From 0d6acf3e5493d3ca0a0d230e8738c54a921ac103 Mon Sep 17 00:00:00 2001 From: NRayya <82588017+NRayya@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:28:44 +0200 Subject: [PATCH 001/137] feat: assign DOIs to collections --- app/Actions/Coconut/AssignDOI.php | 50 +++++++ .../Commands/AssignCollectionsIdentifiers.php | 83 ++++++++++++ app/Console/Commands/AssignDOIs.php | 46 +++++++ app/Models/Collection.php | 1 + app/Models/HasDOI.php | 114 ++++++++++++++++ app/Providers/DOIServiceProvider.php | 24 ++++ app/Services/DOI/DOIService.php | 18 +++ app/Services/DOI/DataCite.php | 126 ++++++++++++++++++ config/app.php | 2 + config/doi.php | 36 +++++ 10 files changed, 500 insertions(+) create mode 100644 app/Actions/Coconut/AssignDOI.php create mode 100644 app/Console/Commands/AssignCollectionsIdentifiers.php create mode 100644 app/Console/Commands/AssignDOIs.php create mode 100644 app/Models/HasDOI.php create mode 100644 app/Providers/DOIServiceProvider.php create mode 100644 app/Services/DOI/DOIService.php create mode 100644 app/Services/DOI/DataCite.php create mode 100644 config/doi.php diff --git a/app/Actions/Coconut/AssignDOI.php b/app/Actions/Coconut/AssignDOI.php new file mode 100644 index 00000000..e074baf7 --- /dev/null +++ b/app/Actions/Coconut/AssignDOI.php @@ -0,0 +1,50 @@ +doiService = $doiService; + } + + /** + * Archive the given model. + * + * @param mixed $model + * @return void + */ + public function assign($model) + { + $collection = null; + if ($model instanceof Collection) { + $collection = $model; + } + if ($collection) { + $collectionIdentifier = $collection->identifier ? $collection->identifier : null; + if ($collectionIdentifier == null) { + $collectionTicker = Ticker::whereType('collection')->first(); + $collectionIdentifier = $collectionTicker->index + 1; + $collectionTicker->index = $collectionIdentifier; + $collectionTicker->save(); + + $collection->identifier = $collectionIdentifier; + $collection->save(); + } + $collection->fresh()->generateDOI($this->doiService); + echo $collection->identifier."\r\n"; + } + } +} diff --git a/app/Console/Commands/AssignCollectionsIdentifiers.php b/app/Console/Commands/AssignCollectionsIdentifiers.php new file mode 100644 index 00000000..579c0a79 --- /dev/null +++ b/app/Console/Commands/AssignCollectionsIdentifiers.php @@ -0,0 +1,83 @@ +fetchLastIndex() + 1; + $data = []; + $this->info('Assigning identifiers to collections'); + Collection::select('identifier', 'id')->where([ + ['identifier', '=', null], + ])->chunk($batchSize, function ($collections) use (&$currentIndex) { + $data = []; + $header = ['id', 'identifier']; + foreach ($collections as $collection) { + if (! $collection->identifier) { + $data[] = array_combine($header, [$collection->id, $this->generateIdentifier($currentIndex)]); + $currentIndex++; + } + } + $this->insertBatch($data); + }); + $this->info('Assigning identifiers to collections: Done'); + } + + public function generateIdentifier($index) + { + return 'CNPC'.str_pad($index, 4, '0', STR_PAD_LEFT); + } + + public function fetchLastIndex() + { + $ticker = Ticker::where('type', 'collection')->first(); + + return (int) $ticker->index; + } + + /** + * Insert a batch of data into the database. + * + * @return void + */ + private function insertBatch(array $data) + { + DB::transaction(function () use ($data) { + foreach ($data as $row) { + Collection::updateorCreate( + [ + 'id' => $row['id'], + ], + [ + 'identifier' => $row['identifier'], + ] + ); + } + }); + } +} diff --git a/app/Console/Commands/AssignDOIs.php b/app/Console/Commands/AssignDOIs.php new file mode 100644 index 00000000..38d20252 --- /dev/null +++ b/app/Console/Commands/AssignDOIs.php @@ -0,0 +1,46 @@ +get(); + + foreach ($collections as $collection) { + // echo $collection->identifier."\r\n"; + $collectionDOI = $collection->doi ? $collection->doi : null; + $assigner->assign($collection); + } + }); + } +} diff --git a/app/Models/Collection.php b/app/Models/Collection.php index f5fa2501..fa6f50de 100644 --- a/app/Models/Collection.php +++ b/app/Models/Collection.php @@ -15,6 +15,7 @@ class Collection extends Model implements Auditable, HasMedia { + use HasDOI; use HasFactory; use HasTags; use InteractsWithMedia; diff --git a/app/Models/HasDOI.php b/app/Models/HasDOI.php new file mode 100644 index 00000000..1f1d6319 --- /dev/null +++ b/app/Models/HasDOI.php @@ -0,0 +1,114 @@ +getIdentifier($this, 'identifier'); + if ($this->doi == null) { + $url = 'https://dev.coconut.naturalproducts.net/collections/'.$identifier; // ToDo: fix collections url + $attributes = $this->getMetadata(); + $attributes['url'] = $url; + $doiResponse = $doiService->createDOI($identifier, $attributes); + $this->doi = $doiResponse['data']['id']; + // $this->datacite_schema = $doiResponse; + $this->save(); + } + + } + + } + + public function getIdentifier($model, $key) + { + return $model->getAttributes()[$key]; + } + + public function getMetadata() + { + $title = $this->title; + $creators = [ + ['name' => 'COCONUT', + 'nameType' => 'Organizational', ], + ]; + $description = [ + 'description' => $this->description, + 'descriptionType' => 'Other', + ]; + $relatedIdentifiers = [ + [ + 'relatedIdentifier' => $this->url, + 'relatedIdentifierType' => 'URL', + 'relationType' => 'References', + ], + ]; + $dates = [ + [ + 'date' => $this->created_at, + 'dateType' => 'Available', + ], + [ + 'date' => $this->created_at, + 'dateType' => 'Submitted', + ], + [ + 'date' => $this->updated_at, + 'dateType' => 'Updated', + ], + ]; + + $rights = [ + [ + 'rights' => 'Creative Commons Attribution 4.0 International', + 'rightsUri' => 'https://creativecommons.org/licenses/by/4.0/legalcode', + 'rightsIdentifier' => 'CC-BY-4.0', + 'rightsIdentifierScheme' => 'SPDX', + 'schemeUri' => 'https://spdx.org/licenses/', + ], + ]; + $publicationYear = explode('-', $this->created_at)[0]; + $subjects = [ + ['subject' => 'Natural Product', + 'subjectScheme' => 'NCI Thesaurus OBO Edition', + 'schemeURI' => 'http://purl.obolibrary.org/obo/ncit/releases/2022-08-19/ncit.owl', + 'valueURI' => 'http://purl.obolibrary.org/obo/NCIT_C66892', + 'classificationCode' => 'NCIT:C66892', + ], + ]; + $attributes = [ + 'creators' => $creators, + 'titles' => [ + [ + 'title' => $title, + ], + ], + 'dates' => $dates, + 'language' => 'en', + 'rightsList' => $rights, + 'descriptions' => [$description], + 'relatedIdentifiers' => $relatedIdentifiers, + 'resourceType' => 'Collection', + 'resourceTypeGeneral' => 'Collection', + 'publicationYear' => $publicationYear, + 'subjects' => $subjects, + 'types' => [ + 'ris' => 'DATA', + 'bibtex' => 'misc', + 'schemaOrg' => 'Collection', + 'resourceType' => 'Collection', + 'resourceTypeGeneral' => 'Collection', + ], + 'isActive' => true, + 'event' => 'publish', + 'state' => 'findable', + 'schemaVersion' => 'http://datacite.org/schema/kernel-4', + + ]; + + return $attributes; + } +} diff --git a/app/Providers/DOIServiceProvider.php b/app/Providers/DOIServiceProvider.php new file mode 100644 index 00000000..39d981db --- /dev/null +++ b/app/Providers/DOIServiceProvider.php @@ -0,0 +1,24 @@ +app->bind(DOIService::class, function ($app) { + return match (config('doi.default')) { + 'datacite' => new DataCite + }; + }); + } +} diff --git a/app/Services/DOI/DOIService.php b/app/Services/DOI/DOIService.php new file mode 100644 index 00000000..27a37b7f --- /dev/null +++ b/app/Services/DOI/DOIService.php @@ -0,0 +1,18 @@ +client = new Client([ + 'base_uri' => Config::get('doi.'.Config::get('doi.default').'.endpoint'), + 'auth' => [Config::get('doi.'.Config::get('doi.default').'.username'), Config::get('doi.'.Config::get('doi.default').'.secret')], + 'headers' => [ + 'Accept' => 'application/vnd.api+json', + ], + ]); + $this->prefix = Config::get('doi.'.Config::get('doi.default').'.prefix'); + } + + /** + * Returns a list of DOIs + */ + public function getDOIs() + { + $prefix = Config::get('doi.'.Config::get('doi.default').'.prefix'); + $response = $this->client->get('/dois?prefix='.$prefix); + + return $response->getBody(); + } + + public function getDOI($doi) + { + $response = $this->client->get('/dois/'.urlencode($doi)); + + return $response->getBody(); + } + + public function createDOI($identifier, $metadata = []) + { + $doi = $this->prefix.'/'.Config::get('app.name').'.'.$identifier; + echo $doi; + $url = 'https://dev.coconut.naturalproducts.net/collections/'.$identifier; + echo $url; + $suffix = Config::get('app.name').'.'.$identifier; + echo $suffix; + $attributes = [ + 'doi' => $this->prefix.'/'.Config::get('app.name').'.'.$identifier, + 'prefix' => $this->prefix, + 'suffix' => Config::get('app.name').'.'.$identifier, + 'publisher' => Config::get('app.name'), + 'publicationYear' => now()->format('Y'), + 'language' => 'en', + ]; + + foreach ($metadata as $key => $value) { + $attributes[$key] = $value; + } + + $body = [ + 'data' => [ + 'type' => 'dois', + 'attributes' => $attributes, + ], + ]; + + dd(json_encode($body)); + // dd($body); + + $response = $this->client->post('/dois', + [RequestOptions::JSON => $body] + ); + + $stream = $response->getBody(); + $contents = $stream->getContents(); + + return json_decode($contents, true); + } + + /** + * Update DataCite metadata based on DOI + * + * @param string $doi + * @param array $metadata + * @return array $contents + */ + public function updateDOI($doi, $metadata = []) + { + foreach ($metadata as $key => $value) { + $attributes[$key] = $value; + } + + $body = [ + 'data' => [ + 'type' => 'dois', + 'attributes' => $attributes, + ], + ]; + + $response = $this->client->put('/dois/'.urlencode($doi), + [RequestOptions::JSON => $body] + ); + + $stream = $response->getBody(); + $contents = $stream->getContents(); + $contents = json_decode($contents, true); + + return $contents; + } + + public function deleteDOI($doi) + { + $response = $this->client->delete('/dois/'.urlencode($doi)); + + return $response->getBody(); + } + + public function getDOIActivity($doi) + { + $response = $this->client->get('/dois/'.urlencode($doi).'/activities'); + + return $response->getBody(); + } +} diff --git a/config/app.php b/config/app.php index 0968d310..3acfe4a8 100644 --- a/config/app.php +++ b/config/app.php @@ -177,6 +177,8 @@ Spatie\Permission\PermissionServiceProvider::class, OwenIt\Auditing\AuditingServiceProvider::class, App\Providers\RestDocumentationServiceProvider::class, + App\Providers\DOIServiceProvider::class, + ])->toArray(), /* diff --git a/config/doi.php b/config/doi.php new file mode 100644 index 00000000..4855e6f3 --- /dev/null +++ b/config/doi.php @@ -0,0 +1,36 @@ + env('DOI_PROVIDER', 'datacite'), + + /* + |-------------------------------------------------------------------------- + | DataCite Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'datacite' => [ + 'username' => env('DATACITE_USERNAME'), + 'secret' => env('DATACITE_SECRET'), + 'prefix' => env('DATACITE_PREFIX'), + 'endpoint' => env('DATACITE_ENDPOINT', 'api.test.datacite.org'), + 'contributor_types' => env('DATACITE_CONTRIBUTOR_TYPE', ['ContactPerson', 'DataCollector', 'DataCurator', 'DataManager', 'Distributor', 'Editor', 'HostingInstitution', 'Producer', 'ProjectLeader', 'ProjectManager', 'ProjectMember', 'RegistrationAgency', 'RegistrationAuthority', 'RelatedPerson', 'Researcher', 'ResearchGroup', 'RightsHolder', 'Sponsor', 'Supervisor', 'WorkPackageLeader', 'Other']), + ], + +]; From d0652b3a2b88145909704709afe4f2fd79a14f10 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:08:04 +0200 Subject: [PATCH 002/137] fix: added repository --- resources/dc-ops/production/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/dc-ops/production/Dockerfile b/resources/dc-ops/production/Dockerfile index 6670f457..532d075d 100755 --- a/resources/dc-ops/production/Dockerfile +++ b/resources/dc-ops/production/Dockerfile @@ -27,7 +27,8 @@ RUN apt-get update && apt-get install -y \ libgd-dev \ libpq-dev -RUN apt-get update \ +RUN add-apt-repository ppa:ondrej/php \ + apt-get update \ && mkdir -p /etc/apt/keyrings \ && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils librsvg2-bin fswatch \ && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ From a0c8dd83f68e44a8e180d845550101e2a19b505e Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:11:18 +0200 Subject: [PATCH 003/137] fix: added missing command --- resources/dc-ops/production/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/dc-ops/production/Dockerfile b/resources/dc-ops/production/Dockerfile index 532d075d..df86bd4d 100755 --- a/resources/dc-ops/production/Dockerfile +++ b/resources/dc-ops/production/Dockerfile @@ -27,8 +27,9 @@ RUN apt-get update && apt-get install -y \ libgd-dev \ libpq-dev -RUN add-apt-repository ppa:ondrej/php \ - apt-get update \ +RUN apt-get update \ + && apt-get install software-properties-common \ + && add-apt-repository ppa:ondrej/php \ && mkdir -p /etc/apt/keyrings \ && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils librsvg2-bin fswatch \ && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ From 2f5321994a4dfc22d31bf2c0ada08649637ed6eb Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:12:19 +0200 Subject: [PATCH 004/137] fix: added yes flag to install commands --- resources/dc-ops/production/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/dc-ops/production/Dockerfile b/resources/dc-ops/production/Dockerfile index df86bd4d..15893ec0 100755 --- a/resources/dc-ops/production/Dockerfile +++ b/resources/dc-ops/production/Dockerfile @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y \ libpq-dev RUN apt-get update \ - && apt-get install software-properties-common \ + && apt-get install -y software-properties-common \ && add-apt-repository ppa:ondrej/php \ && mkdir -p /etc/apt/keyrings \ && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils librsvg2-bin fswatch \ From 56433df96c328226b49b9d4e51676f5883baf966 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:13:57 +0200 Subject: [PATCH 005/137] fix: AttributeError: 'NoneType' object has no attribute 'people' fix --- resources/dc-ops/production/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/dc-ops/production/Dockerfile b/resources/dc-ops/production/Dockerfile index 15893ec0..f0ac1717 100755 --- a/resources/dc-ops/production/Dockerfile +++ b/resources/dc-ops/production/Dockerfile @@ -32,6 +32,7 @@ RUN apt-get update \ && add-apt-repository ppa:ondrej/php \ && mkdir -p /etc/apt/keyrings \ && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils librsvg2-bin fswatch \ + && apt-get install python3-launchpadlib \ && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ && echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ && apt-get update \ From f46711ec4dd9b0fd08306c0b4c4c210f464226d9 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:19:06 +0200 Subject: [PATCH 006/137] fix: added required libs --- resources/dc-ops/production/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/dc-ops/production/Dockerfile b/resources/dc-ops/production/Dockerfile index f0ac1717..6cc67c4b 100755 --- a/resources/dc-ops/production/Dockerfile +++ b/resources/dc-ops/production/Dockerfile @@ -29,9 +29,10 @@ RUN apt-get update && apt-get install -y \ RUN apt-get update \ && apt-get install -y software-properties-common \ + && apt-get install -y python3-launchpadlib \ && add-apt-repository ppa:ondrej/php \ && mkdir -p /etc/apt/keyrings \ - && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils librsvg2-bin fswatch \ + && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils python2 librsvg2-bin fswatch \ && apt-get install python3-launchpadlib \ && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ && echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ From 668d489fb5bef4e444056013bba060477de8ab43 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:20:42 +0200 Subject: [PATCH 007/137] fix: removed python2 to resolve Package 'python2' has no installation candidate --- resources/dc-ops/production/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/dc-ops/production/Dockerfile b/resources/dc-ops/production/Dockerfile index 6cc67c4b..5eb4d832 100755 --- a/resources/dc-ops/production/Dockerfile +++ b/resources/dc-ops/production/Dockerfile @@ -32,7 +32,7 @@ RUN apt-get update \ && apt-get install -y python3-launchpadlib \ && add-apt-repository ppa:ondrej/php \ && mkdir -p /etc/apt/keyrings \ - && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils python2 librsvg2-bin fswatch \ + && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils librsvg2-bin fswatch \ && apt-get install python3-launchpadlib \ && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ && echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ From 996baa4cd7f6c81bf864e5b3d556e3ca01701d03 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:24:32 +0200 Subject: [PATCH 008/137] fix: enabled php redis --- resources/dc-ops/production/Dockerfile | 124 +++++++++---------------- 1 file changed, 45 insertions(+), 79 deletions(-) diff --git a/resources/dc-ops/production/Dockerfile b/resources/dc-ops/production/Dockerfile index 5eb4d832..9f9bd19c 100755 --- a/resources/dc-ops/production/Dockerfile +++ b/resources/dc-ops/production/Dockerfile @@ -1,8 +1,5 @@ FROM php:8.3-fpm -# Copy composer.lock and composer.json -COPY composer.lock composer.json /var/www/ - # Set working directory WORKDIR /var/www @@ -25,97 +22,66 @@ RUN apt-get update && apt-get install -y \ libzip-dev \ libicu-dev \ libgd-dev \ - libpq-dev - -RUN apt-get update \ - && apt-get install -y software-properties-common \ - && apt-get install -y python3-launchpadlib \ - && add-apt-repository ppa:ondrej/php \ - && mkdir -p /etc/apt/keyrings \ - && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev dnsutils librsvg2-bin fswatch \ - && apt-get install python3-launchpadlib \ - && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ - && echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ - && apt-get update \ - && apt-get install -y php8.3-cli php8.3-dev \ - php8.3-pgsql php8.3-sqlite3 php8.3-gd \ - php8.3-curl \ - php8.3-imap php8.3-mysql php8.3-mbstring \ - php8.3-xml php8.3-zip php8.3-bcmath php8.3-soap \ - php8.3-intl php8.3-readline \ - php8.3-ldap \ - php8.3-msgpack php8.3-igbinary php8.3-redis php8.3-swoole \ - php8.3-memcached php8.3-pcov php8.3-imagick php8.3-xdebug \ - && curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \ - && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ - && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ - && apt-get update \ + libpq-dev \ + gnupg \ + gosu \ + curl \ + ca-certificates \ + supervisor \ + sqlite3 \ + libcap2-bin \ + dnsutils \ + librsvg2-bin \ + fswatch \ + software-properties-common \ + libmagickwand-dev + +# Install Redis extension using PECL +RUN pecl install redis && docker-php-ext-enable redis + +# Install Node.js and Yarn +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs \ - && npm install -g npm \ - && npm install -g pnpm \ - && npm install -g bun \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \ + && npm install -g npm pnpm bun \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor -o /etc/apt/keyrings/yarn.gpg \ && echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ - && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/dev/null \ - && echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ - && apt-get update \ - && apt-get install -y yarn \ - && apt-get install -y mysql-client \ - && apt-get install -y postgresql-client-$POSTGRES_VERSION \ - && apt-get -y autoremove \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Install imagick -RUN apt-get update && apt-get install -y --no-install-recommends \ - libmagickwand-dev && \ - git clone https://github.com/Imagick/imagick.git --depth 1 /tmp/imagick && \ - cd /tmp/imagick && \ - phpize && \ - ./configure && \ - make && \ - make install && \ - docker-php-ext-enable imagick && \ - apt-get purge -y --auto-remove git && \ - rm -rf /var/lib/apt/lists/* /tmp/imagick - -# Clear cache -RUN apt-get clean && rm -rf /var/lib/apt/lists/* - -# Install extensions -RUN docker-php-ext-configure pgsql --with-pgsql=/usr/include/postgresql/ -RUN docker-php-ext-install pdo pdo_mysql pdo_pgsql pgsql mbstring zip exif pcntl -RUN docker-php-ext-configure gd --with-external-gd -RUN docker-php-ext-install gd -RUN docker-php-ext-configure intl -RUN docker-php-ext-install intl -RUN docker-php-ext-install bcmath + && apt-get update && apt-get install -y yarn +# Install PostgreSQL client +RUN curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/keyrings/pgdg.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ + && apt-get update && apt-get install -y postgresql-client-$POSTGRES_VERSION -RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get install -y nodejs +# Install and configure PHP extensions +RUN docker-php-ext-configure pgsql --with-pgsql=/usr/include/postgresql/ \ + && docker-php-ext-install pdo pdo_mysql pdo_pgsql pgsql mbstring zip exif pcntl \ + && docker-php-ext-configure gd --with-external-gd && docker-php-ext-install gd \ + && docker-php-ext-configure intl && docker-php-ext-install intl \ + && docker-php-ext-install bcmath -# Install composer +# Install Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Add user for laravel application -RUN groupadd -g 1000 www -RUN useradd -u 1000 -ms /bin/bash -g www www +RUN groupadd -g 1000 www \ + && useradd -u 1000 -ms /bin/bash -g www www # Copy existing application directory contents COPY . /var/www -RUN composer install --optimize-autoloader --no-scripts --prefer-dist -RUN npm ci -RUN npm run build - -# Copy existing application directory permissions -COPY --chown=www:www . /var/www +# Set proper permissions +RUN chown -R www:www /var/www -# Change current user to www +# Switch to the www user USER www +# Install PHP dependencies using Composer +RUN composer install --optimize-autoloader --no-scripts --prefer-dist + +# Install Node.js dependencies and build assets +RUN npm ci && npm run build + # Expose port 9000 and start php-fpm server EXPOSE 9000 -CMD ["php-fpm"] \ No newline at end of file +CMD ["php-fpm"] From 275330bbd7f251f988b7767c6eb857cd8d125c88 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 11:34:40 +0200 Subject: [PATCH 009/137] fix: removed rename --- .../migrations/2024_08_14_150749_rename_organism_parts_table.php | 1 - 1 file changed, 1 deletion(-) diff --git a/database/migrations/2024_08_14_150749_rename_organism_parts_table.php b/database/migrations/2024_08_14_150749_rename_organism_parts_table.php index f6069e85..8edc4ad8 100644 --- a/database/migrations/2024_08_14_150749_rename_organism_parts_table.php +++ b/database/migrations/2024_08_14_150749_rename_organism_parts_table.php @@ -15,7 +15,6 @@ public function up(): void Schema::table('sample_locations', function (Blueprint $table) { $table->string('collection_ids')->nullable(); $table->integer('molecule_count')->nullable(); - $table->renameColumn('ontology', 'iri'); $table->string('iri')->nullable()->change(); }); Schema::table('molecule_organism', function (Blueprint $table) { From e10f10937a0e78560a62e4e2dc30d9b37f475ffd Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 12:24:20 +0200 Subject: [PATCH 010/137] fix: added missing media drop --- .../migrations/2024_06_28_121942_create_media_table.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/database/migrations/2024_06_28_121942_create_media_table.php b/database/migrations/2024_06_28_121942_create_media_table.php index 47a4be98..fc7f9650 100644 --- a/database/migrations/2024_06_28_121942_create_media_table.php +++ b/database/migrations/2024_06_28_121942_create_media_table.php @@ -29,4 +29,12 @@ public function up(): void $table->nullableTimestamps(); }); } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('media'); + } }; From b03eae89bf8c0752f7b5037067f1cb8985908f4c Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Thu, 12 Sep 2024 16:40:20 +0200 Subject: [PATCH 011/137] fix: DOI issue fixed --- app/Console/Commands/AssignCollectionsIdentifiers.php | 4 +++- app/Services/DOI/DataCite.php | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/AssignCollectionsIdentifiers.php b/app/Console/Commands/AssignCollectionsIdentifiers.php index d2148355..64e7a71d 100644 --- a/app/Console/Commands/AssignCollectionsIdentifiers.php +++ b/app/Console/Commands/AssignCollectionsIdentifiers.php @@ -50,9 +50,11 @@ public function handle() public function generateIdentifier($index) { - return 'CNPC'.str_pad($index, 4, '0', STR_PAD_LEFT); + $prefix = (env('APP_ENV') === 'production') ? 'CNPC' : 'CNPC_DEV'; + return $prefix . str_pad($index, 6, '0', STR_PAD_LEFT); } + public function fetchLastIndex() { $ticker = Ticker::where('type', 'collection')->first(); diff --git a/app/Services/DOI/DataCite.php b/app/Services/DOI/DataCite.php index 4d9f1dde..db6d7a3f 100644 --- a/app/Services/DOI/DataCite.php +++ b/app/Services/DOI/DataCite.php @@ -41,11 +41,8 @@ public function getDOI($doi) public function createDOI($identifier, $metadata = []) { $doi = $this->prefix.'/'.Config::get('app.name').'.'.$identifier; - echo $doi; - $url = 'https://dev.coconut.naturalproducts.net/collections/'.$identifier; - echo $url; + $url = 'https://coconut.naturalproducts.net/collections/'.$identifier; $suffix = Config::get('app.name').'.'.$identifier; - echo $suffix; $attributes = [ 'doi' => $this->prefix.'/'.Config::get('app.name').'.'.$identifier, 'prefix' => $this->prefix, @@ -66,9 +63,6 @@ public function createDOI($identifier, $metadata = []) ], ]; - dd(json_encode($body)); - // dd($body); - $response = $this->client->post('/dois', [RequestOptions::JSON => $body] ); From 2a5c5f5f2e51d14515292da0a0ff91348d5fee0f Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 18 Sep 2024 02:00:13 +0200 Subject: [PATCH 012/137] wip: suggested changes are now stored in the reports table. SQL queries need to be built at the time of approving the report --- app/Actions/Coconut/SearchMolecule.php | 1 - .../Commands/OrganismDedupeOptions.php | 2 - .../Dashboard/Resources/CitationResource.php | 88 +------ .../Resources/CollectionResource.php | 3 - .../Resources/GeoLocationResource.php | 7 +- .../Dashboard/Resources/OrganismResource.php | 99 +------- .../MoleculesRelationManager.php | 45 +++- .../Dashboard/Resources/ReportResource.php | 232 +++++++++++++++++- .../ReportResource/Pages/CreateReport.php | 9 + app/Http/Controllers/API/SearchController.php | 4 - app/Models/Citation.php | 96 ++++++++ app/Models/GeoLocation.php | 15 ++ app/Models/Organism.php | 105 ++++++++ app/Models/Report.php | 7 +- docs/.vitepress/config.mts | 42 ++-- docs/analysis.md | 3 - docs/curation.md | 27 ++ docs/data-contributors.md | 18 ++ docs/developers.md | 9 + docs/steering-committee.md | 45 ++++ 20 files changed, 621 insertions(+), 236 deletions(-) create mode 100644 docs/data-contributors.md create mode 100644 docs/developers.md create mode 100644 docs/steering-committee.md diff --git a/app/Actions/Coconut/SearchMolecule.php b/app/Actions/Coconut/SearchMolecule.php index 9198fb21..c5ee90ad 100644 --- a/app/Actions/Coconut/SearchMolecule.php +++ b/app/Actions/Coconut/SearchMolecule.php @@ -350,7 +350,6 @@ private function executeQuery($statement) $ids_array = collect($hits)->pluck('id')->toArray(); $ids = implode(',', $ids_array); - // dd($ids); if ($ids != '') { diff --git a/app/Console/Commands/OrganismDedupeOptions.php b/app/Console/Commands/OrganismDedupeOptions.php index 1abe945c..ce32649d 100644 --- a/app/Console/Commands/OrganismDedupeOptions.php +++ b/app/Console/Commands/OrganismDedupeOptions.php @@ -74,8 +74,6 @@ public function handle() array_unshift($choices, 'Skip'); - // dd($choices); - $retainValue = select( 'Select the record you want to retain:', $choices diff --git a/app/Filament/Dashboard/Resources/CitationResource.php b/app/Filament/Dashboard/Resources/CitationResource.php index 00776312..28ee9b40 100644 --- a/app/Filament/Dashboard/Resources/CitationResource.php +++ b/app/Filament/Dashboard/Resources/CitationResource.php @@ -6,18 +6,12 @@ use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\CollectionRelationManager; use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\MoleculeRelationManager; use App\Models\Citation; -use Closure; -use Filament\Forms\Components\Section; -use Filament\Forms\Components\Textarea; -use Filament\Forms\Components\TextInput; use Filament\Forms\Form; -use Filament\Forms\Get; use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; use Illuminate\Support\Facades\Cache; -use Illuminate\Support\HtmlString; use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager; class CitationResource extends Resource @@ -35,87 +29,7 @@ class CitationResource extends Resource public static function form(Form $form): Form { return $form - ->schema([ - Section::make() - ->schema([ - TextInput::make('failMessage') - ->default('') - ->hidden() - ->disabled(), - TextInput::make('doi') - ->label('DOI') - ->live(onBlur: true) - ->afterStateUpdated(function ($set, $state) { - if (doiRegxMatch($state)) { - $citationDetails = fetchDOICitation($state); - if ($citationDetails) { - $set('title', $citationDetails['title']); - $set('authors', $citationDetails['authors']); - $set('citation_text', $citationDetails['citation_text']); - $set('failMessage', 'Success'); - } else { - $set('failMessage', 'No citation found. Please fill in the details manually'); - } - } else { - $set('failMessage', 'Invalid DOI'); - } - }) - ->helperText(function ($get) { - - if ($get('failMessage') == 'Fetching') { - return new HtmlString(' - - - '); - } elseif ($get('failMessage') != 'Success') { - return new HtmlString(''.$get('failMessage').''); - } else { - return null; - } - }) - ->required() - ->unique() - ->rules([ - fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { - if ($get('failMessage') != 'No citation found. Please fill in the details manually') { - $fail($get('failMessage')); - } - }, - ]) - ->validationMessages([ - 'unique' => 'The DOI already exists.', - ]), - ]), - - Section::make() - ->schema([ - TextInput::make('title') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - TextInput::make('authors') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - Textarea::make('citation_text') - ->label('Citation text / URL') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - ])->columns(1), - ]); + ->schema(Citation::getForm()); } public static function table(Table $table): Table diff --git a/app/Filament/Dashboard/Resources/CollectionResource.php b/app/Filament/Dashboard/Resources/CollectionResource.php index 500fe6cb..72d72403 100644 --- a/app/Filament/Dashboard/Resources/CollectionResource.php +++ b/app/Filament/Dashboard/Resources/CollectionResource.php @@ -131,9 +131,6 @@ public static function table(Table $table): Table public static function getRelations(): array { - // $record = static::getOwner(); - // dd(static::getOwner()); - // dd(static::$model::molecules()->get()); $arr = [ EntriesRelationManager::class, CitationsRelationManager::class, diff --git a/app/Filament/Dashboard/Resources/GeoLocationResource.php b/app/Filament/Dashboard/Resources/GeoLocationResource.php index 9288ff9c..2e96fcb7 100644 --- a/app/Filament/Dashboard/Resources/GeoLocationResource.php +++ b/app/Filament/Dashboard/Resources/GeoLocationResource.php @@ -5,7 +5,6 @@ use App\Filament\Dashboard\Resources\GeoLocationResource\Pages; use App\Filament\Dashboard\Resources\GeoLocationResource\Widgets\GeoLocationStats; use App\Models\GeoLocation; -use Filament\Forms\Components\TextInput; use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; @@ -26,11 +25,7 @@ class GeoLocationResource extends Resource public static function form(Form $form): Form { return $form - ->schema([ - TextInput::make('name') - ->required() - ->maxLength(255), - ]); + ->schema(GeoLocation::getForm()); } public static function table(Table $table): Table diff --git a/app/Filament/Dashboard/Resources/OrganismResource.php b/app/Filament/Dashboard/Resources/OrganismResource.php index 2f162e54..9624a38e 100644 --- a/app/Filament/Dashboard/Resources/OrganismResource.php +++ b/app/Filament/Dashboard/Resources/OrganismResource.php @@ -9,8 +9,6 @@ use App\Forms\Components\OrganismsTable; use App\Models\Organism; use Archilex\AdvancedTables\Filters\AdvancedFilter; -use Filament\Forms; -use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Grid; use Filament\Forms\Components\Group; use Filament\Forms\Components\Section; @@ -43,102 +41,9 @@ public static function form(Form $form): Form Group::make() ->schema([ Section::make('') - ->schema([ - Forms\Components\TextInput::make('name') - ->required() - ->unique() - ->maxLength(255) - ->suffixAction( - Action::make('infoFromSources') - ->icon('heroicon-m-clipboard') - // ->fillForm(function ($record, callable $get): array { - // $entered_name = $get('name'); - // $name = ucfirst(trim($entered_name)); - // $data = null; - // $iri = null; - // $organism = null; - // $rank = null; - - // if ($name && $name != '') { - // $data = Self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - // } - // return [ - // 'name' => $name, - // 'iri' => $iri, - // 'rank' => $rank, - // ]; - // }) - // ->form([ - // Forms\Components\TextInput::make('name')->readOnly(), - // Forms\Components\TextInput::make('iri')->readOnly(), - // Forms\Components\TextInput::make('rank')->readOnly(), - // ]) - // ->action(fn ( $record) => $record->advance()) - ->modalContent(function ($record, $get): View { - $name = ucfirst(trim($get('name'))); - $data = null; - // $iri = null; - // $organism = null; - // $rank = null; - - if ($name && $name != '') { - $data = self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - } - - return view( - 'forms.components.organism-info', - [ - 'data' => $data, - ], - ); - }) - ->action(function (array $data, Organism $record): void { - // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); - }) - ->slideOver() - ), - Forms\Components\TextInput::make('iri') - ->label('IRI') - ->maxLength(255), - Forms\Components\TextInput::make('rank') - ->maxLength(255), - ]), + ->schema(Organism::getForm()), ]) ->columnSpan(1), - Group::make() ->schema([ Section::make('') @@ -254,7 +159,6 @@ protected static function getGNFMatches($name, $organism) $responseBody = json_decode($response->getBody(), true); return $responseBody; - // dd($responseBody); // if (isset($responseBody['names']) && count($responseBody['names']) > 0) { // $r_name = $responseBody['names'][0]; @@ -293,7 +197,6 @@ protected static function getGNFMatches($name, $organism) protected static function updateOrganismModel($name, $iri, $organism = null, $rank = null) { - // dd($name, $iri, $organism, $rank); if (! $organism) { $organism = Organism::where('name', $name)->first(); } diff --git a/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php b/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php index fc5845e8..c754721f 100644 --- a/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php +++ b/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php @@ -160,13 +160,48 @@ public function table(Table $table): Table } $newOrganism = Organism::findOrFail($data['org_id']); - $locations = $livewire->mountedTableBulkActionData['locations']; - if ($locations) { - $sampleLocations = SampleLocation::findOrFail($locations); - foreach ($sampleLocations as $location) { - $location->auditSyncWithoutDetaching('molecules', $moleculeIds); + // Get the NEW sample locations + $new_form_sample_locations = $livewire->mountedTableBulkActionData['locations']; + if ($new_form_sample_locations) { + $new_sample_locations = SampleLocation::findOrFail($new_form_sample_locations); + } + + // Get the CURRENT organism + $currentOrganism = $this->getOwnerRecord(); + + // Handling Molecules with only ONE location + // Detach Molecules with only ONE location from CURRENT Organism + if ($molecule_ids_with_one_location) { + $molecule_with_one_location = $records->whereIn('id', $molecule_ids_with_one_location); + $currentOrganism->auditDetach('molecules', $molecule_ids_with_one_location); + + // Detach molecules with only ONE location from CURRENT Sample Locations + foreach ($molecule_with_one_location as $record) { + $current_sample_locations = $record->sampleLocations()->where('organism_id', $this->getOwnerRecord()->id)->get(); + foreach ($current_sample_locations as $location) { + $location->auditDetach('molecules', $record->id); + } } } + + // Handling Molecules with MULTIPLE locations + // Detach molecules from Sample Locations + foreach ($molecues_with_muliple_locations as $molecule) { + $current_sample_locations_subset = SampleLocation::findOrFail($molecule['sampleLocations']); + $current_sample_locations_multiple = $records->where('id', $molecule['id'])[0]->sampleLocations()->where('organism_id', $this->getOwnerRecord()->id)->get(); + if ($current_sample_locations_multiple->pluck('id') == $current_sample_locations_subset->pluck('id')) { + $currentOrganism->auditDetach('molecules', $molecule['id']); + } + foreach ($current_sample_locations_subset as $location) { + $location->auditDetach('molecules', $molecule['id']); + customAuditLog('re-assign', [$records->find($molecule['id'])], 'sampleLocations', $current_sample_locations_subset, $new_sample_locations); + } + } + + foreach ($new_sample_locations as $location) { + $location->auditSyncWithoutDetaching('molecules', $moleculeIds); + // customAuditLog('cust_sync', $records, 'sampleLocations', [], $location); + } $newOrganism->auditSyncWithoutDetaching('molecules', $moleculeIds); $currentOrganism->refresh(); diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index a26e7ad1..97997f4e 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -5,15 +5,20 @@ use App\Filament\Dashboard\Resources\ReportResource\Pages; use App\Filament\Dashboard\Resources\ReportResource\RelationManagers; use App\Models\Citation; +use App\Models\GeoLocation; use App\Models\Molecule; +use App\Models\Organism; use App\Models\Report; use Archilex\AdvancedTables\Filters\AdvancedFilter; use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Grid; use Filament\Forms\Components\KeyValue; +use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; use Filament\Forms\Components\SpatieTagsInput; +use Filament\Forms\Components\Tabs; +use Filament\Forms\Components\TagsInput; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\ToggleButtons; @@ -125,11 +130,228 @@ public static function form(Form $form): Form ->hidden(function (Get $get) { return $get('is_change'); }), - KeyValue::make('suggested_changes') - ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') - ->addActionLabel('Add property') - ->keyLabel('Property') - ->valueLabel('Suggested change') + // KeyValue::make('suggested_changes') + // ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') + // ->addActionLabel('Add property') + // ->keyLabel('Property') + // ->valueLabel('Suggested change') + // ->hidden(function (Get $get) { + // return ! $get('is_change'); + // }), + Tabs::make('Tabs') + ->tabs([ + Tabs\Tab::make('organisms_changes') + ->label('Organisms') + ->schema([ + Repeater::make('organisms_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('organisms') + ->label('Organism') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->organisms()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('organisms.name', 'organisms.id')->toArray() ?? []; + }) + ->getOptionLabelUsing(fn ($value): ?string => Organism::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_organism_details') + ->schema(Organism::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + + ]), + Tabs\Tab::make('geo_locations_changes') + ->label('Geo Locations') + ->schema([ + Repeater::make('geo_locations_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('geo_locations') + ->label('Geo Location') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->geo_locations()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('geo_locations.name', 'geo_locations.id')->toArray(); + }) + ->getOptionLabelUsing(fn ($value): ?string => GeoLocation::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_geo_locations_details') + ->schema(GeoLocation::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('synonyms') + ->label('Synonyms') + ->schema([ + Repeater::make('synonyms_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('synonyms') + ->label('Synonym') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + $synonyms = Molecule::select('synonyms')->where('identifier', $get('../../mol_id_csv'))->get()[0]['synonyms']; + $matched_synonyms = []; + foreach ($synonyms as $synonym) { + str_contains(strtolower($synonym), strtolower($search)) ? array_push($matched_synonyms, $synonym) : null; + } + + return $matched_synonyms; + }) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_synonym_details') + ->schema([ + TagsInput::make('new_synonym') + ->label('New Synonym') + ->separator(',') + ->splitKeys([',']), + ])->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('identifiers') + ->label('Identifiers') + ->schema([ + Repeater::make('identifiers_changes') + ->schema([ + Select::make('identifer_to_change') + ->options([ + 'name' => 'Name', + 'cas' => 'CAS', + ]) + ->default('name') + ->live(), + Select::make('current_Name') + ->options(function (Get $get): array { + return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->name ?? '']; + }) + ->default(0) + ->disabled() + ->hidden(function (Get $get) { + return $get('identifer_to_change') == 'cas'; + }), + Select::make('current_CAS') + ->options(function (Get $get): array { + return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->cas]; + }) + ->default(0) + ->disabled() + ->hidden(function (Get $get) { + return $get('identifer_to_change') == 'name'; + }), + TextInput::make('new_name') + ->label(function (Get $get) { + return $get('identifer_to_change') == 'name' ? 'New Name' : 'New CAS'; + }), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('citations') + ->label('Citations') + ->schema([ + Repeater::make('citations_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('citations') + ->label('Citation') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->citations()->where('title', 'ilike', "%{$search}%")->limit(10)->pluck('citations.title', 'citations.id')->toArray(); + }) + ->getOptionLabelUsing(fn ($value): ?string => Citation::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_citation_details') + ->schema(Citation::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + + ]), + + Tabs\Tab::make('Chemical Classifications') + ->schema([ + // ... + ]), + ]) ->hidden(function (Get $get) { return ! $get('is_change'); }), diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 937c3131..2878f2c6 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -67,6 +67,15 @@ protected function mutateFormDataBeforeCreate(array $data): array $data['user_id'] = auth()->id(); $data['status'] = 'submitted'; + $suggested_changes = []; + $suggested_changes['organisms_changes'] = $data['organisms_changes']; + $suggested_changes['geo_locations_changes'] = $data['geo_locations_changes']; + $suggested_changes['synonyms_changes'] = $data['synonyms_changes']; + $suggested_changes['identifiers_changes'] = $data['identifiers_changes']; + $suggested_changes['citations_changes'] = $data['citations_changes']; + + $data['suggested_changes'] = $suggested_changes; + return $data; } diff --git a/app/Http/Controllers/API/SearchController.php b/app/Http/Controllers/API/SearchController.php index 8cd31eb8..2a21f544 100644 --- a/app/Http/Controllers/API/SearchController.php +++ b/app/Http/Controllers/API/SearchController.php @@ -19,8 +19,6 @@ public function search(Request $request) $queryType = 'text'; $results = []; - //dd($request); - $limit = $request->query('limit'); $sort = $request->query('sort'); $limit = $limit ? $limit : 24; @@ -218,7 +216,6 @@ public function search(Request $request) $statement = $statement.')'; } $statement = $statement.' LIMIT '.$limit; - // dd($statement ); } else { if ($query) { $query = str_replace("'", "''", $query); @@ -289,7 +286,6 @@ public function search(Request $request) $page ); - //dd($pagination); return $pagination; } catch (QueryException $exception) { $message = $exception->getMessage(); diff --git a/app/Models/Citation.php b/app/Models/Citation.php index 8ee2f9ff..94542b75 100644 --- a/app/Models/Citation.php +++ b/app/Models/Citation.php @@ -2,9 +2,15 @@ namespace App\Models; +use Closure; +use Filament\Forms\Components\Section; +use Filament\Forms\Components\Textarea; +use Filament\Forms\Components\TextInput; +use Filament\Forms\Get; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Support\HtmlString; use OwenIt\Auditing\Contracts\Auditable; class Citation extends Model implements Auditable @@ -47,4 +53,94 @@ public function reports(): MorphToMany { return $this->morphToMany(Report::class, 'reportable'); } + + public function transformAudit(array $data): array + { + return changeAudit($data); + } + + public static function getForm() + { + return [ + Section::make() + ->schema([ + TextInput::make('failMessage') + ->default('') + ->hidden() + ->disabled(), + TextInput::make('doi') + ->label('DOI') + ->live(onBlur: true) + ->afterStateUpdated(function ($set, $state) { + if (doiRegxMatch($state)) { + $citationDetails = fetchDOICitation($state); + if ($citationDetails) { + $set('title', $citationDetails['title']); + $set('authors', $citationDetails['authors']); + $set('citation_text', $citationDetails['citation_text']); + $set('failMessage', 'Success'); + } else { + $set('failMessage', 'No citation found. Please fill in the details manually'); + } + } else { + $set('failMessage', 'Invalid DOI'); + } + }) + ->helperText(function ($get) { + + if ($get('failMessage') == 'Fetching') { + return new HtmlString(' + + + '); + } elseif ($get('failMessage') != 'Success') { + return new HtmlString(''.$get('failMessage').''); + } else { + return null; + } + }) + ->required() + ->unique() + ->rules([ + fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { + if ($get('failMessage') != 'No citation found. Please fill in the details manually') { + $fail($get('failMessage')); + } + }, + ]) + ->validationMessages([ + 'unique' => 'The DOI already exists.', + ]), + ]), + + Section::make() + ->schema([ + TextInput::make('title') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + TextInput::make('authors') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + Textarea::make('citation_text') + ->label('Citation text / URL') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + ])->columns(1), + ]; + } } diff --git a/app/Models/GeoLocation.php b/app/Models/GeoLocation.php index 3686a8d0..28bcd5ef 100644 --- a/app/Models/GeoLocation.php +++ b/app/Models/GeoLocation.php @@ -2,6 +2,7 @@ namespace App\Models; +use Filament\Forms\Components\TextInput; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use OwenIt\Auditing\Contracts\Auditable; @@ -24,4 +25,18 @@ public function molecules() { return $this->belongsToMany(Molecule::class)->withPivot('locations')->withTimestamps(); } + + public function transformAudit(array $data): array + { + return changeAudit($data); + } + + public static function getForm(): array + { + return [ + TextInput::make('name') + ->required() + ->maxLength(255), + ]; + } } diff --git a/app/Models/Organism.php b/app/Models/Organism.php index c2fb8c48..ad4c09ab 100644 --- a/app/Models/Organism.php +++ b/app/Models/Organism.php @@ -2,6 +2,9 @@ namespace App\Models; +use Filament\Forms; +use Filament\Forms\Components\Actions\Action; +use Illuminate\Contracts\View\View; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -46,4 +49,106 @@ public function getIriAttribute($value) { return urldecode($value); } + + public function transformAudit(array $data): array + { + return changeAudit($data); + } + + public static function getForm(): array + { + return [ + Forms\Components\TextInput::make('name') + ->required() + ->unique(Organism::class, 'name') + ->maxLength(255) + ->suffixAction( + Action::make('infoFromSources') + ->icon('heroicon-m-clipboard') + // ->fillForm(function ($record, callable $get): array { + // $entered_name = $get('name'); + // $name = ucfirst(trim($entered_name)); + // $data = null; + // $iri = null; + // $organism = null; + // $rank = null; + + // if ($name && $name != '') { + // $data = Self::getOLSIRI($name, 'species'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'species'); + // Self::info("Mapped and updated: $name"); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // Self::info("Mapped and updated: $name"); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // Self::info("Mapped and updated: $name"); + // } else { + // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // } + // } + // } + // } + // return [ + // 'name' => $name, + // 'iri' => $iri, + // 'rank' => $rank, + // ]; + // }) + // ->form([ + // Forms\Components\TextInput::make('name')->readOnly(), + // Forms\Components\TextInput::make('iri')->readOnly(), + // Forms\Components\TextInput::make('rank')->readOnly(), + // ]) + // ->action(fn ( $record) => $record->advance()) + ->modalContent(function ($record, $get): View { + $name = ucfirst(trim($get('name'))); + $data = null; + // $iri = null; + // $organism = null; + // $rank = null; + + if ($name && $name != '') { + $data = self::getOLSIRI($name, 'species'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'species'); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // } else { + // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // } + // } + // } + } + + return view( + 'forms.components.organism-info', + [ + 'data' => $data, + ], + ); + }) + ->action(function (array $data, Organism $record): void { + // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); + }) + ->slideOver() + ), + Forms\Components\TextInput::make('iri') + ->label('IRI') + ->maxLength(255), + Forms\Components\TextInput::make('rank') + ->maxLength(255), + ]; + } } diff --git a/app/Models/Report.php b/app/Models/Report.php index e4c4cfb9..f2c574af 100644 --- a/app/Models/Report.php +++ b/app/Models/Report.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\States\Report\ReportState; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -38,7 +37,6 @@ class Report extends Model implements Auditable protected $casts = [ 'suggested_changes' => 'array', - // 'status' => ReportState::class, ]; /** @@ -70,6 +68,11 @@ public function organisms(): MorphToMany return $this->morphedByMany(Organism::class, 'reportable'); } + // public function geoLocations(): MorphToMany + // { + // return $this->morphedByMany(Organism::class, 'reportable'); + // } + /** * Get all of the users that are assigned this report. */ diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 432e8c6e..59068233 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -25,7 +25,7 @@ export default defineConfig({ nav: [ { text: 'Home', link: '/introduction' }, - { text: 'API', link: 'https://coconut.cheminf.studio/api-documentation' }, + // { text: 'API', link: 'https://coconut.cheminf.studio/api-documentation' }, { text: 'About', link: 'https://coconut.cheminf.studio/about' }, { text: 'Download', link: 'https://coconut.cheminf.studio/download' } ], @@ -47,19 +47,19 @@ export default defineConfig({ ] }, { - text: 'Curation', + text: 'Downloads', items: [ - { text: 'Analysis', link: '/analysis' }, - { text: 'Reporting', link: '/reporting' }, - { text: 'Audit Trail', link: '/audit-trail' } + { text: 'Data Base', link: '/data-base' }, + { text: 'Versions', link: '/versions' }, + { text: 'Use Cases', link: '/use-cases' }, ] }, { - text: 'Downloads', + text: 'Curation', items: [ - { text: 'Data Base', link: '/data-base' }, - { text: 'Use Cases', link: '/use-cases' }, - { text: 'Versions', link: '/versions' }, + // { text: 'Analysis', link: '/analysis' }, + { text: 'Reporting', link: '/reporting' }, + { text: 'Audit Trail', link: '/audit-trail' } ] }, { @@ -77,16 +77,16 @@ export default defineConfig({ // { text: 'Multiple Compound Submission', link: '/multi-submission' }, ] }, - { - text: 'API', - items: [ - { text: 'Auth', link: '/auth-api' }, - { text: 'Search', link: '/search-api' }, - { text: 'Schemas', link: '/schemas-api' }, - // { text: 'Download', link: '/download-api' }, - // { text: 'Submission', link: '/submission-api' } - ] - }, + // { + // text: 'API', + // items: [ + // { text: 'Auth', link: '/auth-api' }, + // { text: 'Search', link: '/search-api' }, + // { text: 'Schemas', link: '/schemas-api' }, + // { text: 'Download', link: '/download-api' }, + // { text: 'Submission', link: '/submission-api' } + // ] + // }, { text: 'Development', items: [ @@ -97,7 +97,9 @@ export default defineConfig({ { text: 'Contribution', items: [ - { text: 'Contributors and Steering Committee', link: '/contributors' } + { text: 'Steering Committee', link: '/steering-committee' }, + { text: 'Developers', link: '/developers' }, + // { text: 'Data Contributors', link: '/data-contributors' }, ], }, { diff --git a/docs/analysis.md b/docs/analysis.md index 2fc75169..f56140af 100644 --- a/docs/analysis.md +++ b/docs/analysis.md @@ -15,6 +15,3 @@ * Structures that cannot be parsed by the ChEMBL structure curation pipeline (113 in total) have been removed. * Duplicates have been merged into one entry and the highly annotated entry has been made the parent entry, and the remainder is now included in the parent entry. - ## Curation flow chart - - \ No newline at end of file diff --git a/docs/curation.md b/docs/curation.md index 107810b2..b83d3c53 100644 --- a/docs/curation.md +++ b/docs/curation.md @@ -1,5 +1,32 @@ # Curation of COCONUT DB +COCONUT has aggregated NPs data from 63 sources under open source licenses. This data ranged from supplimentary material from published papers to well curated databases under open licenses. It was decided by the Steering Committee that the focus of COCONUT Natural Products database was to provide reliable information on Molecules, Organisms and sample locations within the organisms where these molecules were reported from, and geo-locations where these organisms were reported to be found in literature. In order provide this complete set of information on a compound, wherever it was determined during the curation process that the required information was missing webscraping was utilised. Scraping was also used where source collection data was openly accessible but had no bulk download links. + +Following the above processes and principles, the Original 2021 version of COCONUT aggregated 53 openly accessible Collections. 2024 version of COCONUT expanded its database to include 10 more Collections bringing the total to 63. While gathering this data for the new version, the older 53 collection were revisited to ensure inclusion of updates from these sources. Where the Collections are no more accessible, the data that was used in the 2021 version of COCONUT was left as is. + +The process of aggregation invovled automated pipelines that minimises manual intervention and ensures the data is of highest quality. Initially data from each collection is passed through RDKit pipeline. Any molecules that failed to get parsed by RDKit were eliminated from further processing. The parsed molecules were then kept as CSV files with all the data provided by the sources. These CSV files are then loaded into COCONUT database preserving the data to trace it back the source. Now, to establish that the chemical structure are valid, ChEMBL pipeline (ChEMBL Structure Curation Pipeline Checker) was used. Any molecules marked with an error code of 6 or higer are marked as rejected and kept for future reference (COCONUT provides tools to make corrections at this stage to rectify any discrepancies that led to these errors and resubmit the molecules). The ones that are marked as passed are then imported into the tables accessible by the users on COCONUT. + + ## Curation flow chart + + + +## Curation tools +One of the features that distinguishes COCONUT 2024 from its predecessor is the Curation Tools. The research community's experience with 2021 version resulted in the realisation that not all the molecules from the Natural Products sources are organic in their origin. Hence rose the demand for ways to curate the molecules on COCONUT 2021. This was realised with the release of COCONUT 2024. + +### Reporting +The Curation process begins with Reporting. Any user on COCONUT has the ability to report on discrepancies in data displayed on the platform (Find more about reporting [here](/reporting)). Once a report is created, it stays in the **Draft** state. The user can still edit and make changes to the report at this stage. When the report is ready for submission, user can simply change the status to **Submittted**. This will now go into the Curation queue and gets examined by a Curator on the platform. + +::: info COCONUT Curators +Members of the COCONUT steering committee, also take up the role of curator on the platform. They can also confer this role to some selected users who are deemed knowledgable in the field of Natural Products. +::: + +If the Curator deems the report to be correct, the report gets approved and necessary action gets taken. For example, if a compound is reported to be synthetic in origin, after curator's enquiry, if is proven to be so, the compound gets deactivated along with a reason why it was deactivated. + +Users may also suggest changes to the details of a compound through reporting and the same curation process is followed. + +### Audit trails +To ensure transparency in the curation process and thereby impart authenticity to the data on the platform, COCONUT 2024 also provides for audit trails. Every change to the data displayed on the platform is captured. Who did what and where are tracked internally. Combined with the vetting process for curators, the audit trails prevent any misuse of the platform. Find more about auditing [here](/audit-trail). + diff --git a/docs/data-contributors.md b/docs/data-contributors.md new file mode 100644 index 00000000..84fd9071 --- /dev/null +++ b/docs/data-contributors.md @@ -0,0 +1,18 @@ +# Data Contributors to COCONUT +## + +::: info Original Dataset Maintainers +Their untiring efforts in making their data openly available +::: + +::: info Dr. Simon Saubern and Dr. Alex Shmaylov from the Commonwealth Scientific and Industrial Research Organisation (CSIRO), Australia + Australian Natural Product database to COCONUT +::: + +::: info Mr. Nikita Ionov and Prof. Dr. Vladimir Poroikov of the Russian Academy of Sciences, Russia + Phyto4Health data +::: + +::: info Prof. Dr. José L. Medina-Franco and Mr. Alejandro Gómez García of the National Autonomous University of Mexico, Mexico + Latin American dataset +::: diff --git a/docs/developers.md b/docs/developers.md new file mode 100644 index 00000000..899ca989 --- /dev/null +++ b/docs/developers.md @@ -0,0 +1,9 @@ +# Developers of COCONUT +## +- Sri Ram Sagar Kanakam (Sagar) +- Venkata chandrasekhar Nainala (Chandu) +- Dr. Kohulan Rajan +- Noura Rayya +- Dr. Jonas Schaub +- Nisha Sharma +- Viktor Weißenborn diff --git a/docs/steering-committee.md b/docs/steering-committee.md new file mode 100644 index 00000000..f923539b --- /dev/null +++ b/docs/steering-committee.md @@ -0,0 +1,45 @@ +# Steering committee of COCONUT +::: info Dr Pierre-Marie Allard + Université de Fribourg - Universität Freiburg,
+ Faculty of Science and Medicine +::: + +::: info Dr Peter Ertl + Ertl Molecular +::: + +::: info Prof. Dr Jose L. Medina-Franco + National Autonomous University of Mexico,
+ School of Chemistry +::: + +::: info Prof. Dr Guido F. Pauli + University of Illinois at Chicago,
+ Pharmacognosy Institute +::: + +::: info Prof. Dr. Christoph Steinbeck + Analytical Chemistry - Cheminformatics and Chemometrics,
+ Friedrich-Schiller-University +::: + + + From 2da1fcfdd08dc7e5ca7523b18ac51a0d2cacf81f Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 24 Sep 2024 00:57:48 +0200 Subject: [PATCH 013/137] fix: key issue fixed --- app/Livewire/MoleculeHistoryTimeline.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/Livewire/MoleculeHistoryTimeline.php b/app/Livewire/MoleculeHistoryTimeline.php index f12a0364..2c79262f 100644 --- a/app/Livewire/MoleculeHistoryTimeline.php +++ b/app/Livewire/MoleculeHistoryTimeline.php @@ -18,18 +18,17 @@ public function getHistory() $audit_data[$index]['user_name'] = $audit->getMetadata()['user_name']; $audit_data[$index]['event'] = $audit->getMetadata()['audit_event']; $audit_data[$index]['created_at'] = date('Y/m/d', strtotime($audit->getMetadata()['audit_created_at'])); + // dd($audit->old_values, $audit->new_values); + // dd($audit->getModified()); - if (str_contains('.', array_keys($audit->old_values)[0])) { - $old_key = $audit->old_values ? explode('.', array_keys($audit->old_values)[0])[0] : null; - $new_key = $audit->new_values ? explode('.', array_keys($audit->new_values)[0])[0] : null; - - $old_key = $old_key ?: $new_key; - $new_key = $new_key ?: $old_key; - } else { - foreach ($audit->getModified() as $key => $value) { - $audit_data[$index]['affected_columns'][$key]['old_value'] = $value['old'] ?: null; - $audit_data[$index]['affected_columns'][$key]['new_value'] = $value['new'] ?: null; - } + $key = null; + $old_key = $audit->old_values ? explode('.', array_keys($audit->old_values)[0])[0] : null; + $new_key = $audit->new_values ? explode('.', array_keys($audit->new_values)[0])[0] : null; + $key = $old_key ?? $new_key; + + foreach ($audit->getModified() as $value) { + $audit_data[$index]['affected_columns'][$key]['old_value'] = array_key_exists('old', $value) ? $value['old'] : null; + $audit_data[$index]['affected_columns'][$key]['new_value'] = array_key_exists('new', $value) ? $value['new'] : null; } } From bef6b8dde8e06b76580dcb31eda1b748c844d7b6 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 24 Sep 2024 12:44:02 +0200 Subject: [PATCH 014/137] fix: disabled logging empty values and enabled handling of existing empty values in both old and new columns --- config/audit.php | 2 +- resources/views/livewire/molecule-history-timeline.blade.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/audit.php b/config/audit.php index df6dd561..bf34de57 100644 --- a/config/audit.php +++ b/config/audit.php @@ -101,7 +101,7 @@ | */ - 'empty_values' => true, + 'empty_values' => false, 'allowed_empty_values' => [ 'retrieved', ], diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index d283d5ff..27da7e88 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -10,6 +10,7 @@
    @foreach ($audit_data as $audit) + @if (array_key_exists('affected_columns', $audit))
  • @@ -66,6 +67,7 @@

  • + @endif @endforeach
From b6067a5b409fe46780ad87f28ec6cb48c8286e9d Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 24 Sep 2024 12:49:29 +0200 Subject: [PATCH 015/137] fix: now the timestamps are auto managed for the pivot table molecule_sample_location --- app/Models/Molecule.php | 2 +- app/Models/SampleLocation.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Molecule.php b/app/Models/Molecule.php index 707e5cb3..1387e7c0 100644 --- a/app/Models/Molecule.php +++ b/app/Models/Molecule.php @@ -129,7 +129,7 @@ public function geo_locations(): BelongsToMany public function sampleLocations(): BelongsToMany { - return $this->belongsToMany(SampleLocation::class); + return $this->belongsToMany(SampleLocation::class)->withTimestamps(); } /** diff --git a/app/Models/SampleLocation.php b/app/Models/SampleLocation.php index c7f64a54..c54ec90e 100644 --- a/app/Models/SampleLocation.php +++ b/app/Models/SampleLocation.php @@ -38,7 +38,7 @@ public function organisms(): HasOne public function molecules(): BelongsToMany { - return $this->belongsToMany(Molecule::class); + return $this->belongsToMany(Molecule::class)->withTimestamps(); } public function transformAudit(array $data): array From 5be9ccb64315a252e7bf5bae8e4c24bcc2494ae0 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 18 Sep 2024 02:00:13 +0200 Subject: [PATCH 016/137] wip: suggested changes are now stored in the reports table. SQL queries need to be built at the time of approving the report --- app/Actions/Coconut/SearchMolecule.php | 1 - .../Dashboard/Resources/CitationResource.php | 88 +------ .../Resources/CollectionResource.php | 3 - .../Resources/GeoLocationResource.php | 7 +- .../Dashboard/Resources/OrganismResource.php | 99 +------- .../Dashboard/Resources/ReportResource.php | 232 +++++++++++++++++- .../ReportResource/Pages/CreateReport.php | 9 + app/Http/Controllers/API/SearchController.php | 4 - app/Models/Citation.php | 91 +++++++ app/Models/GeoLocation.php | 10 + app/Models/Organism.php | 100 ++++++++ app/Models/Report.php | 7 +- 12 files changed, 445 insertions(+), 206 deletions(-) diff --git a/app/Actions/Coconut/SearchMolecule.php b/app/Actions/Coconut/SearchMolecule.php index 9198fb21..c5ee90ad 100644 --- a/app/Actions/Coconut/SearchMolecule.php +++ b/app/Actions/Coconut/SearchMolecule.php @@ -350,7 +350,6 @@ private function executeQuery($statement) $ids_array = collect($hits)->pluck('id')->toArray(); $ids = implode(',', $ids_array); - // dd($ids); if ($ids != '') { diff --git a/app/Filament/Dashboard/Resources/CitationResource.php b/app/Filament/Dashboard/Resources/CitationResource.php index 00776312..28ee9b40 100644 --- a/app/Filament/Dashboard/Resources/CitationResource.php +++ b/app/Filament/Dashboard/Resources/CitationResource.php @@ -6,18 +6,12 @@ use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\CollectionRelationManager; use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\MoleculeRelationManager; use App\Models\Citation; -use Closure; -use Filament\Forms\Components\Section; -use Filament\Forms\Components\Textarea; -use Filament\Forms\Components\TextInput; use Filament\Forms\Form; -use Filament\Forms\Get; use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; use Illuminate\Support\Facades\Cache; -use Illuminate\Support\HtmlString; use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager; class CitationResource extends Resource @@ -35,87 +29,7 @@ class CitationResource extends Resource public static function form(Form $form): Form { return $form - ->schema([ - Section::make() - ->schema([ - TextInput::make('failMessage') - ->default('') - ->hidden() - ->disabled(), - TextInput::make('doi') - ->label('DOI') - ->live(onBlur: true) - ->afterStateUpdated(function ($set, $state) { - if (doiRegxMatch($state)) { - $citationDetails = fetchDOICitation($state); - if ($citationDetails) { - $set('title', $citationDetails['title']); - $set('authors', $citationDetails['authors']); - $set('citation_text', $citationDetails['citation_text']); - $set('failMessage', 'Success'); - } else { - $set('failMessage', 'No citation found. Please fill in the details manually'); - } - } else { - $set('failMessage', 'Invalid DOI'); - } - }) - ->helperText(function ($get) { - - if ($get('failMessage') == 'Fetching') { - return new HtmlString(' - - - '); - } elseif ($get('failMessage') != 'Success') { - return new HtmlString(''.$get('failMessage').''); - } else { - return null; - } - }) - ->required() - ->unique() - ->rules([ - fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { - if ($get('failMessage') != 'No citation found. Please fill in the details manually') { - $fail($get('failMessage')); - } - }, - ]) - ->validationMessages([ - 'unique' => 'The DOI already exists.', - ]), - ]), - - Section::make() - ->schema([ - TextInput::make('title') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - TextInput::make('authors') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - Textarea::make('citation_text') - ->label('Citation text / URL') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - ])->columns(1), - ]); + ->schema(Citation::getForm()); } public static function table(Table $table): Table diff --git a/app/Filament/Dashboard/Resources/CollectionResource.php b/app/Filament/Dashboard/Resources/CollectionResource.php index 500fe6cb..72d72403 100644 --- a/app/Filament/Dashboard/Resources/CollectionResource.php +++ b/app/Filament/Dashboard/Resources/CollectionResource.php @@ -131,9 +131,6 @@ public static function table(Table $table): Table public static function getRelations(): array { - // $record = static::getOwner(); - // dd(static::getOwner()); - // dd(static::$model::molecules()->get()); $arr = [ EntriesRelationManager::class, CitationsRelationManager::class, diff --git a/app/Filament/Dashboard/Resources/GeoLocationResource.php b/app/Filament/Dashboard/Resources/GeoLocationResource.php index 9288ff9c..2e96fcb7 100644 --- a/app/Filament/Dashboard/Resources/GeoLocationResource.php +++ b/app/Filament/Dashboard/Resources/GeoLocationResource.php @@ -5,7 +5,6 @@ use App\Filament\Dashboard\Resources\GeoLocationResource\Pages; use App\Filament\Dashboard\Resources\GeoLocationResource\Widgets\GeoLocationStats; use App\Models\GeoLocation; -use Filament\Forms\Components\TextInput; use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; @@ -26,11 +25,7 @@ class GeoLocationResource extends Resource public static function form(Form $form): Form { return $form - ->schema([ - TextInput::make('name') - ->required() - ->maxLength(255), - ]); + ->schema(GeoLocation::getForm()); } public static function table(Table $table): Table diff --git a/app/Filament/Dashboard/Resources/OrganismResource.php b/app/Filament/Dashboard/Resources/OrganismResource.php index 2f162e54..9624a38e 100644 --- a/app/Filament/Dashboard/Resources/OrganismResource.php +++ b/app/Filament/Dashboard/Resources/OrganismResource.php @@ -9,8 +9,6 @@ use App\Forms\Components\OrganismsTable; use App\Models\Organism; use Archilex\AdvancedTables\Filters\AdvancedFilter; -use Filament\Forms; -use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Grid; use Filament\Forms\Components\Group; use Filament\Forms\Components\Section; @@ -43,102 +41,9 @@ public static function form(Form $form): Form Group::make() ->schema([ Section::make('') - ->schema([ - Forms\Components\TextInput::make('name') - ->required() - ->unique() - ->maxLength(255) - ->suffixAction( - Action::make('infoFromSources') - ->icon('heroicon-m-clipboard') - // ->fillForm(function ($record, callable $get): array { - // $entered_name = $get('name'); - // $name = ucfirst(trim($entered_name)); - // $data = null; - // $iri = null; - // $organism = null; - // $rank = null; - - // if ($name && $name != '') { - // $data = Self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - // } - // return [ - // 'name' => $name, - // 'iri' => $iri, - // 'rank' => $rank, - // ]; - // }) - // ->form([ - // Forms\Components\TextInput::make('name')->readOnly(), - // Forms\Components\TextInput::make('iri')->readOnly(), - // Forms\Components\TextInput::make('rank')->readOnly(), - // ]) - // ->action(fn ( $record) => $record->advance()) - ->modalContent(function ($record, $get): View { - $name = ucfirst(trim($get('name'))); - $data = null; - // $iri = null; - // $organism = null; - // $rank = null; - - if ($name && $name != '') { - $data = self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - } - - return view( - 'forms.components.organism-info', - [ - 'data' => $data, - ], - ); - }) - ->action(function (array $data, Organism $record): void { - // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); - }) - ->slideOver() - ), - Forms\Components\TextInput::make('iri') - ->label('IRI') - ->maxLength(255), - Forms\Components\TextInput::make('rank') - ->maxLength(255), - ]), + ->schema(Organism::getForm()), ]) ->columnSpan(1), - Group::make() ->schema([ Section::make('') @@ -254,7 +159,6 @@ protected static function getGNFMatches($name, $organism) $responseBody = json_decode($response->getBody(), true); return $responseBody; - // dd($responseBody); // if (isset($responseBody['names']) && count($responseBody['names']) > 0) { // $r_name = $responseBody['names'][0]; @@ -293,7 +197,6 @@ protected static function getGNFMatches($name, $organism) protected static function updateOrganismModel($name, $iri, $organism = null, $rank = null) { - // dd($name, $iri, $organism, $rank); if (! $organism) { $organism = Organism::where('name', $name)->first(); } diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index a26e7ad1..97997f4e 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -5,15 +5,20 @@ use App\Filament\Dashboard\Resources\ReportResource\Pages; use App\Filament\Dashboard\Resources\ReportResource\RelationManagers; use App\Models\Citation; +use App\Models\GeoLocation; use App\Models\Molecule; +use App\Models\Organism; use App\Models\Report; use Archilex\AdvancedTables\Filters\AdvancedFilter; use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Grid; use Filament\Forms\Components\KeyValue; +use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; use Filament\Forms\Components\SpatieTagsInput; +use Filament\Forms\Components\Tabs; +use Filament\Forms\Components\TagsInput; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\ToggleButtons; @@ -125,11 +130,228 @@ public static function form(Form $form): Form ->hidden(function (Get $get) { return $get('is_change'); }), - KeyValue::make('suggested_changes') - ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') - ->addActionLabel('Add property') - ->keyLabel('Property') - ->valueLabel('Suggested change') + // KeyValue::make('suggested_changes') + // ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') + // ->addActionLabel('Add property') + // ->keyLabel('Property') + // ->valueLabel('Suggested change') + // ->hidden(function (Get $get) { + // return ! $get('is_change'); + // }), + Tabs::make('Tabs') + ->tabs([ + Tabs\Tab::make('organisms_changes') + ->label('Organisms') + ->schema([ + Repeater::make('organisms_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('organisms') + ->label('Organism') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->organisms()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('organisms.name', 'organisms.id')->toArray() ?? []; + }) + ->getOptionLabelUsing(fn ($value): ?string => Organism::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_organism_details') + ->schema(Organism::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + + ]), + Tabs\Tab::make('geo_locations_changes') + ->label('Geo Locations') + ->schema([ + Repeater::make('geo_locations_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('geo_locations') + ->label('Geo Location') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->geo_locations()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('geo_locations.name', 'geo_locations.id')->toArray(); + }) + ->getOptionLabelUsing(fn ($value): ?string => GeoLocation::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_geo_locations_details') + ->schema(GeoLocation::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('synonyms') + ->label('Synonyms') + ->schema([ + Repeater::make('synonyms_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('synonyms') + ->label('Synonym') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + $synonyms = Molecule::select('synonyms')->where('identifier', $get('../../mol_id_csv'))->get()[0]['synonyms']; + $matched_synonyms = []; + foreach ($synonyms as $synonym) { + str_contains(strtolower($synonym), strtolower($search)) ? array_push($matched_synonyms, $synonym) : null; + } + + return $matched_synonyms; + }) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_synonym_details') + ->schema([ + TagsInput::make('new_synonym') + ->label('New Synonym') + ->separator(',') + ->splitKeys([',']), + ])->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('identifiers') + ->label('Identifiers') + ->schema([ + Repeater::make('identifiers_changes') + ->schema([ + Select::make('identifer_to_change') + ->options([ + 'name' => 'Name', + 'cas' => 'CAS', + ]) + ->default('name') + ->live(), + Select::make('current_Name') + ->options(function (Get $get): array { + return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->name ?? '']; + }) + ->default(0) + ->disabled() + ->hidden(function (Get $get) { + return $get('identifer_to_change') == 'cas'; + }), + Select::make('current_CAS') + ->options(function (Get $get): array { + return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->cas]; + }) + ->default(0) + ->disabled() + ->hidden(function (Get $get) { + return $get('identifer_to_change') == 'name'; + }), + TextInput::make('new_name') + ->label(function (Get $get) { + return $get('identifer_to_change') == 'name' ? 'New Name' : 'New CAS'; + }), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('citations') + ->label('Citations') + ->schema([ + Repeater::make('citations_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('citations') + ->label('Citation') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->citations()->where('title', 'ilike', "%{$search}%")->limit(10)->pluck('citations.title', 'citations.id')->toArray(); + }) + ->getOptionLabelUsing(fn ($value): ?string => Citation::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_citation_details') + ->schema(Citation::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + + ]), + + Tabs\Tab::make('Chemical Classifications') + ->schema([ + // ... + ]), + ]) ->hidden(function (Get $get) { return ! $get('is_change'); }), diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 937c3131..2878f2c6 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -67,6 +67,15 @@ protected function mutateFormDataBeforeCreate(array $data): array $data['user_id'] = auth()->id(); $data['status'] = 'submitted'; + $suggested_changes = []; + $suggested_changes['organisms_changes'] = $data['organisms_changes']; + $suggested_changes['geo_locations_changes'] = $data['geo_locations_changes']; + $suggested_changes['synonyms_changes'] = $data['synonyms_changes']; + $suggested_changes['identifiers_changes'] = $data['identifiers_changes']; + $suggested_changes['citations_changes'] = $data['citations_changes']; + + $data['suggested_changes'] = $suggested_changes; + return $data; } diff --git a/app/Http/Controllers/API/SearchController.php b/app/Http/Controllers/API/SearchController.php index 8cd31eb8..2a21f544 100644 --- a/app/Http/Controllers/API/SearchController.php +++ b/app/Http/Controllers/API/SearchController.php @@ -19,8 +19,6 @@ public function search(Request $request) $queryType = 'text'; $results = []; - //dd($request); - $limit = $request->query('limit'); $sort = $request->query('sort'); $limit = $limit ? $limit : 24; @@ -218,7 +216,6 @@ public function search(Request $request) $statement = $statement.')'; } $statement = $statement.' LIMIT '.$limit; - // dd($statement ); } else { if ($query) { $query = str_replace("'", "''", $query); @@ -289,7 +286,6 @@ public function search(Request $request) $page ); - //dd($pagination); return $pagination; } catch (QueryException $exception) { $message = $exception->getMessage(); diff --git a/app/Models/Citation.php b/app/Models/Citation.php index 3cc86333..94542b75 100644 --- a/app/Models/Citation.php +++ b/app/Models/Citation.php @@ -2,9 +2,15 @@ namespace App\Models; +use Closure; +use Filament\Forms\Components\Section; +use Filament\Forms\Components\Textarea; +use Filament\Forms\Components\TextInput; +use Filament\Forms\Get; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Support\HtmlString; use OwenIt\Auditing\Contracts\Auditable; class Citation extends Model implements Auditable @@ -52,4 +58,89 @@ public function transformAudit(array $data): array { return changeAudit($data); } + + public static function getForm() + { + return [ + Section::make() + ->schema([ + TextInput::make('failMessage') + ->default('') + ->hidden() + ->disabled(), + TextInput::make('doi') + ->label('DOI') + ->live(onBlur: true) + ->afterStateUpdated(function ($set, $state) { + if (doiRegxMatch($state)) { + $citationDetails = fetchDOICitation($state); + if ($citationDetails) { + $set('title', $citationDetails['title']); + $set('authors', $citationDetails['authors']); + $set('citation_text', $citationDetails['citation_text']); + $set('failMessage', 'Success'); + } else { + $set('failMessage', 'No citation found. Please fill in the details manually'); + } + } else { + $set('failMessage', 'Invalid DOI'); + } + }) + ->helperText(function ($get) { + + if ($get('failMessage') == 'Fetching') { + return new HtmlString(' + + + '); + } elseif ($get('failMessage') != 'Success') { + return new HtmlString(''.$get('failMessage').''); + } else { + return null; + } + }) + ->required() + ->unique() + ->rules([ + fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { + if ($get('failMessage') != 'No citation found. Please fill in the details manually') { + $fail($get('failMessage')); + } + }, + ]) + ->validationMessages([ + 'unique' => 'The DOI already exists.', + ]), + ]), + + Section::make() + ->schema([ + TextInput::make('title') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + TextInput::make('authors') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + Textarea::make('citation_text') + ->label('Citation text / URL') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + ])->columns(1), + ]; + } } diff --git a/app/Models/GeoLocation.php b/app/Models/GeoLocation.php index 12ae9b35..28bcd5ef 100644 --- a/app/Models/GeoLocation.php +++ b/app/Models/GeoLocation.php @@ -2,6 +2,7 @@ namespace App\Models; +use Filament\Forms\Components\TextInput; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use OwenIt\Auditing\Contracts\Auditable; @@ -29,4 +30,13 @@ public function transformAudit(array $data): array { return changeAudit($data); } + + public static function getForm(): array + { + return [ + TextInput::make('name') + ->required() + ->maxLength(255), + ]; + } } diff --git a/app/Models/Organism.php b/app/Models/Organism.php index 52be6e4d..ad4c09ab 100644 --- a/app/Models/Organism.php +++ b/app/Models/Organism.php @@ -2,6 +2,9 @@ namespace App\Models; +use Filament\Forms; +use Filament\Forms\Components\Actions\Action; +use Illuminate\Contracts\View\View; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -51,4 +54,101 @@ public function transformAudit(array $data): array { return changeAudit($data); } + + public static function getForm(): array + { + return [ + Forms\Components\TextInput::make('name') + ->required() + ->unique(Organism::class, 'name') + ->maxLength(255) + ->suffixAction( + Action::make('infoFromSources') + ->icon('heroicon-m-clipboard') + // ->fillForm(function ($record, callable $get): array { + // $entered_name = $get('name'); + // $name = ucfirst(trim($entered_name)); + // $data = null; + // $iri = null; + // $organism = null; + // $rank = null; + + // if ($name && $name != '') { + // $data = Self::getOLSIRI($name, 'species'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'species'); + // Self::info("Mapped and updated: $name"); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // Self::info("Mapped and updated: $name"); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // Self::info("Mapped and updated: $name"); + // } else { + // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // } + // } + // } + // } + // return [ + // 'name' => $name, + // 'iri' => $iri, + // 'rank' => $rank, + // ]; + // }) + // ->form([ + // Forms\Components\TextInput::make('name')->readOnly(), + // Forms\Components\TextInput::make('iri')->readOnly(), + // Forms\Components\TextInput::make('rank')->readOnly(), + // ]) + // ->action(fn ( $record) => $record->advance()) + ->modalContent(function ($record, $get): View { + $name = ucfirst(trim($get('name'))); + $data = null; + // $iri = null; + // $organism = null; + // $rank = null; + + if ($name && $name != '') { + $data = self::getOLSIRI($name, 'species'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'species'); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // } else { + // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // } + // } + // } + } + + return view( + 'forms.components.organism-info', + [ + 'data' => $data, + ], + ); + }) + ->action(function (array $data, Organism $record): void { + // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); + }) + ->slideOver() + ), + Forms\Components\TextInput::make('iri') + ->label('IRI') + ->maxLength(255), + Forms\Components\TextInput::make('rank') + ->maxLength(255), + ]; + } } diff --git a/app/Models/Report.php b/app/Models/Report.php index f6e45e66..71793af8 100644 --- a/app/Models/Report.php +++ b/app/Models/Report.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\States\Report\ReportState; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -38,7 +37,6 @@ class Report extends Model implements Auditable protected $casts = [ 'suggested_changes' => 'array', - // 'status' => ReportState::class, ]; /** @@ -70,6 +68,11 @@ public function organisms(): MorphToMany return $this->morphedByMany(Organism::class, 'reportable'); } + // public function geoLocations(): MorphToMany + // { + // return $this->morphedByMany(Organism::class, 'reportable'); + // } + /** * Get all of the users that are assigned this report. */ From 058d9421681f52a0cd3b54d37d287c99fba642f7 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:33:11 +0200 Subject: [PATCH 017/137] feat: improved suggestions by replacing the old key value pairs with tabs that can be approved by curators --- .../Dashboard/Resources/ReportResource.php | 398 ++++++++++++++---- .../ReportResource/Pages/EditReport.php | 11 + .../ReportResource/Pages/ViewReport.php | 11 + ...09_150749_add_columns_on_reports_table.php | 2 +- 4 files changed, 334 insertions(+), 88 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 97997f4e..19ff713f 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -12,8 +12,8 @@ use Archilex\AdvancedTables\Filters\AdvancedFilter; use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; +use Filament\Forms\Components\Checkbox; use Filament\Forms\Components\Grid; -use Filament\Forms\Components\KeyValue; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; use Filament\Forms\Components\SpatieTagsInput; @@ -30,6 +30,7 @@ use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Facades\DB; use Illuminate\Support\HtmlString; use Illuminate\Support\Str; use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager; @@ -62,46 +63,26 @@ public static function form(Form $form): Form ->columnSpan(2), Actions::make([ Action::make('approve') - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create'; - }) ->form([ Textarea::make('reason'), ]) - ->action(function (array $data, Report $record, Molecule $molecule, $set): void { - - $record['status'] = 'approved'; - $record['reason'] = $data['reason']; - $record->save(); - - $set('status', 'rejected'); - - if ($record['mol_id_csv'] && ! $record['is_change']) { - $molecule_ids = explode(',', $record['mol_id_csv']); - $molecule = Molecule::whereIn('id', $molecule_ids)->get(); - foreach ($molecule as $mol) { - $mol->active = false; - $mol->save(); - } - } + ->action(function (array $data, Report $record, Molecule $molecule, $set, $livewire): void { + self::approveReport($data, $record, $molecule, $livewire); + $set('status', 'approved'); }), Action::make('reject') ->color('danger') - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create'; - }) ->form([ Textarea::make('reason'), ]) ->action(function (array $data, Report $record, $set): void { - - $record['status'] = 'rejected'; - $record['reason'] = $data['reason']; - $record->save(); - + self::rejectReport($data, $record); $set('status', 'rejected'); }), ]) + ->hidden(function (Get $get, string $operation) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; + }) ->verticalAlignment(VerticalAlignment::End) ->columnStart(4), ]) @@ -130,21 +111,19 @@ public static function form(Form $form): Form ->hidden(function (Get $get) { return $get('is_change'); }), - // KeyValue::make('suggested_changes') - // ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') - // ->addActionLabel('Add property') - // ->keyLabel('Property') - // ->valueLabel('Suggested change') - // ->hidden(function (Get $get) { - // return ! $get('is_change'); - // }), - Tabs::make('Tabs') + Tabs::make('suggested_changes') ->tabs([ Tabs\Tab::make('organisms_changes') ->label('Organisms') ->schema([ Repeater::make('organisms_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }) + ->disabled(false), Select::make('operation') ->options([ 'update' => 'Update', @@ -152,7 +131,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('organisms') ->label('Organism') ->searchable() @@ -163,12 +143,14 @@ public static function form(Form $form): Form ->getOptionLabelUsing(fn ($value): ?string => Organism::find($value)?->name) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_organism_details') ->schema(Organism::getForm())->columns(3) ->hidden(function (Get $get) { @@ -177,7 +159,7 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('geo_locations_changes') @@ -185,6 +167,11 @@ public static function form(Form $form): Form ->schema([ Repeater::make('geo_locations_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), Select::make('operation') ->options([ 'update' => 'Update', @@ -192,7 +179,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('geo_locations') ->label('Geo Location') ->searchable() @@ -203,12 +191,14 @@ public static function form(Form $form): Form ->getOptionLabelUsing(fn ($value): ?string => GeoLocation::find($value)?->name) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_geo_locations_details') ->schema(GeoLocation::getForm())->columns(3) ->hidden(function (Get $get) { @@ -217,13 +207,18 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('synonyms') ->label('Synonyms') ->schema([ Repeater::make('synonyms_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), Select::make('operation') ->options([ 'update' => 'Update', @@ -231,7 +226,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('synonyms') ->label('Synonym') ->searchable() @@ -239,20 +235,26 @@ public static function form(Form $form): Form ->getSearchResultsUsing(function (string $search, Get $get): array { $synonyms = Molecule::select('synonyms')->where('identifier', $get('../../mol_id_csv'))->get()[0]['synonyms']; $matched_synonyms = []; + $associative_matched_synonyms = []; foreach ($synonyms as $synonym) { str_contains(strtolower($synonym), strtolower($search)) ? array_push($matched_synonyms, $synonym) : null; } + foreach ($matched_synonyms as $item) { + $associative_matched_synonyms[$item] = $item; + } - return $matched_synonyms; + return $associative_matched_synonyms; }) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_synonym_details') ->schema([ TagsInput::make('new_synonym') @@ -266,14 +268,19 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('identifiers') ->label('Identifiers') ->schema([ Repeater::make('identifiers_changes') ->schema([ - Select::make('identifer_to_change') + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), + Select::make('change') ->options([ 'name' => 'Name', 'cas' => 'CAS', @@ -282,35 +289,63 @@ public static function form(Form $form): Form ->live(), Select::make('current_Name') ->options(function (Get $get): array { - return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->name ?? '']; + $name = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->name ?? ''; + + return [$name => $name]; }) - ->default(0) - ->disabled() ->hidden(function (Get $get) { - return $get('identifer_to_change') == 'cas'; - }), - Select::make('current_CAS') + return $get('change') == 'cas'; + }) + ->columnSpan(2), + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->hidden(function (Get $get) { + return $get('change') == 'name'; + }) + ->live() + ->columnSpan(2), + Select::make('current_cas') + ->label('Current CAS') ->options(function (Get $get): array { - return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->cas]; + $cas_ids = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->cas ?? ''; + $associative_cas_ids = []; + foreach ($cas_ids as $item) { + $associative_cas_ids[$item] = $item; + } + + return $associative_cas_ids; }) - ->default(0) - ->disabled() ->hidden(function (Get $get) { - return $get('identifer_to_change') == 'name'; - }), + return $get('change') == 'name' || $get('operation') == 'add'; + }) + ->columnSpan(2), TextInput::make('new_name') ->label(function (Get $get) { - return $get('identifer_to_change') == 'name' ? 'New Name' : 'New CAS'; - }), + return $get('change') == 'name' ? 'New Name' : 'New CAS'; + }) + ->hidden(function (Get $get) { + return $get('operation') == 'remove'; + }) + ->columnSpan(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('citations') ->label('Citations') ->schema([ Repeater::make('citations_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), Select::make('operation') ->options([ 'update' => 'Update', @@ -318,7 +353,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('citations') ->label('Citation') ->searchable() @@ -329,12 +365,14 @@ public static function form(Form $form): Form ->getOptionLabelUsing(fn ($value): ?string => Citation::find($value)?->name) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_citation_details') ->schema(Citation::getForm())->columns(3) ->hidden(function (Get $get) { @@ -343,12 +381,17 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('Chemical Classifications') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), // ... ]), ]) @@ -452,6 +495,7 @@ public static function form(Form $form): Form return true; } }) + ->live() ->hidden(function (Get $get, string $operation) { if ($operation != 'create') { return true; @@ -509,20 +553,8 @@ public static function table(Table $table): Table ->form([ Textarea::make('reason'), ]) - ->action(function (array $data, Report $record, Molecule $molecule): void { - - $record['status'] = 'approved'; - $record['reason'] = $data['reason']; - $record->save(); - - if ($record['mol_id_csv'] && ! $record['is_change']) { - $molecule_ids = explode(',', $record['mol_id_csv']); - $molecule = Molecule::whereIn('id', $molecule_ids)->get(); - foreach ($molecule as $mol) { - $mol->active = false; - $mol->save(); - } - } + ->action(function (array $data, Report $record, Molecule $molecule, $livewire): void { + self::approveReport($data, $record, $molecule, $livewire); }), Tables\Actions\Action::make('reject') // ->button() @@ -535,10 +567,7 @@ public static function table(Table $table): Table ]) ->action(function (array $data, Report $record): void { - - $record['status'] = 'rejected'; - $record['reason'] = $data['reason']; - $record->save(); + self::rejectReport($data, $record); }), ]) ->bulkActions([ @@ -578,4 +607,199 @@ public static function getEloquentQuery(): Builder return parent::getEloquentQuery(); } + + public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void + { + $record['status'] = 'approved'; + $record['comment'] = $data['reason']; + + // In case of reporting a synthetic molecule, Deactivate Molecules + if ($record['mol_id_csv'] && ! $record['is_change']) { + $molecule_ids = explode(',', $record['mol_id_csv']); + $molecule = Molecule::whereIn('id', $molecule_ids)->get(); + foreach ($molecule as $mol) { + $mol->active = false; + $mol->save(); + } + } + + // In case of Changes, run SQL queries for the approved changes + if ($record['is_change']) { + + // To remove null values from the arrays before we assign them below + // dd(array_map(function($subArray) { + // return array_filter($subArray, function($value) { + // return !is_null($value); + // }); + // }, $livewire->data['organisms_changes'])); + + $suggestedChanges = $record->suggested_changes; + $suggestedChanges['organisms_changes'] = $livewire->data['organisms_changes']; + $suggestedChanges['geo_locations_changes'] = $livewire->data['geo_locations_changes']; + $suggestedChanges['synonyms_changes'] = $livewire->data['synonyms_changes']; + $suggestedChanges['identifiers_changes'] = $livewire->data['identifiers_changes']; + $suggestedChanges['citations_changes'] = $livewire->data['citations_changes']; + $record->suggested_changes = $suggestedChanges; + } + + // Run SQL queries for the approved changes + self::runSQLQueries($record); + + // Save the report record in any case + $record->save(); + } + + public static function rejectReport(array $data, Report $record): void + { + $record['status'] = 'rejected'; + $record['comment'] = $data['reason']; + $record->save(); + } + + public static function runSQLQueries(Report $record): void + { + DB::transaction(function () use ($record) { + // Check if organisms_changes exists and process it + if (isset($record->suggested_changes['organisms_changes'])) { + foreach ($record->suggested_changes['organisms_changes'] as $organism) { + if ($organism['approve'] && $organism['operation'] === 'update' && ! is_null($organism['organisms'])) { + // Perform update only if organisms ID is not null + // --------check if the organism name already exists + // --------need to handle iri and other fields of Organism for authentication + $db_organism = Organism::find($organism['organisms']); + $db_organism->name = $organism['name']; + $db_organism->save(); + } elseif ($organism['approve'] && $organism['operation'] === 'remove' && ! is_null($organism['organisms'])) { + // Perform delete only if organisms ID is not null + $db_organism = Organism::find($organism['organisms']); + $db_organism->delete(); + } elseif ($organism['approve'] && $organism['operation'] === 'add' && ! is_null($organism['name'])) { + // Perform insert only if name is not null (and other required fields can be checked too) + Organism::create([ + 'name' => $organism['name'], + 'iri' => $organism['iri'], + 'rank' => $organism['rank'], + ]); + } + } + } + + // Check if geo_locations_changes exists and process it + if (isset($record->suggested_changes['geo_locations_changes'])) { + foreach ($record->suggested_changes['geo_locations_changes'] as $geo_location) { + if ($geo_location['approve'] && $geo_location['operation'] === 'update' && ! is_null($geo_location['geo_locations'])) { + // Perform update only if geo_locations ID is not null + $db_geo_location = GeoLocation::find($geo_location['geo_locations']); + $db_geo_location->name = $geo_location['name']; + $db_geo_location->save(); + } elseif ($geo_location['approve'] && $geo_location['operation'] === 'remove' && ! is_null($geo_location['geo_locations'])) { + // Perform delete only if geo_locations ID is not null + $db_geo_location = GeoLocation::find($geo_location['geo_locations']); + $db_geo_location->delete(); + } elseif ($geo_location['approve'] && $geo_location['operation'] === 'add' && ! is_null($geo_location['name'])) { + // Perform insert only if name is not null + GeoLocation::create(['name' => $geo_location['name']]); + } + } + } + + // Check if synonyms_changes exists and process it + if (isset($record->suggested_changes['synonyms_changes'])) { + foreach ($record->suggested_changes['synonyms_changes'] as $synonym) { + if ($synonym['approve'] && $synonym['operation'] === 'update' && ! is_null($synonym['synonyms'])) { + // Perform update only if synonym name is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $synonyms = $db_molecule->synonyms; + foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { + $synonyms[$key] = $synonym['name']; + } + $db_molecule->synonyms = $synonyms; + $db_molecule->save(); + } elseif ($synonym['approve'] && $synonym['operation'] === 'remove' && ! is_null($synonym['synonyms'])) { + // Perform delete only if synonym name is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $synonyms = $db_molecule->synonyms; + foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { + unset($synonyms[$key]); + } + $db_molecule->synonyms = $synonyms; + $db_molecule->save(); + } elseif ($synonym['approve'] && $synonym['operation'] === 'add' && ! empty($synonym['new_synonym'])) { + // Perform insert only if new_synonym is not empty + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $synonyms = $db_molecule->synonyms; + $synonyms = array_merge($synonyms, $synonym['new_synonym']); + $db_molecule->synonyms = $synonyms; + $db_molecule->save(); + } + } + } + + // Check if identifiers_changes exists and process it + if (isset($record->suggested_changes['identifiers_changes'])) { + foreach ($record->suggested_changes['identifiers_changes'] as $identifier) { + if ($identifier['approve'] && $identifier['change'] === 'name' && ! is_null($identifier['current_Name']) && ! is_null($identifier['new_name'])) { + // Update name if current name and new name are not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $db_molecule->name = $identifier['new_name']; + $db_molecule->save(); + } elseif ($identifier['change'] == 'cas') { + if ($identifier['approve'] && $identifier['operation'] === 'update' && ! is_null($identifier['current_cas']) && ! is_null($identifier['new_name'])) { + // Update CAS if the current CAS and new name is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $cas = $db_molecule->cas; + foreach (array_keys($cas, $identifier['current_cas']) as $key) { + $cas[$key] = $identifier['new_name']; + } + $db_molecule->cas = $cas; + $db_molecule->save(); + } elseif ($identifier['approve'] && $identifier['operation'] === 'remove' && ! is_null($identifier['current_cas'])) { + // Perform delete only if CAS is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $cas = $db_molecule->cas; + foreach (array_keys($cas, $identifier['current_cas']) as $key) { + unset($cas[$key]); + } + $db_molecule->cas = $cas; + $db_molecule->save(); + } elseif ($identifier['approve'] && $identifier['operation'] === 'add' && ! is_null($identifier['new_name'])) { + // Perform insert only if new_name (CAS) is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $cas = $db_molecule->cas; + $cas[] = $identifier['new_name']; + $db_molecule->cas = $cas; + $db_molecule->save(); + } + } + } + } + + // Check if citations_changes exists and process it + if (isset($record->suggested_changes['citations_changes'])) { + foreach ($record->suggested_changes['citations_changes'] as $citation) { + if ($citation['approve'] && $citation['operation'] === 'update' && ! is_null($citation['citations'])) { + // Perform update only if citation ID is not null + $db_citation = Citation::find($citation['citations']); + // $db_citation->doi = $citation['doi']; + $db_citation->title = $citation['name']; + // $db_citation->authors = $citation['authors']; + // $db_citation->citation_text = $citation['citation_text']; + $db_citation->save(); + } elseif ($citation['approve'] && $citation['operation'] === 'remove' && ! is_null($citation['citations'])) { + // Perform delete only if citation ID is not null + $db_citation = Citation::find($citation['citations']); + $db_citation->delete(); + } elseif ($citation['approve'] && $citation['operation'] === 'add' && ! is_null($citation['name'])) { + // Perform insert only if name (citation ID) is not null + $db_citation = new Citation; + $db_citation->doi = $citation['doi']; + $db_citation->title = $citation['title']; + $db_citation->authors = $citation['authors']; + $db_citation->citation_text = $citation['citation_text']; + $db_citation->save(); + } + } + } + }); + } } diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index faec4f41..5471d32c 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -10,6 +10,17 @@ class EditReport extends EditRecord { protected static string $resource = ReportResource::class; + protected function mutateFormDataBeforeFill(array $data): array + { + $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; + $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; + $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; + $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; + $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + + return $data; + } + protected function getHeaderActions(): array { return [ diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php index 379e42c1..6e3966f4 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php @@ -8,4 +8,15 @@ class ViewReport extends ViewRecord { protected static string $resource = ReportResource::class; + + protected function mutateFormDataBeforeFill(array $data): array + { + $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; + $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; + $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; + $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; + $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + + return $data; + } } diff --git a/database/migrations/2024_09_09_150749_add_columns_on_reports_table.php b/database/migrations/2024_09_09_150749_add_columns_on_reports_table.php index 8ea2e3b4..db442525 100644 --- a/database/migrations/2024_09_09_150749_add_columns_on_reports_table.php +++ b/database/migrations/2024_09_09_150749_add_columns_on_reports_table.php @@ -24,7 +24,7 @@ public function up(): void public function down(): void { Schema::table('reports', function (Blueprint $table) { - $table->dropColumn([ 'query']); + $table->dropColumn(['query']); $table->renameColumn('doi', 'url'); }); } From 716fe435c89f0c67453a0534df6baf03463e2016 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:34:17 +0200 Subject: [PATCH 018/137] fix: now the time line shows synonym and cas changes properly --- .../molecule-history-timeline.blade.php | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index 27da7e88..702cb219 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -34,26 +34,46 @@ @switch(explode('.',$column_name)[0]) @case('comment') - {{$column_values['new_value'][0]['comment'] ?? 'N/A'}} + {{$column_values['new_value'][0]['comment'] ?? 'N/A'}} @break @case('active') - @if ($column_values['new_value']) - Activated - @else - Deactivated - @endif + @if ($column_values['new_value']) + Activated + @else + Deactivated + @endif @break @case('created') - Initial creation of the compound on COCONUT + Initial creation of the compound on COCONUT @break @case('organisms') @case('sampleLocations') - Detached from:
{{$column_values['old_value']?:'N/A'}}
- Attached to:
{{$column_values['new_value']?:'N/A'}}
+ @if ($column_values['old_value']) + Detached from:
{{$column_values['old_value']?:'N/A'}}
+ @endif + @if ($column_values['new_value']) + Attached to:
{{$column_values['new_value']?:'N/A'}}
+ @endif + @break + @case('synonyms') + @if (array_diff($column_values['old_value'], $column_values['new_value'])) + Removed:
{{implode(', ',array_diff($column_values['old_value'], $column_values['new_value']))}}
+ @endif + @if (array_diff($column_values['new_value'], $column_values['old_value'])) + Added:
{{implode(', ',array_diff($column_values['new_value'], $column_values['old_value']))}}
+ @endif + @break + @case('cas') + @if (array_diff($column_values['old_value'], $column_values['new_value'])) + Removed:
{{implode(', ',array_diff($column_values['old_value'], $column_values['new_value']))}}
+ @endif + @if (array_diff($column_values['new_value'], $column_values['old_value'])) + Added:
{{implode(', ',array_diff($column_values['new_value'], $column_values['old_value']))}}
+ @endif @break @default - Old Value:
{{$column_values['old_value']??'N/A'}}
- New Value:
{{$column_values['new_value']??'N/A'}} + Old Value:
{{$column_values['old_value']??'N/A'}}
+ New Value:
{{$column_values['new_value']??'N/A'}} @endswitch
From d7dbc88fab69478eebc30a6128c795a8c8804f27 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:35:19 +0200 Subject: [PATCH 019/137] chore: commented out the slide over (wip) --- app/Models/Organism.php | 159 ++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/app/Models/Organism.php b/app/Models/Organism.php index ad4c09ab..489d5458 100644 --- a/app/Models/Organism.php +++ b/app/Models/Organism.php @@ -62,88 +62,89 @@ public static function getForm(): array ->required() ->unique(Organism::class, 'name') ->maxLength(255) - ->suffixAction( - Action::make('infoFromSources') - ->icon('heroicon-m-clipboard') - // ->fillForm(function ($record, callable $get): array { - // $entered_name = $get('name'); - // $name = ucfirst(trim($entered_name)); - // $data = null; - // $iri = null; - // $organism = null; - // $rank = null; + // ->suffixAction( + // Action::make('infoFromSources') + // ->icon('heroicon-m-clipboard') + // // ->fillForm(function ($record, callable $get): array { + // // $entered_name = $get('name'); + // // $name = ucfirst(trim($entered_name)); + // // $data = null; + // // $iri = null; + // // $organism = null; + // // $rank = null; - // if ($name && $name != '') { - // $data = Self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - // } - // return [ - // 'name' => $name, - // 'iri' => $iri, - // 'rank' => $rank, - // ]; - // }) - // ->form([ - // Forms\Components\TextInput::make('name')->readOnly(), - // Forms\Components\TextInput::make('iri')->readOnly(), - // Forms\Components\TextInput::make('rank')->readOnly(), - // ]) - // ->action(fn ( $record) => $record->advance()) - ->modalContent(function ($record, $get): View { - $name = ucfirst(trim($get('name'))); - $data = null; - // $iri = null; - // $organism = null; - // $rank = null; + // // if ($name && $name != '') { + // // $data = Self::getOLSIRI($name, 'species'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'species'); + // // Self::info("Mapped and updated: $name"); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // Self::info("Mapped and updated: $name"); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // Self::info("Mapped and updated: $name"); + // // } else { + // // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // // } + // // } + // // } + // // } + // // return [ + // // 'name' => $name, + // // 'iri' => $iri, + // // 'rank' => $rank, + // // ]; + // // }) + // // ->form([ + // // Forms\Components\TextInput::make('name')->readOnly(), + // // Forms\Components\TextInput::make('iri')->readOnly(), + // // Forms\Components\TextInput::make('rank')->readOnly(), + // // ]) + // // ->action(fn ( $record) => $record->advance()) + // ->modalContent(function ($record, $get): View { + // $name = ucfirst(trim($get('name'))); + // $data = null; + // // $iri = null; + // // $organism = null; + // // $rank = null; - if ($name && $name != '') { - $data = self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - } + // if ($name && $name != '') { + // $data = self::getOLSIRI($name, 'species'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'species'); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // } else { + // // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // // } + // // } + // // } + // } - return view( - 'forms.components.organism-info', - [ - 'data' => $data, - ], - ); - }) - ->action(function (array $data, Organism $record): void { - // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); - }) - ->slideOver() - ), + // return view( + // 'forms.components.organism-info', + // [ + // 'data' => $data, + // ], + // ); + // }) + // ->action(function (array $data, Organism $record): void { + // // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); + // }) + // ->slideOver() + // ) + , Forms\Components\TextInput::make('iri') ->label('IRI') ->maxLength(255), From ff4621b6f87bd0df7cee7dbddd60889aed928a54 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:36:04 +0200 Subject: [PATCH 020/137] fix: minor fix related to creating citations --- app/Models/Citation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/Citation.php b/app/Models/Citation.php index 94542b75..61f3d1c4 100644 --- a/app/Models/Citation.php +++ b/app/Models/Citation.php @@ -73,6 +73,7 @@ public static function getForm() ->live(onBlur: true) ->afterStateUpdated(function ($set, $state) { if (doiRegxMatch($state)) { + $set('failMessage', 'Fetching'); $citationDetails = fetchDOICitation($state); if ($citationDetails) { $set('title', $citationDetails['title']); @@ -103,7 +104,7 @@ public static function getForm() ->unique() ->rules([ fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { - if ($get('failMessage') != 'No citation found. Please fill in the details manually') { + if ($get('failMessage') != 'Success') { $fail($get('failMessage')); } }, From 8fef4466365f7ee807d7ea1582a1a4cc10a39065 Mon Sep 17 00:00:00 2001 From: Sagar Date: Sun, 29 Sep 2024 20:04:11 +0200 Subject: [PATCH 021/137] feat: improved the user friendliness (wip) --- .../Dashboard/Resources/ReportResource.php | 47 ++++++++++--------- .../ReportResource/Pages/CreateReport.php | 12 +++++ 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 19ff713f..e717152b 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -60,12 +60,18 @@ public static function form(Form $form): Form true => 'Request Changes to Data', ]) ->inline() + ->hidden(function () { + return request()->has('type'); + }) ->columnSpan(2), Actions::make([ Action::make('approve') ->form([ Textarea::make('reason'), ]) + ->hidden(function (Get $get, string $operation) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; + }) ->action(function (array $data, Report $record, Molecule $molecule, $set, $livewire): void { self::approveReport($data, $record, $molecule, $livewire); $set('status', 'approved'); @@ -75,14 +81,18 @@ public static function form(Form $form): Form ->form([ Textarea::make('reason'), ]) + ->hidden(function (Get $get, string $operation) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; + }) ->action(function (array $data, Report $record, $set): void { self::rejectReport($data, $record); $set('status', 'rejected'); }), + Action::make('viewCompoundPage') + ->color('info') + ->url(fn (): string => env('APP_URL').'/compounds/'.request()->compound_id) + ->openUrlInNewTab(), ]) - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; - }) ->verticalAlignment(VerticalAlignment::End) ->columnStart(4), ]) @@ -96,14 +106,15 @@ public static function form(Form $form): Form return getReportTypes(); }) ->hidden(function (string $operation) { - if ($operation == 'create') { - return false; - } else { - return true; - } + return $operation != 'create' || request()->has('type'); }), TextInput::make('title') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Title of the report. This is required.') + ->default(function () { + if (request()->type == 'change' && request()->has('compound_id')) { + return 'Request changes'; + } + }) ->required(), Textarea::make('evidence') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Please provide Evidence/Comment to support your claims in this report. This will help our Curators in reviewing your report.') @@ -384,16 +395,6 @@ public static function form(Form $form): Form ->columns(7), ]), - - Tabs\Tab::make('Chemical Classifications') - ->schema([ - Checkbox::make('approve') - ->inline(false) - ->hidden(function (string $operation) { - return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - // ... - ]), ]) ->hidden(function (Get $get) { return ! $get('is_change'); @@ -409,7 +410,10 @@ public static function form(Form $form): Form $state, shouldOpenInNewTab: true, ), - ), + ) + ->hidden(function () { + return request()->has('type') && request()->type == 'change'; + }), Select::make('collections') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Select the Collections you want to report. This will help our Curators in reviewing your report.') ->relationship('collections', 'title') @@ -497,9 +501,10 @@ public static function form(Form $form): Form }) ->live() ->hidden(function (Get $get, string $operation) { - if ($operation != 'create') { + if ($operation != 'create' || request()->type == 'change') { return true; - } elseif (! request()->has('compound_id') && $get('report_type') != 'molecule') { + } + if (! request()->has('compound_id') && $get('report_type') != 'molecule') { return true; } }) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 2878f2c6..f9e0b47d 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -14,6 +14,18 @@ class CreateReport extends CreateRecord { protected static string $resource = ReportResource::class; + public function getTitle(): string + { + $title = 'Create Report'; + request()->type == 'change' ? $title = 'Request Changes' : $title = 'Report '; + if (request()->has('compound_id')) { + $molecule = Molecule::where('identifier', request()->compound_id)->first(); + $title = $title.' - '.$molecule->name.' ('.$molecule->identifier.')'; + } + + return __($title); + } + protected function afterFill(): void { $request = request(); From 3c97f6ba23787d4c6defe330d02ab81c661c1de4 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Mon, 30 Sep 2024 12:38:21 +0200 Subject: [PATCH 022/137] feat: added np_classifier in compound details and history ui updates --- app/Actions/Coconut/SearchMolecule.php | 4 + .../views/livewire/molecule-details.blade.php | 44 +++++++ .../molecule-history-timeline.blade.php | 120 +++++++++++------- 3 files changed, 125 insertions(+), 43 deletions(-) diff --git a/app/Actions/Coconut/SearchMolecule.php b/app/Actions/Coconut/SearchMolecule.php index 9198fb21..c360495b 100644 --- a/app/Actions/Coconut/SearchMolecule.php +++ b/app/Actions/Coconut/SearchMolecule.php @@ -143,6 +143,10 @@ private function getFilterMap() 'subclass' => 'chemical_sub_class', 'superclass' => 'chemical_super_class', 'parent' => 'direct_parent_classification', + 'np_class' => 'np_classifier_class', + 'np_superclass' => 'np_classifier_superclass', + 'np_pathway' => 'np_classifier_pathway', + 'np_glycoside' => 'np_classifier_is_glycoside', 'org' => 'organism', 'cite' => 'ciatation', ]; diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index 59e96618..81443122 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -419,6 +419,50 @@ class="ml-3 text-base">Direct @endif + @if ($molecule->properties) +
+ +
+ @endif +
diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index d283d5ff..0998f5b8 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -1,11 +1,10 @@ -
+
-
+
    @@ -17,57 +16,92 @@
    -

    -

    -

    {{$audit['user_name']}} {{$audit['event']}}

    - @foreach ($audit['affected_columns'] as $column_name => $column_values) +

    + {{ $audit['user_name'] ?? 'COCONUT Curator' }} + + {{ $audit['event'] ?? '' }}  + {{ \Carbon\Carbon::parse($audit['created_at'])->diffForHumans() }} + +

    + @foreach ($audit['affected_columns'] as $column_name => $column_values)
    - {{ Str::of($column_name)->camel()->replace('_', ' ')->replaceMatches('/[A-Z]/', ' $0')->title() }} -
    - - +
    + {{ Str::of($column_name)->camel()->replace('_', ' ')->replaceMatches('/[A-Z]/', ' $0')->title() }} +
    + {{--
    + + - - @switch(explode('.',$column_name)[0]) - @case('comment') - {{$column_values['new_value'][0]['comment'] ?? 'N/A'}} - @break - @case('active') - @if ($column_values['new_value']) - Activated - @else - Deactivated - @endif - @break - @case('created') - Initial creation of the compound on COCONUT - @break - @case('organisms') - @case('sampleLocations') - Detached from:
    {{$column_values['old_value']?:'N/A'}}
    - Attached to:
    {{$column_values['new_value']?:'N/A'}}
    - @break - @default - Old Value:
    {{$column_values['old_value']??'N/A'}}
    - New Value:
    {{$column_values['new_value']??'N/A'}} + + @switch(explode('.', $column_name)[0]) + @case('comment') + {{ $column_values['new_value'][0]['comment'] ?? 'N/A' }} + @break + @case('active') + {{ $column_values['new_value'] ? 'Activated' : 'Deactivated' }} + @break + @case('created') + Initial creation of the compound on COCONUT + @break + @case('organisms') + @case('sampleLocations') + Detached from:
    {{ $column_values['old_value'] ?: 'N/A' }}
    + Attached to:
    {{ $column_values['new_value'] ?: 'N/A' }}
    + @break + @default + Old Value:
    {{ $column_values['old_value'] ?: 'N/A' }}
    + New Value:
    {{ $column_values['new_value'] ?: 'N/A' }} @endswitch
    -
    +
    --}}
    - - @endforeach -

    -

    - @endforeach
-
\ No newline at end of file +
+ +
+ +
+
+

+ +
+
+ +
+
+
+
From afa3037cdd9b855652342ed7b7832253c7bb26ec Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Mon, 30 Sep 2024 12:42:36 +0200 Subject: [PATCH 023/137] fix: disabled history show by default and header to represent the event --- .../views/livewire/molecule-history-timeline.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index 0998f5b8..65542b72 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -1,4 +1,4 @@ -
+
',yp=Number.isNaN||Fe.isNaN;function j(e){return typeof e=="number"&&!yp(e)}var To=function(t){return t>0&&t<1/0};function oa(e){return typeof e>"u"}function ot(e){return ra(e)==="object"&&e!==null}var _p=Object.prototype.hasOwnProperty;function Tt(e){if(!ot(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&_p.call(i,"isPrototypeOf")}catch{return!1}}function Ee(e){return typeof e=="function"}var Rp=Array.prototype.slice;function Po(e){return Array.from?Array.from(e):Rp.call(e)}function le(e,t){return e&&Ee(t)&&(Array.isArray(e)||j(e.length)?Po(e).forEach(function(i,a){t.call(e,i,a,e)}):ot(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var J=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n0&&a.forEach(function(o){ot(o)&&Object.keys(o).forEach(function(l){t[l]=o[l]})}),t},wp=/\.\d*(?:0|9){12}\d*$/;function vt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return wp.test(e)?Math.round(e*t)/t:e}var Sp=/^width|height|left|top|marginLeft|marginTop$/;function je(e,t){var i=e.style;le(t,function(a,n){Sp.test(n)&&j(a)&&(a="".concat(a,"px")),i[n]=a})}function Lp(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function de(e,t){if(t){if(j(e.length)){le(e,function(a){de(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function De(e,t){if(t){if(j(e.length)){le(e,function(i){De(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function It(e,t,i){if(t){if(j(e.length)){le(e,function(a){It(a,t,i)});return}i?de(e,t):De(e,t)}}var Ap=/([a-z\d])([A-Z])/g;function va(e){return e.replace(Ap,"$1-$2").toLowerCase()}function ga(e,t){return ot(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(va(t)))}function Ut(e,t,i){ot(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(va(t)),i)}function Mp(e,t){if(ot(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch{e.dataset[t]=void 0}else e.removeAttribute("data-".concat(va(t)))}var Do=/\s\s*/,Fo=function(){var e=!1;if(bi){var t=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(o){t=o}});Fe.addEventListener("test",i,a),Fe.removeEventListener("test",i,a)}return e}();function Pe(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(Do).forEach(function(o){if(!Fo){var l=e.listeners;l&&l[o]&&l[o][i]&&(n=l[o][i],delete l[o][i],Object.keys(l[o]).length===0&&delete l[o],Object.keys(l).length===0&&delete e.listeners)}e.removeEventListener(o,n,a)})}function Re(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(Do).forEach(function(o){if(a.once&&!Fo){var l=e.listeners,r=l===void 0?{}:l;n=function(){delete r[o][i],e.removeEventListener(o,n,a);for(var p=arguments.length,c=new Array(p),d=0;dMath.abs(i)&&(i=m)})}),i}function gi(e,t){var i=e.pageX,a=e.pageY,n={endX:i,endY:a};return t?n:xo({startX:i,startY:a},n)}function Dp(e){var t=0,i=0,a=0;return le(e,function(n){var o=n.startX,l=n.startY;t+=o,i+=l,a+=1}),t/=a,i/=a,{pageX:t,pageY:i}}function qe(e){var t=e.aspectRatio,i=e.height,a=e.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=To(a),l=To(i);if(o&&l){var r=i*t;n==="contain"&&r>a||n==="cover"&&r90?{width:s,height:r}:{width:r,height:s}}function zp(e,t,i,a){var n=t.aspectRatio,o=t.naturalWidth,l=t.naturalHeight,r=t.rotate,s=r===void 0?0:r,p=t.scaleX,c=p===void 0?1:p,d=t.scaleY,m=d===void 0?1:d,u=i.aspectRatio,f=i.naturalWidth,h=i.naturalHeight,g=a.fillColor,I=g===void 0?"transparent":g,E=a.imageSmoothingEnabled,T=E===void 0?!0:E,v=a.imageSmoothingQuality,y=v===void 0?"low":v,b=a.maxWidth,w=b===void 0?1/0:b,x=a.maxHeight,_=x===void 0?1/0:x,P=a.minWidth,O=P===void 0?0:P,M=a.minHeight,C=M===void 0?0:M,S=document.createElement("canvas"),F=S.getContext("2d"),R=qe({aspectRatio:u,width:w,height:_}),L=qe({aspectRatio:u,width:O,height:C},"cover"),z=Math.min(R.width,Math.max(L.width,f)),D=Math.min(R.height,Math.max(L.height,h)),k=qe({aspectRatio:n,width:w,height:_}),B=qe({aspectRatio:n,width:O,height:C},"cover"),X=Math.min(k.width,Math.max(B.width,o)),Y=Math.min(k.height,Math.max(B.height,l)),Q=[-X/2,-Y/2,X,Y];return S.width=vt(z),S.height=vt(D),F.fillStyle=I,F.fillRect(0,0,z,D),F.save(),F.translate(z/2,D/2),F.rotate(s*Math.PI/180),F.scale(c,m),F.imageSmoothingEnabled=T,F.imageSmoothingQuality=y,F.drawImage.apply(F,[e].concat(_o(Q.map(function(pe){return Math.floor(vt(pe))})))),F.restore(),S}var Co=String.fromCharCode;function Cp(e,t,i){var a="";i+=t;for(var n=t;n0;)i.push(Co.apply(null,Po(n.subarray(0,a)))),n=n.subarray(a);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function Vp(e){var t=new DataView(e),i;try{var a,n,o;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var l=t.byteLength,r=2;r+1=8&&(o=p+d)}}}if(o){var m=t.getUint16(o,a),u,f;for(f=0;f=0?o:Mo),height:Math.max(a.offsetHeight,l>=0?l:Oo)};this.containerData=r,je(n,{width:r.width,height:r.height}),de(t,be),De(n,be)},initCanvas:function(){var t=this.containerData,i=this.imageData,a=this.options.viewMode,n=Math.abs(i.rotate)%180===90,o=n?i.naturalHeight:i.naturalWidth,l=n?i.naturalWidth:i.naturalHeight,r=o/l,s=t.width,p=t.height;t.height*r>t.width?a===3?s=t.height*r:p=t.width/r:a===3?p=t.width/r:s=t.height*r;var c={aspectRatio:r,naturalWidth:o,naturalHeight:l,width:s,height:p};this.canvasData=c,this.limited=a===1||a===2,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=J({},c)},limitCanvas:function(t,i){var a=this.options,n=this.containerData,o=this.canvasData,l=this.cropBoxData,r=a.viewMode,s=o.aspectRatio,p=this.cropped&&l;if(t){var c=Number(a.minCanvasWidth)||0,d=Number(a.minCanvasHeight)||0;r>1?(c=Math.max(c,n.width),d=Math.max(d,n.height),r===3&&(d*s>c?c=d*s:d=c/s)):r>0&&(c?c=Math.max(c,p?l.width:0):d?d=Math.max(d,p?l.height:0):p&&(c=l.width,d=l.height,d*s>c?c=d*s:d=c/s));var m=qe({aspectRatio:s,width:c,height:d});c=m.width,d=m.height,o.minWidth=c,o.minHeight=d,o.maxWidth=1/0,o.maxHeight=1/0}if(i)if(r>(p?0:1)){var u=n.width-o.width,f=n.height-o.height;o.minLeft=Math.min(0,u),o.minTop=Math.min(0,f),o.maxLeft=Math.max(0,u),o.maxTop=Math.max(0,f),p&&this.limited&&(o.minLeft=Math.min(l.left,l.left+(l.width-o.width)),o.minTop=Math.min(l.top,l.top+(l.height-o.height)),o.maxLeft=l.left,o.maxTop=l.top,r===2&&(o.width>=n.width&&(o.minLeft=Math.min(0,u),o.maxLeft=Math.max(0,u)),o.height>=n.height&&(o.minTop=Math.min(0,f),o.maxTop=Math.max(0,f))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=n.width,o.maxTop=n.height},renderCanvas:function(t,i){var a=this.canvasData,n=this.imageData;if(i){var o=Fp({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),l=o.width,r=o.height,s=a.width*(l/a.naturalWidth),p=a.height*(r/a.naturalHeight);a.left-=(s-a.width)/2,a.top-=(p-a.height)/2,a.width=s,a.height=p,a.aspectRatio=l/r,a.naturalWidth=l,a.naturalHeight=r,this.limitCanvas(!0,!1)}(a.width>a.maxWidth||a.widtha.maxHeight||a.heighti.width?o.height=o.width/a:o.width=o.height*a),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*n),o.height=Math.max(o.minHeight,o.height*n),o.left=i.left+(i.width-o.width)/2,o.top=i.top+(i.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=J({},o)},limitCropBox:function(t,i){var a=this.options,n=this.containerData,o=this.canvasData,l=this.cropBoxData,r=this.limited,s=a.aspectRatio;if(t){var p=Number(a.minCropBoxWidth)||0,c=Number(a.minCropBoxHeight)||0,d=r?Math.min(n.width,o.width,o.width+o.left,n.width-o.left):n.width,m=r?Math.min(n.height,o.height,o.height+o.top,n.height-o.top):n.height;p=Math.min(p,n.width),c=Math.min(c,n.height),s&&(p&&c?c*s>p?c=p/s:p=c*s:p?c=p/s:c&&(p=c*s),m*s>d?m=d/s:d=m*s),l.minWidth=Math.min(p,d),l.minHeight=Math.min(c,m),l.maxWidth=d,l.maxHeight=m}i&&(r?(l.minLeft=Math.max(0,o.left),l.minTop=Math.max(0,o.top),l.maxLeft=Math.min(n.width,o.left+o.width)-l.width,l.maxTop=Math.min(n.height,o.top+o.height)-l.height):(l.minLeft=0,l.minTop=0,l.maxLeft=n.width-l.width,l.maxTop=n.height-l.height))},renderCropBox:function(){var t=this.options,i=this.containerData,a=this.cropBoxData;(a.width>a.maxWidth||a.widtha.maxHeight||a.height=i.width&&a.height>=i.height?wo:Ta),je(this.cropBox,J({width:a.width,height:a.height},Vt({translateX:a.left,translateY:a.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),xt(this.element,pa,this.getData())}},Wp={initPreview:function(){var t=this.element,i=this.crossOrigin,a=this.options.preview,n=i?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",l=document.createElement("img");if(i&&(l.crossOrigin=i),l.src=n,l.alt=o,this.viewBox.appendChild(l),this.viewBoxImage=l,!!a){var r=a;typeof a=="string"?r=t.ownerDocument.querySelectorAll(a):a.querySelector&&(r=[a]),this.previews=r,le(r,function(s){var p=document.createElement("img");Ut(s,hi,{width:s.offsetWidth,height:s.offsetHeight,html:s.innerHTML}),i&&(p.crossOrigin=i),p.src=n,p.alt=o,p.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',s.innerHTML="",s.appendChild(p)})}},resetPreview:function(){le(this.previews,function(t){var i=ga(t,hi);je(t,{width:i.width,height:i.height}),t.innerHTML=i.html,Mp(t,hi)})},preview:function(){var t=this.imageData,i=this.canvasData,a=this.cropBoxData,n=a.width,o=a.height,l=t.width,r=t.height,s=a.left-i.left-t.left,p=a.top-i.top-t.top;!this.cropped||this.disabled||(je(this.viewBoxImage,J({width:l,height:r},Vt(J({translateX:-s,translateY:-p},t)))),le(this.previews,function(c){var d=ga(c,hi),m=d.width,u=d.height,f=m,h=u,g=1;n&&(g=m/n,h=o*g),o&&h>u&&(g=u/o,f=n*g,h=u),je(c,{width:f,height:h}),je(c.getElementsByTagName("img")[0],J({width:l*g,height:r*g},Vt(J({translateX:-s*g,translateY:-p*g},t))))}))}},Hp={bind:function(){var t=this.element,i=this.options,a=this.cropper;Ee(i.cropstart)&&Re(t,fa,i.cropstart),Ee(i.cropmove)&&Re(t,ua,i.cropmove),Ee(i.cropend)&&Re(t,ma,i.cropend),Ee(i.crop)&&Re(t,pa,i.crop),Ee(i.zoom)&&Re(t,ha,i.zoom),Re(a,po,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&Re(a,go,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Re(a,co,this.onDblclick=this.dblclick.bind(this)),Re(t.ownerDocument,mo,this.onCropMove=this.cropMove.bind(this)),Re(t.ownerDocument,uo,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&Re(window,ho,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,a=this.cropper;Ee(i.cropstart)&&Pe(t,fa,i.cropstart),Ee(i.cropmove)&&Pe(t,ua,i.cropmove),Ee(i.cropend)&&Pe(t,ma,i.cropend),Ee(i.crop)&&Pe(t,pa,i.crop),Ee(i.zoom)&&Pe(t,ha,i.zoom),Pe(a,po,this.onCropStart),i.zoomable&&i.zoomOnWheel&&Pe(a,go,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Pe(a,co,this.onDblclick),Pe(t.ownerDocument,mo,this.onCropMove),Pe(t.ownerDocument,uo,this.onCropEnd),i.responsive&&Pe(window,ho,this.onResize)}},jp={resize:function(){if(!this.disabled){var t=this.options,i=this.container,a=this.containerData,n=i.offsetWidth/a.width,o=i.offsetHeight/a.height,l=Math.abs(n-1)>Math.abs(o-1)?n:o;if(l!==1){var r,s;t.restore&&(r=this.getCanvasData(),s=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(le(r,function(p,c){r[c]=p*l})),this.setCropBoxData(le(s,function(p,c){s[c]=p*l})))}}},dblclick:function(){this.disabled||this.options.dragMode===Ao||this.setDragMode(Lp(this.dragBox,ca)?Lo:Ia)},wheel:function(t){var i=this,a=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*a,t)))},cropStart:function(t){var i=t.buttons,a=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(j(i)&&i!==1||j(a)&&a!==0||t.ctrlKey))){var n=this.options,o=this.pointers,l;t.changedTouches?le(t.changedTouches,function(r){o[r.identifier]=gi(r)}):o[t.pointerId||0]=gi(t),Object.keys(o).length>1&&n.zoomable&&n.zoomOnTouch?l=So:l=ga(t.target,Gt),bp.test(l)&&xt(this.element,fa,{originalEvent:t,action:l})!==!1&&(t.preventDefault(),this.action=l,this.cropping=!1,l===Ro&&(this.cropping=!0,de(this.dragBox,Ei)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var a=this.pointers;t.preventDefault(),xt(this.element,ua,{originalEvent:t,action:i})!==!1&&(t.changedTouches?le(t.changedTouches,function(n){J(a[n.identifier]||{},gi(n,!0))}):J(a[t.pointerId||0]||{},gi(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,a=this.pointers;t.changedTouches?le(t.changedTouches,function(n){delete a[n.identifier]}):delete a[t.pointerId||0],i&&(t.preventDefault(),Object.keys(a).length||(this.action=""),this.cropping&&(this.cropping=!1,It(this.dragBox,Ei,this.cropped&&this.options.modal)),xt(this.element,ma,{originalEvent:t,action:i}))}}},qp={change:function(t){var i=this.options,a=this.canvasData,n=this.containerData,o=this.cropBoxData,l=this.pointers,r=this.action,s=i.aspectRatio,p=o.left,c=o.top,d=o.width,m=o.height,u=p+d,f=c+m,h=0,g=0,I=n.width,E=n.height,T=!0,v;!s&&t.shiftKey&&(s=d&&m?d/m:1),this.limited&&(h=o.minLeft,g=o.minTop,I=h+Math.min(n.width,a.width,a.left+a.width),E=g+Math.min(n.height,a.height,a.top+a.height));var y=l[Object.keys(l)[0]],b={x:y.endX-y.startX,y:y.endY-y.startY},w=function(_){switch(_){case at:u+b.x>I&&(b.x=I-u);break;case nt:p+b.xE&&(b.y=E-f);break}};switch(r){case Ta:p+=b.x,c+=b.y;break;case at:if(b.x>=0&&(u>=I||s&&(c<=g||f>=E))){T=!1;break}w(at),d+=b.x,d<0&&(r=nt,d=-d,p-=d),s&&(m=d/s,c+=(o.height-m)/2);break;case He:if(b.y<=0&&(c<=g||s&&(p<=h||u>=I))){T=!1;break}w(He),m-=b.y,c+=b.y,m<0&&(r=bt,m=-m,c-=m),s&&(d=m*s,p+=(o.width-d)/2);break;case nt:if(b.x<=0&&(p<=h||s&&(c<=g||f>=E))){T=!1;break}w(nt),d-=b.x,p+=b.x,d<0&&(r=at,d=-d,p-=d),s&&(m=d/s,c+=(o.height-m)/2);break;case bt:if(b.y>=0&&(f>=E||s&&(p<=h||u>=I))){T=!1;break}w(bt),m+=b.y,m<0&&(r=He,m=-m,c-=m),s&&(d=m*s,p+=(o.width-d)/2);break;case Ct:if(s){if(b.y<=0&&(c<=g||u>=I)){T=!1;break}w(He),m-=b.y,c+=b.y,d=m*s}else w(He),w(at),b.x>=0?ug&&(m-=b.y,c+=b.y):(m-=b.y,c+=b.y);d<0&&m<0?(r=kt,m=-m,d=-d,c-=m,p-=d):d<0?(r=Nt,d=-d,p-=d):m<0&&(r=Bt,m=-m,c-=m);break;case Nt:if(s){if(b.y<=0&&(c<=g||p<=h)){T=!1;break}w(He),m-=b.y,c+=b.y,d=m*s,p+=o.width-d}else w(He),w(nt),b.x<=0?p>h?(d-=b.x,p+=b.x):b.y<=0&&c<=g&&(T=!1):(d-=b.x,p+=b.x),b.y<=0?c>g&&(m-=b.y,c+=b.y):(m-=b.y,c+=b.y);d<0&&m<0?(r=Bt,m=-m,d=-d,c-=m,p-=d):d<0?(r=Ct,d=-d,p-=d):m<0&&(r=kt,m=-m,c-=m);break;case kt:if(s){if(b.x<=0&&(p<=h||f>=E)){T=!1;break}w(nt),d-=b.x,p+=b.x,m=d/s}else w(bt),w(nt),b.x<=0?p>h?(d-=b.x,p+=b.x):b.y>=0&&f>=E&&(T=!1):(d-=b.x,p+=b.x),b.y>=0?f=0&&(u>=I||f>=E)){T=!1;break}w(at),d+=b.x,m=d/s}else w(bt),w(at),b.x>=0?u=0&&f>=E&&(T=!1):d+=b.x,b.y>=0?f0?r=b.y>0?Bt:Ct:b.x<0&&(p-=d,r=b.y>0?kt:Nt),b.y<0&&(c-=m),this.cropped||(De(this.cropBox,be),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(o.width=d,o.height=m,o.left=p,o.top=c,this.action=r,this.renderCropBox()),le(l,function(x){x.startX=x.endX,x.startY=x.endY})}},Yp={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&de(this.dragBox,Ei),De(this.cropBox,be),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=J({},this.initialImageData),this.canvasData=J({},this.initialCanvasData),this.cropBoxData=J({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(J(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),De(this.dragBox,Ei),de(this.cropBox,be)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,le(this.previews,function(a){a.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,De(this.cropper,ro)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,de(this.cropper,ro)),this},destroy:function(){var t=this.element;return t[K]?(t[K]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=a.left,o=a.top;return this.moveTo(oa(t)?t:n+Number(t),oa(i)?i:o+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(j(t)&&(a.left=t,n=!0),j(i)&&(a.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,i){var a=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(a.width*t/a.naturalWidth,null,i)},zoomTo:function(t,i,a){var n=this.options,o=this.canvasData,l=o.width,r=o.height,s=o.naturalWidth,p=o.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var c=s*t,d=p*t;if(xt(this.element,ha,{ratio:t,oldRatio:l/s,originalEvent:a})===!1)return this;if(a){var m=this.pointers,u=zo(this.cropper),f=m&&Object.keys(m).length?Dp(m):{pageX:a.pageX,pageY:a.pageY};o.left-=(c-l)*((f.pageX-u.left-o.left)/l),o.top-=(d-r)*((f.pageY-u.top-o.top)/r)}else Tt(i)&&j(i.x)&&j(i.y)?(o.left-=(c-l)*((i.x-o.left)/l),o.top-=(d-r)*((i.y-o.top)/r)):(o.left-=(c-l)/2,o.top-=(d-r)/2);o.width=c,o.height=d,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),j(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,j(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(j(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.imageData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(j(t)&&(a.scaleX=t,n=!0),j(i)&&(a.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,a=this.imageData,n=this.canvasData,o=this.cropBoxData,l;if(this.ready&&this.cropped){l={x:o.left-n.left,y:o.top-n.top,width:o.width,height:o.height};var r=a.width/a.naturalWidth;if(le(l,function(c,d){l[d]=c/r}),t){var s=Math.round(l.y+l.height),p=Math.round(l.x+l.width);l.x=Math.round(l.x),l.y=Math.round(l.y),l.width=p-l.x,l.height=s-l.y}}else l={x:0,y:0,width:0,height:0};return i.rotatable&&(l.rotate=a.rotate||0),i.scalable&&(l.scaleX=a.scaleX||1,l.scaleY=a.scaleY||1),l},setData:function(t){var i=this.options,a=this.imageData,n=this.canvasData,o={};if(this.ready&&!this.disabled&&Tt(t)){var l=!1;i.rotatable&&j(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,l=!0),i.scalable&&(j(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,l=!0),j(t.scaleY)&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,l=!0)),l&&this.renderCanvas(!0,!0);var r=a.width/a.naturalWidth;j(t.x)&&(o.left=t.x*r+n.left),j(t.y)&&(o.top=t.y*r+n.top),j(t.width)&&(o.width=t.width*r),j(t.height)&&(o.height=t.height*r),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?J({},this.containerData):{}},getImageData:function(){return this.sized?J({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&le(["left","top","width","height","naturalWidth","naturalHeight"],function(a){i[a]=t[a]}),i},setCanvasData:function(t){var i=this.canvasData,a=i.aspectRatio;return this.ready&&!this.disabled&&Tt(t)&&(j(t.left)&&(i.left=t.left),j(t.top)&&(i.top=t.top),j(t.width)?(i.width=t.width,i.height=t.width/a):j(t.height)&&(i.height=t.height,i.width=t.height*a),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,a=this.options.aspectRatio,n,o;return this.ready&&this.cropped&&!this.disabled&&Tt(t)&&(j(t.left)&&(i.left=t.left),j(t.top)&&(i.top=t.top),j(t.width)&&t.width!==i.width&&(n=!0,i.width=t.width),j(t.height)&&t.height!==i.height&&(o=!0,i.height=t.height),a&&(n?i.height=i.width/a:o&&(i.width=i.height*a)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,a=zp(this.image,this.imageData,i,t);if(!this.cropped)return a;var n=this.getData(t.rounded),o=n.x,l=n.y,r=n.width,s=n.height,p=a.width/Math.floor(i.naturalWidth);p!==1&&(o*=p,l*=p,r*=p,s*=p);var c=r/s,d=qe({aspectRatio:c,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),m=qe({aspectRatio:c,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=qe({aspectRatio:c,width:t.width||(p!==1?a.width:r),height:t.height||(p!==1?a.height:s)}),f=u.width,h=u.height;f=Math.min(d.width,Math.max(m.width,f)),h=Math.min(d.height,Math.max(m.height,h));var g=document.createElement("canvas"),I=g.getContext("2d");g.width=vt(f),g.height=vt(h),I.fillStyle=t.fillColor||"transparent",I.fillRect(0,0,f,h);var E=t.imageSmoothingEnabled,T=E===void 0?!0:E,v=t.imageSmoothingQuality;I.imageSmoothingEnabled=T,v&&(I.imageSmoothingQuality=v);var y=a.width,b=a.height,w=o,x=l,_,P,O,M,C,S;w<=-r||w>y?(w=0,_=0,O=0,C=0):w<=0?(O=-w,w=0,_=Math.min(y,r+w),C=_):w<=y&&(O=0,_=Math.min(r,y-w),C=_),_<=0||x<=-s||x>b?(x=0,P=0,M=0,S=0):x<=0?(M=-x,x=0,P=Math.min(b,s+x),S=P):x<=b&&(M=0,P=Math.min(s,b-x),S=P);var F=[w,x,_,P];if(C>0&&S>0){var R=f/r;F.push(O*R,M*R,C*R,S*R)}return I.drawImage.apply(I,[a].concat(_o(F.map(function(L){return Math.floor(vt(L))})))),g},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!oa(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,a=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var o=t===Ia,l=i.movable&&t===Lo;t=o||l?t:Ao,i.dragMode=t,Ut(a,Gt,t),It(a,ca,o),It(a,da,l),i.cropBoxMovable||(Ut(n,Gt,t),It(n,ca,o),It(n,da,l))}return this}},$p=Fe.Cropper,xa=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(rp(this,e),!t||!vp.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=J({},bo,Tt(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return sp(e,[{key:"init",value:function(){var i=this.element,a=i.tagName.toLowerCase(),n;if(!i[K]){if(i[K]=this,a==="img"){if(this.isImg=!0,n=i.getAttribute("src")||"",this.originalUrl=n,!n)return;n=i.src}else a==="canvas"&&window.HTMLCanvasElement&&(n=i.toDataURL());this.load(n)}}},{key:"load",value:function(i){var a=this;if(i){this.url=i,this.imageData={};var n=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Tp.test(i)){Ip.test(i)?this.read(Bp(i)):this.clone();return}var l=new XMLHttpRequest,r=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=r,l.onerror=r,l.ontimeout=r,l.onprogress=function(){l.getResponseHeader("content-type")!==Eo&&l.abort()},l.onload=function(){a.read(l.response)},l.onloadend=function(){a.reloading=!1,a.xhr=null},o.checkCrossOrigin&&Io(i)&&n.crossOrigin&&(i=vo(i)),l.open("GET",i,!0),l.responseType="arraybuffer",l.withCredentials=n.crossOrigin==="use-credentials",l.send()}}},{key:"read",value:function(i){var a=this.options,n=this.imageData,o=Vp(i),l=0,r=1,s=1;if(o>1){this.url=kp(i,Eo);var p=Gp(o);l=p.rotate,r=p.scaleX,s=p.scaleY}a.rotatable&&(n.rotate=l),a.scalable&&(n.scaleX=r,n.scaleY=s),this.clone()}},{key:"clone",value:function(){var i=this.element,a=this.url,n=i.crossOrigin,o=a;this.options.checkCrossOrigin&&Io(a)&&(n||(n="anonymous"),o=vo(a)),this.crossOrigin=n,this.crossOriginUrl=o;var l=document.createElement("img");n&&(l.crossOrigin=n),l.src=o||a,l.alt=i.alt||"The image to crop",this.image=l,l.onload=this.start.bind(this),l.onerror=this.stop.bind(this),de(l,so),i.parentNode.insertBefore(l,i.nextSibling)}},{key:"start",value:function(){var i=this,a=this.image;a.onload=null,a.onerror=null,this.sizing=!0;var n=Fe.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Fe.navigator.userAgent),o=function(p,c){J(i.imageData,{naturalWidth:p,naturalHeight:c,aspectRatio:p/c}),i.initialImageData=J({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(a.naturalWidth&&!n){o(a.naturalWidth,a.naturalHeight);return}var l=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=l,l.onload=function(){o(l.width,l.height),n||r.removeChild(l)},l.src=a.src,n||(l.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",r.appendChild(l))}},{key:"stop",value:function(){var i=this.image;i.onload=null,i.onerror=null,i.parentNode.removeChild(i),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var i=this.element,a=this.options,n=this.image,o=i.parentNode,l=document.createElement("div");l.innerHTML=xp;var r=l.querySelector(".".concat(K,"-container")),s=r.querySelector(".".concat(K,"-canvas")),p=r.querySelector(".".concat(K,"-drag-box")),c=r.querySelector(".".concat(K,"-crop-box")),d=c.querySelector(".".concat(K,"-face"));this.container=o,this.cropper=r,this.canvas=s,this.dragBox=p,this.cropBox=c,this.viewBox=r.querySelector(".".concat(K,"-view-box")),this.face=d,s.appendChild(n),de(i,be),o.insertBefore(r,i.nextSibling),De(n,so),this.initPreview(),this.bind(),a.initialAspectRatio=Math.max(0,a.initialAspectRatio)||NaN,a.aspectRatio=Math.max(0,a.aspectRatio)||NaN,a.viewMode=Math.max(0,Math.min(3,Math.round(a.viewMode)))||0,de(c,be),a.guides||de(c.getElementsByClassName("".concat(K,"-dashed")),be),a.center||de(c.getElementsByClassName("".concat(K,"-center")),be),a.background&&de(r,"".concat(K,"-bg")),a.highlight||de(d,fp),a.cropBoxMovable&&(de(d,da),Ut(d,Gt,Ta)),a.cropBoxResizable||(de(c.getElementsByClassName("".concat(K,"-line")),be),de(c.getElementsByClassName("".concat(K,"-point")),be)),this.render(),this.ready=!0,this.setDragMode(a.dragMode),a.autoCrop&&this.crop(),this.setData(a.data),Ee(a.ready)&&Re(i,fo,a.ready,{once:!0}),xt(i,fo)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),De(this.element,be)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=$p,e}},{key:"setDefaults",value:function(i){J(bo,Tt(i)&&i)}}])}();J(xa.prototype,Up,Wp,Hp,jp,qp,Yp);var No={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(No);var Bo=No;var ko={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(ko);var Vo=ko;var we=function(e,t,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:t.get(e)},yt,Wt,lt,ya=class{constructor(...t){yt.set(this,new Map),Wt.set(this,new Map),lt.set(this,new Map);for(let i of t)this.define(i)}define(t,i=!1){for(let[a,n]of Object.entries(t)){a=a.toLowerCase(),n=n.map(r=>r.toLowerCase()),we(this,lt,"f").has(a)||we(this,lt,"f").set(a,new Set);let o=we(this,lt,"f").get(a),l=!0;for(let r of n){let s=r.startsWith("*");if(r=s?r.slice(1):r,o?.add(r),l&&we(this,Wt,"f").set(a,r),l=!1,s)continue;let p=we(this,yt,"f").get(r);if(p&&p!=a&&!i)throw new Error(`"${a} -> ${r}" conflicts with "${p} -> ${r}". Pass \`force=true\` to override this definition.`);we(this,yt,"f").set(r,a)}}return this}getType(t){if(typeof t!="string")return null;let i=t.replace(/^.*[/\\]/,"").toLowerCase(),a=i.replace(/^.*\./,"").toLowerCase(),n=i.length{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(let t of we(this,lt,"f").values())Object.freeze(t);return this}_getTestState(){return{types:we(this,yt,"f"),extensions:we(this,Wt,"f")}}};yt=new WeakMap,Wt=new WeakMap,lt=new WeakMap;var _a=ya;var Go=new _a(Vo,Bo)._freeze();var Uo=({addFilter:e,utils:t})=>{let{Type:i,replaceInString:a,toNaturalFileSize:n}=t;return e("ALLOW_HOPPER_ITEM",(o,{query:l})=>{if(!l("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;let r=l("GET_MAX_FILE_SIZE");if(r!==null&&o.size>r)return!1;let s=l("GET_MIN_FILE_SIZE");return!(s!==null&&o.sizenew Promise((r,s)=>{if(!l("GET_ALLOW_FILE_SIZE_VALIDATION"))return r(o);let p=l("GET_FILE_VALIDATE_SIZE_FILTER");if(p&&!p(o))return r(o);let c=l("GET_MAX_FILE_SIZE");if(c!==null&&o.size>c){s({status:{main:l("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:a(l("GET_LABEL_MAX_FILE_SIZE"),{filesize:n(c,".",l("GET_FILE_SIZE_BASE"),l("GET_FILE_SIZE_LABELS",l))})}});return}let d=l("GET_MIN_FILE_SIZE");if(d!==null&&o.sizef+h.fileSize,0)>m){s({status:{main:l("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:a(l("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:n(m,".",l("GET_FILE_SIZE_BASE"),l("GET_FILE_SIZE_LABELS",l))})}});return}r(o)})),{options:{allowFileSizeValidation:[!0,i.BOOLEAN],maxFileSize:[null,i.INT],minFileSize:[null,i.INT],maxTotalFileSize:[null,i.INT],fileValidateSizeFilter:[null,i.FUNCTION],labelMinFileSizeExceeded:["File is too small",i.STRING],labelMinFileSize:["Minimum file size is {filesize}",i.STRING],labelMaxFileSizeExceeded:["File is too large",i.STRING],labelMaxFileSize:["Maximum file size is {filesize}",i.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",i.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",i.STRING]}}},Xp=typeof window<"u"&&typeof window.document<"u";Xp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Uo}));var Wo=Uo;var Ho=({addFilter:e,utils:t})=>{let{Type:i,isString:a,replaceInString:n,guesstimateMimeType:o,getExtensionFromFilename:l,getFilenameFromURL:r}=t,s=(u,f)=>{let h=(/^[^/]+/.exec(u)||[]).pop(),g=f.slice(0,-2);return h===g},p=(u,f)=>u.some(h=>/\*$/.test(h)?s(f,h):h===f),c=u=>{let f="";if(a(u)){let h=r(u),g=l(h);g&&(f=o(g))}else f=u.type;return f},d=(u,f,h)=>{if(f.length===0)return!0;let g=c(u);return h?new Promise((I,E)=>{h(u,g).then(T=>{p(f,T)?I():E()}).catch(E)}):p(f,g)},m=u=>f=>u[f]===null?!1:u[f]||f;return e("SET_ATTRIBUTE_TO_OPTION_MAP",u=>Object.assign(u,{accept:"acceptedFileTypes"})),e("ALLOW_HOPPER_ITEM",(u,{query:f})=>f("GET_ALLOW_FILE_TYPE_VALIDATION")?d(u,f("GET_ACCEPTED_FILE_TYPES")):!0),e("LOAD_FILE",(u,{query:f})=>new Promise((h,g)=>{if(!f("GET_ALLOW_FILE_TYPE_VALIDATION")){h(u);return}let I=f("GET_ACCEPTED_FILE_TYPES"),E=f("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),T=d(u,I,E),v=()=>{let y=I.map(m(f("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"))).filter(w=>w!==!1),b=y.filter((w,x)=>y.indexOf(w)===x);g({status:{main:f("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:n(f("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:b.join(", "),allButLastType:b.slice(0,-1).join(", "),lastType:b[b.length-1]})}})};if(typeof T=="boolean")return T?h(u):v();T.then(()=>{h(u)}).catch(v)})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}},Qp=typeof window<"u"&&typeof window.document<"u";Qp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Ho}));var jo=Ho;var qo=e=>/^image/.test(e.type),Yo=({addFilter:e,utils:t})=>{let{Type:i,isFile:a,getNumericAspectRatioFromString:n}=t,o=(p,c)=>!(!qo(p.file)||!c("GET_ALLOW_IMAGE_CROP")),l=p=>typeof p=="object",r=p=>typeof p=="number",s=(p,c)=>p.setMetadata("crop",Object.assign({},p.getMetadata("crop"),c));return e("DID_CREATE_ITEM",(p,{query:c})=>{p.extend("setImageCrop",d=>{if(!(!o(p,c)||!l(center)))return p.setMetadata("crop",d),d}),p.extend("setImageCropCenter",d=>{if(!(!o(p,c)||!l(d)))return s(p,{center:d})}),p.extend("setImageCropZoom",d=>{if(!(!o(p,c)||!r(d)))return s(p,{zoom:Math.max(1,d)})}),p.extend("setImageCropRotation",d=>{if(!(!o(p,c)||!r(d)))return s(p,{rotation:d})}),p.extend("setImageCropFlip",d=>{if(!(!o(p,c)||!l(d)))return s(p,{flip:d})}),p.extend("setImageCropAspectRatio",d=>{if(!o(p,c)||typeof d>"u")return;let m=p.getMetadata("crop"),u=n(d),f={center:{x:.5,y:.5},flip:m?Object.assign({},m.flip):{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:u};return p.setMetadata("crop",f),f})}),e("DID_LOAD_ITEM",(p,{query:c})=>new Promise((d,m)=>{let u=p.file;if(!a(u)||!qo(u)||!c("GET_ALLOW_IMAGE_CROP")||p.getMetadata("crop"))return d(p);let h=c("GET_IMAGE_CROP_ASPECT_RATIO");p.setMetadata("crop",{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:h?n(h):null}),d(p)})),{options:{allowImageCrop:[!0,i.BOOLEAN],imageCropAspectRatio:[null,i.STRING]}}},Zp=typeof window<"u"&&typeof window.document<"u";Zp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Yo}));var $o=Yo;var Ra=e=>/^image/.test(e.type),Xo=e=>{let{addFilter:t,utils:i,views:a}=e,{Type:n,createRoute:o,createItemAPI:l=c=>c}=i,{fileActionButton:r}=a;t("SHOULD_REMOVE_ON_REVERT",(c,{item:d,query:m})=>new Promise(u=>{let{file:f}=d,h=m("GET_ALLOW_IMAGE_EDIT")&&m("GET_IMAGE_EDIT_ALLOW_EDIT")&&Ra(f);u(!h)})),t("DID_LOAD_ITEM",(c,{query:d,dispatch:m})=>new Promise((u,f)=>{if(c.origin>1){u(c);return}let{file:h}=c;if(!d("GET_ALLOW_IMAGE_EDIT")||!d("GET_IMAGE_EDIT_INSTANT_EDIT")){u(c);return}if(!Ra(h)){u(c);return}let g=(E,T,v)=>y=>{s.shift(),y?T(E):v(E),m("KICK"),I()},I=()=>{if(!s.length)return;let{item:E,resolve:T,reject:v}=s[0];m("EDIT_ITEM",{id:E.id,handleEditorResponse:g(E,T,v)})};p({item:c,resolve:u,reject:f}),s.length===1&&I()})),t("DID_CREATE_ITEM",(c,{query:d,dispatch:m})=>{c.extend("edit",()=>{m("EDIT_ITEM",{id:c.id})})});let s=[],p=c=>(s.push(c),c);return t("CREATE_VIEW",c=>{let{is:d,view:m,query:u}=c;if(!u("GET_ALLOW_IMAGE_EDIT"))return;let f=u("GET_ALLOW_IMAGE_PREVIEW");if(!(d("file-info")&&!f||d("file")&&f))return;let g=u("GET_IMAGE_EDIT_EDITOR");if(!g)return;g.filepondCallbackBridge||(g.outputData=!0,g.outputFile=!1,g.filepondCallbackBridge={onconfirm:g.onconfirm||(()=>{}),oncancel:g.oncancel||(()=>{})});let I=({root:v,props:y,action:b})=>{let{id:w}=y,{handleEditorResponse:x}=b;g.cropAspectRatio=v.query("GET_IMAGE_CROP_ASPECT_RATIO")||g.cropAspectRatio,g.outputCanvasBackgroundColor=v.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||g.outputCanvasBackgroundColor;let _=v.query("GET_ITEM",w);if(!_)return;let P=_.file,O=_.getMetadata("crop"),M={center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},C=_.getMetadata("resize"),S=_.getMetadata("filter")||null,F=_.getMetadata("filters")||null,R=_.getMetadata("colors")||null,L=_.getMetadata("markup")||null,z={crop:O||M,size:C?{upscale:C.upscale,mode:C.mode,width:C.size.width,height:C.size.height}:null,filter:F?F.id||F.matrix:v.query("GET_ALLOW_IMAGE_FILTER")&&v.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!R?S:null,color:R,markup:L};g.onconfirm=({data:D})=>{let{crop:k,size:B,filter:X,color:Y,colorMatrix:Q,markup:pe}=D,G={};if(k&&(G.crop=k),B){let H=(_.getMetadata("resize")||{}).size,q={width:B.width,height:B.height};!(q.width&&q.height)&&H&&(q.width=H.width,q.height=H.height),(q.width||q.height)&&(G.resize={upscale:B.upscale,mode:B.mode,size:q})}pe&&(G.markup=pe),G.colors=Y,G.filters=X,G.filter=Q,_.setMetadata(G),g.filepondCallbackBridge.onconfirm(D,l(_)),x&&(g.onclose=()=>{x(!0),g.onclose=null})},g.oncancel=()=>{g.filepondCallbackBridge.oncancel(l(_)),x&&(g.onclose=()=>{x(!1),g.onclose=null})},g.open(P,z)},E=({root:v,props:y})=>{if(!u("GET_IMAGE_EDIT_ALLOW_EDIT"))return;let{id:b}=y,w=u("GET_ITEM",b);if(!w)return;let x=w.file;if(Ra(x))if(v.ref.handleEdit=_=>{_.stopPropagation(),v.dispatch("EDIT_ITEM",{id:b})},f){let _=m.createChildView(r,{label:"edit",icon:u("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});_.element.classList.add("filepond--action-edit-item"),_.element.dataset.align=u("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),_.on("click",v.ref.handleEdit),v.ref.buttonEditItem=m.appendChildView(_)}else{let _=m.element.querySelector(".filepond--file-info-main"),P=document.createElement("button");P.className="filepond--action-edit-item-alt",P.innerHTML=u("GET_IMAGE_EDIT_ICON_EDIT")+"edit",P.addEventListener("click",v.ref.handleEdit),_.appendChild(P),v.ref.editButton=P}};m.registerDestroyer(({root:v})=>{v.ref.buttonEditItem&&v.ref.buttonEditItem.off("click",v.ref.handleEdit),v.ref.editButton&&v.ref.editButton.removeEventListener("click",v.ref.handleEdit)});let T={EDIT_ITEM:I,DID_LOAD_ITEM:E};if(f){let v=({root:y})=>{y.ref.buttonEditItem&&(y.ref.buttonEditItem.opacity=1)};T.DID_IMAGE_PREVIEW_SHOW=v}m.registerWriter(o(T))}),{options:{allowImageEdit:[!0,n.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",n.STRING],imageEditInstantEdit:[!1,n.BOOLEAN],imageEditAllowEdit:[!0,n.BOOLEAN],imageEditIconEdit:['',n.STRING],imageEditEditor:[null,n.OBJECT]}}},Kp=typeof window<"u"&&typeof window.document<"u";Kp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Xo}));var Qo=Xo;var Jp=e=>/^image\/jpeg/.test(e.type),rt={JPEG:65496,APP1:65505,EXIF:1165519206,TIFF:18761,Orientation:274,Unknown:65280},st=(e,t,i=!1)=>e.getUint16(t,i),Zo=(e,t,i=!1)=>e.getUint32(t,i),em=e=>new Promise((t,i)=>{let a=new FileReader;a.onload=function(n){let o=new DataView(n.target.result);if(st(o,0)!==rt.JPEG){t(-1);return}let l=o.byteLength,r=2;for(;rtypeof window<"u"&&typeof window.document<"u")(),im=()=>tm,am="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",Ko,Ti=im()?new Image:{};Ti.onload=()=>Ko=Ti.naturalWidth>Ti.naturalHeight;Ti.src=am;var nm=()=>Ko,Jo=({addFilter:e,utils:t})=>{let{Type:i,isFile:a}=t;return e("DID_LOAD_ITEM",(n,{query:o})=>new Promise((l,r)=>{let s=n.file;if(!a(s)||!Jp(s)||!o("GET_ALLOW_IMAGE_EXIF_ORIENTATION")||!nm())return l(n);em(s).then(p=>{n.setMetadata("exif",{orientation:p}),l(n)})})),{options:{allowImageExifOrientation:[!0,i.BOOLEAN]}}},om=typeof window<"u"&&typeof window.document<"u";om&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Jo}));var el=Jo;var lm=e=>/^image/.test(e.type),tl=(e,t)=>jt(e.x*t,e.y*t),il=(e,t)=>jt(e.x+t.x,e.y+t.y),rm=e=>{let t=Math.sqrt(e.x*e.x+e.y*e.y);return t===0?{x:0,y:0}:jt(e.x/t,e.y/t)},Ii=(e,t,i)=>{let a=Math.cos(t),n=Math.sin(t),o=jt(e.x-i.x,e.y-i.y);return jt(i.x+a*o.x-n*o.y,i.y+n*o.x+a*o.y)},jt=(e=0,t=0)=>({x:e,y:t}),Te=(e,t,i=1,a)=>{if(typeof e=="string")return parseFloat(e)*i;if(typeof e=="number")return e*(a?t[a]:Math.min(t.width,t.height))},sm=(e,t,i)=>{let a=e.borderStyle||e.lineStyle||"solid",n=e.backgroundColor||e.fontColor||"transparent",o=e.borderColor||e.lineColor||"transparent",l=Te(e.borderWidth||e.lineWidth,t,i),r=e.lineCap||"round",s=e.lineJoin||"round",p=typeof a=="string"?"":a.map(d=>Te(d,t,i)).join(","),c=e.opacity||1;return{"stroke-linecap":r,"stroke-linejoin":s,"stroke-width":l||0,"stroke-dasharray":p,stroke:o,fill:n,opacity:c}},Se=e=>e!=null,cm=(e,t,i=1)=>{let a=Te(e.x,t,i,"width")||Te(e.left,t,i,"width"),n=Te(e.y,t,i,"height")||Te(e.top,t,i,"height"),o=Te(e.width,t,i,"width"),l=Te(e.height,t,i,"height"),r=Te(e.right,t,i,"width"),s=Te(e.bottom,t,i,"height");return Se(n)||(Se(l)&&Se(s)?n=t.height-l-s:n=s),Se(a)||(Se(o)&&Se(r)?a=t.width-o-r:a=r),Se(o)||(Se(a)&&Se(r)?o=t.width-a-r:o=0),Se(l)||(Se(n)&&Se(s)?l=t.height-n-s:l=0),{x:a||0,y:n||0,width:o||0,height:l||0}},dm=e=>e.map((t,i)=>`${i===0?"M":"L"} ${t.x} ${t.y}`).join(" "),Ce=(e,t)=>Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),pm="http://www.w3.org/2000/svg",_t=(e,t)=>{let i=document.createElementNS(pm,e);return t&&Ce(i,t),i},mm=e=>Ce(e,{...e.rect,...e.styles}),um=e=>{let t=e.rect.x+e.rect.width*.5,i=e.rect.y+e.rect.height*.5,a=e.rect.width*.5,n=e.rect.height*.5;return Ce(e,{cx:t,cy:i,rx:a,ry:n,...e.styles})},fm={contain:"xMidYMid meet",cover:"xMidYMid slice"},hm=(e,t)=>{Ce(e,{...e.rect,...e.styles,preserveAspectRatio:fm[t.fit]||"none"})},gm={left:"start",center:"middle",right:"end"},Em=(e,t,i,a)=>{let n=Te(t.fontSize,i,a),o=t.fontFamily||"sans-serif",l=t.fontWeight||"normal",r=gm[t.textAlign]||"start";Ce(e,{...e.rect,...e.styles,"stroke-width":0,"font-weight":l,"font-size":n,"font-family":o,"text-anchor":r}),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},bm=(e,t,i,a)=>{Ce(e,{...e.rect,...e.styles,fill:"none"});let n=e.childNodes[0],o=e.childNodes[1],l=e.childNodes[2],r=e.rect,s={x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height};if(Ce(n,{x1:r.x,y1:r.y,x2:s.x,y2:s.y}),!t.lineDecoration)return;o.style.display="none",l.style.display="none";let p=rm({x:s.x-r.x,y:s.y-r.y}),c=Te(.05,i,a);if(t.lineDecoration.indexOf("arrow-begin")!==-1){let d=tl(p,c),m=il(r,d),u=Ii(r,2,m),f=Ii(r,-2,m);Ce(o,{style:"display:block;",d:`M${u.x},${u.y} L${r.x},${r.y} L${f.x},${f.y}`})}if(t.lineDecoration.indexOf("arrow-end")!==-1){let d=tl(p,-c),m=il(s,d),u=Ii(s,2,m),f=Ii(s,-2,m);Ce(l,{style:"display:block;",d:`M${u.x},${u.y} L${s.x},${s.y} L${f.x},${f.y}`})}},Tm=(e,t,i,a)=>{Ce(e,{...e.styles,fill:"none",d:dm(t.points.map(n=>({x:Te(n.x,i,a,"width"),y:Te(n.y,i,a,"height")})))})},vi=e=>t=>_t(e,{id:t.id}),Im=e=>{let t=_t("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=()=>{t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},vm=e=>{let t=_t("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=_t("line");t.appendChild(i);let a=_t("path");t.appendChild(a);let n=_t("path");return t.appendChild(n),t},xm={image:Im,rect:vi("rect"),ellipse:vi("ellipse"),text:vi("text"),path:vi("path"),line:vm},ym={rect:mm,ellipse:um,image:hm,text:Em,path:Tm,line:bm},_m=(e,t)=>xm[e](t),Rm=(e,t,i,a,n)=>{t!=="path"&&(e.rect=cm(i,a,n)),e.styles=sm(i,a,n),ym[t](e,i,a,n)},wm=["x","y","left","top","right","bottom","width","height"],Sm=e=>typeof e=="string"&&/%/.test(e)?parseFloat(e)/100:e,Lm=e=>{let[t,i]=e,a=i.points?{}:wm.reduce((n,o)=>(n[o]=Sm(i[o]),n),{});return[t,{zIndex:0,...i,...a}]},Am=(e,t)=>e[1].zIndex>t[1].zIndex?1:e[1].zIndexe.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:({root:t,props:i})=>{if(!i.dirty)return;let{crop:a,resize:n,markup:o}=i,l=i.width,r=i.height,s=a.width,p=a.height;if(n){let{size:u}=n,f=u&&u.width,h=u&&u.height,g=n.mode,I=n.upscale;f&&!h&&(h=f),h&&!f&&(f=h);let E=s{let[f,h]=u,g=_m(f,h);Rm(g,f,h,c,d),t.element.appendChild(g)})}}),Ht=(e,t)=>({x:e,y:t}),Om=(e,t)=>e.x*t.x+e.y*t.y,al=(e,t)=>Ht(e.x-t.x,e.y-t.y),Pm=(e,t)=>Om(al(e,t),al(e,t)),nl=(e,t)=>Math.sqrt(Pm(e,t)),ol=(e,t)=>{let i=e,a=1.5707963267948966,n=t,o=1.5707963267948966-t,l=Math.sin(a),r=Math.sin(n),s=Math.sin(o),p=Math.cos(o),c=i/l,d=c*r,m=c*s;return Ht(p*d,p*m)},Dm=(e,t)=>{let i=e.width,a=e.height,n=ol(i,t),o=ol(a,t),l=Ht(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),r=Ht(e.x+e.width+Math.abs(o.y),e.y+Math.abs(o.x)),s=Ht(e.x-Math.abs(o.y),e.y+e.height-Math.abs(o.x));return{width:nl(l,r),height:nl(l,s)}},Fm=(e,t,i=1)=>{let a=e.height/e.width,n=1,o=t,l=1,r=a;r>o&&(r=o,l=r/a);let s=Math.max(n/l,o/r),p=e.width/(i*s*l),c=p*t;return{width:p,height:c}},rl=(e,t,i,a)=>{let n=a.x>.5?1-a.x:a.x,o=a.y>.5?1-a.y:a.y,l=n*2*e.width,r=o*2*e.height,s=Dm(t,i);return Math.max(s.width/l,s.height/r)},sl=(e,t)=>{let i=e.width,a=i*t;a>e.height&&(a=e.height,i=a/t);let n=(e.width-i)*.5,o=(e.height-a)*.5;return{x:n,y:o,width:i,height:a}},zm=(e,t={})=>{let{zoom:i,rotation:a,center:n,aspectRatio:o}=t;o||(o=e.height/e.width);let l=Fm(e,o,i),r={x:l.width*.5,y:l.height*.5},s={x:0,y:0,width:l.width,height:l.height,center:r},p=typeof t.scaleToFit>"u"||t.scaleToFit,c=rl(e,sl(s,o),a,p?n:{x:.5,y:.5}),d=i*c;return{widthFloat:l.width/d,heightFloat:l.height/d,width:Math.round(l.width/d),height:Math.round(l.height/d)}},ze={type:"spring",stiffness:.5,damping:.45,mass:10},Cm=e=>e.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:({root:t,props:i})=>{t.appendChild(i.image)}}),Nm=e=>e.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:ze,originY:ze,scaleX:ze,scaleY:ze,translateX:ze,translateY:ze,rotateZ:ze}},create:({root:t,props:i})=>{i.width=i.image.width,i.height=i.image.height,t.ref.bitmap=t.appendChildView(t.createChildView(Cm(e),{image:i.image}))},write:({root:t,props:i})=>{let{flip:a}=i.crop,{bitmap:n}=t.ref;n.scaleX=a.horizontal?-1:1,n.scaleY=a.vertical?-1:1}}),Bm=e=>e.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function({root:t,props:i}){i.background&&(t.element.style.backgroundColor=i.background)},create:({root:t,props:i})=>{t.ref.image=t.appendChildView(t.createChildView(Nm(e),Object.assign({},i))),t.ref.createMarkup=()=>{t.ref.markup||(t.ref.markup=t.appendChildView(t.createChildView(Mm(e),Object.assign({},i))))},t.ref.destroyMarkup=()=>{t.ref.markup&&(t.removeChildView(t.ref.markup),t.ref.markup=null)};let a=t.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");a!==null&&(a==="grid"?t.element.dataset.transparencyIndicator=a:t.element.dataset.transparencyIndicator="color")},write:({root:t,props:i,shouldOptimize:a})=>{let{crop:n,markup:o,resize:l,dirty:r,width:s,height:p}=i;t.ref.image.crop=n;let c={x:0,y:0,width:s,height:p,center:{x:s*.5,y:p*.5}},d={width:t.ref.image.width,height:t.ref.image.height},m={x:n.center.x*d.width,y:n.center.y*d.height},u={x:c.center.x-d.width*n.center.x,y:c.center.y-d.height*n.center.y},f=Math.PI*2+n.rotation%(Math.PI*2),h=n.aspectRatio||d.height/d.width,g=typeof n.scaleToFit>"u"||n.scaleToFit,I=rl(d,sl(c,h),f,g?n.center:{x:.5,y:.5}),E=n.zoom*I;o&&o.length?(t.ref.createMarkup(),t.ref.markup.width=s,t.ref.markup.height=p,t.ref.markup.resize=l,t.ref.markup.dirty=r,t.ref.markup.markup=o,t.ref.markup.crop=zm(d,n)):t.ref.markup&&t.ref.destroyMarkup();let T=t.ref.image;if(a){T.originX=null,T.originY=null,T.translateX=null,T.translateY=null,T.rotateZ=null,T.scaleX=null,T.scaleY=null;return}T.originX=m.x,T.originY=m.y,T.translateX=u.x,T.translateY=u.y,T.rotateZ=f,T.scaleX=E,T.scaleY=E}}),km=e=>e.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:ze,scaleY:ze,translateY:ze,opacity:{type:"tween",duration:400}}},create:({root:t,props:i})=>{t.ref.clip=t.appendChildView(t.createChildView(Bm(e),{id:i.id,image:i.image,crop:i.crop,markup:i.markup,resize:i.resize,dirty:i.dirty,background:i.background}))},write:({root:t,props:i,shouldOptimize:a})=>{let{clip:n}=t.ref,{image:o,crop:l,markup:r,resize:s,dirty:p}=i;if(n.crop=l,n.markup=r,n.resize=s,n.dirty=p,n.opacity=a?0:1,a||t.rect.element.hidden)return;let c=o.height/o.width,d=l.aspectRatio||c,m=t.rect.inner.width,u=t.rect.inner.height,f=t.query("GET_IMAGE_PREVIEW_HEIGHT"),h=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),g=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),I=t.query("GET_PANEL_ASPECT_RATIO"),E=t.query("GET_ALLOW_MULTIPLE");I&&!E&&(f=m*I,d=I);let T=f!==null?f:Math.max(h,Math.min(m*d,g)),v=T/d;v>m&&(v=m,T=v*d),T>u&&(T=u,v=u/d),n.width=v,n.height=T}}),Vm=` +var Jl=Object.defineProperty;var er=(e,t)=>{for(var i in t)Jl(e,i,{get:t[i],enumerable:!0})};var na={};er(na,{FileOrigin:()=>zt,FileStatus:()=>Et,OptionTypes:()=>Gi,Status:()=>no,create:()=>ut,destroy:()=>ft,find:()=>Wi,getOptions:()=>Hi,parse:()=>Ui,registerPlugin:()=>Ie,setOptions:()=>Dt,supported:()=>Vi});var tr=e=>e instanceof HTMLElement,ir=(e,t=[],i=[])=>{let a={...e},n=[],o=[],l=()=>({...a}),r=()=>{let f=[...n];return n.length=0,f},s=()=>{let f=[...o];o.length=0,f.forEach(({type:h,data:g})=>{p(h,g)})},p=(f,h,g)=>{if(g&&!document.hidden){o.push({type:f,data:h});return}u[f]&&u[f](h),n.push({type:f,data:h})},c=(f,...h)=>m[f]?m[f](...h):null,d={getState:l,processActionQueue:r,processDispatchQueue:s,dispatch:p,query:c},m={};t.forEach(f=>{m={...f(a),...m}});let u={};return i.forEach(f=>{u={...f(p,c,a),...u}}),d},ar=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},te=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},We=e=>{let t={};return te(e,i=>{ar(t,i,e[i])}),t},se=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},nr="http://www.w3.org/2000/svg",or=["svg","path"],Oa=e=>or.includes(e),ni=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=Oa(e)?document.createElementNS(nr,e):document.createElement(e);return t&&(Oa(e)?se(a,"class",t):a.className=t),te(i,(n,o)=>{se(a,n,o)}),a},lr=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},rr=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),sr=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),cr=(()=>typeof window<"u"&&typeof window.document<"u")(),En=()=>cr,dr=En()?ni("svg"):{},pr="children"in dr?e=>e.children.length:e=>e.childNodes.length,bn=(e,t,i,a)=>{let n=i[0]||e.left,o=i[1]||e.top,l=n+e.width,r=o+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:o,right:l,bottom:r}};return t.filter(p=>!p.isRectIgnored()).map(p=>p.rect).forEach(p=>{Pa(s.inner,{...p.inner}),Pa(s.outer,{...p.outer})}),Da(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Da(s.outer),s},Pa=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Da=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},$e=e=>typeof e=="number",mr=(e,t,i,a=.001)=>Math.abs(e-t){let a=null,n=null,o=0,l=!1,p=We({interpolate:(c,d)=>{if(l)return;if(!($e(a)&&$e(n))){l=!0,o=0;return}let m=-(n-a)*e;o+=m/i,n+=o,o*=t,mr(n,a,o)||d?(n=a,o=0,l=!0,p.onupdate(n),p.oncomplete(n)):p.onupdate(n)},target:{set:c=>{if($e(c)&&!$e(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){l=!0,o=0,p.onupdate(n),p.oncomplete(n);return}l=!1},get:()=>a},resting:{get:()=>l},onupdate:c=>{},oncomplete:c=>{}});return p};var fr=e=>e<.5?2*e*e:-1+(4-2*e)*e,hr=({duration:e=500,easing:t=fr,delay:i=0}={})=>{let a=null,n,o,l=!0,r=!1,s=null,c=We({interpolate:(d,m)=>{l||s===null||(a===null&&(a=d),!(d-a=e||m?(n=1,o=r?0:1,c.onupdate(o*s),c.oncomplete(o*s),l=!0):(o=n/e,c.onupdate((n>=0?t(r?1-o:o):0)*s))))},target:{get:()=>r?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}dl},onupdate:d=>{},oncomplete:d=>{}});return c},Fa={spring:ur,tween:hr},gr=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,o=typeof a=="object"?{...a}:{};return Fa[n]?Fa[n](o):null},ji=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(o=>{let l=o,r=()=>i[o],s=p=>i[o]=p;typeof o=="object"&&(l=o.key,r=o.getter||r,s=o.setter||s),!(n[l]&&!a)&&(n[l]={get:r,set:s})})})},Er=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},o=[];return te(e,(l,r)=>{let s=gr(r);if(!s)return;s.onupdate=c=>{t[l]=c},s.target=n[l],ji([{key:l,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[l]}],[i,a],t,!0),o.push(s)}),{write:l=>{let r=document.hidden,s=!0;return o.forEach(p=>{p.resting||(s=!1),p.interpolate(l,r)}),s},destroy:()=>{}}},br=e=>(t,i)=>{e.addEventListener(t,i)},Tr=e=>(t,i)=>{e.removeEventListener(t,i)},vr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,viewState:n,view:o})=>{let l=[],r=br(o.element),s=Tr(o.element);return a.on=(p,c)=>{l.push({type:p,fn:c}),r(p,c)},a.off=(p,c)=>{l.splice(l.findIndex(d=>d.type===p&&d.fn===c),1),s(p,c)},{write:()=>!0,destroy:()=>{l.forEach(p=>{s(p.type,p.fn)})}}},Ir=({mixinConfig:e,viewProps:t,viewExternalAPI:i})=>{ji(e,i,t)},ue=e=>e!=null,xr={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},yr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,view:n})=>{let o={...t},l={};ji(e,[i,a],t);let r=()=>[t.translateX||0,t.translateY||0],s=()=>[t.scaleX||0,t.scaleY||0],p=()=>n.rect?bn(n.rect,n.childViews,r(),s()):null;return i.rect={get:p},a.rect={get:p},e.forEach(c=>{t[c]=typeof o[c]>"u"?xr[c]:o[c]}),{write:()=>{if(_r(l,t))return Rr(n.element,t),Object.assign(l,{...t}),!0},destroy:()=>{}}},_r=(e,t)=>{if(Object.keys(e).length!==Object.keys(t).length)return!0;for(let i in t)if(t[i]!==e[i])return!0;return!1},Rr=(e,{opacity:t,perspective:i,translateX:a,translateY:n,scaleX:o,scaleY:l,rotateX:r,rotateY:s,rotateZ:p,originX:c,originY:d,width:m,height:u})=>{let f="",h="";(ue(c)||ue(d))&&(h+=`transform-origin: ${c||0}px ${d||0}px;`),ue(i)&&(f+=`perspective(${i}px) `),(ue(a)||ue(n))&&(f+=`translate3d(${a||0}px, ${n||0}px, 0) `),(ue(o)||ue(l))&&(f+=`scale3d(${ue(o)?o:1}, ${ue(l)?l:1}, 1) `),ue(p)&&(f+=`rotateZ(${p}rad) `),ue(r)&&(f+=`rotateX(${r}rad) `),ue(s)&&(f+=`rotateY(${s}rad) `),f.length&&(h+=`transform:${f};`),ue(t)&&(h+=`opacity:${t};`,t===0&&(h+="visibility:hidden;"),t<1&&(h+="pointer-events:none;")),ue(u)&&(h+=`height:${u}px;`),ue(m)&&(h+=`width:${m}px;`);let g=e.elementCurrentStyle||"";(h.length!==g.length||h!==g)&&(e.style.cssText=h,e.elementCurrentStyle=h)},wr={styles:yr,listeners:vr,animations:Er,apis:Ir},za=(e={},t={},i={})=>(t.layoutCalculated||(e.paddingTop=parseInt(i.paddingTop,10)||0,e.marginTop=parseInt(i.marginTop,10)||0,e.marginRight=parseInt(i.marginRight,10)||0,e.marginBottom=parseInt(i.marginBottom,10)||0,e.marginLeft=parseInt(i.marginLeft,10)||0,t.layoutCalculated=!0),e.left=t.offsetLeft||0,e.top=t.offsetTop||0,e.width=t.offsetWidth||0,e.height=t.offsetHeight||0,e.right=e.left+e.width,e.bottom=e.top+e.height,e.scrollTop=t.scrollTop,e.hidden=t.offsetParent===null,e),ne=({tag:e="div",name:t=null,attributes:i={},read:a=()=>{},write:n=()=>{},create:o=()=>{},destroy:l=()=>{},filterFrameActionsForChild:r=(u,f)=>f,didCreateView:s=()=>{},didWriteView:p=()=>{},ignoreRect:c=!1,ignoreRectUpdate:d=!1,mixins:m=[]}={})=>(u,f={})=>{let h=ni(e,`filepond--${t}`,i),g=window.getComputedStyle(h,null),v=za(),E=null,T=!1,I=[],y=[],b={},w={},x=[n],_=[a],P=[l],O=()=>h,M=()=>I.concat(),C=()=>b,S=G=>(H,Y)=>H(G,Y),F=()=>E||(E=bn(v,I,[0,0],[1,1]),E),R=()=>g,L=()=>{E=null,I.forEach(Y=>Y._read()),!(d&&v.width&&v.height)&&za(v,h,g);let H={root:Q,props:f,rect:v};_.forEach(Y=>Y(H))},z=(G,H,Y)=>{let le=H.length===0;return x.forEach(ee=>{ee({props:f,root:Q,actions:H,timestamp:G,shouldOptimize:Y})===!1&&(le=!1)}),y.forEach(ee=>{ee.write(G)===!1&&(le=!1)}),I.filter(ee=>!!ee.element.parentNode).forEach(ee=>{ee._write(G,r(ee,H),Y)||(le=!1)}),I.forEach((ee,V)=>{ee.element.parentNode||(Q.appendChild(ee.element,V),ee._read(),ee._write(G,r(ee,H),Y),le=!1)}),T=le,p({props:f,root:Q,actions:H,timestamp:G}),le},D=()=>{y.forEach(G=>G.destroy()),P.forEach(G=>{G({root:Q,props:f})}),I.forEach(G=>G._destroy())},k={element:{get:O},style:{get:R},childViews:{get:M}},B={...k,rect:{get:F},ref:{get:C},is:G=>t===G,appendChild:lr(h),createChildView:S(u),linkView:G=>(I.push(G),G),unlinkView:G=>{I.splice(I.indexOf(G),1)},appendChildView:rr(h,I),removeChildView:sr(h,I),registerWriter:G=>x.push(G),registerReader:G=>_.push(G),registerDestroyer:G=>P.push(G),invalidateLayout:()=>h.layoutCalculated=!1,dispatch:u.dispatch,query:u.query},X={element:{get:O},childViews:{get:M},rect:{get:F},resting:{get:()=>T},isRectIgnored:()=>c,_read:L,_write:z,_destroy:D},q={...k,rect:{get:()=>v}};Object.keys(m).sort((G,H)=>G==="styles"?1:H==="styles"?-1:0).forEach(G=>{let H=wr[G]({mixinConfig:m[G],viewProps:f,viewState:w,viewInternalAPI:B,viewExternalAPI:X,view:We(q)});H&&y.push(H)});let Q=We(B);o({root:Q,props:f});let pe=pr(h);return I.forEach((G,H)=>{Q.appendChild(G.element,pe+H)}),s(Q),We(X)},Sr=(e,t,i=60)=>{let a="__framePainter";if(window[a]){window[a].readers.push(e),window[a].writers.push(t);return}window[a]={readers:[e],writers:[t]};let n=window[a],o=1e3/i,l=null,r=null,s=null,p=null,c=()=>{document.hidden?(s=()=>window.setTimeout(()=>d(performance.now()),o),p=()=>window.clearTimeout(r)):(s=()=>window.requestAnimationFrame(d),p=()=>window.cancelAnimationFrame(r))};document.addEventListener("visibilitychange",()=>{p&&p(),c(),d(performance.now())});let d=m=>{r=s(d),l||(l=m);let u=m-l;u<=o||(l=m-u%o,n.readers.forEach(f=>f()),n.writers.forEach(f=>f(m)))};return c(),d(performance.now()),{pause:()=>{p(r)}}},he=(e,t)=>({root:i,props:a,actions:n=[],timestamp:o,shouldOptimize:l})=>{n.filter(r=>e[r.type]).forEach(r=>e[r.type]({root:i,props:a,action:r.data,timestamp:o,shouldOptimize:l})),t&&t({root:i,props:a,actions:n,timestamp:o,shouldOptimize:l})},Ca=(e,t)=>t.parentNode.insertBefore(e,t),Na=(e,t)=>t.parentNode.insertBefore(e,t.nextSibling),si=e=>Array.isArray(e),Be=e=>e==null,Lr=e=>e.trim(),ci=e=>""+e,Ar=(e,t=",")=>Be(e)?[]:si(e)?e:ci(e).split(t).map(Lr).filter(i=>i.length),Tn=e=>typeof e=="boolean",vn=e=>Tn(e)?e:e==="true",fe=e=>typeof e=="string",In=e=>$e(e)?e:fe(e)?ci(e).replace(/[a-z]+/gi,""):0,ai=e=>parseInt(In(e),10),Ba=e=>parseFloat(In(e)),gt=e=>$e(e)&&isFinite(e)&&Math.floor(e)===e,ka=(e,t=1e3)=>{if(gt(e))return e;let i=ci(e).trim();return/MB$/i.test(i)?(i=i.replace(/MB$i/,"").trim(),ai(i)*t*t):/KB/i.test(i)?(i=i.replace(/KB$i/,"").trim(),ai(i)*t):ai(i)},Xe=e=>typeof e=="function",Mr=e=>{let t=self,i=e.split("."),a=null;for(;a=i.shift();)if(t=t[a],!t)return null;return t},Va={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},Or=e=>{let t={};return t.url=fe(e)?e:e.url||"",t.timeout=e.timeout?parseInt(e.timeout,10):0,t.headers=e.headers?e.headers:{},te(Va,i=>{t[i]=Pr(i,e[i],Va[i],t.timeout,t.headers)}),t.process=e.process||fe(e)||e.url?t.process:null,t.remove=e.remove||null,delete t.headers,t},Pr=(e,t,i,a,n)=>{if(t===null)return null;if(typeof t=="function")return t;let o={url:i==="GET"||i==="PATCH"?`?${e}=`:"",method:i,headers:n,withCredentials:!1,timeout:a,onload:null,ondata:null,onerror:null};if(fe(t))return o.url=t,o;if(Object.assign(o,t),fe(o.headers)){let l=o.headers.split(/:(.+)/);o.headers={header:l[0],value:l[1]}}return o.withCredentials=vn(o.withCredentials),o},Dr=e=>Or(e),Fr=e=>e===null,ce=e=>typeof e=="object"&&e!==null,zr=e=>ce(e)&&fe(e.url)&&ce(e.process)&&ce(e.revert)&&ce(e.restore)&&ce(e.fetch),Pi=e=>si(e)?"array":Fr(e)?"null":gt(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":zr(e)?"api":typeof e,Cr=e=>e.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'),Nr={array:Ar,boolean:vn,int:e=>Pi(e)==="bytes"?ka(e):ai(e),number:Ba,float:Ba,bytes:ka,string:e=>Xe(e)?e:ci(e),function:e=>Mr(e),serverapi:Dr,object:e=>{try{return JSON.parse(Cr(e))}catch{return null}}},Br=(e,t)=>Nr[t](e),xn=(e,t,i)=>{if(e===t)return e;let a=Pi(e);if(a!==i){let n=Br(e,i);if(a=Pi(n),n===null)throw`Trying to assign value with incorrect type to "${option}", allowed type: "${i}"`;e=n}return e},kr=(e,t)=>{let i=e;return{enumerable:!0,get:()=>i,set:a=>{i=xn(a,e,t)}}},Vr=e=>{let t={};return te(e,i=>{let a=e[i];t[i]=kr(a[0],a[1])}),We(t)},Gr=e=>({items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:Vr(e)}),di=(e,t="-")=>e.split(/(?=[A-Z])/).map(i=>i.toLowerCase()).join(t),Ur=(e,t)=>{let i={};return te(t,a=>{i[a]={get:()=>e.getState().options[a],set:n=>{e.dispatch(`SET_${di(a,"_").toUpperCase()}`,{value:n})}}}),i},Wr=e=>(t,i,a)=>{let n={};return te(e,o=>{let l=di(o,"_").toUpperCase();n[`SET_${l}`]=r=>{try{a.options[o]=r.value}catch{}t(`DID_SET_${l}`,{value:a.options[o]})}}),n},Hr=e=>t=>{let i={};return te(e,a=>{i[`GET_${di(a,"_").toUpperCase()}`]=n=>t.options[a]}),i},_e={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5},Yi=()=>Math.random().toString(36).substring(2,11),qi=(e,t)=>e.splice(t,1),jr=(e,t)=>{t?e():document.hidden?Promise.resolve(1).then(e):setTimeout(e,0)},pi=()=>{let e=[],t=(a,n)=>{qi(e,e.findIndex(o=>o.event===a&&(o.cb===n||!n)))},i=(a,n,o)=>{e.filter(l=>l.event===a).map(l=>l.cb).forEach(l=>jr(()=>l(...n),o))};return{fireSync:(a,...n)=>{i(a,n,!0)},fire:(a,...n)=>{i(a,n,!1)},on:(a,n)=>{e.push({event:a,cb:n})},onOnce:(a,n)=>{e.push({event:a,cb:(...o)=>{t(a,n),n(...o)}})},off:t}},yn=(e,t,i)=>{Object.getOwnPropertyNames(e).filter(a=>!i.includes(a)).forEach(a=>Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(e,a)))},Yr=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],ge=e=>{let t={};return yn(e,t,Yr),t},qr=e=>{e.forEach((t,i)=>{t.released&&qi(e,i)})},W={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},re={INPUT:1,LIMBO:2,LOCAL:3},_n=e=>/[^0-9]+/.exec(e),Rn=()=>_n(1.1.toLocaleString())[0],$r=()=>{let e=Rn(),t=1e3.toLocaleString(),i=1e3.toString();return t!==i?_n(t)[0]:e==="."?",":"."},A={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},$i=[],Ae=(e,t,i)=>new Promise((a,n)=>{let o=$i.filter(r=>r.key===e).map(r=>r.cb);if(o.length===0){a(t);return}let l=o.shift();o.reduce((r,s)=>r.then(p=>s(p,i)),l(t,i)).then(r=>a(r)).catch(r=>n(r))}),tt=(e,t,i)=>$i.filter(a=>a.key===e).map(a=>a.cb(t,i)),Xr=(e,t)=>$i.push({key:e,cb:t}),Qr=e=>Object.assign(dt,e),oi=()=>({...dt}),Zr=e=>{te(e,(t,i)=>{dt[t]&&(dt[t][0]=xn(i,dt[t][0],dt[t][1]))})},dt={id:[null,A.STRING],name:["filepond",A.STRING],disabled:[!1,A.BOOLEAN],className:[null,A.STRING],required:[!1,A.BOOLEAN],captureMethod:[null,A.STRING],allowSyncAcceptAttribute:[!0,A.BOOLEAN],allowDrop:[!0,A.BOOLEAN],allowBrowse:[!0,A.BOOLEAN],allowPaste:[!0,A.BOOLEAN],allowMultiple:[!1,A.BOOLEAN],allowReplace:[!0,A.BOOLEAN],allowRevert:[!0,A.BOOLEAN],allowRemove:[!0,A.BOOLEAN],allowProcess:[!0,A.BOOLEAN],allowReorder:[!1,A.BOOLEAN],allowDirectoriesOnly:[!1,A.BOOLEAN],storeAsFile:[!1,A.BOOLEAN],forceRevert:[!1,A.BOOLEAN],maxFiles:[null,A.INT],checkValidity:[!1,A.BOOLEAN],itemInsertLocationFreedom:[!0,A.BOOLEAN],itemInsertLocation:["before",A.STRING],itemInsertInterval:[75,A.INT],dropOnPage:[!1,A.BOOLEAN],dropOnElement:[!0,A.BOOLEAN],dropValidation:[!1,A.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],A.ARRAY],instantUpload:[!0,A.BOOLEAN],maxParallelUploads:[2,A.INT],allowMinimumUploadDuration:[!0,A.BOOLEAN],chunkUploads:[!1,A.BOOLEAN],chunkForce:[!1,A.BOOLEAN],chunkSize:[5e6,A.INT],chunkRetryDelays:[[500,1e3,3e3],A.ARRAY],server:[null,A.SERVER_API],fileSizeBase:[1e3,A.INT],labelFileSizeBytes:["bytes",A.STRING],labelFileSizeKilobytes:["KB",A.STRING],labelFileSizeMegabytes:["MB",A.STRING],labelFileSizeGigabytes:["GB",A.STRING],labelDecimalSeparator:[Rn(),A.STRING],labelThousandsSeparator:[$r(),A.STRING],labelIdle:['Drag & Drop your files or Browse',A.STRING],labelInvalidField:["Field contains invalid files",A.STRING],labelFileWaitingForSize:["Waiting for size",A.STRING],labelFileSizeNotAvailable:["Size not available",A.STRING],labelFileCountSingular:["file in list",A.STRING],labelFileCountPlural:["files in list",A.STRING],labelFileLoading:["Loading",A.STRING],labelFileAdded:["Added",A.STRING],labelFileLoadError:["Error during load",A.STRING],labelFileRemoved:["Removed",A.STRING],labelFileRemoveError:["Error during remove",A.STRING],labelFileProcessing:["Uploading",A.STRING],labelFileProcessingComplete:["Upload complete",A.STRING],labelFileProcessingAborted:["Upload cancelled",A.STRING],labelFileProcessingError:["Error during upload",A.STRING],labelFileProcessingRevertError:["Error during revert",A.STRING],labelTapToCancel:["tap to cancel",A.STRING],labelTapToRetry:["tap to retry",A.STRING],labelTapToUndo:["tap to undo",A.STRING],labelButtonRemoveItem:["Remove",A.STRING],labelButtonAbortItemLoad:["Abort",A.STRING],labelButtonRetryItemLoad:["Retry",A.STRING],labelButtonAbortItemProcessing:["Cancel",A.STRING],labelButtonUndoItemProcessing:["Undo",A.STRING],labelButtonRetryItemProcessing:["Retry",A.STRING],labelButtonProcessItem:["Upload",A.STRING],iconRemove:['',A.STRING],iconProcess:['',A.STRING],iconRetry:['',A.STRING],iconUndo:['',A.STRING],iconDone:['',A.STRING],oninit:[null,A.FUNCTION],onwarning:[null,A.FUNCTION],onerror:[null,A.FUNCTION],onactivatefile:[null,A.FUNCTION],oninitfile:[null,A.FUNCTION],onaddfilestart:[null,A.FUNCTION],onaddfileprogress:[null,A.FUNCTION],onaddfile:[null,A.FUNCTION],onprocessfilestart:[null,A.FUNCTION],onprocessfileprogress:[null,A.FUNCTION],onprocessfileabort:[null,A.FUNCTION],onprocessfilerevert:[null,A.FUNCTION],onprocessfile:[null,A.FUNCTION],onprocessfiles:[null,A.FUNCTION],onremovefile:[null,A.FUNCTION],onpreparefile:[null,A.FUNCTION],onupdatefiles:[null,A.FUNCTION],onreorderfiles:[null,A.FUNCTION],beforeDropFile:[null,A.FUNCTION],beforeAddFile:[null,A.FUNCTION],beforeRemoveFile:[null,A.FUNCTION],beforePrepareFile:[null,A.FUNCTION],stylePanelLayout:[null,A.STRING],stylePanelAspectRatio:[null,A.STRING],styleItemPanelAspectRatio:[null,A.STRING],styleButtonRemoveItemPosition:["left",A.STRING],styleButtonProcessItemPosition:["right",A.STRING],styleLoadIndicatorPosition:["right",A.STRING],styleProgressIndicatorPosition:["right",A.STRING],styleButtonRemoveItemAlign:[!1,A.BOOLEAN],files:[[],A.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],A.ARRAY]},Qe=(e,t)=>Be(t)?e[0]||null:gt(t)?e[t]||null:(typeof t=="object"&&(t=t.id),e.find(i=>i.id===t)||null),wn=e=>{if(Be(e))return e;if(/:/.test(e)){let t=e.split(":");return t[1]/t[0]}return parseFloat(e)},Me=e=>e.filter(t=>!t.archived),Sn={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},Zt=null,Kr=()=>{if(Zt===null)try{let e=new DataTransfer;e.items.add(new File(["hello world"],"This_Works.txt"));let t=document.createElement("input");t.setAttribute("type","file"),t.files=e.files,Zt=t.files.length===1}catch{Zt=!1}return Zt},Jr=[W.LOAD_ERROR,W.PROCESSING_ERROR,W.PROCESSING_REVERT_ERROR],es=[W.LOADING,W.PROCESSING,W.PROCESSING_QUEUED,W.INIT],ts=[W.PROCESSING_COMPLETE],is=e=>Jr.includes(e.status),as=e=>es.includes(e.status),ns=e=>ts.includes(e.status),Ga=e=>ce(e.options.server)&&(ce(e.options.server.process)||Xe(e.options.server.process)),os=e=>({GET_STATUS:()=>{let t=Me(e.items),{EMPTY:i,ERROR:a,BUSY:n,IDLE:o,READY:l}=Sn;return t.length===0?i:t.some(is)?a:t.some(as)?n:t.some(ns)?l:o},GET_ITEM:t=>Qe(e.items,t),GET_ACTIVE_ITEM:t=>Qe(Me(e.items),t),GET_ACTIVE_ITEMS:()=>Me(e.items),GET_ITEMS:()=>e.items,GET_ITEM_NAME:t=>{let i=Qe(e.items,t);return i?i.filename:null},GET_ITEM_SIZE:t=>{let i=Qe(e.items,t);return i?i.fileSize:null},GET_STYLES:()=>Object.keys(e.options).filter(t=>/^style/.test(t)).map(t=>({name:t,value:e.options[t]})),GET_PANEL_ASPECT_RATIO:()=>/circle/.test(e.options.stylePanelLayout)?1:wn(e.options.stylePanelAspectRatio),GET_ITEM_PANEL_ASPECT_RATIO:()=>e.options.styleItemPanelAspectRatio,GET_ITEMS_BY_STATUS:t=>Me(e.items).filter(i=>i.status===t),GET_TOTAL_ITEMS:()=>Me(e.items).length,SHOULD_UPDATE_FILE_INPUT:()=>e.options.storeAsFile&&Kr()&&!Ga(e),IS_ASYNC:()=>Ga(e),GET_FILE_SIZE_LABELS:t=>({labelBytes:t("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:t("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:t("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:t("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0})}),ls=e=>{let t=Me(e.items).length;if(!e.options.allowMultiple)return t===0;let i=e.options.maxFiles;return i===null||tMath.max(Math.min(i,e),t),rs=(e,t,i)=>e.splice(t,0,i),ss=(e,t,i)=>Be(t)?null:typeof i>"u"?(e.push(t),t):(i=Ln(i,0,e.length),rs(e,i,t),t),Di=e=>/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e),Ft=e=>`${e}`.split("/").pop().split("?").shift(),mi=e=>e.split(".").pop(),cs=e=>{if(typeof e!="string")return"";let t=e.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?t==="jpeg"?"jpg":t:""},At=(e,t="")=>(t+e).slice(-t.length),An=(e=new Date)=>`${e.getFullYear()}-${At(e.getMonth()+1,"00")}-${At(e.getDate(),"00")}_${At(e.getHours(),"00")}-${At(e.getMinutes(),"00")}-${At(e.getSeconds(),"00")}`,ht=(e,t,i=null,a=null)=>{let n=typeof i=="string"?e.slice(0,e.size,i):e.slice(0,e.size,e.type);return n.lastModifiedDate=new Date,e._relativePath&&(n._relativePath=e._relativePath),fe(t)||(t=An()),t&&a===null&&mi(t)?n.name=t:(a=a||cs(n.type),n.name=t+(a?"."+a:"")),n},ds=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,Mn=(e,t)=>{let i=ds();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},ps=(e,t)=>{let i=new ArrayBuffer(e.length),a=new Uint8Array(i);for(let n=0;n(/^data:(.+);/.exec(e)||[])[1]||null,ms=e=>e.split(",")[1].replace(/\s/g,""),us=e=>atob(ms(e)),fs=e=>{let t=On(e),i=us(e);return ps(i,t)},hs=(e,t,i)=>ht(fs(e),t,null,i),gs=e=>{if(!/^content-disposition:/i.test(e))return null;let t=e.split(/filename=|filename\*=.+''/).splice(1).map(i=>i.trim().replace(/^["']|[;"']{0,2}$/g,"")).filter(i=>i.length);return t.length?decodeURI(t[t.length-1]):null},Es=e=>{if(/content-length:/i.test(e)){let t=e.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},bs=e=>/x-content-transfer-id:/i.test(e)&&(e.split(":")[1]||"").trim()||null,Xi=e=>{let t={source:null,name:null,size:null},i=e.split(` +`);for(let a of i){let n=gs(a);if(n){t.name=n;continue}let o=Es(a);if(o){t.size=o;continue}let l=bs(a);if(l){t.source=l;continue}}return t},Ts=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let r=t.source;l.fire("init",r),r instanceof File?l.fire("load",r):r instanceof Blob?l.fire("load",ht(r,r.name)):Di(r)?l.fire("load",hs(r)):o(r)},o=r=>{if(!e){l.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(r,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=ht(s,s.name||Ft(r))),l.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{l.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,p,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=p/c,l.fire("progress",t.progress)},()=>{l.fire("abort")},s=>{let p=Xi(typeof s=="string"?s:s.headers);l.fire("meta",{size:t.size||p.size,filename:p.name,source:p.source})})},l={...pi(),setSource:r=>t.source=r,getProgress:i,abort:a,load:n};return l},Ua=e=>/GET|HEAD/.test(e),Ze=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,l.abort()}},n=!1,o=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),Ua(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let l=new XMLHttpRequest,r=Ua(i.method)?l:l.upload;return r.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},l.onreadystatechange=()=>{l.readyState<2||l.readyState===4&&l.status===0||o||(o=!0,a.onheaders(l))},l.onload=()=>{l.status>=200&&l.status<300?a.onload(l):a.onerror(l)},l.onerror=()=>a.onerror(l),l.onabort=()=>{n=!0,a.onabort()},l.ontimeout=()=>a.ontimeout(l),l.open(i.method,t,!0),gt(i.timeout)&&(l.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let p=unescape(encodeURIComponent(i.headers[s]));l.setRequestHeader(s,p)}),i.responseType&&(l.responseType=i.responseType),i.withCredentials&&(l.withCredentials=!0),l.send(e),a},ie=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),Ke=e=>t=>{e(ie("error",0,"Timeout",t.getAllResponseHeaders()))},Wa=e=>/\?/.test(e),Pt=(...e)=>{let t="";return e.forEach(i=>{t+=Wa(t)&&Wa(i)?i.replace(/\?/,"&"):i}),t},wi=(e="",t)=>{if(typeof t=="function")return t;if(!t||!fe(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,o,l,r,s,p)=>{let c=Ze(n,Pt(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let m=d.getAllResponseHeaders(),u=Xi(m).name||Ft(n);o(ie("load",d.status,t.method==="HEAD"?null:ht(i(d.response),u),m))},c.onerror=d=>{l(ie("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{p(ie("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=Ke(l),c.onprogress=r,c.onabort=s,c}},xe={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},vs=(e,t,i,a,n,o,l,r,s,p,c)=>{let d=[],{chunkTransferId:m,chunkServer:u,chunkSize:f,chunkRetryDelays:h}=c,g={serverId:m,aborted:!1},v=t.ondata||(S=>S),E=t.onload||((S,F)=>F==="HEAD"?S.getResponseHeader("Upload-Offset"):S.response),T=t.onerror||(S=>null),I=S=>{let F=new FormData;ce(n)&&F.append(i,JSON.stringify(n));let R=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:R},z=Ze(v(F),Pt(e,t.url),L);z.onload=D=>S(E(D,L.method)),z.onerror=D=>l(ie("error",D.status,T(D.response)||D.statusText,D.getAllResponseHeaders())),z.ontimeout=Ke(l)},y=S=>{let F=Pt(e,u.url,g.serverId),L={headers:typeof t.headers=="function"?t.headers(g.serverId):{...t.headers},method:"HEAD"},z=Ze(null,F,L);z.onload=D=>S(E(D,L.method)),z.onerror=D=>l(ie("error",D.status,T(D.response)||D.statusText,D.getAllResponseHeaders())),z.ontimeout=Ke(l)},b=Math.floor(a.size/f);for(let S=0;S<=b;S++){let F=S*f,R=a.slice(F,F+f,"application/offset+octet-stream");d[S]={index:S,size:R.size,offset:F,data:R,file:a,progress:0,retries:[...h],status:xe.QUEUED,error:null,request:null,timeout:null}}let w=()=>o(g.serverId),x=S=>S.status===xe.QUEUED||S.status===xe.ERROR,_=S=>{if(g.aborted)return;if(S=S||d.find(x),!S){d.every(k=>k.status===xe.COMPLETE)&&w();return}S.status=xe.PROCESSING,S.progress=null;let F=u.ondata||(k=>k),R=u.onerror||(k=>null),L=Pt(e,u.url,g.serverId),z=typeof u.headers=="function"?u.headers(S):{...u.headers,"Content-Type":"application/offset+octet-stream","Upload-Offset":S.offset,"Upload-Length":a.size,"Upload-Name":a.name},D=S.request=Ze(F(S.data),L,{...u,headers:z});D.onload=()=>{S.status=xe.COMPLETE,S.request=null,M()},D.onprogress=(k,B,X)=>{S.progress=k?B:null,O()},D.onerror=k=>{S.status=xe.ERROR,S.request=null,S.error=R(k.response)||k.statusText,P(S)||l(ie("error",k.status,R(k.response)||k.statusText,k.getAllResponseHeaders()))},D.ontimeout=k=>{S.status=xe.ERROR,S.request=null,P(S)||Ke(l)(k)},D.onabort=()=>{S.status=xe.QUEUED,S.request=null,s()}},P=S=>S.retries.length===0?!1:(S.status=xe.WAITING,clearTimeout(S.timeout),S.timeout=setTimeout(()=>{_(S)},S.retries.shift()),!0),O=()=>{let S=d.reduce((R,L)=>R===null||L.progress===null?null:R+L.progress,0);if(S===null)return r(!1,0,0);let F=d.reduce((R,L)=>R+L.size,0);r(!0,S,F)},M=()=>{d.filter(F=>F.status===xe.PROCESSING).length>=1||_()},C=()=>{d.forEach(S=>{clearTimeout(S.timeout),S.request&&S.request.abort()})};return g.serverId?y(S=>{g.aborted||(d.filter(F=>F.offset{F.status=xe.COMPLETE,F.progress=F.size}),M())}):I(S=>{g.aborted||(p(S),g.serverId=S,M())}),{abort:()=>{g.aborted=!0,C()}}},Is=(e,t,i,a)=>(n,o,l,r,s,p,c)=>{if(!n)return;let d=a.chunkUploads,m=d&&n.size>a.chunkSize,u=d&&(m||a.chunkForce);if(n instanceof Blob&&u)return vs(e,t,i,n,o,l,r,s,p,c,a);let f=t.ondata||(y=>y),h=t.onload||(y=>y),g=t.onerror||(y=>null),v=typeof t.headers=="function"?t.headers(n,o)||{}:{...t.headers},E={...t,headers:v};var T=new FormData;ce(o)&&T.append(i,JSON.stringify(o)),(n instanceof Blob?[{name:null,file:n}]:n).forEach(y=>{T.append(i,y.file,y.name===null?y.file.name:`${y.name}${y.file.name}`)});let I=Ze(f(T),Pt(e,t.url),E);return I.onload=y=>{l(ie("load",y.status,h(y.response),y.getAllResponseHeaders()))},I.onerror=y=>{r(ie("error",y.status,g(y.response)||y.statusText,y.getAllResponseHeaders()))},I.ontimeout=Ke(r),I.onprogress=s,I.onabort=p,I},xs=(e="",t,i,a)=>typeof t=="function"?(...n)=>t(i,...n,a):!t||!fe(t.url)?null:Is(e,t,i,a),Mt=(e="",t)=>{if(typeof t=="function")return t;if(!t||!fe(t.url))return(n,o)=>o();let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,o,l)=>{let r=Ze(n,e+t.url,t);return r.onload=s=>{o(ie("load",s.status,i(s.response),s.getAllResponseHeaders()))},r.onerror=s=>{l(ie("error",s.status,a(s.response)||s.statusText,s.getAllResponseHeaders()))},r.ontimeout=Ke(l),r}},Pn=(e=0,t=1)=>e+Math.random()*(t-e),ys=(e,t=1e3,i=0,a=25,n=250)=>{let o=null,l=Date.now(),r=()=>{let s=Date.now()-l,p=Pn(a,n);s+p>t&&(p=s+p-t);let c=s/t;if(c>=1||document.hidden){e(1);return}e(c),o=setTimeout(r,p)};return t>0&&r(),{clear:()=>{clearTimeout(o)}}},_s=(e,t)=>{let i={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},{allowMinimumUploadDuration:a}=t,n=(c,d)=>{let m=()=>{i.duration===0||i.progress===null||p.fire("progress",p.getProgress())},u=()=>{i.complete=!0,p.fire("load-perceived",i.response.body)};p.fire("start"),i.timestamp=Date.now(),i.perceivedPerformanceUpdater=ys(f=>{i.perceivedProgress=f,i.perceivedDuration=Date.now()-i.timestamp,m(),i.response&&i.perceivedProgress===1&&!i.complete&&u()},a?Pn(750,1500):0),i.request=e(c,d,f=>{i.response=ce(f)?f:{type:"load",code:200,body:`${f}`,headers:{}},i.duration=Date.now()-i.timestamp,i.progress=1,p.fire("load",i.response.body),(!a||a&&i.perceivedProgress===1)&&u()},f=>{i.perceivedPerformanceUpdater.clear(),p.fire("error",ce(f)?f:{type:"error",code:0,body:`${f}`})},(f,h,g)=>{i.duration=Date.now()-i.timestamp,i.progress=f?h/g:null,m()},()=>{i.perceivedPerformanceUpdater.clear(),p.fire("abort",i.response?i.response.body:null)},f=>{p.fire("transfer",f)})},o=()=>{i.request&&(i.perceivedPerformanceUpdater.clear(),i.request.abort&&i.request.abort(),i.complete=!0)},l=()=>{o(),i.complete=!1,i.perceivedProgress=0,i.progress=0,i.timestamp=null,i.perceivedDuration=0,i.duration=0,i.request=null,i.response=null},r=a?()=>i.progress?Math.min(i.progress,i.perceivedProgress):null:()=>i.progress||null,s=a?()=>Math.min(i.duration,i.perceivedDuration):()=>i.duration,p={...pi(),process:n,abort:o,getProgress:r,getDuration:s,reset:l};return p},Dn=e=>e.substring(0,e.lastIndexOf("."))||e,Rs=e=>{let t=[e.name,e.size,e.type];return e instanceof Blob||Di(e)?t[0]=e.name||An():Di(e)?(t[1]=e.length,t[2]=On(e)):fe(e)&&(t[0]=Ft(e),t[1]=0,t[2]="application/octet-stream"),{name:t[0],size:t[1],type:t[2]}},Je=e=>!!(e instanceof File||e instanceof Blob&&e.name),Fn=e=>{if(!ce(e))return e;let t=si(e)?[]:{};for(let i in e){if(!e.hasOwnProperty(i))continue;let a=e[i];t[i]=a&&ce(a)?Fn(a):a}return t},ws=(e=null,t=null,i=null)=>{let a=Yi(),n={archived:!1,frozen:!1,released:!1,source:null,file:i,serverFileReference:t,transferId:null,processingAborted:!1,status:t?W.PROCESSING_COMPLETE:W.INIT,activeLoader:null,activeProcessor:null},o=null,l={},r=x=>n.status=x,s=(x,..._)=>{n.released||n.frozen||b.fire(x,..._)},p=()=>mi(n.file.name),c=()=>n.file.type,d=()=>n.file.size,m=()=>n.file,u=(x,_,P)=>{if(n.source=x,b.fireSync("init"),n.file){b.fireSync("load-skip");return}n.file=Rs(x),_.on("init",()=>{s("load-init")}),_.on("meta",O=>{n.file.size=O.size,n.file.filename=O.filename,O.source&&(e=re.LIMBO,n.serverFileReference=O.source,n.status=W.PROCESSING_COMPLETE),s("load-meta")}),_.on("progress",O=>{r(W.LOADING),s("load-progress",O)}),_.on("error",O=>{r(W.LOAD_ERROR),s("load-request-error",O)}),_.on("abort",()=>{r(W.INIT),s("load-abort")}),_.on("load",O=>{n.activeLoader=null;let M=S=>{n.file=Je(S)?S:n.file,e===re.LIMBO&&n.serverFileReference?r(W.PROCESSING_COMPLETE):r(W.IDLE),s("load")},C=S=>{n.file=O,s("load-meta"),r(W.LOAD_ERROR),s("load-file-error",S)};if(n.serverFileReference){M(O);return}P(O,M,C)}),_.setSource(x),n.activeLoader=_,_.load()},f=()=>{n.activeLoader&&n.activeLoader.load()},h=()=>{if(n.activeLoader){n.activeLoader.abort();return}r(W.INIT),s("load-abort")},g=(x,_)=>{if(n.processingAborted){n.processingAborted=!1;return}if(r(W.PROCESSING),o=null,!(n.file instanceof Blob)){b.on("load",()=>{g(x,_)});return}x.on("load",M=>{n.transferId=null,n.serverFileReference=M}),x.on("transfer",M=>{n.transferId=M}),x.on("load-perceived",M=>{n.activeProcessor=null,n.transferId=null,n.serverFileReference=M,r(W.PROCESSING_COMPLETE),s("process-complete",M)}),x.on("start",()=>{s("process-start")}),x.on("error",M=>{n.activeProcessor=null,r(W.PROCESSING_ERROR),s("process-error",M)}),x.on("abort",M=>{n.activeProcessor=null,n.serverFileReference=M,r(W.IDLE),s("process-abort"),o&&o()}),x.on("progress",M=>{s("process-progress",M)});let P=M=>{n.archived||x.process(M,{...l})},O=console.error;_(n.file,P,O),n.activeProcessor=x},v=()=>{n.processingAborted=!1,r(W.PROCESSING_QUEUED)},E=()=>new Promise(x=>{if(!n.activeProcessor){n.processingAborted=!0,r(W.IDLE),s("process-abort"),x();return}o=()=>{x()},n.activeProcessor.abort()}),T=(x,_)=>new Promise((P,O)=>{let M=n.serverFileReference!==null?n.serverFileReference:n.transferId;if(M===null){P();return}x(M,()=>{n.serverFileReference=null,n.transferId=null,P()},C=>{if(!_){P();return}r(W.PROCESSING_REVERT_ERROR),s("process-revert-error"),O(C)}),r(W.IDLE),s("process-revert")}),I=(x,_,P)=>{let O=x.split("."),M=O[0],C=O.pop(),S=l;O.forEach(F=>S=S[F]),JSON.stringify(S[C])!==JSON.stringify(_)&&(S[C]=_,s("metadata-update",{key:M,value:l[M],silent:P}))},b={id:{get:()=>a},origin:{get:()=>e,set:x=>e=x},serverId:{get:()=>n.serverFileReference},transferId:{get:()=>n.transferId},status:{get:()=>n.status},filename:{get:()=>n.file.name},filenameWithoutExtension:{get:()=>Dn(n.file.name)},fileExtension:{get:p},fileType:{get:c},fileSize:{get:d},file:{get:m},relativePath:{get:()=>n.file._relativePath},source:{get:()=>n.source},getMetadata:x=>Fn(x?l[x]:l),setMetadata:(x,_,P)=>{if(ce(x)){let O=x;return Object.keys(O).forEach(M=>{I(M,O[M],_)}),x}return I(x,_,P),_},extend:(x,_)=>w[x]=_,abortLoad:h,retryLoad:f,requestProcessing:v,abortProcessing:E,load:u,process:g,revert:T,...pi(),freeze:()=>n.frozen=!0,release:()=>n.released=!0,released:{get:()=>n.released},archive:()=>n.archived=!0,archived:{get:()=>n.archived},setFile:x=>n.file=x},w=We(b);return w},Ss=(e,t)=>Be(t)?0:fe(t)?e.findIndex(i=>i.id===t):-1,Ha=(e,t)=>{let i=Ss(e,t);if(!(i<0))return e[i]||null},ja=(e,t,i,a,n,o)=>{let l=Ze(null,e,{method:"GET",responseType:"blob"});return l.onload=r=>{let s=r.getAllResponseHeaders(),p=Xi(s).name||Ft(e);t(ie("load",r.status,ht(r.response,p),s))},l.onerror=r=>{i(ie("error",r.status,r.statusText,r.getAllResponseHeaders()))},l.onheaders=r=>{o(ie("headers",r.status,null,r.getAllResponseHeaders()))},l.ontimeout=Ke(i),l.onprogress=a,l.onabort=n,l},Ya=e=>(e.indexOf("//")===0&&(e=location.protocol+e),e.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]),Ls=e=>(e.indexOf(":")>-1||e.indexOf("//")>-1)&&Ya(location.href)!==Ya(e),Kt=e=>(...t)=>Xe(e)?e(...t):e,As=e=>!Je(e.file),Si=(e,t)=>{clearTimeout(t.listUpdateTimeout),t.listUpdateTimeout=setTimeout(()=>{e("DID_UPDATE_ITEMS",{items:Me(t.items)})},0)},qa=(e,...t)=>new Promise(i=>{if(!e)return i(!0);let a=e(...t);if(a==null)return i(!0);if(typeof a=="boolean")return i(a);typeof a.then=="function"&&a.then(i)}),Li=(e,t)=>{e.items.sort((i,a)=>t(ge(i),ge(a)))},ye=(e,t)=>({query:i,success:a=()=>{},failure:n=()=>{},...o}={})=>{let l=Qe(e.items,i);if(!l){n({error:ie("error",0,"Item not found"),file:null});return}t(l,a,n,o||{})},Ms=(e,t,i)=>({ABORT_ALL:()=>{Me(i.items).forEach(a=>{a.freeze(),a.abortLoad(),a.abortProcessing()})},DID_SET_FILES:({value:a=[]})=>{let n=a.map(l=>({source:l.source?l.source:l,options:l.options})),o=Me(i.items);o.forEach(l=>{n.find(r=>r.source===l.source||r.source===l.file)||e("REMOVE_ITEM",{query:l,remove:!1})}),o=Me(i.items),n.forEach((l,r)=>{o.find(s=>s.source===l.source||s.file===l.source)||e("ADD_ITEM",{...l,interactionMethod:_e.NONE,index:r})})},DID_UPDATE_ITEM_METADATA:({id:a,action:n,change:o})=>{o.silent||(clearTimeout(i.itemUpdateTimeout),i.itemUpdateTimeout=setTimeout(()=>{let l=Ha(i.items,a);if(!t("IS_ASYNC")){Ae("SHOULD_PREPARE_OUTPUT",!1,{item:l,query:t,action:n,change:o}).then(c=>{let d=t("GET_BEFORE_PREPARE_FILE");d&&(c=d(l,c)),c&&e("REQUEST_PREPARE_OUTPUT",{query:a,item:l,success:m=>{e("DID_PREPARE_OUTPUT",{id:a,file:m})}},!0)});return}l.origin===re.LOCAL&&e("DID_LOAD_ITEM",{id:l.id,error:null,serverFileReference:l.source});let r=()=>{setTimeout(()=>{e("REQUEST_ITEM_PROCESSING",{query:a})},32)},s=c=>{l.revert(Mt(i.options.server.url,i.options.server.revert),t("GET_FORCE_REVERT")).then(c?r:()=>{}).catch(()=>{})},p=c=>{l.abortProcessing().then(c?r:()=>{})};if(l.status===W.PROCESSING_COMPLETE)return s(i.options.instantUpload);if(l.status===W.PROCESSING)return p(i.options.instantUpload);i.options.instantUpload&&r()},0))},MOVE_ITEM:({query:a,index:n})=>{let o=Qe(i.items,a);if(!o)return;let l=i.items.indexOf(o);n=Ln(n,0,i.items.length-1),l!==n&&i.items.splice(n,0,i.items.splice(l,1)[0])},SORT:({compare:a})=>{Li(i,a),e("DID_SORT_ITEMS",{items:t("GET_ACTIVE_ITEMS")})},ADD_ITEMS:({items:a,index:n,interactionMethod:o,success:l=()=>{},failure:r=()=>{}})=>{let s=n;if(n===-1||typeof n>"u"){let u=t("GET_ITEM_INSERT_LOCATION"),f=t("GET_TOTAL_ITEMS");s=u==="before"?0:f}let p=t("GET_IGNORED_FILES"),c=u=>Je(u)?!p.includes(u.name.toLowerCase()):!Be(u),m=a.filter(c).map(u=>new Promise((f,h)=>{e("ADD_ITEM",{interactionMethod:o,source:u.source||u,success:f,failure:h,index:s++,options:u.options||{}})}));Promise.all(m).then(l).catch(r)},ADD_ITEM:({source:a,index:n=-1,interactionMethod:o,success:l=()=>{},failure:r=()=>{},options:s={}})=>{if(Be(a)){r({error:ie("error",0,"No source"),file:null});return}if(Je(a)&&i.options.ignoredFiles.includes(a.name.toLowerCase()))return;if(!ls(i)){if(i.options.allowMultiple||!i.options.allowMultiple&&!i.options.allowReplace){let E=ie("warning",0,"Max files");e("DID_THROW_MAX_FILES",{source:a,error:E}),r({error:E,file:null});return}let v=Me(i.items)[0];if(v.status===W.PROCESSING_COMPLETE||v.status===W.PROCESSING_REVERT_ERROR){let E=t("GET_FORCE_REVERT");if(v.revert(Mt(i.options.server.url,i.options.server.revert),E).then(()=>{E&&e("ADD_ITEM",{source:a,index:n,interactionMethod:o,success:l,failure:r,options:s})}).catch(()=>{}),E)return}e("REMOVE_ITEM",{query:v.id})}let p=s.type==="local"?re.LOCAL:s.type==="limbo"?re.LIMBO:re.INPUT,c=ws(p,p===re.INPUT?null:a,s.file);Object.keys(s.metadata||{}).forEach(v=>{c.setMetadata(v,s.metadata[v])}),tt("DID_CREATE_ITEM",c,{query:t,dispatch:e});let d=t("GET_ITEM_INSERT_LOCATION");i.options.itemInsertLocationFreedom||(n=d==="before"?-1:i.items.length),ss(i.items,c,n),Xe(d)&&a&&Li(i,d);let m=c.id;c.on("init",()=>{e("DID_INIT_ITEM",{id:m})}),c.on("load-init",()=>{e("DID_START_ITEM_LOAD",{id:m})}),c.on("load-meta",()=>{e("DID_UPDATE_ITEM_META",{id:m})}),c.on("load-progress",v=>{e("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:m,progress:v})}),c.on("load-request-error",v=>{let E=Kt(i.options.labelFileLoadError)(v);if(v.code>=400&&v.code<500){e("DID_THROW_ITEM_INVALID",{id:m,error:v,status:{main:E,sub:`${v.code} (${v.body})`}}),r({error:v,file:ge(c)});return}e("DID_THROW_ITEM_LOAD_ERROR",{id:m,error:v,status:{main:E,sub:i.options.labelTapToRetry}})}),c.on("load-file-error",v=>{e("DID_THROW_ITEM_INVALID",{id:m,error:v.status,status:v.status}),r({error:v.status,file:ge(c)})}),c.on("load-abort",()=>{e("REMOVE_ITEM",{query:m})}),c.on("load-skip",()=>{c.on("metadata-update",v=>{Je(c.file)&&e("DID_UPDATE_ITEM_METADATA",{id:m,change:v})}),e("COMPLETE_LOAD_ITEM",{query:m,item:c,data:{source:a,success:l}})}),c.on("load",()=>{let v=E=>{if(!E){e("REMOVE_ITEM",{query:m});return}c.on("metadata-update",T=>{e("DID_UPDATE_ITEM_METADATA",{id:m,change:T})}),Ae("SHOULD_PREPARE_OUTPUT",!1,{item:c,query:t}).then(T=>{let I=t("GET_BEFORE_PREPARE_FILE");I&&(T=I(c,T));let y=()=>{e("COMPLETE_LOAD_ITEM",{query:m,item:c,data:{source:a,success:l}}),Si(e,i)};if(T){e("REQUEST_PREPARE_OUTPUT",{query:m,item:c,success:b=>{e("DID_PREPARE_OUTPUT",{id:m,file:b}),y()}},!0);return}y()})};Ae("DID_LOAD_ITEM",c,{query:t,dispatch:e}).then(()=>{qa(t("GET_BEFORE_ADD_FILE"),ge(c)).then(v)}).catch(E=>{if(!E||!E.error||!E.status)return v(!1);e("DID_THROW_ITEM_INVALID",{id:m,error:E.error,status:E.status})})}),c.on("process-start",()=>{e("DID_START_ITEM_PROCESSING",{id:m})}),c.on("process-progress",v=>{e("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:m,progress:v})}),c.on("process-error",v=>{e("DID_THROW_ITEM_PROCESSING_ERROR",{id:m,error:v,status:{main:Kt(i.options.labelFileProcessingError)(v),sub:i.options.labelTapToRetry}})}),c.on("process-revert-error",v=>{e("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:m,error:v,status:{main:Kt(i.options.labelFileProcessingRevertError)(v),sub:i.options.labelTapToRetry}})}),c.on("process-complete",v=>{e("DID_COMPLETE_ITEM_PROCESSING",{id:m,error:null,serverFileReference:v}),e("DID_DEFINE_VALUE",{id:m,value:v})}),c.on("process-abort",()=>{e("DID_ABORT_ITEM_PROCESSING",{id:m})}),c.on("process-revert",()=>{e("DID_REVERT_ITEM_PROCESSING",{id:m}),e("DID_DEFINE_VALUE",{id:m,value:null})}),e("DID_ADD_ITEM",{id:m,index:n,interactionMethod:o}),Si(e,i);let{url:u,load:f,restore:h,fetch:g}=i.options.server||{};c.load(a,Ts(p===re.INPUT?fe(a)&&Ls(a)&&g?wi(u,g):ja:p===re.LIMBO?wi(u,h):wi(u,f)),(v,E,T)=>{Ae("LOAD_FILE",v,{query:t}).then(E).catch(T)})},REQUEST_PREPARE_OUTPUT:({item:a,success:n,failure:o=()=>{}})=>{let l={error:ie("error",0,"Item not found"),file:null};if(a.archived)return o(l);Ae("PREPARE_OUTPUT",a.file,{query:t,item:a}).then(r=>{Ae("COMPLETE_PREPARE_OUTPUT",r,{query:t,item:a}).then(s=>{if(a.archived)return o(l);n(s)})})},COMPLETE_LOAD_ITEM:({item:a,data:n})=>{let{success:o,source:l}=n,r=t("GET_ITEM_INSERT_LOCATION");if(Xe(r)&&l&&Li(i,r),e("DID_LOAD_ITEM",{id:a.id,error:null,serverFileReference:a.origin===re.INPUT?null:l}),o(ge(a)),a.origin===re.LOCAL){e("DID_LOAD_LOCAL_ITEM",{id:a.id});return}if(a.origin===re.LIMBO){e("DID_COMPLETE_ITEM_PROCESSING",{id:a.id,error:null,serverFileReference:l}),e("DID_DEFINE_VALUE",{id:a.id,value:a.serverId||l});return}t("IS_ASYNC")&&i.options.instantUpload&&e("REQUEST_ITEM_PROCESSING",{query:a.id})},RETRY_ITEM_LOAD:ye(i,a=>{a.retryLoad()}),REQUEST_ITEM_PREPARE:ye(i,(a,n,o)=>{e("REQUEST_PREPARE_OUTPUT",{query:a.id,item:a,success:l=>{e("DID_PREPARE_OUTPUT",{id:a.id,file:l}),n({file:a,output:l})},failure:o},!0)}),REQUEST_ITEM_PROCESSING:ye(i,(a,n,o)=>{if(!(a.status===W.IDLE||a.status===W.PROCESSING_ERROR)){let r=()=>e("REQUEST_ITEM_PROCESSING",{query:a,success:n,failure:o}),s=()=>document.hidden?r():setTimeout(r,32);a.status===W.PROCESSING_COMPLETE||a.status===W.PROCESSING_REVERT_ERROR?a.revert(Mt(i.options.server.url,i.options.server.revert),t("GET_FORCE_REVERT")).then(s).catch(()=>{}):a.status===W.PROCESSING&&a.abortProcessing().then(s);return}a.status!==W.PROCESSING_QUEUED&&(a.requestProcessing(),e("DID_REQUEST_ITEM_PROCESSING",{id:a.id}),e("PROCESS_ITEM",{query:a,success:n,failure:o},!0))}),PROCESS_ITEM:ye(i,(a,n,o)=>{let l=t("GET_MAX_PARALLEL_UPLOADS");if(t("GET_ITEMS_BY_STATUS",W.PROCESSING).length===l){i.processingQueue.push({id:a.id,success:n,failure:o});return}if(a.status===W.PROCESSING)return;let s=()=>{let c=i.processingQueue.shift();if(!c)return;let{id:d,success:m,failure:u}=c,f=Qe(i.items,d);if(!f||f.archived){s();return}e("PROCESS_ITEM",{query:d,success:m,failure:u},!0)};a.onOnce("process-complete",()=>{n(ge(a)),s();let c=i.options.server;if(i.options.instantUpload&&a.origin===re.LOCAL&&Xe(c.remove)){let u=()=>{};a.origin=re.LIMBO,i.options.server.remove(a.source,u,u)}t("GET_ITEMS_BY_STATUS",W.PROCESSING_COMPLETE).length===i.items.length&&e("DID_COMPLETE_ITEM_PROCESSING_ALL")}),a.onOnce("process-error",c=>{o({error:c,file:ge(a)}),s()});let p=i.options;a.process(_s(xs(p.server.url,p.server.process,p.name,{chunkTransferId:a.transferId,chunkServer:p.server.patch,chunkUploads:p.chunkUploads,chunkForce:p.chunkForce,chunkSize:p.chunkSize,chunkRetryDelays:p.chunkRetryDelays}),{allowMinimumUploadDuration:t("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(c,d,m)=>{Ae("PREPARE_OUTPUT",c,{query:t,item:a}).then(u=>{e("DID_PREPARE_OUTPUT",{id:a.id,file:u}),d(u)}).catch(m)})}),RETRY_ITEM_PROCESSING:ye(i,a=>{e("REQUEST_ITEM_PROCESSING",{query:a})}),REQUEST_REMOVE_ITEM:ye(i,a=>{qa(t("GET_BEFORE_REMOVE_FILE"),ge(a)).then(n=>{n&&e("REMOVE_ITEM",{query:a})})}),RELEASE_ITEM:ye(i,a=>{a.release()}),REMOVE_ITEM:ye(i,(a,n,o,l)=>{let r=()=>{let p=a.id;Ha(i.items,p).archive(),e("DID_REMOVE_ITEM",{error:null,id:p,item:a}),Si(e,i),n(ge(a))},s=i.options.server;a.origin===re.LOCAL&&s&&Xe(s.remove)&&l.remove!==!1?(e("DID_START_ITEM_REMOVE",{id:a.id}),s.remove(a.source,()=>r(),p=>{e("DID_THROW_ITEM_REMOVE_ERROR",{id:a.id,error:ie("error",0,p,null),status:{main:Kt(i.options.labelFileRemoveError)(p),sub:i.options.labelTapToRetry}})})):((l.revert&&a.origin!==re.LOCAL&&a.serverId!==null||i.options.chunkUploads&&a.file.size>i.options.chunkSize||i.options.chunkUploads&&i.options.chunkForce)&&a.revert(Mt(i.options.server.url,i.options.server.revert),t("GET_FORCE_REVERT")),r())}),ABORT_ITEM_LOAD:ye(i,a=>{a.abortLoad()}),ABORT_ITEM_PROCESSING:ye(i,a=>{if(a.serverId){e("REVERT_ITEM_PROCESSING",{id:a.id});return}a.abortProcessing().then(()=>{i.options.instantUpload&&e("REMOVE_ITEM",{query:a.id})})}),REQUEST_REVERT_ITEM_PROCESSING:ye(i,a=>{if(!i.options.instantUpload){e("REVERT_ITEM_PROCESSING",{query:a});return}let n=r=>{r&&e("REVERT_ITEM_PROCESSING",{query:a})},o=t("GET_BEFORE_REMOVE_FILE");if(!o)return n(!0);let l=o(ge(a));if(l==null)return n(!0);if(typeof l=="boolean")return n(l);typeof l.then=="function"&&l.then(n)}),REVERT_ITEM_PROCESSING:ye(i,a=>{a.revert(Mt(i.options.server.url,i.options.server.revert),t("GET_FORCE_REVERT")).then(()=>{(i.options.instantUpload||As(a))&&e("REMOVE_ITEM",{query:a.id})}).catch(()=>{})}),SET_OPTIONS:({options:a})=>{let n=Object.keys(a),o=Os.filter(r=>n.includes(r));[...o,...Object.keys(a).filter(r=>!o.includes(r))].forEach(r=>{e(`SET_${di(r,"_").toUpperCase()}`,{value:a[r]})})}}),Os=["server"],Qi=e=>e,ke=e=>document.createElement(e),ae=(e,t)=>{let i=e.childNodes[0];i?t!==i.nodeValue&&(i.nodeValue=t):(i=document.createTextNode(t),e.appendChild(i))},$a=(e,t,i,a)=>{let n=(a%360-90)*Math.PI/180;return{x:e+i*Math.cos(n),y:t+i*Math.sin(n)}},Ps=(e,t,i,a,n,o)=>{let l=$a(e,t,i,n),r=$a(e,t,i,a);return["M",l.x,l.y,"A",i,i,0,o,0,r.x,r.y].join(" ")},Ds=(e,t,i,a,n)=>{let o=1;return n>a&&n-a<=.5&&(o=0),a>n&&a-n>=.5&&(o=0),Ps(e,t,i,Math.min(.9999,a)*360,Math.min(.9999,n)*360,o)},Fs=({root:e,props:t})=>{t.spin=!1,t.progress=0,t.opacity=0;let i=ni("svg");e.ref.path=ni("path",{"stroke-width":2,"stroke-linecap":"round"}),i.appendChild(e.ref.path),e.ref.svg=i,e.appendChild(i)},zs=({root:e,props:t})=>{if(t.opacity===0)return;t.align&&(e.element.dataset.align=t.align);let i=parseInt(se(e.ref.path,"stroke-width"),10),a=e.rect.element.width*.5,n=0,o=0;t.spin?(n=0,o=.5):(n=0,o=t.progress);let l=Ds(a,a,a-i,n,o);se(e.ref.path,"d",l),se(e.ref.path,"stroke-opacity",t.spin||t.progress>0?1:0)},Xa=ne({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:Fs,write:zs,mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),Cs=({root:e,props:t})=>{e.element.innerHTML=(t.icon||"")+`${t.label}`,t.isDisabled=!1},Ns=({root:e,props:t})=>{let{isDisabled:i}=t,a=e.query("GET_DISABLED")||t.opacity===0;a&&!i?(t.isDisabled=!0,se(e.element,"disabled","disabled")):!a&&i&&(t.isDisabled=!1,e.element.removeAttribute("disabled"))},zn=ne({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:Cs,write:Ns}),Cn=(e,t=".",i=1e3,a={})=>{let{labelBytes:n="bytes",labelKilobytes:o="KB",labelMegabytes:l="MB",labelGigabytes:r="GB"}=a;e=Math.round(Math.abs(e));let s=i,p=i*i,c=i*i*i;return ee.toFixed(t).split(".").filter(a=>a!=="0").join(i),Bs=({root:e,props:t})=>{let i=ke("span");i.className="filepond--file-info-main",se(i,"aria-hidden","true"),e.appendChild(i),e.ref.fileName=i;let a=ke("span");a.className="filepond--file-info-sub",e.appendChild(a),e.ref.fileSize=a,ae(a,e.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),ae(i,Qi(e.query("GET_ITEM_NAME",t.id)))},Fi=({root:e,props:t})=>{ae(e.ref.fileSize,Cn(e.query("GET_ITEM_SIZE",t.id),".",e.query("GET_FILE_SIZE_BASE"),e.query("GET_FILE_SIZE_LABELS",e.query))),ae(e.ref.fileName,Qi(e.query("GET_ITEM_NAME",t.id)))},Za=({root:e,props:t})=>{if(gt(e.query("GET_ITEM_SIZE",t.id))){Fi({root:e,props:t});return}ae(e.ref.fileSize,e.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},ks=ne({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:he({DID_LOAD_ITEM:Fi,DID_UPDATE_ITEM_META:Fi,DID_THROW_ITEM_LOAD_ERROR:Za,DID_THROW_ITEM_INVALID:Za}),didCreateView:e=>{tt("CREATE_VIEW",{...e,view:e})},create:Bs,mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),Nn=e=>Math.round(e*100),Vs=({root:e})=>{let t=ke("span");t.className="filepond--file-status-main",e.appendChild(t),e.ref.main=t;let i=ke("span");i.className="filepond--file-status-sub",e.appendChild(i),e.ref.sub=i,Bn({root:e,action:{progress:null}})},Bn=({root:e,action:t})=>{let i=t.progress===null?e.query("GET_LABEL_FILE_LOADING"):`${e.query("GET_LABEL_FILE_LOADING")} ${Nn(t.progress)}%`;ae(e.ref.main,i),ae(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},Gs=({root:e,action:t})=>{let i=t.progress===null?e.query("GET_LABEL_FILE_PROCESSING"):`${e.query("GET_LABEL_FILE_PROCESSING")} ${Nn(t.progress)}%`;ae(e.ref.main,i),ae(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},Us=({root:e})=>{ae(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING")),ae(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},Ws=({root:e})=>{ae(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_ABORTED")),ae(e.ref.sub,e.query("GET_LABEL_TAP_TO_RETRY"))},Hs=({root:e})=>{ae(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),ae(e.ref.sub,e.query("GET_LABEL_TAP_TO_UNDO"))},Ka=({root:e})=>{ae(e.ref.main,""),ae(e.ref.sub,"")},Ot=({root:e,action:t})=>{ae(e.ref.main,t.status.main),ae(e.ref.sub,t.status.sub)},js=ne({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:he({DID_LOAD_ITEM:Ka,DID_REVERT_ITEM_PROCESSING:Ka,DID_REQUEST_ITEM_PROCESSING:Us,DID_ABORT_ITEM_PROCESSING:Ws,DID_COMPLETE_ITEM_PROCESSING:Hs,DID_UPDATE_ITEM_PROCESS_PROGRESS:Gs,DID_UPDATE_ITEM_LOAD_PROGRESS:Bn,DID_THROW_ITEM_LOAD_ERROR:Ot,DID_THROW_ITEM_INVALID:Ot,DID_THROW_ITEM_PROCESSING_ERROR:Ot,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Ot,DID_THROW_ITEM_REMOVE_ERROR:Ot}),didCreateView:e=>{tt("CREATE_VIEW",{...e,view:e})},create:Vs,mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),zi={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},Ci=[];te(zi,e=>{Ci.push(e)});var ve=e=>{if(Ni(e)==="right")return 0;let t=e.ref.buttonRemoveItem.rect.element;return t.hidden?null:t.width+t.left},Ys=e=>e.ref.buttonAbortItemLoad.rect.element.width,Jt=e=>Math.floor(e.ref.buttonRemoveItem.rect.element.height/4),qs=e=>Math.floor(e.ref.buttonRemoveItem.rect.element.left/2),$s=e=>e.query("GET_STYLE_LOAD_INDICATOR_POSITION"),Xs=e=>e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION"),Ni=e=>e.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION"),Qs={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:$s},processProgressIndicator:{opacity:0,align:Xs},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},Ja={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:ve},status:{translateX:ve}},Ai={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},pt={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:ve},status:{translateX:ve,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:ve},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:Ni},info:{translateX:ve},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:Ni},buttonRemoveItem:{opacity:1},info:{translateX:ve},status:{opacity:1,translateX:ve}},DID_LOAD_ITEM:Ja,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:ve},status:{translateX:ve}},DID_START_ITEM_PROCESSING:Ai,DID_REQUEST_ITEM_PROCESSING:Ai,DID_UPDATE_ITEM_PROCESS_PROGRESS:Ai,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:ve}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:ve},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:Ja},Zs=ne({create:({root:e})=>{e.element.innerHTML=e.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),Ks=({root:e,props:t})=>{let i=Object.keys(zi).reduce((f,h)=>(f[h]={...zi[h]},f),{}),{id:a}=t,n=e.query("GET_ALLOW_REVERT"),o=e.query("GET_ALLOW_REMOVE"),l=e.query("GET_ALLOW_PROCESS"),r=e.query("GET_INSTANT_UPLOAD"),s=e.query("IS_ASYNC"),p=e.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN"),c;s?l&&!n?c=f=>!/RevertItemProcessing/.test(f):!l&&n?c=f=>!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(f):!l&&!n&&(c=f=>!/Process/.test(f)):c=f=>!/Process/.test(f);let d=c?Ci.filter(c):Ci.concat();if(r&&n&&(i.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",i.RevertItemProcessing.icon="GET_ICON_REMOVE"),s&&!n){let f=pt.DID_COMPLETE_ITEM_PROCESSING;f.info.translateX=qs,f.info.translateY=Jt,f.status.translateY=Jt,f.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(s&&!l&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach(f=>{pt[f].status.translateY=Jt}),pt.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=Ys),p&&n){i.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";let f=pt.DID_COMPLETE_ITEM_PROCESSING;f.info.translateX=ve,f.status.translateY=Jt,f.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}o||(i.RemoveItem.disabled=!0),te(i,(f,h)=>{let g=e.createChildView(zn,{label:e.query(h.label),icon:e.query(h.icon),opacity:0});d.includes(f)&&e.appendChildView(g),h.disabled&&(g.element.setAttribute("disabled","disabled"),g.element.setAttribute("hidden","hidden")),g.element.dataset.align=e.query(`GET_STYLE_${h.align}`),g.element.classList.add(h.className),g.on("click",v=>{v.stopPropagation(),!h.disabled&&e.dispatch(h.action,{query:a})}),e.ref[`button${f}`]=g}),e.ref.processingCompleteIndicator=e.appendChildView(e.createChildView(Zs)),e.ref.processingCompleteIndicator.element.dataset.align=e.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),e.ref.info=e.appendChildView(e.createChildView(ks,{id:a})),e.ref.status=e.appendChildView(e.createChildView(js,{id:a}));let m=e.appendChildView(e.createChildView(Xa,{opacity:0,align:e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));m.element.classList.add("filepond--load-indicator"),e.ref.loadProgressIndicator=m;let u=e.appendChildView(e.createChildView(Xa,{opacity:0,align:e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));u.element.classList.add("filepond--process-indicator"),e.ref.processProgressIndicator=u,e.ref.activeStyles=[]},Js=({root:e,actions:t,props:i})=>{ec({root:e,actions:t,props:i});let a=t.concat().filter(n=>/^DID_/.test(n.type)).reverse().find(n=>pt[n.type]);if(a){e.ref.activeStyles=[];let n=pt[a.type];te(Qs,(o,l)=>{let r=e.ref[o];te(l,(s,p)=>{let c=n[o]&&typeof n[o][s]<"u"?n[o][s]:p;e.ref.activeStyles.push({control:r,key:s,value:c})})})}e.ref.activeStyles.forEach(({control:n,key:o,value:l})=>{n[o]=typeof l=="function"?l(e):l})},ec=he({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:({root:e,action:t})=>{e.ref.buttonAbortItemProcessing.label=t.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:({root:e,action:t})=>{e.ref.buttonAbortItemLoad.label=t.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:({root:e,action:t})=>{e.ref.buttonAbortItemRemoval.label=t.value},DID_REQUEST_ITEM_PROCESSING:({root:e})=>{e.ref.processProgressIndicator.spin=!0,e.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:({root:e})=>{e.ref.loadProgressIndicator.spin=!0,e.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:({root:e})=>{e.ref.processProgressIndicator.spin=!0,e.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:({root:e,action:t})=>{e.ref.loadProgressIndicator.spin=!1,e.ref.loadProgressIndicator.progress=t.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:({root:e,action:t})=>{e.ref.processProgressIndicator.spin=!1,e.ref.processProgressIndicator.progress=t.progress}}),tc=ne({create:Ks,write:Js,didCreateView:e=>{tt("CREATE_VIEW",{...e,view:e})},name:"file"}),ic=({root:e,props:t})=>{e.ref.fileName=ke("legend"),e.appendChild(e.ref.fileName),e.ref.file=e.appendChildView(e.createChildView(tc,{id:t.id})),e.ref.data=!1},ac=({root:e,props:t})=>{ae(e.ref.fileName,Qi(e.query("GET_ITEM_NAME",t.id)))},nc=ne({create:ic,ignoreRect:!0,write:he({DID_LOAD_ITEM:ac}),didCreateView:e=>{tt("CREATE_VIEW",{...e,view:e})},tag:"fieldset",name:"file-wrapper"}),en={type:"spring",damping:.6,mass:7},oc=({root:e,props:t})=>{[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:en},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:en},styles:["translateY"]}}].forEach(i=>{lc(e,i,t.name)}),e.element.classList.add(`filepond--${t.name}`),e.ref.scalable=null},lc=(e,t,i)=>{let a=ne({name:`panel-${t.name} filepond--${i}`,mixins:t.mixins,ignoreRectUpdate:!0}),n=e.createChildView(a,t.props);e.ref[t.name]=e.appendChildView(n)},rc=({root:e,props:t})=>{if((e.ref.scalable===null||t.scalable!==e.ref.scalable)&&(e.ref.scalable=Tn(t.scalable)?t.scalable:!0,e.element.dataset.scalable=e.ref.scalable),!t.height)return;let i=e.ref.top.rect.element,a=e.ref.bottom.rect.element,n=Math.max(i.height+a.height,t.height);e.ref.center.translateY=i.height,e.ref.center.scaleY=(n-i.height-a.height)/100,e.ref.bottom.translateY=n-a.height},kn=ne({name:"panel",read:({root:e,props:t})=>t.heightCurrent=e.ref.bottom.translateY,write:rc,create:oc,ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),sc=e=>{let t=e.map(a=>a.id),i;return{setIndex:a=>{i=a},getIndex:()=>i,getItemIndex:a=>t.indexOf(a.id)}},tn={type:"spring",stiffness:.75,damping:.45,mass:10},an="spring",nn={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},cc=({root:e,props:t})=>{if(e.ref.handleClick=a=>e.dispatch("DID_ACTIVATE_ITEM",{id:t.id}),e.element.id=`filepond--item-${t.id}`,e.element.addEventListener("click",e.ref.handleClick),e.ref.container=e.appendChildView(e.createChildView(nc,{id:t.id})),e.ref.panel=e.appendChildView(e.createChildView(kn,{name:"item-panel"})),e.ref.panel.height=null,t.markedForRemoval=!1,!e.query("GET_ALLOW_REORDER"))return;e.element.dataset.dragState="idle";let i=a=>{if(!a.isPrimary)return;let n=!1,o={x:a.pageX,y:a.pageY};t.dragOrigin={x:e.translateX,y:e.translateY},t.dragCenter={x:a.offsetX,y:a.offsetY};let l=sc(e.query("GET_ACTIVE_ITEMS"));e.dispatch("DID_GRAB_ITEM",{id:t.id,dragState:l});let r=d=>{if(!d.isPrimary)return;d.stopPropagation(),d.preventDefault(),t.dragOffset={x:d.pageX-o.x,y:d.pageY-o.y},t.dragOffset.x*t.dragOffset.x+t.dragOffset.y*t.dragOffset.y>16&&!n&&(n=!0,e.element.removeEventListener("click",e.ref.handleClick)),e.dispatch("DID_DRAG_ITEM",{id:t.id,dragState:l})},s=d=>{d.isPrimary&&(t.dragOffset={x:d.pageX-o.x,y:d.pageY-o.y},c())},p=()=>{c()},c=()=>{document.removeEventListener("pointercancel",p),document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",s),e.dispatch("DID_DROP_ITEM",{id:t.id,dragState:l}),n&&setTimeout(()=>e.element.addEventListener("click",e.ref.handleClick),0)};document.addEventListener("pointercancel",p),document.addEventListener("pointermove",r),document.addEventListener("pointerup",s)};e.element.addEventListener("pointerdown",i)},dc=he({DID_UPDATE_PANEL_HEIGHT:({root:e,action:t})=>{e.height=t.height}}),pc=he({DID_GRAB_ITEM:({root:e,props:t})=>{t.dragOrigin={x:e.translateX,y:e.translateY}},DID_DRAG_ITEM:({root:e})=>{e.element.dataset.dragState="drag"},DID_DROP_ITEM:({root:e,props:t})=>{t.dragOffset=null,t.dragOrigin=null,e.element.dataset.dragState="drop"}},({root:e,actions:t,props:i,shouldOptimize:a})=>{e.element.dataset.dragState==="drop"&&e.scaleX<=1&&(e.element.dataset.dragState="idle");let n=t.concat().filter(l=>/^DID_/.test(l.type)).reverse().find(l=>nn[l.type]);n&&n.type!==i.currentState&&(i.currentState=n.type,e.element.dataset.filepondItemState=nn[i.currentState]||"");let o=e.query("GET_ITEM_PANEL_ASPECT_RATIO")||e.query("GET_PANEL_ASPECT_RATIO");o?a||(e.height=e.rect.element.width*o):(dc({root:e,actions:t,props:i}),!e.height&&e.ref.container.rect.element.height>0&&(e.height=e.ref.container.rect.element.height)),a&&(e.ref.panel.height=null),e.ref.panel.height=e.height}),mc=ne({create:cc,write:pc,destroy:({root:e,props:t})=>{e.element.removeEventListener("click",e.ref.handleClick),e.dispatch("RELEASE_ITEM",{query:t.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:an,scaleY:an,translateX:tn,translateY:tn,opacity:{type:"tween",duration:150}}}}),Zi=(e,t)=>Math.max(1,Math.floor((e+1)/t)),Ki=(e,t,i)=>{if(!i)return;let a=e.rect.element.width,n=t.length,o=null;if(n===0||i.topE){if(i.left{se(e.element,"role","list"),e.ref.lastItemSpanwDate=Date.now()},fc=({root:e,action:t})=>{let{id:i,index:a,interactionMethod:n}=t;e.ref.addIndex=a;let o=Date.now(),l=o,r=1;if(n!==_e.NONE){r=0;let s=e.query("GET_ITEM_INSERT_INTERVAL"),p=o-e.ref.lastItemSpanwDate;l=p{e.dragOffset?(e.translateX=null,e.translateY=null,e.translateX=e.dragOrigin.x+e.dragOffset.x,e.translateY=e.dragOrigin.y+e.dragOffset.y,e.scaleX=1.025,e.scaleY=1.025):(e.translateX=t,e.translateY=i,Date.now()>e.spawnDate&&(e.opacity===0&&hc(e,t,i,a,n),e.scaleX=1,e.scaleY=1,e.opacity=1))},hc=(e,t,i,a,n)=>{e.interactionMethod===_e.NONE?(e.translateX=null,e.translateX=t,e.translateY=null,e.translateY=i):e.interactionMethod===_e.DROP?(e.translateX=null,e.translateX=t-a*20,e.translateY=null,e.translateY=i-n*10,e.scaleX=.8,e.scaleY=.8):e.interactionMethod===_e.BROWSE?(e.translateY=null,e.translateY=i-30):e.interactionMethod===_e.API&&(e.translateX=null,e.translateX=t-30,e.translateY=null)},gc=({root:e,action:t})=>{let{id:i}=t,a=e.childViews.find(n=>n.id===i);a&&(a.scaleX=.9,a.scaleY=.9,a.opacity=0,a.markedForRemoval=!0)},Mi=e=>e.rect.element.height+e.rect.element.marginBottom*.5+e.rect.element.marginTop*.5,Ec=e=>e.rect.element.width+e.rect.element.marginLeft*.5+e.rect.element.marginRight*.5,bc=({root:e,action:t})=>{let{id:i,dragState:a}=t,n=e.query("GET_ITEM",{id:i}),o=e.childViews.find(g=>g.id===i),l=e.childViews.length,r=a.getItemIndex(n);if(!o)return;let s={x:o.dragOrigin.x+o.dragOffset.x+o.dragCenter.x,y:o.dragOrigin.y+o.dragOffset.y+o.dragCenter.y},p=Mi(o),c=Ec(o),d=Math.floor(e.rect.outer.width/c);d>l&&(d=l);let m=Math.floor(l/d+1);ei.setHeight=p*m,ei.setWidth=c*d;var u={y:Math.floor(s.y/p),x:Math.floor(s.x/c),getGridIndex:function(){return s.y>ei.getHeight||s.y<0||s.x>ei.getWidth||s.x<0?r:this.y*d+this.x},getColIndex:function(){let v=e.query("GET_ACTIVE_ITEMS"),E=e.childViews.filter(O=>O.rect.element.height),T=v.map(O=>E.find(M=>M.id===O.id)),I=T.findIndex(O=>O===o),y=Mi(o),b=T.length,w=b,x=0,_=0,P=0;for(let O=0;OO){if(s.y1?u.getGridIndex():u.getColIndex();e.dispatch("MOVE_ITEM",{query:o,index:f});let h=a.getIndex();if(h===void 0||h!==f){if(a.setIndex(f),h===void 0)return;e.dispatch("DID_REORDER_ITEMS",{items:e.query("GET_ACTIVE_ITEMS"),origin:r,target:f})}},Tc=he({DID_ADD_ITEM:fc,DID_REMOVE_ITEM:gc,DID_DRAG_ITEM:bc}),vc=({root:e,props:t,actions:i,shouldOptimize:a})=>{Tc({root:e,props:t,actions:i});let{dragCoordinates:n}=t,o=e.rect.element.width,l=e.childViews.filter(T=>T.rect.element.height),r=e.query("GET_ACTIVE_ITEMS").map(T=>l.find(I=>I.id===T.id)).filter(T=>T),s=n?Ki(e,r,n):null,p=e.ref.addIndex||null;e.ref.addIndex=null;let c=0,d=0,m=0;if(r.length===0)return;let u=r[0].rect.element,f=u.marginTop+u.marginBottom,h=u.marginLeft+u.marginRight,g=u.width+h,v=u.height+f,E=Zi(o,g);if(E===1){let T=0,I=0;r.forEach((y,b)=>{if(s){let _=b-s;_===-2?I=-f*.25:_===-1?I=-f*.75:_===0?I=f*.75:_===1?I=f*.25:I=0}a&&(y.translateX=null,y.translateY=null),y.markedForRemoval||on(y,0,T+I);let x=(y.rect.element.height+f)*(y.markedForRemoval?y.opacity:1);T+=x})}else{let T=0,I=0;r.forEach((y,b)=>{b===s&&(c=1),b===p&&(m+=1),y.markedForRemoval&&y.opacity<.5&&(d-=1);let w=b+m+c+d,x=w%E,_=Math.floor(w/E),P=x*g,O=_*v,M=Math.sign(P-T),C=Math.sign(O-I);T=P,I=O,!y.markedForRemoval&&(a&&(y.translateX=null,y.translateY=null),on(y,P,O,M,C))})}},Ic=(e,t)=>t.filter(i=>i.data&&i.data.id?e.id===i.data.id:!0),xc=ne({create:uc,write:vc,tag:"ul",name:"list",didWriteView:({root:e})=>{e.childViews.filter(t=>t.markedForRemoval&&t.opacity===0&&t.resting).forEach(t=>{t._destroy(),e.removeChildView(t)})},filterFrameActionsForChild:Ic,mixins:{apis:["dragCoordinates"]}}),yc=({root:e,props:t})=>{e.ref.list=e.appendChildView(e.createChildView(xc)),t.dragCoordinates=null,t.overflowing=!1},_c=({root:e,props:t,action:i})=>{e.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(t.dragCoordinates={left:i.position.scopeLeft-e.ref.list.rect.element.left,top:i.position.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},Rc=({props:e})=>{e.dragCoordinates=null},wc=he({DID_DRAG:_c,DID_END_DRAG:Rc}),Sc=({root:e,props:t,actions:i})=>{if(wc({root:e,props:t,actions:i}),e.ref.list.dragCoordinates=t.dragCoordinates,t.overflowing&&!t.overflow&&(t.overflowing=!1,e.element.dataset.state="",e.height=null),t.overflow){let a=Math.round(t.overflow);a!==e.height&&(t.overflowing=!0,e.element.dataset.state="overflow",e.height=a)}},Lc=ne({create:yc,write:Sc,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),Oe=(e,t,i,a="")=>{i?se(e,t,a):e.removeAttribute(t)},Ac=e=>{if(!(!e||e.value==="")){try{e.value=""}catch{}if(e.value){let t=ke("form"),i=e.parentNode,a=e.nextSibling;t.appendChild(e),t.reset(),a?i.insertBefore(e,a):i.appendChild(e)}}},Mc=({root:e,props:t})=>{e.element.id=`filepond--browser-${t.id}`,se(e.element,"name",e.query("GET_NAME")),se(e.element,"aria-controls",`filepond--assistant-${t.id}`),se(e.element,"aria-labelledby",`filepond--drop-label-${t.id}`),Vn({root:e,action:{value:e.query("GET_ACCEPTED_FILE_TYPES")}}),Gn({root:e,action:{value:e.query("GET_ALLOW_MULTIPLE")}}),Un({root:e,action:{value:e.query("GET_ALLOW_DIRECTORIES_ONLY")}}),Bi({root:e}),Wn({root:e,action:{value:e.query("GET_REQUIRED")}}),Hn({root:e,action:{value:e.query("GET_CAPTURE_METHOD")}}),e.ref.handleChange=i=>{if(!e.element.value)return;let a=Array.from(e.element.files).map(n=>(n._relativePath=n.webkitRelativePath,n));setTimeout(()=>{t.onload(a),Ac(e.element)},250)},e.element.addEventListener("change",e.ref.handleChange)},Vn=({root:e,action:t})=>{e.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&Oe(e.element,"accept",!!t.value,t.value?t.value.join(","):"")},Gn=({root:e,action:t})=>{Oe(e.element,"multiple",t.value)},Un=({root:e,action:t})=>{Oe(e.element,"webkitdirectory",t.value)},Bi=({root:e})=>{let t=e.query("GET_DISABLED"),i=e.query("GET_ALLOW_BROWSE"),a=t||!i;Oe(e.element,"disabled",a)},Wn=({root:e,action:t})=>{t.value?e.query("GET_TOTAL_ITEMS")===0&&Oe(e.element,"required",!0):Oe(e.element,"required",!1)},Hn=({root:e,action:t})=>{Oe(e.element,"capture",!!t.value,t.value===!0?"":t.value)},ln=({root:e})=>{let{element:t}=e;e.query("GET_TOTAL_ITEMS")>0?(Oe(t,"required",!1),Oe(t,"name",!1)):(Oe(t,"name",!0,e.query("GET_NAME")),e.query("GET_CHECK_VALIDITY")&&t.setCustomValidity(""),e.query("GET_REQUIRED")&&Oe(t,"required",!0))},Oc=({root:e})=>{e.query("GET_CHECK_VALIDITY")&&e.element.setCustomValidity(e.query("GET_LABEL_INVALID_FIELD"))},Pc=ne({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:Mc,destroy:({root:e})=>{e.element.removeEventListener("change",e.ref.handleChange)},write:he({DID_LOAD_ITEM:ln,DID_REMOVE_ITEM:ln,DID_THROW_ITEM_INVALID:Oc,DID_SET_DISABLED:Bi,DID_SET_ALLOW_BROWSE:Bi,DID_SET_ALLOW_DIRECTORIES_ONLY:Un,DID_SET_ALLOW_MULTIPLE:Gn,DID_SET_ACCEPTED_FILE_TYPES:Vn,DID_SET_CAPTURE_METHOD:Hn,DID_SET_REQUIRED:Wn})}),rn={ENTER:13,SPACE:32},Dc=({root:e,props:t})=>{let i=ke("label");se(i,"for",`filepond--browser-${t.id}`),se(i,"id",`filepond--drop-label-${t.id}`),e.ref.handleKeyDown=a=>{(a.keyCode===rn.ENTER||a.keyCode===rn.SPACE)&&(a.preventDefault(),e.ref.label.click())},e.ref.handleClick=a=>{a.target===i||i.contains(a.target)||e.ref.label.click()},i.addEventListener("keydown",e.ref.handleKeyDown),e.element.addEventListener("click",e.ref.handleClick),jn(i,t.caption),e.appendChild(i),e.ref.label=i},jn=(e,t)=>{e.innerHTML=t;let i=e.querySelector(".filepond--label-action");return i&&se(i,"tabindex","0"),t},Fc=ne({name:"drop-label",ignoreRect:!0,create:Dc,destroy:({root:e})=>{e.ref.label.addEventListener("keydown",e.ref.handleKeyDown),e.element.removeEventListener("click",e.ref.handleClick)},write:he({DID_SET_LABEL_IDLE:({root:e,action:t})=>{jn(e.ref.label,t.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),zc=ne({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),Cc=({root:e})=>{let t=e.rect.element.width*.5,i=e.rect.element.height*.5;e.ref.blob=e.appendChildView(e.createChildView(zc,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:t,translateY:i}))},Nc=({root:e,action:t})=>{if(!e.ref.blob){Cc({root:e});return}e.ref.blob.translateX=t.position.scopeLeft,e.ref.blob.translateY=t.position.scopeTop,e.ref.blob.scaleX=1,e.ref.blob.scaleY=1,e.ref.blob.opacity=1},Bc=({root:e})=>{e.ref.blob&&(e.ref.blob.opacity=0)},kc=({root:e})=>{e.ref.blob&&(e.ref.blob.scaleX=2.5,e.ref.blob.scaleY=2.5,e.ref.blob.opacity=0)},Vc=({root:e,props:t,actions:i})=>{Gc({root:e,props:t,actions:i});let{blob:a}=e.ref;i.length===0&&a&&a.opacity===0&&(e.removeChildView(a),e.ref.blob=null)},Gc=he({DID_DRAG:Nc,DID_DROP:kc,DID_END_DRAG:Bc}),Uc=ne({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:Vc}),Yn=(e,t)=>{try{let i=new DataTransfer;t.forEach(a=>{a instanceof File?i.items.add(a):i.items.add(new File([a],a.name,{type:a.type}))}),e.files=i.files}catch{return!1}return!0},Wc=({root:e})=>e.ref.fields={},ui=(e,t)=>e.ref.fields[t],Ji=e=>{e.query("GET_ACTIVE_ITEMS").forEach(t=>{e.ref.fields[t.id]&&e.element.appendChild(e.ref.fields[t.id])})},sn=({root:e})=>Ji(e),Hc=({root:e,action:t})=>{let n=!(e.query("GET_ITEM",t.id).origin===re.LOCAL)&&e.query("SHOULD_UPDATE_FILE_INPUT"),o=ke("input");o.type=n?"file":"hidden",o.name=e.query("GET_NAME"),e.ref.fields[t.id]=o,Ji(e)},jc=({root:e,action:t})=>{let i=ui(e,t.id);if(!i||(t.serverFileReference!==null&&(i.value=t.serverFileReference),!e.query("SHOULD_UPDATE_FILE_INPUT")))return;let a=e.query("GET_ITEM",t.id);Yn(i,[a.file])},Yc=({root:e,action:t})=>{e.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout(()=>{let i=ui(e,t.id);i&&Yn(i,[t.file])},0)},qc=({root:e})=>{e.element.disabled=e.query("GET_DISABLED")},$c=({root:e,action:t})=>{let i=ui(e,t.id);i&&(i.parentNode&&i.parentNode.removeChild(i),delete e.ref.fields[t.id])},Xc=({root:e,action:t})=>{let i=ui(e,t.id);i&&(t.value===null?i.removeAttribute("value"):i.type!="file"&&(i.value=t.value),Ji(e))},Qc=he({DID_SET_DISABLED:qc,DID_ADD_ITEM:Hc,DID_LOAD_ITEM:jc,DID_REMOVE_ITEM:$c,DID_DEFINE_VALUE:Xc,DID_PREPARE_OUTPUT:Yc,DID_REORDER_ITEMS:sn,DID_SORT_ITEMS:sn}),Zc=ne({tag:"fieldset",name:"data",create:Wc,write:Qc,ignoreRect:!0}),Kc=e=>"getRootNode"in e?e.getRootNode():document,Jc=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],ed=["css","csv","html","txt"],td={zip:"zip|compressed",epub:"application/epub+zip"},qn=(e="")=>(e=e.toLowerCase(),Jc.includes(e)?"image/"+(e==="jpg"?"jpeg":e==="svg"?"svg+xml":e):ed.includes(e)?"text/"+e:td[e]||""),ea=e=>new Promise((t,i)=>{let a=cd(e);if(a.length&&!id(e))return t(a);ad(e).then(t)}),id=e=>e.files?e.files.length>0:!1,ad=e=>new Promise((t,i)=>{let a=(e.items?Array.from(e.items):[]).filter(n=>nd(n)).map(n=>od(n));if(!a.length){t(e.files?Array.from(e.files):[]);return}Promise.all(a).then(n=>{let o=[];n.forEach(l=>{o.push.apply(o,l)}),t(o.filter(l=>l).map(l=>(l._relativePath||(l._relativePath=l.webkitRelativePath),l)))}).catch(console.error)}),nd=e=>{if($n(e)){let t=ta(e);if(t)return t.isFile||t.isDirectory}return e.kind==="file"},od=e=>new Promise((t,i)=>{if(sd(e)){ld(ta(e)).then(t).catch(i);return}t([e.getAsFile()])}),ld=e=>new Promise((t,i)=>{let a=[],n=0,o=0,l=()=>{o===0&&n===0&&t(a)},r=s=>{n++;let p=s.createReader(),c=()=>{p.readEntries(d=>{if(d.length===0){n--,l();return}d.forEach(m=>{m.isDirectory?r(m):(o++,m.file(u=>{let f=rd(u);m.fullPath&&(f._relativePath=m.fullPath),a.push(f),o--,l()}))}),c()},i)};c()};r(e)}),rd=e=>{if(e.type.length)return e;let t=e.lastModifiedDate,i=e.name,a=qn(mi(e.name));return a.length&&(e=e.slice(0,e.size,a),e.name=i,e.lastModifiedDate=t),e},sd=e=>$n(e)&&(ta(e)||{}).isDirectory,$n=e=>"webkitGetAsEntry"in e,ta=e=>e.webkitGetAsEntry(),cd=e=>{let t=[];try{if(t=pd(e),t.length)return t;t=dd(e)}catch{}return t},dd=e=>{let t=e.getData("url");return typeof t=="string"&&t.length?[t]:[]},pd=e=>{let t=e.getData("text/html");if(typeof t=="string"&&t.length){let i=t.match(/src\s*=\s*"(.+?)"/);if(i)return[i[1]]}return[]},li=[],et=e=>({pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.offsetX||e.layerX,scopeTop:e.offsetY||e.layerY}),md=(e,t,i)=>{let a=ud(t),n={element:e,filterElement:i,state:null,ondrop:()=>{},onenter:()=>{},ondrag:()=>{},onexit:()=>{},onload:()=>{},allowdrop:()=>{}};return n.destroy=a.addListener(n),n},ud=e=>{let t=li.find(a=>a.element===e);if(t)return t;let i=fd(e);return li.push(i),i},fd=e=>{let t=[],i={dragenter:gd,dragover:Ed,dragleave:Td,drop:bd},a={};te(i,(o,l)=>{a[o]=l(e,t),e.addEventListener(o,a[o],!1)});let n={element:e,addListener:o=>(t.push(o),()=>{t.splice(t.indexOf(o),1),t.length===0&&(li.splice(li.indexOf(n),1),te(i,l=>{e.removeEventListener(l,a[l],!1)}))})};return n},hd=(e,t)=>("elementFromPoint"in e||(e=document),e.elementFromPoint(t.x,t.y)),ia=(e,t)=>{let i=Kc(t),a=hd(i,{x:e.pageX-window.pageXOffset,y:e.pageY-window.pageYOffset});return a===t||t.contains(a)},Xn=null,ti=(e,t)=>{try{e.dropEffect=t}catch{}},gd=(e,t)=>i=>{i.preventDefault(),Xn=i.target,t.forEach(a=>{let{element:n,onenter:o}=a;ia(i,n)&&(a.state="enter",o(et(i)))})},Ed=(e,t)=>i=>{i.preventDefault();let a=i.dataTransfer;ea(a).then(n=>{let o=!1;t.some(l=>{let{filterElement:r,element:s,onenter:p,onexit:c,ondrag:d,allowdrop:m}=l;ti(a,"copy");let u=m(n);if(!u){ti(a,"none");return}if(ia(i,s)){if(o=!0,l.state===null){l.state="enter",p(et(i));return}if(l.state="over",r&&!u){ti(a,"none");return}d(et(i))}else r&&!o&&ti(a,"none"),l.state&&(l.state=null,c(et(i)))})})},bd=(e,t)=>i=>{i.preventDefault();let a=i.dataTransfer;ea(a).then(n=>{t.forEach(o=>{let{filterElement:l,element:r,ondrop:s,onexit:p,allowdrop:c}=o;if(o.state=null,!(l&&!ia(i,r))){if(!c(n))return p(et(i));s(et(i),n)}})})},Td=(e,t)=>i=>{Xn===i.target&&t.forEach(a=>{let{onexit:n}=a;a.state=null,n(et(i))})},vd=(e,t,i)=>{e.classList.add("filepond--hopper");let{catchesDropsOnPage:a,requiresDropOnElement:n,filterItems:o=c=>c}=i,l=md(e,a?document.documentElement:e,n),r="",s="";l.allowdrop=c=>t(o(c)),l.ondrop=(c,d)=>{let m=o(d);if(!t(m)){p.ondragend(c);return}s="drag-drop",p.onload(m,c)},l.ondrag=c=>{p.ondrag(c)},l.onenter=c=>{s="drag-over",p.ondragstart(c)},l.onexit=c=>{s="drag-exit",p.ondragend(c)};let p={updateHopperState:()=>{r!==s&&(e.dataset.hopperState=s,r=s)},onload:()=>{},ondragstart:()=>{},ondrag:()=>{},ondragend:()=>{},destroy:()=>{l.destroy()}};return p},ki=!1,mt=[],Qn=e=>{let t=document.activeElement;if(t&&(/textarea|input/i.test(t.nodeName)||t.getAttribute("contenteditable")==="true")){let a=!1,n=t;for(;n!==document.body;){if(n.classList.contains("filepond--root")){a=!0;break}n=n.parentNode}if(!a)return}ea(e.clipboardData).then(a=>{a.length&&mt.forEach(n=>n(a))})},Id=e=>{mt.includes(e)||(mt.push(e),!ki&&(ki=!0,document.addEventListener("paste",Qn)))},xd=e=>{qi(mt,mt.indexOf(e)),mt.length===0&&(document.removeEventListener("paste",Qn),ki=!1)},yd=()=>{let e=i=>{t.onload(i)},t={destroy:()=>{xd(e)},onload:()=>{}};return Id(e),t},_d=({root:e,props:t})=>{e.element.id=`filepond--assistant-${t.id}`,se(e.element,"role","status"),se(e.element,"aria-live","polite"),se(e.element,"aria-relevant","additions")},cn=null,dn=null,Oi=[],fi=(e,t)=>{e.element.textContent=t},Rd=e=>{e.element.textContent=""},Zn=(e,t,i)=>{let a=e.query("GET_TOTAL_ITEMS");fi(e,`${i} ${t}, ${a} ${a===1?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL")}`),clearTimeout(dn),dn=setTimeout(()=>{Rd(e)},1500)},Kn=e=>e.element.parentNode.contains(document.activeElement),wd=({root:e,action:t})=>{if(!Kn(e))return;e.element.textContent="";let i=e.query("GET_ITEM",t.id);Oi.push(i.filename),clearTimeout(cn),cn=setTimeout(()=>{Zn(e,Oi.join(", "),e.query("GET_LABEL_FILE_ADDED")),Oi.length=0},750)},Sd=({root:e,action:t})=>{if(!Kn(e))return;let i=t.item;Zn(e,i.filename,e.query("GET_LABEL_FILE_REMOVED"))},Ld=({root:e,action:t})=>{let a=e.query("GET_ITEM",t.id).filename,n=e.query("GET_LABEL_FILE_PROCESSING_COMPLETE");fi(e,`${a} ${n}`)},pn=({root:e,action:t})=>{let a=e.query("GET_ITEM",t.id).filename,n=e.query("GET_LABEL_FILE_PROCESSING_ABORTED");fi(e,`${a} ${n}`)},ii=({root:e,action:t})=>{let a=e.query("GET_ITEM",t.id).filename;fi(e,`${t.status.main} ${a} ${t.status.sub}`)},Ad=ne({create:_d,ignoreRect:!0,ignoreRectUpdate:!0,write:he({DID_LOAD_ITEM:wd,DID_REMOVE_ITEM:Sd,DID_COMPLETE_ITEM_PROCESSING:Ld,DID_ABORT_ITEM_PROCESSING:pn,DID_REVERT_ITEM_PROCESSING:pn,DID_THROW_ITEM_REMOVE_ERROR:ii,DID_THROW_ITEM_LOAD_ERROR:ii,DID_THROW_ITEM_INVALID:ii,DID_THROW_ITEM_PROCESSING_ERROR:ii}),tag:"span",name:"assistant"}),Jn=(e,t="-")=>e.replace(new RegExp(`${t}.`,"g"),i=>i.charAt(1).toUpperCase()),eo=(e,t=16,i=!0)=>{let a=Date.now(),n=null;return(...o)=>{clearTimeout(n);let l=Date.now()-a,r=()=>{a=Date.now(),e(...o)};le.preventDefault(),Od=({root:e,props:t})=>{let i=e.query("GET_ID");i&&(e.element.id=i);let a=e.query("GET_CLASS_NAME");a&&a.split(" ").filter(s=>s.length).forEach(s=>{e.element.classList.add(s)}),e.ref.label=e.appendChildView(e.createChildView(Fc,{...t,translateY:null,caption:e.query("GET_LABEL_IDLE")})),e.ref.list=e.appendChildView(e.createChildView(Lc,{translateY:null})),e.ref.panel=e.appendChildView(e.createChildView(kn,{name:"panel-root"})),e.ref.assistant=e.appendChildView(e.createChildView(Ad,{...t})),e.ref.data=e.appendChildView(e.createChildView(Zc,{...t})),e.ref.measure=ke("div"),e.ref.measure.style.height="100%",e.element.appendChild(e.ref.measure),e.ref.bounds=null,e.query("GET_STYLES").filter(s=>!Be(s.value)).map(({name:s,value:p})=>{e.element.dataset[s]=p}),e.ref.widthPrevious=null,e.ref.widthUpdated=eo(()=>{e.ref.updateHistory=[],e.dispatch("DID_RESIZE_ROOT")},250),e.ref.previousAspectRatio=null,e.ref.updateHistory=[];let n=window.matchMedia("(pointer: fine) and (hover: hover)").matches,o="PointerEvent"in window;e.query("GET_ALLOW_REORDER")&&o&&!n&&(e.element.addEventListener("touchmove",ri,{passive:!1}),e.element.addEventListener("gesturestart",ri));let l=e.query("GET_CREDITS");if(l.length===2){let s=document.createElement("a");s.className="filepond--credits",s.href=l[0],s.tabIndex=-1,s.target="_blank",s.rel="noopener noreferrer",s.textContent=l[1],e.element.appendChild(s),e.ref.credits=s}},Pd=({root:e,props:t,actions:i})=>{if(Nd({root:e,props:t,actions:i}),i.filter(b=>/^DID_SET_STYLE_/.test(b.type)).filter(b=>!Be(b.data.value)).map(({type:b,data:w})=>{let x=Jn(b.substring(8).toLowerCase(),"_");e.element.dataset[x]=w.value,e.invalidateLayout()}),e.rect.element.hidden)return;e.rect.element.width!==e.ref.widthPrevious&&(e.ref.widthPrevious=e.rect.element.width,e.ref.widthUpdated());let a=e.ref.bounds;a||(a=e.ref.bounds=zd(e),e.element.removeChild(e.ref.measure),e.ref.measure=null);let{hopper:n,label:o,list:l,panel:r}=e.ref;n&&n.updateHopperState();let s=e.query("GET_PANEL_ASPECT_RATIO"),p=e.query("GET_ALLOW_MULTIPLE"),c=e.query("GET_TOTAL_ITEMS"),d=p?e.query("GET_MAX_FILES")||Md:1,m=c===d,u=i.find(b=>b.type==="DID_ADD_ITEM");if(m&&u){let b=u.data.interactionMethod;o.opacity=0,p?o.translateY=-40:b===_e.API?o.translateX=40:b===_e.BROWSE?o.translateY=40:o.translateY=30}else m||(o.opacity=1,o.translateX=0,o.translateY=0);let f=Dd(e),h=Fd(e),g=o.rect.element.height,v=!p||m?0:g,E=m?l.rect.element.marginTop:0,T=c===0?0:l.rect.element.marginBottom,I=v+E+h.visual+T,y=v+E+h.bounds+T;if(l.translateY=Math.max(0,v-l.rect.element.marginTop)-f.top,s){let b=e.rect.element.width,w=b*s;s!==e.ref.previousAspectRatio&&(e.ref.previousAspectRatio=s,e.ref.updateHistory=[]);let x=e.ref.updateHistory;x.push(b);let _=2;if(x.length>_*2){let O=x.length,M=O-10,C=0;for(let S=O;S>=M;S--)if(x[S]===x[S-2]&&C++,C>=_)return}r.scalable=!1,r.height=w;let P=w-v-(T-f.bottom)-(m?E:0);h.visual>P?l.overflow=P:l.overflow=null,e.height=w}else if(a.fixedHeight){r.scalable=!1;let b=a.fixedHeight-v-(T-f.bottom)-(m?E:0);h.visual>b?l.overflow=b:l.overflow=null}else if(a.cappedHeight){let b=I>=a.cappedHeight,w=Math.min(a.cappedHeight,I);r.scalable=!0,r.height=b?w:w-f.top-f.bottom;let x=w-v-(T-f.bottom)-(m?E:0);I>a.cappedHeight&&h.visual>x?l.overflow=x:l.overflow=null,e.height=Math.min(a.cappedHeight,y-f.top-f.bottom)}else{let b=c>0?f.top+f.bottom:0;r.scalable=!0,r.height=Math.max(g,I-b),e.height=Math.max(g,y-b)}e.ref.credits&&r.heightCurrent&&(e.ref.credits.style.transform=`translateY(${r.heightCurrent}px)`)},Dd=e=>{let t=e.ref.list.childViews[0].childViews[0];return t?{top:t.rect.element.marginTop,bottom:t.rect.element.marginBottom}:{top:0,bottom:0}},Fd=e=>{let t=0,i=0,a=e.ref.list,n=a.childViews[0],o=n.childViews.filter(E=>E.rect.element.height),l=e.query("GET_ACTIVE_ITEMS").map(E=>o.find(T=>T.id===E.id)).filter(E=>E);if(l.length===0)return{visual:t,bounds:i};let r=n.rect.element.width,s=Ki(n,l,a.dragCoordinates),p=l[0].rect.element,c=p.marginTop+p.marginBottom,d=p.marginLeft+p.marginRight,m=p.width+d,u=p.height+c,f=typeof s<"u"&&s>=0?1:0,h=l.find(E=>E.markedForRemoval&&E.opacity<.45)?-1:0,g=l.length+f+h,v=Zi(r,m);return v===1?l.forEach(E=>{let T=E.rect.element.height+c;i+=T,t+=T*E.opacity}):(i=Math.ceil(g/v)*u,t=i),{visual:t,bounds:i}},zd=e=>{let t=e.ref.measureHeight||null;return{cappedHeight:parseInt(e.style.maxHeight,10)||null,fixedHeight:t===0?null:t}},aa=(e,t)=>{let i=e.query("GET_ALLOW_REPLACE"),a=e.query("GET_ALLOW_MULTIPLE"),n=e.query("GET_TOTAL_ITEMS"),o=e.query("GET_MAX_FILES"),l=t.length;return!a&&l>1?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:ie("warning",0,"Max files")}),!0):(o=a?o:1,!a&&i?!1:gt(o)&&n+l>o?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:ie("warning",0,"Max files")}),!0):!1)},Cd=(e,t,i)=>{let a=e.childViews[0];return Ki(a,t,{left:i.scopeLeft-a.rect.element.left,top:i.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},mn=e=>{let t=e.query("GET_ALLOW_DROP"),i=e.query("GET_DISABLED"),a=t&&!i;if(a&&!e.ref.hopper){let n=vd(e.element,o=>{let l=e.query("GET_BEFORE_DROP_FILE")||(()=>!0);return e.query("GET_DROP_VALIDATION")?o.every(s=>tt("ALLOW_HOPPER_ITEM",s,{query:e.query}).every(p=>p===!0)&&l(s)):!0},{filterItems:o=>{let l=e.query("GET_IGNORED_FILES");return o.filter(r=>Je(r)?!l.includes(r.name.toLowerCase()):!0)},catchesDropsOnPage:e.query("GET_DROP_ON_PAGE"),requiresDropOnElement:e.query("GET_DROP_ON_ELEMENT")});n.onload=(o,l)=>{let s=e.ref.list.childViews[0].childViews.filter(c=>c.rect.element.height),p=e.query("GET_ACTIVE_ITEMS").map(c=>s.find(d=>d.id===c.id)).filter(c=>c);Ae("ADD_ITEMS",o,{dispatch:e.dispatch}).then(c=>{if(aa(e,c))return!1;e.dispatch("ADD_ITEMS",{items:c,index:Cd(e.ref.list,p,l),interactionMethod:_e.DROP})}),e.dispatch("DID_DROP",{position:l}),e.dispatch("DID_END_DRAG",{position:l})},n.ondragstart=o=>{e.dispatch("DID_START_DRAG",{position:o})},n.ondrag=eo(o=>{e.dispatch("DID_DRAG",{position:o})}),n.ondragend=o=>{e.dispatch("DID_END_DRAG",{position:o})},e.ref.hopper=n,e.ref.drip=e.appendChildView(e.createChildView(Uc))}else!a&&e.ref.hopper&&(e.ref.hopper.destroy(),e.ref.hopper=null,e.removeChildView(e.ref.drip))},un=(e,t)=>{let i=e.query("GET_ALLOW_BROWSE"),a=e.query("GET_DISABLED"),n=i&&!a;n&&!e.ref.browser?e.ref.browser=e.appendChildView(e.createChildView(Pc,{...t,onload:o=>{Ae("ADD_ITEMS",o,{dispatch:e.dispatch}).then(l=>{if(aa(e,l))return!1;e.dispatch("ADD_ITEMS",{items:l,index:-1,interactionMethod:_e.BROWSE})})}}),0):!n&&e.ref.browser&&(e.removeChildView(e.ref.browser),e.ref.browser=null)},fn=e=>{let t=e.query("GET_ALLOW_PASTE"),i=e.query("GET_DISABLED"),a=t&&!i;a&&!e.ref.paster?(e.ref.paster=yd(),e.ref.paster.onload=n=>{Ae("ADD_ITEMS",n,{dispatch:e.dispatch}).then(o=>{if(aa(e,o))return!1;e.dispatch("ADD_ITEMS",{items:o,index:-1,interactionMethod:_e.PASTE})})}):!a&&e.ref.paster&&(e.ref.paster.destroy(),e.ref.paster=null)},Nd=he({DID_SET_ALLOW_BROWSE:({root:e,props:t})=>{un(e,t)},DID_SET_ALLOW_DROP:({root:e})=>{mn(e)},DID_SET_ALLOW_PASTE:({root:e})=>{fn(e)},DID_SET_DISABLED:({root:e,props:t})=>{mn(e),fn(e),un(e,t),e.query("GET_DISABLED")?e.element.dataset.disabled="disabled":e.element.removeAttribute("data-disabled")}}),Bd=ne({name:"root",read:({root:e})=>{e.ref.measure&&(e.ref.measureHeight=e.ref.measure.offsetHeight)},create:Od,write:Pd,destroy:({root:e})=>{e.ref.paster&&e.ref.paster.destroy(),e.ref.hopper&&e.ref.hopper.destroy(),e.element.removeEventListener("touchmove",ri),e.element.removeEventListener("gesturestart",ri)},mixins:{styles:["height"]}}),kd=(e={})=>{let t=null,i=oi(),a=ir(Gr(i),[os,Hr(i)],[Ms,Wr(i)]);a.dispatch("SET_OPTIONS",{options:e});let n=()=>{document.hidden||a.dispatch("KICK")};document.addEventListener("visibilitychange",n);let o=null,l=!1,r=!1,s=null,p=null,c=()=>{l||(l=!0),clearTimeout(o),o=setTimeout(()=>{l=!1,s=null,p=null,r&&(r=!1,a.dispatch("DID_STOP_RESIZE"))},500)};window.addEventListener("resize",c);let d=Bd(a,{id:Yi()}),m=!1,u=!1,f={_read:()=>{l&&(p=window.innerWidth,s||(s=p),!r&&p!==s&&(a.dispatch("DID_START_RESIZE"),r=!0)),u&&m&&(m=d.element.offsetParent===null),!m&&(d._read(),u=d.rect.element.hidden)},_write:R=>{let L=a.processActionQueue().filter(z=>!/^SET_/.test(z.type));m&&!L.length||(E(L),m=d._write(R,L,r),qr(a.query("GET_ITEMS")),m&&a.processDispatchQueue())}},h=R=>L=>{let z={type:R};if(!L)return z;if(L.hasOwnProperty("error")&&(z.error=L.error?{...L.error}:null),L.status&&(z.status={...L.status}),L.file&&(z.output=L.file),L.source)z.file=L.source;else if(L.item||L.id){let D=L.item?L.item:a.query("GET_ITEM",L.id);z.file=D?ge(D):null}return L.items&&(z.items=L.items.map(ge)),/progress/.test(R)&&(z.progress=L.progress),L.hasOwnProperty("origin")&&L.hasOwnProperty("target")&&(z.origin=L.origin,z.target=L.target),z},g={DID_DESTROY:h("destroy"),DID_INIT:h("init"),DID_THROW_MAX_FILES:h("warning"),DID_INIT_ITEM:h("initfile"),DID_START_ITEM_LOAD:h("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:h("addfileprogress"),DID_LOAD_ITEM:h("addfile"),DID_THROW_ITEM_INVALID:[h("error"),h("addfile")],DID_THROW_ITEM_LOAD_ERROR:[h("error"),h("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[h("error"),h("removefile")],DID_PREPARE_OUTPUT:h("preparefile"),DID_START_ITEM_PROCESSING:h("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:h("processfileprogress"),DID_ABORT_ITEM_PROCESSING:h("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:h("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:h("processfiles"),DID_REVERT_ITEM_PROCESSING:h("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[h("error"),h("processfile")],DID_REMOVE_ITEM:h("removefile"),DID_UPDATE_ITEMS:h("updatefiles"),DID_ACTIVATE_ITEM:h("activatefile"),DID_REORDER_ITEMS:h("reorderfiles")},v=R=>{let L={pond:F,...R};delete L.type,d.element.dispatchEvent(new CustomEvent(`FilePond:${R.type}`,{detail:L,bubbles:!0,cancelable:!0,composed:!0}));let z=[];R.hasOwnProperty("error")&&z.push(R.error),R.hasOwnProperty("file")&&z.push(R.file);let D=["type","error","file"];Object.keys(R).filter(B=>!D.includes(B)).forEach(B=>z.push(R[B])),F.fire(R.type,...z);let k=a.query(`GET_ON${R.type.toUpperCase()}`);k&&k(...z)},E=R=>{R.length&&R.filter(L=>g[L.type]).forEach(L=>{let z=g[L.type];(Array.isArray(z)?z:[z]).forEach(D=>{L.type==="DID_INIT_ITEM"?v(D(L.data)):setTimeout(()=>{v(D(L.data))},0)})})},T=R=>a.dispatch("SET_OPTIONS",{options:R}),I=R=>a.query("GET_ACTIVE_ITEM",R),y=R=>new Promise((L,z)=>{a.dispatch("REQUEST_ITEM_PREPARE",{query:R,success:D=>{L(D)},failure:D=>{z(D)}})}),b=(R,L={})=>new Promise((z,D)=>{_([{source:R,options:L}],{index:L.index}).then(k=>z(k&&k[0])).catch(D)}),w=R=>R.file&&R.id,x=(R,L)=>(typeof R=="object"&&!w(R)&&!L&&(L=R,R=void 0),a.dispatch("REMOVE_ITEM",{...L,query:R}),a.query("GET_ACTIVE_ITEM",R)===null),_=(...R)=>new Promise((L,z)=>{let D=[],k={};if(si(R[0]))D.push.apply(D,R[0]),Object.assign(k,R[1]||{});else{let B=R[R.length-1];typeof B=="object"&&!(B instanceof Blob)&&Object.assign(k,R.pop()),D.push(...R)}a.dispatch("ADD_ITEMS",{items:D,index:k.index,interactionMethod:_e.API,success:L,failure:z})}),P=()=>a.query("GET_ACTIVE_ITEMS"),O=R=>new Promise((L,z)=>{a.dispatch("REQUEST_ITEM_PROCESSING",{query:R,success:D=>{L(D)},failure:D=>{z(D)}})}),M=(...R)=>{let L=Array.isArray(R[0])?R[0]:R,z=L.length?L:P();return Promise.all(z.map(y))},C=(...R)=>{let L=Array.isArray(R[0])?R[0]:R;if(!L.length){let z=P().filter(D=>!(D.status===W.IDLE&&D.origin===re.LOCAL)&&D.status!==W.PROCESSING&&D.status!==W.PROCESSING_COMPLETE&&D.status!==W.PROCESSING_REVERT_ERROR);return Promise.all(z.map(O))}return Promise.all(L.map(O))},S=(...R)=>{let L=Array.isArray(R[0])?R[0]:R,z;typeof L[L.length-1]=="object"?z=L.pop():Array.isArray(R[0])&&(z=R[1]);let D=P();return L.length?L.map(B=>$e(B)?D[B]?D[B].id:null:B).filter(B=>B).map(B=>x(B,z)):Promise.all(D.map(B=>x(B,z)))},F={...pi(),...f,...Ur(a,i),setOptions:T,addFile:b,addFiles:_,getFile:I,processFile:O,prepareFile:y,removeFile:x,moveFile:(R,L)=>a.dispatch("MOVE_ITEM",{query:R,index:L}),getFiles:P,processFiles:C,removeFiles:S,prepareFiles:M,sort:R=>a.dispatch("SORT",{compare:R}),browse:()=>{var R=d.element.querySelector("input[type=file]");R&&R.click()},destroy:()=>{F.fire("destroy",d.element),a.dispatch("ABORT_ALL"),d._destroy(),window.removeEventListener("resize",c),document.removeEventListener("visibilitychange",n),a.dispatch("DID_DESTROY")},insertBefore:R=>Ca(d.element,R),insertAfter:R=>Na(d.element,R),appendTo:R=>R.appendChild(d.element),replaceElement:R=>{Ca(d.element,R),R.parentNode.removeChild(R),t=R},restoreElement:()=>{t&&(Na(t,d.element),d.element.parentNode.removeChild(d.element),t=null)},isAttachedTo:R=>d.element===R||t===R,element:{get:()=>d.element},status:{get:()=>a.query("GET_STATUS")}};return a.dispatch("DID_INIT"),We(F)},to=(e={})=>{let t={};return te(oi(),(a,n)=>{t[a]=n[0]}),kd({...t,...e})},Vd=e=>e.charAt(0).toLowerCase()+e.slice(1),Gd=e=>Jn(e.replace(/^data-/,"")),io=(e,t)=>{te(t,(i,a)=>{te(e,(n,o)=>{let l=new RegExp(i);if(!l.test(n)||(delete e[n],a===!1))return;if(fe(a)){e[a]=o;return}let s=a.group;ce(a)&&!e[s]&&(e[s]={}),e[s][Vd(n.replace(l,""))]=o}),a.mapping&&io(e[a.group],a.mapping)})},Ud=(e,t={})=>{let i=[];te(e.attributes,n=>{i.push(e.attributes[n])});let a=i.filter(n=>n.name).reduce((n,o)=>{let l=se(e,o.name);return n[Gd(o.name)]=l===o.name?!0:l,n},{});return io(a,t),a},Wd=(e,t={})=>{let i={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};tt("SET_ATTRIBUTE_TO_OPTION_MAP",i);let a={...t},n=Ud(e.nodeName==="FIELDSET"?e.querySelector("input[type=file]"):e,i);Object.keys(n).forEach(l=>{ce(n[l])?(ce(a[l])||(a[l]={}),Object.assign(a[l],n[l])):a[l]=n[l]}),a.files=(t.files||[]).concat(Array.from(e.querySelectorAll("input:not([type=file])")).map(l=>({source:l.value,options:{type:l.dataset.type}})));let o=to(a);return e.files&&Array.from(e.files).forEach(l=>{o.addFile(l)}),o.replaceElement(e),o},Hd=(...e)=>tr(e[0])?Wd(...e):to(...e),jd=["fire","_read","_write"],hn=e=>{let t={};return yn(e,t,jd),t},Yd=(e,t)=>e.replace(/(?:{([a-zA-Z]+)})/g,(i,a)=>t[a]),qd=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i);return{transfer:(n,o)=>{},post:(n,o,l)=>{let r=Yi();a.onmessage=s=>{s.data.id===r&&o(s.data.message)},a.postMessage({id:r,message:n},l)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},$d=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),ao=(e,t)=>{let i=e.slice(0,e.size,e.type);return i.lastModifiedDate=e.lastModifiedDate,i.name=t,i},Xd=e=>ao(e,e.name),gn=[],Qd=e=>{if(gn.includes(e))return;gn.push(e);let t=e({addFilter:Xr,utils:{Type:A,forin:te,isString:fe,isFile:Je,toNaturalFileSize:Cn,replaceInString:Yd,getExtensionFromFilename:mi,getFilenameWithoutExtension:Dn,guesstimateMimeType:qn,getFileFromBlob:ht,getFilenameFromURL:Ft,createRoute:he,createWorker:qd,createView:ne,createItemAPI:ge,loadImage:$d,copyFile:Xd,renameFile:ao,createBlob:Mn,applyFilterChain:Ae,text:ae,getNumericAspectRatioFromString:wn},views:{fileActionButton:zn}});Qr(t.options)},Zd=()=>Object.prototype.toString.call(window.operamini)==="[object OperaMini]",Kd=()=>"Promise"in window,Jd=()=>"slice"in Blob.prototype,ep=()=>"URL"in window&&"createObjectURL"in window.URL,tp=()=>"visibilityState"in document,ip=()=>"performance"in window,ap=()=>"supports"in(window.CSS||{}),np=()=>/MSIE|Trident/.test(window.navigator.userAgent),Vi=(()=>{let e=En()&&!Zd()&&tp()&&Kd()&&Jd()&&ep()&&ip()&&(ap()||np());return()=>e})(),Ue={apps:[]},op="filepond",it=()=>{},no={},Et={},zt={},Gi={},ut=it,ft=it,Ui=it,Wi=it,Ie=it,Hi=it,Dt=it;if(Vi()){Sr(()=>{Ue.apps.forEach(i=>i._read())},i=>{Ue.apps.forEach(a=>a._write(i))});let e=()=>{document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:Vi,create:ut,destroy:ft,parse:Ui,find:Wi,registerPlugin:Ie,setOptions:Dt}})),document.removeEventListener("DOMContentLoaded",e)};document.readyState!=="loading"?setTimeout(()=>e(),0):document.addEventListener("DOMContentLoaded",e);let t=()=>te(oi(),(i,a)=>{Gi[i]=a[1]});no={...Sn},zt={...re},Et={...W},Gi={},t(),ut=(...i)=>{let a=Hd(...i);return a.on("destroy",ft),Ue.apps.push(a),hn(a)},ft=i=>{let a=Ue.apps.findIndex(n=>n.isAttachedTo(i));return a>=0?(Ue.apps.splice(a,1)[0].restoreElement(),!0):!1},Ui=i=>Array.from(i.querySelectorAll(`.${op}`)).filter(o=>!Ue.apps.find(l=>l.isAttachedTo(o))).map(o=>ut(o)),Wi=i=>{let a=Ue.apps.find(n=>n.isAttachedTo(i));return a?hn(a):null},Ie=(...i)=>{i.forEach(Qd),t()},Hi=()=>{let i={};return te(oi(),(a,n)=>{i[a]=n[0]}),i},Dt=i=>(ce(i)&&(Ue.apps.forEach(a=>{a.setOptions(i)}),Zr(i)),Hi())}function oo(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function xo(e){for(var t=1;te.length)&&(t=e.length);for(var i=0,a=new Array(t);i
',yp=Number.isNaN||Fe.isNaN;function j(e){return typeof e=="number"&&!yp(e)}var To=function(t){return t>0&&t<1/0};function oa(e){return typeof e>"u"}function ot(e){return ra(e)==="object"&&e!==null}var _p=Object.prototype.hasOwnProperty;function Tt(e){if(!ot(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&_p.call(i,"isPrototypeOf")}catch{return!1}}function Ee(e){return typeof e=="function"}var Rp=Array.prototype.slice;function Po(e){return Array.from?Array.from(e):Rp.call(e)}function oe(e,t){return e&&Ee(t)&&(Array.isArray(e)||j(e.length)?Po(e).forEach(function(i,a){t.call(e,i,a,e)}):ot(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var J=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n0&&a.forEach(function(o){ot(o)&&Object.keys(o).forEach(function(l){t[l]=o[l]})}),t},wp=/\.\d*(?:0|9){12}\d*$/;function It(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return wp.test(e)?Math.round(e*t)/t:e}var Sp=/^width|height|left|top|marginLeft|marginTop$/;function je(e,t){var i=e.style;oe(t,function(a,n){Sp.test(n)&&j(a)&&(a="".concat(a,"px")),i[n]=a})}function Lp(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function de(e,t){if(t){if(j(e.length)){oe(e,function(a){de(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function De(e,t){if(t){if(j(e.length)){oe(e,function(i){De(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function vt(e,t,i){if(t){if(j(e.length)){oe(e,function(a){vt(a,t,i)});return}i?de(e,t):De(e,t)}}var Ap=/([a-z\d])([A-Z])/g;function Ia(e){return e.replace(Ap,"$1-$2").toLowerCase()}function ga(e,t){return ot(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Ia(t)))}function Ut(e,t,i){ot(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(Ia(t)),i)}function Mp(e,t){if(ot(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch{e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Ia(t)))}var Do=/\s\s*/,Fo=function(){var e=!1;if(bi){var t=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(o){t=o}});Fe.addEventListener("test",i,a),Fe.removeEventListener("test",i,a)}return e}();function Pe(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(Do).forEach(function(o){if(!Fo){var l=e.listeners;l&&l[o]&&l[o][i]&&(n=l[o][i],delete l[o][i],Object.keys(l[o]).length===0&&delete l[o],Object.keys(l).length===0&&delete e.listeners)}e.removeEventListener(o,n,a)})}function Re(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(Do).forEach(function(o){if(a.once&&!Fo){var l=e.listeners,r=l===void 0?{}:l;n=function(){delete r[o][i],e.removeEventListener(o,n,a);for(var p=arguments.length,c=new Array(p),d=0;dMath.abs(i)&&(i=m)})}),i}function gi(e,t){var i=e.pageX,a=e.pageY,n={endX:i,endY:a};return t?n:xo({startX:i,startY:a},n)}function Dp(e){var t=0,i=0,a=0;return oe(e,function(n){var o=n.startX,l=n.startY;t+=o,i+=l,a+=1}),t/=a,i/=a,{pageX:t,pageY:i}}function Ye(e){var t=e.aspectRatio,i=e.height,a=e.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=To(a),l=To(i);if(o&&l){var r=i*t;n==="contain"&&r>a||n==="cover"&&r90?{width:s,height:r}:{width:r,height:s}}function zp(e,t,i,a){var n=t.aspectRatio,o=t.naturalWidth,l=t.naturalHeight,r=t.rotate,s=r===void 0?0:r,p=t.scaleX,c=p===void 0?1:p,d=t.scaleY,m=d===void 0?1:d,u=i.aspectRatio,f=i.naturalWidth,h=i.naturalHeight,g=a.fillColor,v=g===void 0?"transparent":g,E=a.imageSmoothingEnabled,T=E===void 0?!0:E,I=a.imageSmoothingQuality,y=I===void 0?"low":I,b=a.maxWidth,w=b===void 0?1/0:b,x=a.maxHeight,_=x===void 0?1/0:x,P=a.minWidth,O=P===void 0?0:P,M=a.minHeight,C=M===void 0?0:M,S=document.createElement("canvas"),F=S.getContext("2d"),R=Ye({aspectRatio:u,width:w,height:_}),L=Ye({aspectRatio:u,width:O,height:C},"cover"),z=Math.min(R.width,Math.max(L.width,f)),D=Math.min(R.height,Math.max(L.height,h)),k=Ye({aspectRatio:n,width:w,height:_}),B=Ye({aspectRatio:n,width:O,height:C},"cover"),X=Math.min(k.width,Math.max(B.width,o)),q=Math.min(k.height,Math.max(B.height,l)),Q=[-X/2,-q/2,X,q];return S.width=It(z),S.height=It(D),F.fillStyle=v,F.fillRect(0,0,z,D),F.save(),F.translate(z/2,D/2),F.rotate(s*Math.PI/180),F.scale(c,m),F.imageSmoothingEnabled=T,F.imageSmoothingQuality=y,F.drawImage.apply(F,[e].concat(_o(Q.map(function(pe){return Math.floor(It(pe))})))),F.restore(),S}var Co=String.fromCharCode;function Cp(e,t,i){var a="";i+=t;for(var n=t;n0;)i.push(Co.apply(null,Po(n.subarray(0,a)))),n=n.subarray(a);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function Vp(e){var t=new DataView(e),i;try{var a,n,o;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var l=t.byteLength,r=2;r+1=8&&(o=p+d)}}}if(o){var m=t.getUint16(o,a),u,f;for(f=0;f=0?o:Mo),height:Math.max(a.offsetHeight,l>=0?l:Oo)};this.containerData=r,je(n,{width:r.width,height:r.height}),de(t,be),De(n,be)},initCanvas:function(){var t=this.containerData,i=this.imageData,a=this.options.viewMode,n=Math.abs(i.rotate)%180===90,o=n?i.naturalHeight:i.naturalWidth,l=n?i.naturalWidth:i.naturalHeight,r=o/l,s=t.width,p=t.height;t.height*r>t.width?a===3?s=t.height*r:p=t.width/r:a===3?p=t.width/r:s=t.height*r;var c={aspectRatio:r,naturalWidth:o,naturalHeight:l,width:s,height:p};this.canvasData=c,this.limited=a===1||a===2,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=J({},c)},limitCanvas:function(t,i){var a=this.options,n=this.containerData,o=this.canvasData,l=this.cropBoxData,r=a.viewMode,s=o.aspectRatio,p=this.cropped&&l;if(t){var c=Number(a.minCanvasWidth)||0,d=Number(a.minCanvasHeight)||0;r>1?(c=Math.max(c,n.width),d=Math.max(d,n.height),r===3&&(d*s>c?c=d*s:d=c/s)):r>0&&(c?c=Math.max(c,p?l.width:0):d?d=Math.max(d,p?l.height:0):p&&(c=l.width,d=l.height,d*s>c?c=d*s:d=c/s));var m=Ye({aspectRatio:s,width:c,height:d});c=m.width,d=m.height,o.minWidth=c,o.minHeight=d,o.maxWidth=1/0,o.maxHeight=1/0}if(i)if(r>(p?0:1)){var u=n.width-o.width,f=n.height-o.height;o.minLeft=Math.min(0,u),o.minTop=Math.min(0,f),o.maxLeft=Math.max(0,u),o.maxTop=Math.max(0,f),p&&this.limited&&(o.minLeft=Math.min(l.left,l.left+(l.width-o.width)),o.minTop=Math.min(l.top,l.top+(l.height-o.height)),o.maxLeft=l.left,o.maxTop=l.top,r===2&&(o.width>=n.width&&(o.minLeft=Math.min(0,u),o.maxLeft=Math.max(0,u)),o.height>=n.height&&(o.minTop=Math.min(0,f),o.maxTop=Math.max(0,f))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=n.width,o.maxTop=n.height},renderCanvas:function(t,i){var a=this.canvasData,n=this.imageData;if(i){var o=Fp({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),l=o.width,r=o.height,s=a.width*(l/a.naturalWidth),p=a.height*(r/a.naturalHeight);a.left-=(s-a.width)/2,a.top-=(p-a.height)/2,a.width=s,a.height=p,a.aspectRatio=l/r,a.naturalWidth=l,a.naturalHeight=r,this.limitCanvas(!0,!1)}(a.width>a.maxWidth||a.widtha.maxHeight||a.heighti.width?o.height=o.width/a:o.width=o.height*a),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*n),o.height=Math.max(o.minHeight,o.height*n),o.left=i.left+(i.width-o.width)/2,o.top=i.top+(i.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=J({},o)},limitCropBox:function(t,i){var a=this.options,n=this.containerData,o=this.canvasData,l=this.cropBoxData,r=this.limited,s=a.aspectRatio;if(t){var p=Number(a.minCropBoxWidth)||0,c=Number(a.minCropBoxHeight)||0,d=r?Math.min(n.width,o.width,o.width+o.left,n.width-o.left):n.width,m=r?Math.min(n.height,o.height,o.height+o.top,n.height-o.top):n.height;p=Math.min(p,n.width),c=Math.min(c,n.height),s&&(p&&c?c*s>p?c=p/s:p=c*s:p?c=p/s:c&&(p=c*s),m*s>d?m=d/s:d=m*s),l.minWidth=Math.min(p,d),l.minHeight=Math.min(c,m),l.maxWidth=d,l.maxHeight=m}i&&(r?(l.minLeft=Math.max(0,o.left),l.minTop=Math.max(0,o.top),l.maxLeft=Math.min(n.width,o.left+o.width)-l.width,l.maxTop=Math.min(n.height,o.top+o.height)-l.height):(l.minLeft=0,l.minTop=0,l.maxLeft=n.width-l.width,l.maxTop=n.height-l.height))},renderCropBox:function(){var t=this.options,i=this.containerData,a=this.cropBoxData;(a.width>a.maxWidth||a.widtha.maxHeight||a.height=i.width&&a.height>=i.height?wo:Ta),je(this.cropBox,J({width:a.width,height:a.height},Vt({translateX:a.left,translateY:a.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),xt(this.element,pa,this.getData())}},Wp={initPreview:function(){var t=this.element,i=this.crossOrigin,a=this.options.preview,n=i?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",l=document.createElement("img");if(i&&(l.crossOrigin=i),l.src=n,l.alt=o,this.viewBox.appendChild(l),this.viewBoxImage=l,!!a){var r=a;typeof a=="string"?r=t.ownerDocument.querySelectorAll(a):a.querySelector&&(r=[a]),this.previews=r,oe(r,function(s){var p=document.createElement("img");Ut(s,hi,{width:s.offsetWidth,height:s.offsetHeight,html:s.innerHTML}),i&&(p.crossOrigin=i),p.src=n,p.alt=o,p.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',s.innerHTML="",s.appendChild(p)})}},resetPreview:function(){oe(this.previews,function(t){var i=ga(t,hi);je(t,{width:i.width,height:i.height}),t.innerHTML=i.html,Mp(t,hi)})},preview:function(){var t=this.imageData,i=this.canvasData,a=this.cropBoxData,n=a.width,o=a.height,l=t.width,r=t.height,s=a.left-i.left-t.left,p=a.top-i.top-t.top;!this.cropped||this.disabled||(je(this.viewBoxImage,J({width:l,height:r},Vt(J({translateX:-s,translateY:-p},t)))),oe(this.previews,function(c){var d=ga(c,hi),m=d.width,u=d.height,f=m,h=u,g=1;n&&(g=m/n,h=o*g),o&&h>u&&(g=u/o,f=n*g,h=u),je(c,{width:f,height:h}),je(c.getElementsByTagName("img")[0],J({width:l*g,height:r*g},Vt(J({translateX:-s*g,translateY:-p*g},t))))}))}},Hp={bind:function(){var t=this.element,i=this.options,a=this.cropper;Ee(i.cropstart)&&Re(t,fa,i.cropstart),Ee(i.cropmove)&&Re(t,ua,i.cropmove),Ee(i.cropend)&&Re(t,ma,i.cropend),Ee(i.crop)&&Re(t,pa,i.crop),Ee(i.zoom)&&Re(t,ha,i.zoom),Re(a,po,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&Re(a,go,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Re(a,co,this.onDblclick=this.dblclick.bind(this)),Re(t.ownerDocument,mo,this.onCropMove=this.cropMove.bind(this)),Re(t.ownerDocument,uo,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&Re(window,ho,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,a=this.cropper;Ee(i.cropstart)&&Pe(t,fa,i.cropstart),Ee(i.cropmove)&&Pe(t,ua,i.cropmove),Ee(i.cropend)&&Pe(t,ma,i.cropend),Ee(i.crop)&&Pe(t,pa,i.crop),Ee(i.zoom)&&Pe(t,ha,i.zoom),Pe(a,po,this.onCropStart),i.zoomable&&i.zoomOnWheel&&Pe(a,go,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Pe(a,co,this.onDblclick),Pe(t.ownerDocument,mo,this.onCropMove),Pe(t.ownerDocument,uo,this.onCropEnd),i.responsive&&Pe(window,ho,this.onResize)}},jp={resize:function(){if(!this.disabled){var t=this.options,i=this.container,a=this.containerData,n=i.offsetWidth/a.width,o=i.offsetHeight/a.height,l=Math.abs(n-1)>Math.abs(o-1)?n:o;if(l!==1){var r,s;t.restore&&(r=this.getCanvasData(),s=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(oe(r,function(p,c){r[c]=p*l})),this.setCropBoxData(oe(s,function(p,c){s[c]=p*l})))}}},dblclick:function(){this.disabled||this.options.dragMode===Ao||this.setDragMode(Lp(this.dragBox,ca)?Lo:va)},wheel:function(t){var i=this,a=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*a,t)))},cropStart:function(t){var i=t.buttons,a=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(j(i)&&i!==1||j(a)&&a!==0||t.ctrlKey))){var n=this.options,o=this.pointers,l;t.changedTouches?oe(t.changedTouches,function(r){o[r.identifier]=gi(r)}):o[t.pointerId||0]=gi(t),Object.keys(o).length>1&&n.zoomable&&n.zoomOnTouch?l=So:l=ga(t.target,Gt),bp.test(l)&&xt(this.element,fa,{originalEvent:t,action:l})!==!1&&(t.preventDefault(),this.action=l,this.cropping=!1,l===Ro&&(this.cropping=!0,de(this.dragBox,Ei)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var a=this.pointers;t.preventDefault(),xt(this.element,ua,{originalEvent:t,action:i})!==!1&&(t.changedTouches?oe(t.changedTouches,function(n){J(a[n.identifier]||{},gi(n,!0))}):J(a[t.pointerId||0]||{},gi(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,a=this.pointers;t.changedTouches?oe(t.changedTouches,function(n){delete a[n.identifier]}):delete a[t.pointerId||0],i&&(t.preventDefault(),Object.keys(a).length||(this.action=""),this.cropping&&(this.cropping=!1,vt(this.dragBox,Ei,this.cropped&&this.options.modal)),xt(this.element,ma,{originalEvent:t,action:i}))}}},Yp={change:function(t){var i=this.options,a=this.canvasData,n=this.containerData,o=this.cropBoxData,l=this.pointers,r=this.action,s=i.aspectRatio,p=o.left,c=o.top,d=o.width,m=o.height,u=p+d,f=c+m,h=0,g=0,v=n.width,E=n.height,T=!0,I;!s&&t.shiftKey&&(s=d&&m?d/m:1),this.limited&&(h=o.minLeft,g=o.minTop,v=h+Math.min(n.width,a.width,a.left+a.width),E=g+Math.min(n.height,a.height,a.top+a.height));var y=l[Object.keys(l)[0]],b={x:y.endX-y.startX,y:y.endY-y.startY},w=function(_){switch(_){case at:u+b.x>v&&(b.x=v-u);break;case nt:p+b.xE&&(b.y=E-f);break}};switch(r){case Ta:p+=b.x,c+=b.y;break;case at:if(b.x>=0&&(u>=v||s&&(c<=g||f>=E))){T=!1;break}w(at),d+=b.x,d<0&&(r=nt,d=-d,p-=d),s&&(m=d/s,c+=(o.height-m)/2);break;case He:if(b.y<=0&&(c<=g||s&&(p<=h||u>=v))){T=!1;break}w(He),m-=b.y,c+=b.y,m<0&&(r=bt,m=-m,c-=m),s&&(d=m*s,p+=(o.width-d)/2);break;case nt:if(b.x<=0&&(p<=h||s&&(c<=g||f>=E))){T=!1;break}w(nt),d-=b.x,p+=b.x,d<0&&(r=at,d=-d,p-=d),s&&(m=d/s,c+=(o.height-m)/2);break;case bt:if(b.y>=0&&(f>=E||s&&(p<=h||u>=v))){T=!1;break}w(bt),m+=b.y,m<0&&(r=He,m=-m,c-=m),s&&(d=m*s,p+=(o.width-d)/2);break;case Ct:if(s){if(b.y<=0&&(c<=g||u>=v)){T=!1;break}w(He),m-=b.y,c+=b.y,d=m*s}else w(He),w(at),b.x>=0?ug&&(m-=b.y,c+=b.y):(m-=b.y,c+=b.y);d<0&&m<0?(r=kt,m=-m,d=-d,c-=m,p-=d):d<0?(r=Nt,d=-d,p-=d):m<0&&(r=Bt,m=-m,c-=m);break;case Nt:if(s){if(b.y<=0&&(c<=g||p<=h)){T=!1;break}w(He),m-=b.y,c+=b.y,d=m*s,p+=o.width-d}else w(He),w(nt),b.x<=0?p>h?(d-=b.x,p+=b.x):b.y<=0&&c<=g&&(T=!1):(d-=b.x,p+=b.x),b.y<=0?c>g&&(m-=b.y,c+=b.y):(m-=b.y,c+=b.y);d<0&&m<0?(r=Bt,m=-m,d=-d,c-=m,p-=d):d<0?(r=Ct,d=-d,p-=d):m<0&&(r=kt,m=-m,c-=m);break;case kt:if(s){if(b.x<=0&&(p<=h||f>=E)){T=!1;break}w(nt),d-=b.x,p+=b.x,m=d/s}else w(bt),w(nt),b.x<=0?p>h?(d-=b.x,p+=b.x):b.y>=0&&f>=E&&(T=!1):(d-=b.x,p+=b.x),b.y>=0?f=0&&(u>=v||f>=E)){T=!1;break}w(at),d+=b.x,m=d/s}else w(bt),w(at),b.x>=0?u=0&&f>=E&&(T=!1):d+=b.x,b.y>=0?f0?r=b.y>0?Bt:Ct:b.x<0&&(p-=d,r=b.y>0?kt:Nt),b.y<0&&(c-=m),this.cropped||(De(this.cropBox,be),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(o.width=d,o.height=m,o.left=p,o.top=c,this.action=r,this.renderCropBox()),oe(l,function(x){x.startX=x.endX,x.startY=x.endY})}},qp={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&de(this.dragBox,Ei),De(this.cropBox,be),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=J({},this.initialImageData),this.canvasData=J({},this.initialCanvasData),this.cropBoxData=J({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(J(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),De(this.dragBox,Ei),de(this.cropBox,be)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,oe(this.previews,function(a){a.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,De(this.cropper,ro)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,de(this.cropper,ro)),this},destroy:function(){var t=this.element;return t[K]?(t[K]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=a.left,o=a.top;return this.moveTo(oa(t)?t:n+Number(t),oa(i)?i:o+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(j(t)&&(a.left=t,n=!0),j(i)&&(a.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,i){var a=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(a.width*t/a.naturalWidth,null,i)},zoomTo:function(t,i,a){var n=this.options,o=this.canvasData,l=o.width,r=o.height,s=o.naturalWidth,p=o.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var c=s*t,d=p*t;if(xt(this.element,ha,{ratio:t,oldRatio:l/s,originalEvent:a})===!1)return this;if(a){var m=this.pointers,u=zo(this.cropper),f=m&&Object.keys(m).length?Dp(m):{pageX:a.pageX,pageY:a.pageY};o.left-=(c-l)*((f.pageX-u.left-o.left)/l),o.top-=(d-r)*((f.pageY-u.top-o.top)/r)}else Tt(i)&&j(i.x)&&j(i.y)?(o.left-=(c-l)*((i.x-o.left)/l),o.top-=(d-r)*((i.y-o.top)/r)):(o.left-=(c-l)/2,o.top-=(d-r)/2);o.width=c,o.height=d,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),j(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,j(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(j(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.imageData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(j(t)&&(a.scaleX=t,n=!0),j(i)&&(a.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,a=this.imageData,n=this.canvasData,o=this.cropBoxData,l;if(this.ready&&this.cropped){l={x:o.left-n.left,y:o.top-n.top,width:o.width,height:o.height};var r=a.width/a.naturalWidth;if(oe(l,function(c,d){l[d]=c/r}),t){var s=Math.round(l.y+l.height),p=Math.round(l.x+l.width);l.x=Math.round(l.x),l.y=Math.round(l.y),l.width=p-l.x,l.height=s-l.y}}else l={x:0,y:0,width:0,height:0};return i.rotatable&&(l.rotate=a.rotate||0),i.scalable&&(l.scaleX=a.scaleX||1,l.scaleY=a.scaleY||1),l},setData:function(t){var i=this.options,a=this.imageData,n=this.canvasData,o={};if(this.ready&&!this.disabled&&Tt(t)){var l=!1;i.rotatable&&j(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,l=!0),i.scalable&&(j(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,l=!0),j(t.scaleY)&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,l=!0)),l&&this.renderCanvas(!0,!0);var r=a.width/a.naturalWidth;j(t.x)&&(o.left=t.x*r+n.left),j(t.y)&&(o.top=t.y*r+n.top),j(t.width)&&(o.width=t.width*r),j(t.height)&&(o.height=t.height*r),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?J({},this.containerData):{}},getImageData:function(){return this.sized?J({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&oe(["left","top","width","height","naturalWidth","naturalHeight"],function(a){i[a]=t[a]}),i},setCanvasData:function(t){var i=this.canvasData,a=i.aspectRatio;return this.ready&&!this.disabled&&Tt(t)&&(j(t.left)&&(i.left=t.left),j(t.top)&&(i.top=t.top),j(t.width)?(i.width=t.width,i.height=t.width/a):j(t.height)&&(i.height=t.height,i.width=t.height*a),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,a=this.options.aspectRatio,n,o;return this.ready&&this.cropped&&!this.disabled&&Tt(t)&&(j(t.left)&&(i.left=t.left),j(t.top)&&(i.top=t.top),j(t.width)&&t.width!==i.width&&(n=!0,i.width=t.width),j(t.height)&&t.height!==i.height&&(o=!0,i.height=t.height),a&&(n?i.height=i.width/a:o&&(i.width=i.height*a)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,a=zp(this.image,this.imageData,i,t);if(!this.cropped)return a;var n=this.getData(t.rounded),o=n.x,l=n.y,r=n.width,s=n.height,p=a.width/Math.floor(i.naturalWidth);p!==1&&(o*=p,l*=p,r*=p,s*=p);var c=r/s,d=Ye({aspectRatio:c,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),m=Ye({aspectRatio:c,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=Ye({aspectRatio:c,width:t.width||(p!==1?a.width:r),height:t.height||(p!==1?a.height:s)}),f=u.width,h=u.height;f=Math.min(d.width,Math.max(m.width,f)),h=Math.min(d.height,Math.max(m.height,h));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=It(f),g.height=It(h),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,h);var E=t.imageSmoothingEnabled,T=E===void 0?!0:E,I=t.imageSmoothingQuality;v.imageSmoothingEnabled=T,I&&(v.imageSmoothingQuality=I);var y=a.width,b=a.height,w=o,x=l,_,P,O,M,C,S;w<=-r||w>y?(w=0,_=0,O=0,C=0):w<=0?(O=-w,w=0,_=Math.min(y,r+w),C=_):w<=y&&(O=0,_=Math.min(r,y-w),C=_),_<=0||x<=-s||x>b?(x=0,P=0,M=0,S=0):x<=0?(M=-x,x=0,P=Math.min(b,s+x),S=P):x<=b&&(M=0,P=Math.min(s,b-x),S=P);var F=[w,x,_,P];if(C>0&&S>0){var R=f/r;F.push(O*R,M*R,C*R,S*R)}return v.drawImage.apply(v,[a].concat(_o(F.map(function(L){return Math.floor(It(L))})))),g},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!oa(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,a=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var o=t===va,l=i.movable&&t===Lo;t=o||l?t:Ao,i.dragMode=t,Ut(a,Gt,t),vt(a,ca,o),vt(a,da,l),i.cropBoxMovable||(Ut(n,Gt,t),vt(n,ca,o),vt(n,da,l))}return this}},$p=Fe.Cropper,xa=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(rp(this,e),!t||!Ip.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=J({},bo,Tt(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return sp(e,[{key:"init",value:function(){var i=this.element,a=i.tagName.toLowerCase(),n;if(!i[K]){if(i[K]=this,a==="img"){if(this.isImg=!0,n=i.getAttribute("src")||"",this.originalUrl=n,!n)return;n=i.src}else a==="canvas"&&window.HTMLCanvasElement&&(n=i.toDataURL());this.load(n)}}},{key:"load",value:function(i){var a=this;if(i){this.url=i,this.imageData={};var n=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Tp.test(i)){vp.test(i)?this.read(Bp(i)):this.clone();return}var l=new XMLHttpRequest,r=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=r,l.onerror=r,l.ontimeout=r,l.onprogress=function(){l.getResponseHeader("content-type")!==Eo&&l.abort()},l.onload=function(){a.read(l.response)},l.onloadend=function(){a.reloading=!1,a.xhr=null},o.checkCrossOrigin&&vo(i)&&n.crossOrigin&&(i=Io(i)),l.open("GET",i,!0),l.responseType="arraybuffer",l.withCredentials=n.crossOrigin==="use-credentials",l.send()}}},{key:"read",value:function(i){var a=this.options,n=this.imageData,o=Vp(i),l=0,r=1,s=1;if(o>1){this.url=kp(i,Eo);var p=Gp(o);l=p.rotate,r=p.scaleX,s=p.scaleY}a.rotatable&&(n.rotate=l),a.scalable&&(n.scaleX=r,n.scaleY=s),this.clone()}},{key:"clone",value:function(){var i=this.element,a=this.url,n=i.crossOrigin,o=a;this.options.checkCrossOrigin&&vo(a)&&(n||(n="anonymous"),o=Io(a)),this.crossOrigin=n,this.crossOriginUrl=o;var l=document.createElement("img");n&&(l.crossOrigin=n),l.src=o||a,l.alt=i.alt||"The image to crop",this.image=l,l.onload=this.start.bind(this),l.onerror=this.stop.bind(this),de(l,so),i.parentNode.insertBefore(l,i.nextSibling)}},{key:"start",value:function(){var i=this,a=this.image;a.onload=null,a.onerror=null,this.sizing=!0;var n=Fe.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Fe.navigator.userAgent),o=function(p,c){J(i.imageData,{naturalWidth:p,naturalHeight:c,aspectRatio:p/c}),i.initialImageData=J({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(a.naturalWidth&&!n){o(a.naturalWidth,a.naturalHeight);return}var l=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=l,l.onload=function(){o(l.width,l.height),n||r.removeChild(l)},l.src=a.src,n||(l.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",r.appendChild(l))}},{key:"stop",value:function(){var i=this.image;i.onload=null,i.onerror=null,i.parentNode.removeChild(i),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var i=this.element,a=this.options,n=this.image,o=i.parentNode,l=document.createElement("div");l.innerHTML=xp;var r=l.querySelector(".".concat(K,"-container")),s=r.querySelector(".".concat(K,"-canvas")),p=r.querySelector(".".concat(K,"-drag-box")),c=r.querySelector(".".concat(K,"-crop-box")),d=c.querySelector(".".concat(K,"-face"));this.container=o,this.cropper=r,this.canvas=s,this.dragBox=p,this.cropBox=c,this.viewBox=r.querySelector(".".concat(K,"-view-box")),this.face=d,s.appendChild(n),de(i,be),o.insertBefore(r,i.nextSibling),De(n,so),this.initPreview(),this.bind(),a.initialAspectRatio=Math.max(0,a.initialAspectRatio)||NaN,a.aspectRatio=Math.max(0,a.aspectRatio)||NaN,a.viewMode=Math.max(0,Math.min(3,Math.round(a.viewMode)))||0,de(c,be),a.guides||de(c.getElementsByClassName("".concat(K,"-dashed")),be),a.center||de(c.getElementsByClassName("".concat(K,"-center")),be),a.background&&de(r,"".concat(K,"-bg")),a.highlight||de(d,fp),a.cropBoxMovable&&(de(d,da),Ut(d,Gt,Ta)),a.cropBoxResizable||(de(c.getElementsByClassName("".concat(K,"-line")),be),de(c.getElementsByClassName("".concat(K,"-point")),be)),this.render(),this.ready=!0,this.setDragMode(a.dragMode),a.autoCrop&&this.crop(),this.setData(a.data),Ee(a.ready)&&Re(i,fo,a.ready,{once:!0}),xt(i,fo)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),De(this.element,be)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=$p,e}},{key:"setDefaults",value:function(i){J(bo,Tt(i)&&i)}}])}();J(xa.prototype,Up,Wp,Hp,jp,Yp,qp);var No={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(No);var Bo=No;var ko={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(ko);var Vo=ko;var we=function(e,t,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:t.get(e)},yt,Wt,lt,ya=class{constructor(...t){yt.set(this,new Map),Wt.set(this,new Map),lt.set(this,new Map);for(let i of t)this.define(i)}define(t,i=!1){for(let[a,n]of Object.entries(t)){a=a.toLowerCase(),n=n.map(r=>r.toLowerCase()),we(this,lt,"f").has(a)||we(this,lt,"f").set(a,new Set);let o=we(this,lt,"f").get(a),l=!0;for(let r of n){let s=r.startsWith("*");if(r=s?r.slice(1):r,o?.add(r),l&&we(this,Wt,"f").set(a,r),l=!1,s)continue;let p=we(this,yt,"f").get(r);if(p&&p!=a&&!i)throw new Error(`"${a} -> ${r}" conflicts with "${p} -> ${r}". Pass \`force=true\` to override this definition.`);we(this,yt,"f").set(r,a)}}return this}getType(t){if(typeof t!="string")return null;let i=t.replace(/^.*[/\\]/,"").toLowerCase(),a=i.replace(/^.*\./,"").toLowerCase(),n=i.length{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(let t of we(this,lt,"f").values())Object.freeze(t);return this}_getTestState(){return{types:we(this,yt,"f"),extensions:we(this,Wt,"f")}}};yt=new WeakMap,Wt=new WeakMap,lt=new WeakMap;var _a=ya;var Go=new _a(Vo,Bo)._freeze();var Uo=({addFilter:e,utils:t})=>{let{Type:i,replaceInString:a,toNaturalFileSize:n}=t;return e("ALLOW_HOPPER_ITEM",(o,{query:l})=>{if(!l("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;let r=l("GET_MAX_FILE_SIZE");if(r!==null&&o.size>r)return!1;let s=l("GET_MIN_FILE_SIZE");return!(s!==null&&o.sizenew Promise((r,s)=>{if(!l("GET_ALLOW_FILE_SIZE_VALIDATION"))return r(o);let p=l("GET_FILE_VALIDATE_SIZE_FILTER");if(p&&!p(o))return r(o);let c=l("GET_MAX_FILE_SIZE");if(c!==null&&o.size>c){s({status:{main:l("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:a(l("GET_LABEL_MAX_FILE_SIZE"),{filesize:n(c,".",l("GET_FILE_SIZE_BASE"),l("GET_FILE_SIZE_LABELS",l))})}});return}let d=l("GET_MIN_FILE_SIZE");if(d!==null&&o.sizef+h.fileSize,0)>m){s({status:{main:l("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:a(l("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:n(m,".",l("GET_FILE_SIZE_BASE"),l("GET_FILE_SIZE_LABELS",l))})}});return}r(o)})),{options:{allowFileSizeValidation:[!0,i.BOOLEAN],maxFileSize:[null,i.INT],minFileSize:[null,i.INT],maxTotalFileSize:[null,i.INT],fileValidateSizeFilter:[null,i.FUNCTION],labelMinFileSizeExceeded:["File is too small",i.STRING],labelMinFileSize:["Minimum file size is {filesize}",i.STRING],labelMaxFileSizeExceeded:["File is too large",i.STRING],labelMaxFileSize:["Maximum file size is {filesize}",i.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",i.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",i.STRING]}}},Xp=typeof window<"u"&&typeof window.document<"u";Xp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Uo}));var Wo=Uo;var Ho=({addFilter:e,utils:t})=>{let{Type:i,isString:a,replaceInString:n,guesstimateMimeType:o,getExtensionFromFilename:l,getFilenameFromURL:r}=t,s=(u,f)=>{let h=(/^[^/]+/.exec(u)||[]).pop(),g=f.slice(0,-2);return h===g},p=(u,f)=>u.some(h=>/\*$/.test(h)?s(f,h):h===f),c=u=>{let f="";if(a(u)){let h=r(u),g=l(h);g&&(f=o(g))}else f=u.type;return f},d=(u,f,h)=>{if(f.length===0)return!0;let g=c(u);return h?new Promise((v,E)=>{h(u,g).then(T=>{p(f,T)?v():E()}).catch(E)}):p(f,g)},m=u=>f=>u[f]===null?!1:u[f]||f;return e("SET_ATTRIBUTE_TO_OPTION_MAP",u=>Object.assign(u,{accept:"acceptedFileTypes"})),e("ALLOW_HOPPER_ITEM",(u,{query:f})=>f("GET_ALLOW_FILE_TYPE_VALIDATION")?d(u,f("GET_ACCEPTED_FILE_TYPES")):!0),e("LOAD_FILE",(u,{query:f})=>new Promise((h,g)=>{if(!f("GET_ALLOW_FILE_TYPE_VALIDATION")){h(u);return}let v=f("GET_ACCEPTED_FILE_TYPES"),E=f("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),T=d(u,v,E),I=()=>{let y=v.map(m(f("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"))).filter(w=>w!==!1),b=y.filter((w,x)=>y.indexOf(w)===x);g({status:{main:f("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:n(f("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:b.join(", "),allButLastType:b.slice(0,-1).join(", "),lastType:b[b.length-1]})}})};if(typeof T=="boolean")return T?h(u):I();T.then(()=>{h(u)}).catch(I)})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}},Qp=typeof window<"u"&&typeof window.document<"u";Qp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Ho}));var jo=Ho;var Yo=e=>/^image/.test(e.type),qo=({addFilter:e,utils:t})=>{let{Type:i,isFile:a,getNumericAspectRatioFromString:n}=t,o=(p,c)=>!(!Yo(p.file)||!c("GET_ALLOW_IMAGE_CROP")),l=p=>typeof p=="object",r=p=>typeof p=="number",s=(p,c)=>p.setMetadata("crop",Object.assign({},p.getMetadata("crop"),c));return e("DID_CREATE_ITEM",(p,{query:c})=>{p.extend("setImageCrop",d=>{if(!(!o(p,c)||!l(center)))return p.setMetadata("crop",d),d}),p.extend("setImageCropCenter",d=>{if(!(!o(p,c)||!l(d)))return s(p,{center:d})}),p.extend("setImageCropZoom",d=>{if(!(!o(p,c)||!r(d)))return s(p,{zoom:Math.max(1,d)})}),p.extend("setImageCropRotation",d=>{if(!(!o(p,c)||!r(d)))return s(p,{rotation:d})}),p.extend("setImageCropFlip",d=>{if(!(!o(p,c)||!l(d)))return s(p,{flip:d})}),p.extend("setImageCropAspectRatio",d=>{if(!o(p,c)||typeof d>"u")return;let m=p.getMetadata("crop"),u=n(d),f={center:{x:.5,y:.5},flip:m?Object.assign({},m.flip):{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:u};return p.setMetadata("crop",f),f})}),e("DID_LOAD_ITEM",(p,{query:c})=>new Promise((d,m)=>{let u=p.file;if(!a(u)||!Yo(u)||!c("GET_ALLOW_IMAGE_CROP")||p.getMetadata("crop"))return d(p);let h=c("GET_IMAGE_CROP_ASPECT_RATIO");p.setMetadata("crop",{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:h?n(h):null}),d(p)})),{options:{allowImageCrop:[!0,i.BOOLEAN],imageCropAspectRatio:[null,i.STRING]}}},Zp=typeof window<"u"&&typeof window.document<"u";Zp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:qo}));var $o=qo;var Ra=e=>/^image/.test(e.type),Xo=e=>{let{addFilter:t,utils:i,views:a}=e,{Type:n,createRoute:o,createItemAPI:l=c=>c}=i,{fileActionButton:r}=a;t("SHOULD_REMOVE_ON_REVERT",(c,{item:d,query:m})=>new Promise(u=>{let{file:f}=d,h=m("GET_ALLOW_IMAGE_EDIT")&&m("GET_IMAGE_EDIT_ALLOW_EDIT")&&Ra(f);u(!h)})),t("DID_LOAD_ITEM",(c,{query:d,dispatch:m})=>new Promise((u,f)=>{if(c.origin>1){u(c);return}let{file:h}=c;if(!d("GET_ALLOW_IMAGE_EDIT")||!d("GET_IMAGE_EDIT_INSTANT_EDIT")){u(c);return}if(!Ra(h)){u(c);return}let g=(E,T,I)=>y=>{s.shift(),y?T(E):I(E),m("KICK"),v()},v=()=>{if(!s.length)return;let{item:E,resolve:T,reject:I}=s[0];m("EDIT_ITEM",{id:E.id,handleEditorResponse:g(E,T,I)})};p({item:c,resolve:u,reject:f}),s.length===1&&v()})),t("DID_CREATE_ITEM",(c,{query:d,dispatch:m})=>{c.extend("edit",()=>{m("EDIT_ITEM",{id:c.id})})});let s=[],p=c=>(s.push(c),c);return t("CREATE_VIEW",c=>{let{is:d,view:m,query:u}=c;if(!u("GET_ALLOW_IMAGE_EDIT"))return;let f=u("GET_ALLOW_IMAGE_PREVIEW");if(!(d("file-info")&&!f||d("file")&&f))return;let g=u("GET_IMAGE_EDIT_EDITOR");if(!g)return;g.filepondCallbackBridge||(g.outputData=!0,g.outputFile=!1,g.filepondCallbackBridge={onconfirm:g.onconfirm||(()=>{}),oncancel:g.oncancel||(()=>{})});let v=({root:I,props:y,action:b})=>{let{id:w}=y,{handleEditorResponse:x}=b;g.cropAspectRatio=I.query("GET_IMAGE_CROP_ASPECT_RATIO")||g.cropAspectRatio,g.outputCanvasBackgroundColor=I.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||g.outputCanvasBackgroundColor;let _=I.query("GET_ITEM",w);if(!_)return;let P=_.file,O=_.getMetadata("crop"),M={center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},C=_.getMetadata("resize"),S=_.getMetadata("filter")||null,F=_.getMetadata("filters")||null,R=_.getMetadata("colors")||null,L=_.getMetadata("markup")||null,z={crop:O||M,size:C?{upscale:C.upscale,mode:C.mode,width:C.size.width,height:C.size.height}:null,filter:F?F.id||F.matrix:I.query("GET_ALLOW_IMAGE_FILTER")&&I.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!R?S:null,color:R,markup:L};g.onconfirm=({data:D})=>{let{crop:k,size:B,filter:X,color:q,colorMatrix:Q,markup:pe}=D,G={};if(k&&(G.crop=k),B){let H=(_.getMetadata("resize")||{}).size,Y={width:B.width,height:B.height};!(Y.width&&Y.height)&&H&&(Y.width=H.width,Y.height=H.height),(Y.width||Y.height)&&(G.resize={upscale:B.upscale,mode:B.mode,size:Y})}pe&&(G.markup=pe),G.colors=q,G.filters=X,G.filter=Q,_.setMetadata(G),g.filepondCallbackBridge.onconfirm(D,l(_)),x&&(g.onclose=()=>{x(!0),g.onclose=null})},g.oncancel=()=>{g.filepondCallbackBridge.oncancel(l(_)),x&&(g.onclose=()=>{x(!1),g.onclose=null})},g.open(P,z)},E=({root:I,props:y})=>{if(!u("GET_IMAGE_EDIT_ALLOW_EDIT"))return;let{id:b}=y,w=u("GET_ITEM",b);if(!w)return;let x=w.file;if(Ra(x))if(I.ref.handleEdit=_=>{_.stopPropagation(),I.dispatch("EDIT_ITEM",{id:b})},f){let _=m.createChildView(r,{label:"edit",icon:u("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});_.element.classList.add("filepond--action-edit-item"),_.element.dataset.align=u("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),_.on("click",I.ref.handleEdit),I.ref.buttonEditItem=m.appendChildView(_)}else{let _=m.element.querySelector(".filepond--file-info-main"),P=document.createElement("button");P.className="filepond--action-edit-item-alt",P.innerHTML=u("GET_IMAGE_EDIT_ICON_EDIT")+"edit",P.addEventListener("click",I.ref.handleEdit),_.appendChild(P),I.ref.editButton=P}};m.registerDestroyer(({root:I})=>{I.ref.buttonEditItem&&I.ref.buttonEditItem.off("click",I.ref.handleEdit),I.ref.editButton&&I.ref.editButton.removeEventListener("click",I.ref.handleEdit)});let T={EDIT_ITEM:v,DID_LOAD_ITEM:E};if(f){let I=({root:y})=>{y.ref.buttonEditItem&&(y.ref.buttonEditItem.opacity=1)};T.DID_IMAGE_PREVIEW_SHOW=I}m.registerWriter(o(T))}),{options:{allowImageEdit:[!0,n.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",n.STRING],imageEditInstantEdit:[!1,n.BOOLEAN],imageEditAllowEdit:[!0,n.BOOLEAN],imageEditIconEdit:['',n.STRING],imageEditEditor:[null,n.OBJECT]}}},Kp=typeof window<"u"&&typeof window.document<"u";Kp&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Xo}));var Qo=Xo;var Jp=e=>/^image\/jpeg/.test(e.type),rt={JPEG:65496,APP1:65505,EXIF:1165519206,TIFF:18761,Orientation:274,Unknown:65280},st=(e,t,i=!1)=>e.getUint16(t,i),Zo=(e,t,i=!1)=>e.getUint32(t,i),em=e=>new Promise((t,i)=>{let a=new FileReader;a.onload=function(n){let o=new DataView(n.target.result);if(st(o,0)!==rt.JPEG){t(-1);return}let l=o.byteLength,r=2;for(;rtypeof window<"u"&&typeof window.document<"u")(),im=()=>tm,am="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",Ko,Ti=im()?new Image:{};Ti.onload=()=>Ko=Ti.naturalWidth>Ti.naturalHeight;Ti.src=am;var nm=()=>Ko,Jo=({addFilter:e,utils:t})=>{let{Type:i,isFile:a}=t;return e("DID_LOAD_ITEM",(n,{query:o})=>new Promise((l,r)=>{let s=n.file;if(!a(s)||!Jp(s)||!o("GET_ALLOW_IMAGE_EXIF_ORIENTATION")||!nm())return l(n);em(s).then(p=>{n.setMetadata("exif",{orientation:p}),l(n)})})),{options:{allowImageExifOrientation:[!0,i.BOOLEAN]}}},om=typeof window<"u"&&typeof window.document<"u";om&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Jo}));var el=Jo;var lm=e=>/^image/.test(e.type),tl=(e,t)=>jt(e.x*t,e.y*t),il=(e,t)=>jt(e.x+t.x,e.y+t.y),rm=e=>{let t=Math.sqrt(e.x*e.x+e.y*e.y);return t===0?{x:0,y:0}:jt(e.x/t,e.y/t)},vi=(e,t,i)=>{let a=Math.cos(t),n=Math.sin(t),o=jt(e.x-i.x,e.y-i.y);return jt(i.x+a*o.x-n*o.y,i.y+n*o.x+a*o.y)},jt=(e=0,t=0)=>({x:e,y:t}),Te=(e,t,i=1,a)=>{if(typeof e=="string")return parseFloat(e)*i;if(typeof e=="number")return e*(a?t[a]:Math.min(t.width,t.height))},sm=(e,t,i)=>{let a=e.borderStyle||e.lineStyle||"solid",n=e.backgroundColor||e.fontColor||"transparent",o=e.borderColor||e.lineColor||"transparent",l=Te(e.borderWidth||e.lineWidth,t,i),r=e.lineCap||"round",s=e.lineJoin||"round",p=typeof a=="string"?"":a.map(d=>Te(d,t,i)).join(","),c=e.opacity||1;return{"stroke-linecap":r,"stroke-linejoin":s,"stroke-width":l||0,"stroke-dasharray":p,stroke:o,fill:n,opacity:c}},Se=e=>e!=null,cm=(e,t,i=1)=>{let a=Te(e.x,t,i,"width")||Te(e.left,t,i,"width"),n=Te(e.y,t,i,"height")||Te(e.top,t,i,"height"),o=Te(e.width,t,i,"width"),l=Te(e.height,t,i,"height"),r=Te(e.right,t,i,"width"),s=Te(e.bottom,t,i,"height");return Se(n)||(Se(l)&&Se(s)?n=t.height-l-s:n=s),Se(a)||(Se(o)&&Se(r)?a=t.width-o-r:a=r),Se(o)||(Se(a)&&Se(r)?o=t.width-a-r:o=0),Se(l)||(Se(n)&&Se(s)?l=t.height-n-s:l=0),{x:a||0,y:n||0,width:o||0,height:l||0}},dm=e=>e.map((t,i)=>`${i===0?"M":"L"} ${t.x} ${t.y}`).join(" "),Ce=(e,t)=>Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),pm="http://www.w3.org/2000/svg",_t=(e,t)=>{let i=document.createElementNS(pm,e);return t&&Ce(i,t),i},mm=e=>Ce(e,{...e.rect,...e.styles}),um=e=>{let t=e.rect.x+e.rect.width*.5,i=e.rect.y+e.rect.height*.5,a=e.rect.width*.5,n=e.rect.height*.5;return Ce(e,{cx:t,cy:i,rx:a,ry:n,...e.styles})},fm={contain:"xMidYMid meet",cover:"xMidYMid slice"},hm=(e,t)=>{Ce(e,{...e.rect,...e.styles,preserveAspectRatio:fm[t.fit]||"none"})},gm={left:"start",center:"middle",right:"end"},Em=(e,t,i,a)=>{let n=Te(t.fontSize,i,a),o=t.fontFamily||"sans-serif",l=t.fontWeight||"normal",r=gm[t.textAlign]||"start";Ce(e,{...e.rect,...e.styles,"stroke-width":0,"font-weight":l,"font-size":n,"font-family":o,"text-anchor":r}),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},bm=(e,t,i,a)=>{Ce(e,{...e.rect,...e.styles,fill:"none"});let n=e.childNodes[0],o=e.childNodes[1],l=e.childNodes[2],r=e.rect,s={x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height};if(Ce(n,{x1:r.x,y1:r.y,x2:s.x,y2:s.y}),!t.lineDecoration)return;o.style.display="none",l.style.display="none";let p=rm({x:s.x-r.x,y:s.y-r.y}),c=Te(.05,i,a);if(t.lineDecoration.indexOf("arrow-begin")!==-1){let d=tl(p,c),m=il(r,d),u=vi(r,2,m),f=vi(r,-2,m);Ce(o,{style:"display:block;",d:`M${u.x},${u.y} L${r.x},${r.y} L${f.x},${f.y}`})}if(t.lineDecoration.indexOf("arrow-end")!==-1){let d=tl(p,-c),m=il(s,d),u=vi(s,2,m),f=vi(s,-2,m);Ce(l,{style:"display:block;",d:`M${u.x},${u.y} L${s.x},${s.y} L${f.x},${f.y}`})}},Tm=(e,t,i,a)=>{Ce(e,{...e.styles,fill:"none",d:dm(t.points.map(n=>({x:Te(n.x,i,a,"width"),y:Te(n.y,i,a,"height")})))})},Ii=e=>t=>_t(e,{id:t.id}),vm=e=>{let t=_t("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=()=>{t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},Im=e=>{let t=_t("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=_t("line");t.appendChild(i);let a=_t("path");t.appendChild(a);let n=_t("path");return t.appendChild(n),t},xm={image:vm,rect:Ii("rect"),ellipse:Ii("ellipse"),text:Ii("text"),path:Ii("path"),line:Im},ym={rect:mm,ellipse:um,image:hm,text:Em,path:Tm,line:bm},_m=(e,t)=>xm[e](t),Rm=(e,t,i,a,n)=>{t!=="path"&&(e.rect=cm(i,a,n)),e.styles=sm(i,a,n),ym[t](e,i,a,n)},wm=["x","y","left","top","right","bottom","width","height"],Sm=e=>typeof e=="string"&&/%/.test(e)?parseFloat(e)/100:e,Lm=e=>{let[t,i]=e,a=i.points?{}:wm.reduce((n,o)=>(n[o]=Sm(i[o]),n),{});return[t,{zIndex:0,...i,...a}]},Am=(e,t)=>e[1].zIndex>t[1].zIndex?1:e[1].zIndexe.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:({root:t,props:i})=>{if(!i.dirty)return;let{crop:a,resize:n,markup:o}=i,l=i.width,r=i.height,s=a.width,p=a.height;if(n){let{size:u}=n,f=u&&u.width,h=u&&u.height,g=n.mode,v=n.upscale;f&&!h&&(h=f),h&&!f&&(f=h);let E=s{let[f,h]=u,g=_m(f,h);Rm(g,f,h,c,d),t.element.appendChild(g)})}}),Ht=(e,t)=>({x:e,y:t}),Om=(e,t)=>e.x*t.x+e.y*t.y,al=(e,t)=>Ht(e.x-t.x,e.y-t.y),Pm=(e,t)=>Om(al(e,t),al(e,t)),nl=(e,t)=>Math.sqrt(Pm(e,t)),ol=(e,t)=>{let i=e,a=1.5707963267948966,n=t,o=1.5707963267948966-t,l=Math.sin(a),r=Math.sin(n),s=Math.sin(o),p=Math.cos(o),c=i/l,d=c*r,m=c*s;return Ht(p*d,p*m)},Dm=(e,t)=>{let i=e.width,a=e.height,n=ol(i,t),o=ol(a,t),l=Ht(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),r=Ht(e.x+e.width+Math.abs(o.y),e.y+Math.abs(o.x)),s=Ht(e.x-Math.abs(o.y),e.y+e.height-Math.abs(o.x));return{width:nl(l,r),height:nl(l,s)}},Fm=(e,t,i=1)=>{let a=e.height/e.width,n=1,o=t,l=1,r=a;r>o&&(r=o,l=r/a);let s=Math.max(n/l,o/r),p=e.width/(i*s*l),c=p*t;return{width:p,height:c}},rl=(e,t,i,a)=>{let n=a.x>.5?1-a.x:a.x,o=a.y>.5?1-a.y:a.y,l=n*2*e.width,r=o*2*e.height,s=Dm(t,i);return Math.max(s.width/l,s.height/r)},sl=(e,t)=>{let i=e.width,a=i*t;a>e.height&&(a=e.height,i=a/t);let n=(e.width-i)*.5,o=(e.height-a)*.5;return{x:n,y:o,width:i,height:a}},zm=(e,t={})=>{let{zoom:i,rotation:a,center:n,aspectRatio:o}=t;o||(o=e.height/e.width);let l=Fm(e,o,i),r={x:l.width*.5,y:l.height*.5},s={x:0,y:0,width:l.width,height:l.height,center:r},p=typeof t.scaleToFit>"u"||t.scaleToFit,c=rl(e,sl(s,o),a,p?n:{x:.5,y:.5}),d=i*c;return{widthFloat:l.width/d,heightFloat:l.height/d,width:Math.round(l.width/d),height:Math.round(l.height/d)}},ze={type:"spring",stiffness:.5,damping:.45,mass:10},Cm=e=>e.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:({root:t,props:i})=>{t.appendChild(i.image)}}),Nm=e=>e.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:ze,originY:ze,scaleX:ze,scaleY:ze,translateX:ze,translateY:ze,rotateZ:ze}},create:({root:t,props:i})=>{i.width=i.image.width,i.height=i.image.height,t.ref.bitmap=t.appendChildView(t.createChildView(Cm(e),{image:i.image}))},write:({root:t,props:i})=>{let{flip:a}=i.crop,{bitmap:n}=t.ref;n.scaleX=a.horizontal?-1:1,n.scaleY=a.vertical?-1:1}}),Bm=e=>e.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function({root:t,props:i}){i.background&&(t.element.style.backgroundColor=i.background)},create:({root:t,props:i})=>{t.ref.image=t.appendChildView(t.createChildView(Nm(e),Object.assign({},i))),t.ref.createMarkup=()=>{t.ref.markup||(t.ref.markup=t.appendChildView(t.createChildView(Mm(e),Object.assign({},i))))},t.ref.destroyMarkup=()=>{t.ref.markup&&(t.removeChildView(t.ref.markup),t.ref.markup=null)};let a=t.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");a!==null&&(a==="grid"?t.element.dataset.transparencyIndicator=a:t.element.dataset.transparencyIndicator="color")},write:({root:t,props:i,shouldOptimize:a})=>{let{crop:n,markup:o,resize:l,dirty:r,width:s,height:p}=i;t.ref.image.crop=n;let c={x:0,y:0,width:s,height:p,center:{x:s*.5,y:p*.5}},d={width:t.ref.image.width,height:t.ref.image.height},m={x:n.center.x*d.width,y:n.center.y*d.height},u={x:c.center.x-d.width*n.center.x,y:c.center.y-d.height*n.center.y},f=Math.PI*2+n.rotation%(Math.PI*2),h=n.aspectRatio||d.height/d.width,g=typeof n.scaleToFit>"u"||n.scaleToFit,v=rl(d,sl(c,h),f,g?n.center:{x:.5,y:.5}),E=n.zoom*v;o&&o.length?(t.ref.createMarkup(),t.ref.markup.width=s,t.ref.markup.height=p,t.ref.markup.resize=l,t.ref.markup.dirty=r,t.ref.markup.markup=o,t.ref.markup.crop=zm(d,n)):t.ref.markup&&t.ref.destroyMarkup();let T=t.ref.image;if(a){T.originX=null,T.originY=null,T.translateX=null,T.translateY=null,T.rotateZ=null,T.scaleX=null,T.scaleY=null;return}T.originX=m.x,T.originY=m.y,T.translateX=u.x,T.translateY=u.y,T.rotateZ=f,T.scaleX=E,T.scaleY=E}}),km=e=>e.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:ze,scaleY:ze,translateY:ze,opacity:{type:"tween",duration:400}}},create:({root:t,props:i})=>{t.ref.clip=t.appendChildView(t.createChildView(Bm(e),{id:i.id,image:i.image,crop:i.crop,markup:i.markup,resize:i.resize,dirty:i.dirty,background:i.background}))},write:({root:t,props:i,shouldOptimize:a})=>{let{clip:n}=t.ref,{image:o,crop:l,markup:r,resize:s,dirty:p}=i;if(n.crop=l,n.markup=r,n.resize=s,n.dirty=p,n.opacity=a?0:1,a||t.rect.element.hidden)return;let c=o.height/o.width,d=l.aspectRatio||c,m=t.rect.inner.width,u=t.rect.inner.height,f=t.query("GET_IMAGE_PREVIEW_HEIGHT"),h=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),g=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),v=t.query("GET_PANEL_ASPECT_RATIO"),E=t.query("GET_ALLOW_MULTIPLE");v&&!E&&(f=m*v,d=v);let T=f!==null?f:Math.max(h,Math.min(m*d,g)),I=T/d;I>m&&(I=m,T=I*d),T>u&&(T=u,I=u/d),n.width=I,n.height=T}}),Vm=` @@ -18,14 +18,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho -`,ll=0,Gm=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=Vm;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}ll++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,ll)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),Um=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},Wm=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,o=i[0],l=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],f=i[9],h=i[10],g=i[11],I=i[12],E=i[13],T=i[14],v=i[15],y=i[16],b=i[17],w=i[18],x=i[19],_=0,P=0,O=0,M=0,C=0;for(;_{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},jm={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},qm=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,jm[a](t,i))},Ym=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let o=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),qm(o,t,i,a),o.drawImage(e,0,0,t,i),n},cl=e=>/^image/.test(e.type)&&!/svg/.test(e.type),$m=10,Xm=10,Qm=e=>{let t=Math.min($m/e.width,Xm/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),o=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,o);let l=null;try{l=a.getImageData(0,0,n,o).data}catch{return null}let r=l.length,s=0,p=0,c=0,d=0;for(;dMath.floor(Math.sqrt(e/(t/4))),Zm=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),Km=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},Jm=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),eu=e=>{let t=Gm(e),i=km(e),{createWorker:a}=e.utils,n=(E,T,v)=>new Promise(y=>{E.ref.imageData||(E.ref.imageData=v.getContext("2d").getImageData(0,0,v.width,v.height));let b=Km(E.ref.imageData);if(!T||T.length!==20)return v.getContext("2d").putImageData(b,0,0),y();let w=a(Wm);w.post({imageData:b,colorMatrix:T},x=>{v.getContext("2d").putImageData(x,0,0),w.terminate(),y()},[b.data.buffer])}),o=(E,T)=>{E.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},l=({root:E})=>{let T=E.ref.images.shift();return T.opacity=0,T.translateY=-15,E.ref.imageViewBin.push(T),T},r=({root:E,props:T,image:v})=>{let y=T.id,b=E.query("GET_ITEM",{id:y});if(!b)return;let w=b.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=E.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),_,P,O=!1;E.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(_=b.getMetadata("markup")||[],P=b.getMetadata("resize"),O=!0);let M=E.appendChildView(E.createChildView(i,{id:y,image:v,crop:w,resize:P,markup:_,dirty:O,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),E.childViews.length);E.ref.images.push(M),M.opacity=1,M.scaleX=1,M.scaleY=1,M.translateY=0,setTimeout(()=>{E.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:E,props:T})=>{let v=E.query("GET_ITEM",{id:T.id});if(!v)return;let y=E.ref.images[E.ref.images.length-1];y.crop=v.getMetadata("crop"),y.background=E.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),E.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(y.dirty=!0,y.resize=v.getMetadata("resize"),y.markup=v.getMetadata("markup"))},p=({root:E,props:T,action:v})=>{if(!/crop|filter|markup|resize/.test(v.change.key)||!E.ref.images.length)return;let y=E.query("GET_ITEM",{id:T.id});if(y){if(/filter/.test(v.change.key)){let b=E.ref.images[E.ref.images.length-1];n(E,v.change.value,b.image);return}if(/crop|markup|resize/.test(v.change.key)){let b=y.getMetadata("crop"),w=E.ref.images[E.ref.images.length-1];if(b&&b.aspectRatio&&w.crop&&w.crop.aspectRatio&&Math.abs(b.aspectRatio-w.crop.aspectRatio)>1e-5){let x=l({root:E});r({root:E,props:T,image:Zm(x.image)})}else s({root:E,props:T})}}},c=E=>{let v=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),y=v?parseInt(v[1]):null;return y!==null&&y<=58?!1:"createImageBitmap"in window&&cl(E)},d=({root:E,props:T})=>{let{id:v}=T,y=E.query("GET_ITEM",v);if(!y)return;let b=URL.createObjectURL(y.file);Hm(b,(w,x)=>{E.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:v,width:w,height:x})})},m=({root:E,props:T})=>{let{id:v}=T,y=E.query("GET_ITEM",v);if(!y)return;let b=URL.createObjectURL(y.file),w=()=>{Jm(b).then(x)},x=_=>{URL.revokeObjectURL(b);let O=(y.getMetadata("exif")||{}).orientation||-1,{width:M,height:C}=_;if(!M||!C)return;O>=5&&O<=8&&([M,C]=[C,M]);let S=Math.max(1,window.devicePixelRatio*.75),R=E.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*S,L=C/M,z=E.rect.element.width,D=E.rect.element.height,k=z,B=k*L;L>1?(k=Math.min(M,z*R),B=k*L):(B=Math.min(C,D*R),k=B/L);let X=Ym(_,k,B,O),Y=()=>{let pe=E.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?Qm(data):null;y.setMetadata("color",pe,!0),"close"in _&&_.close(),E.ref.overlayShadow.opacity=1,r({root:E,props:T,image:X})},Q=y.getMetadata("filter");Q?n(E,Q,X).then(Y):Y()};if(c(y.file)){let _=a(Um);_.post({file:y.file},P=>{if(_.terminate(),!P){w();return}x(P)})}else w()},u=({root:E})=>{let T=E.ref.images[E.ref.images.length-1];T.translateY=0,T.scaleX=1,T.scaleY=1,T.opacity=1},f=({root:E})=>{E.ref.overlayShadow.opacity=1,E.ref.overlayError.opacity=0,E.ref.overlaySuccess.opacity=0},h=({root:E})=>{E.ref.overlayShadow.opacity=.25,E.ref.overlayError.opacity=1},g=({root:E})=>{E.ref.overlayShadow.opacity=.25,E.ref.overlaySuccess.opacity=1},I=({root:E})=>{E.ref.images=[],E.ref.imageData=null,E.ref.imageViewBin=[],E.ref.overlayShadow=E.appendChildView(E.createChildView(t,{opacity:0,status:"idle"})),E.ref.overlaySuccess=E.appendChildView(E.createChildView(t,{opacity:0,status:"success"})),E.ref.overlayError=E.appendChildView(E.createChildView(t,{opacity:0,status:"failure"}))};return e.utils.createView({name:"image-preview-wrapper",create:I,styles:["height"],apis:["height"],destroy:({root:E})=>{E.ref.images.forEach(T=>{T.image.width=1,T.image.height=1})},didWriteView:({root:E})=>{E.ref.images.forEach(T=>{T.dirty=!1})},write:e.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:u,DID_IMAGE_PREVIEW_CONTAINER_CREATE:d,DID_FINISH_CALCULATE_PREVIEWSIZE:m,DID_UPDATE_ITEM_METADATA:p,DID_THROW_ITEM_LOAD_ERROR:h,DID_THROW_ITEM_PROCESSING_ERROR:h,DID_THROW_ITEM_INVALID:h,DID_COMPLETE_ITEM_PROCESSING:g,DID_START_ITEM_PROCESSING:f,DID_REVERT_ITEM_PROCESSING:f},({root:E})=>{let T=E.ref.imageViewBin.filter(v=>v.opacity===0);E.ref.imageViewBin=E.ref.imageViewBin.filter(v=>v.opacity>0),T.forEach(v=>o(E,v)),T.length=0})})},dl=e=>{let{addFilter:t,utils:i}=e,{Type:a,createRoute:n,isFile:o}=i,l=eu(e);return t("CREATE_VIEW",r=>{let{is:s,view:p,query:c}=r;if(!s("file")||!c("GET_ALLOW_IMAGE_PREVIEW"))return;let d=({root:g,props:I})=>{let{id:E}=I,T=c("GET_ITEM",E);if(!T||!o(T.file)||T.archived)return;let v=T.file;if(!lm(v)||!c("GET_IMAGE_PREVIEW_FILTER_ITEM")(T))return;let y="createImageBitmap"in(window||{}),b=c("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!y&&b&&v.size>b)return;g.ref.imagePreview=p.appendChildView(p.createChildView(l,{id:E}));let w=g.query("GET_IMAGE_PREVIEW_HEIGHT");w&&g.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:T.id,height:w});let x=!y&&v.size>c("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");g.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:E},x)},m=(g,I)=>{if(!g.ref.imagePreview)return;let{id:E}=I,T=g.query("GET_ITEM",{id:E});if(!T)return;let v=g.query("GET_PANEL_ASPECT_RATIO"),y=g.query("GET_ITEM_PANEL_ASPECT_RATIO"),b=g.query("GET_IMAGE_PREVIEW_HEIGHT");if(v||y||b)return;let{imageWidth:w,imageHeight:x}=g.ref;if(!w||!x)return;let _=g.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),P=g.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),M=(T.getMetadata("exif")||{}).orientation||-1;if(M>=5&&M<=8&&([w,x]=[x,w]),!cl(T.file)||g.query("GET_IMAGE_PREVIEW_UPSCALE")){let z=2048/w;w*=z,x*=z}let C=x/w,S=(T.getMetadata("crop")||{}).aspectRatio||C,F=Math.max(_,Math.min(x,P)),R=g.rect.element.width,L=Math.min(R*S,F);g.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:T.id,height:L})},u=({root:g})=>{g.ref.shouldRescale=!0},f=({root:g,action:I})=>{I.change.key==="crop"&&(g.ref.shouldRescale=!0)},h=({root:g,action:I})=>{g.ref.imageWidth=I.width,g.ref.imageHeight=I.height,g.ref.shouldRescale=!0,g.ref.shouldDrawPreview=!0,g.dispatch("KICK")};p.registerWriter(n({DID_RESIZE_ROOT:u,DID_STOP_RESIZE:u,DID_LOAD_ITEM:d,DID_IMAGE_PREVIEW_CALCULATE_SIZE:h,DID_UPDATE_ITEM_METADATA:f},({root:g,props:I})=>{g.ref.imagePreview&&(g.rect.element.hidden||(g.ref.shouldRescale&&(m(g,I),g.ref.shouldRescale=!1),g.ref.shouldDrawPreview&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{g.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:I.id})})}),g.ref.shouldDrawPreview=!1)))}))}),{options:{allowImagePreview:[!0,a.BOOLEAN],imagePreviewFilterItem:[()=>!0,a.FUNCTION],imagePreviewHeight:[null,a.INT],imagePreviewMinHeight:[44,a.INT],imagePreviewMaxHeight:[256,a.INT],imagePreviewMaxFileSize:[null,a.INT],imagePreviewZoomFactor:[2,a.INT],imagePreviewUpscale:[!1,a.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,a.INT],imagePreviewTransparencyIndicator:[null,a.STRING],imagePreviewCalculateAverageImageColor:[!1,a.BOOLEAN],imagePreviewMarkupShow:[!0,a.BOOLEAN],imagePreviewMarkupFilter:[()=>!0,a.FUNCTION]}}},tu=typeof window<"u"&&typeof window.document<"u";tu&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:dl}));var pl=dl;var iu=e=>/^image/.test(e.type),au=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t({width:a,height:n})},i.onerror=()=>t(null),i.src=e},ml=({addFilter:e,utils:t})=>{let{Type:i}=t;return e("DID_LOAD_ITEM",(a,{query:n})=>new Promise((o,l)=>{let r=a.file;if(!iu(r)||!n("GET_ALLOW_IMAGE_RESIZE"))return o(a);let s=n("GET_IMAGE_RESIZE_MODE"),p=n("GET_IMAGE_RESIZE_TARGET_WIDTH"),c=n("GET_IMAGE_RESIZE_TARGET_HEIGHT"),d=n("GET_IMAGE_RESIZE_UPSCALE");if(p===null&&c===null)return o(a);let m=p===null?c:p,u=c===null?m:c,f=URL.createObjectURL(r);au(f,h=>{if(URL.revokeObjectURL(f),!h)return o(a);let{width:g,height:I}=h,E=(a.getMetadata("exif")||{}).orientation||-1;if(E>=5&&E<=8&&([g,I]=[I,g]),g===m&&I===u)return o(a);if(!d){if(s==="cover"){if(g<=m||I<=u)return o(a)}else if(g<=m&&I<=m)return o(a)}a.setMetadata("resize",{mode:s,upscale:d,size:{width:m,height:u}}),o(a)})})),{options:{allowImageResize:[!0,i.BOOLEAN],imageResizeMode:["cover",i.STRING],imageResizeUpscale:[!0,i.BOOLEAN],imageResizeTargetWidth:[null,i.INT],imageResizeTargetHeight:[null,i.INT]}}},nu=typeof window<"u"&&typeof window.document<"u";nu&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:ml}));var ul=ml;var ou=e=>/^image/.test(e.type),lu=e=>e.substr(0,e.lastIndexOf("."))||e,ru={jpeg:"jpg","svg+xml":"svg"},su=(e,t)=>{let i=lu(e),a=t.split("/")[1],n=ru[a]||a;return`${i}.${n}`},cu=e=>/jpeg|png|svg\+xml/.test(e)?e:"image/jpeg",du=e=>/^image/.test(e.type),pu={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},mu=(e,t,i)=>(i===-1&&(i=1),pu[i](e,t)),qt=(e,t)=>({x:e,y:t}),uu=(e,t)=>e.x*t.x+e.y*t.y,fl=(e,t)=>qt(e.x-t.x,e.y-t.y),fu=(e,t)=>uu(fl(e,t),fl(e,t)),hl=(e,t)=>Math.sqrt(fu(e,t)),gl=(e,t)=>{let i=e,a=1.5707963267948966,n=t,o=1.5707963267948966-t,l=Math.sin(a),r=Math.sin(n),s=Math.sin(o),p=Math.cos(o),c=i/l,d=c*r,m=c*s;return qt(p*d,p*m)},hu=(e,t)=>{let i=e.width,a=e.height,n=gl(i,t),o=gl(a,t),l=qt(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),r=qt(e.x+e.width+Math.abs(o.y),e.y+Math.abs(o.x)),s=qt(e.x-Math.abs(o.y),e.y+e.height-Math.abs(o.x));return{width:hl(l,r),height:hl(l,s)}},Tl=(e,t,i=0,a={x:.5,y:.5})=>{let n=a.x>.5?1-a.x:a.x,o=a.y>.5?1-a.y:a.y,l=n*2*e.width,r=o*2*e.height,s=hu(t,i);return Math.max(s.width/l,s.height/r)},Il=(e,t)=>{let i=e.width,a=i*t;a>e.height&&(a=e.height,i=a/t);let n=(e.width-i)*.5,o=(e.height-a)*.5;return{x:n,y:o,width:i,height:a}},El=(e,t,i=1)=>{let a=e.height/e.width,n=1,o=t,l=1,r=a;r>o&&(r=o,l=r/a);let s=Math.max(n/l,o/r),p=e.width/(i*s*l),c=p*t;return{width:p,height:c}},vl=e=>{e.width=1,e.height=1,e.getContext("2d").clearRect(0,0,1,1)},bl=e=>e&&(e.horizontal||e.vertical),gu=(e,t,i)=>{if(t<=1&&!bl(i))return e.width=e.naturalWidth,e.height=e.naturalHeight,e;let a=document.createElement("canvas"),n=e.naturalWidth,o=e.naturalHeight,l=t>=5&&t<=8;l?(a.width=o,a.height=n):(a.width=n,a.height=o);let r=a.getContext("2d");if(t&&r.transform.apply(r,mu(n,o,t)),bl(i)){let s=[1,0,0,1,0,0];(!l&&i.horizontal||l&i.vertical)&&(s[0]=-1,s[4]=n),(!l&&i.vertical||l&&i.horizontal)&&(s[3]=-1,s[5]=o),r.transform(...s)}return r.drawImage(e,0,0,n,o),a},Eu=(e,t,i={},a={})=>{let{canvasMemoryLimit:n,background:o=null}=a,l=i.zoom||1,r=gu(e,t,i.flip),s={width:r.width,height:r.height},p=i.aspectRatio||s.height/s.width,c=El(s,p,l);if(n){let T=c.width*c.height;if(T>n){let v=Math.sqrt(n)/Math.sqrt(T);s.width=Math.floor(s.width*v),s.height=Math.floor(s.height*v),c=El(s,p,l)}}let d=document.createElement("canvas"),m={x:c.width*.5,y:c.height*.5},u={x:0,y:0,width:c.width,height:c.height,center:m},f=typeof i.scaleToFit>"u"||i.scaleToFit,h=l*Tl(s,Il(u,p),i.rotation,f?i.center:{x:.5,y:.5});d.width=Math.round(c.width/h),d.height=Math.round(c.height/h),m.x/=h,m.y/=h;let g={x:m.x-s.width*(i.center?i.center.x:.5),y:m.y-s.height*(i.center?i.center.y:.5)},I=d.getContext("2d");o&&(I.fillStyle=o,I.fillRect(0,0,d.width,d.height)),I.translate(m.x,m.y),I.rotate(i.rotation||0),I.drawImage(r,g.x-m.x,g.y-m.y,s.width,s.height);let E=I.getImageData(0,0,d.width,d.height);return vl(d),E},bu=(()=>typeof window<"u"&&typeof window.document<"u")();bu&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){var a=this.toDataURL(t,i).split(",")[1];setTimeout(function(){for(var n=atob(a),o=n.length,l=new Uint8Array(o),r=0;rnew Promise(a=>{let n=i?i(e):e;Promise.resolve(n).then(o=>{o.toBlob(a,t.type,t.quality)})}),yi=(e,t)=>Yt(e.x*t,e.y*t),_i=(e,t)=>Yt(e.x+t.x,e.y+t.y),xl=e=>{let t=Math.sqrt(e.x*e.x+e.y*e.y);return t===0?{x:0,y:0}:Yt(e.x/t,e.y/t)},Ye=(e,t,i)=>{let a=Math.cos(t),n=Math.sin(t),o=Yt(e.x-i.x,e.y-i.y);return Yt(i.x+a*o.x-n*o.y,i.y+n*o.x+a*o.y)},Yt=(e=0,t=0)=>({x:e,y:t}),me=(e,t,i=1,a)=>{if(typeof e=="string")return parseFloat(e)*i;if(typeof e=="number")return e*(a?t[a]:Math.min(t.width,t.height))},ct=(e,t,i)=>{let a=e.borderStyle||e.lineStyle||"solid",n=e.backgroundColor||e.fontColor||"transparent",o=e.borderColor||e.lineColor||"transparent",l=me(e.borderWidth||e.lineWidth,t,i),r=e.lineCap||"round",s=e.lineJoin||"round",p=typeof a=="string"?"":a.map(d=>me(d,t,i)).join(","),c=e.opacity||1;return{"stroke-linecap":r,"stroke-linejoin":s,"stroke-width":l||0,"stroke-dasharray":p,stroke:o,fill:n,opacity:c}},Le=e=>e!=null,wt=(e,t,i=1)=>{let a=me(e.x,t,i,"width")||me(e.left,t,i,"width"),n=me(e.y,t,i,"height")||me(e.top,t,i,"height"),o=me(e.width,t,i,"width"),l=me(e.height,t,i,"height"),r=me(e.right,t,i,"width"),s=me(e.bottom,t,i,"height");return Le(n)||(Le(l)&&Le(s)?n=t.height-l-s:n=s),Le(a)||(Le(o)&&Le(r)?a=t.width-o-r:a=r),Le(o)||(Le(a)&&Le(r)?o=t.width-a-r:o=0),Le(l)||(Le(n)&&Le(s)?l=t.height-n-s:l=0),{x:a||0,y:n||0,width:o||0,height:l||0}},Iu=e=>e.map((t,i)=>`${i===0?"M":"L"} ${t.x} ${t.y}`).join(" "),Ne=(e,t)=>Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),vu="http://www.w3.org/2000/svg",Rt=(e,t)=>{let i=document.createElementNS(vu,e);return t&&Ne(i,t),i},xu=e=>Ne(e,{...e.rect,...e.styles}),yu=e=>{let t=e.rect.x+e.rect.width*.5,i=e.rect.y+e.rect.height*.5,a=e.rect.width*.5,n=e.rect.height*.5;return Ne(e,{cx:t,cy:i,rx:a,ry:n,...e.styles})},_u={contain:"xMidYMid meet",cover:"xMidYMid slice"},Ru=(e,t)=>{Ne(e,{...e.rect,...e.styles,preserveAspectRatio:_u[t.fit]||"none"})},wu={left:"start",center:"middle",right:"end"},Su=(e,t,i,a)=>{let n=me(t.fontSize,i,a),o=t.fontFamily||"sans-serif",l=t.fontWeight||"normal",r=wu[t.textAlign]||"start";Ne(e,{...e.rect,...e.styles,"stroke-width":0,"font-weight":l,"font-size":n,"font-family":o,"text-anchor":r}),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},Lu=(e,t,i,a)=>{Ne(e,{...e.rect,...e.styles,fill:"none"});let n=e.childNodes[0],o=e.childNodes[1],l=e.childNodes[2],r=e.rect,s={x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height};if(Ne(n,{x1:r.x,y1:r.y,x2:s.x,y2:s.y}),!t.lineDecoration)return;o.style.display="none",l.style.display="none";let p=xl({x:s.x-r.x,y:s.y-r.y}),c=me(.05,i,a);if(t.lineDecoration.indexOf("arrow-begin")!==-1){let d=yi(p,c),m=_i(r,d),u=Ye(r,2,m),f=Ye(r,-2,m);Ne(o,{style:"display:block;",d:`M${u.x},${u.y} L${r.x},${r.y} L${f.x},${f.y}`})}if(t.lineDecoration.indexOf("arrow-end")!==-1){let d=yi(p,-c),m=_i(s,d),u=Ye(s,2,m),f=Ye(s,-2,m);Ne(l,{style:"display:block;",d:`M${u.x},${u.y} L${s.x},${s.y} L${f.x},${f.y}`})}},Au=(e,t,i,a)=>{Ne(e,{...e.styles,fill:"none",d:Iu(t.points.map(n=>({x:me(n.x,i,a,"width"),y:me(n.y,i,a,"height")})))})},xi=e=>t=>Rt(e,{id:t.id}),Mu=e=>{let t=Rt("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=()=>{t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},Ou=e=>{let t=Rt("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=Rt("line");t.appendChild(i);let a=Rt("path");t.appendChild(a);let n=Rt("path");return t.appendChild(n),t},Pu={image:Mu,rect:xi("rect"),ellipse:xi("ellipse"),text:xi("text"),path:xi("path"),line:Ou},Du={rect:xu,ellipse:yu,image:Ru,text:Su,path:Au,line:Lu},Fu=(e,t)=>Pu[e](t),zu=(e,t,i,a,n)=>{t!=="path"&&(e.rect=wt(i,a,n)),e.styles=ct(i,a,n),Du[t](e,i,a,n)},yl=(e,t)=>e[1].zIndex>t[1].zIndex?1:e[1].zIndexnew Promise(n=>{let{background:o=null}=a,l=new FileReader;l.onloadend=()=>{let r=l.result,s=document.createElement("div");s.style.cssText="position:absolute;pointer-events:none;width:0;height:0;visibility:hidden;",s.innerHTML=r;let p=s.querySelector("svg");document.body.appendChild(s);let c=p.getBBox();s.parentNode.removeChild(s);let d=s.querySelector("title"),m=p.getAttribute("viewBox")||"",u=p.getAttribute("width")||"",f=p.getAttribute("height")||"",h=parseFloat(u)||null,g=parseFloat(f)||null,I=(u.match(/[a-z]+/)||[])[0]||"",E=(f.match(/[a-z]+/)||[])[0]||"",T=m.split(" ").map(parseFloat),v=T.length?{x:T[0],y:T[1],width:T[2],height:T[3]}:c,y=h??v.width,b=g??v.height;p.style.overflow="visible",p.setAttribute("width",y),p.setAttribute("height",b);let w="";if(i&&i.length){let Q={width:y,height:b};w=i.sort(yl).reduce((pe,G)=>{let H=Fu(G[0],G[1]);return zu(H,G[0],G[1],Q),H.removeAttribute("id"),H.getAttribute("opacity")===1&&H.removeAttribute("opacity"),pe+` +`,ll=0,Gm=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=Vm;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}ll++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,ll)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),Um=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},Wm=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,o=i[0],l=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],f=i[9],h=i[10],g=i[11],v=i[12],E=i[13],T=i[14],I=i[15],y=i[16],b=i[17],w=i[18],x=i[19],_=0,P=0,O=0,M=0,C=0;for(;_{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},jm={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},Ym=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,jm[a](t,i))},qm=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let o=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),Ym(o,t,i,a),o.drawImage(e,0,0,t,i),n},cl=e=>/^image/.test(e.type)&&!/svg/.test(e.type),$m=10,Xm=10,Qm=e=>{let t=Math.min($m/e.width,Xm/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),o=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,o);let l=null;try{l=a.getImageData(0,0,n,o).data}catch{return null}let r=l.length,s=0,p=0,c=0,d=0;for(;dMath.floor(Math.sqrt(e/(t/4))),Zm=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),Km=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},Jm=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),eu=e=>{let t=Gm(e),i=km(e),{createWorker:a}=e.utils,n=(E,T,I)=>new Promise(y=>{E.ref.imageData||(E.ref.imageData=I.getContext("2d").getImageData(0,0,I.width,I.height));let b=Km(E.ref.imageData);if(!T||T.length!==20)return I.getContext("2d").putImageData(b,0,0),y();let w=a(Wm);w.post({imageData:b,colorMatrix:T},x=>{I.getContext("2d").putImageData(x,0,0),w.terminate(),y()},[b.data.buffer])}),o=(E,T)=>{E.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},l=({root:E})=>{let T=E.ref.images.shift();return T.opacity=0,T.translateY=-15,E.ref.imageViewBin.push(T),T},r=({root:E,props:T,image:I})=>{let y=T.id,b=E.query("GET_ITEM",{id:y});if(!b)return;let w=b.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=E.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),_,P,O=!1;E.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(_=b.getMetadata("markup")||[],P=b.getMetadata("resize"),O=!0);let M=E.appendChildView(E.createChildView(i,{id:y,image:I,crop:w,resize:P,markup:_,dirty:O,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),E.childViews.length);E.ref.images.push(M),M.opacity=1,M.scaleX=1,M.scaleY=1,M.translateY=0,setTimeout(()=>{E.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:E,props:T})=>{let I=E.query("GET_ITEM",{id:T.id});if(!I)return;let y=E.ref.images[E.ref.images.length-1];y.crop=I.getMetadata("crop"),y.background=E.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),E.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(y.dirty=!0,y.resize=I.getMetadata("resize"),y.markup=I.getMetadata("markup"))},p=({root:E,props:T,action:I})=>{if(!/crop|filter|markup|resize/.test(I.change.key)||!E.ref.images.length)return;let y=E.query("GET_ITEM",{id:T.id});if(y){if(/filter/.test(I.change.key)){let b=E.ref.images[E.ref.images.length-1];n(E,I.change.value,b.image);return}if(/crop|markup|resize/.test(I.change.key)){let b=y.getMetadata("crop"),w=E.ref.images[E.ref.images.length-1];if(b&&b.aspectRatio&&w.crop&&w.crop.aspectRatio&&Math.abs(b.aspectRatio-w.crop.aspectRatio)>1e-5){let x=l({root:E});r({root:E,props:T,image:Zm(x.image)})}else s({root:E,props:T})}}},c=E=>{let I=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),y=I?parseInt(I[1]):null;return y!==null&&y<=58?!1:"createImageBitmap"in window&&cl(E)},d=({root:E,props:T})=>{let{id:I}=T,y=E.query("GET_ITEM",I);if(!y)return;let b=URL.createObjectURL(y.file);Hm(b,(w,x)=>{E.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:I,width:w,height:x})})},m=({root:E,props:T})=>{let{id:I}=T,y=E.query("GET_ITEM",I);if(!y)return;let b=URL.createObjectURL(y.file),w=()=>{Jm(b).then(x)},x=_=>{URL.revokeObjectURL(b);let O=(y.getMetadata("exif")||{}).orientation||-1,{width:M,height:C}=_;if(!M||!C)return;O>=5&&O<=8&&([M,C]=[C,M]);let S=Math.max(1,window.devicePixelRatio*.75),R=E.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*S,L=C/M,z=E.rect.element.width,D=E.rect.element.height,k=z,B=k*L;L>1?(k=Math.min(M,z*R),B=k*L):(B=Math.min(C,D*R),k=B/L);let X=qm(_,k,B,O),q=()=>{let pe=E.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?Qm(data):null;y.setMetadata("color",pe,!0),"close"in _&&_.close(),E.ref.overlayShadow.opacity=1,r({root:E,props:T,image:X})},Q=y.getMetadata("filter");Q?n(E,Q,X).then(q):q()};if(c(y.file)){let _=a(Um);_.post({file:y.file},P=>{if(_.terminate(),!P){w();return}x(P)})}else w()},u=({root:E})=>{let T=E.ref.images[E.ref.images.length-1];T.translateY=0,T.scaleX=1,T.scaleY=1,T.opacity=1},f=({root:E})=>{E.ref.overlayShadow.opacity=1,E.ref.overlayError.opacity=0,E.ref.overlaySuccess.opacity=0},h=({root:E})=>{E.ref.overlayShadow.opacity=.25,E.ref.overlayError.opacity=1},g=({root:E})=>{E.ref.overlayShadow.opacity=.25,E.ref.overlaySuccess.opacity=1},v=({root:E})=>{E.ref.images=[],E.ref.imageData=null,E.ref.imageViewBin=[],E.ref.overlayShadow=E.appendChildView(E.createChildView(t,{opacity:0,status:"idle"})),E.ref.overlaySuccess=E.appendChildView(E.createChildView(t,{opacity:0,status:"success"})),E.ref.overlayError=E.appendChildView(E.createChildView(t,{opacity:0,status:"failure"}))};return e.utils.createView({name:"image-preview-wrapper",create:v,styles:["height"],apis:["height"],destroy:({root:E})=>{E.ref.images.forEach(T=>{T.image.width=1,T.image.height=1})},didWriteView:({root:E})=>{E.ref.images.forEach(T=>{T.dirty=!1})},write:e.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:u,DID_IMAGE_PREVIEW_CONTAINER_CREATE:d,DID_FINISH_CALCULATE_PREVIEWSIZE:m,DID_UPDATE_ITEM_METADATA:p,DID_THROW_ITEM_LOAD_ERROR:h,DID_THROW_ITEM_PROCESSING_ERROR:h,DID_THROW_ITEM_INVALID:h,DID_COMPLETE_ITEM_PROCESSING:g,DID_START_ITEM_PROCESSING:f,DID_REVERT_ITEM_PROCESSING:f},({root:E})=>{let T=E.ref.imageViewBin.filter(I=>I.opacity===0);E.ref.imageViewBin=E.ref.imageViewBin.filter(I=>I.opacity>0),T.forEach(I=>o(E,I)),T.length=0})})},dl=e=>{let{addFilter:t,utils:i}=e,{Type:a,createRoute:n,isFile:o}=i,l=eu(e);return t("CREATE_VIEW",r=>{let{is:s,view:p,query:c}=r;if(!s("file")||!c("GET_ALLOW_IMAGE_PREVIEW"))return;let d=({root:g,props:v})=>{let{id:E}=v,T=c("GET_ITEM",E);if(!T||!o(T.file)||T.archived)return;let I=T.file;if(!lm(I)||!c("GET_IMAGE_PREVIEW_FILTER_ITEM")(T))return;let y="createImageBitmap"in(window||{}),b=c("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!y&&b&&I.size>b)return;g.ref.imagePreview=p.appendChildView(p.createChildView(l,{id:E}));let w=g.query("GET_IMAGE_PREVIEW_HEIGHT");w&&g.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:T.id,height:w});let x=!y&&I.size>c("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");g.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:E},x)},m=(g,v)=>{if(!g.ref.imagePreview)return;let{id:E}=v,T=g.query("GET_ITEM",{id:E});if(!T)return;let I=g.query("GET_PANEL_ASPECT_RATIO"),y=g.query("GET_ITEM_PANEL_ASPECT_RATIO"),b=g.query("GET_IMAGE_PREVIEW_HEIGHT");if(I||y||b)return;let{imageWidth:w,imageHeight:x}=g.ref;if(!w||!x)return;let _=g.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),P=g.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),M=(T.getMetadata("exif")||{}).orientation||-1;if(M>=5&&M<=8&&([w,x]=[x,w]),!cl(T.file)||g.query("GET_IMAGE_PREVIEW_UPSCALE")){let z=2048/w;w*=z,x*=z}let C=x/w,S=(T.getMetadata("crop")||{}).aspectRatio||C,F=Math.max(_,Math.min(x,P)),R=g.rect.element.width,L=Math.min(R*S,F);g.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:T.id,height:L})},u=({root:g})=>{g.ref.shouldRescale=!0},f=({root:g,action:v})=>{v.change.key==="crop"&&(g.ref.shouldRescale=!0)},h=({root:g,action:v})=>{g.ref.imageWidth=v.width,g.ref.imageHeight=v.height,g.ref.shouldRescale=!0,g.ref.shouldDrawPreview=!0,g.dispatch("KICK")};p.registerWriter(n({DID_RESIZE_ROOT:u,DID_STOP_RESIZE:u,DID_LOAD_ITEM:d,DID_IMAGE_PREVIEW_CALCULATE_SIZE:h,DID_UPDATE_ITEM_METADATA:f},({root:g,props:v})=>{g.ref.imagePreview&&(g.rect.element.hidden||(g.ref.shouldRescale&&(m(g,v),g.ref.shouldRescale=!1),g.ref.shouldDrawPreview&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{g.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:v.id})})}),g.ref.shouldDrawPreview=!1)))}))}),{options:{allowImagePreview:[!0,a.BOOLEAN],imagePreviewFilterItem:[()=>!0,a.FUNCTION],imagePreviewHeight:[null,a.INT],imagePreviewMinHeight:[44,a.INT],imagePreviewMaxHeight:[256,a.INT],imagePreviewMaxFileSize:[null,a.INT],imagePreviewZoomFactor:[2,a.INT],imagePreviewUpscale:[!1,a.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,a.INT],imagePreviewTransparencyIndicator:[null,a.STRING],imagePreviewCalculateAverageImageColor:[!1,a.BOOLEAN],imagePreviewMarkupShow:[!0,a.BOOLEAN],imagePreviewMarkupFilter:[()=>!0,a.FUNCTION]}}},tu=typeof window<"u"&&typeof window.document<"u";tu&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:dl}));var pl=dl;var iu=e=>/^image/.test(e.type),au=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t({width:a,height:n})},i.onerror=()=>t(null),i.src=e},ml=({addFilter:e,utils:t})=>{let{Type:i}=t;return e("DID_LOAD_ITEM",(a,{query:n})=>new Promise((o,l)=>{let r=a.file;if(!iu(r)||!n("GET_ALLOW_IMAGE_RESIZE"))return o(a);let s=n("GET_IMAGE_RESIZE_MODE"),p=n("GET_IMAGE_RESIZE_TARGET_WIDTH"),c=n("GET_IMAGE_RESIZE_TARGET_HEIGHT"),d=n("GET_IMAGE_RESIZE_UPSCALE");if(p===null&&c===null)return o(a);let m=p===null?c:p,u=c===null?m:c,f=URL.createObjectURL(r);au(f,h=>{if(URL.revokeObjectURL(f),!h)return o(a);let{width:g,height:v}=h,E=(a.getMetadata("exif")||{}).orientation||-1;if(E>=5&&E<=8&&([g,v]=[v,g]),g===m&&v===u)return o(a);if(!d){if(s==="cover"){if(g<=m||v<=u)return o(a)}else if(g<=m&&v<=m)return o(a)}a.setMetadata("resize",{mode:s,upscale:d,size:{width:m,height:u}}),o(a)})})),{options:{allowImageResize:[!0,i.BOOLEAN],imageResizeMode:["cover",i.STRING],imageResizeUpscale:[!0,i.BOOLEAN],imageResizeTargetWidth:[null,i.INT],imageResizeTargetHeight:[null,i.INT]}}},nu=typeof window<"u"&&typeof window.document<"u";nu&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:ml}));var ul=ml;var ou=e=>/^image/.test(e.type),lu=e=>e.substr(0,e.lastIndexOf("."))||e,ru={jpeg:"jpg","svg+xml":"svg"},su=(e,t)=>{let i=lu(e),a=t.split("/")[1],n=ru[a]||a;return`${i}.${n}`},cu=e=>/jpeg|png|svg\+xml/.test(e)?e:"image/jpeg",du=e=>/^image/.test(e.type),pu={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},mu=(e,t,i)=>(i===-1&&(i=1),pu[i](e,t)),Yt=(e,t)=>({x:e,y:t}),uu=(e,t)=>e.x*t.x+e.y*t.y,fl=(e,t)=>Yt(e.x-t.x,e.y-t.y),fu=(e,t)=>uu(fl(e,t),fl(e,t)),hl=(e,t)=>Math.sqrt(fu(e,t)),gl=(e,t)=>{let i=e,a=1.5707963267948966,n=t,o=1.5707963267948966-t,l=Math.sin(a),r=Math.sin(n),s=Math.sin(o),p=Math.cos(o),c=i/l,d=c*r,m=c*s;return Yt(p*d,p*m)},hu=(e,t)=>{let i=e.width,a=e.height,n=gl(i,t),o=gl(a,t),l=Yt(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),r=Yt(e.x+e.width+Math.abs(o.y),e.y+Math.abs(o.x)),s=Yt(e.x-Math.abs(o.y),e.y+e.height-Math.abs(o.x));return{width:hl(l,r),height:hl(l,s)}},Tl=(e,t,i=0,a={x:.5,y:.5})=>{let n=a.x>.5?1-a.x:a.x,o=a.y>.5?1-a.y:a.y,l=n*2*e.width,r=o*2*e.height,s=hu(t,i);return Math.max(s.width/l,s.height/r)},vl=(e,t)=>{let i=e.width,a=i*t;a>e.height&&(a=e.height,i=a/t);let n=(e.width-i)*.5,o=(e.height-a)*.5;return{x:n,y:o,width:i,height:a}},El=(e,t,i=1)=>{let a=e.height/e.width,n=1,o=t,l=1,r=a;r>o&&(r=o,l=r/a);let s=Math.max(n/l,o/r),p=e.width/(i*s*l),c=p*t;return{width:p,height:c}},Il=e=>{e.width=1,e.height=1,e.getContext("2d").clearRect(0,0,1,1)},bl=e=>e&&(e.horizontal||e.vertical),gu=(e,t,i)=>{if(t<=1&&!bl(i))return e.width=e.naturalWidth,e.height=e.naturalHeight,e;let a=document.createElement("canvas"),n=e.naturalWidth,o=e.naturalHeight,l=t>=5&&t<=8;l?(a.width=o,a.height=n):(a.width=n,a.height=o);let r=a.getContext("2d");if(t&&r.transform.apply(r,mu(n,o,t)),bl(i)){let s=[1,0,0,1,0,0];(!l&&i.horizontal||l&i.vertical)&&(s[0]=-1,s[4]=n),(!l&&i.vertical||l&&i.horizontal)&&(s[3]=-1,s[5]=o),r.transform(...s)}return r.drawImage(e,0,0,n,o),a},Eu=(e,t,i={},a={})=>{let{canvasMemoryLimit:n,background:o=null}=a,l=i.zoom||1,r=gu(e,t,i.flip),s={width:r.width,height:r.height},p=i.aspectRatio||s.height/s.width,c=El(s,p,l);if(n){let T=c.width*c.height;if(T>n){let I=Math.sqrt(n)/Math.sqrt(T);s.width=Math.floor(s.width*I),s.height=Math.floor(s.height*I),c=El(s,p,l)}}let d=document.createElement("canvas"),m={x:c.width*.5,y:c.height*.5},u={x:0,y:0,width:c.width,height:c.height,center:m},f=typeof i.scaleToFit>"u"||i.scaleToFit,h=l*Tl(s,vl(u,p),i.rotation,f?i.center:{x:.5,y:.5});d.width=Math.round(c.width/h),d.height=Math.round(c.height/h),m.x/=h,m.y/=h;let g={x:m.x-s.width*(i.center?i.center.x:.5),y:m.y-s.height*(i.center?i.center.y:.5)},v=d.getContext("2d");o&&(v.fillStyle=o,v.fillRect(0,0,d.width,d.height)),v.translate(m.x,m.y),v.rotate(i.rotation||0),v.drawImage(r,g.x-m.x,g.y-m.y,s.width,s.height);let E=v.getImageData(0,0,d.width,d.height);return Il(d),E},bu=(()=>typeof window<"u"&&typeof window.document<"u")();bu&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){var a=this.toDataURL(t,i).split(",")[1];setTimeout(function(){for(var n=atob(a),o=n.length,l=new Uint8Array(o),r=0;rnew Promise(a=>{let n=i?i(e):e;Promise.resolve(n).then(o=>{o.toBlob(a,t.type,t.quality)})}),yi=(e,t)=>qt(e.x*t,e.y*t),_i=(e,t)=>qt(e.x+t.x,e.y+t.y),xl=e=>{let t=Math.sqrt(e.x*e.x+e.y*e.y);return t===0?{x:0,y:0}:qt(e.x/t,e.y/t)},qe=(e,t,i)=>{let a=Math.cos(t),n=Math.sin(t),o=qt(e.x-i.x,e.y-i.y);return qt(i.x+a*o.x-n*o.y,i.y+n*o.x+a*o.y)},qt=(e=0,t=0)=>({x:e,y:t}),me=(e,t,i=1,a)=>{if(typeof e=="string")return parseFloat(e)*i;if(typeof e=="number")return e*(a?t[a]:Math.min(t.width,t.height))},ct=(e,t,i)=>{let a=e.borderStyle||e.lineStyle||"solid",n=e.backgroundColor||e.fontColor||"transparent",o=e.borderColor||e.lineColor||"transparent",l=me(e.borderWidth||e.lineWidth,t,i),r=e.lineCap||"round",s=e.lineJoin||"round",p=typeof a=="string"?"":a.map(d=>me(d,t,i)).join(","),c=e.opacity||1;return{"stroke-linecap":r,"stroke-linejoin":s,"stroke-width":l||0,"stroke-dasharray":p,stroke:o,fill:n,opacity:c}},Le=e=>e!=null,wt=(e,t,i=1)=>{let a=me(e.x,t,i,"width")||me(e.left,t,i,"width"),n=me(e.y,t,i,"height")||me(e.top,t,i,"height"),o=me(e.width,t,i,"width"),l=me(e.height,t,i,"height"),r=me(e.right,t,i,"width"),s=me(e.bottom,t,i,"height");return Le(n)||(Le(l)&&Le(s)?n=t.height-l-s:n=s),Le(a)||(Le(o)&&Le(r)?a=t.width-o-r:a=r),Le(o)||(Le(a)&&Le(r)?o=t.width-a-r:o=0),Le(l)||(Le(n)&&Le(s)?l=t.height-n-s:l=0),{x:a||0,y:n||0,width:o||0,height:l||0}},vu=e=>e.map((t,i)=>`${i===0?"M":"L"} ${t.x} ${t.y}`).join(" "),Ne=(e,t)=>Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),Iu="http://www.w3.org/2000/svg",Rt=(e,t)=>{let i=document.createElementNS(Iu,e);return t&&Ne(i,t),i},xu=e=>Ne(e,{...e.rect,...e.styles}),yu=e=>{let t=e.rect.x+e.rect.width*.5,i=e.rect.y+e.rect.height*.5,a=e.rect.width*.5,n=e.rect.height*.5;return Ne(e,{cx:t,cy:i,rx:a,ry:n,...e.styles})},_u={contain:"xMidYMid meet",cover:"xMidYMid slice"},Ru=(e,t)=>{Ne(e,{...e.rect,...e.styles,preserveAspectRatio:_u[t.fit]||"none"})},wu={left:"start",center:"middle",right:"end"},Su=(e,t,i,a)=>{let n=me(t.fontSize,i,a),o=t.fontFamily||"sans-serif",l=t.fontWeight||"normal",r=wu[t.textAlign]||"start";Ne(e,{...e.rect,...e.styles,"stroke-width":0,"font-weight":l,"font-size":n,"font-family":o,"text-anchor":r}),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},Lu=(e,t,i,a)=>{Ne(e,{...e.rect,...e.styles,fill:"none"});let n=e.childNodes[0],o=e.childNodes[1],l=e.childNodes[2],r=e.rect,s={x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height};if(Ne(n,{x1:r.x,y1:r.y,x2:s.x,y2:s.y}),!t.lineDecoration)return;o.style.display="none",l.style.display="none";let p=xl({x:s.x-r.x,y:s.y-r.y}),c=me(.05,i,a);if(t.lineDecoration.indexOf("arrow-begin")!==-1){let d=yi(p,c),m=_i(r,d),u=qe(r,2,m),f=qe(r,-2,m);Ne(o,{style:"display:block;",d:`M${u.x},${u.y} L${r.x},${r.y} L${f.x},${f.y}`})}if(t.lineDecoration.indexOf("arrow-end")!==-1){let d=yi(p,-c),m=_i(s,d),u=qe(s,2,m),f=qe(s,-2,m);Ne(l,{style:"display:block;",d:`M${u.x},${u.y} L${s.x},${s.y} L${f.x},${f.y}`})}},Au=(e,t,i,a)=>{Ne(e,{...e.styles,fill:"none",d:vu(t.points.map(n=>({x:me(n.x,i,a,"width"),y:me(n.y,i,a,"height")})))})},xi=e=>t=>Rt(e,{id:t.id}),Mu=e=>{let t=Rt("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=()=>{t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},Ou=e=>{let t=Rt("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=Rt("line");t.appendChild(i);let a=Rt("path");t.appendChild(a);let n=Rt("path");return t.appendChild(n),t},Pu={image:Mu,rect:xi("rect"),ellipse:xi("ellipse"),text:xi("text"),path:xi("path"),line:Ou},Du={rect:xu,ellipse:yu,image:Ru,text:Su,path:Au,line:Lu},Fu=(e,t)=>Pu[e](t),zu=(e,t,i,a,n)=>{t!=="path"&&(e.rect=wt(i,a,n)),e.styles=ct(i,a,n),Du[t](e,i,a,n)},yl=(e,t)=>e[1].zIndex>t[1].zIndex?1:e[1].zIndexnew Promise(n=>{let{background:o=null}=a,l=new FileReader;l.onloadend=()=>{let r=l.result,s=document.createElement("div");s.style.cssText="position:absolute;pointer-events:none;width:0;height:0;visibility:hidden;",s.innerHTML=r;let p=s.querySelector("svg");document.body.appendChild(s);let c=p.getBBox();s.parentNode.removeChild(s);let d=s.querySelector("title"),m=p.getAttribute("viewBox")||"",u=p.getAttribute("width")||"",f=p.getAttribute("height")||"",h=parseFloat(u)||null,g=parseFloat(f)||null,v=(u.match(/[a-z]+/)||[])[0]||"",E=(f.match(/[a-z]+/)||[])[0]||"",T=m.split(" ").map(parseFloat),I=T.length?{x:T[0],y:T[1],width:T[2],height:T[3]}:c,y=h??I.width,b=g??I.height;p.style.overflow="visible",p.setAttribute("width",y),p.setAttribute("height",b);let w="";if(i&&i.length){let Q={width:y,height:b};w=i.sort(yl).reduce((pe,G)=>{let H=Fu(G[0],G[1]);return zu(H,G[0],G[1],Q),H.removeAttribute("id"),H.getAttribute("opacity")===1&&H.removeAttribute("opacity"),pe+` `+H.outerHTML+` `},""),w=` ${w.replace(/ /g," ")} -`}let x=t.aspectRatio||b/y,_=y,P=_*x,O=typeof t.scaleToFit>"u"||t.scaleToFit,M=t.center?t.center.x:.5,C=t.center?t.center.y:.5,S=Tl({width:y,height:b},Il({width:_,height:P},x),t.rotation,O?{x:M,y:C}:{x:.5,y:.5}),F=t.zoom*S,R=t.rotation*(180/Math.PI),L={x:_*.5,y:P*.5},z={x:L.x-y*M,y:L.y-b*C},D=[`rotate(${R} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${F})`,`translate(${-L.x} ${-L.y})`,`translate(${z.x} ${z.y})`],k=t.flip&&t.flip.horizontal,B=t.flip&&t.flip.vertical,X=[`scale(${k?-1:1} ${B?-1:1})`,`translate(${k?-y:0} ${B?-b:0})`],Y=` -"u"||t.scaleToFit,M=t.center?t.center.x:.5,C=t.center?t.center.y:.5,S=Tl({width:y,height:b},vl({width:_,height:P},x),t.rotation,O?{x:M,y:C}:{x:.5,y:.5}),F=t.zoom*S,R=t.rotation*(180/Math.PI),L={x:_*.5,y:P*.5},z={x:L.x-y*M,y:L.y-b*C},D=[`rotate(${R} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${F})`,`translate(${-L.x} ${-L.y})`,`translate(${z.x} ${z.y})`],k=t.flip&&t.flip.horizontal,B=t.flip&&t.flip.vertical,X=[`scale(${k?-1:1} ${B?-1:1})`,`translate(${k?-y:0} ${B?-b:0})`],q=` + ${p.outerHTML}${w} -`;n(Y)},l.readAsText(e)}),Nu=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},Bu=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,f=null;if(u.forEach(h=>{h.type==="filter"&&(f=h)}),f){let h=null;u.forEach(g=>{g.type==="resize"&&(h=g)}),h&&(h.data.matrix=f.data,u=u.filter(g=>g.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,o=1;function l(d,m,u){let f=m[d]/255,h=m[d+1]/255,g=m[d+2]/255,I=m[d+3]/255,E=f*u[0]+h*u[1]+g*u[2]+I*u[3]+u[4],T=f*u[5]+h*u[6]+g*u[7]+I*u[8]+u[9],v=f*u[10]+h*u[11]+g*u[12]+I*u[13]+u[14],y=f*u[15]+h*u[16]+g*u[17]+I*u[18]+u[19],b=Math.max(0,E*y)+a*(1-y),w=Math.max(0,T*y)+n*(1-y),x=Math.max(0,v*y)+o*(1-y);m[d]=Math.max(0,Math.min(1,b))*255,m[d+1]=Math.max(0,Math.min(1,w))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,f=u.length,h=m[0],g=m[1],I=m[2],E=m[3],T=m[4],v=m[5],y=m[6],b=m[7],w=m[8],x=m[9],_=m[10],P=m[11],O=m[12],M=m[13],C=m[14],S=m[15],F=m[16],R=m[17],L=m[18],z=m[19],D=0,k=0,B=0,X=0,Y=0,Q=0,pe=0,G=0,H=0,q=0,re=0,ee=0;for(;D1&&f===!1)return p(d,I);h=d.width*S,g=d.height*S}let E=d.width,T=d.height,v=Math.round(h),y=Math.round(g),b=d.data,w=new Uint8ClampedArray(v*y*4),x=E/v,_=T/y,P=Math.ceil(x*.5),O=Math.ceil(_*.5);for(let M=0;M=-1&&re<=1&&(F=2*re*re*re-3*re*re+1,F>0)){q=4*(H+Y*E);let ee=b[q+3];B+=F*ee,L+=F,ee<255&&(F=F*ee/250),z+=F*b[q],D+=F*b[q+1],k+=F*b[q+2],R+=F}}}w[S]=z/R,w[S+1]=D/R,w[S+2]=k/R,w[S+3]=B/L,I&&l(S,w,I)}return{data:w,width:v,height:y}}},ku=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,o=!1;for(;i=65504&&a<=65519||a===65534)||(o||(o=ku(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},Gu=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(Vu(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),Uu=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,Wu=(e,t)=>{let i=Uu();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},Hu=()=>Math.random().toString(36).substr(2,9),ju=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(o,l,r)=>{let s=Hu();n[s]=l,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:o},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},qu=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Yu=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.concat.bind(a))),Promise.resolve([])),$u=(e,t)=>new Promise(i=>{let a={width:e.width,height:e.height},n=e.getContext("2d"),o=t.sort(yl).map(l=>()=>new Promise(r=>{tf[l[0]](n,a,l[1],r)&&r()}));Yu(o).then(()=>i(e))}),St=(e,t)=>{e.beginPath(),e.lineCap=t["stroke-linecap"],e.lineJoin=t["stroke-linejoin"],e.lineWidth=t["stroke-width"],t["stroke-dasharray"].length&&e.setLineDash(t["stroke-dasharray"].split(",")),e.fillStyle=t.fill,e.strokeStyle=t.stroke,e.globalAlpha=t.opacity||1},Lt=e=>{e.fill(),e.stroke(),e.globalAlpha=1},Xu=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);return St(e,n),e.rect(a.x,a.y,a.width,a.height),Lt(e,n),!0},Qu=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);St(e,n);let o=a.x,l=a.y,r=a.width,s=a.height,p=.5522848,c=r/2*p,d=s/2*p,m=o+r,u=l+s,f=o+r/2,h=l+s/2;return e.moveTo(o,h),e.bezierCurveTo(o,h-d,f-c,l,f,l),e.bezierCurveTo(f+c,l,m,h-d,m,h),e.bezierCurveTo(m,h+d,f+c,u,f,u),e.bezierCurveTo(f-c,u,o,h+d,o,h),Lt(e,n),!0},Zu=(e,t,i,a)=>{let n=wt(i,t),o=ct(i,t);St(e,o);let l=new Image;new URL(i.src,window.location.href).origin!==window.location.origin&&(l.crossOrigin=""),l.onload=()=>{if(i.fit==="cover"){let s=n.width/n.height,p=s>1?l.width:l.height*s,c=s>1?l.width/s:l.height,d=l.width*.5-p*.5,m=l.height*.5-c*.5;e.drawImage(l,d,m,p,c,n.x,n.y,n.width,n.height)}else if(i.fit==="contain"){let s=Math.min(n.width/l.width,n.height/l.height),p=s*l.width,c=s*l.height,d=n.x+n.width*.5-p*.5,m=n.y+n.height*.5-c*.5;e.drawImage(l,0,0,l.width,l.height,d,m,p,c)}else e.drawImage(l,0,0,l.width,l.height,n.x,n.y,n.width,n.height);Lt(e,o),a()},l.src=i.src},Ku=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);St(e,n);let o=me(i.fontSize,t),l=i.fontFamily||"sans-serif",r=i.fontWeight||"normal",s=i.textAlign||"left";return e.font=`${r} ${o}px ${l}`,e.textAlign=s,e.fillText(i.text,a.x,a.y),Lt(e,n),!0},Ju=(e,t,i)=>{let a=ct(i,t);St(e,a),e.beginPath();let n=i.points.map(l=>({x:me(l.x,t,1,"width"),y:me(l.y,t,1,"height")}));e.moveTo(n[0].x,n[0].y);let o=n.length;for(let l=1;l{let a=wt(i,t),n=ct(i,t);St(e,n),e.beginPath();let o={x:a.x,y:a.y},l={x:a.x+a.width,y:a.y+a.height};e.moveTo(o.x,o.y),e.lineTo(l.x,l.y);let r=xl({x:l.x-o.x,y:l.y-o.y}),s=.04*Math.min(t.width,t.height);if(i.lineDecoration.indexOf("arrow-begin")!==-1){let p=yi(r,s),c=_i(o,p),d=Ye(o,2,c),m=Ye(o,-2,c);e.moveTo(d.x,d.y),e.lineTo(o.x,o.y),e.lineTo(m.x,m.y)}if(i.lineDecoration.indexOf("arrow-end")!==-1){let p=yi(r,-s),c=_i(l,p),d=Ye(l,2,c),m=Ye(l,-2,c);e.moveTo(d.x,d.y),e.lineTo(l.x,l.y),e.lineTo(m.x,m.y)}return Lt(e,n),!0},tf={rect:Xu,ellipse:Qu,image:Zu,text:Ku,line:ef,path:Ju},af=e=>{let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t},nf=(e,t,i={})=>new Promise((a,n)=>{if(!e||!du(e))return n({status:"not an image file",file:e});let{stripImageHead:o,beforeCreateBlob:l,afterCreateBlob:r,canvasMemoryLimit:s}=i,{crop:p,size:c,filter:d,markup:m,output:u}=t,f=t.image&&t.image.orientation?Math.max(1,Math.min(8,t.image.orientation)):null,h=u&&u.quality,g=h===null?null:h/100,I=u&&u.type||null,E=u&&u.background||null,T=[];c&&(typeof c.width=="number"||typeof c.height=="number")&&T.push({type:"resize",data:c}),d&&d.length===20&&T.push({type:"filter",data:d});let v=w=>{let x=r?r(w):w;Promise.resolve(x).then(a)},y=(w,x)=>{let _=af(w),P=m.length?$u(_,m):_;Promise.resolve(P).then(O=>{Tu(O,x,l).then(M=>{if(vl(O),o)return v(M);Gu(e).then(C=>{C!==null&&(M=new Blob([C,M.slice(20)],{type:M.type})),v(M)})}).catch(n)})};if(/svg/.test(e.type)&&I===null)return Cu(e,p,m,{background:E}).then(w=>{a(Wu(w,"image/svg+xml"))});let b=URL.createObjectURL(e);qu(b).then(w=>{URL.revokeObjectURL(b);let x=Eu(w,f,p,{canvasMemoryLimit:s,background:E}),_={quality:g,type:I||e.type};if(!T.length)return y(x,_);let P=ju(Bu);P.post({transforms:T,imageData:x},O=>{y(Nu(O),_),P.terminate()},[x.data.buffer])}).catch(n)}),of=["x","y","left","top","right","bottom","width","height"],lf=e=>typeof e=="string"&&/%/.test(e)?parseFloat(e)/100:e,rf=e=>{let[t,i]=e,a=i.points?{}:of.reduce((n,o)=>(n[o]=lf(i[o]),n),{});return[t,{zIndex:0,...i,...a}]},sf=e=>new Promise((t,i)=>{let a=new Image;a.src=URL.createObjectURL(e);let n=()=>{let l=a.naturalWidth,r=a.naturalHeight;l&&r&&(URL.revokeObjectURL(a.src),clearInterval(o),t({width:l,height:r}))};a.onerror=l=>{URL.revokeObjectURL(a.src),clearInterval(o),i(l)};let o=setInterval(n,1);n()});typeof window<"u"&&typeof window.document<"u"&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){let a=this;setTimeout(()=>{let n=a.toDataURL(t,i).split(",")[1],o=atob(n),l=o.length,r=new Uint8Array(l);for(;l--;)r[l]=o.charCodeAt(l);e(new Blob([r],{type:t||"image/png"}))})}}));var Sa=typeof window<"u"&&typeof window.document<"u",cf=Sa&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_l=({addFilter:e,utils:t})=>{let{Type:i,forin:a,getFileFromBlob:n,isFile:o}=t,l=["crop","resize","filter","markup","output"],r=c=>(d,m,u)=>d(m,c?c(u):u),s=c=>c.aspectRatio===null&&c.rotation===0&&c.zoom===1&&c.center&&c.center.x===.5&&c.center.y===.5&&c.flip&&c.flip.horizontal===!1&&c.flip.vertical===!1;e("SHOULD_PREPARE_OUTPUT",(c,{query:d})=>new Promise(m=>{m(!d("IS_ASYNC"))}));let p=(c,d,m)=>new Promise(u=>{if(!c("GET_ALLOW_IMAGE_TRANSFORM")||m.archived||!o(d)||!ou(d))return u(!1);sf(d).then(()=>{let f=c("GET_IMAGE_TRANSFORM_IMAGE_FILTER");if(f){let h=f(d);if(h==null)return handleRevert(!0);if(typeof h=="boolean")return u(h);if(typeof h.then=="function")return h.then(u)}u(!0)}).catch(f=>{u(!1)})});return e("DID_CREATE_ITEM",(c,{query:d,dispatch:m})=>{d("GET_ALLOW_IMAGE_TRANSFORM")&&c.extend("requestPrepare",()=>new Promise((u,f)=>{m("REQUEST_PREPARE_OUTPUT",{query:c.id,item:c,success:u,failure:f},!0)}))}),e("PREPARE_OUTPUT",(c,{query:d,item:m})=>new Promise(u=>{p(d,c,m).then(f=>{if(!f)return u(c);let h=[];d("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_ORIGINAL")&&h.push(()=>new Promise(x=>{x({name:d("GET_IMAGE_TRANSFORM_VARIANTS_ORIGINAL_NAME"),file:c})})),d("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_DEFAULT")&&h.push((x,_,P)=>new Promise(O=>{x(_,P).then(M=>O({name:d("GET_IMAGE_TRANSFORM_VARIANTS_DEFAULT_NAME"),file:M}))}));let g=d("GET_IMAGE_TRANSFORM_VARIANTS")||{};a(g,(x,_)=>{let P=r(_);h.push((O,M,C)=>new Promise(S=>{P(O,M,C).then(F=>S({name:x,file:F}))}))});let I=d("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY"),E=d("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY_MODE"),T=I===null?null:I/100,v=d("GET_IMAGE_TRANSFORM_OUTPUT_MIME_TYPE"),y=d("GET_IMAGE_TRANSFORM_CLIENT_TRANSFORMS")||l;m.setMetadata("output",{type:v,quality:T,client:y},!0);let b=(x,_)=>new Promise((P,O)=>{let M={..._};Object.keys(M).filter(B=>B!=="exif").forEach(B=>{y.indexOf(B)===-1&&delete M[B]});let{resize:C,exif:S,output:F,crop:R,filter:L,markup:z}=M,D={image:{orientation:S?S.orientation:null},output:F&&(F.type||typeof F.quality=="number"||F.background)?{type:F.type,quality:typeof F.quality=="number"?F.quality*100:null,background:F.background||d("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||null}:void 0,size:C&&(C.size.width||C.size.height)?{mode:C.mode,upscale:C.upscale,...C.size}:void 0,crop:R&&!s(R)?{...R}:void 0,markup:z&&z.length?z.map(rf):[],filter:L};if(D.output){let B=F.type?F.type!==x.type:!1,X=/\/jpe?g$/.test(x.type),Y=F.quality!==null?X&&E==="always":!1;if(!!!(D.size||D.crop||D.filter||B||Y))return P(x)}let k={beforeCreateBlob:d("GET_IMAGE_TRANSFORM_BEFORE_CREATE_BLOB"),afterCreateBlob:d("GET_IMAGE_TRANSFORM_AFTER_CREATE_BLOB"),canvasMemoryLimit:d("GET_IMAGE_TRANSFORM_CANVAS_MEMORY_LIMIT"),stripImageHead:d("GET_IMAGE_TRANSFORM_OUTPUT_STRIP_IMAGE_HEAD")};nf(x,D,k).then(B=>{let X=n(B,su(x.name,cu(B.type)));P(X)}).catch(O)}),w=h.map(x=>x(b,c,m.getMetadata()));Promise.all(w).then(x=>{u(x.length===1&&x[0].name===null?x[0].file:x)})})})),{options:{allowImageTransform:[!0,i.BOOLEAN],imageTransformImageFilter:[null,i.FUNCTION],imageTransformOutputMimeType:[null,i.STRING],imageTransformOutputQuality:[null,i.INT],imageTransformOutputStripImageHead:[!0,i.BOOLEAN],imageTransformClientTransforms:[null,i.ARRAY],imageTransformOutputQualityMode:["always",i.STRING],imageTransformVariants:[null,i.OBJECT],imageTransformVariantsIncludeDefault:[!0,i.BOOLEAN],imageTransformVariantsDefaultName:[null,i.STRING],imageTransformVariantsIncludeOriginal:[!1,i.BOOLEAN],imageTransformVariantsOriginalName:["original_",i.STRING],imageTransformBeforeCreateBlob:[null,i.FUNCTION],imageTransformAfterCreateBlob:[null,i.FUNCTION],imageTransformCanvasMemoryLimit:[Sa&&cf?4096*4096:null,i.INT],imageTransformCanvasBackgroundColor:[null,i.STRING]}}};Sa&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_l}));var Rl=_l;var La=e=>/^video/.test(e.type),$t=e=>/^audio/.test(e.type),Aa=class{constructor(t,i){this.mediaEl=t,this.audioElems=i,this.onplayhead=!1,this.duration=0,this.timelineWidth=this.audioElems.timeline.offsetWidth-this.audioElems.playhead.offsetWidth,this.moveplayheadFn=this.moveplayhead.bind(this),this.registerListeners()}registerListeners(){this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1),this.mediaEl.addEventListener("canplaythrough",()=>this.duration=this.mediaEl.duration,!1),this.audioElems.timeline.addEventListener("click",this.timelineClicked.bind(this),!1),this.audioElems.button.addEventListener("click",this.play.bind(this)),this.audioElems.playhead.addEventListener("mousedown",this.mouseDown.bind(this),!1),window.addEventListener("mouseup",this.mouseUp.bind(this),!1)}play(){this.mediaEl.paused?this.mediaEl.play():this.mediaEl.pause(),this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause")}timeUpdate(){let t=this.mediaEl.currentTime/this.duration*100;this.audioElems.playhead.style.marginLeft=t+"%",this.mediaEl.currentTime===this.duration&&(this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause"))}moveplayhead(t){let i=t.clientX-this.getPosition(this.audioElems.timeline);i>=0&&i<=this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=i+"px"),i<0&&(this.audioElems.playhead.style.marginLeft="0px"),i>this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=this.timelineWidth-4+"px")}timelineClicked(t){this.moveplayhead(t),this.mediaEl.currentTime=this.duration*this.clickPercent(t)}mouseDown(){this.onplayhead=!0,window.addEventListener("mousemove",this.moveplayheadFn,!0),this.mediaEl.removeEventListener("timeupdate",this.timeUpdate.bind(this),!1)}mouseUp(t){window.removeEventListener("mousemove",this.moveplayheadFn,!0),this.onplayhead==!0&&(this.moveplayhead(t),this.mediaEl.currentTime=this.duration*this.clickPercent(t),this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1)),this.onplayhead=!1}clickPercent(t){return(t.clientX-this.getPosition(this.audioElems.timeline))/this.timelineWidth}getPosition(t){return t.getBoundingClientRect().left}},df=e=>e.utils.createView({name:"media-preview",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let{id:a}=i,n=t.query("GET_ITEM",{id:i.id}),o=$t(n.file)?"audio":"video";if(t.ref.media=document.createElement(o),t.ref.media.setAttribute("controls",!0),t.element.appendChild(t.ref.media),$t(n.file)){let l=document.createDocumentFragment();t.ref.audio=[],t.ref.audio.container=document.createElement("div"),t.ref.audio.button=document.createElement("span"),t.ref.audio.timeline=document.createElement("div"),t.ref.audio.playhead=document.createElement("div"),t.ref.audio.container.className="audioplayer",t.ref.audio.button.className="playpausebtn play",t.ref.audio.timeline.className="timeline",t.ref.audio.playhead.className="playhead",t.ref.audio.timeline.appendChild(t.ref.audio.playhead),t.ref.audio.container.appendChild(t.ref.audio.button),t.ref.audio.container.appendChild(t.ref.audio.timeline),l.appendChild(t.ref.audio.container),t.element.appendChild(l)}},write:e.utils.createRoute({DID_MEDIA_PREVIEW_LOAD:({root:t,props:i})=>{let{id:a}=i,n=t.query("GET_ITEM",{id:i.id});if(!n)return;let o=window.URL||window.webkitURL,l=new Blob([n.file],{type:n.file.type});t.ref.media.type=n.file.type,t.ref.media.src=n.file.mock&&n.file.url||o.createObjectURL(l),$t(n.file)&&new Aa(t.ref.media,t.ref.audio),t.ref.media.addEventListener("loadeddata",()=>{let r=75;if(La(n.file)){let s=t.ref.media.offsetWidth,p=t.ref.media.videoWidth/s;r=t.ref.media.videoHeight/p}t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:r})},!1)}})}),pf=e=>{let t=({root:a,props:n})=>{let{id:o}=n;a.query("GET_ITEM",o)&&a.dispatch("DID_MEDIA_PREVIEW_LOAD",{id:o})},i=({root:a,props:n})=>{let o=df(e);a.ref.media=a.appendChildView(a.createChildView(o,{id:n.id}))};return e.utils.createView({name:"media-preview-wrapper",create:i,write:e.utils.createRoute({DID_MEDIA_PREVIEW_CONTAINER_CREATE:t})})},Ma=e=>{let{addFilter:t,utils:i}=e,{Type:a,createRoute:n}=i,o=pf(e);return t("CREATE_VIEW",l=>{let{is:r,view:s,query:p}=l;if(!r("file"))return;let c=({root:d,props:m})=>{let{id:u}=m,f=p("GET_ITEM",u),h=p("GET_ALLOW_VIDEO_PREVIEW"),g=p("GET_ALLOW_AUDIO_PREVIEW");!f||f.archived||(!La(f.file)||!h)&&(!$t(f.file)||!g)||(d.ref.mediaPreview=s.appendChildView(s.createChildView(o,{id:u})),d.dispatch("DID_MEDIA_PREVIEW_CONTAINER_CREATE",{id:u}))};s.registerWriter(n({DID_LOAD_ITEM:c},({root:d,props:m})=>{let{id:u}=m,f=p("GET_ITEM",u),h=d.query("GET_ALLOW_VIDEO_PREVIEW"),g=d.query("GET_ALLOW_AUDIO_PREVIEW");!f||(!La(f.file)||!h)&&(!$t(f.file)||!g)||d.rect.element.hidden}))}),{options:{allowVideoPreview:[!0,a.BOOLEAN],allowAudioPreview:[!0,a.BOOLEAN]}}},mf=typeof window<"u"&&typeof window.document<"u";mf&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Ma}));var wl={labelIdle:'\u0627\u0633\u062D\u0628 \u0648 \u0627\u062F\u0631\u062C \u0645\u0644\u0641\u0627\u062A\u0643 \u0623\u0648 \u062A\u0635\u0641\u062D ',labelInvalidField:"\u0627\u0644\u062D\u0642\u0644 \u064A\u062D\u062A\u0648\u064A \u0639\u0644\u0649 \u0645\u0644\u0641\u0627\u062A \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629",labelFileWaitingForSize:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062D\u062C\u0645",labelFileSizeNotAvailable:"\u0627\u0644\u062D\u062C\u0645 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D",labelFileLoading:"\u0628\u0627\u0644\u0625\u0646\u062A\u0638\u0627\u0631",labelFileLoadError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u062D\u0645\u064A\u0644",labelFileProcessing:"\u064A\u062A\u0645 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingComplete:"\u062A\u0645 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingAborted:"\u062A\u0645 \u0625\u0644\u063A\u0627\u0621 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingRevertError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u0631\u0627\u062C\u0639",labelFileRemoveError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062D\u0630\u0641",labelTapToCancel:"\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0644\u063A\u0627\u0621",labelTapToRetry:"\u0627\u0646\u0642\u0631 \u0644\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",labelTapToUndo:"\u0627\u0646\u0642\u0631 \u0644\u0644\u062A\u0631\u0627\u062C\u0639",labelButtonRemoveItem:"\u0645\u0633\u062D",labelButtonAbortItemLoad:"\u0625\u0644\u063A\u0627\u0621",labelButtonRetryItemLoad:"\u0625\u0639\u0627\u062F\u0629",labelButtonAbortItemProcessing:"\u0625\u0644\u063A\u0627\u0621",labelButtonUndoItemProcessing:"\u062A\u0631\u0627\u062C\u0639",labelButtonRetryItemProcessing:"\u0625\u0639\u0627\u062F\u0629",labelButtonProcessItem:"\u0631\u0641\u0639",labelMaxFileSizeExceeded:"\u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u0627",labelMaxFileSize:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u0623\u0642\u0635\u0649: {filesize}",labelMaxTotalFileSizeExceeded:"\u062A\u0645 \u062A\u062C\u0627\u0648\u0632 \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u062D\u062C\u0645 \u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A",labelMaxTotalFileSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641: {filesize}",labelFileTypeNotAllowed:"\u0645\u0644\u0641 \u0645\u0646 \u0646\u0648\u0639 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D",fileValidateTypeLabelExpectedTypes:"\u062A\u062A\u0648\u0642\u0639 {allButLastType} \u0645\u0646 {lastType}",imageValidateSizeLabelFormatError:"\u0646\u0648\u0639 \u0627\u0644\u0635\u0648\u0631\u0629 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",imageValidateSizeLabelImageSizeTooSmall:"\u0627\u0644\u0635\u0648\u0631\u0629 \u0635\u063A\u064A\u0631 \u062C\u062F\u0627",imageValidateSizeLabelImageSizeTooBig:"\u0627\u0644\u0635\u0648\u0631\u0629 \u0643\u0628\u064A\u0631\u0629 \u062C\u062F\u0627",imageValidateSizeLabelExpectedMinSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0627\u0644\u062F\u0642\u0629 \u0636\u0639\u064A\u0641\u0629 \u062C\u062F\u0627",imageValidateSizeLabelImageResolutionTooHigh:"\u0627\u0644\u062F\u0642\u0629 \u0645\u0631\u062A\u0641\u0639\u0629 \u062C\u062F\u0627",imageValidateSizeLabelExpectedMinResolution:"\u0623\u0642\u0644 \u062F\u0642\u0629: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0623\u0642\u0635\u0649 \u062F\u0642\u0629: {maxResolution}"};var Sl={labelIdle:'Arrossega i deixa els teus fitxers o Navega ',labelInvalidField:"El camp cont\xE9 fitxers inv\xE0lids",labelFileWaitingForSize:"Esperant mida",labelFileSizeNotAvailable:"Mida no disponible",labelFileLoading:"Carregant",labelFileLoadError:"Error durant la c\xE0rrega",labelFileProcessing:"Pujant",labelFileProcessingComplete:"Pujada completada",labelFileProcessingAborted:"Pujada cancel\xB7lada",labelFileProcessingError:"Error durant la pujada",labelFileProcessingRevertError:"Error durant la reversi\xF3",labelFileRemoveError:"Error durant l'eliminaci\xF3",labelTapToCancel:"toca per cancel\xB7lar",labelTapToRetry:"toca per reintentar",labelTapToUndo:"toca per desfer",labelButtonRemoveItem:"Eliminar",labelButtonAbortItemLoad:"Cancel\xB7lar",labelButtonRetryItemLoad:"Reintentar",labelButtonAbortItemProcessing:"Cancel\xB7lar",labelButtonUndoItemProcessing:"Desfer",labelButtonRetryItemProcessing:"Reintentar",labelButtonProcessItem:"Pujar",labelMaxFileSizeExceeded:"El fitxer \xE9s massa gran",labelMaxFileSize:"La mida m\xE0xima del fitxer \xE9s {filesize}",labelMaxTotalFileSizeExceeded:"Mida m\xE0xima total excedida",labelMaxTotalFileSize:"La mida m\xE0xima total del fitxer \xE9s {filesize}",labelFileTypeNotAllowed:"Fitxer de tipus inv\xE0lid",fileValidateTypeLabelExpectedTypes:"Espera {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipus d'imatge no suportada",imageValidateSizeLabelImageSizeTooSmall:"La imatge \xE9s massa petita",imageValidateSizeLabelImageSizeTooBig:"La imatge \xE9s massa gran",imageValidateSizeLabelExpectedMinSize:"La mida m\xEDnima \xE9s {minWidth} x {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La mida m\xE0xima \xE9s {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La resoluci\xF3 \xE9s massa baixa",imageValidateSizeLabelImageResolutionTooHigh:"La resoluci\xF3 \xE9s massa alta",imageValidateSizeLabelExpectedMinResolution:"La resoluci\xF3 m\xEDnima \xE9s {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La resoluci\xF3 m\xE0xima \xE9s {maxResolution}"};var Ll={labelIdle:'\u067E\u06D5\u0695\u06AF\u06D5\u06A9\u0627\u0646 \u0641\u0695\u06CE \u0628\u062F\u06D5 \u0626\u06CE\u0631\u06D5 \u0628\u06C6 \u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u06CC\u0627\u0646 \u0647\u06D5\u06B5\u0628\u0698\u06CE\u0631\u06D5 ',labelInvalidField:"\u067E\u06D5\u0695\u06AF\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06CC \u062A\u06CE\u062F\u0627\u06CC\u06D5",labelFileWaitingForSize:"\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06CC\u06CC \u0642\u06D5\u0628\u0627\u0631\u06D5",labelFileSizeNotAvailable:"\u0642\u06D5\u0628\u0627\u0631\u06D5 \u0628\u06D5\u0631\u062F\u06D5\u0633\u062A \u0646\u06CC\u06D5",labelFileLoading:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileLoadError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5\u0645\u0627\u0648\u06D5\u06CC \u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileProcessing:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileProcessingComplete:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u062A\u06D5\u0648\u0627\u0648 \u0628\u0648\u0648",labelFileProcessingAborted:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u06CC\u06D5\u0648\u06D5",labelFileProcessingError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5\u06A9\u0627\u062A\u06CC \u0628\u0627\u0631\u06A9\u0631\u062F\u0646\u062F\u0627",labelFileProcessingRevertError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5 \u06A9\u0627\u062A\u06CC \u06AF\u06D5\u0695\u0627\u0646\u06D5\u0648\u06D5",labelFileRemoveError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5 \u06A9\u0627\u062A\u06CC \u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5",labelTapToCancel:"\u0628\u06C6 \u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5 Tab \u062F\u0627\u0628\u06AF\u0631\u06D5",labelTapToRetry:"tap \u062F\u0627\u0628\u06AF\u0631\u06D5 \u0628\u06C6 \u062F\u0648\u0648\u0628\u0627\u0631\u06D5\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5",labelTapToUndo:"tap \u062F\u0627\u0628\u06AF\u0631\u06D5 \u0628\u06C6 \u06AF\u06D5\u0695\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRemoveItem:"\u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5",labelButtonAbortItemLoad:"\u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRetryItemLoad:"\u0647\u06D5\u0648\u06B5\u062F\u0627\u0646\u06D5\u0648\u06D5",labelButtonAbortItemProcessing:"\u067E\u06D5\u0634\u06CC\u0645\u0627\u0646\u0628\u0648\u0648\u0646\u06D5\u0648\u06D5",labelButtonUndoItemProcessing:"\u06AF\u06D5\u0695\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRetryItemProcessing:"\u0647\u06D5\u0648\u06B5\u062F\u0627\u0646\u06D5\u0648\u06D5",labelButtonProcessItem:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelMaxFileSizeExceeded:"\u067E\u06D5\u0695\u06AF\u06D5 \u0632\u06C6\u0631 \u06AF\u06D5\u0648\u0631\u06D5\u06CC\u06D5",labelMaxFileSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {filesize}",labelMaxTotalFileSizeExceeded:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5\u06CC \u06A9\u06C6\u06CC \u06AF\u0634\u062A\u06CC \u062A\u06CE\u067E\u06D5\u0695\u06CE\u0646\u062F\u0631\u0627",labelMaxTotalFileSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5\u06CC \u06A9\u06C6\u06CC \u067E\u06D5\u0695\u06AF\u06D5 {filesize}",labelFileTypeNotAllowed:"\u062C\u06C6\u0631\u06CC \u067E\u06D5\u0695\u06AF\u06D5\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5",fileValidateTypeLabelExpectedTypes:"\u062C\u06AF\u06D5 \u0644\u06D5 {allButLastType} \u06CC\u0627\u0646 {lastType}",imageValidateSizeLabelFormatError:"\u062C\u06C6\u0631\u06CC \u0648\u06CE\u0646\u06D5 \u067E\u0627\u06B5\u067E\u0634\u062A\u06CC\u06CC \u0646\u06D5\u06A9\u0631\u0627\u0648\u06D5",imageValidateSizeLabelImageSizeTooSmall:"\u0648\u06CE\u0646\u06D5\u06A9\u06D5 \u0632\u06C6\u0631 \u0628\u0686\u0648\u0648\u06A9\u06D5",imageValidateSizeLabelImageSizeTooBig:"\u0648\u06CE\u0646\u06D5\u06A9\u06D5 \u0632\u06C6\u0631 \u06AF\u06D5\u0648\u0631\u06D5\u06CC\u06D5",imageValidateSizeLabelExpectedMinSize:"\u06A9\u06D5\u0645\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC\u06D5\u06A9\u06D5\u06CC \u0632\u06C6\u0631 \u06A9\u06D5\u0645\u06D5",imageValidateSizeLabelImageResolutionTooHigh:"\u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC\u06D5\u06A9\u06D5\u06CC \u0632\u06C6\u0631 \u0628\u06D5\u0631\u0632\u06D5",imageValidateSizeLabelExpectedMinResolution:"\u06A9\u06D5\u0645\u062A\u0631\u06CC\u0646 \u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0648\u0631\u062F\u0628\u06CC\u0646\u06CC {maxResolution}"};var Al={labelIdle:'P\u0159et\xE1hn\u011Bte soubor sem (drag&drop) nebo Vyhledat ',labelInvalidField:"Pole obsahuje chybn\xE9 soubory",labelFileWaitingForSize:"Zji\u0161\u0165uje se velikost",labelFileSizeNotAvailable:"Velikost nen\xED zn\xE1m\xE1",labelFileLoading:"P\u0159en\xE1\u0161\xED se",labelFileLoadError:"Chyba p\u0159i p\u0159enosu",labelFileProcessing:"Prob\xEDh\xE1 upload",labelFileProcessingComplete:"Upload dokon\u010Den",labelFileProcessingAborted:"Upload stornov\xE1n",labelFileProcessingError:"Chyba p\u0159i uploadu",labelFileProcessingRevertError:"Chyba p\u0159i obnov\u011B",labelFileRemoveError:"Chyba p\u0159i odstran\u011Bn\xED",labelTapToCancel:"klepn\u011Bte pro storno",labelTapToRetry:"klepn\u011Bte pro opakov\xE1n\xED",labelTapToUndo:"klepn\u011Bte pro vr\xE1cen\xED",labelButtonRemoveItem:"Odstranit",labelButtonAbortItemLoad:"Storno",labelButtonRetryItemLoad:"Opakovat",labelButtonAbortItemProcessing:"Zp\u011Bt",labelButtonUndoItemProcessing:"Vr\xE1tit",labelButtonRetryItemProcessing:"Opakovat",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Soubor je p\u0159\xEDli\u0161 velk\xFD",labelMaxFileSize:"Nejv\u011Bt\u0161\xED velikost souboru je {filesize}",labelMaxTotalFileSizeExceeded:"P\u0159ekro\u010Dena maxim\xE1ln\xED celkov\xE1 velikost souboru",labelMaxTotalFileSize:"Maxim\xE1ln\xED celkov\xE1 velikost souboru je {filesize}",labelFileTypeNotAllowed:"Soubor je nespr\xE1vn\xE9ho typu",fileValidateTypeLabelExpectedTypes:"O\u010Dek\xE1v\xE1 se {allButLastType} nebo {lastType}",imageValidateSizeLabelFormatError:"Obr\xE1zek tohoto typu nen\xED podporov\xE1n",imageValidateSizeLabelImageSizeTooSmall:"Obr\xE1zek je p\u0159\xEDli\u0161 mal\xFD",imageValidateSizeLabelImageSizeTooBig:"Obr\xE1zek je p\u0159\xEDli\u0161 velk\xFD",imageValidateSizeLabelExpectedMinSize:"Minim\xE1ln\xED rozm\u011Br je {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maxim\xE1ln\xED rozm\u011Br je {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rozli\u0161en\xED je p\u0159\xEDli\u0161 mal\xE9",imageValidateSizeLabelImageResolutionTooHigh:"Rozli\u0161en\xED je p\u0159\xEDli\u0161 velk\xE9",imageValidateSizeLabelExpectedMinResolution:"Minim\xE1ln\xED rozli\u0161en\xED je {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maxim\xE1ln\xED rozli\u0161en\xED je {maxResolution}"};var Ml={labelIdle:'Tr\xE6k & slip filer eller Gennemse ',labelInvalidField:"Felt indeholder ugyldige filer",labelFileWaitingForSize:"Venter p\xE5 st\xF8rrelse",labelFileSizeNotAvailable:"St\xF8rrelse ikke tilg\xE6ngelig",labelFileLoading:"Loader",labelFileLoadError:"Load fejlede",labelFileProcessing:"Uploader",labelFileProcessingComplete:"Upload f\xE6rdig",labelFileProcessingAborted:"Upload annulleret",labelFileProcessingError:"Upload fejlede",labelFileProcessingRevertError:"Fortryd fejlede",labelFileRemoveError:"Fjern fejlede",labelTapToCancel:"tryk for at annullere",labelTapToRetry:"tryk for at pr\xF8ve igen",labelTapToUndo:"tryk for at fortryde",labelButtonRemoveItem:"Fjern",labelButtonAbortItemLoad:"Annuller",labelButtonRetryItemLoad:"Fors\xF8g igen",labelButtonAbortItemProcessing:"Annuller",labelButtonUndoItemProcessing:"Fortryd",labelButtonRetryItemProcessing:"Pr\xF8v igen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Filen er for stor",labelMaxFileSize:"Maksimal filst\xF8rrelse er {filesize}",labelMaxTotalFileSizeExceeded:"Maksimal totalst\xF8rrelse overskredet",labelMaxTotalFileSize:"Maksimal total filst\xF8rrelse er {filesize}",labelFileTypeNotAllowed:"Ugyldig filtype",fileValidateTypeLabelExpectedTypes:"Forventer {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Ugyldigt format",imageValidateSizeLabelImageSizeTooSmall:"Billedet er for lille",imageValidateSizeLabelImageSizeTooBig:"Billedet er for stort",imageValidateSizeLabelExpectedMinSize:"Minimum st\xF8rrelse er {minBredde} \xD7 {minH\xF8jde}",imageValidateSizeLabelExpectedMaxSize:"Maksimal st\xF8rrelse er {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"For lav opl\xF8sning",imageValidateSizeLabelImageResolutionTooHigh:"For h\xF8j opl\xF8sning",imageValidateSizeLabelExpectedMinResolution:"Minimum opl\xF8sning er {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimal opl\xF8sning er {maxResolution}"};var Ol={labelIdle:'Dateien ablegen oder ausw\xE4hlen ',labelInvalidField:"Feld beinhaltet ung\xFCltige Dateien",labelFileWaitingForSize:"Dateigr\xF6\xDFe berechnen",labelFileSizeNotAvailable:"Dateigr\xF6\xDFe nicht verf\xFCgbar",labelFileLoading:"Laden",labelFileLoadError:"Fehler beim Laden",labelFileProcessing:"Upload l\xE4uft",labelFileProcessingComplete:"Upload abgeschlossen",labelFileProcessingAborted:"Upload abgebrochen",labelFileProcessingError:"Fehler beim Upload",labelFileProcessingRevertError:"Fehler beim Wiederherstellen",labelFileRemoveError:"Fehler beim L\xF6schen",labelTapToCancel:"abbrechen",labelTapToRetry:"erneut versuchen",labelTapToUndo:"r\xFCckg\xE4ngig",labelButtonRemoveItem:"Entfernen",labelButtonAbortItemLoad:"Verwerfen",labelButtonRetryItemLoad:"Erneut versuchen",labelButtonAbortItemProcessing:"Abbrechen",labelButtonUndoItemProcessing:"R\xFCckg\xE4ngig",labelButtonRetryItemProcessing:"Erneut versuchen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Datei ist zu gro\xDF",labelMaxFileSize:"Maximale Dateigr\xF6\xDFe: {filesize}",labelMaxTotalFileSizeExceeded:"Maximale gesamte Dateigr\xF6\xDFe \xFCberschritten",labelMaxTotalFileSize:"Maximale gesamte Dateigr\xF6\xDFe: {filesize}",labelFileTypeNotAllowed:"Dateityp ung\xFCltig",fileValidateTypeLabelExpectedTypes:"Erwartet {allButLastType} oder {lastType}",imageValidateSizeLabelFormatError:"Bildtyp nicht unterst\xFCtzt",imageValidateSizeLabelImageSizeTooSmall:"Bild ist zu klein",imageValidateSizeLabelImageSizeTooBig:"Bild ist zu gro\xDF",imageValidateSizeLabelExpectedMinSize:"Mindestgr\xF6\xDFe: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximale Gr\xF6\xDFe: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Aufl\xF6sung ist zu niedrig",imageValidateSizeLabelImageResolutionTooHigh:"Aufl\xF6sung ist zu hoch",imageValidateSizeLabelExpectedMinResolution:"Mindestaufl\xF6sung: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximale Aufl\xF6sung: {maxResolution}"};var Pl={labelIdle:'Drag & Drop your files or Browse ',labelInvalidField:"Field contains invalid files",labelFileWaitingForSize:"Waiting for size",labelFileSizeNotAvailable:"Size not available",labelFileLoading:"Loading",labelFileLoadError:"Error during load",labelFileProcessing:"Uploading",labelFileProcessingComplete:"Upload complete",labelFileProcessingAborted:"Upload cancelled",labelFileProcessingError:"Error during upload",labelFileProcessingRevertError:"Error during revert",labelFileRemoveError:"Error during remove",labelTapToCancel:"tap to cancel",labelTapToRetry:"tap to retry",labelTapToUndo:"tap to undo",labelButtonRemoveItem:"Remove",labelButtonAbortItemLoad:"Abort",labelButtonRetryItemLoad:"Retry",labelButtonAbortItemProcessing:"Cancel",labelButtonUndoItemProcessing:"Undo",labelButtonRetryItemProcessing:"Retry",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"File is too large",labelMaxFileSize:"Maximum file size is {filesize}",labelMaxTotalFileSizeExceeded:"Maximum total size exceeded",labelMaxTotalFileSize:"Maximum total file size is {filesize}",labelFileTypeNotAllowed:"File of invalid type",fileValidateTypeLabelExpectedTypes:"Expects {allButLastType} or {lastType}",imageValidateSizeLabelFormatError:"Image type not supported",imageValidateSizeLabelImageSizeTooSmall:"Image is too small",imageValidateSizeLabelImageSizeTooBig:"Image is too big",imageValidateSizeLabelExpectedMinSize:"Minimum size is {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum size is {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolution is too low",imageValidateSizeLabelImageResolutionTooHigh:"Resolution is too high",imageValidateSizeLabelExpectedMinResolution:"Minimum resolution is {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximum resolution is {maxResolution}"};var Dl={labelIdle:'Arrastra y suelta tus archivos o Examina ',labelInvalidField:"El campo contiene archivos inv\xE1lidos",labelFileWaitingForSize:"Esperando tama\xF1o",labelFileSizeNotAvailable:"Tama\xF1o no disponible",labelFileLoading:"Cargando",labelFileLoadError:"Error durante la carga",labelFileProcessing:"Subiendo",labelFileProcessingComplete:"Subida completa",labelFileProcessingAborted:"Subida cancelada",labelFileProcessingError:"Error durante la subida",labelFileProcessingRevertError:"Error durante la reversi\xF3n",labelFileRemoveError:"Error durante la eliminaci\xF3n",labelTapToCancel:"toca para cancelar",labelTapToRetry:"tocar para reintentar",labelTapToUndo:"tocar para deshacer",labelButtonRemoveItem:"Eliminar",labelButtonAbortItemLoad:"Cancelar",labelButtonRetryItemLoad:"Reintentar",labelButtonAbortItemProcessing:"Cancelar",labelButtonUndoItemProcessing:"Deshacer",labelButtonRetryItemProcessing:"Reintentar",labelButtonProcessItem:"Subir",labelMaxFileSizeExceeded:"El archivo es demasiado grande",labelMaxFileSize:"El tama\xF1o m\xE1ximo del archivo es {filesize}",labelMaxTotalFileSizeExceeded:"Tama\xF1o total m\xE1ximo excedido",labelMaxTotalFileSize:"El tama\xF1o total m\xE1ximo del archivo es {filesize}",labelFileTypeNotAllowed:"Archivo de tipo inv\xE1lido",fileValidateTypeLabelExpectedTypes:"Espera {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipo de imagen no soportada",imageValidateSizeLabelImageSizeTooSmall:"La imagen es demasiado peque\xF1a",imageValidateSizeLabelImageSizeTooBig:"La imagen es demasiado grande",imageValidateSizeLabelExpectedMinSize:"El tama\xF1o m\xEDnimo es {minWidth} x {minHeight}",imageValidateSizeLabelExpectedMaxSize:"El tama\xF1o m\xE1ximo es {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La resoluci\xF3n es demasiado baja",imageValidateSizeLabelImageResolutionTooHigh:"La resoluci\xF3n es demasiado alta",imageValidateSizeLabelExpectedMinResolution:"La resoluci\xF3n m\xEDnima es {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La resoluci\xF3n m\xE1xima es {maxResolution}"};var Fl={labelIdle:'\u0641\u0627\u06CC\u0644 \u0631\u0627 \u0627\u06CC\u0646\u062C\u0627 \u0628\u06A9\u0634\u06CC\u062F \u0648 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u062C\u0633\u062A\u062C\u0648 \u06A9\u0646\u06CC\u062F ',labelInvalidField:"\u0641\u06CC\u0644\u062F \u062F\u0627\u0631\u0627\u06CC \u0641\u0627\u06CC\u0644 \u0647\u0627\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A",labelFileWaitingForSize:"Waiting for size",labelFileSizeNotAvailable:"\u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0645\u062C\u0627\u0632 \u0646\u06CC\u0633\u062A",labelFileLoading:"\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileLoadError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0627\u062C\u0631\u0627",labelFileProcessing:"\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileProcessingComplete:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0627\u0645\u0644 \u0634\u062F",labelFileProcessingAborted:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0644\u063A\u0648 \u0634\u062F",labelFileProcessingError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileProcessingRevertError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641",labelFileRemoveError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641",labelTapToCancel:"\u0628\u0631\u0627\u06CC \u0644\u063A\u0648 \u0636\u0631\u0628\u0647 \u0628\u0632\u0646\u06CC\u062F",labelTapToRetry:"\u0628\u0631\u0627\u06CC \u062A\u06A9\u0631\u0627\u0631 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",labelTapToUndo:"\u0628\u0631\u0627\u06CC \u0628\u0631\u06AF\u0634\u062A \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",labelButtonRemoveItem:"\u062D\u0630\u0641",labelButtonAbortItemLoad:"\u0644\u063A\u0648",labelButtonRetryItemLoad:"\u062A\u06A9\u0631\u0627\u0631",labelButtonAbortItemProcessing:"\u0644\u063A\u0648",labelButtonUndoItemProcessing:"\u0628\u0631\u06AF\u0634\u062A",labelButtonRetryItemProcessing:"\u062A\u06A9\u0631\u0627\u0631",labelButtonProcessItem:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelMaxFileSizeExceeded:"\u0641\u0627\u06CC\u0644 \u0628\u0633\u06CC\u0627\u0631 \u062D\u062C\u06CC\u0645 \u0627\u0633\u062A",labelMaxFileSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0645\u062C\u0627\u0632 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A",labelMaxTotalFileSizeExceeded:"\u0627\u0632 \u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0628\u06CC\u0634\u062A\u0631 \u0634\u062F",labelMaxTotalFileSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A",labelFileTypeNotAllowed:"\u0646\u0648\u0639 \u0641\u0627\u06CC\u0644 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A",fileValidateTypeLabelExpectedTypes:"\u062F\u0631 \u0627\u0646\u062A\u0638\u0627\u0631 {allButLastType} \u06CC\u0627 {lastType}",imageValidateSizeLabelFormatError:"\u0641\u0631\u0645\u062A \u062A\u0635\u0648\u06CC\u0631 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0646\u0645\u06CC \u0634\u0648\u062F",imageValidateSizeLabelImageSizeTooSmall:"\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0648\u0686\u06A9 \u0627\u0633\u062A",imageValidateSizeLabelImageSizeTooBig:"\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0628\u0632\u0631\u06AF \u0627\u0633\u062A",imageValidateSizeLabelExpectedMinSize:"\u062D\u062F\u0627\u0642\u0644 \u0627\u0646\u062F\u0627\u0632\u0647 {minWidth} \xD7 {minHeight} \u0627\u0633\u062A",imageValidateSizeLabelExpectedMaxSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0627\u0646\u062F\u0627\u0632\u0647 {maxWidth} \xD7 {maxHeight} \u0627\u0633\u062A",imageValidateSizeLabelImageResolutionTooLow:"\u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0645 \u0627\u0633\u062A",imageValidateSizeLabelImageResolutionTooHigh:"\u0648\u0636\u0648\u0639 \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0632\u06CC\u0627\u062F \u0627\u0633\u062A",imageValidateSizeLabelExpectedMinResolution:"\u062D\u062F\u0627\u0642\u0644 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {minResolution} \u0627\u0633\u062A",imageValidateSizeLabelExpectedMaxResolution:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {maxResolution} \u0627\u0633\u062A"};var zl={labelIdle:'Ved\xE4 ja pudota tiedostoja tai Selaa ',labelInvalidField:"Kent\xE4ss\xE4 on virheellisi\xE4 tiedostoja",labelFileWaitingForSize:"Odotetaan kokoa",labelFileSizeNotAvailable:"Kokoa ei saatavilla",labelFileLoading:"Ladataan",labelFileLoadError:"Virhe latauksessa",labelFileProcessing:"L\xE4hetet\xE4\xE4n",labelFileProcessingComplete:"L\xE4hetys valmis",labelFileProcessingAborted:"L\xE4hetys peruttu",labelFileProcessingError:"Virhe l\xE4hetyksess\xE4",labelFileProcessingRevertError:"Virhe palautuksessa",labelFileRemoveError:"Virhe poistamisessa",labelTapToCancel:"peruuta napauttamalla",labelTapToRetry:"yrit\xE4 uudelleen napauttamalla",labelTapToUndo:"kumoa napauttamalla",labelButtonRemoveItem:"Poista",labelButtonAbortItemLoad:"Keskeyt\xE4",labelButtonRetryItemLoad:"Yrit\xE4 uudelleen",labelButtonAbortItemProcessing:"Peruuta",labelButtonUndoItemProcessing:"Kumoa",labelButtonRetryItemProcessing:"Yrit\xE4 uudelleen",labelButtonProcessItem:"L\xE4het\xE4",labelMaxFileSizeExceeded:"Tiedoston koko on liian suuri",labelMaxFileSize:"Tiedoston maksimikoko on {filesize}",labelMaxTotalFileSizeExceeded:"Tiedostojen yhdistetty maksimikoko ylitetty",labelMaxTotalFileSize:"Tiedostojen yhdistetty maksimikoko on {filesize}",labelFileTypeNotAllowed:"Tiedostotyyppi\xE4 ei sallita",fileValidateTypeLabelExpectedTypes:"Sallitaan {allButLastType} tai {lastType}",imageValidateSizeLabelFormatError:"Kuvatyyppi\xE4 ei tueta",imageValidateSizeLabelImageSizeTooSmall:"Kuva on liian pieni",imageValidateSizeLabelImageSizeTooBig:"Kuva on liian suuri",imageValidateSizeLabelExpectedMinSize:"Minimikoko on {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimikoko on {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resoluutio on liian pieni",imageValidateSizeLabelImageResolutionTooHigh:"Resoluutio on liian suuri",imageValidateSizeLabelExpectedMinResolution:"Minimiresoluutio on {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimiresoluutio on {maxResolution}"};var Cl={labelIdle:'Faites glisser vos fichiers ou Parcourir ',labelInvalidField:"Le champ contient des fichiers invalides",labelFileWaitingForSize:"En attente de taille",labelFileSizeNotAvailable:"Taille non disponible",labelFileLoading:"Chargement",labelFileLoadError:"Erreur durant le chargement",labelFileProcessing:"Traitement",labelFileProcessingComplete:"Traitement effectu\xE9",labelFileProcessingAborted:"Traitement interrompu",labelFileProcessingError:"Erreur durant le traitement",labelFileProcessingRevertError:"Erreur durant la restauration",labelFileRemoveError:"Erreur durant la suppression",labelTapToCancel:"appuyer pour annuler",labelTapToRetry:"appuyer pour r\xE9essayer",labelTapToUndo:"appuyer pour revenir en arri\xE8re",labelButtonRemoveItem:"Retirer",labelButtonAbortItemLoad:"Annuler",labelButtonRetryItemLoad:"Recommencer",labelButtonAbortItemProcessing:"Annuler",labelButtonUndoItemProcessing:"Revenir en arri\xE8re",labelButtonRetryItemProcessing:"Recommencer",labelButtonProcessItem:"Transf\xE9rer",labelMaxFileSizeExceeded:"Le fichier est trop volumineux",labelMaxFileSize:"La taille maximale de fichier est {filesize}",labelMaxTotalFileSizeExceeded:"Taille totale maximale d\xE9pass\xE9e",labelMaxTotalFileSize:"La taille totale maximale des fichiers est {filesize}",labelFileTypeNotAllowed:"Fichier non valide",fileValidateTypeLabelExpectedTypes:"Attendu {allButLastType} ou {lastType}",imageValidateSizeLabelFormatError:"Type d'image non pris en charge",imageValidateSizeLabelImageSizeTooSmall:"L'image est trop petite",imageValidateSizeLabelImageSizeTooBig:"L'image est trop grande",imageValidateSizeLabelExpectedMinSize:"La taille minimale est {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La taille maximale est {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La r\xE9solution est trop faible",imageValidateSizeLabelImageResolutionTooHigh:"La r\xE9solution est trop \xE9lev\xE9e",imageValidateSizeLabelExpectedMinResolution:"La r\xE9solution minimale est {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La r\xE9solution maximale est {maxResolution}"};var Nl={labelIdle:'Mozgasd ide a f\xE1jlt a felt\xF6lt\xE9shez, vagy tall\xF3z\xE1s ',labelInvalidField:"A mez\u0151 \xE9rv\xE9nytelen f\xE1jlokat tartalmaz",labelFileWaitingForSize:"F\xE1ljm\xE9ret kisz\xE1mol\xE1sa",labelFileSizeNotAvailable:"A f\xE1jlm\xE9ret nem el\xE9rhet\u0151",labelFileLoading:"T\xF6lt\xE9s",labelFileLoadError:"Hiba a bet\xF6lt\xE9s sor\xE1n",labelFileProcessing:"Felt\xF6lt\xE9s",labelFileProcessingComplete:"Sikeres felt\xF6lt\xE9s",labelFileProcessingAborted:"A felt\xF6lt\xE9s megszak\xEDtva",labelFileProcessingError:"Hiba t\xF6rt\xE9nt a felt\xF6lt\xE9s sor\xE1n",labelFileProcessingRevertError:"Hiba a vissza\xE1ll\xEDt\xE1s sor\xE1n",labelFileRemoveError:"Hiba t\xF6rt\xE9nt az elt\xE1vol\xEDt\xE1s sor\xE1n",labelTapToCancel:"koppints a t\xF6rl\xE9shez",labelTapToRetry:"koppints az \xFAjrakezd\xE9shez",labelTapToUndo:"koppints a visszavon\xE1shoz",labelButtonRemoveItem:"Elt\xE1vol\xEDt\xE1s",labelButtonAbortItemLoad:"Megszak\xEDt\xE1s",labelButtonRetryItemLoad:"\xDAjrapr\xF3b\xE1lkoz\xE1s",labelButtonAbortItemProcessing:"Megszak\xEDt\xE1s",labelButtonUndoItemProcessing:"Visszavon\xE1s",labelButtonRetryItemProcessing:"\xDAjrapr\xF3b\xE1lkoz\xE1s",labelButtonProcessItem:"Felt\xF6lt\xE9s",labelMaxFileSizeExceeded:"A f\xE1jl t\xFAll\xE9pte a maxim\xE1lis m\xE9retet",labelMaxFileSize:"Maxim\xE1lis f\xE1jlm\xE9ret: {filesize}",labelMaxTotalFileSizeExceeded:"T\xFAll\xE9pte a maxim\xE1lis teljes m\xE9retet",labelMaxTotalFileSize:"A maxim\xE1is teljes f\xE1jlm\xE9ret: {filesize}",labelFileTypeNotAllowed:"\xC9rv\xE9nytelen t\xEDpus\xFA f\xE1jl",fileValidateTypeLabelExpectedTypes:"Enged\xE9lyezett t\xEDpusok {allButLastType} vagy {lastType}",imageValidateSizeLabelFormatError:"A k\xE9pt\xEDpus nem t\xE1mogatott",imageValidateSizeLabelImageSizeTooSmall:"A k\xE9p t\xFAl kicsi",imageValidateSizeLabelImageSizeTooBig:"A k\xE9p t\xFAl nagy",imageValidateSizeLabelExpectedMinSize:"Minimum m\xE9ret: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum m\xE9ret: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"A felbont\xE1s t\xFAl alacsony",imageValidateSizeLabelImageResolutionTooHigh:"A felbont\xE1s t\xFAl magas",imageValidateSizeLabelExpectedMinResolution:"Minim\xE1is felbont\xE1s: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maxim\xE1lis felbont\xE1s: {maxResolution}"};var Bl={labelIdle:'Seret & Jatuhkan berkas Anda atau Jelajahi',labelInvalidField:"Isian berisi berkas yang tidak valid",labelFileWaitingForSize:"Menunggu ukuran berkas",labelFileSizeNotAvailable:"Ukuran berkas tidak tersedia",labelFileLoading:"Memuat",labelFileLoadError:"Kesalahan saat memuat",labelFileProcessing:"Mengunggah",labelFileProcessingComplete:"Pengunggahan selesai",labelFileProcessingAborted:"Pengunggahan dibatalkan",labelFileProcessingError:"Kesalahan saat pengunggahan",labelFileProcessingRevertError:"Kesalahan saat pemulihan",labelFileRemoveError:"Kesalahan saat penghapusan",labelTapToCancel:"ketuk untuk membatalkan",labelTapToRetry:"ketuk untuk mencoba lagi",labelTapToUndo:"ketuk untuk mengurungkan",labelButtonRemoveItem:"Hapus",labelButtonAbortItemLoad:"Batalkan",labelButtonRetryItemLoad:"Coba Kembali",labelButtonAbortItemProcessing:"Batalkan",labelButtonUndoItemProcessing:"Urungkan",labelButtonRetryItemProcessing:"Coba Kembali",labelButtonProcessItem:"Unggah",labelMaxFileSizeExceeded:"Berkas terlalu besar",labelMaxFileSize:"Ukuran berkas maksimum adalah {filesize}",labelMaxTotalFileSizeExceeded:"Jumlah berkas maksimum terlampaui",labelMaxTotalFileSize:"Jumlah berkas maksimum adalah {filesize}",labelFileTypeNotAllowed:"Jenis berkas tidak valid",fileValidateTypeLabelExpectedTypes:"Mengharapkan {allButLastType} atau {lastType}",imageValidateSizeLabelFormatError:"Jenis citra tidak didukung",imageValidateSizeLabelImageSizeTooSmall:"Citra terlalu kecil",imageValidateSizeLabelImageSizeTooBig:"Citra terlalu besar",imageValidateSizeLabelExpectedMinSize:"Ukuran minimum adalah {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Ukuran maksimum adalah {minWidth} \xD7 {minHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolusi terlalu rendah",imageValidateSizeLabelImageResolutionTooHigh:"Resolusi terlalu tinggi",imageValidateSizeLabelExpectedMinResolution:"Resolusi minimum adalah {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Resolusi maksimum adalah {maxResolution}"};var kl={labelIdle:'Trascina e rilascia i tuoi file oppure Carica ',labelInvalidField:"Il campo contiene dei file non validi",labelFileWaitingForSize:"Aspettando le dimensioni",labelFileSizeNotAvailable:"Dimensioni non disponibili",labelFileLoading:"Caricamento",labelFileLoadError:"Errore durante il caricamento",labelFileProcessing:"Caricamento",labelFileProcessingComplete:"Caricamento completato",labelFileProcessingAborted:"Caricamento cancellato",labelFileProcessingError:"Errore durante il caricamento",labelFileProcessingRevertError:"Errore durante il ripristino",labelFileRemoveError:"Errore durante l'eliminazione",labelTapToCancel:"tocca per cancellare",labelTapToRetry:"tocca per riprovare",labelTapToUndo:"tocca per ripristinare",labelButtonRemoveItem:"Elimina",labelButtonAbortItemLoad:"Cancella",labelButtonRetryItemLoad:"Ritenta",labelButtonAbortItemProcessing:"Camcella",labelButtonUndoItemProcessing:"Indietro",labelButtonRetryItemProcessing:"Ritenta",labelButtonProcessItem:"Carica",labelMaxFileSizeExceeded:"Il peso del file \xE8 eccessivo",labelMaxFileSize:"Il peso massimo del file \xE8 {filesize}",labelMaxTotalFileSizeExceeded:"Dimensione totale massima superata",labelMaxTotalFileSize:"La dimensione massima totale del file \xE8 {filesize}",labelFileTypeNotAllowed:"File non supportato",fileValidateTypeLabelExpectedTypes:"Aspetta {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipo di immagine non compatibile",imageValidateSizeLabelImageSizeTooSmall:"L'immagine \xE8 troppo piccola",imageValidateSizeLabelImageSizeTooBig:"L'immagine \xE8 troppo grande",imageValidateSizeLabelExpectedMinSize:"La dimensione minima \xE8 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La dimensione massima \xE8 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La risoluzione \xE8 troppo bassa",imageValidateSizeLabelImageResolutionTooHigh:"La risoluzione \xE8 troppo alta",imageValidateSizeLabelExpectedMinResolution:"La risoluzione minima \xE8 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La risoluzione massima \xE8 {maxResolution}"};var Vl={labelIdle:'\u1791\u17B6\u1789&\u178A\u17B6\u1780\u17CB\u17A0\u17D2\u179C\u17B6\u179B\u17CB\u17AF\u1780\u179F\u17B6\u179A\u179A\u1794\u179F\u17CB\u17A2\u17D2\u1793\u1780 \u17AC \u179F\u17D2\u179C\u17C2\u1784\u179A\u1780 ',labelInvalidField:"\u1785\u1793\u17D2\u179B\u17C4\u17C7\u1798\u17B6\u1793\u17AF\u1780\u179F\u17B6\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",labelFileWaitingForSize:"\u1780\u17C6\u1796\u17BB\u1784\u179A\u1784\u17CB\u1785\u17B6\u17C6\u1791\u17C6\u17A0\u17C6",labelFileSizeNotAvailable:"\u1791\u17C6\u17A0\u17C6\u1798\u17B7\u1793\u17A2\u17B6\u1785\u1794\u17D2\u179A\u17BE\u1794\u17B6\u1793",labelFileLoading:"\u1780\u17C6\u1796\u17BB\u1784\u178A\u17C6\u178E\u17BE\u179A\u1780\u17B6\u179A",labelFileLoadError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178A\u17C6\u178E\u17BE\u179A\u1780\u17B6\u179A",labelFileProcessing:"\u1780\u17C6\u1796\u17BB\u1784\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelFileProcessingComplete:"\u1780\u17B6\u179A\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784\u1796\u17C1\u1789\u179B\u17C1\u1789",labelFileProcessingAborted:"\u1780\u17B6\u179A\u1794\u1784\u17D2\u17A0\u17C4\u17C7\u178F\u17D2\u179A\u17BC\u179C\u1794\u17B6\u1793\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelFileProcessingError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u1780\u17C6\u1796\u17BB\u1784\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelFileProcessingRevertError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178F\u17D2\u179A\u17A1\u1794\u17CB",labelFileRemoveError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178A\u1780\u1785\u17C1\u1789",labelTapToCancel:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelTapToRetry:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelTapToUndo:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1798\u17B7\u1793\u1792\u17D2\u179C\u17BE\u179C\u17B7\u1789",labelButtonRemoveItem:"\u1799\u1780\u1785\u17C1\u1789",labelButtonAbortItemLoad:"\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelButtonRetryItemLoad:"\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelButtonAbortItemProcessing:"\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelButtonUndoItemProcessing:"\u1798\u17B7\u1793\u1792\u17D2\u179C\u17BE\u179C\u17B7\u1789",labelButtonRetryItemProcessing:"\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelButtonProcessItem:"\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelMaxFileSizeExceeded:"\u17AF\u1780\u179F\u17B6\u179A\u1792\u17C6\u1796\u17C1\u1780",labelMaxFileSize:"\u1791\u17C6\u17A0\u17C6\u17AF\u1780\u179F\u17B6\u179A\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {filesize}",labelMaxTotalFileSizeExceeded:"\u179B\u17BE\u179F\u1791\u17C6\u17A0\u17C6\u179F\u179A\u17BB\u1794\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6",labelMaxTotalFileSize:"\u1791\u17C6\u17A0\u17C6\u17AF\u1780\u179F\u17B6\u179A\u179F\u179A\u17BB\u1794\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {filesize}",labelFileTypeNotAllowed:"\u1794\u17D2\u179A\u1797\u17C1\u1791\u17AF\u1780\u179F\u17B6\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",fileValidateTypeLabelExpectedTypes:"\u179A\u17C6\u1796\u17B9\u1784\u1790\u17B6 {allButLastType} \u17AC {lastType}",imageValidateSizeLabelFormatError:"\u1794\u17D2\u179A\u1797\u17C1\u1791\u179A\u17BC\u1794\u1797\u17B6\u1796\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",imageValidateSizeLabelImageSizeTooSmall:"\u179A\u17BC\u1794\u1797\u17B6\u1796\u178F\u17BC\u1785\u1796\u17C1\u1780",imageValidateSizeLabelImageSizeTooBig:"\u179A\u17BC\u1794\u1797\u17B6\u1796\u1792\u17C6\u1796\u17C1\u1780",imageValidateSizeLabelExpectedMinSize:"\u1791\u17C6\u17A0\u17C6\u17A2\u1794\u17D2\u1794\u1794\u179A\u1798\u17B6\u1782\u17BA {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u1791\u17C6\u17A0\u17C6\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u1791\u17B6\u1794\u1796\u17C1\u1780",imageValidateSizeLabelImageResolutionTooHigh:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u1781\u17D2\u1796\u179F\u17CB\u1796\u17C1\u1780",imageValidateSizeLabelExpectedMinResolution:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u17A2\u1794\u17D2\u1794\u1794\u179A\u1798\u17B6\u1782\u17BA {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {maxResolution}"};var Gl={labelIdle:'Drag & Drop je bestanden of Bladeren ',labelInvalidField:"Veld bevat ongeldige bestanden",labelFileWaitingForSize:"Wachten op grootte",labelFileSizeNotAvailable:"Grootte niet beschikbaar",labelFileLoading:"Laden",labelFileLoadError:"Fout tijdens laden",labelFileProcessing:"Uploaden",labelFileProcessingComplete:"Upload afgerond",labelFileProcessingAborted:"Upload geannuleerd",labelFileProcessingError:"Fout tijdens upload",labelFileProcessingRevertError:"Fout bij herstellen",labelFileRemoveError:"Fout bij verwijderen",labelTapToCancel:"tik om te annuleren",labelTapToRetry:"tik om opnieuw te proberen",labelTapToUndo:"tik om ongedaan te maken",labelButtonRemoveItem:"Verwijderen",labelButtonAbortItemLoad:"Afbreken",labelButtonRetryItemLoad:"Opnieuw proberen",labelButtonAbortItemProcessing:"Annuleren",labelButtonUndoItemProcessing:"Ongedaan maken",labelButtonRetryItemProcessing:"Opnieuw proberen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Bestand is te groot",labelMaxFileSize:"Maximale bestandsgrootte is {filesize}",labelMaxTotalFileSizeExceeded:"Maximale totale grootte overschreden",labelMaxTotalFileSize:"Maximale totale bestandsgrootte is {filesize}",labelFileTypeNotAllowed:"Ongeldig bestandstype",fileValidateTypeLabelExpectedTypes:"Verwacht {allButLastType} of {lastType}",imageValidateSizeLabelFormatError:"Afbeeldingstype niet ondersteund",imageValidateSizeLabelImageSizeTooSmall:"Afbeelding is te klein",imageValidateSizeLabelImageSizeTooBig:"Afbeelding is te groot",imageValidateSizeLabelExpectedMinSize:"Minimale afmeting is {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximale afmeting is {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolutie is te laag",imageValidateSizeLabelImageResolutionTooHigh:"Resolution is too high",imageValidateSizeLabelExpectedMinResolution:"Minimale resolutie is {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximale resolutie is {maxResolution}"};var Ul={labelIdle:'Dra og slipp filene dine, eller Bla gjennom... ',labelInvalidField:"Feltet inneholder ugyldige filer",labelFileWaitingForSize:"Venter p\xE5 st\xF8rrelse",labelFileSizeNotAvailable:"St\xF8rrelse ikke tilgjengelig",labelFileLoading:"Laster",labelFileLoadError:"Feil under lasting",labelFileProcessing:"Laster opp",labelFileProcessingComplete:"Opplasting ferdig",labelFileProcessingAborted:"Opplasting avbrutt",labelFileProcessingError:"Feil under opplasting",labelFileProcessingRevertError:"Feil under reversering",labelFileRemoveError:"Feil under flytting",labelTapToCancel:"klikk for \xE5 avbryte",labelTapToRetry:"klikk for \xE5 pr\xF8ve p\xE5 nytt",labelTapToUndo:"klikk for \xE5 angre",labelButtonRemoveItem:"Fjern",labelButtonAbortItemLoad:"Avbryt",labelButtonRetryItemLoad:"Pr\xF8v p\xE5 nytt",labelButtonAbortItemProcessing:"Avbryt",labelButtonUndoItemProcessing:"Angre",labelButtonRetryItemProcessing:"Pr\xF8v p\xE5 nytt",labelButtonProcessItem:"Last opp",labelMaxFileSizeExceeded:"Filen er for stor",labelMaxFileSize:"Maksimal filst\xF8rrelse er {filesize}",labelMaxTotalFileSizeExceeded:"Maksimal total st\xF8rrelse oversteget",labelMaxTotalFileSize:"Maksimal total st\xF8rrelse er {filesize}",labelFileTypeNotAllowed:"Ugyldig filtype",fileValidateTypeLabelExpectedTypes:"Forventer {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Bildeformat ikke st\xF8ttet",imageValidateSizeLabelImageSizeTooSmall:"Bildet er for lite",imageValidateSizeLabelImageSizeTooBig:"Bildet er for stort",imageValidateSizeLabelExpectedMinSize:"Minimumsst\xF8rrelse er {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimumsst\xF8rrelse er {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Oppl\xF8sningen er for lav",imageValidateSizeLabelImageResolutionTooHigh:"Oppl\xF8sningen er for h\xF8y",imageValidateSizeLabelExpectedMinResolution:"Minimum oppl\xF8sning er {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimal oppl\xF8sning er {maxResolution}"};var Wl={labelIdle:'Przeci\u0105gnij i upu\u015B\u0107 lub wybierz pliki',labelInvalidField:"Nieprawid\u0142owe pliki",labelFileWaitingForSize:"Pobieranie rozmiaru",labelFileSizeNotAvailable:"Nieznany rozmiar",labelFileLoading:"Wczytywanie",labelFileLoadError:"B\u0142\u0105d wczytywania",labelFileProcessing:"Przesy\u0142anie",labelFileProcessingComplete:"Przes\u0142ano",labelFileProcessingAborted:"Przerwano",labelFileProcessingError:"Przesy\u0142anie nie powiod\u0142o si\u0119",labelFileProcessingRevertError:"Co\u015B posz\u0142o nie tak",labelFileRemoveError:"Nieudane usuni\u0119cie",labelTapToCancel:"Anuluj",labelTapToRetry:"Pon\xF3w",labelTapToUndo:"Cofnij",labelButtonRemoveItem:"Usu\u0144",labelButtonAbortItemLoad:"Przerwij",labelButtonRetryItemLoad:"Pon\xF3w",labelButtonAbortItemProcessing:"Anuluj",labelButtonUndoItemProcessing:"Cofnij",labelButtonRetryItemProcessing:"Pon\xF3w",labelButtonProcessItem:"Prze\u015Blij",labelMaxFileSizeExceeded:"Plik jest zbyt du\u017Cy",labelMaxFileSize:"Dopuszczalna wielko\u015B\u0107 pliku to {filesize}",labelMaxTotalFileSizeExceeded:"Przekroczono \u0142\u0105czny rozmiar plik\xF3w",labelMaxTotalFileSize:"\u0141\u0105czny rozmiar plik\xF3w nie mo\u017Ce przekroczy\u0107 {filesize}",labelFileTypeNotAllowed:"Niedozwolony rodzaj pliku",fileValidateTypeLabelExpectedTypes:"Oczekiwano {allButLastType} lub {lastType}",imageValidateSizeLabelFormatError:"Nieobs\u0142ugiwany format obrazu",imageValidateSizeLabelImageSizeTooSmall:"Obraz jest zbyt ma\u0142y",imageValidateSizeLabelImageSizeTooBig:"Obraz jest zbyt du\u017Cy",imageValidateSizeLabelExpectedMinSize:"Minimalne wymiary obrazu to {minWidth}\xD7{minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksymalna wymiary obrazu to {maxWidth}\xD7{maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rozdzielczo\u015B\u0107 jest zbyt niska",imageValidateSizeLabelImageResolutionTooHigh:"Rozdzielczo\u015B\u0107 jest zbyt wysoka",imageValidateSizeLabelExpectedMinResolution:"Minimalna rozdzielczo\u015B\u0107 to {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksymalna rozdzielczo\u015B\u0107 to {maxResolution}"};var Ri={labelIdle:'Arraste e solte os arquivos ou Clique aqui ',labelInvalidField:"Arquivos inv\xE1lidos",labelFileWaitingForSize:"Calculando o tamanho do arquivo",labelFileSizeNotAvailable:"Tamanho do arquivo indispon\xEDvel",labelFileLoading:"Carregando",labelFileLoadError:"Erro durante o carregamento",labelFileProcessing:"Enviando",labelFileProcessingComplete:"Envio finalizado",labelFileProcessingAborted:"Envio cancelado",labelFileProcessingError:"Erro durante o envio",labelFileProcessingRevertError:"Erro ao reverter o envio",labelFileRemoveError:"Erro ao remover o arquivo",labelTapToCancel:"clique para cancelar",labelTapToRetry:"clique para reenviar",labelTapToUndo:"clique para desfazer",labelButtonRemoveItem:"Remover",labelButtonAbortItemLoad:"Abortar",labelButtonRetryItemLoad:"Reenviar",labelButtonAbortItemProcessing:"Cancelar",labelButtonUndoItemProcessing:"Desfazer",labelButtonRetryItemProcessing:"Reenviar",labelButtonProcessItem:"Enviar",labelMaxFileSizeExceeded:"Arquivo \xE9 muito grande",labelMaxFileSize:"O tamanho m\xE1ximo permitido: {filesize}",labelMaxTotalFileSizeExceeded:"Tamanho total dos arquivos excedido",labelMaxTotalFileSize:"Tamanho total permitido: {filesize}",labelFileTypeNotAllowed:"Tipo de arquivo inv\xE1lido",fileValidateTypeLabelExpectedTypes:"Tipos de arquivo suportados s\xE3o {allButLastType} ou {lastType}",imageValidateSizeLabelFormatError:"Tipo de imagem inv\xE1lida",imageValidateSizeLabelImageSizeTooSmall:"Imagem muito pequena",imageValidateSizeLabelImageSizeTooBig:"Imagem muito grande",imageValidateSizeLabelExpectedMinSize:"Tamanho m\xEDnimo permitida: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Tamanho m\xE1ximo permitido: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolu\xE7\xE3o muito baixa",imageValidateSizeLabelImageResolutionTooHigh:"Resolu\xE7\xE3o muito alta",imageValidateSizeLabelExpectedMinResolution:"Resolu\xE7\xE3o m\xEDnima permitida: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Resolu\xE7\xE3o m\xE1xima permitida: {maxResolution}"};var Hl={labelIdle:'Trage \u0219i plaseaz\u0103 fi\u0219iere sau Caut\u0103-le ',labelInvalidField:"C\xE2mpul con\u021Bine fi\u0219iere care nu sunt valide",labelFileWaitingForSize:"\xCEn a\u0219teptarea dimensiunii",labelFileSizeNotAvailable:"Dimensiunea nu este diponibil\u0103",labelFileLoading:"Se \xEEncarc\u0103",labelFileLoadError:"Eroare la \xEEnc\u0103rcare",labelFileProcessing:"Se \xEEncarc\u0103",labelFileProcessingComplete:"\xCEnc\u0103rcare finalizat\u0103",labelFileProcessingAborted:"\xCEnc\u0103rcare anulat\u0103",labelFileProcessingError:"Eroare la \xEEnc\u0103rcare",labelFileProcessingRevertError:"Eroare la anulare",labelFileRemoveError:"Eroare la \u015Ftergere",labelTapToCancel:"apas\u0103 pentru a anula",labelTapToRetry:"apas\u0103 pentru a re\xEEncerca",labelTapToUndo:"apas\u0103 pentru a anula",labelButtonRemoveItem:"\u015Eterge",labelButtonAbortItemLoad:"Anuleaz\u0103",labelButtonRetryItemLoad:"Re\xEEncearc\u0103",labelButtonAbortItemProcessing:"Anuleaz\u0103",labelButtonUndoItemProcessing:"Anuleaz\u0103",labelButtonRetryItemProcessing:"Re\xEEncearc\u0103",labelButtonProcessItem:"\xCEncarc\u0103",labelMaxFileSizeExceeded:"Fi\u0219ierul este prea mare",labelMaxFileSize:"Dimensiunea maxim\u0103 a unui fi\u0219ier este de {filesize}",labelMaxTotalFileSizeExceeded:"Dimensiunea total\u0103 maxim\u0103 a fost dep\u0103\u0219it\u0103",labelMaxTotalFileSize:"Dimensiunea total\u0103 maxim\u0103 a fi\u0219ierelor este de {filesize}",labelFileTypeNotAllowed:"Tipul fi\u0219ierului nu este valid",fileValidateTypeLabelExpectedTypes:"Se a\u0219teapt\u0103 {allButLastType} sau {lastType}",imageValidateSizeLabelFormatError:"Formatul imaginii nu este acceptat",imageValidateSizeLabelImageSizeTooSmall:"Imaginea este prea mic\u0103",imageValidateSizeLabelImageSizeTooBig:"Imaginea este prea mare",imageValidateSizeLabelExpectedMinSize:"M\u0103rimea minim\u0103 este de {maxWidth} x {maxHeight}",imageValidateSizeLabelExpectedMaxSize:"M\u0103rimea maxim\u0103 este de {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rezolu\u021Bia este prea mic\u0103",imageValidateSizeLabelImageResolutionTooHigh:"Rezolu\u021Bia este prea mare",imageValidateSizeLabelExpectedMinResolution:"Rezolu\u021Bia minim\u0103 este de {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Rezolu\u021Bia maxim\u0103 este de {maxResolution}"};var jl={labelIdle:'\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B \u0438\u043B\u0438 \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 ',labelInvalidField:"\u041F\u043E\u043B\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435 \u0444\u0430\u0439\u043B\u044B",labelFileWaitingForSize:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0440\u0430\u0437\u043C\u0435\u0440",labelFileSizeNotAvailable:"\u0420\u0430\u0437\u043C\u0435\u0440 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",labelFileLoading:"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435",labelFileLoadError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0438",labelFileProcessing:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",labelFileProcessingComplete:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430",labelFileProcessingAborted:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430",labelFileProcessingError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435",labelFileProcessingRevertError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0435",labelFileRemoveError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0438",labelTapToCancel:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B",labelTapToRetry:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelTapToUndo:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",labelButtonRemoveItem:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",labelButtonAbortItemLoad:"\u041F\u0440\u0435\u043A\u0440\u0430\u0449\u0435\u043D\u043E",labelButtonRetryItemLoad:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelButtonAbortItemProcessing:"\u041E\u0442\u043C\u0435\u043D\u0430",labelButtonUndoItemProcessing:"\u041E\u0442\u043C\u0435\u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",labelButtonRetryItemProcessing:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelButtonProcessItem:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",labelMaxFileSizeExceeded:"\u0424\u0430\u0439\u043B \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439",labelMaxFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}",labelMaxTotalFileSizeExceeded:"\u041F\u0440\u0435\u0432\u044B\u0448\u0435\u043D \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440",labelMaxTotalFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}",labelFileTypeNotAllowed:"\u0424\u0430\u0439\u043B \u043D\u0435\u0432\u0435\u0440\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430",fileValidateTypeLabelExpectedTypes:"\u041E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F {allButLastType} \u0438\u043B\u0438 {lastType}",imageValidateSizeLabelFormatError:"\u0422\u0438\u043F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",imageValidateSizeLabelImageSizeTooSmall:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435",imageValidateSizeLabelImageSizeTooBig:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435",imageValidateSizeLabelExpectedMinSize:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043D\u0438\u0437\u043A\u043E\u0435",imageValidateSizeLabelImageResolutionTooHigh:"\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0432\u044B\u0441\u043E\u043A\u043E\u0435",imageValidateSizeLabelExpectedMinResolution:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {maxResolution}"};var ql={labelIdle:'Drag och sl\xE4pp dina filer eller Bl\xE4ddra ',labelInvalidField:"F\xE4ltet inneh\xE5ller felaktiga filer",labelFileWaitingForSize:"V\xE4ntar p\xE5 storlek",labelFileSizeNotAvailable:"Storleken finns inte tillg\xE4nglig",labelFileLoading:"Laddar",labelFileLoadError:"Fel under laddning",labelFileProcessing:"Laddar upp",labelFileProcessingComplete:"Uppladdning klar",labelFileProcessingAborted:"Uppladdning avbruten",labelFileProcessingError:"Fel under uppladdning",labelFileProcessingRevertError:"Fel under \xE5terst\xE4llning",labelFileRemoveError:"Fel under borttagning",labelTapToCancel:"tryck f\xF6r att avbryta",labelTapToRetry:"tryck f\xF6r att f\xF6rs\xF6ka igen",labelTapToUndo:"tryck f\xF6r att \xE5ngra",labelButtonRemoveItem:"Tabort",labelButtonAbortItemLoad:"Avbryt",labelButtonRetryItemLoad:"F\xF6rs\xF6k igen",labelButtonAbortItemProcessing:"Avbryt",labelButtonUndoItemProcessing:"\xC5ngra",labelButtonRetryItemProcessing:"F\xF6rs\xF6k igen",labelButtonProcessItem:"Ladda upp",labelMaxFileSizeExceeded:"Filen \xE4r f\xF6r stor",labelMaxFileSize:"St\xF6rsta till\xE5tna filstorlek \xE4r {filesize}",labelMaxTotalFileSizeExceeded:"Maximal uppladdningsstorlek uppn\xE5d",labelMaxTotalFileSize:"Maximal uppladdningsstorlek \xE4r {filesize}",labelFileTypeNotAllowed:"Felaktig filtyp",fileValidateTypeLabelExpectedTypes:"Godk\xE4nda filtyper {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Bildtypen saknar st\xF6d",imageValidateSizeLabelImageSizeTooSmall:"Bilden \xE4r f\xF6r liten",imageValidateSizeLabelImageSizeTooBig:"Bilden \xE4r f\xF6r stor",imageValidateSizeLabelExpectedMinSize:"Minimal storlek \xE4r {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximal storlek \xE4r {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Uppl\xF6sningen \xE4r f\xF6r l\xE5g",imageValidateSizeLabelImageResolutionTooHigh:"Uppl\xF6sningen \xE4r f\xF6r h\xF6g",imageValidateSizeLabelExpectedMinResolution:"Minsta till\xE5tna uppl\xF6sning \xE4r {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"H\xF6gsta till\xE5tna uppl\xF6sning \xE4r {maxResolution}"};var Yl={labelIdle:'Dosyan\u0131z\u0131 S\xFCr\xFCkleyin & B\u0131rak\u0131n ya da Se\xE7in ',labelInvalidField:"Alan ge\xE7ersiz dosyalar i\xE7eriyor",labelFileWaitingForSize:"Boyut hesaplan\u0131yor",labelFileSizeNotAvailable:"Boyut mevcut de\u011Fil",labelFileLoading:"Y\xFCkleniyor",labelFileLoadError:"Y\xFCkleme s\u0131ras\u0131nda hata olu\u015Ftu",labelFileProcessing:"Y\xFCkleniyor",labelFileProcessingComplete:"Y\xFCkleme tamamland\u0131",labelFileProcessingAborted:"Y\xFCkleme iptal edildi",labelFileProcessingError:"Y\xFCklerken hata olu\u015Ftu",labelFileProcessingRevertError:"Geri \xE7ekerken hata olu\u015Ftu",labelFileRemoveError:"Kald\u0131r\u0131rken hata olu\u015Ftu",labelTapToCancel:"\u0130ptal etmek i\xE7in t\u0131klay\u0131n",labelTapToRetry:"Tekrar denemek i\xE7in t\u0131klay\u0131n",labelTapToUndo:"Geri almak i\xE7in t\u0131klay\u0131n",labelButtonRemoveItem:"Kald\u0131r",labelButtonAbortItemLoad:"\u0130ptal Et",labelButtonRetryItemLoad:"Tekrar dene",labelButtonAbortItemProcessing:"\u0130ptal et",labelButtonUndoItemProcessing:"Geri Al",labelButtonRetryItemProcessing:"Tekrar dene",labelButtonProcessItem:"Y\xFCkle",labelMaxFileSizeExceeded:"Dosya \xE7ok b\xFCy\xFCk",labelMaxFileSize:"En fazla dosya boyutu: {filesize}",labelMaxTotalFileSizeExceeded:"Maximum boyut a\u015F\u0131ld\u0131",labelMaxTotalFileSize:"Maximum dosya boyutu :{filesize}",labelFileTypeNotAllowed:"Ge\xE7ersiz dosya tipi",fileValidateTypeLabelExpectedTypes:"\u015Eu {allButLastType} ya da \u015Fu dosya olmas\u0131 gerekir: {lastType}",imageValidateSizeLabelFormatError:"Resim tipi desteklenmiyor",imageValidateSizeLabelImageSizeTooSmall:"Resim \xE7ok k\xFC\xE7\xFCk",imageValidateSizeLabelImageSizeTooBig:"Resim \xE7ok b\xFCy\xFCk",imageValidateSizeLabelExpectedMinSize:"Minimum boyut {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum boyut {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok d\xFC\u015F\xFCk",imageValidateSizeLabelImageResolutionTooHigh:"\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok y\xFCksek",imageValidateSizeLabelExpectedMinResolution:"Minimum \xE7\xF6z\xFCn\xFCrl\xFCk {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximum \xE7\xF6z\xFCn\xFCrl\xFCk {maxResolution}"};var $l={labelIdle:'\u041F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0444\u0430\u0439\u043B\u0438 \u0430\u0431\u043E \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044C ',labelInvalidField:"\u041F\u043E\u043B\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u0456 \u0444\u0430\u0439\u043B\u0438",labelFileWaitingForSize:"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0440\u043E\u0437\u043C\u0456\u0440",labelFileSizeNotAvailable:"\u0420\u043E\u0437\u043C\u0456\u0440 \u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439",labelFileLoading:"\u041E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u044F",labelFileLoadError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u0456",labelFileProcessing:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",labelFileProcessingComplete:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",labelFileProcessingAborted:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0441\u043A\u0430\u0441\u043E\u0432\u0430\u043D\u043E",labelFileProcessingError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u0456",labelFileProcessingRevertError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u0456",labelFileRemoveError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u0456",labelTapToCancel:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelTapToRetry:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelTapToUndo:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0432\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E",labelButtonRemoveItem:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",labelButtonAbortItemLoad:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelButtonRetryItemLoad:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelButtonAbortItemProcessing:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelButtonUndoItemProcessing:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E",labelButtonRetryItemProcessing:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelButtonProcessItem:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",labelMaxFileSizeExceeded:"\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439",labelMaxFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0444\u0430\u0439\u043B\u0443: {filesize}",labelMaxTotalFileSizeExceeded:"\u041F\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043D\u043E \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440",labelMaxTotalFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {filesize}",labelFileTypeNotAllowed:"\u0424\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0443 \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F",fileValidateTypeLabelExpectedTypes:"\u041E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F {allButLastType} \u0430\u0431\u043E {lastType}",imageValidateSizeLabelFormatError:"\u0424\u043E\u0440\u043C\u0430\u0442 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F",imageValidateSizeLabelImageSizeTooSmall:"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0435",imageValidateSizeLabelImageSizeTooBig:"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435",imageValidateSizeLabelExpectedMinSize:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0456",imageValidateSizeLabelImageResolutionTooHigh:"\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0456",imageValidateSizeLabelExpectedMinResolution:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {maxResolution}"};var Xl={labelIdle:'K\xE9o th\u1EA3 t\u1EC7p c\u1EE7a b\u1EA1n ho\u1EB7c T\xECm ki\u1EBFm ',labelInvalidField:"Tr\u01B0\u1EDDng ch\u1EE9a c\xE1c t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7",labelFileWaitingForSize:"\u0110ang ch\u1EDD k\xEDch th\u01B0\u1EDBc",labelFileSizeNotAvailable:"K\xEDch th\u01B0\u1EDBc kh\xF4ng c\xF3 s\u1EB5n",labelFileLoading:"\u0110ang t\u1EA3i",labelFileLoadError:"L\u1ED7i khi t\u1EA3i",labelFileProcessing:"\u0110ang t\u1EA3i l\xEAn",labelFileProcessingComplete:"T\u1EA3i l\xEAn th\xE0nh c\xF4ng",labelFileProcessingAborted:"\u0110\xE3 hu\u1EF7 t\u1EA3i l\xEAn",labelFileProcessingError:"L\u1ED7i khi t\u1EA3i l\xEAn",labelFileProcessingRevertError:"L\u1ED7i khi ho\xE0n nguy\xEAn",labelFileRemoveError:"L\u1ED7i khi x\xF3a",labelTapToCancel:"nh\u1EA5n \u0111\u1EC3 h\u1EE7y",labelTapToRetry:"nh\u1EA5n \u0111\u1EC3 th\u1EED l\u1EA1i",labelTapToUndo:"nh\u1EA5n \u0111\u1EC3 ho\xE0n t\xE1c",labelButtonRemoveItem:"Xo\xE1",labelButtonAbortItemLoad:"Hu\u1EF7 b\u1ECF",labelButtonRetryItemLoad:"Th\u1EED l\u1EA1i",labelButtonAbortItemProcessing:"H\u1EE7y b\u1ECF",labelButtonUndoItemProcessing:"Ho\xE0n t\xE1c",labelButtonRetryItemProcessing:"Th\u1EED l\u1EA1i",labelButtonProcessItem:"T\u1EA3i l\xEAn",labelMaxFileSizeExceeded:"T\u1EADp tin qu\xE1 l\u1EDBn",labelMaxFileSize:"K\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}",labelMaxTotalFileSizeExceeded:"\u0110\xE3 v\u01B0\u1EE3t qu\xE1 t\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a",labelMaxTotalFileSize:"T\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}",labelFileTypeNotAllowed:"T\u1EC7p thu\u1ED9c lo\u1EA1i kh\xF4ng h\u1EE3p l\u1EC7",fileValidateTypeLabelExpectedTypes:"Ki\u1EC3u t\u1EC7p h\u1EE3p l\u1EC7 l\xE0 {allButLastType} ho\u1EB7c {lastType}",imageValidateSizeLabelFormatError:"Lo\u1EA1i h\xECnh \u1EA3nh kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3",imageValidateSizeLabelImageSizeTooSmall:"H\xECnh \u1EA3nh qu\xE1 nh\u1ECF",imageValidateSizeLabelImageSizeTooBig:"H\xECnh \u1EA3nh qu\xE1 l\u1EDBn",imageValidateSizeLabelExpectedMinSize:"K\xEDch th\u01B0\u1EDBc t\u1ED1i thi\u1EC3u l\xE0 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"K\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a l\xE0 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 th\u1EA5p",imageValidateSizeLabelImageResolutionTooHigh:"\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 cao",imageValidateSizeLabelExpectedMinResolution:"\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i thi\u1EC3u l\xE0 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i \u0111a l\xE0 {maxResolution}"};var Ql={labelIdle:'\u62D6\u653E\u6587\u4EF6\uFF0C\u6216\u8005 \u6D4F\u89C8 ',labelInvalidField:"\u5B57\u6BB5\u5305\u542B\u65E0\u6548\u6587\u4EF6",labelFileWaitingForSize:"\u8BA1\u7B97\u6587\u4EF6\u5927\u5C0F",labelFileSizeNotAvailable:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u53EF\u7528",labelFileLoading:"\u52A0\u8F7D",labelFileLoadError:"\u52A0\u8F7D\u9519\u8BEF",labelFileProcessing:"\u4E0A\u4F20",labelFileProcessingComplete:"\u5DF2\u4E0A\u4F20",labelFileProcessingAborted:"\u4E0A\u4F20\u5DF2\u53D6\u6D88",labelFileProcessingError:"\u4E0A\u4F20\u51FA\u9519",labelFileProcessingRevertError:"\u8FD8\u539F\u51FA\u9519",labelFileRemoveError:"\u5220\u9664\u51FA\u9519",labelTapToCancel:"\u70B9\u51FB\u53D6\u6D88",labelTapToRetry:"\u70B9\u51FB\u91CD\u8BD5",labelTapToUndo:"\u70B9\u51FB\u64A4\u6D88",labelButtonRemoveItem:"\u5220\u9664",labelButtonAbortItemLoad:"\u4E2D\u6B62",labelButtonRetryItemLoad:"\u91CD\u8BD5",labelButtonAbortItemProcessing:"\u53D6\u6D88",labelButtonUndoItemProcessing:"\u64A4\u6D88",labelButtonRetryItemProcessing:"\u91CD\u8BD5",labelButtonProcessItem:"\u4E0A\u4F20",labelMaxFileSizeExceeded:"\u6587\u4EF6\u592A\u5927",labelMaxFileSize:"\u6700\u5927\u503C: {filesize}",labelMaxTotalFileSizeExceeded:"\u8D85\u8FC7\u6700\u5927\u6587\u4EF6\u5927\u5C0F",labelMaxTotalFileSize:"\u6700\u5927\u6587\u4EF6\u5927\u5C0F\uFF1A{filesize}",labelFileTypeNotAllowed:"\u6587\u4EF6\u7C7B\u578B\u65E0\u6548",fileValidateTypeLabelExpectedTypes:"\u5E94\u4E3A {allButLastType} \u6216 {lastType}",imageValidateSizeLabelFormatError:"\u4E0D\u652F\u6301\u56FE\u50CF\u7C7B\u578B",imageValidateSizeLabelImageSizeTooSmall:"\u56FE\u50CF\u592A\u5C0F",imageValidateSizeLabelImageSizeTooBig:"\u56FE\u50CF\u592A\u5927",imageValidateSizeLabelExpectedMinSize:"\u6700\u5C0F\u503C: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u6700\u5927\u503C: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u5206\u8FA8\u7387\u592A\u4F4E",imageValidateSizeLabelImageResolutionTooHigh:"\u5206\u8FA8\u7387\u592A\u9AD8",imageValidateSizeLabelExpectedMinResolution:"\u6700\u5C0F\u5206\u8FA8\u7387\uFF1A{minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u6700\u5927\u5206\u8FA8\u7387\uFF1A{maxResolution}"};var Zl={labelIdle:'\u62D6\u653E\u6A94\u6848\uFF0C\u6216\u8005 \u700F\u89BD ',labelInvalidField:"\u4E0D\u652F\u63F4\u6B64\u6A94\u6848",labelFileWaitingForSize:"\u6B63\u5728\u8A08\u7B97\u6A94\u6848\u5927\u5C0F",labelFileSizeNotAvailable:"\u6A94\u6848\u5927\u5C0F\u4E0D\u7B26",labelFileLoading:"\u8B80\u53D6\u4E2D",labelFileLoadError:"\u8B80\u53D6\u932F\u8AA4",labelFileProcessing:"\u4E0A\u50B3",labelFileProcessingComplete:"\u5DF2\u4E0A\u50B3",labelFileProcessingAborted:"\u4E0A\u50B3\u5DF2\u53D6\u6D88",labelFileProcessingError:"\u4E0A\u50B3\u767C\u751F\u932F\u8AA4",labelFileProcessingRevertError:"\u9084\u539F\u932F\u8AA4",labelFileRemoveError:"\u522A\u9664\u932F\u8AA4",labelTapToCancel:"\u9EDE\u64CA\u53D6\u6D88",labelTapToRetry:"\u9EDE\u64CA\u91CD\u8A66",labelTapToUndo:"\u9EDE\u64CA\u9084\u539F",labelButtonRemoveItem:"\u522A\u9664",labelButtonAbortItemLoad:"\u505C\u6B62",labelButtonRetryItemLoad:"\u91CD\u8A66",labelButtonAbortItemProcessing:"\u53D6\u6D88",labelButtonUndoItemProcessing:"\u53D6\u6D88",labelButtonRetryItemProcessing:"\u91CD\u8A66",labelButtonProcessItem:"\u4E0A\u50B3",labelMaxFileSizeExceeded:"\u6A94\u6848\u904E\u5927",labelMaxFileSize:"\u6700\u5927\u503C\uFF1A{filesize}",labelMaxTotalFileSizeExceeded:"\u8D85\u904E\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F",labelMaxTotalFileSize:"\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F\uFF1A{filesize}",labelFileTypeNotAllowed:"\u4E0D\u652F\u63F4\u6B64\u985E\u578B\u6A94\u6848",fileValidateTypeLabelExpectedTypes:"\u61C9\u70BA {allButLastType} \u6216 {lastType}",imageValidateSizeLabelFormatError:"\u4E0D\u652F\u6301\u6B64\u985E\u5716\u7247\u985E\u578B",imageValidateSizeLabelImageSizeTooSmall:"\u5716\u7247\u904E\u5C0F",imageValidateSizeLabelImageSizeTooBig:"\u5716\u7247\u904E\u5927",imageValidateSizeLabelExpectedMinSize:"\u6700\u5C0F\u5C3A\u5BF8\uFF1A{minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u6700\u5927\u5C3A\u5BF8\uFF1A{maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u89E3\u6790\u5EA6\u904E\u4F4E",imageValidateSizeLabelImageResolutionTooHigh:"\u89E3\u6790\u5EA6\u904E\u9AD8",imageValidateSizeLabelExpectedMinResolution:"\u6700\u4F4E\u89E3\u6790\u5EA6\uFF1A{minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u6700\u9AD8\u89E3\u6790\u5EA6\uFF1A{maxResolution}"};ve(Wo);ve(jo);ve($o);ve(Qo);ve(el);ve(pl);ve(ul);ve(Rl);ve(Ma);window.FilePond=na;function uf({acceptedFileTypes:e,imageEditorEmptyFillColor:t,imageEditorMode:i,imageEditorViewportHeight:a,imageEditorViewportWidth:n,deleteUploadedFileUsing:o,isDeletable:l,isDisabled:r,getUploadedFilesUsing:s,imageCropAspectRatio:p,imagePreviewHeight:c,imageResizeMode:d,imageResizeTargetHeight:m,imageResizeTargetWidth:u,imageResizeUpscale:f,isAvatar:h,hasImageEditor:g,hasCircleCropper:I,canEditSvgs:E,isSvgEditingConfirmed:T,confirmSvgEditingMessage:v,disabledSvgEditingMessage:y,isDownloadable:b,isMultiple:w,isOpenable:x,isPreviewable:_,isReorderable:P,itemPanelAspectRatio:O,loadingIndicatorPosition:M,locale:C,maxFiles:S,maxSize:F,minSize:R,panelAspectRatio:L,panelLayout:z,placeholder:D,removeUploadedFileButtonPosition:k,removeUploadedFileUsing:B,reorderUploadedFilesUsing:X,shouldAppendFiles:Y,shouldOrientImageFromExif:Q,shouldTransformImage:pe,state:G,uploadButtonPosition:H,uploadingMessage:q,uploadProgressIndicatorPosition:re,uploadUsing:ee}){return{fileKeyIndex:{},pond:null,shouldUpdateState:!0,state:G,lastState:null,error:null,uploadedFileIndex:{},isEditorOpen:!1,editingFile:{},currentRatio:"",editor:{},init:async function(){Dt(Kl[C]??Kl.en),this.pond=ut(this.$refs.input,{acceptedFileTypes:e,allowImageExifOrientation:Q,allowPaste:!1,allowRemove:l,allowReorder:P,allowImagePreview:_,allowVideoPreview:_,allowAudioPreview:_,allowImageTransform:pe,credits:!1,files:await this.getFiles(),imageCropAspectRatio:p,imagePreviewHeight:c,imageResizeTargetHeight:m,imageResizeTargetWidth:u,imageResizeMode:d,imageResizeUpscale:f,itemInsertLocation:Y?"after":"before",...D&&{labelIdle:D},maxFiles:S,maxFileSize:F,minFileSize:R,styleButtonProcessItemPosition:H,styleButtonRemoveItemPosition:k,styleItemPanelAspectRatio:O,styleLoadIndicatorPosition:M,stylePanelAspectRatio:L,stylePanelLayout:z,styleProgressIndicatorPosition:re,server:{load:async(N,U)=>{let Z=await(await fetch(N,{cache:"no-store"})).blob();U(Z)},process:(N,U,$,Z,Ve,Ge)=>{this.shouldUpdateState=!1;let Xt=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,Qt=>(Qt^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Qt/4).toString(16));ee(Xt,U,Qt=>{this.shouldUpdateState=!0,Z(Qt)},Ve,Ge)},remove:async(N,U)=>{let $=this.uploadedFileIndex[N]??null;$&&(await o($),U())},revert:async(N,U)=>{await B(N),U()}},allowImageEdit:g,imageEditEditor:{open:N=>this.loadEditor(N),onconfirm:()=>{},oncancel:()=>this.closeEditor(),onclose:()=>this.closeEditor()},fileValidateTypeDetectType:(N,U)=>new Promise(($,Z)=>{let Ve=U||Go.getType(N.name.split(".").pop());Ve?$(Ve):Z()})}),this.$watch("state",async()=>{if(this.pond&&this.shouldUpdateState&&this.state!==void 0){if(this.state!==null&&Object.values(this.state).filter(N=>N.startsWith("livewire-file:")).length){this.lastState=null;return}JSON.stringify(this.state)!==this.lastState&&(this.lastState=JSON.stringify(this.state),this.pond.files=await this.getFiles())}}),this.pond.on("reorderfiles",async N=>{let U=N.map($=>$.source instanceof File?$.serverId:this.uploadedFileIndex[$.source]??null).filter($=>$);await X(Y?U:U.reverse())}),this.pond.on("initfile",async N=>{b&&(h||this.insertDownloadLink(N))}),this.pond.on("initfile",async N=>{x&&(h||this.insertOpenLink(N))}),this.pond.on("addfilestart",async N=>{N.status===Et.PROCESSING_QUEUED&&this.dispatchFormEvent("form-processing-started",{message:q})});let V=async()=>{this.pond.getFiles().filter(N=>N.status===Et.PROCESSING||N.status===Et.PROCESSING_QUEUED).length||this.dispatchFormEvent("form-processing-finished")};this.pond.on("processfile",V),this.pond.on("processfileabort",V),this.pond.on("processfilerevert",V),z==="compact circle"&&(this.pond.on("error",N=>{this.error=`${N.main}: ${N.sub}`.replace("Expects or","Expects")}),this.pond.on("removefile",()=>this.error=null))},destroy:function(){this.destroyEditor(),ft(this.$refs.input),this.pond=null},dispatchFormEvent:function(V,N={}){this.$el.closest("form")?.dispatchEvent(new CustomEvent(V,{composed:!0,cancelable:!0,detail:N}))},getUploadedFiles:async function(){let V=await s();this.fileKeyIndex=V??{},this.uploadedFileIndex=Object.entries(this.fileKeyIndex).filter(([N,U])=>U?.url).reduce((N,[U,$])=>(N[$.url]=U,N),{})},getFiles:async function(){await this.getUploadedFiles();let V=[];for(let N of Object.values(this.fileKeyIndex))N&&V.push({source:N.url,options:{type:"local",...!N.type||_&&(/^audio/.test(N.type)||/^image/.test(N.type)||/^video/.test(N.type))?{}:{file:{name:N.name,size:N.size,type:N.type}}}});return Y?V:V.reverse()},insertDownloadLink:function(V){if(V.origin!==zt.LOCAL)return;let N=this.getDownloadLink(V);N&&document.getElementById(`filepond--item-${V.id}`).querySelector(".filepond--file-info-main").prepend(N)},insertOpenLink:function(V){if(V.origin!==zt.LOCAL)return;let N=this.getOpenLink(V);N&&document.getElementById(`filepond--item-${V.id}`).querySelector(".filepond--file-info-main").prepend(N)},getDownloadLink:function(V){let N=V.source;if(!N)return;let U=document.createElement("a");return U.className="filepond--download-icon",U.href=N,U.download=V.file.name,U},getOpenLink:function(V){let N=V.source;if(!N)return;let U=document.createElement("a");return U.className="filepond--open-icon",U.href=N,U.target="_blank",U},initEditor:function(){r||g&&(this.editor=new xa(this.$refs.editor,{aspectRatio:n/a,autoCropArea:1,center:!0,crop:V=>{this.$refs.xPositionInput.value=Math.round(V.detail.x),this.$refs.yPositionInput.value=Math.round(V.detail.y),this.$refs.heightInput.value=Math.round(V.detail.height),this.$refs.widthInput.value=Math.round(V.detail.width),this.$refs.rotationInput.value=V.detail.rotate},cropBoxResizable:!0,guides:!0,highlight:!0,responsive:!0,toggleDragModeOnDblclick:!0,viewMode:i,wheelZoomRatio:.02}))},closeEditor:function(){this.editingFile={},this.isEditorOpen=!1,this.destroyEditor()},fixImageDimensions:function(V,N){if(V.type!=="image/svg+xml")return N(V);let U=new FileReader;U.onload=$=>{let Z=new DOMParser().parseFromString($.target.result,"image/svg+xml")?.querySelector("svg");if(!Z)return N(V);let Ve=["viewBox","ViewBox","viewbox"].find(Xt=>Z.hasAttribute(Xt));if(!Ve)return N(V);let Ge=Z.getAttribute(Ve).split(" ");return!Ge||Ge.length!==4?N(V):(Z.setAttribute("width",parseFloat(Ge[2])+"pt"),Z.setAttribute("height",parseFloat(Ge[3])+"pt"),N(new File([new Blob([new XMLSerializer().serializeToString(Z)],{type:"image/svg+xml"})],V.name,{type:"image/svg+xml",_relativePath:""})))},U.readAsText(V)},loadEditor:function(V){if(r||!g||!V)return;let N=V.type==="image/svg+xml";if(!E&&N){alert(y);return}T&&N&&!confirm(v)||this.fixImageDimensions(V,U=>{this.editingFile=U,this.initEditor();let $=new FileReader;$.onload=Z=>{this.isEditorOpen=!0,setTimeout(()=>this.editor.replace(Z.target.result),200)},$.readAsDataURL(V)})},getRoundedCanvas:function(V){let N=V.width,U=V.height,$=document.createElement("canvas");$.width=N,$.height=U;let Z=$.getContext("2d");return Z.imageSmoothingEnabled=!0,Z.drawImage(V,0,0,N,U),Z.globalCompositeOperation="destination-in",Z.beginPath(),Z.ellipse(N/2,U/2,N/2,U/2,0,0,2*Math.PI),Z.fill(),$},saveEditor:function(){if(r||!g)return;let V=this.editor.getCroppedCanvas({fillColor:t??"transparent",height:m,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",width:u});I&&(V=this.getRoundedCanvas(V)),V.toBlob(N=>{w&&this.pond.removeFile(this.pond.getFiles().find(U=>U.filename===this.editingFile.name)?.id,{revert:!0}),this.$nextTick(()=>{this.shouldUpdateState=!1;let U=this.editingFile.name.slice(0,this.editingFile.name.lastIndexOf(".")),$=this.editingFile.name.split(".").pop();$==="svg"&&($="png");let Z=/-v(\d+)/;Z.test(U)?U=U.replace(Z,(Ve,Ge)=>`-v${Number(Ge)+1}`):U+="-v1",this.pond.addFile(new File([N],`${U}.${$}`,{type:this.editingFile.type==="image/svg+xml"||I?"image/png":this.editingFile.type,lastModified:new Date().getTime()})).then(()=>{this.closeEditor()}).catch(()=>{this.closeEditor()})})},I?"image/png":this.editingFile.type)},destroyEditor:function(){this.editor&&typeof this.editor.destroy=="function"&&this.editor.destroy(),this.editor=null}}}var Kl={ar:wl,ca:Sl,ckb:Ll,cs:Al,da:Ml,de:Ol,en:Pl,es:Dl,fa:Fl,fi:zl,fr:Cl,hu:Nl,id:Bl,it:kl,km:Vl,nl:Gl,no:Ul,pl:Wl,pt_BR:Ri,pt_PT:Ri,ro:Hl,ru:jl,sv:ql,tr:Yl,uk:$l,vi:Xl,zh_CN:Ql,zh_TW:Zl};export{uf as default}; +`;n(q)},l.readAsText(e)}),Nu=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},Bu=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,f=null;if(u.forEach(h=>{h.type==="filter"&&(f=h)}),f){let h=null;u.forEach(g=>{g.type==="resize"&&(h=g)}),h&&(h.data.matrix=f.data,u=u.filter(g=>g.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,o=1;function l(d,m,u){let f=m[d]/255,h=m[d+1]/255,g=m[d+2]/255,v=m[d+3]/255,E=f*u[0]+h*u[1]+g*u[2]+v*u[3]+u[4],T=f*u[5]+h*u[6]+g*u[7]+v*u[8]+u[9],I=f*u[10]+h*u[11]+g*u[12]+v*u[13]+u[14],y=f*u[15]+h*u[16]+g*u[17]+v*u[18]+u[19],b=Math.max(0,E*y)+a*(1-y),w=Math.max(0,T*y)+n*(1-y),x=Math.max(0,I*y)+o*(1-y);m[d]=Math.max(0,Math.min(1,b))*255,m[d+1]=Math.max(0,Math.min(1,w))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,f=u.length,h=m[0],g=m[1],v=m[2],E=m[3],T=m[4],I=m[5],y=m[6],b=m[7],w=m[8],x=m[9],_=m[10],P=m[11],O=m[12],M=m[13],C=m[14],S=m[15],F=m[16],R=m[17],L=m[18],z=m[19],D=0,k=0,B=0,X=0,q=0,Q=0,pe=0,G=0,H=0,Y=0,le=0,ee=0;for(;D1&&f===!1)return p(d,v);h=d.width*S,g=d.height*S}let E=d.width,T=d.height,I=Math.round(h),y=Math.round(g),b=d.data,w=new Uint8ClampedArray(I*y*4),x=E/I,_=T/y,P=Math.ceil(x*.5),O=Math.ceil(_*.5);for(let M=0;M=-1&&le<=1&&(F=2*le*le*le-3*le*le+1,F>0)){Y=4*(H+q*E);let ee=b[Y+3];B+=F*ee,L+=F,ee<255&&(F=F*ee/250),z+=F*b[Y],D+=F*b[Y+1],k+=F*b[Y+2],R+=F}}}w[S]=z/R,w[S+1]=D/R,w[S+2]=k/R,w[S+3]=B/L,v&&l(S,w,v)}return{data:w,width:I,height:y}}},ku=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,o=!1;for(;i=65504&&a<=65519||a===65534)||(o||(o=ku(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},Gu=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(Vu(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),Uu=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,Wu=(e,t)=>{let i=Uu();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},Hu=()=>Math.random().toString(36).substr(2,9),ju=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(o,l,r)=>{let s=Hu();n[s]=l,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:o},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},Yu=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),qu=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.concat.bind(a))),Promise.resolve([])),$u=(e,t)=>new Promise(i=>{let a={width:e.width,height:e.height},n=e.getContext("2d"),o=t.sort(yl).map(l=>()=>new Promise(r=>{tf[l[0]](n,a,l[1],r)&&r()}));qu(o).then(()=>i(e))}),St=(e,t)=>{e.beginPath(),e.lineCap=t["stroke-linecap"],e.lineJoin=t["stroke-linejoin"],e.lineWidth=t["stroke-width"],t["stroke-dasharray"].length&&e.setLineDash(t["stroke-dasharray"].split(",")),e.fillStyle=t.fill,e.strokeStyle=t.stroke,e.globalAlpha=t.opacity||1},Lt=e=>{e.fill(),e.stroke(),e.globalAlpha=1},Xu=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);return St(e,n),e.rect(a.x,a.y,a.width,a.height),Lt(e,n),!0},Qu=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);St(e,n);let o=a.x,l=a.y,r=a.width,s=a.height,p=.5522848,c=r/2*p,d=s/2*p,m=o+r,u=l+s,f=o+r/2,h=l+s/2;return e.moveTo(o,h),e.bezierCurveTo(o,h-d,f-c,l,f,l),e.bezierCurveTo(f+c,l,m,h-d,m,h),e.bezierCurveTo(m,h+d,f+c,u,f,u),e.bezierCurveTo(f-c,u,o,h+d,o,h),Lt(e,n),!0},Zu=(e,t,i,a)=>{let n=wt(i,t),o=ct(i,t);St(e,o);let l=new Image;new URL(i.src,window.location.href).origin!==window.location.origin&&(l.crossOrigin=""),l.onload=()=>{if(i.fit==="cover"){let s=n.width/n.height,p=s>1?l.width:l.height*s,c=s>1?l.width/s:l.height,d=l.width*.5-p*.5,m=l.height*.5-c*.5;e.drawImage(l,d,m,p,c,n.x,n.y,n.width,n.height)}else if(i.fit==="contain"){let s=Math.min(n.width/l.width,n.height/l.height),p=s*l.width,c=s*l.height,d=n.x+n.width*.5-p*.5,m=n.y+n.height*.5-c*.5;e.drawImage(l,0,0,l.width,l.height,d,m,p,c)}else e.drawImage(l,0,0,l.width,l.height,n.x,n.y,n.width,n.height);Lt(e,o),a()},l.src=i.src},Ku=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);St(e,n);let o=me(i.fontSize,t),l=i.fontFamily||"sans-serif",r=i.fontWeight||"normal",s=i.textAlign||"left";return e.font=`${r} ${o}px ${l}`,e.textAlign=s,e.fillText(i.text,a.x,a.y),Lt(e,n),!0},Ju=(e,t,i)=>{let a=ct(i,t);St(e,a),e.beginPath();let n=i.points.map(l=>({x:me(l.x,t,1,"width"),y:me(l.y,t,1,"height")}));e.moveTo(n[0].x,n[0].y);let o=n.length;for(let l=1;l{let a=wt(i,t),n=ct(i,t);St(e,n),e.beginPath();let o={x:a.x,y:a.y},l={x:a.x+a.width,y:a.y+a.height};e.moveTo(o.x,o.y),e.lineTo(l.x,l.y);let r=xl({x:l.x-o.x,y:l.y-o.y}),s=.04*Math.min(t.width,t.height);if(i.lineDecoration.indexOf("arrow-begin")!==-1){let p=yi(r,s),c=_i(o,p),d=qe(o,2,c),m=qe(o,-2,c);e.moveTo(d.x,d.y),e.lineTo(o.x,o.y),e.lineTo(m.x,m.y)}if(i.lineDecoration.indexOf("arrow-end")!==-1){let p=yi(r,-s),c=_i(l,p),d=qe(l,2,c),m=qe(l,-2,c);e.moveTo(d.x,d.y),e.lineTo(l.x,l.y),e.lineTo(m.x,m.y)}return Lt(e,n),!0},tf={rect:Xu,ellipse:Qu,image:Zu,text:Ku,line:ef,path:Ju},af=e=>{let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t},nf=(e,t,i={})=>new Promise((a,n)=>{if(!e||!du(e))return n({status:"not an image file",file:e});let{stripImageHead:o,beforeCreateBlob:l,afterCreateBlob:r,canvasMemoryLimit:s}=i,{crop:p,size:c,filter:d,markup:m,output:u}=t,f=t.image&&t.image.orientation?Math.max(1,Math.min(8,t.image.orientation)):null,h=u&&u.quality,g=h===null?null:h/100,v=u&&u.type||null,E=u&&u.background||null,T=[];c&&(typeof c.width=="number"||typeof c.height=="number")&&T.push({type:"resize",data:c}),d&&d.length===20&&T.push({type:"filter",data:d});let I=w=>{let x=r?r(w):w;Promise.resolve(x).then(a)},y=(w,x)=>{let _=af(w),P=m.length?$u(_,m):_;Promise.resolve(P).then(O=>{Tu(O,x,l).then(M=>{if(Il(O),o)return I(M);Gu(e).then(C=>{C!==null&&(M=new Blob([C,M.slice(20)],{type:M.type})),I(M)})}).catch(n)})};if(/svg/.test(e.type)&&v===null)return Cu(e,p,m,{background:E}).then(w=>{a(Wu(w,"image/svg+xml"))});let b=URL.createObjectURL(e);Yu(b).then(w=>{URL.revokeObjectURL(b);let x=Eu(w,f,p,{canvasMemoryLimit:s,background:E}),_={quality:g,type:v||e.type};if(!T.length)return y(x,_);let P=ju(Bu);P.post({transforms:T,imageData:x},O=>{y(Nu(O),_),P.terminate()},[x.data.buffer])}).catch(n)}),of=["x","y","left","top","right","bottom","width","height"],lf=e=>typeof e=="string"&&/%/.test(e)?parseFloat(e)/100:e,rf=e=>{let[t,i]=e,a=i.points?{}:of.reduce((n,o)=>(n[o]=lf(i[o]),n),{});return[t,{zIndex:0,...i,...a}]},sf=e=>new Promise((t,i)=>{let a=new Image;a.src=URL.createObjectURL(e);let n=()=>{let l=a.naturalWidth,r=a.naturalHeight;l&&r&&(URL.revokeObjectURL(a.src),clearInterval(o),t({width:l,height:r}))};a.onerror=l=>{URL.revokeObjectURL(a.src),clearInterval(o),i(l)};let o=setInterval(n,1);n()});typeof window<"u"&&typeof window.document<"u"&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){let a=this;setTimeout(()=>{let n=a.toDataURL(t,i).split(",")[1],o=atob(n),l=o.length,r=new Uint8Array(l);for(;l--;)r[l]=o.charCodeAt(l);e(new Blob([r],{type:t||"image/png"}))})}}));var Sa=typeof window<"u"&&typeof window.document<"u",cf=Sa&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_l=({addFilter:e,utils:t})=>{let{Type:i,forin:a,getFileFromBlob:n,isFile:o}=t,l=["crop","resize","filter","markup","output"],r=c=>(d,m,u)=>d(m,c?c(u):u),s=c=>c.aspectRatio===null&&c.rotation===0&&c.zoom===1&&c.center&&c.center.x===.5&&c.center.y===.5&&c.flip&&c.flip.horizontal===!1&&c.flip.vertical===!1;e("SHOULD_PREPARE_OUTPUT",(c,{query:d})=>new Promise(m=>{m(!d("IS_ASYNC"))}));let p=(c,d,m)=>new Promise(u=>{if(!c("GET_ALLOW_IMAGE_TRANSFORM")||m.archived||!o(d)||!ou(d))return u(!1);sf(d).then(()=>{let f=c("GET_IMAGE_TRANSFORM_IMAGE_FILTER");if(f){let h=f(d);if(h==null)return handleRevert(!0);if(typeof h=="boolean")return u(h);if(typeof h.then=="function")return h.then(u)}u(!0)}).catch(f=>{u(!1)})});return e("DID_CREATE_ITEM",(c,{query:d,dispatch:m})=>{d("GET_ALLOW_IMAGE_TRANSFORM")&&c.extend("requestPrepare",()=>new Promise((u,f)=>{m("REQUEST_PREPARE_OUTPUT",{query:c.id,item:c,success:u,failure:f},!0)}))}),e("PREPARE_OUTPUT",(c,{query:d,item:m})=>new Promise(u=>{p(d,c,m).then(f=>{if(!f)return u(c);let h=[];d("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_ORIGINAL")&&h.push(()=>new Promise(x=>{x({name:d("GET_IMAGE_TRANSFORM_VARIANTS_ORIGINAL_NAME"),file:c})})),d("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_DEFAULT")&&h.push((x,_,P)=>new Promise(O=>{x(_,P).then(M=>O({name:d("GET_IMAGE_TRANSFORM_VARIANTS_DEFAULT_NAME"),file:M}))}));let g=d("GET_IMAGE_TRANSFORM_VARIANTS")||{};a(g,(x,_)=>{let P=r(_);h.push((O,M,C)=>new Promise(S=>{P(O,M,C).then(F=>S({name:x,file:F}))}))});let v=d("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY"),E=d("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY_MODE"),T=v===null?null:v/100,I=d("GET_IMAGE_TRANSFORM_OUTPUT_MIME_TYPE"),y=d("GET_IMAGE_TRANSFORM_CLIENT_TRANSFORMS")||l;m.setMetadata("output",{type:I,quality:T,client:y},!0);let b=(x,_)=>new Promise((P,O)=>{let M={..._};Object.keys(M).filter(B=>B!=="exif").forEach(B=>{y.indexOf(B)===-1&&delete M[B]});let{resize:C,exif:S,output:F,crop:R,filter:L,markup:z}=M,D={image:{orientation:S?S.orientation:null},output:F&&(F.type||typeof F.quality=="number"||F.background)?{type:F.type,quality:typeof F.quality=="number"?F.quality*100:null,background:F.background||d("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||null}:void 0,size:C&&(C.size.width||C.size.height)?{mode:C.mode,upscale:C.upscale,...C.size}:void 0,crop:R&&!s(R)?{...R}:void 0,markup:z&&z.length?z.map(rf):[],filter:L};if(D.output){let B=F.type?F.type!==x.type:!1,X=/\/jpe?g$/.test(x.type),q=F.quality!==null?X&&E==="always":!1;if(!!!(D.size||D.crop||D.filter||B||q))return P(x)}let k={beforeCreateBlob:d("GET_IMAGE_TRANSFORM_BEFORE_CREATE_BLOB"),afterCreateBlob:d("GET_IMAGE_TRANSFORM_AFTER_CREATE_BLOB"),canvasMemoryLimit:d("GET_IMAGE_TRANSFORM_CANVAS_MEMORY_LIMIT"),stripImageHead:d("GET_IMAGE_TRANSFORM_OUTPUT_STRIP_IMAGE_HEAD")};nf(x,D,k).then(B=>{let X=n(B,su(x.name,cu(B.type)));P(X)}).catch(O)}),w=h.map(x=>x(b,c,m.getMetadata()));Promise.all(w).then(x=>{u(x.length===1&&x[0].name===null?x[0].file:x)})})})),{options:{allowImageTransform:[!0,i.BOOLEAN],imageTransformImageFilter:[null,i.FUNCTION],imageTransformOutputMimeType:[null,i.STRING],imageTransformOutputQuality:[null,i.INT],imageTransformOutputStripImageHead:[!0,i.BOOLEAN],imageTransformClientTransforms:[null,i.ARRAY],imageTransformOutputQualityMode:["always",i.STRING],imageTransformVariants:[null,i.OBJECT],imageTransformVariantsIncludeDefault:[!0,i.BOOLEAN],imageTransformVariantsDefaultName:[null,i.STRING],imageTransformVariantsIncludeOriginal:[!1,i.BOOLEAN],imageTransformVariantsOriginalName:["original_",i.STRING],imageTransformBeforeCreateBlob:[null,i.FUNCTION],imageTransformAfterCreateBlob:[null,i.FUNCTION],imageTransformCanvasMemoryLimit:[Sa&&cf?4096*4096:null,i.INT],imageTransformCanvasBackgroundColor:[null,i.STRING]}}};Sa&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_l}));var Rl=_l;var La=e=>/^video/.test(e.type),$t=e=>/^audio/.test(e.type),Aa=class{constructor(t,i){this.mediaEl=t,this.audioElems=i,this.onplayhead=!1,this.duration=0,this.timelineWidth=this.audioElems.timeline.offsetWidth-this.audioElems.playhead.offsetWidth,this.moveplayheadFn=this.moveplayhead.bind(this),this.registerListeners()}registerListeners(){this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1),this.mediaEl.addEventListener("canplaythrough",()=>this.duration=this.mediaEl.duration,!1),this.audioElems.timeline.addEventListener("click",this.timelineClicked.bind(this),!1),this.audioElems.button.addEventListener("click",this.play.bind(this)),this.audioElems.playhead.addEventListener("mousedown",this.mouseDown.bind(this),!1),window.addEventListener("mouseup",this.mouseUp.bind(this),!1)}play(){this.mediaEl.paused?this.mediaEl.play():this.mediaEl.pause(),this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause")}timeUpdate(){let t=this.mediaEl.currentTime/this.duration*100;this.audioElems.playhead.style.marginLeft=t+"%",this.mediaEl.currentTime===this.duration&&(this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause"))}moveplayhead(t){let i=t.clientX-this.getPosition(this.audioElems.timeline);i>=0&&i<=this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=i+"px"),i<0&&(this.audioElems.playhead.style.marginLeft="0px"),i>this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=this.timelineWidth-4+"px")}timelineClicked(t){this.moveplayhead(t),this.mediaEl.currentTime=this.duration*this.clickPercent(t)}mouseDown(){this.onplayhead=!0,window.addEventListener("mousemove",this.moveplayheadFn,!0),this.mediaEl.removeEventListener("timeupdate",this.timeUpdate.bind(this),!1)}mouseUp(t){window.removeEventListener("mousemove",this.moveplayheadFn,!0),this.onplayhead==!0&&(this.moveplayhead(t),this.mediaEl.currentTime=this.duration*this.clickPercent(t),this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1)),this.onplayhead=!1}clickPercent(t){return(t.clientX-this.getPosition(this.audioElems.timeline))/this.timelineWidth}getPosition(t){return t.getBoundingClientRect().left}},df=e=>e.utils.createView({name:"media-preview",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let{id:a}=i,n=t.query("GET_ITEM",{id:i.id}),o=$t(n.file)?"audio":"video";if(t.ref.media=document.createElement(o),t.ref.media.setAttribute("controls",!0),t.element.appendChild(t.ref.media),$t(n.file)){let l=document.createDocumentFragment();t.ref.audio=[],t.ref.audio.container=document.createElement("div"),t.ref.audio.button=document.createElement("span"),t.ref.audio.timeline=document.createElement("div"),t.ref.audio.playhead=document.createElement("div"),t.ref.audio.container.className="audioplayer",t.ref.audio.button.className="playpausebtn play",t.ref.audio.timeline.className="timeline",t.ref.audio.playhead.className="playhead",t.ref.audio.timeline.appendChild(t.ref.audio.playhead),t.ref.audio.container.appendChild(t.ref.audio.button),t.ref.audio.container.appendChild(t.ref.audio.timeline),l.appendChild(t.ref.audio.container),t.element.appendChild(l)}},write:e.utils.createRoute({DID_MEDIA_PREVIEW_LOAD:({root:t,props:i})=>{let{id:a}=i,n=t.query("GET_ITEM",{id:i.id});if(!n)return;let o=window.URL||window.webkitURL,l=new Blob([n.file],{type:n.file.type});t.ref.media.type=n.file.type,t.ref.media.src=n.file.mock&&n.file.url||o.createObjectURL(l),$t(n.file)&&new Aa(t.ref.media,t.ref.audio),t.ref.media.addEventListener("loadeddata",()=>{let r=75;if(La(n.file)){let s=t.ref.media.offsetWidth,p=t.ref.media.videoWidth/s;r=t.ref.media.videoHeight/p}t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:r})},!1)}})}),pf=e=>{let t=({root:a,props:n})=>{let{id:o}=n;a.query("GET_ITEM",o)&&a.dispatch("DID_MEDIA_PREVIEW_LOAD",{id:o})},i=({root:a,props:n})=>{let o=df(e);a.ref.media=a.appendChildView(a.createChildView(o,{id:n.id}))};return e.utils.createView({name:"media-preview-wrapper",create:i,write:e.utils.createRoute({DID_MEDIA_PREVIEW_CONTAINER_CREATE:t})})},Ma=e=>{let{addFilter:t,utils:i}=e,{Type:a,createRoute:n}=i,o=pf(e);return t("CREATE_VIEW",l=>{let{is:r,view:s,query:p}=l;if(!r("file"))return;let c=({root:d,props:m})=>{let{id:u}=m,f=p("GET_ITEM",u),h=p("GET_ALLOW_VIDEO_PREVIEW"),g=p("GET_ALLOW_AUDIO_PREVIEW");!f||f.archived||(!La(f.file)||!h)&&(!$t(f.file)||!g)||(d.ref.mediaPreview=s.appendChildView(s.createChildView(o,{id:u})),d.dispatch("DID_MEDIA_PREVIEW_CONTAINER_CREATE",{id:u}))};s.registerWriter(n({DID_LOAD_ITEM:c},({root:d,props:m})=>{let{id:u}=m,f=p("GET_ITEM",u),h=d.query("GET_ALLOW_VIDEO_PREVIEW"),g=d.query("GET_ALLOW_AUDIO_PREVIEW");!f||(!La(f.file)||!h)&&(!$t(f.file)||!g)||d.rect.element.hidden}))}),{options:{allowVideoPreview:[!0,a.BOOLEAN],allowAudioPreview:[!0,a.BOOLEAN]}}},mf=typeof window<"u"&&typeof window.document<"u";mf&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Ma}));var wl={labelIdle:'\u0627\u0633\u062D\u0628 \u0648 \u0627\u062F\u0631\u062C \u0645\u0644\u0641\u0627\u062A\u0643 \u0623\u0648 \u062A\u0635\u0641\u062D ',labelInvalidField:"\u0627\u0644\u062D\u0642\u0644 \u064A\u062D\u062A\u0648\u064A \u0639\u0644\u0649 \u0645\u0644\u0641\u0627\u062A \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629",labelFileWaitingForSize:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062D\u062C\u0645",labelFileSizeNotAvailable:"\u0627\u0644\u062D\u062C\u0645 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D",labelFileLoading:"\u0628\u0627\u0644\u0625\u0646\u062A\u0638\u0627\u0631",labelFileLoadError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u062D\u0645\u064A\u0644",labelFileProcessing:"\u064A\u062A\u0645 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingComplete:"\u062A\u0645 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingAborted:"\u062A\u0645 \u0625\u0644\u063A\u0627\u0621 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingRevertError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u0631\u0627\u062C\u0639",labelFileRemoveError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062D\u0630\u0641",labelTapToCancel:"\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0644\u063A\u0627\u0621",labelTapToRetry:"\u0627\u0646\u0642\u0631 \u0644\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",labelTapToUndo:"\u0627\u0646\u0642\u0631 \u0644\u0644\u062A\u0631\u0627\u062C\u0639",labelButtonRemoveItem:"\u0645\u0633\u062D",labelButtonAbortItemLoad:"\u0625\u0644\u063A\u0627\u0621",labelButtonRetryItemLoad:"\u0625\u0639\u0627\u062F\u0629",labelButtonAbortItemProcessing:"\u0625\u0644\u063A\u0627\u0621",labelButtonUndoItemProcessing:"\u062A\u0631\u0627\u062C\u0639",labelButtonRetryItemProcessing:"\u0625\u0639\u0627\u062F\u0629",labelButtonProcessItem:"\u0631\u0641\u0639",labelMaxFileSizeExceeded:"\u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u0627",labelMaxFileSize:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u0623\u0642\u0635\u0649: {filesize}",labelMaxTotalFileSizeExceeded:"\u062A\u0645 \u062A\u062C\u0627\u0648\u0632 \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u062D\u062C\u0645 \u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A",labelMaxTotalFileSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641: {filesize}",labelFileTypeNotAllowed:"\u0645\u0644\u0641 \u0645\u0646 \u0646\u0648\u0639 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D",fileValidateTypeLabelExpectedTypes:"\u062A\u062A\u0648\u0642\u0639 {allButLastType} \u0645\u0646 {lastType}",imageValidateSizeLabelFormatError:"\u0646\u0648\u0639 \u0627\u0644\u0635\u0648\u0631\u0629 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",imageValidateSizeLabelImageSizeTooSmall:"\u0627\u0644\u0635\u0648\u0631\u0629 \u0635\u063A\u064A\u0631 \u062C\u062F\u0627",imageValidateSizeLabelImageSizeTooBig:"\u0627\u0644\u0635\u0648\u0631\u0629 \u0643\u0628\u064A\u0631\u0629 \u062C\u062F\u0627",imageValidateSizeLabelExpectedMinSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0627\u0644\u062F\u0642\u0629 \u0636\u0639\u064A\u0641\u0629 \u062C\u062F\u0627",imageValidateSizeLabelImageResolutionTooHigh:"\u0627\u0644\u062F\u0642\u0629 \u0645\u0631\u062A\u0641\u0639\u0629 \u062C\u062F\u0627",imageValidateSizeLabelExpectedMinResolution:"\u0623\u0642\u0644 \u062F\u0642\u0629: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0623\u0642\u0635\u0649 \u062F\u0642\u0629: {maxResolution}"};var Sl={labelIdle:'Arrossega i deixa anar els teus fitxers o Navega ',labelInvalidField:"El camp cont\xE9 fitxers inv\xE0lids",labelFileWaitingForSize:"Esperant mida",labelFileSizeNotAvailable:"Mida no disponible",labelFileLoading:"Carregant",labelFileLoadError:"Error durant la c\xE0rrega",labelFileProcessing:"Pujant",labelFileProcessingComplete:"Pujada completada",labelFileProcessingAborted:"Pujada cancel\xB7lada",labelFileProcessingError:"Error durant la pujada",labelFileProcessingRevertError:"Error durant la reversi\xF3",labelFileRemoveError:"Error durant l'eliminaci\xF3",labelTapToCancel:"toca per cancel\xB7lar",labelTapToRetry:"toca per reintentar",labelTapToUndo:"toca per desfer",labelButtonRemoveItem:"Eliminar",labelButtonAbortItemLoad:"Cancel\xB7lar",labelButtonRetryItemLoad:"Reintentar",labelButtonAbortItemProcessing:"Cancel\xB7lar",labelButtonUndoItemProcessing:"Desfer",labelButtonRetryItemProcessing:"Reintentar",labelButtonProcessItem:"Pujar",labelMaxFileSizeExceeded:"El fitxer \xE9s massa gran",labelMaxFileSize:"La mida m\xE0xima del fitxer \xE9s {filesize}",labelMaxTotalFileSizeExceeded:"Mida m\xE0xima total excedida",labelMaxTotalFileSize:"La mida m\xE0xima total del fitxer \xE9s {filesize}",labelFileTypeNotAllowed:"Fitxer de tipus inv\xE0lid",fileValidateTypeLabelExpectedTypes:"Espera {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipus d'imatge no suportada",imageValidateSizeLabelImageSizeTooSmall:"La imatge \xE9s massa petita",imageValidateSizeLabelImageSizeTooBig:"La imatge \xE9s massa gran",imageValidateSizeLabelExpectedMinSize:"La mida m\xEDnima \xE9s {minWidth} x {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La mida m\xE0xima \xE9s {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La resoluci\xF3 \xE9s massa baixa",imageValidateSizeLabelImageResolutionTooHigh:"La resoluci\xF3 \xE9s massa alta",imageValidateSizeLabelExpectedMinResolution:"La resoluci\xF3 m\xEDnima \xE9s {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La resoluci\xF3 m\xE0xima \xE9s {maxResolution}"};var Ll={labelIdle:'\u067E\u06D5\u0695\u06AF\u06D5\u06A9\u0627\u0646 \u0641\u0695\u06CE \u0628\u062F\u06D5 \u0626\u06CE\u0631\u06D5 \u0628\u06C6 \u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u06CC\u0627\u0646 \u0647\u06D5\u06B5\u0628\u0698\u06CE\u0631\u06D5 ',labelInvalidField:"\u067E\u06D5\u0695\u06AF\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06CC \u062A\u06CE\u062F\u0627\u06CC\u06D5",labelFileWaitingForSize:"\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06CC\u06CC \u0642\u06D5\u0628\u0627\u0631\u06D5",labelFileSizeNotAvailable:"\u0642\u06D5\u0628\u0627\u0631\u06D5 \u0628\u06D5\u0631\u062F\u06D5\u0633\u062A \u0646\u06CC\u06D5",labelFileLoading:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileLoadError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5\u0645\u0627\u0648\u06D5\u06CC \u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileProcessing:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileProcessingComplete:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u062A\u06D5\u0648\u0627\u0648 \u0628\u0648\u0648",labelFileProcessingAborted:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u06CC\u06D5\u0648\u06D5",labelFileProcessingError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5\u06A9\u0627\u062A\u06CC \u0628\u0627\u0631\u06A9\u0631\u062F\u0646\u062F\u0627",labelFileProcessingRevertError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5 \u06A9\u0627\u062A\u06CC \u06AF\u06D5\u0695\u0627\u0646\u06D5\u0648\u06D5",labelFileRemoveError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5 \u06A9\u0627\u062A\u06CC \u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5",labelTapToCancel:"\u0628\u06C6 \u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5 Tab \u062F\u0627\u0628\u06AF\u0631\u06D5",labelTapToRetry:"tap \u062F\u0627\u0628\u06AF\u0631\u06D5 \u0628\u06C6 \u062F\u0648\u0648\u0628\u0627\u0631\u06D5\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5",labelTapToUndo:"tap \u062F\u0627\u0628\u06AF\u0631\u06D5 \u0628\u06C6 \u06AF\u06D5\u0695\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRemoveItem:"\u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5",labelButtonAbortItemLoad:"\u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRetryItemLoad:"\u0647\u06D5\u0648\u06B5\u062F\u0627\u0646\u06D5\u0648\u06D5",labelButtonAbortItemProcessing:"\u067E\u06D5\u0634\u06CC\u0645\u0627\u0646\u0628\u0648\u0648\u0646\u06D5\u0648\u06D5",labelButtonUndoItemProcessing:"\u06AF\u06D5\u0695\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRetryItemProcessing:"\u0647\u06D5\u0648\u06B5\u062F\u0627\u0646\u06D5\u0648\u06D5",labelButtonProcessItem:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelMaxFileSizeExceeded:"\u067E\u06D5\u0695\u06AF\u06D5 \u0632\u06C6\u0631 \u06AF\u06D5\u0648\u0631\u06D5\u06CC\u06D5",labelMaxFileSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {filesize}",labelMaxTotalFileSizeExceeded:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5\u06CC \u06A9\u06C6\u06CC \u06AF\u0634\u062A\u06CC \u062A\u06CE\u067E\u06D5\u0695\u06CE\u0646\u062F\u0631\u0627",labelMaxTotalFileSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5\u06CC \u06A9\u06C6\u06CC \u067E\u06D5\u0695\u06AF\u06D5 {filesize}",labelFileTypeNotAllowed:"\u062C\u06C6\u0631\u06CC \u067E\u06D5\u0695\u06AF\u06D5\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5",fileValidateTypeLabelExpectedTypes:"\u062C\u06AF\u06D5 \u0644\u06D5 {allButLastType} \u06CC\u0627\u0646 {lastType}",imageValidateSizeLabelFormatError:"\u062C\u06C6\u0631\u06CC \u0648\u06CE\u0646\u06D5 \u067E\u0627\u06B5\u067E\u0634\u062A\u06CC\u06CC \u0646\u06D5\u06A9\u0631\u0627\u0648\u06D5",imageValidateSizeLabelImageSizeTooSmall:"\u0648\u06CE\u0646\u06D5\u06A9\u06D5 \u0632\u06C6\u0631 \u0628\u0686\u0648\u0648\u06A9\u06D5",imageValidateSizeLabelImageSizeTooBig:"\u0648\u06CE\u0646\u06D5\u06A9\u06D5 \u0632\u06C6\u0631 \u06AF\u06D5\u0648\u0631\u06D5\u06CC\u06D5",imageValidateSizeLabelExpectedMinSize:"\u06A9\u06D5\u0645\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC\u06D5\u06A9\u06D5\u06CC \u0632\u06C6\u0631 \u06A9\u06D5\u0645\u06D5",imageValidateSizeLabelImageResolutionTooHigh:"\u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC\u06D5\u06A9\u06D5\u06CC \u0632\u06C6\u0631 \u0628\u06D5\u0631\u0632\u06D5",imageValidateSizeLabelExpectedMinResolution:"\u06A9\u06D5\u0645\u062A\u0631\u06CC\u0646 \u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0648\u0631\u062F\u0628\u06CC\u0646\u06CC {maxResolution}"};var Al={labelIdle:'P\u0159et\xE1hn\u011Bte soubor sem (drag&drop) nebo Vyhledat ',labelInvalidField:"Pole obsahuje chybn\xE9 soubory",labelFileWaitingForSize:"Zji\u0161\u0165uje se velikost",labelFileSizeNotAvailable:"Velikost nen\xED zn\xE1m\xE1",labelFileLoading:"P\u0159en\xE1\u0161\xED se",labelFileLoadError:"Chyba p\u0159i p\u0159enosu",labelFileProcessing:"Prob\xEDh\xE1 upload",labelFileProcessingComplete:"Upload dokon\u010Den",labelFileProcessingAborted:"Upload stornov\xE1n",labelFileProcessingError:"Chyba p\u0159i uploadu",labelFileProcessingRevertError:"Chyba p\u0159i obnov\u011B",labelFileRemoveError:"Chyba p\u0159i odstran\u011Bn\xED",labelTapToCancel:"klepn\u011Bte pro storno",labelTapToRetry:"klepn\u011Bte pro opakov\xE1n\xED",labelTapToUndo:"klepn\u011Bte pro vr\xE1cen\xED",labelButtonRemoveItem:"Odstranit",labelButtonAbortItemLoad:"Storno",labelButtonRetryItemLoad:"Opakovat",labelButtonAbortItemProcessing:"Zp\u011Bt",labelButtonUndoItemProcessing:"Vr\xE1tit",labelButtonRetryItemProcessing:"Opakovat",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Soubor je p\u0159\xEDli\u0161 velk\xFD",labelMaxFileSize:"Nejv\u011Bt\u0161\xED velikost souboru je {filesize}",labelMaxTotalFileSizeExceeded:"P\u0159ekro\u010Dena maxim\xE1ln\xED celkov\xE1 velikost souboru",labelMaxTotalFileSize:"Maxim\xE1ln\xED celkov\xE1 velikost souboru je {filesize}",labelFileTypeNotAllowed:"Soubor je nespr\xE1vn\xE9ho typu",fileValidateTypeLabelExpectedTypes:"O\u010Dek\xE1v\xE1 se {allButLastType} nebo {lastType}",imageValidateSizeLabelFormatError:"Obr\xE1zek tohoto typu nen\xED podporov\xE1n",imageValidateSizeLabelImageSizeTooSmall:"Obr\xE1zek je p\u0159\xEDli\u0161 mal\xFD",imageValidateSizeLabelImageSizeTooBig:"Obr\xE1zek je p\u0159\xEDli\u0161 velk\xFD",imageValidateSizeLabelExpectedMinSize:"Minim\xE1ln\xED rozm\u011Br je {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maxim\xE1ln\xED rozm\u011Br je {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rozli\u0161en\xED je p\u0159\xEDli\u0161 mal\xE9",imageValidateSizeLabelImageResolutionTooHigh:"Rozli\u0161en\xED je p\u0159\xEDli\u0161 velk\xE9",imageValidateSizeLabelExpectedMinResolution:"Minim\xE1ln\xED rozli\u0161en\xED je {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maxim\xE1ln\xED rozli\u0161en\xED je {maxResolution}"};var Ml={labelIdle:'Tr\xE6k & slip filer eller Gennemse ',labelInvalidField:"Felt indeholder ugyldige filer",labelFileWaitingForSize:"Venter p\xE5 st\xF8rrelse",labelFileSizeNotAvailable:"St\xF8rrelse ikke tilg\xE6ngelig",labelFileLoading:"Loader",labelFileLoadError:"Load fejlede",labelFileProcessing:"Uploader",labelFileProcessingComplete:"Upload f\xE6rdig",labelFileProcessingAborted:"Upload annulleret",labelFileProcessingError:"Upload fejlede",labelFileProcessingRevertError:"Fortryd fejlede",labelFileRemoveError:"Fjern fejlede",labelTapToCancel:"tryk for at annullere",labelTapToRetry:"tryk for at pr\xF8ve igen",labelTapToUndo:"tryk for at fortryde",labelButtonRemoveItem:"Fjern",labelButtonAbortItemLoad:"Annuller",labelButtonRetryItemLoad:"Fors\xF8g igen",labelButtonAbortItemProcessing:"Annuller",labelButtonUndoItemProcessing:"Fortryd",labelButtonRetryItemProcessing:"Pr\xF8v igen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Filen er for stor",labelMaxFileSize:"Maksimal filst\xF8rrelse er {filesize}",labelMaxTotalFileSizeExceeded:"Maksimal totalst\xF8rrelse overskredet",labelMaxTotalFileSize:"Maksimal total filst\xF8rrelse er {filesize}",labelFileTypeNotAllowed:"Ugyldig filtype",fileValidateTypeLabelExpectedTypes:"Forventer {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Ugyldigt format",imageValidateSizeLabelImageSizeTooSmall:"Billedet er for lille",imageValidateSizeLabelImageSizeTooBig:"Billedet er for stort",imageValidateSizeLabelExpectedMinSize:"Minimum st\xF8rrelse er {minBredde} \xD7 {minH\xF8jde}",imageValidateSizeLabelExpectedMaxSize:"Maksimal st\xF8rrelse er {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"For lav opl\xF8sning",imageValidateSizeLabelImageResolutionTooHigh:"For h\xF8j opl\xF8sning",imageValidateSizeLabelExpectedMinResolution:"Minimum opl\xF8sning er {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimal opl\xF8sning er {maxResolution}"};var Ol={labelIdle:'Dateien ablegen oder ausw\xE4hlen ',labelInvalidField:"Feld beinhaltet ung\xFCltige Dateien",labelFileWaitingForSize:"Dateigr\xF6\xDFe berechnen",labelFileSizeNotAvailable:"Dateigr\xF6\xDFe nicht verf\xFCgbar",labelFileLoading:"Laden",labelFileLoadError:"Fehler beim Laden",labelFileProcessing:"Upload l\xE4uft",labelFileProcessingComplete:"Upload abgeschlossen",labelFileProcessingAborted:"Upload abgebrochen",labelFileProcessingError:"Fehler beim Upload",labelFileProcessingRevertError:"Fehler beim Wiederherstellen",labelFileRemoveError:"Fehler beim L\xF6schen",labelTapToCancel:"abbrechen",labelTapToRetry:"erneut versuchen",labelTapToUndo:"r\xFCckg\xE4ngig",labelButtonRemoveItem:"Entfernen",labelButtonAbortItemLoad:"Verwerfen",labelButtonRetryItemLoad:"Erneut versuchen",labelButtonAbortItemProcessing:"Abbrechen",labelButtonUndoItemProcessing:"R\xFCckg\xE4ngig",labelButtonRetryItemProcessing:"Erneut versuchen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Datei ist zu gro\xDF",labelMaxFileSize:"Maximale Dateigr\xF6\xDFe: {filesize}",labelMaxTotalFileSizeExceeded:"Maximale gesamte Dateigr\xF6\xDFe \xFCberschritten",labelMaxTotalFileSize:"Maximale gesamte Dateigr\xF6\xDFe: {filesize}",labelFileTypeNotAllowed:"Dateityp ung\xFCltig",fileValidateTypeLabelExpectedTypes:"Erwartet {allButLastType} oder {lastType}",imageValidateSizeLabelFormatError:"Bildtyp nicht unterst\xFCtzt",imageValidateSizeLabelImageSizeTooSmall:"Bild ist zu klein",imageValidateSizeLabelImageSizeTooBig:"Bild ist zu gro\xDF",imageValidateSizeLabelExpectedMinSize:"Mindestgr\xF6\xDFe: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximale Gr\xF6\xDFe: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Aufl\xF6sung ist zu niedrig",imageValidateSizeLabelImageResolutionTooHigh:"Aufl\xF6sung ist zu hoch",imageValidateSizeLabelExpectedMinResolution:"Mindestaufl\xF6sung: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximale Aufl\xF6sung: {maxResolution}"};var Pl={labelIdle:'Drag & Drop your files or Browse ',labelInvalidField:"Field contains invalid files",labelFileWaitingForSize:"Waiting for size",labelFileSizeNotAvailable:"Size not available",labelFileLoading:"Loading",labelFileLoadError:"Error during load",labelFileProcessing:"Uploading",labelFileProcessingComplete:"Upload complete",labelFileProcessingAborted:"Upload cancelled",labelFileProcessingError:"Error during upload",labelFileProcessingRevertError:"Error during revert",labelFileRemoveError:"Error during remove",labelTapToCancel:"tap to cancel",labelTapToRetry:"tap to retry",labelTapToUndo:"tap to undo",labelButtonRemoveItem:"Remove",labelButtonAbortItemLoad:"Abort",labelButtonRetryItemLoad:"Retry",labelButtonAbortItemProcessing:"Cancel",labelButtonUndoItemProcessing:"Undo",labelButtonRetryItemProcessing:"Retry",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"File is too large",labelMaxFileSize:"Maximum file size is {filesize}",labelMaxTotalFileSizeExceeded:"Maximum total size exceeded",labelMaxTotalFileSize:"Maximum total file size is {filesize}",labelFileTypeNotAllowed:"File of invalid type",fileValidateTypeLabelExpectedTypes:"Expects {allButLastType} or {lastType}",imageValidateSizeLabelFormatError:"Image type not supported",imageValidateSizeLabelImageSizeTooSmall:"Image is too small",imageValidateSizeLabelImageSizeTooBig:"Image is too big",imageValidateSizeLabelExpectedMinSize:"Minimum size is {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum size is {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolution is too low",imageValidateSizeLabelImageResolutionTooHigh:"Resolution is too high",imageValidateSizeLabelExpectedMinResolution:"Minimum resolution is {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximum resolution is {maxResolution}"};var Dl={labelIdle:'Arrastra y suelta tus archivos o Examina ',labelInvalidField:"El campo contiene archivos inv\xE1lidos",labelFileWaitingForSize:"Esperando tama\xF1o",labelFileSizeNotAvailable:"Tama\xF1o no disponible",labelFileLoading:"Cargando",labelFileLoadError:"Error durante la carga",labelFileProcessing:"Subiendo",labelFileProcessingComplete:"Subida completa",labelFileProcessingAborted:"Subida cancelada",labelFileProcessingError:"Error durante la subida",labelFileProcessingRevertError:"Error durante la reversi\xF3n",labelFileRemoveError:"Error durante la eliminaci\xF3n",labelTapToCancel:"toca para cancelar",labelTapToRetry:"tocar para reintentar",labelTapToUndo:"tocar para deshacer",labelButtonRemoveItem:"Eliminar",labelButtonAbortItemLoad:"Cancelar",labelButtonRetryItemLoad:"Reintentar",labelButtonAbortItemProcessing:"Cancelar",labelButtonUndoItemProcessing:"Deshacer",labelButtonRetryItemProcessing:"Reintentar",labelButtonProcessItem:"Subir",labelMaxFileSizeExceeded:"El archivo es demasiado grande",labelMaxFileSize:"El tama\xF1o m\xE1ximo del archivo es {filesize}",labelMaxTotalFileSizeExceeded:"Tama\xF1o total m\xE1ximo excedido",labelMaxTotalFileSize:"El tama\xF1o total m\xE1ximo del archivo es {filesize}",labelFileTypeNotAllowed:"Archivo de tipo inv\xE1lido",fileValidateTypeLabelExpectedTypes:"Espera {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipo de imagen no soportada",imageValidateSizeLabelImageSizeTooSmall:"La imagen es demasiado peque\xF1a",imageValidateSizeLabelImageSizeTooBig:"La imagen es demasiado grande",imageValidateSizeLabelExpectedMinSize:"El tama\xF1o m\xEDnimo es {minWidth} x {minHeight}",imageValidateSizeLabelExpectedMaxSize:"El tama\xF1o m\xE1ximo es {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La resoluci\xF3n es demasiado baja",imageValidateSizeLabelImageResolutionTooHigh:"La resoluci\xF3n es demasiado alta",imageValidateSizeLabelExpectedMinResolution:"La resoluci\xF3n m\xEDnima es {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La resoluci\xF3n m\xE1xima es {maxResolution}"};var Fl={labelIdle:'\u0641\u0627\u06CC\u0644 \u0631\u0627 \u0627\u06CC\u0646\u062C\u0627 \u0628\u06A9\u0634\u06CC\u062F \u0648 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u062C\u0633\u062A\u062C\u0648 \u06A9\u0646\u06CC\u062F ',labelInvalidField:"\u0641\u06CC\u0644\u062F \u062F\u0627\u0631\u0627\u06CC \u0641\u0627\u06CC\u0644 \u0647\u0627\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A",labelFileWaitingForSize:"Waiting for size",labelFileSizeNotAvailable:"\u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0645\u062C\u0627\u0632 \u0646\u06CC\u0633\u062A",labelFileLoading:"\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileLoadError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0627\u062C\u0631\u0627",labelFileProcessing:"\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileProcessingComplete:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0627\u0645\u0644 \u0634\u062F",labelFileProcessingAborted:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0644\u063A\u0648 \u0634\u062F",labelFileProcessingError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileProcessingRevertError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641",labelFileRemoveError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641",labelTapToCancel:"\u0628\u0631\u0627\u06CC \u0644\u063A\u0648 \u0636\u0631\u0628\u0647 \u0628\u0632\u0646\u06CC\u062F",labelTapToRetry:"\u0628\u0631\u0627\u06CC \u062A\u06A9\u0631\u0627\u0631 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",labelTapToUndo:"\u0628\u0631\u0627\u06CC \u0628\u0631\u06AF\u0634\u062A \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",labelButtonRemoveItem:"\u062D\u0630\u0641",labelButtonAbortItemLoad:"\u0644\u063A\u0648",labelButtonRetryItemLoad:"\u062A\u06A9\u0631\u0627\u0631",labelButtonAbortItemProcessing:"\u0644\u063A\u0648",labelButtonUndoItemProcessing:"\u0628\u0631\u06AF\u0634\u062A",labelButtonRetryItemProcessing:"\u062A\u06A9\u0631\u0627\u0631",labelButtonProcessItem:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelMaxFileSizeExceeded:"\u0641\u0627\u06CC\u0644 \u0628\u0633\u06CC\u0627\u0631 \u062D\u062C\u06CC\u0645 \u0627\u0633\u062A",labelMaxFileSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0645\u062C\u0627\u0632 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A",labelMaxTotalFileSizeExceeded:"\u0627\u0632 \u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0628\u06CC\u0634\u062A\u0631 \u0634\u062F",labelMaxTotalFileSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A",labelFileTypeNotAllowed:"\u0646\u0648\u0639 \u0641\u0627\u06CC\u0644 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A",fileValidateTypeLabelExpectedTypes:"\u062F\u0631 \u0627\u0646\u062A\u0638\u0627\u0631 {allButLastType} \u06CC\u0627 {lastType}",imageValidateSizeLabelFormatError:"\u0641\u0631\u0645\u062A \u062A\u0635\u0648\u06CC\u0631 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0646\u0645\u06CC \u0634\u0648\u062F",imageValidateSizeLabelImageSizeTooSmall:"\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0648\u0686\u06A9 \u0627\u0633\u062A",imageValidateSizeLabelImageSizeTooBig:"\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0628\u0632\u0631\u06AF \u0627\u0633\u062A",imageValidateSizeLabelExpectedMinSize:"\u062D\u062F\u0627\u0642\u0644 \u0627\u0646\u062F\u0627\u0632\u0647 {minWidth} \xD7 {minHeight} \u0627\u0633\u062A",imageValidateSizeLabelExpectedMaxSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0627\u0646\u062F\u0627\u0632\u0647 {maxWidth} \xD7 {maxHeight} \u0627\u0633\u062A",imageValidateSizeLabelImageResolutionTooLow:"\u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0645 \u0627\u0633\u062A",imageValidateSizeLabelImageResolutionTooHigh:"\u0648\u0636\u0648\u0639 \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0632\u06CC\u0627\u062F \u0627\u0633\u062A",imageValidateSizeLabelExpectedMinResolution:"\u062D\u062F\u0627\u0642\u0644 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {minResolution} \u0627\u0633\u062A",imageValidateSizeLabelExpectedMaxResolution:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {maxResolution} \u0627\u0633\u062A"};var zl={labelIdle:'Ved\xE4 ja pudota tiedostoja tai Selaa ',labelInvalidField:"Kent\xE4ss\xE4 on virheellisi\xE4 tiedostoja",labelFileWaitingForSize:"Odotetaan kokoa",labelFileSizeNotAvailable:"Kokoa ei saatavilla",labelFileLoading:"Ladataan",labelFileLoadError:"Virhe latauksessa",labelFileProcessing:"L\xE4hetet\xE4\xE4n",labelFileProcessingComplete:"L\xE4hetys valmis",labelFileProcessingAborted:"L\xE4hetys peruttu",labelFileProcessingError:"Virhe l\xE4hetyksess\xE4",labelFileProcessingRevertError:"Virhe palautuksessa",labelFileRemoveError:"Virhe poistamisessa",labelTapToCancel:"peruuta napauttamalla",labelTapToRetry:"yrit\xE4 uudelleen napauttamalla",labelTapToUndo:"kumoa napauttamalla",labelButtonRemoveItem:"Poista",labelButtonAbortItemLoad:"Keskeyt\xE4",labelButtonRetryItemLoad:"Yrit\xE4 uudelleen",labelButtonAbortItemProcessing:"Peruuta",labelButtonUndoItemProcessing:"Kumoa",labelButtonRetryItemProcessing:"Yrit\xE4 uudelleen",labelButtonProcessItem:"L\xE4het\xE4",labelMaxFileSizeExceeded:"Tiedoston koko on liian suuri",labelMaxFileSize:"Tiedoston maksimikoko on {filesize}",labelMaxTotalFileSizeExceeded:"Tiedostojen yhdistetty maksimikoko ylitetty",labelMaxTotalFileSize:"Tiedostojen yhdistetty maksimikoko on {filesize}",labelFileTypeNotAllowed:"Tiedostotyyppi\xE4 ei sallita",fileValidateTypeLabelExpectedTypes:"Sallitaan {allButLastType} tai {lastType}",imageValidateSizeLabelFormatError:"Kuvatyyppi\xE4 ei tueta",imageValidateSizeLabelImageSizeTooSmall:"Kuva on liian pieni",imageValidateSizeLabelImageSizeTooBig:"Kuva on liian suuri",imageValidateSizeLabelExpectedMinSize:"Minimikoko on {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimikoko on {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resoluutio on liian pieni",imageValidateSizeLabelImageResolutionTooHigh:"Resoluutio on liian suuri",imageValidateSizeLabelExpectedMinResolution:"Minimiresoluutio on {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimiresoluutio on {maxResolution}"};var Cl={labelIdle:'Faites glisser vos fichiers ou Parcourir ',labelInvalidField:"Le champ contient des fichiers invalides",labelFileWaitingForSize:"En attente de taille",labelFileSizeNotAvailable:"Taille non disponible",labelFileLoading:"Chargement",labelFileLoadError:"Erreur durant le chargement",labelFileProcessing:"Traitement",labelFileProcessingComplete:"Traitement effectu\xE9",labelFileProcessingAborted:"Traitement interrompu",labelFileProcessingError:"Erreur durant le traitement",labelFileProcessingRevertError:"Erreur durant la restauration",labelFileRemoveError:"Erreur durant la suppression",labelTapToCancel:"appuyer pour annuler",labelTapToRetry:"appuyer pour r\xE9essayer",labelTapToUndo:"appuyer pour revenir en arri\xE8re",labelButtonRemoveItem:"Retirer",labelButtonAbortItemLoad:"Annuler",labelButtonRetryItemLoad:"Recommencer",labelButtonAbortItemProcessing:"Annuler",labelButtonUndoItemProcessing:"Revenir en arri\xE8re",labelButtonRetryItemProcessing:"Recommencer",labelButtonProcessItem:"Transf\xE9rer",labelMaxFileSizeExceeded:"Le fichier est trop volumineux",labelMaxFileSize:"La taille maximale de fichier est {filesize}",labelMaxTotalFileSizeExceeded:"Taille totale maximale d\xE9pass\xE9e",labelMaxTotalFileSize:"La taille totale maximale des fichiers est {filesize}",labelFileTypeNotAllowed:"Fichier non valide",fileValidateTypeLabelExpectedTypes:"Attendu {allButLastType} ou {lastType}",imageValidateSizeLabelFormatError:"Type d'image non pris en charge",imageValidateSizeLabelImageSizeTooSmall:"L'image est trop petite",imageValidateSizeLabelImageSizeTooBig:"L'image est trop grande",imageValidateSizeLabelExpectedMinSize:"La taille minimale est {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La taille maximale est {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La r\xE9solution est trop faible",imageValidateSizeLabelImageResolutionTooHigh:"La r\xE9solution est trop \xE9lev\xE9e",imageValidateSizeLabelExpectedMinResolution:"La r\xE9solution minimale est {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La r\xE9solution maximale est {maxResolution}"};var Nl={labelIdle:'Mozgasd ide a f\xE1jlt a felt\xF6lt\xE9shez, vagy tall\xF3z\xE1s ',labelInvalidField:"A mez\u0151 \xE9rv\xE9nytelen f\xE1jlokat tartalmaz",labelFileWaitingForSize:"F\xE1ljm\xE9ret kisz\xE1mol\xE1sa",labelFileSizeNotAvailable:"A f\xE1jlm\xE9ret nem el\xE9rhet\u0151",labelFileLoading:"T\xF6lt\xE9s",labelFileLoadError:"Hiba a bet\xF6lt\xE9s sor\xE1n",labelFileProcessing:"Felt\xF6lt\xE9s",labelFileProcessingComplete:"Sikeres felt\xF6lt\xE9s",labelFileProcessingAborted:"A felt\xF6lt\xE9s megszak\xEDtva",labelFileProcessingError:"Hiba t\xF6rt\xE9nt a felt\xF6lt\xE9s sor\xE1n",labelFileProcessingRevertError:"Hiba a vissza\xE1ll\xEDt\xE1s sor\xE1n",labelFileRemoveError:"Hiba t\xF6rt\xE9nt az elt\xE1vol\xEDt\xE1s sor\xE1n",labelTapToCancel:"koppints a t\xF6rl\xE9shez",labelTapToRetry:"koppints az \xFAjrakezd\xE9shez",labelTapToUndo:"koppints a visszavon\xE1shoz",labelButtonRemoveItem:"Elt\xE1vol\xEDt\xE1s",labelButtonAbortItemLoad:"Megszak\xEDt\xE1s",labelButtonRetryItemLoad:"\xDAjrapr\xF3b\xE1lkoz\xE1s",labelButtonAbortItemProcessing:"Megszak\xEDt\xE1s",labelButtonUndoItemProcessing:"Visszavon\xE1s",labelButtonRetryItemProcessing:"\xDAjrapr\xF3b\xE1lkoz\xE1s",labelButtonProcessItem:"Felt\xF6lt\xE9s",labelMaxFileSizeExceeded:"A f\xE1jl t\xFAll\xE9pte a maxim\xE1lis m\xE9retet",labelMaxFileSize:"Maxim\xE1lis f\xE1jlm\xE9ret: {filesize}",labelMaxTotalFileSizeExceeded:"T\xFAll\xE9pte a maxim\xE1lis teljes m\xE9retet",labelMaxTotalFileSize:"A maxim\xE1is teljes f\xE1jlm\xE9ret: {filesize}",labelFileTypeNotAllowed:"\xC9rv\xE9nytelen t\xEDpus\xFA f\xE1jl",fileValidateTypeLabelExpectedTypes:"Enged\xE9lyezett t\xEDpusok {allButLastType} vagy {lastType}",imageValidateSizeLabelFormatError:"A k\xE9pt\xEDpus nem t\xE1mogatott",imageValidateSizeLabelImageSizeTooSmall:"A k\xE9p t\xFAl kicsi",imageValidateSizeLabelImageSizeTooBig:"A k\xE9p t\xFAl nagy",imageValidateSizeLabelExpectedMinSize:"Minimum m\xE9ret: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum m\xE9ret: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"A felbont\xE1s t\xFAl alacsony",imageValidateSizeLabelImageResolutionTooHigh:"A felbont\xE1s t\xFAl magas",imageValidateSizeLabelExpectedMinResolution:"Minim\xE1is felbont\xE1s: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maxim\xE1lis felbont\xE1s: {maxResolution}"};var Bl={labelIdle:'Seret & Jatuhkan berkas Anda atau Jelajahi',labelInvalidField:"Isian berisi berkas yang tidak valid",labelFileWaitingForSize:"Menunggu ukuran berkas",labelFileSizeNotAvailable:"Ukuran berkas tidak tersedia",labelFileLoading:"Memuat",labelFileLoadError:"Kesalahan saat memuat",labelFileProcessing:"Mengunggah",labelFileProcessingComplete:"Pengunggahan selesai",labelFileProcessingAborted:"Pengunggahan dibatalkan",labelFileProcessingError:"Kesalahan saat pengunggahan",labelFileProcessingRevertError:"Kesalahan saat pemulihan",labelFileRemoveError:"Kesalahan saat penghapusan",labelTapToCancel:"ketuk untuk membatalkan",labelTapToRetry:"ketuk untuk mencoba lagi",labelTapToUndo:"ketuk untuk mengurungkan",labelButtonRemoveItem:"Hapus",labelButtonAbortItemLoad:"Batalkan",labelButtonRetryItemLoad:"Coba Kembali",labelButtonAbortItemProcessing:"Batalkan",labelButtonUndoItemProcessing:"Urungkan",labelButtonRetryItemProcessing:"Coba Kembali",labelButtonProcessItem:"Unggah",labelMaxFileSizeExceeded:"Berkas terlalu besar",labelMaxFileSize:"Ukuran berkas maksimum adalah {filesize}",labelMaxTotalFileSizeExceeded:"Jumlah berkas maksimum terlampaui",labelMaxTotalFileSize:"Jumlah berkas maksimum adalah {filesize}",labelFileTypeNotAllowed:"Jenis berkas tidak valid",fileValidateTypeLabelExpectedTypes:"Mengharapkan {allButLastType} atau {lastType}",imageValidateSizeLabelFormatError:"Jenis citra tidak didukung",imageValidateSizeLabelImageSizeTooSmall:"Citra terlalu kecil",imageValidateSizeLabelImageSizeTooBig:"Citra terlalu besar",imageValidateSizeLabelExpectedMinSize:"Ukuran minimum adalah {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Ukuran maksimum adalah {minWidth} \xD7 {minHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolusi terlalu rendah",imageValidateSizeLabelImageResolutionTooHigh:"Resolusi terlalu tinggi",imageValidateSizeLabelExpectedMinResolution:"Resolusi minimum adalah {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Resolusi maksimum adalah {maxResolution}"};var kl={labelIdle:'Trascina e rilascia i tuoi file oppure Carica ',labelInvalidField:"Il campo contiene dei file non validi",labelFileWaitingForSize:"Aspettando le dimensioni",labelFileSizeNotAvailable:"Dimensioni non disponibili",labelFileLoading:"Caricamento",labelFileLoadError:"Errore durante il caricamento",labelFileProcessing:"Caricamento",labelFileProcessingComplete:"Caricamento completato",labelFileProcessingAborted:"Caricamento cancellato",labelFileProcessingError:"Errore durante il caricamento",labelFileProcessingRevertError:"Errore durante il ripristino",labelFileRemoveError:"Errore durante l'eliminazione",labelTapToCancel:"tocca per cancellare",labelTapToRetry:"tocca per riprovare",labelTapToUndo:"tocca per ripristinare",labelButtonRemoveItem:"Elimina",labelButtonAbortItemLoad:"Cancella",labelButtonRetryItemLoad:"Ritenta",labelButtonAbortItemProcessing:"Camcella",labelButtonUndoItemProcessing:"Indietro",labelButtonRetryItemProcessing:"Ritenta",labelButtonProcessItem:"Carica",labelMaxFileSizeExceeded:"Il peso del file \xE8 eccessivo",labelMaxFileSize:"Il peso massimo del file \xE8 {filesize}",labelMaxTotalFileSizeExceeded:"Dimensione totale massima superata",labelMaxTotalFileSize:"La dimensione massima totale del file \xE8 {filesize}",labelFileTypeNotAllowed:"File non supportato",fileValidateTypeLabelExpectedTypes:"Aspetta {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipo di immagine non compatibile",imageValidateSizeLabelImageSizeTooSmall:"L'immagine \xE8 troppo piccola",imageValidateSizeLabelImageSizeTooBig:"L'immagine \xE8 troppo grande",imageValidateSizeLabelExpectedMinSize:"La dimensione minima \xE8 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La dimensione massima \xE8 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La risoluzione \xE8 troppo bassa",imageValidateSizeLabelImageResolutionTooHigh:"La risoluzione \xE8 troppo alta",imageValidateSizeLabelExpectedMinResolution:"La risoluzione minima \xE8 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La risoluzione massima \xE8 {maxResolution}"};var Vl={labelIdle:'\u1791\u17B6\u1789&\u178A\u17B6\u1780\u17CB\u17A0\u17D2\u179C\u17B6\u179B\u17CB\u17AF\u1780\u179F\u17B6\u179A\u179A\u1794\u179F\u17CB\u17A2\u17D2\u1793\u1780 \u17AC \u179F\u17D2\u179C\u17C2\u1784\u179A\u1780 ',labelInvalidField:"\u1785\u1793\u17D2\u179B\u17C4\u17C7\u1798\u17B6\u1793\u17AF\u1780\u179F\u17B6\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",labelFileWaitingForSize:"\u1780\u17C6\u1796\u17BB\u1784\u179A\u1784\u17CB\u1785\u17B6\u17C6\u1791\u17C6\u17A0\u17C6",labelFileSizeNotAvailable:"\u1791\u17C6\u17A0\u17C6\u1798\u17B7\u1793\u17A2\u17B6\u1785\u1794\u17D2\u179A\u17BE\u1794\u17B6\u1793",labelFileLoading:"\u1780\u17C6\u1796\u17BB\u1784\u178A\u17C6\u178E\u17BE\u179A\u1780\u17B6\u179A",labelFileLoadError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178A\u17C6\u178E\u17BE\u179A\u1780\u17B6\u179A",labelFileProcessing:"\u1780\u17C6\u1796\u17BB\u1784\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelFileProcessingComplete:"\u1780\u17B6\u179A\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784\u1796\u17C1\u1789\u179B\u17C1\u1789",labelFileProcessingAborted:"\u1780\u17B6\u179A\u1794\u1784\u17D2\u17A0\u17C4\u17C7\u178F\u17D2\u179A\u17BC\u179C\u1794\u17B6\u1793\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelFileProcessingError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u1780\u17C6\u1796\u17BB\u1784\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelFileProcessingRevertError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178F\u17D2\u179A\u17A1\u1794\u17CB",labelFileRemoveError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178A\u1780\u1785\u17C1\u1789",labelTapToCancel:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelTapToRetry:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelTapToUndo:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1798\u17B7\u1793\u1792\u17D2\u179C\u17BE\u179C\u17B7\u1789",labelButtonRemoveItem:"\u1799\u1780\u1785\u17C1\u1789",labelButtonAbortItemLoad:"\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelButtonRetryItemLoad:"\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelButtonAbortItemProcessing:"\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelButtonUndoItemProcessing:"\u1798\u17B7\u1793\u1792\u17D2\u179C\u17BE\u179C\u17B7\u1789",labelButtonRetryItemProcessing:"\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelButtonProcessItem:"\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelMaxFileSizeExceeded:"\u17AF\u1780\u179F\u17B6\u179A\u1792\u17C6\u1796\u17C1\u1780",labelMaxFileSize:"\u1791\u17C6\u17A0\u17C6\u17AF\u1780\u179F\u17B6\u179A\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {filesize}",labelMaxTotalFileSizeExceeded:"\u179B\u17BE\u179F\u1791\u17C6\u17A0\u17C6\u179F\u179A\u17BB\u1794\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6",labelMaxTotalFileSize:"\u1791\u17C6\u17A0\u17C6\u17AF\u1780\u179F\u17B6\u179A\u179F\u179A\u17BB\u1794\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {filesize}",labelFileTypeNotAllowed:"\u1794\u17D2\u179A\u1797\u17C1\u1791\u17AF\u1780\u179F\u17B6\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",fileValidateTypeLabelExpectedTypes:"\u179A\u17C6\u1796\u17B9\u1784\u1790\u17B6 {allButLastType} \u17AC {lastType}",imageValidateSizeLabelFormatError:"\u1794\u17D2\u179A\u1797\u17C1\u1791\u179A\u17BC\u1794\u1797\u17B6\u1796\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",imageValidateSizeLabelImageSizeTooSmall:"\u179A\u17BC\u1794\u1797\u17B6\u1796\u178F\u17BC\u1785\u1796\u17C1\u1780",imageValidateSizeLabelImageSizeTooBig:"\u179A\u17BC\u1794\u1797\u17B6\u1796\u1792\u17C6\u1796\u17C1\u1780",imageValidateSizeLabelExpectedMinSize:"\u1791\u17C6\u17A0\u17C6\u17A2\u1794\u17D2\u1794\u1794\u179A\u1798\u17B6\u1782\u17BA {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u1791\u17C6\u17A0\u17C6\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u1791\u17B6\u1794\u1796\u17C1\u1780",imageValidateSizeLabelImageResolutionTooHigh:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u1781\u17D2\u1796\u179F\u17CB\u1796\u17C1\u1780",imageValidateSizeLabelExpectedMinResolution:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u17A2\u1794\u17D2\u1794\u1794\u179A\u1798\u17B6\u1782\u17BA {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {maxResolution}"};var Gl={labelIdle:'Drag & Drop je bestanden of Bladeren ',labelInvalidField:"Veld bevat ongeldige bestanden",labelFileWaitingForSize:"Wachten op grootte",labelFileSizeNotAvailable:"Grootte niet beschikbaar",labelFileLoading:"Laden",labelFileLoadError:"Fout tijdens laden",labelFileProcessing:"Uploaden",labelFileProcessingComplete:"Upload afgerond",labelFileProcessingAborted:"Upload geannuleerd",labelFileProcessingError:"Fout tijdens upload",labelFileProcessingRevertError:"Fout bij herstellen",labelFileRemoveError:"Fout bij verwijderen",labelTapToCancel:"tik om te annuleren",labelTapToRetry:"tik om opnieuw te proberen",labelTapToUndo:"tik om ongedaan te maken",labelButtonRemoveItem:"Verwijderen",labelButtonAbortItemLoad:"Afbreken",labelButtonRetryItemLoad:"Opnieuw proberen",labelButtonAbortItemProcessing:"Annuleren",labelButtonUndoItemProcessing:"Ongedaan maken",labelButtonRetryItemProcessing:"Opnieuw proberen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Bestand is te groot",labelMaxFileSize:"Maximale bestandsgrootte is {filesize}",labelMaxTotalFileSizeExceeded:"Maximale totale grootte overschreden",labelMaxTotalFileSize:"Maximale totale bestandsgrootte is {filesize}",labelFileTypeNotAllowed:"Ongeldig bestandstype",fileValidateTypeLabelExpectedTypes:"Verwacht {allButLastType} of {lastType}",imageValidateSizeLabelFormatError:"Afbeeldingstype niet ondersteund",imageValidateSizeLabelImageSizeTooSmall:"Afbeelding is te klein",imageValidateSizeLabelImageSizeTooBig:"Afbeelding is te groot",imageValidateSizeLabelExpectedMinSize:"Minimale afmeting is {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximale afmeting is {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolutie is te laag",imageValidateSizeLabelImageResolutionTooHigh:"Resolution is too high",imageValidateSizeLabelExpectedMinResolution:"Minimale resolutie is {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximale resolutie is {maxResolution}"};var Ul={labelIdle:'Dra og slipp filene dine, eller Bla gjennom... ',labelInvalidField:"Feltet inneholder ugyldige filer",labelFileWaitingForSize:"Venter p\xE5 st\xF8rrelse",labelFileSizeNotAvailable:"St\xF8rrelse ikke tilgjengelig",labelFileLoading:"Laster",labelFileLoadError:"Feil under lasting",labelFileProcessing:"Laster opp",labelFileProcessingComplete:"Opplasting ferdig",labelFileProcessingAborted:"Opplasting avbrutt",labelFileProcessingError:"Feil under opplasting",labelFileProcessingRevertError:"Feil under reversering",labelFileRemoveError:"Feil under flytting",labelTapToCancel:"klikk for \xE5 avbryte",labelTapToRetry:"klikk for \xE5 pr\xF8ve p\xE5 nytt",labelTapToUndo:"klikk for \xE5 angre",labelButtonRemoveItem:"Fjern",labelButtonAbortItemLoad:"Avbryt",labelButtonRetryItemLoad:"Pr\xF8v p\xE5 nytt",labelButtonAbortItemProcessing:"Avbryt",labelButtonUndoItemProcessing:"Angre",labelButtonRetryItemProcessing:"Pr\xF8v p\xE5 nytt",labelButtonProcessItem:"Last opp",labelMaxFileSizeExceeded:"Filen er for stor",labelMaxFileSize:"Maksimal filst\xF8rrelse er {filesize}",labelMaxTotalFileSizeExceeded:"Maksimal total st\xF8rrelse oversteget",labelMaxTotalFileSize:"Maksimal total st\xF8rrelse er {filesize}",labelFileTypeNotAllowed:"Ugyldig filtype",fileValidateTypeLabelExpectedTypes:"Forventer {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Bildeformat ikke st\xF8ttet",imageValidateSizeLabelImageSizeTooSmall:"Bildet er for lite",imageValidateSizeLabelImageSizeTooBig:"Bildet er for stort",imageValidateSizeLabelExpectedMinSize:"Minimumsst\xF8rrelse er {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimumsst\xF8rrelse er {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Oppl\xF8sningen er for lav",imageValidateSizeLabelImageResolutionTooHigh:"Oppl\xF8sningen er for h\xF8y",imageValidateSizeLabelExpectedMinResolution:"Minimum oppl\xF8sning er {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimal oppl\xF8sning er {maxResolution}"};var Wl={labelIdle:'Przeci\u0105gnij i upu\u015B\u0107 lub wybierz pliki',labelInvalidField:"Nieprawid\u0142owe pliki",labelFileWaitingForSize:"Pobieranie rozmiaru",labelFileSizeNotAvailable:"Nieznany rozmiar",labelFileLoading:"Wczytywanie",labelFileLoadError:"B\u0142\u0105d wczytywania",labelFileProcessing:"Przesy\u0142anie",labelFileProcessingComplete:"Przes\u0142ano",labelFileProcessingAborted:"Przerwano",labelFileProcessingError:"Przesy\u0142anie nie powiod\u0142o si\u0119",labelFileProcessingRevertError:"Co\u015B posz\u0142o nie tak",labelFileRemoveError:"Nieudane usuni\u0119cie",labelTapToCancel:"Anuluj",labelTapToRetry:"Pon\xF3w",labelTapToUndo:"Cofnij",labelButtonRemoveItem:"Usu\u0144",labelButtonAbortItemLoad:"Przerwij",labelButtonRetryItemLoad:"Pon\xF3w",labelButtonAbortItemProcessing:"Anuluj",labelButtonUndoItemProcessing:"Cofnij",labelButtonRetryItemProcessing:"Pon\xF3w",labelButtonProcessItem:"Prze\u015Blij",labelMaxFileSizeExceeded:"Plik jest zbyt du\u017Cy",labelMaxFileSize:"Dopuszczalna wielko\u015B\u0107 pliku to {filesize}",labelMaxTotalFileSizeExceeded:"Przekroczono \u0142\u0105czny rozmiar plik\xF3w",labelMaxTotalFileSize:"\u0141\u0105czny rozmiar plik\xF3w nie mo\u017Ce przekroczy\u0107 {filesize}",labelFileTypeNotAllowed:"Niedozwolony rodzaj pliku",fileValidateTypeLabelExpectedTypes:"Oczekiwano {allButLastType} lub {lastType}",imageValidateSizeLabelFormatError:"Nieobs\u0142ugiwany format obrazu",imageValidateSizeLabelImageSizeTooSmall:"Obraz jest zbyt ma\u0142y",imageValidateSizeLabelImageSizeTooBig:"Obraz jest zbyt du\u017Cy",imageValidateSizeLabelExpectedMinSize:"Minimalne wymiary obrazu to {minWidth}\xD7{minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksymalna wymiary obrazu to {maxWidth}\xD7{maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rozdzielczo\u015B\u0107 jest zbyt niska",imageValidateSizeLabelImageResolutionTooHigh:"Rozdzielczo\u015B\u0107 jest zbyt wysoka",imageValidateSizeLabelExpectedMinResolution:"Minimalna rozdzielczo\u015B\u0107 to {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksymalna rozdzielczo\u015B\u0107 to {maxResolution}"};var Ri={labelIdle:'Arraste e solte os arquivos ou Clique aqui ',labelInvalidField:"Arquivos inv\xE1lidos",labelFileWaitingForSize:"Calculando o tamanho do arquivo",labelFileSizeNotAvailable:"Tamanho do arquivo indispon\xEDvel",labelFileLoading:"Carregando",labelFileLoadError:"Erro durante o carregamento",labelFileProcessing:"Enviando",labelFileProcessingComplete:"Envio finalizado",labelFileProcessingAborted:"Envio cancelado",labelFileProcessingError:"Erro durante o envio",labelFileProcessingRevertError:"Erro ao reverter o envio",labelFileRemoveError:"Erro ao remover o arquivo",labelTapToCancel:"clique para cancelar",labelTapToRetry:"clique para reenviar",labelTapToUndo:"clique para desfazer",labelButtonRemoveItem:"Remover",labelButtonAbortItemLoad:"Abortar",labelButtonRetryItemLoad:"Reenviar",labelButtonAbortItemProcessing:"Cancelar",labelButtonUndoItemProcessing:"Desfazer",labelButtonRetryItemProcessing:"Reenviar",labelButtonProcessItem:"Enviar",labelMaxFileSizeExceeded:"Arquivo \xE9 muito grande",labelMaxFileSize:"O tamanho m\xE1ximo permitido: {filesize}",labelMaxTotalFileSizeExceeded:"Tamanho total dos arquivos excedido",labelMaxTotalFileSize:"Tamanho total permitido: {filesize}",labelFileTypeNotAllowed:"Tipo de arquivo inv\xE1lido",fileValidateTypeLabelExpectedTypes:"Tipos de arquivo suportados s\xE3o {allButLastType} ou {lastType}",imageValidateSizeLabelFormatError:"Tipo de imagem inv\xE1lida",imageValidateSizeLabelImageSizeTooSmall:"Imagem muito pequena",imageValidateSizeLabelImageSizeTooBig:"Imagem muito grande",imageValidateSizeLabelExpectedMinSize:"Tamanho m\xEDnimo permitida: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Tamanho m\xE1ximo permitido: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolu\xE7\xE3o muito baixa",imageValidateSizeLabelImageResolutionTooHigh:"Resolu\xE7\xE3o muito alta",imageValidateSizeLabelExpectedMinResolution:"Resolu\xE7\xE3o m\xEDnima permitida: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Resolu\xE7\xE3o m\xE1xima permitida: {maxResolution}"};var Hl={labelIdle:'Trage \u0219i plaseaz\u0103 fi\u0219iere sau Caut\u0103-le ',labelInvalidField:"C\xE2mpul con\u021Bine fi\u0219iere care nu sunt valide",labelFileWaitingForSize:"\xCEn a\u0219teptarea dimensiunii",labelFileSizeNotAvailable:"Dimensiunea nu este diponibil\u0103",labelFileLoading:"Se \xEEncarc\u0103",labelFileLoadError:"Eroare la \xEEnc\u0103rcare",labelFileProcessing:"Se \xEEncarc\u0103",labelFileProcessingComplete:"\xCEnc\u0103rcare finalizat\u0103",labelFileProcessingAborted:"\xCEnc\u0103rcare anulat\u0103",labelFileProcessingError:"Eroare la \xEEnc\u0103rcare",labelFileProcessingRevertError:"Eroare la anulare",labelFileRemoveError:"Eroare la \u015Ftergere",labelTapToCancel:"apas\u0103 pentru a anula",labelTapToRetry:"apas\u0103 pentru a re\xEEncerca",labelTapToUndo:"apas\u0103 pentru a anula",labelButtonRemoveItem:"\u015Eterge",labelButtonAbortItemLoad:"Anuleaz\u0103",labelButtonRetryItemLoad:"Re\xEEncearc\u0103",labelButtonAbortItemProcessing:"Anuleaz\u0103",labelButtonUndoItemProcessing:"Anuleaz\u0103",labelButtonRetryItemProcessing:"Re\xEEncearc\u0103",labelButtonProcessItem:"\xCEncarc\u0103",labelMaxFileSizeExceeded:"Fi\u0219ierul este prea mare",labelMaxFileSize:"Dimensiunea maxim\u0103 a unui fi\u0219ier este de {filesize}",labelMaxTotalFileSizeExceeded:"Dimensiunea total\u0103 maxim\u0103 a fost dep\u0103\u0219it\u0103",labelMaxTotalFileSize:"Dimensiunea total\u0103 maxim\u0103 a fi\u0219ierelor este de {filesize}",labelFileTypeNotAllowed:"Tipul fi\u0219ierului nu este valid",fileValidateTypeLabelExpectedTypes:"Se a\u0219teapt\u0103 {allButLastType} sau {lastType}",imageValidateSizeLabelFormatError:"Formatul imaginii nu este acceptat",imageValidateSizeLabelImageSizeTooSmall:"Imaginea este prea mic\u0103",imageValidateSizeLabelImageSizeTooBig:"Imaginea este prea mare",imageValidateSizeLabelExpectedMinSize:"M\u0103rimea minim\u0103 este de {maxWidth} x {maxHeight}",imageValidateSizeLabelExpectedMaxSize:"M\u0103rimea maxim\u0103 este de {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rezolu\u021Bia este prea mic\u0103",imageValidateSizeLabelImageResolutionTooHigh:"Rezolu\u021Bia este prea mare",imageValidateSizeLabelExpectedMinResolution:"Rezolu\u021Bia minim\u0103 este de {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Rezolu\u021Bia maxim\u0103 este de {maxResolution}"};var jl={labelIdle:'\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B \u0438\u043B\u0438 \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 ',labelInvalidField:"\u041F\u043E\u043B\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435 \u0444\u0430\u0439\u043B\u044B",labelFileWaitingForSize:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0440\u0430\u0437\u043C\u0435\u0440",labelFileSizeNotAvailable:"\u0420\u0430\u0437\u043C\u0435\u0440 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",labelFileLoading:"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435",labelFileLoadError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0438",labelFileProcessing:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",labelFileProcessingComplete:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430",labelFileProcessingAborted:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430",labelFileProcessingError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435",labelFileProcessingRevertError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0435",labelFileRemoveError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0438",labelTapToCancel:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B",labelTapToRetry:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelTapToUndo:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",labelButtonRemoveItem:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",labelButtonAbortItemLoad:"\u041F\u0440\u0435\u043A\u0440\u0430\u0449\u0435\u043D\u043E",labelButtonRetryItemLoad:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelButtonAbortItemProcessing:"\u041E\u0442\u043C\u0435\u043D\u0430",labelButtonUndoItemProcessing:"\u041E\u0442\u043C\u0435\u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",labelButtonRetryItemProcessing:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelButtonProcessItem:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",labelMaxFileSizeExceeded:"\u0424\u0430\u0439\u043B \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439",labelMaxFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}",labelMaxTotalFileSizeExceeded:"\u041F\u0440\u0435\u0432\u044B\u0448\u0435\u043D \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440",labelMaxTotalFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}",labelFileTypeNotAllowed:"\u0424\u0430\u0439\u043B \u043D\u0435\u0432\u0435\u0440\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430",fileValidateTypeLabelExpectedTypes:"\u041E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F {allButLastType} \u0438\u043B\u0438 {lastType}",imageValidateSizeLabelFormatError:"\u0422\u0438\u043F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",imageValidateSizeLabelImageSizeTooSmall:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435",imageValidateSizeLabelImageSizeTooBig:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435",imageValidateSizeLabelExpectedMinSize:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043D\u0438\u0437\u043A\u043E\u0435",imageValidateSizeLabelImageResolutionTooHigh:"\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0432\u044B\u0441\u043E\u043A\u043E\u0435",imageValidateSizeLabelExpectedMinResolution:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {maxResolution}"};var Yl={labelIdle:'Drag och sl\xE4pp dina filer eller Bl\xE4ddra ',labelInvalidField:"F\xE4ltet inneh\xE5ller felaktiga filer",labelFileWaitingForSize:"V\xE4ntar p\xE5 storlek",labelFileSizeNotAvailable:"Storleken finns inte tillg\xE4nglig",labelFileLoading:"Laddar",labelFileLoadError:"Fel under laddning",labelFileProcessing:"Laddar upp",labelFileProcessingComplete:"Uppladdning klar",labelFileProcessingAborted:"Uppladdning avbruten",labelFileProcessingError:"Fel under uppladdning",labelFileProcessingRevertError:"Fel under \xE5terst\xE4llning",labelFileRemoveError:"Fel under borttagning",labelTapToCancel:"tryck f\xF6r att avbryta",labelTapToRetry:"tryck f\xF6r att f\xF6rs\xF6ka igen",labelTapToUndo:"tryck f\xF6r att \xE5ngra",labelButtonRemoveItem:"Tabort",labelButtonAbortItemLoad:"Avbryt",labelButtonRetryItemLoad:"F\xF6rs\xF6k igen",labelButtonAbortItemProcessing:"Avbryt",labelButtonUndoItemProcessing:"\xC5ngra",labelButtonRetryItemProcessing:"F\xF6rs\xF6k igen",labelButtonProcessItem:"Ladda upp",labelMaxFileSizeExceeded:"Filen \xE4r f\xF6r stor",labelMaxFileSize:"St\xF6rsta till\xE5tna filstorlek \xE4r {filesize}",labelMaxTotalFileSizeExceeded:"Maximal uppladdningsstorlek uppn\xE5d",labelMaxTotalFileSize:"Maximal uppladdningsstorlek \xE4r {filesize}",labelFileTypeNotAllowed:"Felaktig filtyp",fileValidateTypeLabelExpectedTypes:"Godk\xE4nda filtyper {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Bildtypen saknar st\xF6d",imageValidateSizeLabelImageSizeTooSmall:"Bilden \xE4r f\xF6r liten",imageValidateSizeLabelImageSizeTooBig:"Bilden \xE4r f\xF6r stor",imageValidateSizeLabelExpectedMinSize:"Minimal storlek \xE4r {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximal storlek \xE4r {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Uppl\xF6sningen \xE4r f\xF6r l\xE5g",imageValidateSizeLabelImageResolutionTooHigh:"Uppl\xF6sningen \xE4r f\xF6r h\xF6g",imageValidateSizeLabelExpectedMinResolution:"Minsta till\xE5tna uppl\xF6sning \xE4r {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"H\xF6gsta till\xE5tna uppl\xF6sning \xE4r {maxResolution}"};var ql={labelIdle:'Dosyan\u0131z\u0131 S\xFCr\xFCkleyin & B\u0131rak\u0131n ya da Se\xE7in ',labelInvalidField:"Alan ge\xE7ersiz dosyalar i\xE7eriyor",labelFileWaitingForSize:"Boyut hesaplan\u0131yor",labelFileSizeNotAvailable:"Boyut mevcut de\u011Fil",labelFileLoading:"Y\xFCkleniyor",labelFileLoadError:"Y\xFCkleme s\u0131ras\u0131nda hata olu\u015Ftu",labelFileProcessing:"Y\xFCkleniyor",labelFileProcessingComplete:"Y\xFCkleme tamamland\u0131",labelFileProcessingAborted:"Y\xFCkleme iptal edildi",labelFileProcessingError:"Y\xFCklerken hata olu\u015Ftu",labelFileProcessingRevertError:"Geri \xE7ekerken hata olu\u015Ftu",labelFileRemoveError:"Kald\u0131r\u0131rken hata olu\u015Ftu",labelTapToCancel:"\u0130ptal etmek i\xE7in t\u0131klay\u0131n",labelTapToRetry:"Tekrar denemek i\xE7in t\u0131klay\u0131n",labelTapToUndo:"Geri almak i\xE7in t\u0131klay\u0131n",labelButtonRemoveItem:"Kald\u0131r",labelButtonAbortItemLoad:"\u0130ptal Et",labelButtonRetryItemLoad:"Tekrar dene",labelButtonAbortItemProcessing:"\u0130ptal et",labelButtonUndoItemProcessing:"Geri Al",labelButtonRetryItemProcessing:"Tekrar dene",labelButtonProcessItem:"Y\xFCkle",labelMaxFileSizeExceeded:"Dosya \xE7ok b\xFCy\xFCk",labelMaxFileSize:"En fazla dosya boyutu: {filesize}",labelMaxTotalFileSizeExceeded:"Maximum boyut a\u015F\u0131ld\u0131",labelMaxTotalFileSize:"Maximum dosya boyutu :{filesize}",labelFileTypeNotAllowed:"Ge\xE7ersiz dosya tipi",fileValidateTypeLabelExpectedTypes:"\u015Eu {allButLastType} ya da \u015Fu dosya olmas\u0131 gerekir: {lastType}",imageValidateSizeLabelFormatError:"Resim tipi desteklenmiyor",imageValidateSizeLabelImageSizeTooSmall:"Resim \xE7ok k\xFC\xE7\xFCk",imageValidateSizeLabelImageSizeTooBig:"Resim \xE7ok b\xFCy\xFCk",imageValidateSizeLabelExpectedMinSize:"Minimum boyut {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum boyut {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok d\xFC\u015F\xFCk",imageValidateSizeLabelImageResolutionTooHigh:"\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok y\xFCksek",imageValidateSizeLabelExpectedMinResolution:"Minimum \xE7\xF6z\xFCn\xFCrl\xFCk {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximum \xE7\xF6z\xFCn\xFCrl\xFCk {maxResolution}"};var $l={labelIdle:'\u041F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0444\u0430\u0439\u043B\u0438 \u0430\u0431\u043E \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044C ',labelInvalidField:"\u041F\u043E\u043B\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u0456 \u0444\u0430\u0439\u043B\u0438",labelFileWaitingForSize:"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0440\u043E\u0437\u043C\u0456\u0440",labelFileSizeNotAvailable:"\u0420\u043E\u0437\u043C\u0456\u0440 \u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439",labelFileLoading:"\u041E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u044F",labelFileLoadError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u0456",labelFileProcessing:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",labelFileProcessingComplete:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",labelFileProcessingAborted:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0441\u043A\u0430\u0441\u043E\u0432\u0430\u043D\u043E",labelFileProcessingError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u0456",labelFileProcessingRevertError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u0456",labelFileRemoveError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u0456",labelTapToCancel:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelTapToRetry:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelTapToUndo:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0432\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E",labelButtonRemoveItem:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",labelButtonAbortItemLoad:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelButtonRetryItemLoad:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelButtonAbortItemProcessing:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelButtonUndoItemProcessing:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E",labelButtonRetryItemProcessing:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelButtonProcessItem:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",labelMaxFileSizeExceeded:"\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439",labelMaxFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0444\u0430\u0439\u043B\u0443: {filesize}",labelMaxTotalFileSizeExceeded:"\u041F\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043D\u043E \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440",labelMaxTotalFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {filesize}",labelFileTypeNotAllowed:"\u0424\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0443 \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F",fileValidateTypeLabelExpectedTypes:"\u041E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F {allButLastType} \u0430\u0431\u043E {lastType}",imageValidateSizeLabelFormatError:"\u0424\u043E\u0440\u043C\u0430\u0442 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F",imageValidateSizeLabelImageSizeTooSmall:"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0435",imageValidateSizeLabelImageSizeTooBig:"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435",imageValidateSizeLabelExpectedMinSize:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0456",imageValidateSizeLabelImageResolutionTooHigh:"\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0456",imageValidateSizeLabelExpectedMinResolution:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {maxResolution}"};var Xl={labelIdle:'K\xE9o th\u1EA3 t\u1EC7p c\u1EE7a b\u1EA1n ho\u1EB7c T\xECm ki\u1EBFm ',labelInvalidField:"Tr\u01B0\u1EDDng ch\u1EE9a c\xE1c t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7",labelFileWaitingForSize:"\u0110ang ch\u1EDD k\xEDch th\u01B0\u1EDBc",labelFileSizeNotAvailable:"K\xEDch th\u01B0\u1EDBc kh\xF4ng c\xF3 s\u1EB5n",labelFileLoading:"\u0110ang t\u1EA3i",labelFileLoadError:"L\u1ED7i khi t\u1EA3i",labelFileProcessing:"\u0110ang t\u1EA3i l\xEAn",labelFileProcessingComplete:"T\u1EA3i l\xEAn th\xE0nh c\xF4ng",labelFileProcessingAborted:"\u0110\xE3 hu\u1EF7 t\u1EA3i l\xEAn",labelFileProcessingError:"L\u1ED7i khi t\u1EA3i l\xEAn",labelFileProcessingRevertError:"L\u1ED7i khi ho\xE0n nguy\xEAn",labelFileRemoveError:"L\u1ED7i khi x\xF3a",labelTapToCancel:"nh\u1EA5n \u0111\u1EC3 h\u1EE7y",labelTapToRetry:"nh\u1EA5n \u0111\u1EC3 th\u1EED l\u1EA1i",labelTapToUndo:"nh\u1EA5n \u0111\u1EC3 ho\xE0n t\xE1c",labelButtonRemoveItem:"Xo\xE1",labelButtonAbortItemLoad:"Hu\u1EF7 b\u1ECF",labelButtonRetryItemLoad:"Th\u1EED l\u1EA1i",labelButtonAbortItemProcessing:"H\u1EE7y b\u1ECF",labelButtonUndoItemProcessing:"Ho\xE0n t\xE1c",labelButtonRetryItemProcessing:"Th\u1EED l\u1EA1i",labelButtonProcessItem:"T\u1EA3i l\xEAn",labelMaxFileSizeExceeded:"T\u1EADp tin qu\xE1 l\u1EDBn",labelMaxFileSize:"K\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}",labelMaxTotalFileSizeExceeded:"\u0110\xE3 v\u01B0\u1EE3t qu\xE1 t\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a",labelMaxTotalFileSize:"T\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}",labelFileTypeNotAllowed:"T\u1EC7p thu\u1ED9c lo\u1EA1i kh\xF4ng h\u1EE3p l\u1EC7",fileValidateTypeLabelExpectedTypes:"Ki\u1EC3u t\u1EC7p h\u1EE3p l\u1EC7 l\xE0 {allButLastType} ho\u1EB7c {lastType}",imageValidateSizeLabelFormatError:"Lo\u1EA1i h\xECnh \u1EA3nh kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3",imageValidateSizeLabelImageSizeTooSmall:"H\xECnh \u1EA3nh qu\xE1 nh\u1ECF",imageValidateSizeLabelImageSizeTooBig:"H\xECnh \u1EA3nh qu\xE1 l\u1EDBn",imageValidateSizeLabelExpectedMinSize:"K\xEDch th\u01B0\u1EDBc t\u1ED1i thi\u1EC3u l\xE0 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"K\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a l\xE0 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 th\u1EA5p",imageValidateSizeLabelImageResolutionTooHigh:"\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 cao",imageValidateSizeLabelExpectedMinResolution:"\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i thi\u1EC3u l\xE0 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i \u0111a l\xE0 {maxResolution}"};var Ql={labelIdle:'\u62D6\u653E\u6587\u4EF6\uFF0C\u6216\u8005 \u6D4F\u89C8 ',labelInvalidField:"\u5B57\u6BB5\u5305\u542B\u65E0\u6548\u6587\u4EF6",labelFileWaitingForSize:"\u8BA1\u7B97\u6587\u4EF6\u5927\u5C0F",labelFileSizeNotAvailable:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u53EF\u7528",labelFileLoading:"\u52A0\u8F7D",labelFileLoadError:"\u52A0\u8F7D\u9519\u8BEF",labelFileProcessing:"\u4E0A\u4F20",labelFileProcessingComplete:"\u5DF2\u4E0A\u4F20",labelFileProcessingAborted:"\u4E0A\u4F20\u5DF2\u53D6\u6D88",labelFileProcessingError:"\u4E0A\u4F20\u51FA\u9519",labelFileProcessingRevertError:"\u8FD8\u539F\u51FA\u9519",labelFileRemoveError:"\u5220\u9664\u51FA\u9519",labelTapToCancel:"\u70B9\u51FB\u53D6\u6D88",labelTapToRetry:"\u70B9\u51FB\u91CD\u8BD5",labelTapToUndo:"\u70B9\u51FB\u64A4\u6D88",labelButtonRemoveItem:"\u5220\u9664",labelButtonAbortItemLoad:"\u4E2D\u6B62",labelButtonRetryItemLoad:"\u91CD\u8BD5",labelButtonAbortItemProcessing:"\u53D6\u6D88",labelButtonUndoItemProcessing:"\u64A4\u6D88",labelButtonRetryItemProcessing:"\u91CD\u8BD5",labelButtonProcessItem:"\u4E0A\u4F20",labelMaxFileSizeExceeded:"\u6587\u4EF6\u592A\u5927",labelMaxFileSize:"\u6700\u5927\u503C: {filesize}",labelMaxTotalFileSizeExceeded:"\u8D85\u8FC7\u6700\u5927\u6587\u4EF6\u5927\u5C0F",labelMaxTotalFileSize:"\u6700\u5927\u6587\u4EF6\u5927\u5C0F\uFF1A{filesize}",labelFileTypeNotAllowed:"\u6587\u4EF6\u7C7B\u578B\u65E0\u6548",fileValidateTypeLabelExpectedTypes:"\u5E94\u4E3A {allButLastType} \u6216 {lastType}",imageValidateSizeLabelFormatError:"\u4E0D\u652F\u6301\u56FE\u50CF\u7C7B\u578B",imageValidateSizeLabelImageSizeTooSmall:"\u56FE\u50CF\u592A\u5C0F",imageValidateSizeLabelImageSizeTooBig:"\u56FE\u50CF\u592A\u5927",imageValidateSizeLabelExpectedMinSize:"\u6700\u5C0F\u503C: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u6700\u5927\u503C: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u5206\u8FA8\u7387\u592A\u4F4E",imageValidateSizeLabelImageResolutionTooHigh:"\u5206\u8FA8\u7387\u592A\u9AD8",imageValidateSizeLabelExpectedMinResolution:"\u6700\u5C0F\u5206\u8FA8\u7387\uFF1A{minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u6700\u5927\u5206\u8FA8\u7387\uFF1A{maxResolution}"};var Zl={labelIdle:'\u62D6\u653E\u6A94\u6848\uFF0C\u6216\u8005 \u700F\u89BD ',labelInvalidField:"\u4E0D\u652F\u63F4\u6B64\u6A94\u6848",labelFileWaitingForSize:"\u6B63\u5728\u8A08\u7B97\u6A94\u6848\u5927\u5C0F",labelFileSizeNotAvailable:"\u6A94\u6848\u5927\u5C0F\u4E0D\u7B26",labelFileLoading:"\u8B80\u53D6\u4E2D",labelFileLoadError:"\u8B80\u53D6\u932F\u8AA4",labelFileProcessing:"\u4E0A\u50B3",labelFileProcessingComplete:"\u5DF2\u4E0A\u50B3",labelFileProcessingAborted:"\u4E0A\u50B3\u5DF2\u53D6\u6D88",labelFileProcessingError:"\u4E0A\u50B3\u767C\u751F\u932F\u8AA4",labelFileProcessingRevertError:"\u9084\u539F\u932F\u8AA4",labelFileRemoveError:"\u522A\u9664\u932F\u8AA4",labelTapToCancel:"\u9EDE\u64CA\u53D6\u6D88",labelTapToRetry:"\u9EDE\u64CA\u91CD\u8A66",labelTapToUndo:"\u9EDE\u64CA\u9084\u539F",labelButtonRemoveItem:"\u522A\u9664",labelButtonAbortItemLoad:"\u505C\u6B62",labelButtonRetryItemLoad:"\u91CD\u8A66",labelButtonAbortItemProcessing:"\u53D6\u6D88",labelButtonUndoItemProcessing:"\u53D6\u6D88",labelButtonRetryItemProcessing:"\u91CD\u8A66",labelButtonProcessItem:"\u4E0A\u50B3",labelMaxFileSizeExceeded:"\u6A94\u6848\u904E\u5927",labelMaxFileSize:"\u6700\u5927\u503C\uFF1A{filesize}",labelMaxTotalFileSizeExceeded:"\u8D85\u904E\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F",labelMaxTotalFileSize:"\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F\uFF1A{filesize}",labelFileTypeNotAllowed:"\u4E0D\u652F\u63F4\u6B64\u985E\u578B\u6A94\u6848",fileValidateTypeLabelExpectedTypes:"\u61C9\u70BA {allButLastType} \u6216 {lastType}",imageValidateSizeLabelFormatError:"\u4E0D\u652F\u6301\u6B64\u985E\u5716\u7247\u985E\u578B",imageValidateSizeLabelImageSizeTooSmall:"\u5716\u7247\u904E\u5C0F",imageValidateSizeLabelImageSizeTooBig:"\u5716\u7247\u904E\u5927",imageValidateSizeLabelExpectedMinSize:"\u6700\u5C0F\u5C3A\u5BF8\uFF1A{minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u6700\u5927\u5C3A\u5BF8\uFF1A{maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u89E3\u6790\u5EA6\u904E\u4F4E",imageValidateSizeLabelImageResolutionTooHigh:"\u89E3\u6790\u5EA6\u904E\u9AD8",imageValidateSizeLabelExpectedMinResolution:"\u6700\u4F4E\u89E3\u6790\u5EA6\uFF1A{minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u6700\u9AD8\u89E3\u6790\u5EA6\uFF1A{maxResolution}"};Ie(Wo);Ie(jo);Ie($o);Ie(Qo);Ie(el);Ie(pl);Ie(ul);Ie(Rl);Ie(Ma);window.FilePond=na;function uf({acceptedFileTypes:e,imageEditorEmptyFillColor:t,imageEditorMode:i,imageEditorViewportHeight:a,imageEditorViewportWidth:n,deleteUploadedFileUsing:o,isDeletable:l,isDisabled:r,getUploadedFilesUsing:s,imageCropAspectRatio:p,imagePreviewHeight:c,imageResizeMode:d,imageResizeTargetHeight:m,imageResizeTargetWidth:u,imageResizeUpscale:f,isAvatar:h,hasImageEditor:g,hasCircleCropper:v,canEditSvgs:E,isSvgEditingConfirmed:T,confirmSvgEditingMessage:I,disabledSvgEditingMessage:y,isDownloadable:b,isMultiple:w,isOpenable:x,isPreviewable:_,isReorderable:P,itemPanelAspectRatio:O,loadingIndicatorPosition:M,locale:C,maxFiles:S,maxSize:F,minSize:R,panelAspectRatio:L,panelLayout:z,placeholder:D,removeUploadedFileButtonPosition:k,removeUploadedFileUsing:B,reorderUploadedFilesUsing:X,shouldAppendFiles:q,shouldOrientImageFromExif:Q,shouldTransformImage:pe,state:G,uploadButtonPosition:H,uploadingMessage:Y,uploadProgressIndicatorPosition:le,uploadUsing:ee}){return{fileKeyIndex:{},pond:null,shouldUpdateState:!0,state:G,lastState:null,error:null,uploadedFileIndex:{},isEditorOpen:!1,editingFile:{},currentRatio:"",editor:{},init:async function(){Dt(Kl[C]??Kl.en),this.pond=ut(this.$refs.input,{acceptedFileTypes:e,allowImageExifOrientation:Q,allowPaste:!1,allowRemove:l,allowReorder:P,allowImagePreview:_,allowVideoPreview:_,allowAudioPreview:_,allowImageTransform:pe,credits:!1,files:await this.getFiles(),imageCropAspectRatio:p,imagePreviewHeight:c,imageResizeTargetHeight:m,imageResizeTargetWidth:u,imageResizeMode:d,imageResizeUpscale:f,itemInsertLocation:q?"after":"before",...D&&{labelIdle:D},maxFiles:S,maxFileSize:F,minFileSize:R,styleButtonProcessItemPosition:H,styleButtonRemoveItemPosition:k,styleItemPanelAspectRatio:O,styleLoadIndicatorPosition:M,stylePanelAspectRatio:L,stylePanelLayout:z,styleProgressIndicatorPosition:le,server:{load:async(N,U)=>{let Z=await(await fetch(N,{cache:"no-store"})).blob();U(Z)},process:(N,U,$,Z,Ve,Ge)=>{this.shouldUpdateState=!1;let Xt=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,Qt=>(Qt^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Qt/4).toString(16));ee(Xt,U,Qt=>{this.shouldUpdateState=!0,Z(Qt)},Ve,Ge)},remove:async(N,U)=>{let $=this.uploadedFileIndex[N]??null;$&&(await o($),U())},revert:async(N,U)=>{await B(N),U()}},allowImageEdit:g,imageEditEditor:{open:N=>this.loadEditor(N),onconfirm:()=>{},oncancel:()=>this.closeEditor(),onclose:()=>this.closeEditor()},fileValidateTypeDetectType:(N,U)=>new Promise(($,Z)=>{let Ve=U||Go.getType(N.name.split(".").pop());Ve?$(Ve):Z()})}),this.$watch("state",async()=>{if(this.pond&&this.shouldUpdateState&&this.state!==void 0){if(this.state!==null&&Object.values(this.state).filter(N=>N.startsWith("livewire-file:")).length){this.lastState=null;return}JSON.stringify(this.state)!==this.lastState&&(this.lastState=JSON.stringify(this.state),this.pond.files=await this.getFiles())}}),this.pond.on("reorderfiles",async N=>{let U=N.map($=>$.source instanceof File?$.serverId:this.uploadedFileIndex[$.source]??null).filter($=>$);await X(q?U:U.reverse())}),this.pond.on("initfile",async N=>{b&&(h||this.insertDownloadLink(N))}),this.pond.on("initfile",async N=>{x&&(h||this.insertOpenLink(N))}),this.pond.on("addfilestart",async N=>{N.status===Et.PROCESSING_QUEUED&&this.dispatchFormEvent("form-processing-started",{message:Y})});let V=async()=>{this.pond.getFiles().filter(N=>N.status===Et.PROCESSING||N.status===Et.PROCESSING_QUEUED).length||this.dispatchFormEvent("form-processing-finished")};this.pond.on("processfile",V),this.pond.on("processfileabort",V),this.pond.on("processfilerevert",V),z==="compact circle"&&(this.pond.on("error",N=>{this.error=`${N.main}: ${N.sub}`.replace("Expects or","Expects")}),this.pond.on("removefile",()=>this.error=null))},destroy:function(){this.destroyEditor(),ft(this.$refs.input),this.pond=null},dispatchFormEvent:function(V,N={}){this.$el.closest("form")?.dispatchEvent(new CustomEvent(V,{composed:!0,cancelable:!0,detail:N}))},getUploadedFiles:async function(){let V=await s();this.fileKeyIndex=V??{},this.uploadedFileIndex=Object.entries(this.fileKeyIndex).filter(([N,U])=>U?.url).reduce((N,[U,$])=>(N[$.url]=U,N),{})},getFiles:async function(){await this.getUploadedFiles();let V=[];for(let N of Object.values(this.fileKeyIndex))N&&V.push({source:N.url,options:{type:"local",...!N.type||_&&(/^audio/.test(N.type)||/^image/.test(N.type)||/^video/.test(N.type))?{}:{file:{name:N.name,size:N.size,type:N.type}}}});return q?V:V.reverse()},insertDownloadLink:function(V){if(V.origin!==zt.LOCAL)return;let N=this.getDownloadLink(V);N&&document.getElementById(`filepond--item-${V.id}`).querySelector(".filepond--file-info-main").prepend(N)},insertOpenLink:function(V){if(V.origin!==zt.LOCAL)return;let N=this.getOpenLink(V);N&&document.getElementById(`filepond--item-${V.id}`).querySelector(".filepond--file-info-main").prepend(N)},getDownloadLink:function(V){let N=V.source;if(!N)return;let U=document.createElement("a");return U.className="filepond--download-icon",U.href=N,U.download=V.file.name,U},getOpenLink:function(V){let N=V.source;if(!N)return;let U=document.createElement("a");return U.className="filepond--open-icon",U.href=N,U.target="_blank",U},initEditor:function(){r||g&&(this.editor=new xa(this.$refs.editor,{aspectRatio:n/a,autoCropArea:1,center:!0,crop:V=>{this.$refs.xPositionInput.value=Math.round(V.detail.x),this.$refs.yPositionInput.value=Math.round(V.detail.y),this.$refs.heightInput.value=Math.round(V.detail.height),this.$refs.widthInput.value=Math.round(V.detail.width),this.$refs.rotationInput.value=V.detail.rotate},cropBoxResizable:!0,guides:!0,highlight:!0,responsive:!0,toggleDragModeOnDblclick:!0,viewMode:i,wheelZoomRatio:.02}))},closeEditor:function(){this.editingFile={},this.isEditorOpen=!1,this.destroyEditor()},fixImageDimensions:function(V,N){if(V.type!=="image/svg+xml")return N(V);let U=new FileReader;U.onload=$=>{let Z=new DOMParser().parseFromString($.target.result,"image/svg+xml")?.querySelector("svg");if(!Z)return N(V);let Ve=["viewBox","ViewBox","viewbox"].find(Xt=>Z.hasAttribute(Xt));if(!Ve)return N(V);let Ge=Z.getAttribute(Ve).split(" ");return!Ge||Ge.length!==4?N(V):(Z.setAttribute("width",parseFloat(Ge[2])+"pt"),Z.setAttribute("height",parseFloat(Ge[3])+"pt"),N(new File([new Blob([new XMLSerializer().serializeToString(Z)],{type:"image/svg+xml"})],V.name,{type:"image/svg+xml",_relativePath:""})))},U.readAsText(V)},loadEditor:function(V){if(r||!g||!V)return;let N=V.type==="image/svg+xml";if(!E&&N){alert(y);return}T&&N&&!confirm(I)||this.fixImageDimensions(V,U=>{this.editingFile=U,this.initEditor();let $=new FileReader;$.onload=Z=>{this.isEditorOpen=!0,setTimeout(()=>this.editor.replace(Z.target.result),200)},$.readAsDataURL(V)})},getRoundedCanvas:function(V){let N=V.width,U=V.height,$=document.createElement("canvas");$.width=N,$.height=U;let Z=$.getContext("2d");return Z.imageSmoothingEnabled=!0,Z.drawImage(V,0,0,N,U),Z.globalCompositeOperation="destination-in",Z.beginPath(),Z.ellipse(N/2,U/2,N/2,U/2,0,0,2*Math.PI),Z.fill(),$},saveEditor:function(){if(r||!g)return;let V=this.editor.getCroppedCanvas({fillColor:t??"transparent",height:m,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",width:u});v&&(V=this.getRoundedCanvas(V)),V.toBlob(N=>{w&&this.pond.removeFile(this.pond.getFiles().find(U=>U.filename===this.editingFile.name)?.id,{revert:!0}),this.$nextTick(()=>{this.shouldUpdateState=!1;let U=this.editingFile.name.slice(0,this.editingFile.name.lastIndexOf(".")),$=this.editingFile.name.split(".").pop();$==="svg"&&($="png");let Z=/-v(\d+)/;Z.test(U)?U=U.replace(Z,(Ve,Ge)=>`-v${Number(Ge)+1}`):U+="-v1",this.pond.addFile(new File([N],`${U}.${$}`,{type:this.editingFile.type==="image/svg+xml"||v?"image/png":this.editingFile.type,lastModified:new Date().getTime()})).then(()=>{this.closeEditor()}).catch(()=>{this.closeEditor()})})},v?"image/png":this.editingFile.type)},destroyEditor:function(){this.editor&&typeof this.editor.destroy=="function"&&this.editor.destroy(),this.editor=null}}}var Kl={ar:wl,ca:Sl,ckb:Ll,cs:Al,da:Ml,de:Ol,en:Pl,es:Dl,fa:Fl,fi:zl,fr:Cl,hu:Nl,id:Bl,it:kl,km:Vl,nl:Gl,no:Ul,pl:Wl,pt_BR:Ri,pt_PT:Ri,ro:Hl,ru:jl,sv:Yl,tr:ql,uk:$l,vi:Xl,zh_CN:Ql,zh_TW:Zl};export{uf as default}; /*! Bundled license information: filepond/dist/filepond.esm.js: (*! - * FilePond 4.31.1 + * FilePond 4.31.4 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. *) diff --git a/public/js/filament/forms/components/markdown-editor.js b/public/js/filament/forms/components/markdown-editor.js index f42cab60..c5861840 100644 --- a/public/js/filament/forms/components/markdown-editor.js +++ b/public/js/filament/forms/components/markdown-editor.js @@ -21,7 +21,7 @@ b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e. `)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},st.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},st.prototype.onKeyPress=function(){s&&h>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Mr(n,e),l=r.scroller.scrollTop;if(!a||d)return;var u=n.options.resetSelectionOnContextMenu;u&&n.doc.sel.contains(a)==-1&>(n,wt)(n.doc,yr(a),ke);var f=i.style.cssText,m=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px; z-index: 1000; background: `+(s?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var P;g&&(P=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,P),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function J(){if(i.selectionStart!=null){var ue=n.somethingSelected(),me="\u200B"+(ue?i.value:"");i.value="\u21DA",i.value=me,t.prevInput=ue?"":"\u200B",i.selectionStart=1,i.selectionEnd=me.length,r.selForContextMenu=n.doc.sel}}function Y(){if(t.contextMenuPending==Y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=f,s&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!s||s&&h<9)&&J();var ue=0,me=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gt(n,Ll)(n):ue++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(s&&h>=9&&J(),F){dr(e);var ie=function(){_t(window,"mouseup",ie),setTimeout(Y,20)};Fe(window,"mouseup",ie)}else setTimeout(Y,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function _d(e,t){if(t=t?ge(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=B(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=u.getValue()}var i;if(e.form&&(Fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(f){f.save=r,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,r(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(_t(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var u=tt(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return u}function kd(e){e.off=_t,e.on=Fe,e.wheelEventPixels=zf,e.Doc=Mt,e.splitLines=Bt,e.countColumn=Oe,e.findColumn=Ge,e.isWordChar=we,e.Pass=Ze,e.signal=it,e.Line=Xr,e.changeEnd=xr,e.scrollbarModel=rl,e.Pos=ne,e.cmpPos=ye,e.modes=Wr,e.mimeModes=Kt,e.resolveMode=Ur,e.getMode=$r,e.modeExtensions=gr,e.extendMode=Kr,e.copyState=Vt,e.startState=Gr,e.innerMode=_n,e.commands=$n,e.keyMap=ur,e.keyName=Bl,e.isModifierKey=Rl,e.lookupKey=un,e.normalizeKeyMap=Qf,e.StringStream=at,e.SharedTextMarker=Bn,e.TextMarker=kr,e.LineWidget=Hn,e.e_preventDefault=kt,e.e_stopPropagation=Hr,e.e_stop=dr,e.addClass=le,e.contains=I,e.rmClass=Q,e.keyNames=wr}pd(tt),vd(tt);var wd="iter insert remove copy getEditor constructor".split(" ");for(var Ai in Mt.prototype)Mt.prototype.hasOwnProperty(Ai)&&Se(wd,Ai)<0&&(tt.prototype[Ai]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mt.prototype[Ai]));return Wt(Mt),tt.inputStyles={textarea:st,contenteditable:Qe},tt.defineMode=function(e){!tt.defaults.mode&&e!="null"&&(tt.defaults.mode=e),Gt.apply(this,arguments)},tt.defineMIME=Cr,tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tt.defineMIME("text/plain","null"),tt.defineExtension=function(e,t){tt.prototype[e]=t},tt.defineDocExtension=function(e,t){Mt.prototype[e]=t},tt.fromTextArea=_d,kd(tt),tt.version="5.65.16",tt})});var Yn=Ke((us,cs)=>{(function(o){typeof us=="object"&&typeof cs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(p,v,C){return{startState:function(){return{base:o.startState(p),overlay:o.startState(v),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:o.copyState(p,b.base),overlay:o.copyState(v,b.overlay),basePos:b.basePos,baseCur:null,overlayPos:b.overlayPos,overlayCur:null}},token:function(b,S){return(b!=S.streamSeen||Math.min(S.basePos,S.overlayPos){(function(o){typeof fs=="object"&&typeof ds=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,v=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,C=/[*+-]\s/;o.commands.newlineAndIndentContinueMarkdownList=function(S){if(S.getOption("disableInput"))return o.Pass;for(var s=S.listSelections(),h=[],g=0;g\s*$/.test(E),M=!/>\s*$/.test(E);(R||M)&&S.replaceRange("",{line:T.line,ch:0},{line:T.line,ch:T.ch+1}),h[g]=` + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var P;g&&(P=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,P),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function J(){if(i.selectionStart!=null){var ue=n.somethingSelected(),me="\u200B"+(ue?i.value:"");i.value="\u21DA",i.value=me,t.prevInput=ue?"":"\u200B",i.selectionStart=1,i.selectionEnd=me.length,r.selForContextMenu=n.doc.sel}}function Y(){if(t.contextMenuPending==Y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=f,s&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!s||s&&h<9)&&J();var ue=0,me=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gt(n,Ll)(n):ue++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(s&&h>=9&&J(),F){dr(e);var ie=function(){_t(window,"mouseup",ie),setTimeout(Y,20)};Fe(window,"mouseup",ie)}else setTimeout(Y,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function _d(e,t){if(t=t?ge(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=B(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=u.getValue()}var i;if(e.form&&(Fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(f){f.save=r,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,r(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(_t(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var u=tt(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return u}function kd(e){e.off=_t,e.on=Fe,e.wheelEventPixels=zf,e.Doc=Mt,e.splitLines=Bt,e.countColumn=Oe,e.findColumn=Ge,e.isWordChar=we,e.Pass=Ze,e.signal=it,e.Line=Xr,e.changeEnd=xr,e.scrollbarModel=rl,e.Pos=ne,e.cmpPos=ye,e.modes=Wr,e.mimeModes=Kt,e.resolveMode=Ur,e.getMode=$r,e.modeExtensions=gr,e.extendMode=Kr,e.copyState=Vt,e.startState=Gr,e.innerMode=_n,e.commands=$n,e.keyMap=ur,e.keyName=Bl,e.isModifierKey=Rl,e.lookupKey=un,e.normalizeKeyMap=Qf,e.StringStream=at,e.SharedTextMarker=Bn,e.TextMarker=kr,e.LineWidget=Hn,e.e_preventDefault=kt,e.e_stopPropagation=Hr,e.e_stop=dr,e.addClass=le,e.contains=I,e.rmClass=Q,e.keyNames=wr}pd(tt),vd(tt);var wd="iter insert remove copy getEditor constructor".split(" ");for(var Ai in Mt.prototype)Mt.prototype.hasOwnProperty(Ai)&&Se(wd,Ai)<0&&(tt.prototype[Ai]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mt.prototype[Ai]));return Wt(Mt),tt.inputStyles={textarea:st,contenteditable:Qe},tt.defineMode=function(e){!tt.defaults.mode&&e!="null"&&(tt.defaults.mode=e),Gt.apply(this,arguments)},tt.defineMIME=Cr,tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tt.defineMIME("text/plain","null"),tt.defineExtension=function(e,t){tt.prototype[e]=t},tt.defineDocExtension=function(e,t){Mt.prototype[e]=t},tt.fromTextArea=_d,kd(tt),tt.version="5.65.18",tt})});var Yn=Ke((us,cs)=>{(function(o){typeof us=="object"&&typeof cs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(p,v,C){return{startState:function(){return{base:o.startState(p),overlay:o.startState(v),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:o.copyState(p,b.base),overlay:o.copyState(v,b.overlay),basePos:b.basePos,baseCur:null,overlayPos:b.overlayPos,overlayCur:null}},token:function(b,S){return(b!=S.streamSeen||Math.min(S.basePos,S.overlayPos){(function(o){typeof fs=="object"&&typeof ds=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,v=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,C=/[*+-]\s/;o.commands.newlineAndIndentContinueMarkdownList=function(S){if(S.getOption("disableInput"))return o.Pass;for(var s=S.listSelections(),h=[],g=0;g\s*$/.test(E),M=!/>\s*$/.test(E);(R||M)&&S.replaceRange("",{line:T.line,ch:0},{line:T.line,ch:T.ch+1}),h[g]=` `}else{var H=z[1],Z=z[5],ee=!(C.test(z[2])||z[2].indexOf(">")>=0),re=ee?parseInt(z[3],10)+1+z[4]:z[2].replace("x"," ");h[g]=` `+H+re+Z,ee&&b(S,T)}}S.replaceSelections(h)};function b(S,s){var h=s.line,g=0,T=0,x=p.exec(S.getLine(h)),c=x[1];do{g+=1;var d=h+g,w=S.getLine(d),E=p.exec(w);if(E){var z=E[1],y=parseInt(x[3],10)+g-T,R=parseInt(E[3],10),M=R;if(c===z&&!isNaN(R))y===R&&(M=R+1),y>R&&(M=y+1),S.replaceRange(w.replace(p,z+M+E[4]+E[5]),{line:d,ch:0},{line:d,ch:w.length});else{if(c.length>z.length||c.length{(function(o){typeof hs=="object"&&typeof gs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(h,g,T){var x=T&&T!=o.Init;if(g&&!x)h.on("blur",b),h.on("change",S),h.on("swapDoc",S),o.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){C(h)}),S(h);else if(!g&&x){h.off("blur",b),h.off("change",S),h.off("swapDoc",S),o.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),p(h);var c=h.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}g&&!h.hasFocus()&&b(h)});function p(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function v(h){p(h);var g=h.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=h.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var T=h.getOption("placeholder");typeof T=="string"&&(T=document.createTextNode(T)),g.appendChild(T),h.display.lineSpace.insertBefore(g,h.display.lineSpace.firstChild)}function C(h){setTimeout(function(){var g=!1;if(h.lineCount()==1){var T=h.getInputField();g=T.nodeName=="TEXTAREA"?!h.getLine(0).length:!/[^\u200b]/.test(T.querySelector(".CodeMirror-line").textContent)}g?v(h):p(h)},20)}function b(h){s(h)&&v(h)}function S(h){var g=h.getWrapperElement(),T=s(h);g.className=g.className.replace(" CodeMirror-empty","")+(T?" CodeMirror-empty":""),T?v(h):p(h)}function s(h){return h.lineCount()===1&&h.getLine(0)===""}})});var ys=Ke((vs,bs)=>{(function(o){typeof vs=="object"&&typeof bs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(x,c,d){var w=d&&d!=o.Init;c&&!w?(x.state.markedSelection=[],x.state.markedSelectionStyle=typeof c=="string"?c:"CodeMirror-selectedtext",g(x),x.on("cursorActivity",p),x.on("change",v)):!c&&w&&(x.off("cursorActivity",p),x.off("change",v),h(x),x.state.markedSelection=x.state.markedSelectionStyle=null)});function p(x){x.state.markedSelection&&x.operation(function(){T(x)})}function v(x){x.state.markedSelection&&x.state.markedSelection.length&&x.operation(function(){h(x)})}var C=8,b=o.Pos,S=o.cmpPos;function s(x,c,d,w){if(S(c,d)!=0)for(var E=x.state.markedSelection,z=x.state.markedSelectionStyle,y=c.line;;){var R=y==c.line?c:b(y,0),M=y+C,H=M>=d.line,Z=H?d:b(M,0),ee=x.markText(R,Z,{className:z});if(w==null?E.push(ee):E.splice(w++,0,ee),H)break;y=M}}function h(x){for(var c=x.state.markedSelection,d=0;d1)return g(x);var c=x.getCursor("start"),d=x.getCursor("end"),w=x.state.markedSelection;if(!w.length)return s(x,c,d);var E=w[0].find(),z=w[w.length-1].find();if(!E||!z||d.line-c.line<=C||S(c,z.to)>=0||S(d,E.from)<=0)return g(x);for(;S(c,E.from)>0;)w.shift().clear(),E=w[0].find();for(S(c,E.from)<0&&(E.to.line-c.line0&&(d.line-z.from.line{(function(o){typeof xs=="object"&&typeof _s=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=o.Pos;function v(y){var R=y.flags;return R??(y.ignoreCase?"i":"")+(y.global?"g":"")+(y.multiline?"m":"")}function C(y,R){for(var M=v(y),H=M,Z=0;Zre);N++){var F=y.getLine(ee++);H=H==null?F:H+` `+F}Z=Z*2,R.lastIndex=M.ch;var D=R.exec(H);if(D){var Q=H.slice(0,D.index).split(` diff --git a/public/js/filament/forms/components/rich-editor.js b/public/js/filament/forms/components/rich-editor.js index 3ad59a01..712b5c65 100644 --- a/public/js/filament/forms/components/rich-editor.js +++ b/public/js/filament/forms/components/rich-editor.js @@ -1,4 +1,4 @@ -var Mi="2.1.4",K="[data-trix-attachment]",je={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},y={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(n){return Je(n.parentNode)===y[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(n){return Je(n.parentNode)===y[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},Je=n=>{var t;return n==null||(t=n.tagName)===null||t===void 0?void 0:t.toLowerCase()},Ke=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),se=Ke&&parseInt(Ke[1]),St={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:se&&se>12,samsungAndroid:se&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(n=>n in InputEvent.prototype)},h={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},ji=[h.bytes,h.KB,h.MB,h.GB,h.TB,h.PB],vi={prefix:"IEC",precision:2,formatter(n){switch(n){case 0:return"0 ".concat(h.bytes);case 1:return"1 ".concat(h.byte);default:let t;this.prefix==="SI"?t=1e3:this.prefix==="IEC"&&(t=1024);let e=Math.floor(Math.log(n)/Math.log(t)),i=(n/Math.pow(t,e)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(i," ").concat(ji[e])}}},te="\uFEFF",U="\xA0",Ai=function(n){for(let t in n){let e=n[t];this[t]=e}return this},We=document.documentElement,Wi=We.matches,p=function(n){let{onElement:t,matchingSelector:e,withCallback:i,inPhase:r,preventDefault:o,times:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t||We,l=e,c=r==="capturing",u=function(b){s!=null&&--s==0&&u.destroy();let A=q(b.target,{matchingSelector:l});A!=null&&(i?.call(A,b,A),o&&b.preventDefault())};return u.destroy=()=>a.removeEventListener(n,u,c),a.addEventListener(n,u,c),u},vt=function(n){let{onElement:t,bubbles:e,cancelable:i,attributes:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t??We;e=e!==!1,i=i!==!1;let s=document.createEvent("Events");return s.initEvent(n,e,i),r!=null&&Ai.call(s,r),o.dispatchEvent(s)},xi=function(n,t){if(n?.nodeType===1)return Wi.call(n,t)},q=function(n){let{matchingSelector:t,untilNode:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;n&&n.nodeType!==Node.ELEMENT_NODE;)n=n.parentNode;if(n!=null){if(t==null)return n;if(n.closest&&e==null)return n.closest(t);for(;n&&n!==e;){if(xi(n,t))return n;n=n.parentNode}}},Ue=n=>document.activeElement!==n&&J(n,document.activeElement),J=function(n,t){if(n&&t)for(;t;){if(t===n)return!0;t=t.parentNode}},ae=function(n){var t;if((t=n)===null||t===void 0||!t.parentNode)return;let e=0;for(n=n.previousSibling;n;)e++,n=n.previousSibling;return e},V=n=>{var t;return n==null||(t=n.parentNode)===null||t===void 0?void 0:t.removeChild(n)},Ft=function(n){let{onlyNodesOfType:t,usingFilter:e,expandEntityReferences:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(()=>{switch(t){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(n,r,e??null,i===!0)},x=n=>{var t;return n==null||(t=n.tagName)===null||t===void 0?void 0:t.toLowerCase()},d=function(n){let t,e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof n=="object"?(i=n,n=i.tagName):i={attributes:i};let r=document.createElement(n);if(i.editable!=null&&(i.attributes==null&&(i.attributes={}),i.attributes.contenteditable=i.editable),i.attributes)for(t in i.attributes)e=i.attributes[t],r.setAttribute(t,e);if(i.style)for(t in i.style)e=i.style[t],r.style[t]=e;if(i.data)for(t in i.data)e=i.data[t],r.dataset[t]=e;return i.className&&i.className.split(" ").forEach(o=>{r.classList.add(o)}),i.textContent&&(r.textContent=i.textContent),i.childNodes&&[].concat(i.childNodes).forEach(o=>{r.appendChild(o)}),r},pt,At=function(){if(pt!=null)return pt;pt=[];for(let n in y){let t=y[n];t.tagName&&pt.push(t.tagName)}return pt},le=n=>ot(n?.firstChild),$e=function(n){let{strict:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return t?ot(n):ot(n)||!ot(n.firstChild)&&function(e){return At().includes(x(e))&&!At().includes(x(e.firstChild))}(n)},ot=n=>Ui(n)&&n?.data==="block",Ui=n=>n?.nodeType===Node.COMMENT_NODE,st=function(n){let{name:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n)return xt(n)?n.data===te?!t||n.parentNode.dataset.trixCursorTarget===t:void 0:st(n.firstChild)},$=n=>xi(n,K),yi=n=>xt(n)&&n?.data==="",xt=n=>n?.nodeType===Node.TEXT_NODE,qe={level2Enabled:!0,getLevel(){return this.level2Enabled&&St.supportsInputEvents?2:0},pickFiles(n){let t=d("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});t.addEventListener("change",()=>{n(t.files),V(t)}),V(document.getElementById(this.fileInputId)),document.body.appendChild(t),t.click()}},Tt={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` +var Mi="2.1.5",K="[data-trix-attachment]",je={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},y={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(n){return Je(n.parentNode)===y[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(n){return Je(n.parentNode)===y[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},Je=n=>{var t;return n==null||(t=n.tagName)===null||t===void 0?void 0:t.toLowerCase()},Ke=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),se=Ke&&parseInt(Ke[1]),St={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:se&&se>12,samsungAndroid:se&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(n=>n in InputEvent.prototype)},h={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},ji=[h.bytes,h.KB,h.MB,h.GB,h.TB,h.PB],vi={prefix:"IEC",precision:2,formatter(n){switch(n){case 0:return"0 ".concat(h.bytes);case 1:return"1 ".concat(h.byte);default:let t;this.prefix==="SI"?t=1e3:this.prefix==="IEC"&&(t=1024);let e=Math.floor(Math.log(n)/Math.log(t)),i=(n/Math.pow(t,e)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(i," ").concat(ji[e])}}},te="\uFEFF",U="\xA0",Ai=function(n){for(let t in n){let e=n[t];this[t]=e}return this},We=document.documentElement,Wi=We.matches,p=function(n){let{onElement:t,matchingSelector:e,withCallback:i,inPhase:r,preventDefault:o,times:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=t||We,l=e,c=r==="capturing",u=function(b){s!=null&&--s==0&&u.destroy();let A=q(b.target,{matchingSelector:l});A!=null&&(i?.call(A,b,A),o&&b.preventDefault())};return u.destroy=()=>a.removeEventListener(n,u,c),a.addEventListener(n,u,c),u},vt=function(n){let{onElement:t,bubbles:e,cancelable:i,attributes:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t??We;e=e!==!1,i=i!==!1;let s=document.createEvent("Events");return s.initEvent(n,e,i),r!=null&&Ai.call(s,r),o.dispatchEvent(s)},xi=function(n,t){if(n?.nodeType===1)return Wi.call(n,t)},q=function(n){let{matchingSelector:t,untilNode:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;n&&n.nodeType!==Node.ELEMENT_NODE;)n=n.parentNode;if(n!=null){if(t==null)return n;if(n.closest&&e==null)return n.closest(t);for(;n&&n!==e;){if(xi(n,t))return n;n=n.parentNode}}},Ue=n=>document.activeElement!==n&&J(n,document.activeElement),J=function(n,t){if(n&&t)for(;t;){if(t===n)return!0;t=t.parentNode}},ae=function(n){var t;if((t=n)===null||t===void 0||!t.parentNode)return;let e=0;for(n=n.previousSibling;n;)e++,n=n.previousSibling;return e},V=n=>{var t;return n==null||(t=n.parentNode)===null||t===void 0?void 0:t.removeChild(n)},Ft=function(n){let{onlyNodesOfType:t,usingFilter:e,expandEntityReferences:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(()=>{switch(t){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(n,r,e??null,i===!0)},x=n=>{var t;return n==null||(t=n.tagName)===null||t===void 0?void 0:t.toLowerCase()},d=function(n){let t,e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof n=="object"?(i=n,n=i.tagName):i={attributes:i};let r=document.createElement(n);if(i.editable!=null&&(i.attributes==null&&(i.attributes={}),i.attributes.contenteditable=i.editable),i.attributes)for(t in i.attributes)e=i.attributes[t],r.setAttribute(t,e);if(i.style)for(t in i.style)e=i.style[t],r.style[t]=e;if(i.data)for(t in i.data)e=i.data[t],r.dataset[t]=e;return i.className&&i.className.split(" ").forEach(o=>{r.classList.add(o)}),i.textContent&&(r.textContent=i.textContent),i.childNodes&&[].concat(i.childNodes).forEach(o=>{r.appendChild(o)}),r},pt,At=function(){if(pt!=null)return pt;pt=[];for(let n in y){let t=y[n];t.tagName&&pt.push(t.tagName)}return pt},le=n=>ot(n?.firstChild),$e=function(n){let{strict:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return t?ot(n):ot(n)||!ot(n.firstChild)&&function(e){return At().includes(x(e))&&!At().includes(x(e.firstChild))}(n)},ot=n=>Ui(n)&&n?.data==="block",Ui=n=>n?.nodeType===Node.COMMENT_NODE,st=function(n){let{name:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n)return xt(n)?n.data===te?!t||n.parentNode.dataset.trixCursorTarget===t:void 0:st(n.firstChild)},$=n=>xi(n,K),yi=n=>xt(n)&&n?.data==="",xt=n=>n?.nodeType===Node.TEXT_NODE,qe={level2Enabled:!0,getLevel(){return this.level2Enabled&&St.supportsInputEvents?2:0},pickFiles(n){let t=d("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});t.addEventListener("change",()=>{n(t.files),V(t)}),V(document.getElementById(this.fileInputId)),document.body.appendChild(t),t.click()}},Tt={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` `},Y={bold:{tagName:"strong",inheritable:!0,parser(n){let t=window.getComputedStyle(n);return t.fontWeight==="bold"||t.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:n=>window.getComputedStyle(n).fontStyle==="italic"},href:{groupTagName:"a",parser(n){let t="a:not(".concat(K,")"),e=n.closest(t);if(e)return e.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},Ci={getDefaultHTML:()=>`
@@ -93,7 +93,7 @@ var Mi="2.1.4",K="[data-trix-attachment]",je={preview:{presentation:"gallery",ca display: block; } -%t:empty:not(:focus)::before { +%t:empty::before { content: attr(placeholder); color: graytext; cursor: text; diff --git a/public/js/filament/support/support.js b/public/js/filament/support/support.js index 1a088c96..9616ced7 100644 --- a/public/js/filament/support/support.js +++ b/public/js/filament/support/support.js @@ -1,28 +1,28 @@ -(()=>{var jo=Object.create;var Di=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Ho=Object.getOwnPropertyNames;var $o=Object.getPrototypeOf,Wo=Object.prototype.hasOwnProperty;var Kr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Vo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ho(e))!Wo.call(t,i)&&i!==r&&Di(t,i,{get:()=>e[i],enumerable:!(n=Bo(e,i))||n.enumerable});return t};var zo=(t,e,r)=>(r=t!=null?jo($o(t)):{},Vo(e||!t||!t.__esModule?Di(r,"default",{value:t,enumerable:!0}):r,t));var oo=Kr(()=>{});var ao=Kr(()=>{});var so=Kr((Os,yr)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var l=!n.JS_MD5_NO_COMMON_JS&&typeof yr=="object"&&yr.exports,h=typeof define=="function"&&define.amd,u=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",f="0123456789abcdef".split(""),y=[128,32768,8388608,-2147483648],b=[0,8,16,24],A=["hex","array","digest","buffer","arrayBuffer","base64"],E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),O=[],P;if(u){var R=new ArrayBuffer(68);P=new Uint8Array(R),O=new Uint32Array(R)}var $=Array.isArray;(n.JS_MD5_NO_NODE_JS||!$)&&($=function(s){return Object.prototype.toString.call(s)==="[object Array]"});var B=ArrayBuffer.isView;u&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!B)&&(B=function(s){return typeof s=="object"&&s.buffer&&s.buffer.constructor===ArrayBuffer});var K=function(s){var p=typeof s;if(p==="string")return[s,!0];if(p!=="object"||s===null)throw new Error(t);if(u&&s.constructor===ArrayBuffer)return[new Uint8Array(s),!1];if(!$(s)&&!B(s))throw new Error(t);return[s,!1]},X=function(s){return function(p){return new U(!0).update(p)[s]()}},ne=function(){var s=X("hex");o&&(s=J(s)),s.create=function(){return new U},s.update=function(d){return s.create().update(d)};for(var p=0;p>>6,Ue[_++]=128|d&63):d<55296||d>=57344?(Ue[_++]=224|d>>>12,Ue[_++]=128|d>>>6&63,Ue[_++]=128|d&63):(d=65536+((d&1023)<<10|s.charCodeAt(++N)&1023),Ue[_++]=240|d>>>18,Ue[_++]=128|d>>>12&63,Ue[_++]=128|d>>>6&63,Ue[_++]=128|d&63);else for(_=this.start;N>>2]|=d<>>2]|=(192|d>>>6)<>>2]|=(128|d&63)<=57344?(Q[_>>>2]|=(224|d>>>12)<>>2]|=(128|d>>>6&63)<>>2]|=(128|d&63)<>>2]|=(240|d>>>18)<>>2]|=(128|d>>>12&63)<>>2]|=(128|d>>>6&63)<>>2]|=(128|d&63)<>>2]|=s[N]<=64?(this.start=_-64,this.hash(),this.hashed=!0):this.start=_}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},U.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var s=this.blocks,p=this.lastByteIndex;s[p>>>2]|=y[p&3],p>=56&&(this.hashed||this.hash(),s[0]=s[16],s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),s[14]=this.bytes<<3,s[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},U.prototype.hash=function(){var s,p,v,d,N,_,M=this.blocks;this.first?(s=M[0]-680876937,s=(s<<7|s>>>25)-271733879<<0,d=(-1732584194^s&2004318071)+M[1]-117830708,d=(d<<12|d>>>20)+s<<0,v=(-271733879^d&(s^-271733879))+M[2]-1126478375,v=(v<<17|v>>>15)+d<<0,p=(s^v&(d^s))+M[3]-1316259209,p=(p<<22|p>>>10)+v<<0):(s=this.h0,p=this.h1,v=this.h2,d=this.h3,s+=(d^p&(v^d))+M[0]-680876936,s=(s<<7|s>>>25)+p<<0,d+=(v^s&(p^v))+M[1]-389564586,d=(d<<12|d>>>20)+s<<0,v+=(p^d&(s^p))+M[2]+606105819,v=(v<<17|v>>>15)+d<<0,p+=(s^v&(d^s))+M[3]-1044525330,p=(p<<22|p>>>10)+v<<0),s+=(d^p&(v^d))+M[4]-176418897,s=(s<<7|s>>>25)+p<<0,d+=(v^s&(p^v))+M[5]+1200080426,d=(d<<12|d>>>20)+s<<0,v+=(p^d&(s^p))+M[6]-1473231341,v=(v<<17|v>>>15)+d<<0,p+=(s^v&(d^s))+M[7]-45705983,p=(p<<22|p>>>10)+v<<0,s+=(d^p&(v^d))+M[8]+1770035416,s=(s<<7|s>>>25)+p<<0,d+=(v^s&(p^v))+M[9]-1958414417,d=(d<<12|d>>>20)+s<<0,v+=(p^d&(s^p))+M[10]-42063,v=(v<<17|v>>>15)+d<<0,p+=(s^v&(d^s))+M[11]-1990404162,p=(p<<22|p>>>10)+v<<0,s+=(d^p&(v^d))+M[12]+1804603682,s=(s<<7|s>>>25)+p<<0,d+=(v^s&(p^v))+M[13]-40341101,d=(d<<12|d>>>20)+s<<0,v+=(p^d&(s^p))+M[14]-1502002290,v=(v<<17|v>>>15)+d<<0,p+=(s^v&(d^s))+M[15]+1236535329,p=(p<<22|p>>>10)+v<<0,s+=(v^d&(p^v))+M[1]-165796510,s=(s<<5|s>>>27)+p<<0,d+=(p^v&(s^p))+M[6]-1069501632,d=(d<<9|d>>>23)+s<<0,v+=(s^p&(d^s))+M[11]+643717713,v=(v<<14|v>>>18)+d<<0,p+=(d^s&(v^d))+M[0]-373897302,p=(p<<20|p>>>12)+v<<0,s+=(v^d&(p^v))+M[5]-701558691,s=(s<<5|s>>>27)+p<<0,d+=(p^v&(s^p))+M[10]+38016083,d=(d<<9|d>>>23)+s<<0,v+=(s^p&(d^s))+M[15]-660478335,v=(v<<14|v>>>18)+d<<0,p+=(d^s&(v^d))+M[4]-405537848,p=(p<<20|p>>>12)+v<<0,s+=(v^d&(p^v))+M[9]+568446438,s=(s<<5|s>>>27)+p<<0,d+=(p^v&(s^p))+M[14]-1019803690,d=(d<<9|d>>>23)+s<<0,v+=(s^p&(d^s))+M[3]-187363961,v=(v<<14|v>>>18)+d<<0,p+=(d^s&(v^d))+M[8]+1163531501,p=(p<<20|p>>>12)+v<<0,s+=(v^d&(p^v))+M[13]-1444681467,s=(s<<5|s>>>27)+p<<0,d+=(p^v&(s^p))+M[2]-51403784,d=(d<<9|d>>>23)+s<<0,v+=(s^p&(d^s))+M[7]+1735328473,v=(v<<14|v>>>18)+d<<0,p+=(d^s&(v^d))+M[12]-1926607734,p=(p<<20|p>>>12)+v<<0,N=p^v,s+=(N^d)+M[5]-378558,s=(s<<4|s>>>28)+p<<0,d+=(N^s)+M[8]-2022574463,d=(d<<11|d>>>21)+s<<0,_=d^s,v+=(_^p)+M[11]+1839030562,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[14]-35309556,p=(p<<23|p>>>9)+v<<0,N=p^v,s+=(N^d)+M[1]-1530992060,s=(s<<4|s>>>28)+p<<0,d+=(N^s)+M[4]+1272893353,d=(d<<11|d>>>21)+s<<0,_=d^s,v+=(_^p)+M[7]-155497632,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[10]-1094730640,p=(p<<23|p>>>9)+v<<0,N=p^v,s+=(N^d)+M[13]+681279174,s=(s<<4|s>>>28)+p<<0,d+=(N^s)+M[0]-358537222,d=(d<<11|d>>>21)+s<<0,_=d^s,v+=(_^p)+M[3]-722521979,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[6]+76029189,p=(p<<23|p>>>9)+v<<0,N=p^v,s+=(N^d)+M[9]-640364487,s=(s<<4|s>>>28)+p<<0,d+=(N^s)+M[12]-421815835,d=(d<<11|d>>>21)+s<<0,_=d^s,v+=(_^p)+M[15]+530742520,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[2]-995338651,p=(p<<23|p>>>9)+v<<0,s+=(v^(p|~d))+M[0]-198630844,s=(s<<6|s>>>26)+p<<0,d+=(p^(s|~v))+M[7]+1126891415,d=(d<<10|d>>>22)+s<<0,v+=(s^(d|~p))+M[14]-1416354905,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~s))+M[5]-57434055,p=(p<<21|p>>>11)+v<<0,s+=(v^(p|~d))+M[12]+1700485571,s=(s<<6|s>>>26)+p<<0,d+=(p^(s|~v))+M[3]-1894986606,d=(d<<10|d>>>22)+s<<0,v+=(s^(d|~p))+M[10]-1051523,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~s))+M[1]-2054922799,p=(p<<21|p>>>11)+v<<0,s+=(v^(p|~d))+M[8]+1873313359,s=(s<<6|s>>>26)+p<<0,d+=(p^(s|~v))+M[15]-30611744,d=(d<<10|d>>>22)+s<<0,v+=(s^(d|~p))+M[6]-1560198380,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~s))+M[13]+1309151649,p=(p<<21|p>>>11)+v<<0,s+=(v^(p|~d))+M[4]-145523070,s=(s<<6|s>>>26)+p<<0,d+=(p^(s|~v))+M[11]-1120210379,d=(d<<10|d>>>22)+s<<0,v+=(s^(d|~p))+M[2]+718787259,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~s))+M[9]-343485551,p=(p<<21|p>>>11)+v<<0,this.first?(this.h0=s+1732584193<<0,this.h1=p-271733879<<0,this.h2=v-1732584194<<0,this.h3=d+271733878<<0,this.first=!1):(this.h0=this.h0+s<<0,this.h1=this.h1+p<<0,this.h2=this.h2+v<<0,this.h3=this.h3+d<<0)},U.prototype.hex=function(){this.finalize();var s=this.h0,p=this.h1,v=this.h2,d=this.h3;return f[s>>>4&15]+f[s&15]+f[s>>>12&15]+f[s>>>8&15]+f[s>>>20&15]+f[s>>>16&15]+f[s>>>28&15]+f[s>>>24&15]+f[p>>>4&15]+f[p&15]+f[p>>>12&15]+f[p>>>8&15]+f[p>>>20&15]+f[p>>>16&15]+f[p>>>28&15]+f[p>>>24&15]+f[v>>>4&15]+f[v&15]+f[v>>>12&15]+f[v>>>8&15]+f[v>>>20&15]+f[v>>>16&15]+f[v>>>28&15]+f[v>>>24&15]+f[d>>>4&15]+f[d&15]+f[d>>>12&15]+f[d>>>8&15]+f[d>>>20&15]+f[d>>>16&15]+f[d>>>28&15]+f[d>>>24&15]},U.prototype.toString=U.prototype.hex,U.prototype.digest=function(){this.finalize();var s=this.h0,p=this.h1,v=this.h2,d=this.h3;return[s&255,s>>>8&255,s>>>16&255,s>>>24&255,p&255,p>>>8&255,p>>>16&255,p>>>24&255,v&255,v>>>8&255,v>>>16&255,v>>>24&255,d&255,d>>>8&255,d>>>16&255,d>>>24&255]},U.prototype.array=U.prototype.digest,U.prototype.arrayBuffer=function(){this.finalize();var s=new ArrayBuffer(16),p=new Uint32Array(s);return p[0]=this.h0,p[1]=this.h1,p[2]=this.h2,p[3]=this.h3,s},U.prototype.buffer=U.prototype.arrayBuffer,U.prototype.base64=function(){for(var s,p,v,d="",N=this.array(),_=0;_<15;)s=N[_++],p=N[_++],v=N[_++],d+=E[s>>>2]+E[(s<<4|p>>>4)&63]+E[(p<<2|v>>>6)&63]+E[v&63];return s=N[_],d+=E[s>>>2]+E[s<<4&63]+"==",d};function Z(s,p){var v,d=K(s);if(s=d[0],d[1]){var N=[],_=s.length,M=0,Q;for(v=0;v<_;++v)Q=s.charCodeAt(v),Q<128?N[M++]=Q:Q<2048?(N[M++]=192|Q>>>6,N[M++]=128|Q&63):Q<55296||Q>=57344?(N[M++]=224|Q>>>12,N[M++]=128|Q>>>6&63,N[M++]=128|Q&63):(Q=65536+((Q&1023)<<10|s.charCodeAt(++v)&1023),N[M++]=240|Q>>>18,N[M++]=128|Q>>>12&63,N[M++]=128|Q>>>6&63,N[M++]=128|Q&63);s=N}s.length>64&&(s=new U(!0).update(s).array());var Ue=[],Rt=[];for(v=0;v<64;++v){var Vt=s[v]||0;Ue[v]=92^Vt,Rt[v]=54^Vt}U.call(this,p),this.update(Rt),this.oKeyPad=Ue,this.inner=!0,this.sharedMemory=p}Z.prototype=new U,Z.prototype.finalize=function(){if(U.prototype.finalize.call(this),this.inner){this.inner=!1;var s=this.array();U.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(s),U.prototype.finalize.call(this)}};var me=ne();me.md5=me,me.md5.hmac=de(),l?yr.exports=me:(n.md5=me,h&&define(function(){return me}))})()});var ji=["top","right","bottom","left"],Ti=["start","end"],_i=ji.reduce((t,e)=>t.concat(e,e+"-"+Ti[0],e+"-"+Ti[1]),[]),Et=Math.min,tt=Math.max,hr=Math.round,pr=Math.floor,nn=t=>({x:t,y:t}),Uo={left:"right",right:"left",bottom:"top",top:"bottom"},Yo={start:"end",end:"start"};function Jr(t,e,r){return tt(t,Et(e,r))}function jt(t,e){return typeof t=="function"?t(e):t}function pt(t){return t.split("-")[0]}function xt(t){return t.split("-")[1]}function Bi(t){return t==="x"?"y":"x"}function Zr(t){return t==="y"?"height":"width"}function Pn(t){return["top","bottom"].includes(pt(t))?"y":"x"}function Qr(t){return Bi(Pn(t))}function Hi(t,e,r){r===void 0&&(r=!1);let n=xt(t),i=Qr(t),o=Zr(i),l=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=mr(l)),[l,mr(l)]}function Xo(t){let e=mr(t);return[vr(t),e,vr(e)]}function vr(t){return t.replace(/start|end/g,e=>Yo[e])}function qo(t,e,r){let n=["left","right"],i=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?o:l;default:return[]}}function Go(t,e,r,n){let i=xt(t),o=qo(pt(t),r==="start",n);return i&&(o=o.map(l=>l+"-"+i),e&&(o=o.concat(o.map(vr)))),o}function mr(t){return t.replace(/left|right|bottom|top/g,e=>Uo[e])}function Ko(t){return{top:0,right:0,bottom:0,left:0,...t}}function ei(t){return typeof t!="number"?Ko(t):{top:t,right:t,bottom:t,left:t}}function Dn(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Pi(t,e,r){let{reference:n,floating:i}=t,o=Pn(e),l=Qr(e),h=Zr(l),u=pt(e),f=o==="y",y=n.x+n.width/2-i.width/2,b=n.y+n.height/2-i.height/2,A=n[h]/2-i[h]/2,E;switch(u){case"top":E={x:y,y:n.y-i.height};break;case"bottom":E={x:y,y:n.y+n.height};break;case"right":E={x:n.x+n.width,y:b};break;case"left":E={x:n.x-i.width,y:b};break;default:E={x:n.x,y:n.y}}switch(xt(e)){case"start":E[l]-=A*(r&&f?-1:1);break;case"end":E[l]+=A*(r&&f?-1:1);break}return E}var Jo=async(t,e,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:l}=r,h=o.filter(Boolean),u=await(l.isRTL==null?void 0:l.isRTL(e)),f=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:y,y:b}=Pi(f,n,u),A=n,E={},O=0;for(let P=0;P({name:"arrow",options:t,async fn(e){let{x:r,y:n,placement:i,rects:o,platform:l,elements:h,middlewareData:u}=e,{element:f,padding:y=0}=jt(t,e)||{};if(f==null)return{};let b=ei(y),A={x:r,y:n},E=Qr(i),O=Zr(E),P=await l.getDimensions(f),R=E==="y",$=R?"top":"left",B=R?"bottom":"right",K=R?"clientHeight":"clientWidth",X=o.reference[O]+o.reference[E]-A[E]-o.floating[O],ne=A[E]-o.reference[E],J=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f)),V=J?J[K]:0;(!V||!await(l.isElement==null?void 0:l.isElement(J)))&&(V=h.floating[K]||o.floating[O]);let de=X/2-ne/2,U=V/2-P[O]/2-1,Z=Et(b[$],U),me=Et(b[B],U),s=Z,p=V-P[O]-me,v=V/2-P[O]/2+de,d=Jr(s,v,p),N=!u.arrow&&xt(i)!=null&&v!==d&&o.reference[O]/2-(vxt(i)===t),...r.filter(i=>xt(i)!==t)]:r.filter(i=>pt(i)===i)).filter(i=>t?xt(i)===t||(e?vr(i)!==i:!1):!0)}var ea=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,n,i;let{rects:o,middlewareData:l,placement:h,platform:u,elements:f}=e,{crossAxis:y=!1,alignment:b,allowedPlacements:A=_i,autoAlignment:E=!0,...O}=jt(t,e),P=b!==void 0||A===_i?Qo(b||null,E,A):A,R=await Tn(e,O),$=((r=l.autoPlacement)==null?void 0:r.index)||0,B=P[$];if(B==null)return{};let K=Hi(B,o,await(u.isRTL==null?void 0:u.isRTL(f.floating)));if(h!==B)return{reset:{placement:P[0]}};let X=[R[pt(B)],R[K[0]],R[K[1]]],ne=[...((n=l.autoPlacement)==null?void 0:n.overflows)||[],{placement:B,overflows:X}],J=P[$+1];if(J)return{data:{index:$+1,overflows:ne},reset:{placement:J}};let V=ne.map(Z=>{let me=xt(Z.placement);return[Z.placement,me&&y?Z.overflows.slice(0,2).reduce((s,p)=>s+p,0):Z.overflows[0],Z.overflows]}).sort((Z,me)=>Z[1]-me[1]),U=((i=V.filter(Z=>Z[2].slice(0,xt(Z[0])?2:3).every(me=>me<=0))[0])==null?void 0:i[0])||V[0][0];return U!==h?{data:{index:$+1,overflows:ne},reset:{placement:U}}:{}}}},ta=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;let{placement:i,middlewareData:o,rects:l,initialPlacement:h,platform:u,elements:f}=e,{mainAxis:y=!0,crossAxis:b=!0,fallbackPlacements:A,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:P=!0,...R}=jt(t,e);if((r=o.arrow)!=null&&r.alignmentOffset)return{};let $=pt(i),B=pt(h)===h,K=await(u.isRTL==null?void 0:u.isRTL(f.floating)),X=A||(B||!P?[mr(h)]:Xo(h));!A&&O!=="none"&&X.push(...Go(h,P,O,K));let ne=[h,...X],J=await Tn(e,R),V=[],de=((n=o.flip)==null?void 0:n.overflows)||[];if(y&&V.push(J[$]),b){let s=Hi(i,l,K);V.push(J[s[0]],J[s[1]])}if(de=[...de,{placement:i,overflows:V}],!V.every(s=>s<=0)){var U,Z;let s=(((U=o.flip)==null?void 0:U.index)||0)+1,p=ne[s];if(p)return{data:{index:s,overflows:de},reset:{placement:p}};let v=(Z=de.filter(d=>d.overflows[0]<=0).sort((d,N)=>d.overflows[1]-N.overflows[1])[0])==null?void 0:Z.placement;if(!v)switch(E){case"bestFit":{var me;let d=(me=de.map(N=>[N.placement,N.overflows.filter(_=>_>0).reduce((_,M)=>_+M,0)]).sort((N,_)=>N[1]-_[1])[0])==null?void 0:me[0];d&&(v=d);break}case"initialPlacement":v=h;break}if(i!==v)return{reset:{placement:v}}}return{}}}};function Mi(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ri(t){return ji.some(e=>t[e]>=0)}var na=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:r}=e,{strategy:n="referenceHidden",...i}=jt(t,e);switch(n){case"referenceHidden":{let o=await Tn(e,{...i,elementContext:"reference"}),l=Mi(o,r.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Ri(l)}}}case"escaped":{let o=await Tn(e,{...i,altBoundary:!0}),l=Mi(o,r.floating);return{data:{escapedOffsets:l,escaped:Ri(l)}}}default:return{}}}}};function $i(t){let e=Et(...t.map(o=>o.left)),r=Et(...t.map(o=>o.top)),n=tt(...t.map(o=>o.right)),i=tt(...t.map(o=>o.bottom));return{x:e,y:r,width:n-e,height:i-r}}function ra(t){let e=t.slice().sort((i,o)=>i.y-o.y),r=[],n=null;for(let i=0;in.height/2?r.push([o]):r[r.length-1].push(o),n=o}return r.map(i=>Dn($i(i)))}var ia=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){let{placement:r,elements:n,rects:i,platform:o,strategy:l}=e,{padding:h=2,x:u,y:f}=jt(t,e),y=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),b=ra(y),A=Dn($i(y)),E=ei(h);function O(){if(b.length===2&&b[0].left>b[1].right&&u!=null&&f!=null)return b.find(R=>u>R.left-E.left&&uR.top-E.top&&f=2){if(Pn(r)==="y"){let Z=b[0],me=b[b.length-1],s=pt(r)==="top",p=Z.top,v=me.bottom,d=s?Z.left:me.left,N=s?Z.right:me.right,_=N-d,M=v-p;return{top:p,bottom:v,left:d,right:N,width:_,height:M,x:d,y:p}}let R=pt(r)==="left",$=tt(...b.map(Z=>Z.right)),B=Et(...b.map(Z=>Z.left)),K=b.filter(Z=>R?Z.left===B:Z.right===$),X=K[0].top,ne=K[K.length-1].bottom,J=B,V=$,de=V-J,U=ne-X;return{top:X,bottom:ne,left:J,right:V,width:de,height:U,x:J,y:X}}return A}let P=await o.getElementRects({reference:{getBoundingClientRect:O},floating:n.floating,strategy:l});return i.reference.x!==P.reference.x||i.reference.y!==P.reference.y||i.reference.width!==P.reference.width||i.reference.height!==P.reference.height?{reset:{rects:P}}:{}}}};async function oa(t,e){let{placement:r,platform:n,elements:i}=t,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),l=pt(r),h=xt(r),u=Pn(r)==="y",f=["left","top"].includes(l)?-1:1,y=o&&u?-1:1,b=jt(e,t),{mainAxis:A,crossAxis:E,alignmentAxis:O}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...b};return h&&typeof O=="number"&&(E=h==="end"?O*-1:O),u?{x:E*y,y:A*f}:{x:A*f,y:E*y}}var Wi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;let{x:i,y:o,placement:l,middlewareData:h}=e,u=await oa(e,t);return l===((r=h.offset)==null?void 0:r.placement)&&(n=h.arrow)!=null&&n.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:l}}}}},aa=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:n,placement:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:h={fn:R=>{let{x:$,y:B}=R;return{x:$,y:B}}},...u}=jt(t,e),f={x:r,y:n},y=await Tn(e,u),b=Pn(pt(i)),A=Bi(b),E=f[A],O=f[b];if(o){let R=A==="y"?"top":"left",$=A==="y"?"bottom":"right",B=E+y[R],K=E-y[$];E=Jr(B,E,K)}if(l){let R=b==="y"?"top":"left",$=b==="y"?"bottom":"right",B=O+y[R],K=O-y[$];O=Jr(B,O,K)}let P=h.fn({...e,[A]:E,[b]:O});return{...P,data:{x:P.x-r,y:P.y-n}}}}},sa=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){let{placement:r,rects:n,platform:i,elements:o}=e,{apply:l=()=>{},...h}=jt(t,e),u=await Tn(e,h),f=pt(r),y=xt(r),b=Pn(r)==="y",{width:A,height:E}=n.floating,O,P;f==="top"||f==="bottom"?(O=f,P=y===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(P=f,O=y==="end"?"top":"bottom");let R=E-u[O],$=A-u[P],B=!e.middlewareData.shift,K=R,X=$;if(b){let J=A-u.left-u.right;X=y||B?Et($,J):J}else{let J=E-u.top-u.bottom;K=y||B?Et(R,J):J}if(B&&!y){let J=tt(u.left,0),V=tt(u.right,0),de=tt(u.top,0),U=tt(u.bottom,0);b?X=A-2*(J!==0||V!==0?J+V:tt(u.left,u.right)):K=E-2*(de!==0||U!==0?de+U:tt(u.top,u.bottom))}await l({...e,availableWidth:X,availableHeight:K});let ne=await i.getDimensions(o.floating);return A!==ne.width||E!==ne.height?{reset:{rects:!0}}:{}}}};function rn(t){return Vi(t)?(t.nodeName||"").toLowerCase():"#document"}function lt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bt(t){var e;return(e=(Vi(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vi(t){return t instanceof Node||t instanceof lt(t).Node}function kt(t){return t instanceof Element||t instanceof lt(t).Element}function _t(t){return t instanceof HTMLElement||t instanceof lt(t).HTMLElement}function Ii(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof lt(t).ShadowRoot}function Un(t){let{overflow:e,overflowX:r,overflowY:n,display:i}=ht(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function la(t){return["table","td","th"].includes(rn(t))}function ti(t){let e=ni(),r=ht(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function ca(t){let e=_n(t);for(;_t(e)&&!gr(e);){if(ti(e))return e;e=_n(e)}return null}function ni(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gr(t){return["html","body","#document"].includes(rn(t))}function ht(t){return lt(t).getComputedStyle(t)}function br(t){return kt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _n(t){if(rn(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Ii(t)&&t.host||Bt(t);return Ii(e)?e.host:e}function zi(t){let e=_n(t);return gr(e)?t.ownerDocument?t.ownerDocument.body:t.body:_t(e)&&Un(e)?e:zi(e)}function zn(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);let i=zi(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),l=lt(i);return o?e.concat(l,l.visualViewport||[],Un(i)?i:[],l.frameElement&&r?zn(l.frameElement):[]):e.concat(i,zn(i,[],r))}function Ui(t){let e=ht(t),r=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=_t(t),o=i?t.offsetWidth:r,l=i?t.offsetHeight:n,h=hr(r)!==o||hr(n)!==l;return h&&(r=o,n=l),{width:r,height:n,$:h}}function ri(t){return kt(t)?t:t.contextElement}function Cn(t){let e=ri(t);if(!_t(e))return nn(1);let r=e.getBoundingClientRect(),{width:n,height:i,$:o}=Ui(e),l=(o?hr(r.width):r.width)/n,h=(o?hr(r.height):r.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!h||!Number.isFinite(h))&&(h=1),{x:l,y:h}}var fa=nn(0);function Yi(t){let e=lt(t);return!ni()||!e.visualViewport?fa:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ua(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==lt(t)?!1:e}function vn(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);let i=t.getBoundingClientRect(),o=ri(t),l=nn(1);e&&(n?kt(n)&&(l=Cn(n)):l=Cn(t));let h=ua(o,r,n)?Yi(o):nn(0),u=(i.left+h.x)/l.x,f=(i.top+h.y)/l.y,y=i.width/l.x,b=i.height/l.y;if(o){let A=lt(o),E=n&&kt(n)?lt(n):n,O=A,P=O.frameElement;for(;P&&n&&E!==O;){let R=Cn(P),$=P.getBoundingClientRect(),B=ht(P),K=$.left+(P.clientLeft+parseFloat(B.paddingLeft))*R.x,X=$.top+(P.clientTop+parseFloat(B.paddingTop))*R.y;u*=R.x,f*=R.y,y*=R.x,b*=R.y,u+=K,f+=X,O=lt(P),P=O.frameElement}}return Dn({width:y,height:b,x:u,y:f})}var da=[":popover-open",":modal"];function Xi(t){return da.some(e=>{try{return t.matches(e)}catch{return!1}})}function pa(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t,o=i==="fixed",l=Bt(n),h=e?Xi(e.floating):!1;if(n===l||h&&o)return r;let u={scrollLeft:0,scrollTop:0},f=nn(1),y=nn(0),b=_t(n);if((b||!b&&!o)&&((rn(n)!=="body"||Un(l))&&(u=br(n)),_t(n))){let A=vn(n);f=Cn(n),y.x=A.x+n.clientLeft,y.y=A.y+n.clientTop}return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-u.scrollLeft*f.x+y.x,y:r.y*f.y-u.scrollTop*f.y+y.y}}function ha(t){return Array.from(t.getClientRects())}function qi(t){return vn(Bt(t)).left+br(t).scrollLeft}function va(t){let e=Bt(t),r=br(t),n=t.ownerDocument.body,i=tt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=tt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),l=-r.scrollLeft+qi(t),h=-r.scrollTop;return ht(n).direction==="rtl"&&(l+=tt(e.clientWidth,n.clientWidth)-i),{width:i,height:o,x:l,y:h}}function ma(t,e){let r=lt(t),n=Bt(t),i=r.visualViewport,o=n.clientWidth,l=n.clientHeight,h=0,u=0;if(i){o=i.width,l=i.height;let f=ni();(!f||f&&e==="fixed")&&(h=i.offsetLeft,u=i.offsetTop)}return{width:o,height:l,x:h,y:u}}function ga(t,e){let r=vn(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,o=_t(t)?Cn(t):nn(1),l=t.clientWidth*o.x,h=t.clientHeight*o.y,u=i*o.x,f=n*o.y;return{width:l,height:h,x:u,y:f}}function Fi(t,e,r){let n;if(e==="viewport")n=ma(t,r);else if(e==="document")n=va(Bt(t));else if(kt(e))n=ga(e,r);else{let i=Yi(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Dn(n)}function Gi(t,e){let r=_n(t);return r===e||!kt(r)||gr(r)?!1:ht(r).position==="fixed"||Gi(r,e)}function ba(t,e){let r=e.get(t);if(r)return r;let n=zn(t,[],!1).filter(h=>kt(h)&&rn(h)!=="body"),i=null,o=ht(t).position==="fixed",l=o?_n(t):t;for(;kt(l)&&!gr(l);){let h=ht(l),u=ti(l);!u&&h.position==="fixed"&&(i=null),(o?!u&&!i:!u&&h.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Un(l)&&!u&&Gi(t,l))?n=n.filter(y=>y!==l):i=h,l=_n(l)}return e.set(t,n),n}function ya(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t,l=[...r==="clippingAncestors"?ba(e,this._c):[].concat(r),n],h=l[0],u=l.reduce((f,y)=>{let b=Fi(e,y,i);return f.top=tt(b.top,f.top),f.right=Et(b.right,f.right),f.bottom=Et(b.bottom,f.bottom),f.left=tt(b.left,f.left),f},Fi(e,h,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function wa(t){let{width:e,height:r}=Ui(t);return{width:e,height:r}}function xa(t,e,r){let n=_t(e),i=Bt(e),o=r==="fixed",l=vn(t,!0,o,e),h={scrollLeft:0,scrollTop:0},u=nn(0);if(n||!n&&!o)if((rn(e)!=="body"||Un(i))&&(h=br(e)),n){let b=vn(e,!0,o,e);u.x=b.x+e.clientLeft,u.y=b.y+e.clientTop}else i&&(u.x=qi(i));let f=l.left+h.scrollLeft-u.x,y=l.top+h.scrollTop-u.y;return{x:f,y,width:l.width,height:l.height}}function Li(t,e){return!_t(t)||ht(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ki(t,e){let r=lt(t);if(!_t(t)||Xi(t))return r;let n=Li(t,e);for(;n&&la(n)&&ht(n).position==="static";)n=Li(n,e);return n&&(rn(n)==="html"||rn(n)==="body"&&ht(n).position==="static"&&!ti(n))?r:n||ca(t)||r}var Ea=async function(t){let e=this.getOffsetParent||Ki,r=this.getDimensions;return{reference:xa(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await r(t.floating)}}};function Oa(t){return ht(t).direction==="rtl"}var Sa={convertOffsetParentRelativeRectToViewportRelativeRect:pa,getDocumentElement:Bt,getClippingRect:ya,getOffsetParent:Ki,getElementRects:Ea,getClientRects:ha,getDimensions:wa,getScale:Cn,isElement:kt,isRTL:Oa};function Aa(t,e){let r=null,n,i=Bt(t);function o(){var h;clearTimeout(n),(h=r)==null||h.disconnect(),r=null}function l(h,u){h===void 0&&(h=!1),u===void 0&&(u=1),o();let{left:f,top:y,width:b,height:A}=t.getBoundingClientRect();if(h||e(),!b||!A)return;let E=pr(y),O=pr(i.clientWidth-(f+b)),P=pr(i.clientHeight-(y+A)),R=pr(f),B={rootMargin:-E+"px "+-O+"px "+-P+"px "+-R+"px",threshold:tt(0,Et(1,u))||1},K=!0;function X(ne){let J=ne[0].intersectionRatio;if(J!==u){if(!K)return l();J?l(!1,J):n=setTimeout(()=>{l(!1,1e-7)},100)}K=!1}try{r=new IntersectionObserver(X,{...B,root:i.ownerDocument})}catch{r=new IntersectionObserver(X,B)}r.observe(t)}return l(!0),o}function Ni(t,e,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,f=ri(t),y=i||o?[...f?zn(f):[],...zn(e)]:[];y.forEach($=>{i&&$.addEventListener("scroll",r,{passive:!0}),o&&$.addEventListener("resize",r)});let b=f&&h?Aa(f,r):null,A=-1,E=null;l&&(E=new ResizeObserver($=>{let[B]=$;B&&B.target===f&&E&&(E.unobserve(e),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var K;(K=E)==null||K.observe(e)})),r()}),f&&!u&&E.observe(f),E.observe(e));let O,P=u?vn(t):null;u&&R();function R(){let $=vn(t);P&&($.x!==P.x||$.y!==P.y||$.width!==P.width||$.height!==P.height)&&r(),P=$,O=requestAnimationFrame(R)}return r(),()=>{var $;y.forEach(B=>{i&&B.removeEventListener("scroll",r),o&&B.removeEventListener("resize",r)}),b?.(),($=E)==null||$.disconnect(),E=null,u&&cancelAnimationFrame(O)}}var ii=ea,Ji=aa,Zi=ta,Qi=sa,eo=na,to=Zo,no=ia,ki=(t,e,r)=>{let n=new Map,i={platform:Sa,...r},o={...i.platform,_c:n};return Jo(t,e,{...i,platform:o})},Ca=t=>{let e={placement:"bottom",strategy:"absolute",middleware:[]},r=Object.keys(t),n=i=>t[i];return r.includes("offset")&&e.middleware.push(Wi(n("offset"))),r.includes("teleport")&&(e.strategy="fixed"),r.includes("placement")&&(e.placement=n("placement")),r.includes("autoPlacement")&&!r.includes("flip")&&e.middleware.push(ii(n("autoPlacement"))),r.includes("flip")&&e.middleware.push(Zi(n("flip"))),r.includes("shift")&&e.middleware.push(Ji(n("shift"))),r.includes("inline")&&e.middleware.push(no(n("inline"))),r.includes("arrow")&&e.middleware.push(to(n("arrow"))),r.includes("hide")&&e.middleware.push(eo(n("hide"))),r.includes("size")&&e.middleware.push(Qi(n("size"))),e},Da=(t,e)=>{let r={component:{trap:!1},float:{placement:"bottom",strategy:"absolute",middleware:[]}},n=i=>t[t.indexOf(i)+1];if(t.includes("trap")&&(r.component.trap=!0),t.includes("teleport")&&(r.float.strategy="fixed"),t.includes("offset")&&r.float.middleware.push(Wi(e.offset||10)),t.includes("placement")&&(r.float.placement=n("placement")),t.includes("autoPlacement")&&!t.includes("flip")&&r.float.middleware.push(ii(e.autoPlacement)),t.includes("flip")&&r.float.middleware.push(Zi(e.flip)),t.includes("shift")&&r.float.middleware.push(Ji(e.shift)),t.includes("inline")&&r.float.middleware.push(no(e.inline)),t.includes("arrow")&&r.float.middleware.push(to(e.arrow)),t.includes("hide")&&r.float.middleware.push(eo(e.hide)),t.includes("size")){let i=e.size?.availableWidth??null,o=e.size?.availableHeight??null;i&&delete e.size.availableWidth,o&&delete e.size.availableHeight,r.float.middleware.push(Qi({...e.size,apply({availableWidth:l,availableHeight:h,elements:u}){Object.assign(u.floating.style,{maxWidth:`${i??l}px`,maxHeight:`${o??h}px`})}}))}return r},Ta=t=>{var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),r="";t||(t=Math.floor(Math.random()*e.length));for(var n=0;n{}){let r=!1;return function(){r?e.apply(this,arguments):(r=!0,t.apply(this,arguments))}}function Pa(t){let e={dismissable:!0,trap:!1};function r(n,i=null){if(n){if(n.hasAttribute("aria-expanded")||n.setAttribute("aria-expanded",!1),i.hasAttribute("id"))n.setAttribute("aria-controls",i.getAttribute("id"));else{let o=`panel-${Ta(8)}`;n.setAttribute("aria-controls",o),i.setAttribute("id",o)}i.setAttribute("aria-modal",!0),i.setAttribute("role","dialog")}}t.magic("float",n=>(i={},o={})=>{let l={...e,...o},h=Object.keys(i).length>0?Ca(i):{middleware:[ii()]},u=n,f=n.parentElement.closest("[x-data]"),y=f.querySelector('[x-ref="panel"]');r(u,y);function b(){return y.style.display=="block"}function A(){y.style.display="none",u.setAttribute("aria-expanded","false"),l.trap&&y.setAttribute("x-trap","false"),Ni(n,y,P)}function E(){y.style.display="block",u.setAttribute("aria-expanded","true"),l.trap&&y.setAttribute("x-trap","true"),P()}function O(){b()?A():E()}async function P(){return await ki(n,y,h).then(({middlewareData:R,placement:$,x:B,y:K})=>{if(R.arrow){let X=R.arrow?.x,ne=R.arrow?.y,J=h.middleware.filter(de=>de.name=="arrow")[0].options.element,V={top:"bottom",right:"left",bottom:"top",left:"right"}[$.split("-")[0]];Object.assign(J.style,{left:X!=null?`${X}px`:"",top:ne!=null?`${ne}px`:"",right:"",bottom:"",[V]:"-4px"})}if(R.hide){let{referenceHidden:X}=R.hide;Object.assign(y.style,{visibility:X?"hidden":"visible"})}Object.assign(y.style,{left:`${B}px`,top:`${K}px`})})}l.dismissable&&(window.addEventListener("click",R=>{!f.contains(R.target)&&b()&&O()}),window.addEventListener("keydown",R=>{R.key==="Escape"&&b()&&O()},!0)),O()}),t.directive("float",(n,{modifiers:i,expression:o},{evaluate:l,effect:h})=>{let u=o?l(o):{},f=i.length>0?Da(i,u):{},y=null;f.float.strategy=="fixed"&&(n.style.position="fixed");let b=V=>n.parentElement&&!n.parentElement.closest("[x-data]").contains(V.target)?n.close():null,A=V=>V.key==="Escape"?n.close():null,E=n.getAttribute("x-ref"),O=n.parentElement.closest("[x-data]"),P=O.querySelectorAll(`[\\@click^="$refs.${E}"]`),R=O.querySelectorAll(`[x-on\\:click^="$refs.${E}"]`);n.style.setProperty("display","none"),r([...P,...R][0],n),n._x_isShown=!1,n.trigger=null,n._x_doHide||(n._x_doHide=()=>{n.style.setProperty("display","none",i.includes("important")?"important":void 0)}),n._x_doShow||(n._x_doShow=()=>{n.style.setProperty("display","block",i.includes("important")?"important":void 0)});let $=()=>{n._x_doHide(),n._x_isShown=!1},B=()=>{n._x_doShow(),n._x_isShown=!0},K=()=>setTimeout(B),X=_a(V=>V?B():$(),V=>{typeof n._x_toggleAndCascadeWithTransitions=="function"?n._x_toggleAndCascadeWithTransitions(n,V,B,$):V?K():$()}),ne,J=!0;h(()=>l(V=>{!J&&V===ne||(i.includes("immediate")&&(V?K():$()),X(V),ne=V,J=!1)})),n.open=async function(V){n.trigger=V.currentTarget?V.currentTarget:V,X(!0),n.trigger.setAttribute("aria-expanded","true"),f.component.trap&&n.setAttribute("x-trap","true"),y=Ni(n.trigger,n,()=>{ki(n.trigger,n,f.float).then(({middlewareData:de,placement:U,x:Z,y:me})=>{if(de.arrow){let s=de.arrow?.x,p=de.arrow?.y,v=f.float.middleware.filter(N=>N.name=="arrow")[0].options.element,d={top:"bottom",right:"left",bottom:"top",left:"right"}[U.split("-")[0]];Object.assign(v.style,{left:s!=null?`${s}px`:"",top:p!=null?`${p}px`:"",right:"",bottom:"",[d]:"-4px"})}if(de.hide){let{referenceHidden:s}=de.hide;Object.assign(n.style,{visibility:s?"hidden":"visible"})}Object.assign(n.style,{left:`${Z}px`,top:`${me}px`})})}),window.addEventListener("click",b),window.addEventListener("keydown",A,!0)},n.close=function(){if(!n._x_isShown)return!1;X(!1),n.trigger.setAttribute("aria-expanded","false"),f.component.trap&&n.setAttribute("x-trap","false"),y(),window.removeEventListener("click",b),window.removeEventListener("keydown",A,!1)},n.toggle=function(V){n._x_isShown?n.close():n.open(V)}})}var ro=Pa;function Ma(t){t.store("lazyLoadedAssets",{loaded:new Set,check(l){return Array.isArray(l)?l.every(h=>this.loaded.has(h)):this.loaded.has(l)},markLoaded(l){Array.isArray(l)?l.forEach(h=>this.loaded.add(h)):this.loaded.add(l)}});function e(l){return new CustomEvent(l,{bubbles:!0,composed:!0,cancelable:!0})}function r(l,h={},u,f){let y=document.createElement(l);for(let[b,A]of Object.entries(h))y[b]=A;return u&&(f?u.insertBefore(y,f):u.appendChild(y)),y}function n(l,h,u={},f=null,y=null){let b=l==="link"?`link[href="${h}"]`:`script[src="${h}"]`;if(document.querySelector(b)||t.store("lazyLoadedAssets").check(h))return Promise.resolve();let A=l==="link"?{...u,href:h}:{...u,src:h},E=r(l,A,f,y);return new Promise((O,P)=>{E.onload=()=>{t.store("lazyLoadedAssets").markLoaded(h),O()},E.onerror=()=>{P(new Error(`Failed to load ${l}: ${h}`))}})}async function i(l,h,u=null,f=null){let y={type:"text/css",rel:"stylesheet"};h&&(y.media=h);let b=document.head,A=null;if(u&&f){let E=document.querySelector(`link[href*="${f}"]`);E?(b=E.parentNode,A=u==="before"?E:E.nextSibling):console.warn(`Target (${f}) not found for ${l}. Appending to head.`)}await n("link",l,y,b,A)}async function o(l,h,u=null,f=null){let y,b;u&&f&&(y=document.querySelector(`script[src*="${f}"]`),y?b=u==="before"?y:y.nextSibling:console.warn(`Target (${f}) not found for ${l}. Appending to body.`));let A=h.has("body-start")?"prepend":"append";await n("script",l,{},y||document[h.has("body-end")?"body":"head"],b)}t.directive("load-css",(l,{expression:h},{evaluate:u})=>{let f=u(h),y=l.media,b=l.getAttribute("data-dispatch"),A=l.getAttribute("data-css-before")?"before":l.getAttribute("data-css-after")?"after":null,E=l.getAttribute("data-css-before")||l.getAttribute("data-css-after")||null;Promise.all(f.map(O=>i(O,y,A,E))).then(()=>{b&&window.dispatchEvent(e(b+"-css"))}).catch(O=>{console.error(O)})}),t.directive("load-js",(l,{expression:h,modifiers:u},{evaluate:f})=>{let y=f(h),b=new Set(u),A=l.getAttribute("data-js-before")?"before":l.getAttribute("data-js-after")?"after":null,E=l.getAttribute("data-js-before")||l.getAttribute("data-js-after")||null,O=l.getAttribute("data-dispatch");Promise.all(y.map(P=>o(P,b,A,E))).then(()=>{O&&window.dispatchEvent(e(O+"-js"))}).catch(P=>{console.error(P)})})}var io=Ma;var ko=zo(so(),1);function lo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function Fa(t,e){if(t==null)return{};var r=Ia(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var La="1.15.2";function Ht(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Wt=Ht(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),er=Ht(/Edge/i),co=Ht(/firefox/i),Gn=Ht(/safari/i)&&!Ht(/chrome/i)&&!Ht(/android/i),bo=Ht(/iP(ad|od|hone)/i),yo=Ht(/chrome/i)&&Ht(/android/i),wo={capture:!1,passive:!1};function Ce(t,e,r){t.addEventListener(e,r,!Wt&&wo)}function Oe(t,e,r){t.removeEventListener(e,r,!Wt&&wo)}function _r(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Na(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function St(t,e,r,n){if(t){r=r||document;do{if(e!=null&&(e[0]===">"?t.parentNode===r&&_r(t,e):_r(t,e))||n&&t===r)return t;if(t===r)break}while(t=Na(t))}return null}var fo=/\s+/g;function ct(t,e,r){if(t&&e)if(t.classList)t.classList[r?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(fo," ").replace(" "+e+" "," ");t.className=(n+(r?" "+e:"")).replace(fo," ")}}function ae(t,e,r){var n=t&&t.style;if(n){if(r===void 0)return document.defaultView&&document.defaultView.getComputedStyle?r=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(r=t.currentStyle),e===void 0?r:r[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=r+(typeof r=="string"?"":"px")}}function Ln(t,e){var r="";if(typeof t=="string")r=t;else do{var n=ae(t,"transform");n&&n!=="none"&&(r=n+" "+r)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(r)}function xo(t,e,r){if(t){var n=t.getElementsByTagName(e),i=0,o=n.length;if(r)for(;i=o:l=i<=o,!l)return n;if(n===Pt())break;n=sn(n,!1)}return!1}function Nn(t,e,r,n){for(var i=0,o=0,l=t.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,o=Fa(n,za);tr.pluginEvent.bind(se)(e,r,Mt({dragEl:L,parentEl:ze,ghostEl:ue,rootEl:ke,nextEl:bn,lastDownEl:Ar,cloneEl:We,cloneHidden:an,dragStarted:Yn,putSortable:Ze,activeSortable:se.active,originalEvent:i,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ft,newDraggableIndex:on,hideGhostForTarget:_o,unhideGhostForTarget:Po,cloneNowHidden:function(){an=!0},cloneNowShown:function(){an=!1},dispatchSortableEvent:function(h){it({sortable:r,name:h,originalEvent:i})}},o))};function it(t){Va(Mt({putSortable:Ze,cloneEl:We,targetEl:L,rootEl:ke,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ft,newDraggableIndex:on},t))}var L,ze,ue,ke,bn,Ar,We,an,Fn,ft,Jn,on,wr,Ze,In=!1,Pr=!1,Mr=[],mn,Ot,si,li,ho,vo,Yn,Rn,Zn,Qn=!1,xr=!1,Cr,nt,ci=[],hi=!1,Rr=[],Fr=typeof document<"u",Er=bo,mo=er||Wt?"cssFloat":"float",Ua=Fr&&!yo&&!bo&&"draggable"in document.createElement("div"),Co=function(){if(Fr){if(Wt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Do=function(e,r){var n=ae(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Nn(e,0,r),l=Nn(e,1,r),h=o&&ae(o),u=l&&ae(l),f=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+qe(o).width,y=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+qe(l).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&h.float&&h.float!=="none"){var b=h.float==="left"?"left":"right";return l&&(u.clear==="both"||u.clear===b)?"vertical":"horizontal"}return o&&(h.display==="block"||h.display==="flex"||h.display==="table"||h.display==="grid"||f>=i&&n[mo]==="none"||l&&n[mo]==="none"&&f+y>i)?"vertical":"horizontal"},Ya=function(e,r,n){var i=n?e.left:e.top,o=n?e.right:e.bottom,l=n?e.width:e.height,h=n?r.left:r.top,u=n?r.right:r.bottom,f=n?r.width:r.height;return i===h||o===u||i+l/2===h+f/2},Xa=function(e,r){var n;return Mr.some(function(i){var o=i[ut].options.emptyInsertThreshold;if(!(!o||bi(i))){var l=qe(i),h=e>=l.left-o&&e<=l.right+o,u=r>=l.top-o&&r<=l.bottom+o;if(h&&u)return n=i}}),n},To=function(e){function r(o,l){return function(h,u,f,y){var b=h.options.group.name&&u.options.group.name&&h.options.group.name===u.options.group.name;if(o==null&&(l||b))return!0;if(o==null||o===!1)return!1;if(l&&o==="clone")return o;if(typeof o=="function")return r(o(h,u,f,y),l)(h,u,f,y);var A=(l?h:u).options.group.name;return o===!0||typeof o=="string"&&o===A||o.join&&o.indexOf(A)>-1}}var n={},i=e.group;(!i||Sr(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=r(i.pull,!0),n.checkPut=r(i.put),n.revertClone=i.revertClone,e.group=n},_o=function(){!Co&&ue&&ae(ue,"display","none")},Po=function(){!Co&&ue&&ae(ue,"display","")};Fr&&!yo&&document.addEventListener("click",function(t){if(Pr)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Pr=!1,!1},!0);var gn=function(e){if(L){e=e.touches?e.touches[0]:e;var r=Xa(e.clientX,e.clientY);if(r){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=r,n.preventDefault=void 0,n.stopPropagation=void 0,r[ut]._onDragOver(n)}}},qa=function(e){L&&L.parentNode[ut]._isOutsideThisEl(e.target)};function se(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=$t({},e),t[ut]=this;var r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Do(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,h){l.setData("Text",h.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:se.supportPointer!==!1&&"PointerEvent"in window&&!Gn,emptyInsertThreshold:5};tr.initializePlugins(this,t,r);for(var n in r)!(n in e)&&(e[n]=r[n]);To(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:Ua,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ce(t,"pointerdown",this._onTapStart):(Ce(t,"mousedown",this._onTapStart),Ce(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ce(t,"dragover",this),Ce(t,"dragenter",this)),Mr.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),$t(this,Ha())}se.prototype={constructor:se,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Rn=null)},_getDirection:function(e,r){return typeof this.options.direction=="function"?this.options.direction.call(this,e,r,L):this.options.direction},_onTapStart:function(e){if(e.cancelable){var r=this,n=this.el,i=this.options,o=i.preventOnFilter,l=e.type,h=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,u=(h||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||u,y=i.filter;if(ns(n),!L&&!(/mousedown|pointerdown/.test(l)&&e.button!==0||i.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Gn&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=St(u,i.draggable,n,!1),!(u&&u.animated)&&Ar!==u)){if(Fn=vt(u),Jn=vt(u,i.draggable),typeof y=="function"){if(y.call(this,e,u,this)){it({sortable:r,rootEl:f,name:"filter",targetEl:u,toEl:n,fromEl:n}),at("filter",r,{evt:e}),o&&e.cancelable&&e.preventDefault();return}}else if(y&&(y=y.split(",").some(function(b){if(b=St(f,b.trim(),n,!1),b)return it({sortable:r,rootEl:b,name:"filter",targetEl:u,fromEl:n,toEl:n}),at("filter",r,{evt:e}),!0}),y)){o&&e.cancelable&&e.preventDefault();return}i.handle&&!St(f,i.handle,n,!1)||this._prepareDragStart(e,h,u)}}},_prepareDragStart:function(e,r,n){var i=this,o=i.el,l=i.options,h=o.ownerDocument,u;if(n&&!L&&n.parentNode===o){var f=qe(n);if(ke=o,L=n,ze=L.parentNode,bn=L.nextSibling,Ar=n,wr=l.group,se.dragged=L,mn={target:L,clientX:(r||e).clientX,clientY:(r||e).clientY},ho=mn.clientX-f.left,vo=mn.clientY-f.top,this._lastX=(r||e).clientX,this._lastY=(r||e).clientY,L.style["will-change"]="all",u=function(){if(at("delayEnded",i,{evt:e}),se.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!co&&i.nativeDraggable&&(L.draggable=!0),i._triggerDragStart(e,r),it({sortable:i,name:"choose",originalEvent:e}),ct(L,l.chosenClass,!0)},l.ignore.split(",").forEach(function(y){xo(L,y.trim(),fi)}),Ce(h,"dragover",gn),Ce(h,"mousemove",gn),Ce(h,"touchmove",gn),Ce(h,"mouseup",i._onDrop),Ce(h,"touchend",i._onDrop),Ce(h,"touchcancel",i._onDrop),co&&this.nativeDraggable&&(this.options.touchStartThreshold=4,L.draggable=!0),at("delayStart",this,{evt:e}),l.delay&&(!l.delayOnTouchOnly||r)&&(!this.nativeDraggable||!(er||Wt))){if(se.eventCanceled){this._onDrop();return}Ce(h,"mouseup",i._disableDelayedDrag),Ce(h,"touchend",i._disableDelayedDrag),Ce(h,"touchcancel",i._disableDelayedDrag),Ce(h,"mousemove",i._delayedDragTouchMoveHandler),Ce(h,"touchmove",i._delayedDragTouchMoveHandler),l.supportPointer&&Ce(h,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(u,l.delay)}else u()}},_delayedDragTouchMoveHandler:function(e){var r=e.touches?e.touches[0]:e;Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){L&&fi(L),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Oe(e,"mouseup",this._disableDelayedDrag),Oe(e,"touchend",this._disableDelayedDrag),Oe(e,"touchcancel",this._disableDelayedDrag),Oe(e,"mousemove",this._delayedDragTouchMoveHandler),Oe(e,"touchmove",this._delayedDragTouchMoveHandler),Oe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,r){r=r||e.pointerType=="touch"&&e,!this.nativeDraggable||r?this.options.supportPointer?Ce(document,"pointermove",this._onTouchMove):r?Ce(document,"touchmove",this._onTouchMove):Ce(document,"mousemove",this._onTouchMove):(Ce(L,"dragend",this),Ce(ke,"dragstart",this._onDragStart));try{document.selection?Dr(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,r){if(In=!1,ke&&L){at("dragStarted",this,{evt:r}),this.nativeDraggable&&Ce(document,"dragover",qa);var n=this.options;!e&&ct(L,n.dragClass,!1),ct(L,n.ghostClass,!0),se.active=this,e&&this._appendGhost(),it({sortable:this,name:"start",originalEvent:r})}else this._nulling()},_emulateDragOver:function(){if(Ot){this._lastX=Ot.clientX,this._lastY=Ot.clientY,_o();for(var e=document.elementFromPoint(Ot.clientX,Ot.clientY),r=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Ot.clientX,Ot.clientY),e!==r);)r=e;if(L.parentNode[ut]._isOutsideThisEl(e),r)do{if(r[ut]){var n=void 0;if(n=r[ut]._onDragOver({clientX:Ot.clientX,clientY:Ot.clientY,target:e,rootEl:r}),n&&!this.options.dragoverBubble)break}e=r}while(r=r.parentNode);Po()}},_onTouchMove:function(e){if(mn){var r=this.options,n=r.fallbackTolerance,i=r.fallbackOffset,o=e.touches?e.touches[0]:e,l=ue&&Ln(ue,!0),h=ue&&l&&l.a,u=ue&&l&&l.d,f=Er&&nt&&po(nt),y=(o.clientX-mn.clientX+i.x)/(h||1)+(f?f[0]-ci[0]:0)/(h||1),b=(o.clientY-mn.clientY+i.y)/(u||1)+(f?f[1]-ci[1]:0)/(u||1);if(!se.active&&!In){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(it({rootEl:ze,name:"add",toEl:ze,fromEl:ke,originalEvent:e}),it({sortable:this,name:"remove",toEl:ze,originalEvent:e}),it({rootEl:ze,name:"sort",toEl:ze,fromEl:ke,originalEvent:e}),it({sortable:this,name:"sort",toEl:ze,originalEvent:e})),Ze&&Ze.save()):ft!==Fn&&ft>=0&&(it({sortable:this,name:"update",toEl:ze,originalEvent:e}),it({sortable:this,name:"sort",toEl:ze,originalEvent:e})),se.active&&((ft==null||ft===-1)&&(ft=Fn,on=Jn),it({sortable:this,name:"end",toEl:ze,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){at("nulling",this),ke=L=ze=ue=bn=We=Ar=an=mn=Ot=Yn=ft=on=Fn=Jn=Rn=Zn=Ze=wr=se.dragged=se.ghost=se.clone=se.active=null,Rr.forEach(function(e){e.checked=!0}),Rr.length=si=li=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":L&&(this._onDragOver(e),Ga(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],r,n=this.el.children,i=0,o=n.length,l=this.options;ii.right+o||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>i.bottom+o||t.clientX>n.right&&t.clientY>n.top}function Qa(t,e,r,n,i,o,l,h){var u=n?t.clientY:t.clientX,f=n?r.height:r.width,y=n?r.top:r.left,b=n?r.bottom:r.right,A=!1;if(!l){if(h&&Cry+f*o/2:ub-Cr)return-Zn}else if(u>y+f*(1-i)/2&&ub-f*o/2)?u>y+f/2?1:-1:0}function es(t){return vt(L){t.directive("sortable",e=>{let r=parseInt(e.dataset?.sortableAnimationDuration);r!==0&&!r&&(r=300),e.sortable=xi.create(e,{group:e.getAttribute("x-sortable-group"),draggable:"[x-sortable-item]",handle:"[x-sortable-handle]",dataIdAttr:"x-sortable-item",animation:r,ghostClass:"fi-sortable-ghost"})})};var is=Object.create,Si=Object.defineProperty,os=Object.getPrototypeOf,as=Object.prototype.hasOwnProperty,ss=Object.getOwnPropertyNames,ls=Object.getOwnPropertyDescriptor,cs=t=>Si(t,"__esModule",{value:!0}),Io=(t,e)=>()=>(e||(e={exports:{}},t(e.exports,e)),e.exports),fs=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ss(e))!as.call(t,n)&&n!=="default"&&Si(t,n,{get:()=>e[n],enumerable:!(r=ls(e,n))||r.enumerable});return t},Fo=t=>fs(cs(Si(t!=null?is(os(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),us=Io(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(c){var a=c.getBoundingClientRect();return{width:a.width,height:a.height,top:a.top,right:a.right,bottom:a.bottom,left:a.left,x:a.left,y:a.top}}function r(c){if(c==null)return window;if(c.toString()!=="[object Window]"){var a=c.ownerDocument;return a&&a.defaultView||window}return c}function n(c){var a=r(c),g=a.pageXOffset,D=a.pageYOffset;return{scrollLeft:g,scrollTop:D}}function i(c){var a=r(c).Element;return c instanceof a||c instanceof Element}function o(c){var a=r(c).HTMLElement;return c instanceof a||c instanceof HTMLElement}function l(c){if(typeof ShadowRoot>"u")return!1;var a=r(c).ShadowRoot;return c instanceof a||c instanceof ShadowRoot}function h(c){return{scrollLeft:c.scrollLeft,scrollTop:c.scrollTop}}function u(c){return c===r(c)||!o(c)?n(c):h(c)}function f(c){return c?(c.nodeName||"").toLowerCase():null}function y(c){return((i(c)?c.ownerDocument:c.document)||window.document).documentElement}function b(c){return e(y(c)).left+n(c).scrollLeft}function A(c){return r(c).getComputedStyle(c)}function E(c){var a=A(c),g=a.overflow,D=a.overflowX,T=a.overflowY;return/auto|scroll|overlay|hidden/.test(g+T+D)}function O(c,a,g){g===void 0&&(g=!1);var D=y(a),T=e(c),F=o(a),W={scrollLeft:0,scrollTop:0},j={x:0,y:0};return(F||!F&&!g)&&((f(a)!=="body"||E(D))&&(W=u(a)),o(a)?(j=e(a),j.x+=a.clientLeft,j.y+=a.clientTop):D&&(j.x=b(D))),{x:T.left+W.scrollLeft-j.x,y:T.top+W.scrollTop-j.y,width:T.width,height:T.height}}function P(c){var a=e(c),g=c.offsetWidth,D=c.offsetHeight;return Math.abs(a.width-g)<=1&&(g=a.width),Math.abs(a.height-D)<=1&&(D=a.height),{x:c.offsetLeft,y:c.offsetTop,width:g,height:D}}function R(c){return f(c)==="html"?c:c.assignedSlot||c.parentNode||(l(c)?c.host:null)||y(c)}function $(c){return["html","body","#document"].indexOf(f(c))>=0?c.ownerDocument.body:o(c)&&E(c)?c:$(R(c))}function B(c,a){var g;a===void 0&&(a=[]);var D=$(c),T=D===((g=c.ownerDocument)==null?void 0:g.body),F=r(D),W=T?[F].concat(F.visualViewport||[],E(D)?D:[]):D,j=a.concat(W);return T?j:j.concat(B(R(W)))}function K(c){return["table","td","th"].indexOf(f(c))>=0}function X(c){return!o(c)||A(c).position==="fixed"?null:c.offsetParent}function ne(c){var a=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,g=navigator.userAgent.indexOf("Trident")!==-1;if(g&&o(c)){var D=A(c);if(D.position==="fixed")return null}for(var T=R(c);o(T)&&["html","body"].indexOf(f(T))<0;){var F=A(T);if(F.transform!=="none"||F.perspective!=="none"||F.contain==="paint"||["transform","perspective"].indexOf(F.willChange)!==-1||a&&F.willChange==="filter"||a&&F.filter&&F.filter!=="none")return T;T=T.parentNode}return null}function J(c){for(var a=r(c),g=X(c);g&&K(g)&&A(g).position==="static";)g=X(g);return g&&(f(g)==="html"||f(g)==="body"&&A(g).position==="static")?a:g||ne(c)||a}var V="top",de="bottom",U="right",Z="left",me="auto",s=[V,de,U,Z],p="start",v="end",d="clippingParents",N="viewport",_="popper",M="reference",Q=s.reduce(function(c,a){return c.concat([a+"-"+p,a+"-"+v])},[]),Ue=[].concat(s,[me]).reduce(function(c,a){return c.concat([a,a+"-"+p,a+"-"+v])},[]),Rt="beforeRead",Vt="read",Lr="afterRead",Nr="beforeMain",kr="main",zt="afterMain",nr="beforeWrite",jr="write",rr="afterWrite",It=[Rt,Vt,Lr,Nr,kr,zt,nr,jr,rr];function Br(c){var a=new Map,g=new Set,D=[];c.forEach(function(F){a.set(F.name,F)});function T(F){g.add(F.name);var W=[].concat(F.requires||[],F.requiresIfExists||[]);W.forEach(function(j){if(!g.has(j)){var q=a.get(j);q&&T(q)}}),D.push(F)}return c.forEach(function(F){g.has(F.name)||T(F)}),D}function mt(c){var a=Br(c);return It.reduce(function(g,D){return g.concat(a.filter(function(T){return T.phase===D}))},[])}function Ut(c){var a;return function(){return a||(a=new Promise(function(g){Promise.resolve().then(function(){a=void 0,g(c())})})),a}}function At(c){for(var a=arguments.length,g=new Array(a>1?a-1:0),D=1;D=0,D=g&&o(c)?J(c):c;return i(D)?a.filter(function(T){return i(T)&&kn(T,D)&&f(T)!=="body"}):[]}function wn(c,a,g){var D=a==="clippingParents"?yn(c):[].concat(a),T=[].concat(D,[g]),F=T[0],W=T.reduce(function(j,q){var oe=sr(c,q);return j.top=gt(oe.top,j.top),j.right=ln(oe.right,j.right),j.bottom=ln(oe.bottom,j.bottom),j.left=gt(oe.left,j.left),j},sr(c,F));return W.width=W.right-W.left,W.height=W.bottom-W.top,W.x=W.left,W.y=W.top,W}function cn(c){return c.split("-")[1]}function dt(c){return["top","bottom"].indexOf(c)>=0?"x":"y"}function lr(c){var a=c.reference,g=c.element,D=c.placement,T=D?ot(D):null,F=D?cn(D):null,W=a.x+a.width/2-g.width/2,j=a.y+a.height/2-g.height/2,q;switch(T){case V:q={x:W,y:a.y-g.height};break;case de:q={x:W,y:a.y+a.height};break;case U:q={x:a.x+a.width,y:j};break;case Z:q={x:a.x-g.width,y:j};break;default:q={x:a.x,y:a.y}}var oe=T?dt(T):null;if(oe!=null){var z=oe==="y"?"height":"width";switch(F){case p:q[oe]=q[oe]-(a[z]/2-g[z]/2);break;case v:q[oe]=q[oe]+(a[z]/2-g[z]/2);break}}return q}function cr(){return{top:0,right:0,bottom:0,left:0}}function fr(c){return Object.assign({},cr(),c)}function ur(c,a){return a.reduce(function(g,D){return g[D]=c,g},{})}function qt(c,a){a===void 0&&(a={});var g=a,D=g.placement,T=D===void 0?c.placement:D,F=g.boundary,W=F===void 0?d:F,j=g.rootBoundary,q=j===void 0?N:j,oe=g.elementContext,z=oe===void 0?_:oe,De=g.altBoundary,Le=De===void 0?!1:De,Ae=g.padding,xe=Ae===void 0?0:Ae,Me=fr(typeof xe!="number"?xe:ur(xe,s)),Ee=z===_?M:_,Be=c.elements.reference,Re=c.rects.popper,He=c.elements[Le?Ee:z],ce=wn(i(He)?He:He.contextElement||y(c.elements.popper),W,q),Pe=e(Be),Te=lr({reference:Pe,element:Re,strategy:"absolute",placement:T}),Ne=Xt(Object.assign({},Re,Te)),Fe=z===_?Ne:Pe,Ye={top:ce.top-Fe.top+Me.top,bottom:Fe.bottom-ce.bottom+Me.bottom,left:ce.left-Fe.left+Me.left,right:Fe.right-ce.right+Me.right},$e=c.modifiersData.offset;if(z===_&&$e){var Ve=$e[T];Object.keys(Ye).forEach(function(wt){var et=[U,de].indexOf(wt)>=0?1:-1,Lt=[V,de].indexOf(wt)>=0?"y":"x";Ye[wt]+=Ve[Lt]*et})}return Ye}var dr="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",zr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",xn={placement:"bottom",modifiers:[],strategy:"absolute"};function fn(){for(var c=arguments.length,a=new Array(c),g=0;g100){console.error(zr);break}if(z.reset===!0){z.reset=!1,Pe=-1;continue}var Te=z.orderedModifiers[Pe],Ne=Te.fn,Fe=Te.options,Ye=Fe===void 0?{}:Fe,$e=Te.name;typeof Ne=="function"&&(z=Ne({state:z,options:Ye,name:$e,instance:Ae})||z)}}},update:Ut(function(){return new Promise(function(Ee){Ae.forceUpdate(),Ee(z)})}),destroy:function(){Me(),Le=!0}};if(!fn(j,q))return console.error(dr),Ae;Ae.setOptions(oe).then(function(Ee){!Le&&oe.onFirstUpdate&&oe.onFirstUpdate(Ee)});function xe(){z.orderedModifiers.forEach(function(Ee){var Be=Ee.name,Re=Ee.options,He=Re===void 0?{}:Re,ce=Ee.effect;if(typeof ce=="function"){var Pe=ce({state:z,name:Be,instance:Ae,options:He}),Te=function(){};De.push(Pe||Te)}})}function Me(){De.forEach(function(Ee){return Ee()}),De=[]}return Ae}}var On={passive:!0};function Ur(c){var a=c.state,g=c.instance,D=c.options,T=D.scroll,F=T===void 0?!0:T,W=D.resize,j=W===void 0?!0:W,q=r(a.elements.popper),oe=[].concat(a.scrollParents.reference,a.scrollParents.popper);return F&&oe.forEach(function(z){z.addEventListener("scroll",g.update,On)}),j&&q.addEventListener("resize",g.update,On),function(){F&&oe.forEach(function(z){z.removeEventListener("scroll",g.update,On)}),j&&q.removeEventListener("resize",g.update,On)}}var jn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ur,data:{}};function Yr(c){var a=c.state,g=c.name;a.modifiersData[g]=lr({reference:a.rects.reference,element:a.rects.popper,strategy:"absolute",placement:a.placement})}var Bn={name:"popperOffsets",enabled:!0,phase:"read",fn:Yr,data:{}},Xr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qr(c){var a=c.x,g=c.y,D=window,T=D.devicePixelRatio||1;return{x:Yt(Yt(a*T)/T)||0,y:Yt(Yt(g*T)/T)||0}}function Hn(c){var a,g=c.popper,D=c.popperRect,T=c.placement,F=c.offsets,W=c.position,j=c.gpuAcceleration,q=c.adaptive,oe=c.roundOffsets,z=oe===!0?qr(F):typeof oe=="function"?oe(F):F,De=z.x,Le=De===void 0?0:De,Ae=z.y,xe=Ae===void 0?0:Ae,Me=F.hasOwnProperty("x"),Ee=F.hasOwnProperty("y"),Be=Z,Re=V,He=window;if(q){var ce=J(g),Pe="clientHeight",Te="clientWidth";ce===r(g)&&(ce=y(g),A(ce).position!=="static"&&(Pe="scrollHeight",Te="scrollWidth")),ce=ce,T===V&&(Re=de,xe-=ce[Pe]-D.height,xe*=j?1:-1),T===Z&&(Be=U,Le-=ce[Te]-D.width,Le*=j?1:-1)}var Ne=Object.assign({position:W},q&&Xr);if(j){var Fe;return Object.assign({},Ne,(Fe={},Fe[Re]=Ee?"0":"",Fe[Be]=Me?"0":"",Fe.transform=(He.devicePixelRatio||1)<2?"translate("+Le+"px, "+xe+"px)":"translate3d("+Le+"px, "+xe+"px, 0)",Fe))}return Object.assign({},Ne,(a={},a[Re]=Ee?xe+"px":"",a[Be]=Me?Le+"px":"",a.transform="",a))}function m(c){var a=c.state,g=c.options,D=g.gpuAcceleration,T=D===void 0?!0:D,F=g.adaptive,W=F===void 0?!0:F,j=g.roundOffsets,q=j===void 0?!0:j,oe=A(a.elements.popper).transitionProperty||"";W&&["transform","top","right","bottom","left"].some(function(De){return oe.indexOf(De)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',` +(()=>{var Bo=Object.create;var Di=Object.defineProperty;var Ho=Object.getOwnPropertyDescriptor;var $o=Object.getOwnPropertyNames;var Wo=Object.getPrototypeOf,Vo=Object.prototype.hasOwnProperty;var Kr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var zo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $o(e))!Vo.call(t,i)&&i!==r&&Di(t,i,{get:()=>e[i],enumerable:!(n=Ho(e,i))||n.enumerable});return t};var Uo=(t,e,r)=>(r=t!=null?Bo(Wo(t)):{},zo(e||!t||!t.__esModule?Di(r,"default",{value:t,enumerable:!0}):r,t));var oo=Kr(()=>{});var ao=Kr(()=>{});var so=Kr((Os,yr)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var s=!n.JS_MD5_NO_COMMON_JS&&typeof yr=="object"&&yr.exports,h=typeof define=="function"&&define.amd,u=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",f="0123456789abcdef".split(""),w=[128,32768,8388608,-2147483648],m=[0,8,16,24],E=["hex","array","digest","buffer","arrayBuffer","base64"],O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),S=[],P;if(u){var R=new ArrayBuffer(68);P=new Uint8Array(R),S=new Uint32Array(R)}var $=Array.isArray;(n.JS_MD5_NO_NODE_JS||!$)&&($=function(l){return Object.prototype.toString.call(l)==="[object Array]"});var B=ArrayBuffer.isView;u&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!B)&&(B=function(l){return typeof l=="object"&&l.buffer&&l.buffer.constructor===ArrayBuffer});var K=function(l){var p=typeof l;if(p==="string")return[l,!0];if(p!=="object"||l===null)throw new Error(t);if(u&&l.constructor===ArrayBuffer)return[new Uint8Array(l),!1];if(!$(l)&&!B(l))throw new Error(t);return[l,!1]},X=function(l){return function(p){return new U(!0).update(p)[l]()}},ne=function(){var l=X("hex");o&&(l=J(l)),l.create=function(){return new U},l.update=function(d){return l.create().update(d)};for(var p=0;p>>6,Ue[_++]=128|d&63):d<55296||d>=57344?(Ue[_++]=224|d>>>12,Ue[_++]=128|d>>>6&63,Ue[_++]=128|d&63):(d=65536+((d&1023)<<10|l.charCodeAt(++N)&1023),Ue[_++]=240|d>>>18,Ue[_++]=128|d>>>12&63,Ue[_++]=128|d>>>6&63,Ue[_++]=128|d&63);else for(_=this.start;N>>2]|=d<>>2]|=(192|d>>>6)<>>2]|=(128|d&63)<=57344?(Q[_>>>2]|=(224|d>>>12)<>>2]|=(128|d>>>6&63)<>>2]|=(128|d&63)<>>2]|=(240|d>>>18)<>>2]|=(128|d>>>12&63)<>>2]|=(128|d>>>6&63)<>>2]|=(128|d&63)<>>2]|=l[N]<=64?(this.start=_-64,this.hash(),this.hashed=!0):this.start=_}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},U.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var l=this.blocks,p=this.lastByteIndex;l[p>>>2]|=w[p&3],p>=56&&(this.hashed||this.hash(),l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),l[14]=this.bytes<<3,l[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},U.prototype.hash=function(){var l,p,v,d,N,_,M=this.blocks;this.first?(l=M[0]-680876937,l=(l<<7|l>>>25)-271733879<<0,d=(-1732584194^l&2004318071)+M[1]-117830708,d=(d<<12|d>>>20)+l<<0,v=(-271733879^d&(l^-271733879))+M[2]-1126478375,v=(v<<17|v>>>15)+d<<0,p=(l^v&(d^l))+M[3]-1316259209,p=(p<<22|p>>>10)+v<<0):(l=this.h0,p=this.h1,v=this.h2,d=this.h3,l+=(d^p&(v^d))+M[0]-680876936,l=(l<<7|l>>>25)+p<<0,d+=(v^l&(p^v))+M[1]-389564586,d=(d<<12|d>>>20)+l<<0,v+=(p^d&(l^p))+M[2]+606105819,v=(v<<17|v>>>15)+d<<0,p+=(l^v&(d^l))+M[3]-1044525330,p=(p<<22|p>>>10)+v<<0),l+=(d^p&(v^d))+M[4]-176418897,l=(l<<7|l>>>25)+p<<0,d+=(v^l&(p^v))+M[5]+1200080426,d=(d<<12|d>>>20)+l<<0,v+=(p^d&(l^p))+M[6]-1473231341,v=(v<<17|v>>>15)+d<<0,p+=(l^v&(d^l))+M[7]-45705983,p=(p<<22|p>>>10)+v<<0,l+=(d^p&(v^d))+M[8]+1770035416,l=(l<<7|l>>>25)+p<<0,d+=(v^l&(p^v))+M[9]-1958414417,d=(d<<12|d>>>20)+l<<0,v+=(p^d&(l^p))+M[10]-42063,v=(v<<17|v>>>15)+d<<0,p+=(l^v&(d^l))+M[11]-1990404162,p=(p<<22|p>>>10)+v<<0,l+=(d^p&(v^d))+M[12]+1804603682,l=(l<<7|l>>>25)+p<<0,d+=(v^l&(p^v))+M[13]-40341101,d=(d<<12|d>>>20)+l<<0,v+=(p^d&(l^p))+M[14]-1502002290,v=(v<<17|v>>>15)+d<<0,p+=(l^v&(d^l))+M[15]+1236535329,p=(p<<22|p>>>10)+v<<0,l+=(v^d&(p^v))+M[1]-165796510,l=(l<<5|l>>>27)+p<<0,d+=(p^v&(l^p))+M[6]-1069501632,d=(d<<9|d>>>23)+l<<0,v+=(l^p&(d^l))+M[11]+643717713,v=(v<<14|v>>>18)+d<<0,p+=(d^l&(v^d))+M[0]-373897302,p=(p<<20|p>>>12)+v<<0,l+=(v^d&(p^v))+M[5]-701558691,l=(l<<5|l>>>27)+p<<0,d+=(p^v&(l^p))+M[10]+38016083,d=(d<<9|d>>>23)+l<<0,v+=(l^p&(d^l))+M[15]-660478335,v=(v<<14|v>>>18)+d<<0,p+=(d^l&(v^d))+M[4]-405537848,p=(p<<20|p>>>12)+v<<0,l+=(v^d&(p^v))+M[9]+568446438,l=(l<<5|l>>>27)+p<<0,d+=(p^v&(l^p))+M[14]-1019803690,d=(d<<9|d>>>23)+l<<0,v+=(l^p&(d^l))+M[3]-187363961,v=(v<<14|v>>>18)+d<<0,p+=(d^l&(v^d))+M[8]+1163531501,p=(p<<20|p>>>12)+v<<0,l+=(v^d&(p^v))+M[13]-1444681467,l=(l<<5|l>>>27)+p<<0,d+=(p^v&(l^p))+M[2]-51403784,d=(d<<9|d>>>23)+l<<0,v+=(l^p&(d^l))+M[7]+1735328473,v=(v<<14|v>>>18)+d<<0,p+=(d^l&(v^d))+M[12]-1926607734,p=(p<<20|p>>>12)+v<<0,N=p^v,l+=(N^d)+M[5]-378558,l=(l<<4|l>>>28)+p<<0,d+=(N^l)+M[8]-2022574463,d=(d<<11|d>>>21)+l<<0,_=d^l,v+=(_^p)+M[11]+1839030562,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[14]-35309556,p=(p<<23|p>>>9)+v<<0,N=p^v,l+=(N^d)+M[1]-1530992060,l=(l<<4|l>>>28)+p<<0,d+=(N^l)+M[4]+1272893353,d=(d<<11|d>>>21)+l<<0,_=d^l,v+=(_^p)+M[7]-155497632,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[10]-1094730640,p=(p<<23|p>>>9)+v<<0,N=p^v,l+=(N^d)+M[13]+681279174,l=(l<<4|l>>>28)+p<<0,d+=(N^l)+M[0]-358537222,d=(d<<11|d>>>21)+l<<0,_=d^l,v+=(_^p)+M[3]-722521979,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[6]+76029189,p=(p<<23|p>>>9)+v<<0,N=p^v,l+=(N^d)+M[9]-640364487,l=(l<<4|l>>>28)+p<<0,d+=(N^l)+M[12]-421815835,d=(d<<11|d>>>21)+l<<0,_=d^l,v+=(_^p)+M[15]+530742520,v=(v<<16|v>>>16)+d<<0,p+=(_^v)+M[2]-995338651,p=(p<<23|p>>>9)+v<<0,l+=(v^(p|~d))+M[0]-198630844,l=(l<<6|l>>>26)+p<<0,d+=(p^(l|~v))+M[7]+1126891415,d=(d<<10|d>>>22)+l<<0,v+=(l^(d|~p))+M[14]-1416354905,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~l))+M[5]-57434055,p=(p<<21|p>>>11)+v<<0,l+=(v^(p|~d))+M[12]+1700485571,l=(l<<6|l>>>26)+p<<0,d+=(p^(l|~v))+M[3]-1894986606,d=(d<<10|d>>>22)+l<<0,v+=(l^(d|~p))+M[10]-1051523,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~l))+M[1]-2054922799,p=(p<<21|p>>>11)+v<<0,l+=(v^(p|~d))+M[8]+1873313359,l=(l<<6|l>>>26)+p<<0,d+=(p^(l|~v))+M[15]-30611744,d=(d<<10|d>>>22)+l<<0,v+=(l^(d|~p))+M[6]-1560198380,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~l))+M[13]+1309151649,p=(p<<21|p>>>11)+v<<0,l+=(v^(p|~d))+M[4]-145523070,l=(l<<6|l>>>26)+p<<0,d+=(p^(l|~v))+M[11]-1120210379,d=(d<<10|d>>>22)+l<<0,v+=(l^(d|~p))+M[2]+718787259,v=(v<<15|v>>>17)+d<<0,p+=(d^(v|~l))+M[9]-343485551,p=(p<<21|p>>>11)+v<<0,this.first?(this.h0=l+1732584193<<0,this.h1=p-271733879<<0,this.h2=v-1732584194<<0,this.h3=d+271733878<<0,this.first=!1):(this.h0=this.h0+l<<0,this.h1=this.h1+p<<0,this.h2=this.h2+v<<0,this.h3=this.h3+d<<0)},U.prototype.hex=function(){this.finalize();var l=this.h0,p=this.h1,v=this.h2,d=this.h3;return f[l>>>4&15]+f[l&15]+f[l>>>12&15]+f[l>>>8&15]+f[l>>>20&15]+f[l>>>16&15]+f[l>>>28&15]+f[l>>>24&15]+f[p>>>4&15]+f[p&15]+f[p>>>12&15]+f[p>>>8&15]+f[p>>>20&15]+f[p>>>16&15]+f[p>>>28&15]+f[p>>>24&15]+f[v>>>4&15]+f[v&15]+f[v>>>12&15]+f[v>>>8&15]+f[v>>>20&15]+f[v>>>16&15]+f[v>>>28&15]+f[v>>>24&15]+f[d>>>4&15]+f[d&15]+f[d>>>12&15]+f[d>>>8&15]+f[d>>>20&15]+f[d>>>16&15]+f[d>>>28&15]+f[d>>>24&15]},U.prototype.toString=U.prototype.hex,U.prototype.digest=function(){this.finalize();var l=this.h0,p=this.h1,v=this.h2,d=this.h3;return[l&255,l>>>8&255,l>>>16&255,l>>>24&255,p&255,p>>>8&255,p>>>16&255,p>>>24&255,v&255,v>>>8&255,v>>>16&255,v>>>24&255,d&255,d>>>8&255,d>>>16&255,d>>>24&255]},U.prototype.array=U.prototype.digest,U.prototype.arrayBuffer=function(){this.finalize();var l=new ArrayBuffer(16),p=new Uint32Array(l);return p[0]=this.h0,p[1]=this.h1,p[2]=this.h2,p[3]=this.h3,l},U.prototype.buffer=U.prototype.arrayBuffer,U.prototype.base64=function(){for(var l,p,v,d="",N=this.array(),_=0;_<15;)l=N[_++],p=N[_++],v=N[_++],d+=O[l>>>2]+O[(l<<4|p>>>4)&63]+O[(p<<2|v>>>6)&63]+O[v&63];return l=N[_],d+=O[l>>>2]+O[l<<4&63]+"==",d};function Z(l,p){var v,d=K(l);if(l=d[0],d[1]){var N=[],_=l.length,M=0,Q;for(v=0;v<_;++v)Q=l.charCodeAt(v),Q<128?N[M++]=Q:Q<2048?(N[M++]=192|Q>>>6,N[M++]=128|Q&63):Q<55296||Q>=57344?(N[M++]=224|Q>>>12,N[M++]=128|Q>>>6&63,N[M++]=128|Q&63):(Q=65536+((Q&1023)<<10|l.charCodeAt(++v)&1023),N[M++]=240|Q>>>18,N[M++]=128|Q>>>12&63,N[M++]=128|Q>>>6&63,N[M++]=128|Q&63);l=N}l.length>64&&(l=new U(!0).update(l).array());var Ue=[],Rt=[];for(v=0;v<64;++v){var Vt=l[v]||0;Ue[v]=92^Vt,Rt[v]=54^Vt}U.call(this,p),this.update(Rt),this.oKeyPad=Ue,this.inner=!0,this.sharedMemory=p}Z.prototype=new U,Z.prototype.finalize=function(){if(U.prototype.finalize.call(this),this.inner){this.inner=!1;var l=this.array();U.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(l),U.prototype.finalize.call(this)}};var me=ne();me.md5=me,me.md5.hmac=de(),s?yr.exports=me:(n.md5=me,h&&define(function(){return me}))})()});var ji=["top","right","bottom","left"],Ti=["start","end"],_i=ji.reduce((t,e)=>t.concat(e,e+"-"+Ti[0],e+"-"+Ti[1]),[]),Et=Math.min,tt=Math.max,hr=Math.round,pr=Math.floor,nn=t=>({x:t,y:t}),Yo={left:"right",right:"left",bottom:"top",top:"bottom"},Xo={start:"end",end:"start"};function Jr(t,e,r){return tt(t,Et(e,r))}function jt(t,e){return typeof t=="function"?t(e):t}function pt(t){return t.split("-")[0]}function xt(t){return t.split("-")[1]}function Bi(t){return t==="x"?"y":"x"}function Zr(t){return t==="y"?"height":"width"}function Pn(t){return["top","bottom"].includes(pt(t))?"y":"x"}function Qr(t){return Bi(Pn(t))}function Hi(t,e,r){r===void 0&&(r=!1);let n=xt(t),i=Qr(t),o=Zr(i),s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=mr(s)),[s,mr(s)]}function qo(t){let e=mr(t);return[vr(t),e,vr(e)]}function vr(t){return t.replace(/start|end/g,e=>Xo[e])}function Go(t,e,r){let n=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?o:s;default:return[]}}function Ko(t,e,r,n){let i=xt(t),o=Go(pt(t),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(vr)))),o}function mr(t){return t.replace(/left|right|bottom|top/g,e=>Yo[e])}function Jo(t){return{top:0,right:0,bottom:0,left:0,...t}}function ei(t){return typeof t!="number"?Jo(t):{top:t,right:t,bottom:t,left:t}}function Dn(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Pi(t,e,r){let{reference:n,floating:i}=t,o=Pn(e),s=Qr(e),h=Zr(s),u=pt(e),f=o==="y",w=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,E=n[h]/2-i[h]/2,O;switch(u){case"top":O={x:w,y:n.y-i.height};break;case"bottom":O={x:w,y:n.y+n.height};break;case"right":O={x:n.x+n.width,y:m};break;case"left":O={x:n.x-i.width,y:m};break;default:O={x:n.x,y:n.y}}switch(xt(e)){case"start":O[s]-=E*(r&&f?-1:1);break;case"end":O[s]+=E*(r&&f?-1:1);break}return O}var Zo=async(t,e,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,h=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(e)),f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:w,y:m}=Pi(f,n,u),E=n,O={},S=0;for(let P=0;P({name:"arrow",options:t,async fn(e){let{x:r,y:n,placement:i,rects:o,platform:s,elements:h,middlewareData:u}=e,{element:f,padding:w=0}=jt(t,e)||{};if(f==null)return{};let m=ei(w),E={x:r,y:n},O=Qr(i),S=Zr(O),P=await s.getDimensions(f),R=O==="y",$=R?"top":"left",B=R?"bottom":"right",K=R?"clientHeight":"clientWidth",X=o.reference[S]+o.reference[O]-E[O]-o.floating[S],ne=E[O]-o.reference[O],J=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f)),V=J?J[K]:0;(!V||!await(s.isElement==null?void 0:s.isElement(J)))&&(V=h.floating[K]||o.floating[S]);let de=X/2-ne/2,U=V/2-P[S]/2-1,Z=Et(m[$],U),me=Et(m[B],U),l=Z,p=V-P[S]-me,v=V/2-P[S]/2+de,d=Jr(l,v,p),N=!u.arrow&&xt(i)!=null&&v!==d&&o.reference[S]/2-(vxt(i)===t),...r.filter(i=>xt(i)!==t)]:r.filter(i=>pt(i)===i)).filter(i=>t?xt(i)===t||(e?vr(i)!==i:!1):!0)}var ta=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,n,i;let{rects:o,middlewareData:s,placement:h,platform:u,elements:f}=e,{crossAxis:w=!1,alignment:m,allowedPlacements:E=_i,autoAlignment:O=!0,...S}=jt(t,e),P=m!==void 0||E===_i?ea(m||null,O,E):E,R=await Tn(e,S),$=((r=s.autoPlacement)==null?void 0:r.index)||0,B=P[$];if(B==null)return{};let K=Hi(B,o,await(u.isRTL==null?void 0:u.isRTL(f.floating)));if(h!==B)return{reset:{placement:P[0]}};let X=[R[pt(B)],R[K[0]],R[K[1]]],ne=[...((n=s.autoPlacement)==null?void 0:n.overflows)||[],{placement:B,overflows:X}],J=P[$+1];if(J)return{data:{index:$+1,overflows:ne},reset:{placement:J}};let V=ne.map(Z=>{let me=xt(Z.placement);return[Z.placement,me&&w?Z.overflows.slice(0,2).reduce((l,p)=>l+p,0):Z.overflows[0],Z.overflows]}).sort((Z,me)=>Z[1]-me[1]),U=((i=V.filter(Z=>Z[2].slice(0,xt(Z[0])?2:3).every(me=>me<=0))[0])==null?void 0:i[0])||V[0][0];return U!==h?{data:{index:$+1,overflows:ne},reset:{placement:U}}:{}}}},na=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;let{placement:i,middlewareData:o,rects:s,initialPlacement:h,platform:u,elements:f}=e,{mainAxis:w=!0,crossAxis:m=!0,fallbackPlacements:E,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:P=!0,...R}=jt(t,e);if((r=o.arrow)!=null&&r.alignmentOffset)return{};let $=pt(i),B=pt(h)===h,K=await(u.isRTL==null?void 0:u.isRTL(f.floating)),X=E||(B||!P?[mr(h)]:qo(h));!E&&S!=="none"&&X.push(...Ko(h,P,S,K));let ne=[h,...X],J=await Tn(e,R),V=[],de=((n=o.flip)==null?void 0:n.overflows)||[];if(w&&V.push(J[$]),m){let l=Hi(i,s,K);V.push(J[l[0]],J[l[1]])}if(de=[...de,{placement:i,overflows:V}],!V.every(l=>l<=0)){var U,Z;let l=(((U=o.flip)==null?void 0:U.index)||0)+1,p=ne[l];if(p)return{data:{index:l,overflows:de},reset:{placement:p}};let v=(Z=de.filter(d=>d.overflows[0]<=0).sort((d,N)=>d.overflows[1]-N.overflows[1])[0])==null?void 0:Z.placement;if(!v)switch(O){case"bestFit":{var me;let d=(me=de.map(N=>[N.placement,N.overflows.filter(_=>_>0).reduce((_,M)=>_+M,0)]).sort((N,_)=>N[1]-_[1])[0])==null?void 0:me[0];d&&(v=d);break}case"initialPlacement":v=h;break}if(i!==v)return{reset:{placement:v}}}return{}}}};function Mi(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ri(t){return ji.some(e=>t[e]>=0)}var ra=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:r}=e,{strategy:n="referenceHidden",...i}=jt(t,e);switch(n){case"referenceHidden":{let o=await Tn(e,{...i,elementContext:"reference"}),s=Mi(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ri(s)}}}case"escaped":{let o=await Tn(e,{...i,altBoundary:!0}),s=Mi(o,r.floating);return{data:{escapedOffsets:s,escaped:Ri(s)}}}default:return{}}}}};function $i(t){let e=Et(...t.map(o=>o.left)),r=Et(...t.map(o=>o.top)),n=tt(...t.map(o=>o.right)),i=tt(...t.map(o=>o.bottom));return{x:e,y:r,width:n-e,height:i-r}}function ia(t){let e=t.slice().sort((i,o)=>i.y-o.y),r=[],n=null;for(let i=0;in.height/2?r.push([o]):r[r.length-1].push(o),n=o}return r.map(i=>Dn($i(i)))}var oa=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){let{placement:r,elements:n,rects:i,platform:o,strategy:s}=e,{padding:h=2,x:u,y:f}=jt(t,e),w=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),m=ia(w),E=Dn($i(w)),O=ei(h);function S(){if(m.length===2&&m[0].left>m[1].right&&u!=null&&f!=null)return m.find(R=>u>R.left-O.left&&uR.top-O.top&&f=2){if(Pn(r)==="y"){let Z=m[0],me=m[m.length-1],l=pt(r)==="top",p=Z.top,v=me.bottom,d=l?Z.left:me.left,N=l?Z.right:me.right,_=N-d,M=v-p;return{top:p,bottom:v,left:d,right:N,width:_,height:M,x:d,y:p}}let R=pt(r)==="left",$=tt(...m.map(Z=>Z.right)),B=Et(...m.map(Z=>Z.left)),K=m.filter(Z=>R?Z.left===B:Z.right===$),X=K[0].top,ne=K[K.length-1].bottom,J=B,V=$,de=V-J,U=ne-X;return{top:X,bottom:ne,left:J,right:V,width:de,height:U,x:J,y:X}}return E}let P=await o.getElementRects({reference:{getBoundingClientRect:S},floating:n.floating,strategy:s});return i.reference.x!==P.reference.x||i.reference.y!==P.reference.y||i.reference.width!==P.reference.width||i.reference.height!==P.reference.height?{reset:{rects:P}}:{}}}};async function aa(t,e){let{placement:r,platform:n,elements:i}=t,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=pt(r),h=xt(r),u=Pn(r)==="y",f=["left","top"].includes(s)?-1:1,w=o&&u?-1:1,m=jt(e,t),{mainAxis:E,crossAxis:O,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return h&&typeof S=="number"&&(O=h==="end"?S*-1:S),u?{x:O*w,y:E*f}:{x:E*f,y:O*w}}var Wi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;let{x:i,y:o,placement:s,middlewareData:h}=e,u=await aa(e,t);return s===((r=h.offset)==null?void 0:r.placement)&&(n=h.arrow)!=null&&n.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},sa=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:n,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:h={fn:R=>{let{x:$,y:B}=R;return{x:$,y:B}}},...u}=jt(t,e),f={x:r,y:n},w=await Tn(e,u),m=Pn(pt(i)),E=Bi(m),O=f[E],S=f[m];if(o){let R=E==="y"?"top":"left",$=E==="y"?"bottom":"right",B=O+w[R],K=O-w[$];O=Jr(B,O,K)}if(s){let R=m==="y"?"top":"left",$=m==="y"?"bottom":"right",B=S+w[R],K=S-w[$];S=Jr(B,S,K)}let P=h.fn({...e,[E]:O,[m]:S});return{...P,data:{x:P.x-r,y:P.y-n}}}}},la=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){let{placement:r,rects:n,platform:i,elements:o}=e,{apply:s=()=>{},...h}=jt(t,e),u=await Tn(e,h),f=pt(r),w=xt(r),m=Pn(r)==="y",{width:E,height:O}=n.floating,S,P;f==="top"||f==="bottom"?(S=f,P=w===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(P=f,S=w==="end"?"top":"bottom");let R=O-u[S],$=E-u[P],B=!e.middlewareData.shift,K=R,X=$;if(m){let J=E-u.left-u.right;X=w||B?Et($,J):J}else{let J=O-u.top-u.bottom;K=w||B?Et(R,J):J}if(B&&!w){let J=tt(u.left,0),V=tt(u.right,0),de=tt(u.top,0),U=tt(u.bottom,0);m?X=E-2*(J!==0||V!==0?J+V:tt(u.left,u.right)):K=O-2*(de!==0||U!==0?de+U:tt(u.top,u.bottom))}await s({...e,availableWidth:X,availableHeight:K});let ne=await i.getDimensions(o.floating);return E!==ne.width||O!==ne.height?{reset:{rects:!0}}:{}}}};function rn(t){return Vi(t)?(t.nodeName||"").toLowerCase():"#document"}function ct(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bt(t){var e;return(e=(Vi(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vi(t){return t instanceof Node||t instanceof ct(t).Node}function kt(t){return t instanceof Element||t instanceof ct(t).Element}function _t(t){return t instanceof HTMLElement||t instanceof ct(t).HTMLElement}function Ii(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ct(t).ShadowRoot}function Un(t){let{overflow:e,overflowX:r,overflowY:n,display:i}=ht(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function ca(t){return["table","td","th"].includes(rn(t))}function ti(t){let e=ni(),r=ht(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function fa(t){let e=_n(t);for(;_t(e)&&!gr(e);){if(ti(e))return e;e=_n(e)}return null}function ni(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gr(t){return["html","body","#document"].includes(rn(t))}function ht(t){return ct(t).getComputedStyle(t)}function br(t){return kt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function _n(t){if(rn(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Ii(t)&&t.host||Bt(t);return Ii(e)?e.host:e}function zi(t){let e=_n(t);return gr(e)?t.ownerDocument?t.ownerDocument.body:t.body:_t(e)&&Un(e)?e:zi(e)}function zn(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);let i=zi(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),s=ct(i);return o?e.concat(s,s.visualViewport||[],Un(i)?i:[],s.frameElement&&r?zn(s.frameElement):[]):e.concat(i,zn(i,[],r))}function Ui(t){let e=ht(t),r=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=_t(t),o=i?t.offsetWidth:r,s=i?t.offsetHeight:n,h=hr(r)!==o||hr(n)!==s;return h&&(r=o,n=s),{width:r,height:n,$:h}}function ri(t){return kt(t)?t:t.contextElement}function Cn(t){let e=ri(t);if(!_t(e))return nn(1);let r=e.getBoundingClientRect(),{width:n,height:i,$:o}=Ui(e),s=(o?hr(r.width):r.width)/n,h=(o?hr(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!h||!Number.isFinite(h))&&(h=1),{x:s,y:h}}var ua=nn(0);function Yi(t){let e=ct(t);return!ni()||!e.visualViewport?ua:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function da(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ct(t)?!1:e}function vn(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);let i=t.getBoundingClientRect(),o=ri(t),s=nn(1);e&&(n?kt(n)&&(s=Cn(n)):s=Cn(t));let h=da(o,r,n)?Yi(o):nn(0),u=(i.left+h.x)/s.x,f=(i.top+h.y)/s.y,w=i.width/s.x,m=i.height/s.y;if(o){let E=ct(o),O=n&&kt(n)?ct(n):n,S=E,P=S.frameElement;for(;P&&n&&O!==S;){let R=Cn(P),$=P.getBoundingClientRect(),B=ht(P),K=$.left+(P.clientLeft+parseFloat(B.paddingLeft))*R.x,X=$.top+(P.clientTop+parseFloat(B.paddingTop))*R.y;u*=R.x,f*=R.y,w*=R.x,m*=R.y,u+=K,f+=X,S=ct(P),P=S.frameElement}}return Dn({width:w,height:m,x:u,y:f})}var pa=[":popover-open",":modal"];function Xi(t){return pa.some(e=>{try{return t.matches(e)}catch{return!1}})}function ha(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t,o=i==="fixed",s=Bt(n),h=e?Xi(e.floating):!1;if(n===s||h&&o)return r;let u={scrollLeft:0,scrollTop:0},f=nn(1),w=nn(0),m=_t(n);if((m||!m&&!o)&&((rn(n)!=="body"||Un(s))&&(u=br(n)),_t(n))){let E=vn(n);f=Cn(n),w.x=E.x+n.clientLeft,w.y=E.y+n.clientTop}return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-u.scrollLeft*f.x+w.x,y:r.y*f.y-u.scrollTop*f.y+w.y}}function va(t){return Array.from(t.getClientRects())}function qi(t){return vn(Bt(t)).left+br(t).scrollLeft}function ma(t){let e=Bt(t),r=br(t),n=t.ownerDocument.body,i=tt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=tt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),s=-r.scrollLeft+qi(t),h=-r.scrollTop;return ht(n).direction==="rtl"&&(s+=tt(e.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:h}}function ga(t,e){let r=ct(t),n=Bt(t),i=r.visualViewport,o=n.clientWidth,s=n.clientHeight,h=0,u=0;if(i){o=i.width,s=i.height;let f=ni();(!f||f&&e==="fixed")&&(h=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:h,y:u}}function ba(t,e){let r=vn(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,o=_t(t)?Cn(t):nn(1),s=t.clientWidth*o.x,h=t.clientHeight*o.y,u=i*o.x,f=n*o.y;return{width:s,height:h,x:u,y:f}}function Fi(t,e,r){let n;if(e==="viewport")n=ga(t,r);else if(e==="document")n=ma(Bt(t));else if(kt(e))n=ba(e,r);else{let i=Yi(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Dn(n)}function Gi(t,e){let r=_n(t);return r===e||!kt(r)||gr(r)?!1:ht(r).position==="fixed"||Gi(r,e)}function ya(t,e){let r=e.get(t);if(r)return r;let n=zn(t,[],!1).filter(h=>kt(h)&&rn(h)!=="body"),i=null,o=ht(t).position==="fixed",s=o?_n(t):t;for(;kt(s)&&!gr(s);){let h=ht(s),u=ti(s);!u&&h.position==="fixed"&&(i=null),(o?!u&&!i:!u&&h.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Un(s)&&!u&&Gi(t,s))?n=n.filter(w=>w!==s):i=h,s=_n(s)}return e.set(t,n),n}function wa(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t,s=[...r==="clippingAncestors"?ya(e,this._c):[].concat(r),n],h=s[0],u=s.reduce((f,w)=>{let m=Fi(e,w,i);return f.top=tt(m.top,f.top),f.right=Et(m.right,f.right),f.bottom=Et(m.bottom,f.bottom),f.left=tt(m.left,f.left),f},Fi(e,h,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function xa(t){let{width:e,height:r}=Ui(t);return{width:e,height:r}}function Ea(t,e,r){let n=_t(e),i=Bt(e),o=r==="fixed",s=vn(t,!0,o,e),h={scrollLeft:0,scrollTop:0},u=nn(0);if(n||!n&&!o)if((rn(e)!=="body"||Un(i))&&(h=br(e)),n){let m=vn(e,!0,o,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}else i&&(u.x=qi(i));let f=s.left+h.scrollLeft-u.x,w=s.top+h.scrollTop-u.y;return{x:f,y:w,width:s.width,height:s.height}}function Li(t,e){return!_t(t)||ht(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ki(t,e){let r=ct(t);if(!_t(t)||Xi(t))return r;let n=Li(t,e);for(;n&&ca(n)&&ht(n).position==="static";)n=Li(n,e);return n&&(rn(n)==="html"||rn(n)==="body"&&ht(n).position==="static"&&!ti(n))?r:n||fa(t)||r}var Oa=async function(t){let e=this.getOffsetParent||Ki,r=this.getDimensions;return{reference:Ea(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await r(t.floating)}}};function Sa(t){return ht(t).direction==="rtl"}var Aa={convertOffsetParentRelativeRectToViewportRelativeRect:ha,getDocumentElement:Bt,getClippingRect:wa,getOffsetParent:Ki,getElementRects:Oa,getClientRects:va,getDimensions:xa,getScale:Cn,isElement:kt,isRTL:Sa};function Ca(t,e){let r=null,n,i=Bt(t);function o(){var h;clearTimeout(n),(h=r)==null||h.disconnect(),r=null}function s(h,u){h===void 0&&(h=!1),u===void 0&&(u=1),o();let{left:f,top:w,width:m,height:E}=t.getBoundingClientRect();if(h||e(),!m||!E)return;let O=pr(w),S=pr(i.clientWidth-(f+m)),P=pr(i.clientHeight-(w+E)),R=pr(f),B={rootMargin:-O+"px "+-S+"px "+-P+"px "+-R+"px",threshold:tt(0,Et(1,u))||1},K=!0;function X(ne){let J=ne[0].intersectionRatio;if(J!==u){if(!K)return s();J?s(!1,J):n=setTimeout(()=>{s(!1,1e-7)},100)}K=!1}try{r=new IntersectionObserver(X,{...B,root:i.ownerDocument})}catch{r=new IntersectionObserver(X,B)}r.observe(t)}return s(!0),o}function Ni(t,e,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,f=ri(t),w=i||o?[...f?zn(f):[],...zn(e)]:[];w.forEach($=>{i&&$.addEventListener("scroll",r,{passive:!0}),o&&$.addEventListener("resize",r)});let m=f&&h?Ca(f,r):null,E=-1,O=null;s&&(O=new ResizeObserver($=>{let[B]=$;B&&B.target===f&&O&&(O.unobserve(e),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var K;(K=O)==null||K.observe(e)})),r()}),f&&!u&&O.observe(f),O.observe(e));let S,P=u?vn(t):null;u&&R();function R(){let $=vn(t);P&&($.x!==P.x||$.y!==P.y||$.width!==P.width||$.height!==P.height)&&r(),P=$,S=requestAnimationFrame(R)}return r(),()=>{var $;w.forEach(B=>{i&&B.removeEventListener("scroll",r),o&&B.removeEventListener("resize",r)}),m?.(),($=O)==null||$.disconnect(),O=null,u&&cancelAnimationFrame(S)}}var ii=ta,Ji=sa,Zi=na,Qi=la,eo=ra,to=Qo,no=oa,ki=(t,e,r)=>{let n=new Map,i={platform:Aa,...r},o={...i.platform,_c:n};return Zo(t,e,{...i,platform:o})},Da=t=>{let e={placement:"bottom",strategy:"absolute",middleware:[]},r=Object.keys(t),n=i=>t[i];return r.includes("offset")&&e.middleware.push(Wi(n("offset"))),r.includes("teleport")&&(e.strategy="fixed"),r.includes("placement")&&(e.placement=n("placement")),r.includes("autoPlacement")&&!r.includes("flip")&&e.middleware.push(ii(n("autoPlacement"))),r.includes("flip")&&e.middleware.push(Zi(n("flip"))),r.includes("shift")&&e.middleware.push(Ji(n("shift"))),r.includes("inline")&&e.middleware.push(no(n("inline"))),r.includes("arrow")&&e.middleware.push(to(n("arrow"))),r.includes("hide")&&e.middleware.push(eo(n("hide"))),r.includes("size")&&e.middleware.push(Qi(n("size"))),e},Ta=(t,e)=>{let r={component:{trap:!1},float:{placement:"bottom",strategy:"absolute",middleware:[]}},n=i=>t[t.indexOf(i)+1];if(t.includes("trap")&&(r.component.trap=!0),t.includes("teleport")&&(r.float.strategy="fixed"),t.includes("offset")&&r.float.middleware.push(Wi(e.offset||10)),t.includes("placement")&&(r.float.placement=n("placement")),t.includes("autoPlacement")&&!t.includes("flip")&&r.float.middleware.push(ii(e.autoPlacement)),t.includes("flip")&&r.float.middleware.push(Zi(e.flip)),t.includes("shift")&&r.float.middleware.push(Ji(e.shift)),t.includes("inline")&&r.float.middleware.push(no(e.inline)),t.includes("arrow")&&r.float.middleware.push(to(e.arrow)),t.includes("hide")&&r.float.middleware.push(eo(e.hide)),t.includes("size")){let i=e.size?.availableWidth??null,o=e.size?.availableHeight??null;i&&delete e.size.availableWidth,o&&delete e.size.availableHeight,r.float.middleware.push(Qi({...e.size,apply({availableWidth:s,availableHeight:h,elements:u}){Object.assign(u.floating.style,{maxWidth:`${i??s}px`,maxHeight:`${o??h}px`})}}))}return r},_a=t=>{var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),r="";t||(t=Math.floor(Math.random()*e.length));for(var n=0;n{}){let r=!1;return function(){r?e.apply(this,arguments):(r=!0,t.apply(this,arguments))}}function Ma(t){let e={dismissable:!0,trap:!1};function r(n,i=null){if(n){if(n.hasAttribute("aria-expanded")||n.setAttribute("aria-expanded",!1),i.hasAttribute("id"))n.setAttribute("aria-controls",i.getAttribute("id"));else{let o=`panel-${_a(8)}`;n.setAttribute("aria-controls",o),i.setAttribute("id",o)}i.setAttribute("aria-modal",!0),i.setAttribute("role","dialog")}}t.magic("float",n=>(i={},o={})=>{let s={...e,...o},h=Object.keys(i).length>0?Da(i):{middleware:[ii()]},u=n,f=n.parentElement.closest("[x-data]"),w=f.querySelector('[x-ref="panel"]');r(u,w);function m(){return w.style.display=="block"}function E(){w.style.display="none",u.setAttribute("aria-expanded","false"),s.trap&&w.setAttribute("x-trap","false"),Ni(n,w,P)}function O(){w.style.display="block",u.setAttribute("aria-expanded","true"),s.trap&&w.setAttribute("x-trap","true"),P()}function S(){m()?E():O()}async function P(){return await ki(n,w,h).then(({middlewareData:R,placement:$,x:B,y:K})=>{if(R.arrow){let X=R.arrow?.x,ne=R.arrow?.y,J=h.middleware.filter(de=>de.name=="arrow")[0].options.element,V={top:"bottom",right:"left",bottom:"top",left:"right"}[$.split("-")[0]];Object.assign(J.style,{left:X!=null?`${X}px`:"",top:ne!=null?`${ne}px`:"",right:"",bottom:"",[V]:"-4px"})}if(R.hide){let{referenceHidden:X}=R.hide;Object.assign(w.style,{visibility:X?"hidden":"visible"})}Object.assign(w.style,{left:`${B}px`,top:`${K}px`})})}s.dismissable&&(window.addEventListener("click",R=>{!f.contains(R.target)&&m()&&S()}),window.addEventListener("keydown",R=>{R.key==="Escape"&&m()&&S()},!0)),S()}),t.directive("float",(n,{modifiers:i,expression:o},{evaluate:s,effect:h})=>{let u=o?s(o):{},f=i.length>0?Ta(i,u):{},w=null;f.float.strategy=="fixed"&&(n.style.position="fixed");let m=V=>n.parentElement&&!n.parentElement.closest("[x-data]").contains(V.target)?n.close():null,E=V=>V.key==="Escape"?n.close():null,O=n.getAttribute("x-ref"),S=n.parentElement.closest("[x-data]"),P=S.querySelectorAll(`[\\@click^="$refs.${O}"]`),R=S.querySelectorAll(`[x-on\\:click^="$refs.${O}"]`);n.style.setProperty("display","none"),r([...P,...R][0],n),n._x_isShown=!1,n.trigger=null,n._x_doHide||(n._x_doHide=()=>{n.style.setProperty("display","none",i.includes("important")?"important":void 0)}),n._x_doShow||(n._x_doShow=()=>{n.style.setProperty("display","block",i.includes("important")?"important":void 0)});let $=()=>{n._x_doHide(),n._x_isShown=!1},B=()=>{n._x_doShow(),n._x_isShown=!0},K=()=>setTimeout(B),X=Pa(V=>V?B():$(),V=>{typeof n._x_toggleAndCascadeWithTransitions=="function"?n._x_toggleAndCascadeWithTransitions(n,V,B,$):V?K():$()}),ne,J=!0;h(()=>s(V=>{!J&&V===ne||(i.includes("immediate")&&(V?K():$()),X(V),ne=V,J=!1)})),n.open=async function(V){n.trigger=V.currentTarget?V.currentTarget:V,X(!0),n.trigger.setAttribute("aria-expanded","true"),f.component.trap&&n.setAttribute("x-trap","true"),w=Ni(n.trigger,n,()=>{ki(n.trigger,n,f.float).then(({middlewareData:de,placement:U,x:Z,y:me})=>{if(de.arrow){let l=de.arrow?.x,p=de.arrow?.y,v=f.float.middleware.filter(N=>N.name=="arrow")[0].options.element,d={top:"bottom",right:"left",bottom:"top",left:"right"}[U.split("-")[0]];Object.assign(v.style,{left:l!=null?`${l}px`:"",top:p!=null?`${p}px`:"",right:"",bottom:"",[d]:"-4px"})}if(de.hide){let{referenceHidden:l}=de.hide;Object.assign(n.style,{visibility:l?"hidden":"visible"})}Object.assign(n.style,{left:`${Z}px`,top:`${me}px`})})}),window.addEventListener("click",m),window.addEventListener("keydown",E,!0)},n.close=function(){if(!n._x_isShown)return!1;X(!1),n.trigger.setAttribute("aria-expanded","false"),f.component.trap&&n.setAttribute("x-trap","false"),w(),window.removeEventListener("click",m),window.removeEventListener("keydown",E,!1)},n.toggle=function(V){n._x_isShown?n.close():n.open(V)}})}var ro=Ma;function Ra(t){t.store("lazyLoadedAssets",{loaded:new Set,check(s){return Array.isArray(s)?s.every(h=>this.loaded.has(h)):this.loaded.has(s)},markLoaded(s){Array.isArray(s)?s.forEach(h=>this.loaded.add(h)):this.loaded.add(s)}});let e=s=>new CustomEvent(s,{bubbles:!0,composed:!0,cancelable:!0}),r=(s,h={},u,f)=>{let w=document.createElement(s);return Object.entries(h).forEach(([m,E])=>w[m]=E),u&&(f?u.insertBefore(w,f):u.appendChild(w)),w},n=(s,h,u={},f=null,w=null)=>{let m=s==="link"?`link[href="${h}"]`:`script[src="${h}"]`;if(document.querySelector(m)||t.store("lazyLoadedAssets").check(h))return Promise.resolve();let E=s==="link"?{...u,href:h}:{...u,src:h},O=r(s,E,f,w);return new Promise((S,P)=>{O.onload=()=>{t.store("lazyLoadedAssets").markLoaded(h),S()},O.onerror=()=>{P(new Error(`Failed to load ${s}: ${h}`))}})},i=async(s,h,u=null,f=null)=>{let w={type:"text/css",rel:"stylesheet"};h&&(w.media=h);let m=document.head,E=null;if(u&&f){let O=document.querySelector(`link[href*="${f}"]`);O?(m=O.parentElement,E=u==="before"?O:O.nextSibling):(console.warn(`Target (${f}) not found for ${s}. Appending to head.`),m=document.head,E=null)}await n("link",s,w,m,E)},o=async(s,h,u=null,f=null,w=null)=>{let m=document.head,E=null;if(u&&f){let S=document.querySelector(`script[src*="${f}"]`);S?(m=S.parentElement,E=u==="before"?S:S.nextSibling):(console.warn(`Target (${f}) not found for ${s}. Falling back to head or body.`),m=document.head,E=null)}else(h.has("body-start")||h.has("body-end"))&&(m=document.body,h.has("body-start")&&(E=document.body.firstChild));let O={};w&&(O.type="module"),await n("script",s,O,m,E)};t.directive("load-css",(s,{expression:h},{evaluate:u})=>{let f=u(h),w=s.media,m=s.getAttribute("data-dispatch"),E=s.getAttribute("data-css-before")?"before":s.getAttribute("data-css-after")?"after":null,O=s.getAttribute("data-css-before")||s.getAttribute("data-css-after")||null;Promise.all(f.map(S=>i(S,w,E,O))).then(()=>{m&&window.dispatchEvent(e(`${m}-css`))}).catch(console.error)}),t.directive("load-js",(s,{expression:h,modifiers:u},{evaluate:f})=>{let w=f(h),m=new Set(u),E=s.getAttribute("data-js-before")?"before":s.getAttribute("data-js-after")?"after":null,O=s.getAttribute("data-js-before")||s.getAttribute("data-js-after")||null,S=s.getAttribute("data-js-as-module")||s.getAttribute("data-as-module")||!1,P=s.getAttribute("data-dispatch");Promise.all(w.map(R=>o(R,m,E,O,S))).then(()=>{P&&window.dispatchEvent(e(`${P}-js`))}).catch(console.error)})}var io=Ra;var jo=Uo(so(),1);function lo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function La(t,e){if(t==null)return{};var r=Fa(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var Na="1.15.3";function Ht(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Wt=Ht(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),er=Ht(/Edge/i),co=Ht(/firefox/i),Gn=Ht(/safari/i)&&!Ht(/chrome/i)&&!Ht(/android/i),bo=Ht(/iP(ad|od|hone)/i),yo=Ht(/chrome/i)&&Ht(/android/i),wo={capture:!1,passive:!1};function Ce(t,e,r){t.addEventListener(e,r,!Wt&&wo)}function Oe(t,e,r){t.removeEventListener(e,r,!Wt&&wo)}function _r(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function xo(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function St(t,e,r,n){if(t){r=r||document;do{if(e!=null&&(e[0]===">"?t.parentNode===r&&_r(t,e):_r(t,e))||n&&t===r)return t;if(t===r)break}while(t=xo(t))}return null}var fo=/\s+/g;function ft(t,e,r){if(t&&e)if(t.classList)t.classList[r?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(fo," ").replace(" "+e+" "," ");t.className=(n+(r?" "+e:"")).replace(fo," ")}}function ae(t,e,r){var n=t&&t.style;if(n){if(r===void 0)return document.defaultView&&document.defaultView.getComputedStyle?r=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(r=t.currentStyle),e===void 0?r:r[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=r+(typeof r=="string"?"":"px")}}function Ln(t,e){var r="";if(typeof t=="string")r=t;else do{var n=ae(t,"transform");n&&n!=="none"&&(r=n+" "+r)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(r)}function Eo(t,e,r){if(t){var n=t.getElementsByTagName(e),i=0,o=n.length;if(r)for(;i=o:s=i<=o,!s)return n;if(n===Pt())break;n=sn(n,!1)}return!1}function Nn(t,e,r,n){for(var i=0,o=0,s=t.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,o=La(n,za);tr.pluginEvent.bind(se)(e,r,Mt({dragEl:L,parentEl:ze,ghostEl:ue,rootEl:ke,nextEl:bn,lastDownEl:Ar,cloneEl:We,cloneHidden:an,dragStarted:Yn,putSortable:Ze,activeSortable:se.active,originalEvent:i,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on,hideGhostForTarget:Po,unhideGhostForTarget:Mo,cloneNowHidden:function(){an=!0},cloneNowShown:function(){an=!1},dispatchSortableEvent:function(h){it({sortable:r,name:h,originalEvent:i})}},o))};function it(t){Va(Mt({putSortable:Ze,cloneEl:We,targetEl:L,rootEl:ke,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on},t))}var L,ze,ue,ke,bn,Ar,We,an,Fn,ut,Jn,on,wr,Ze,In=!1,Pr=!1,Mr=[],mn,Ot,si,li,ho,vo,Yn,Rn,Zn,Qn=!1,xr=!1,Cr,nt,ci=[],hi=!1,Rr=[],Fr=typeof document<"u",Er=bo,mo=er||Wt?"cssFloat":"float",Ua=Fr&&!yo&&!bo&&"draggable"in document.createElement("div"),Do=function(){if(Fr){if(Wt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),To=function(e,r){var n=ae(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Nn(e,0,r),s=Nn(e,1,r),h=o&&ae(o),u=s&&ae(s),f=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+qe(o).width,w=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+qe(s).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&h.float&&h.float!=="none"){var m=h.float==="left"?"left":"right";return s&&(u.clear==="both"||u.clear===m)?"vertical":"horizontal"}return o&&(h.display==="block"||h.display==="flex"||h.display==="table"||h.display==="grid"||f>=i&&n[mo]==="none"||s&&n[mo]==="none"&&f+w>i)?"vertical":"horizontal"},Ya=function(e,r,n){var i=n?e.left:e.top,o=n?e.right:e.bottom,s=n?e.width:e.height,h=n?r.left:r.top,u=n?r.right:r.bottom,f=n?r.width:r.height;return i===h||o===u||i+s/2===h+f/2},Xa=function(e,r){var n;return Mr.some(function(i){var o=i[st].options.emptyInsertThreshold;if(!(!o||bi(i))){var s=qe(i),h=e>=s.left-o&&e<=s.right+o,u=r>=s.top-o&&r<=s.bottom+o;if(h&&u)return n=i}}),n},_o=function(e){function r(o,s){return function(h,u,f,w){var m=h.options.group.name&&u.options.group.name&&h.options.group.name===u.options.group.name;if(o==null&&(s||m))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return r(o(h,u,f,w),s)(h,u,f,w);var E=(s?h:u).options.group.name;return o===!0||typeof o=="string"&&o===E||o.join&&o.indexOf(E)>-1}}var n={},i=e.group;(!i||Sr(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=r(i.pull,!0),n.checkPut=r(i.put),n.revertClone=i.revertClone,e.group=n},Po=function(){!Do&&ue&&ae(ue,"display","none")},Mo=function(){!Do&&ue&&ae(ue,"display","")};Fr&&!yo&&document.addEventListener("click",function(t){if(Pr)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Pr=!1,!1},!0);var gn=function(e){if(L){e=e.touches?e.touches[0]:e;var r=Xa(e.clientX,e.clientY);if(r){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=r,n.preventDefault=void 0,n.stopPropagation=void 0,r[st]._onDragOver(n)}}},qa=function(e){L&&L.parentNode[st]._isOutsideThisEl(e.target)};function se(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=$t({},e),t[st]=this;var r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return To(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,h){s.setData("Text",h.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:se.supportPointer!==!1&&"PointerEvent"in window&&!Gn,emptyInsertThreshold:5};tr.initializePlugins(this,t,r);for(var n in r)!(n in e)&&(e[n]=r[n]);_o(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:Ua,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ce(t,"pointerdown",this._onTapStart):(Ce(t,"mousedown",this._onTapStart),Ce(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ce(t,"dragover",this),Ce(t,"dragenter",this)),Mr.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),$t(this,Ha())}se.prototype={constructor:se,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Rn=null)},_getDirection:function(e,r){return typeof this.options.direction=="function"?this.options.direction.call(this,e,r,L):this.options.direction},_onTapStart:function(e){if(e.cancelable){var r=this,n=this.el,i=this.options,o=i.preventOnFilter,s=e.type,h=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,u=(h||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||u,w=i.filter;if(ns(n),!L&&!(/mousedown|pointerdown/.test(s)&&e.button!==0||i.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Gn&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=St(u,i.draggable,n,!1),!(u&&u.animated)&&Ar!==u)){if(Fn=vt(u),Jn=vt(u,i.draggable),typeof w=="function"){if(w.call(this,e,u,this)){it({sortable:r,rootEl:f,name:"filter",targetEl:u,toEl:n,fromEl:n}),at("filter",r,{evt:e}),o&&e.cancelable&&e.preventDefault();return}}else if(w&&(w=w.split(",").some(function(m){if(m=St(f,m.trim(),n,!1),m)return it({sortable:r,rootEl:m,name:"filter",targetEl:u,fromEl:n,toEl:n}),at("filter",r,{evt:e}),!0}),w)){o&&e.cancelable&&e.preventDefault();return}i.handle&&!St(f,i.handle,n,!1)||this._prepareDragStart(e,h,u)}}},_prepareDragStart:function(e,r,n){var i=this,o=i.el,s=i.options,h=o.ownerDocument,u;if(n&&!L&&n.parentNode===o){var f=qe(n);if(ke=o,L=n,ze=L.parentNode,bn=L.nextSibling,Ar=n,wr=s.group,se.dragged=L,mn={target:L,clientX:(r||e).clientX,clientY:(r||e).clientY},ho=mn.clientX-f.left,vo=mn.clientY-f.top,this._lastX=(r||e).clientX,this._lastY=(r||e).clientY,L.style["will-change"]="all",u=function(){if(at("delayEnded",i,{evt:e}),se.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!co&&i.nativeDraggable&&(L.draggable=!0),i._triggerDragStart(e,r),it({sortable:i,name:"choose",originalEvent:e}),ft(L,s.chosenClass,!0)},s.ignore.split(",").forEach(function(w){Eo(L,w.trim(),fi)}),Ce(h,"dragover",gn),Ce(h,"mousemove",gn),Ce(h,"touchmove",gn),Ce(h,"mouseup",i._onDrop),Ce(h,"touchend",i._onDrop),Ce(h,"touchcancel",i._onDrop),co&&this.nativeDraggable&&(this.options.touchStartThreshold=4,L.draggable=!0),at("delayStart",this,{evt:e}),s.delay&&(!s.delayOnTouchOnly||r)&&(!this.nativeDraggable||!(er||Wt))){if(se.eventCanceled){this._onDrop();return}Ce(h,"mouseup",i._disableDelayedDrag),Ce(h,"touchend",i._disableDelayedDrag),Ce(h,"touchcancel",i._disableDelayedDrag),Ce(h,"mousemove",i._delayedDragTouchMoveHandler),Ce(h,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Ce(h,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(u,s.delay)}else u()}},_delayedDragTouchMoveHandler:function(e){var r=e.touches?e.touches[0]:e;Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){L&&fi(L),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Oe(e,"mouseup",this._disableDelayedDrag),Oe(e,"touchend",this._disableDelayedDrag),Oe(e,"touchcancel",this._disableDelayedDrag),Oe(e,"mousemove",this._delayedDragTouchMoveHandler),Oe(e,"touchmove",this._delayedDragTouchMoveHandler),Oe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,r){r=r||e.pointerType=="touch"&&e,!this.nativeDraggable||r?this.options.supportPointer?Ce(document,"pointermove",this._onTouchMove):r?Ce(document,"touchmove",this._onTouchMove):Ce(document,"mousemove",this._onTouchMove):(Ce(L,"dragend",this),Ce(ke,"dragstart",this._onDragStart));try{document.selection?Dr(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,r){if(In=!1,ke&&L){at("dragStarted",this,{evt:r}),this.nativeDraggable&&Ce(document,"dragover",qa);var n=this.options;!e&&ft(L,n.dragClass,!1),ft(L,n.ghostClass,!0),se.active=this,e&&this._appendGhost(),it({sortable:this,name:"start",originalEvent:r})}else this._nulling()},_emulateDragOver:function(){if(Ot){this._lastX=Ot.clientX,this._lastY=Ot.clientY,Po();for(var e=document.elementFromPoint(Ot.clientX,Ot.clientY),r=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Ot.clientX,Ot.clientY),e!==r);)r=e;if(L.parentNode[st]._isOutsideThisEl(e),r)do{if(r[st]){var n=void 0;if(n=r[st]._onDragOver({clientX:Ot.clientX,clientY:Ot.clientY,target:e,rootEl:r}),n&&!this.options.dragoverBubble)break}e=r}while(r=xo(r));Mo()}},_onTouchMove:function(e){if(mn){var r=this.options,n=r.fallbackTolerance,i=r.fallbackOffset,o=e.touches?e.touches[0]:e,s=ue&&Ln(ue,!0),h=ue&&s&&s.a,u=ue&&s&&s.d,f=Er&&nt&&po(nt),w=(o.clientX-mn.clientX+i.x)/(h||1)+(f?f[0]-ci[0]:0)/(h||1),m=(o.clientY-mn.clientY+i.y)/(u||1)+(f?f[1]-ci[1]:0)/(u||1);if(!se.active&&!In){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(it({rootEl:ze,name:"add",toEl:ze,fromEl:ke,originalEvent:e}),it({sortable:this,name:"remove",toEl:ze,originalEvent:e}),it({rootEl:ze,name:"sort",toEl:ze,fromEl:ke,originalEvent:e}),it({sortable:this,name:"sort",toEl:ze,originalEvent:e})),Ze&&Ze.save()):ut!==Fn&&ut>=0&&(it({sortable:this,name:"update",toEl:ze,originalEvent:e}),it({sortable:this,name:"sort",toEl:ze,originalEvent:e})),se.active&&((ut==null||ut===-1)&&(ut=Fn,on=Jn),it({sortable:this,name:"end",toEl:ze,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){at("nulling",this),ke=L=ze=ue=bn=We=Ar=an=mn=Ot=Yn=ut=on=Fn=Jn=Rn=Zn=Ze=wr=se.dragged=se.ghost=se.clone=se.active=null,Rr.forEach(function(e){e.checked=!0}),Rr.length=si=li=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":L&&(this._onDragOver(e),Ga(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],r,n=this.el.children,i=0,o=n.length,s=this.options;ii.right+o||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>i.bottom+o||t.clientX>n.right&&t.clientY>n.top}function Qa(t,e,r,n,i,o,s,h){var u=n?t.clientY:t.clientX,f=n?r.height:r.width,w=n?r.top:r.left,m=n?r.bottom:r.right,E=!1;if(!s){if(h&&Crw+f*o/2:um-Cr)return-Zn}else if(u>w+f*(1-i)/2&&um-f*o/2)?u>w+f/2?1:-1:0}function es(t){return vt(L){t.directive("sortable",e=>{let r=parseInt(e.dataset?.sortableAnimationDuration);r!==0&&!r&&(r=300),e.sortable=xi.create(e,{group:e.getAttribute("x-sortable-group"),draggable:"[x-sortable-item]",handle:"[x-sortable-handle]",dataIdAttr:"x-sortable-item",animation:r,ghostClass:"fi-sortable-ghost"})})};var is=Object.create,Si=Object.defineProperty,os=Object.getPrototypeOf,as=Object.prototype.hasOwnProperty,ss=Object.getOwnPropertyNames,ls=Object.getOwnPropertyDescriptor,cs=t=>Si(t,"__esModule",{value:!0}),Fo=(t,e)=>()=>(e||(e={exports:{}},t(e.exports,e)),e.exports),fs=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ss(e))!as.call(t,n)&&n!=="default"&&Si(t,n,{get:()=>e[n],enumerable:!(r=ls(e,n))||r.enumerable});return t},Lo=t=>fs(cs(Si(t!=null?is(os(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),us=Fo(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(c){var a=c.getBoundingClientRect();return{width:a.width,height:a.height,top:a.top,right:a.right,bottom:a.bottom,left:a.left,x:a.left,y:a.top}}function r(c){if(c==null)return window;if(c.toString()!=="[object Window]"){var a=c.ownerDocument;return a&&a.defaultView||window}return c}function n(c){var a=r(c),b=a.pageXOffset,D=a.pageYOffset;return{scrollLeft:b,scrollTop:D}}function i(c){var a=r(c).Element;return c instanceof a||c instanceof Element}function o(c){var a=r(c).HTMLElement;return c instanceof a||c instanceof HTMLElement}function s(c){if(typeof ShadowRoot>"u")return!1;var a=r(c).ShadowRoot;return c instanceof a||c instanceof ShadowRoot}function h(c){return{scrollLeft:c.scrollLeft,scrollTop:c.scrollTop}}function u(c){return c===r(c)||!o(c)?n(c):h(c)}function f(c){return c?(c.nodeName||"").toLowerCase():null}function w(c){return((i(c)?c.ownerDocument:c.document)||window.document).documentElement}function m(c){return e(w(c)).left+n(c).scrollLeft}function E(c){return r(c).getComputedStyle(c)}function O(c){var a=E(c),b=a.overflow,D=a.overflowX,T=a.overflowY;return/auto|scroll|overlay|hidden/.test(b+T+D)}function S(c,a,b){b===void 0&&(b=!1);var D=w(a),T=e(c),F=o(a),W={scrollLeft:0,scrollTop:0},j={x:0,y:0};return(F||!F&&!b)&&((f(a)!=="body"||O(D))&&(W=u(a)),o(a)?(j=e(a),j.x+=a.clientLeft,j.y+=a.clientTop):D&&(j.x=m(D))),{x:T.left+W.scrollLeft-j.x,y:T.top+W.scrollTop-j.y,width:T.width,height:T.height}}function P(c){var a=e(c),b=c.offsetWidth,D=c.offsetHeight;return Math.abs(a.width-b)<=1&&(b=a.width),Math.abs(a.height-D)<=1&&(D=a.height),{x:c.offsetLeft,y:c.offsetTop,width:b,height:D}}function R(c){return f(c)==="html"?c:c.assignedSlot||c.parentNode||(s(c)?c.host:null)||w(c)}function $(c){return["html","body","#document"].indexOf(f(c))>=0?c.ownerDocument.body:o(c)&&O(c)?c:$(R(c))}function B(c,a){var b;a===void 0&&(a=[]);var D=$(c),T=D===((b=c.ownerDocument)==null?void 0:b.body),F=r(D),W=T?[F].concat(F.visualViewport||[],O(D)?D:[]):D,j=a.concat(W);return T?j:j.concat(B(R(W)))}function K(c){return["table","td","th"].indexOf(f(c))>=0}function X(c){return!o(c)||E(c).position==="fixed"?null:c.offsetParent}function ne(c){var a=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,b=navigator.userAgent.indexOf("Trident")!==-1;if(b&&o(c)){var D=E(c);if(D.position==="fixed")return null}for(var T=R(c);o(T)&&["html","body"].indexOf(f(T))<0;){var F=E(T);if(F.transform!=="none"||F.perspective!=="none"||F.contain==="paint"||["transform","perspective"].indexOf(F.willChange)!==-1||a&&F.willChange==="filter"||a&&F.filter&&F.filter!=="none")return T;T=T.parentNode}return null}function J(c){for(var a=r(c),b=X(c);b&&K(b)&&E(b).position==="static";)b=X(b);return b&&(f(b)==="html"||f(b)==="body"&&E(b).position==="static")?a:b||ne(c)||a}var V="top",de="bottom",U="right",Z="left",me="auto",l=[V,de,U,Z],p="start",v="end",d="clippingParents",N="viewport",_="popper",M="reference",Q=l.reduce(function(c,a){return c.concat([a+"-"+p,a+"-"+v])},[]),Ue=[].concat(l,[me]).reduce(function(c,a){return c.concat([a,a+"-"+p,a+"-"+v])},[]),Rt="beforeRead",Vt="read",Lr="afterRead",Nr="beforeMain",kr="main",zt="afterMain",nr="beforeWrite",jr="write",rr="afterWrite",It=[Rt,Vt,Lr,Nr,kr,zt,nr,jr,rr];function Br(c){var a=new Map,b=new Set,D=[];c.forEach(function(F){a.set(F.name,F)});function T(F){b.add(F.name);var W=[].concat(F.requires||[],F.requiresIfExists||[]);W.forEach(function(j){if(!b.has(j)){var q=a.get(j);q&&T(q)}}),D.push(F)}return c.forEach(function(F){b.has(F.name)||T(F)}),D}function mt(c){var a=Br(c);return It.reduce(function(b,D){return b.concat(a.filter(function(T){return T.phase===D}))},[])}function Ut(c){var a;return function(){return a||(a=new Promise(function(b){Promise.resolve().then(function(){a=void 0,b(c())})})),a}}function At(c){for(var a=arguments.length,b=new Array(a>1?a-1:0),D=1;D=0,D=b&&o(c)?J(c):c;return i(D)?a.filter(function(T){return i(T)&&kn(T,D)&&f(T)!=="body"}):[]}function wn(c,a,b){var D=a==="clippingParents"?yn(c):[].concat(a),T=[].concat(D,[b]),F=T[0],W=T.reduce(function(j,q){var oe=sr(c,q);return j.top=gt(oe.top,j.top),j.right=ln(oe.right,j.right),j.bottom=ln(oe.bottom,j.bottom),j.left=gt(oe.left,j.left),j},sr(c,F));return W.width=W.right-W.left,W.height=W.bottom-W.top,W.x=W.left,W.y=W.top,W}function cn(c){return c.split("-")[1]}function dt(c){return["top","bottom"].indexOf(c)>=0?"x":"y"}function lr(c){var a=c.reference,b=c.element,D=c.placement,T=D?ot(D):null,F=D?cn(D):null,W=a.x+a.width/2-b.width/2,j=a.y+a.height/2-b.height/2,q;switch(T){case V:q={x:W,y:a.y-b.height};break;case de:q={x:W,y:a.y+a.height};break;case U:q={x:a.x+a.width,y:j};break;case Z:q={x:a.x-b.width,y:j};break;default:q={x:a.x,y:a.y}}var oe=T?dt(T):null;if(oe!=null){var z=oe==="y"?"height":"width";switch(F){case p:q[oe]=q[oe]-(a[z]/2-b[z]/2);break;case v:q[oe]=q[oe]+(a[z]/2-b[z]/2);break}}return q}function cr(){return{top:0,right:0,bottom:0,left:0}}function fr(c){return Object.assign({},cr(),c)}function ur(c,a){return a.reduce(function(b,D){return b[D]=c,b},{})}function qt(c,a){a===void 0&&(a={});var b=a,D=b.placement,T=D===void 0?c.placement:D,F=b.boundary,W=F===void 0?d:F,j=b.rootBoundary,q=j===void 0?N:j,oe=b.elementContext,z=oe===void 0?_:oe,De=b.altBoundary,Le=De===void 0?!1:De,Ae=b.padding,xe=Ae===void 0?0:Ae,Me=fr(typeof xe!="number"?xe:ur(xe,l)),Ee=z===_?M:_,Be=c.elements.reference,Re=c.rects.popper,He=c.elements[Le?Ee:z],ce=wn(i(He)?He:He.contextElement||w(c.elements.popper),W,q),Pe=e(Be),Te=lr({reference:Pe,element:Re,strategy:"absolute",placement:T}),Ne=Xt(Object.assign({},Re,Te)),Fe=z===_?Ne:Pe,Ye={top:ce.top-Fe.top+Me.top,bottom:Fe.bottom-ce.bottom+Me.bottom,left:ce.left-Fe.left+Me.left,right:Fe.right-ce.right+Me.right},$e=c.modifiersData.offset;if(z===_&&$e){var Ve=$e[T];Object.keys(Ye).forEach(function(wt){var et=[U,de].indexOf(wt)>=0?1:-1,Lt=[V,de].indexOf(wt)>=0?"y":"x";Ye[wt]+=Ve[Lt]*et})}return Ye}var dr="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",zr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",xn={placement:"bottom",modifiers:[],strategy:"absolute"};function fn(){for(var c=arguments.length,a=new Array(c),b=0;b100){console.error(zr);break}if(z.reset===!0){z.reset=!1,Pe=-1;continue}var Te=z.orderedModifiers[Pe],Ne=Te.fn,Fe=Te.options,Ye=Fe===void 0?{}:Fe,$e=Te.name;typeof Ne=="function"&&(z=Ne({state:z,options:Ye,name:$e,instance:Ae})||z)}}},update:Ut(function(){return new Promise(function(Ee){Ae.forceUpdate(),Ee(z)})}),destroy:function(){Me(),Le=!0}};if(!fn(j,q))return console.error(dr),Ae;Ae.setOptions(oe).then(function(Ee){!Le&&oe.onFirstUpdate&&oe.onFirstUpdate(Ee)});function xe(){z.orderedModifiers.forEach(function(Ee){var Be=Ee.name,Re=Ee.options,He=Re===void 0?{}:Re,ce=Ee.effect;if(typeof ce=="function"){var Pe=ce({state:z,name:Be,instance:Ae,options:He}),Te=function(){};De.push(Pe||Te)}})}function Me(){De.forEach(function(Ee){return Ee()}),De=[]}return Ae}}var On={passive:!0};function Ur(c){var a=c.state,b=c.instance,D=c.options,T=D.scroll,F=T===void 0?!0:T,W=D.resize,j=W===void 0?!0:W,q=r(a.elements.popper),oe=[].concat(a.scrollParents.reference,a.scrollParents.popper);return F&&oe.forEach(function(z){z.addEventListener("scroll",b.update,On)}),j&&q.addEventListener("resize",b.update,On),function(){F&&oe.forEach(function(z){z.removeEventListener("scroll",b.update,On)}),j&&q.removeEventListener("resize",b.update,On)}}var jn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ur,data:{}};function Yr(c){var a=c.state,b=c.name;a.modifiersData[b]=lr({reference:a.rects.reference,element:a.rects.popper,strategy:"absolute",placement:a.placement})}var Bn={name:"popperOffsets",enabled:!0,phase:"read",fn:Yr,data:{}},Xr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qr(c){var a=c.x,b=c.y,D=window,T=D.devicePixelRatio||1;return{x:Yt(Yt(a*T)/T)||0,y:Yt(Yt(b*T)/T)||0}}function Hn(c){var a,b=c.popper,D=c.popperRect,T=c.placement,F=c.offsets,W=c.position,j=c.gpuAcceleration,q=c.adaptive,oe=c.roundOffsets,z=oe===!0?qr(F):typeof oe=="function"?oe(F):F,De=z.x,Le=De===void 0?0:De,Ae=z.y,xe=Ae===void 0?0:Ae,Me=F.hasOwnProperty("x"),Ee=F.hasOwnProperty("y"),Be=Z,Re=V,He=window;if(q){var ce=J(b),Pe="clientHeight",Te="clientWidth";ce===r(b)&&(ce=w(b),E(ce).position!=="static"&&(Pe="scrollHeight",Te="scrollWidth")),ce=ce,T===V&&(Re=de,xe-=ce[Pe]-D.height,xe*=j?1:-1),T===Z&&(Be=U,Le-=ce[Te]-D.width,Le*=j?1:-1)}var Ne=Object.assign({position:W},q&&Xr);if(j){var Fe;return Object.assign({},Ne,(Fe={},Fe[Re]=Ee?"0":"",Fe[Be]=Me?"0":"",Fe.transform=(He.devicePixelRatio||1)<2?"translate("+Le+"px, "+xe+"px)":"translate3d("+Le+"px, "+xe+"px, 0)",Fe))}return Object.assign({},Ne,(a={},a[Re]=Ee?xe+"px":"",a[Be]=Me?Le+"px":"",a.transform="",a))}function g(c){var a=c.state,b=c.options,D=b.gpuAcceleration,T=D===void 0?!0:D,F=b.adaptive,W=F===void 0?!0:F,j=b.roundOffsets,q=j===void 0?!0:j,oe=E(a.elements.popper).transitionProperty||"";W&&["transform","top","right","bottom","left"].some(function(De){return oe.indexOf(De)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',` `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",` -`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var z={placement:ot(a.placement),popper:a.elements.popper,popperRect:a.rects.popper,gpuAcceleration:T};a.modifiersData.popperOffsets!=null&&(a.styles.popper=Object.assign({},a.styles.popper,Hn(Object.assign({},z,{offsets:a.modifiersData.popperOffsets,position:a.options.strategy,adaptive:W,roundOffsets:q})))),a.modifiersData.arrow!=null&&(a.styles.arrow=Object.assign({},a.styles.arrow,Hn(Object.assign({},z,{offsets:a.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:q})))),a.attributes.popper=Object.assign({},a.attributes.popper,{"data-popper-placement":a.placement})}var w={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:m,data:{}};function S(c){var a=c.state;Object.keys(a.elements).forEach(function(g){var D=a.styles[g]||{},T=a.attributes[g]||{},F=a.elements[g];!o(F)||!f(F)||(Object.assign(F.style,D),Object.keys(T).forEach(function(W){var j=T[W];j===!1?F.removeAttribute(W):F.setAttribute(W,j===!0?"":j)}))})}function I(c){var a=c.state,g={popper:{position:a.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(a.elements.popper.style,g.popper),a.styles=g,a.elements.arrow&&Object.assign(a.elements.arrow.style,g.arrow),function(){Object.keys(a.elements).forEach(function(D){var T=a.elements[D],F=a.attributes[D]||{},W=Object.keys(a.styles.hasOwnProperty(D)?a.styles[D]:g[D]),j=W.reduce(function(q,oe){return q[oe]="",q},{});!o(T)||!f(T)||(Object.assign(T.style,j),Object.keys(F).forEach(function(q){T.removeAttribute(q)}))})}}var Y={name:"applyStyles",enabled:!0,phase:"write",fn:S,effect:I,requires:["computeStyles"]};function H(c,a,g){var D=ot(c),T=[Z,V].indexOf(D)>=0?-1:1,F=typeof g=="function"?g(Object.assign({},a,{placement:c})):g,W=F[0],j=F[1];return W=W||0,j=(j||0)*T,[Z,U].indexOf(D)>=0?{x:j,y:W}:{x:W,y:j}}function k(c){var a=c.state,g=c.options,D=c.name,T=g.offset,F=T===void 0?[0,0]:T,W=Ue.reduce(function(z,De){return z[De]=H(De,a.rects,F),z},{}),j=W[a.placement],q=j.x,oe=j.y;a.modifiersData.popperOffsets!=null&&(a.modifiersData.popperOffsets.x+=q,a.modifiersData.popperOffsets.y+=oe),a.modifiersData[D]=W}var be={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:k},le={left:"right",right:"left",bottom:"top",top:"bottom"};function pe(c){return c.replace(/left|right|bottom|top/g,function(a){return le[a]})}var ye={start:"end",end:"start"};function _e(c){return c.replace(/start|end/g,function(a){return ye[a]})}function je(c,a){a===void 0&&(a={});var g=a,D=g.placement,T=g.boundary,F=g.rootBoundary,W=g.padding,j=g.flipVariations,q=g.allowedAutoPlacements,oe=q===void 0?Ue:q,z=cn(D),De=z?j?Q:Q.filter(function(xe){return cn(xe)===z}):s,Le=De.filter(function(xe){return oe.indexOf(xe)>=0});Le.length===0&&(Le=De,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var Ae=Le.reduce(function(xe,Me){return xe[Me]=qt(c,{placement:Me,boundary:T,rootBoundary:F,padding:W})[ot(Me)],xe},{});return Object.keys(Ae).sort(function(xe,Me){return Ae[xe]-Ae[Me]})}function Se(c){if(ot(c)===me)return[];var a=pe(c);return[_e(c),a,_e(a)]}function Ie(c){var a=c.state,g=c.options,D=c.name;if(!a.modifiersData[D]._skip){for(var T=g.mainAxis,F=T===void 0?!0:T,W=g.altAxis,j=W===void 0?!0:W,q=g.fallbackPlacements,oe=g.padding,z=g.boundary,De=g.rootBoundary,Le=g.altBoundary,Ae=g.flipVariations,xe=Ae===void 0?!0:Ae,Me=g.allowedAutoPlacements,Ee=a.options.placement,Be=ot(Ee),Re=Be===Ee,He=q||(Re||!xe?[pe(Ee)]:Se(Ee)),ce=[Ee].concat(He).reduce(function(te,ge){return te.concat(ot(ge)===me?je(a,{placement:ge,boundary:z,rootBoundary:De,padding:oe,flipVariations:xe,allowedAutoPlacements:Me}):ge)},[]),Pe=a.rects.reference,Te=a.rects.popper,Ne=new Map,Fe=!0,Ye=ce[0],$e=0;$e=0,dn=Lt?"width":"height",Zt=qt(a,{placement:Ve,boundary:z,rootBoundary:De,altBoundary:Le,padding:oe}),Nt=Lt?et?U:Z:et?de:V;Pe[dn]>Te[dn]&&(Nt=pe(Nt));var $n=pe(Nt),Qt=[];if(F&&Qt.push(Zt[wt]<=0),j&&Qt.push(Zt[Nt]<=0,Zt[$n]<=0),Qt.every(function(te){return te})){Ye=Ve,Fe=!1;break}Ne.set(Ve,Qt)}if(Fe)for(var Sn=xe?3:1,Wn=function(ge){var we=ce.find(function(Ke){var Je=Ne.get(Ke);if(Je)return Je.slice(0,ge).every(function(Dt){return Dt})});if(we)return Ye=we,"break"},C=Sn;C>0;C--){var G=Wn(C);if(G==="break")break}a.placement!==Ye&&(a.modifiersData[D]._skip=!0,a.placement=Ye,a.reset=!0)}}var re={name:"flip",enabled:!0,phase:"main",fn:Ie,requiresIfExists:["offset"],data:{_skip:!1}};function he(c){return c==="x"?"y":"x"}function ve(c,a,g){return gt(c,ln(a,g))}function ee(c){var a=c.state,g=c.options,D=c.name,T=g.mainAxis,F=T===void 0?!0:T,W=g.altAxis,j=W===void 0?!1:W,q=g.boundary,oe=g.rootBoundary,z=g.altBoundary,De=g.padding,Le=g.tether,Ae=Le===void 0?!0:Le,xe=g.tetherOffset,Me=xe===void 0?0:xe,Ee=qt(a,{boundary:q,rootBoundary:oe,padding:De,altBoundary:z}),Be=ot(a.placement),Re=cn(a.placement),He=!Re,ce=dt(Be),Pe=he(ce),Te=a.modifiersData.popperOffsets,Ne=a.rects.reference,Fe=a.rects.popper,Ye=typeof Me=="function"?Me(Object.assign({},a.rects,{placement:a.placement})):Me,$e={x:0,y:0};if(Te){if(F||j){var Ve=ce==="y"?V:Z,wt=ce==="y"?de:U,et=ce==="y"?"height":"width",Lt=Te[ce],dn=Te[ce]+Ee[Ve],Zt=Te[ce]-Ee[wt],Nt=Ae?-Fe[et]/2:0,$n=Re===p?Ne[et]:Fe[et],Qt=Re===p?-Fe[et]:-Ne[et],Sn=a.elements.arrow,Wn=Ae&&Sn?P(Sn):{width:0,height:0},C=a.modifiersData["arrow#persistent"]?a.modifiersData["arrow#persistent"].padding:cr(),G=C[Ve],te=C[wt],ge=ve(0,Ne[et],Wn[et]),we=He?Ne[et]/2-Nt-ge-G-Ye:$n-ge-G-Ye,Ke=He?-Ne[et]/2+Nt+ge+te+Ye:Qt+ge+te+Ye,Je=a.elements.arrow&&J(a.elements.arrow),Dt=Je?ce==="y"?Je.clientTop||0:Je.clientLeft||0:0,Vn=a.modifiersData.offset?a.modifiersData.offset[a.placement][ce]:0,Tt=Te[ce]+we-Vn-Dt,An=Te[ce]+Ke-Vn;if(F){var pn=ve(Ae?ln(dn,Tt):dn,Lt,Ae?gt(Zt,An):Zt);Te[ce]=pn,$e[ce]=pn-Lt}if(j){var en=ce==="x"?V:Z,Gr=ce==="x"?de:U,tn=Te[Pe],hn=tn+Ee[en],Ai=tn-Ee[Gr],Ci=ve(Ae?ln(hn,Tt):hn,tn,Ae?gt(Ai,An):Ai);Te[Pe]=Ci,$e[Pe]=Ci-tn}}a.modifiersData[D]=$e}}var ie={name:"preventOverflow",enabled:!0,phase:"main",fn:ee,requiresIfExists:["offset"]},x=function(a,g){return a=typeof a=="function"?a(Object.assign({},g.rects,{placement:g.placement})):a,fr(typeof a!="number"?a:ur(a,s))};function Ge(c){var a,g=c.state,D=c.name,T=c.options,F=g.elements.arrow,W=g.modifiersData.popperOffsets,j=ot(g.placement),q=dt(j),oe=[Z,U].indexOf(j)>=0,z=oe?"height":"width";if(!(!F||!W)){var De=x(T.padding,g),Le=P(F),Ae=q==="y"?V:Z,xe=q==="y"?de:U,Me=g.rects.reference[z]+g.rects.reference[q]-W[q]-g.rects.popper[z],Ee=W[q]-g.rects.reference[q],Be=J(F),Re=Be?q==="y"?Be.clientHeight||0:Be.clientWidth||0:0,He=Me/2-Ee/2,ce=De[Ae],Pe=Re-Le[z]-De[xe],Te=Re/2-Le[z]/2+He,Ne=ve(ce,Te,Pe),Fe=q;g.modifiersData[D]=(a={},a[Fe]=Ne,a.centerOffset=Ne-Te,a)}}function fe(c){var a=c.state,g=c.options,D=g.element,T=D===void 0?"[data-popper-arrow]":D;if(T!=null&&!(typeof T=="string"&&(T=a.elements.popper.querySelector(T),!T))){if(o(T)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),!kn(a.elements.popper,T)){console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}a.elements.arrow=T}}var Ft={name:"arrow",enabled:!0,phase:"main",fn:Ge,effect:fe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bt(c,a,g){return g===void 0&&(g={x:0,y:0}),{top:c.top-a.height-g.y,right:c.right-a.width+g.x,bottom:c.bottom-a.height+g.y,left:c.left-a.width-g.x}}function Gt(c){return[V,U,de,Z].some(function(a){return c[a]>=0})}function Kt(c){var a=c.state,g=c.name,D=a.rects.reference,T=a.rects.popper,F=a.modifiersData.preventOverflow,W=qt(a,{elementContext:"reference"}),j=qt(a,{altBoundary:!0}),q=bt(W,D),oe=bt(j,T,F),z=Gt(q),De=Gt(oe);a.modifiersData[g]={referenceClippingOffsets:q,popperEscapeOffsets:oe,isReferenceHidden:z,hasPopperEscaped:De},a.attributes.popper=Object.assign({},a.attributes.popper,{"data-popper-reference-hidden":z,"data-popper-escaped":De})}var Jt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kt},rt=[jn,Bn,w,Y],st=En({defaultModifiers:rt}),yt=[jn,Bn,w,Y,be,re,ie,Ft,Jt],un=En({defaultModifiers:yt});t.applyStyles=Y,t.arrow=Ft,t.computeStyles=w,t.createPopper=un,t.createPopperLite=st,t.defaultModifiers=yt,t.detectOverflow=qt,t.eventListeners=jn,t.flip=re,t.hide=Jt,t.offset=be,t.popperGenerator=En,t.popperOffsets=Bn,t.preventOverflow=ie}),Lo=Io(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=us(),r='',n="tippy-box",i="tippy-content",o="tippy-backdrop",l="tippy-arrow",h="tippy-svg-arrow",u={passive:!0,capture:!0};function f(m,w){return{}.hasOwnProperty.call(m,w)}function y(m,w,S){if(Array.isArray(m)){var I=m[w];return I??(Array.isArray(S)?S[w]:S)}return m}function b(m,w){var S={}.toString.call(m);return S.indexOf("[object")===0&&S.indexOf(w+"]")>-1}function A(m,w){return typeof m=="function"?m.apply(void 0,w):m}function E(m,w){if(w===0)return m;var S;return function(I){clearTimeout(S),S=setTimeout(function(){m(I)},w)}}function O(m,w){var S=Object.assign({},m);return w.forEach(function(I){delete S[I]}),S}function P(m){return m.split(/\s+/).filter(Boolean)}function R(m){return[].concat(m)}function $(m,w){m.indexOf(w)===-1&&m.push(w)}function B(m){return m.filter(function(w,S){return m.indexOf(w)===S})}function K(m){return m.split("-")[0]}function X(m){return[].slice.call(m)}function ne(m){return Object.keys(m).reduce(function(w,S){return m[S]!==void 0&&(w[S]=m[S]),w},{})}function J(){return document.createElement("div")}function V(m){return["Element","Fragment"].some(function(w){return b(m,w)})}function de(m){return b(m,"NodeList")}function U(m){return b(m,"MouseEvent")}function Z(m){return!!(m&&m._tippy&&m._tippy.reference===m)}function me(m){return V(m)?[m]:de(m)?X(m):Array.isArray(m)?m:X(document.querySelectorAll(m))}function s(m,w){m.forEach(function(S){S&&(S.style.transitionDuration=w+"ms")})}function p(m,w){m.forEach(function(S){S&&S.setAttribute("data-state",w)})}function v(m){var w,S=R(m),I=S[0];return!(I==null||(w=I.ownerDocument)==null)&&w.body?I.ownerDocument:document}function d(m,w){var S=w.clientX,I=w.clientY;return m.every(function(Y){var H=Y.popperRect,k=Y.popperState,be=Y.props,le=be.interactiveBorder,pe=K(k.placement),ye=k.modifiersData.offset;if(!ye)return!0;var _e=pe==="bottom"?ye.top.y:0,je=pe==="top"?ye.bottom.y:0,Se=pe==="right"?ye.left.x:0,Ie=pe==="left"?ye.right.x:0,re=H.top-I+_e>le,he=I-H.bottom-je>le,ve=H.left-S+Se>le,ee=S-H.right-Ie>le;return re||he||ve||ee})}function N(m,w,S){var I=w+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(Y){m[I](Y,S)})}var _={isTouch:!1},M=0;function Q(){_.isTouch||(_.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ue))}function Ue(){var m=performance.now();m-M<20&&(_.isTouch=!1,document.removeEventListener("mousemove",Ue)),M=m}function Rt(){var m=document.activeElement;if(Z(m)){var w=m._tippy;m.blur&&!w.state.isVisible&&m.blur()}}function Vt(){document.addEventListener("touchstart",Q,u),window.addEventListener("blur",Rt)}var Lr=typeof window<"u"&&typeof document<"u",Nr=Lr?navigator.userAgent:"",kr=/MSIE |Trident\//.test(Nr);function zt(m){var w=m==="destroy"?"n already-":" ";return[m+"() was called on a"+w+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function nr(m){var w=/[ \t]{2,}/g,S=/^[ \t]*/gm;return m.replace(w," ").replace(S,"").trim()}function jr(m){return nr(` +`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var z={placement:ot(a.placement),popper:a.elements.popper,popperRect:a.rects.popper,gpuAcceleration:T};a.modifiersData.popperOffsets!=null&&(a.styles.popper=Object.assign({},a.styles.popper,Hn(Object.assign({},z,{offsets:a.modifiersData.popperOffsets,position:a.options.strategy,adaptive:W,roundOffsets:q})))),a.modifiersData.arrow!=null&&(a.styles.arrow=Object.assign({},a.styles.arrow,Hn(Object.assign({},z,{offsets:a.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:q})))),a.attributes.popper=Object.assign({},a.attributes.popper,{"data-popper-placement":a.placement})}var y={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:g,data:{}};function A(c){var a=c.state;Object.keys(a.elements).forEach(function(b){var D=a.styles[b]||{},T=a.attributes[b]||{},F=a.elements[b];!o(F)||!f(F)||(Object.assign(F.style,D),Object.keys(T).forEach(function(W){var j=T[W];j===!1?F.removeAttribute(W):F.setAttribute(W,j===!0?"":j)}))})}function I(c){var a=c.state,b={popper:{position:a.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(a.elements.popper.style,b.popper),a.styles=b,a.elements.arrow&&Object.assign(a.elements.arrow.style,b.arrow),function(){Object.keys(a.elements).forEach(function(D){var T=a.elements[D],F=a.attributes[D]||{},W=Object.keys(a.styles.hasOwnProperty(D)?a.styles[D]:b[D]),j=W.reduce(function(q,oe){return q[oe]="",q},{});!o(T)||!f(T)||(Object.assign(T.style,j),Object.keys(F).forEach(function(q){T.removeAttribute(q)}))})}}var Y={name:"applyStyles",enabled:!0,phase:"write",fn:A,effect:I,requires:["computeStyles"]};function H(c,a,b){var D=ot(c),T=[Z,V].indexOf(D)>=0?-1:1,F=typeof b=="function"?b(Object.assign({},a,{placement:c})):b,W=F[0],j=F[1];return W=W||0,j=(j||0)*T,[Z,U].indexOf(D)>=0?{x:j,y:W}:{x:W,y:j}}function k(c){var a=c.state,b=c.options,D=c.name,T=b.offset,F=T===void 0?[0,0]:T,W=Ue.reduce(function(z,De){return z[De]=H(De,a.rects,F),z},{}),j=W[a.placement],q=j.x,oe=j.y;a.modifiersData.popperOffsets!=null&&(a.modifiersData.popperOffsets.x+=q,a.modifiersData.popperOffsets.y+=oe),a.modifiersData[D]=W}var be={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:k},le={left:"right",right:"left",bottom:"top",top:"bottom"};function pe(c){return c.replace(/left|right|bottom|top/g,function(a){return le[a]})}var ye={start:"end",end:"start"};function _e(c){return c.replace(/start|end/g,function(a){return ye[a]})}function je(c,a){a===void 0&&(a={});var b=a,D=b.placement,T=b.boundary,F=b.rootBoundary,W=b.padding,j=b.flipVariations,q=b.allowedAutoPlacements,oe=q===void 0?Ue:q,z=cn(D),De=z?j?Q:Q.filter(function(xe){return cn(xe)===z}):l,Le=De.filter(function(xe){return oe.indexOf(xe)>=0});Le.length===0&&(Le=De,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var Ae=Le.reduce(function(xe,Me){return xe[Me]=qt(c,{placement:Me,boundary:T,rootBoundary:F,padding:W})[ot(Me)],xe},{});return Object.keys(Ae).sort(function(xe,Me){return Ae[xe]-Ae[Me]})}function Se(c){if(ot(c)===me)return[];var a=pe(c);return[_e(c),a,_e(a)]}function Ie(c){var a=c.state,b=c.options,D=c.name;if(!a.modifiersData[D]._skip){for(var T=b.mainAxis,F=T===void 0?!0:T,W=b.altAxis,j=W===void 0?!0:W,q=b.fallbackPlacements,oe=b.padding,z=b.boundary,De=b.rootBoundary,Le=b.altBoundary,Ae=b.flipVariations,xe=Ae===void 0?!0:Ae,Me=b.allowedAutoPlacements,Ee=a.options.placement,Be=ot(Ee),Re=Be===Ee,He=q||(Re||!xe?[pe(Ee)]:Se(Ee)),ce=[Ee].concat(He).reduce(function(te,ge){return te.concat(ot(ge)===me?je(a,{placement:ge,boundary:z,rootBoundary:De,padding:oe,flipVariations:xe,allowedAutoPlacements:Me}):ge)},[]),Pe=a.rects.reference,Te=a.rects.popper,Ne=new Map,Fe=!0,Ye=ce[0],$e=0;$e=0,dn=Lt?"width":"height",Zt=qt(a,{placement:Ve,boundary:z,rootBoundary:De,altBoundary:Le,padding:oe}),Nt=Lt?et?U:Z:et?de:V;Pe[dn]>Te[dn]&&(Nt=pe(Nt));var $n=pe(Nt),Qt=[];if(F&&Qt.push(Zt[wt]<=0),j&&Qt.push(Zt[Nt]<=0,Zt[$n]<=0),Qt.every(function(te){return te})){Ye=Ve,Fe=!1;break}Ne.set(Ve,Qt)}if(Fe)for(var Sn=xe?3:1,Wn=function(ge){var we=ce.find(function(Ke){var Je=Ne.get(Ke);if(Je)return Je.slice(0,ge).every(function(Dt){return Dt})});if(we)return Ye=we,"break"},C=Sn;C>0;C--){var G=Wn(C);if(G==="break")break}a.placement!==Ye&&(a.modifiersData[D]._skip=!0,a.placement=Ye,a.reset=!0)}}var re={name:"flip",enabled:!0,phase:"main",fn:Ie,requiresIfExists:["offset"],data:{_skip:!1}};function he(c){return c==="x"?"y":"x"}function ve(c,a,b){return gt(c,ln(a,b))}function ee(c){var a=c.state,b=c.options,D=c.name,T=b.mainAxis,F=T===void 0?!0:T,W=b.altAxis,j=W===void 0?!1:W,q=b.boundary,oe=b.rootBoundary,z=b.altBoundary,De=b.padding,Le=b.tether,Ae=Le===void 0?!0:Le,xe=b.tetherOffset,Me=xe===void 0?0:xe,Ee=qt(a,{boundary:q,rootBoundary:oe,padding:De,altBoundary:z}),Be=ot(a.placement),Re=cn(a.placement),He=!Re,ce=dt(Be),Pe=he(ce),Te=a.modifiersData.popperOffsets,Ne=a.rects.reference,Fe=a.rects.popper,Ye=typeof Me=="function"?Me(Object.assign({},a.rects,{placement:a.placement})):Me,$e={x:0,y:0};if(Te){if(F||j){var Ve=ce==="y"?V:Z,wt=ce==="y"?de:U,et=ce==="y"?"height":"width",Lt=Te[ce],dn=Te[ce]+Ee[Ve],Zt=Te[ce]-Ee[wt],Nt=Ae?-Fe[et]/2:0,$n=Re===p?Ne[et]:Fe[et],Qt=Re===p?-Fe[et]:-Ne[et],Sn=a.elements.arrow,Wn=Ae&&Sn?P(Sn):{width:0,height:0},C=a.modifiersData["arrow#persistent"]?a.modifiersData["arrow#persistent"].padding:cr(),G=C[Ve],te=C[wt],ge=ve(0,Ne[et],Wn[et]),we=He?Ne[et]/2-Nt-ge-G-Ye:$n-ge-G-Ye,Ke=He?-Ne[et]/2+Nt+ge+te+Ye:Qt+ge+te+Ye,Je=a.elements.arrow&&J(a.elements.arrow),Dt=Je?ce==="y"?Je.clientTop||0:Je.clientLeft||0:0,Vn=a.modifiersData.offset?a.modifiersData.offset[a.placement][ce]:0,Tt=Te[ce]+we-Vn-Dt,An=Te[ce]+Ke-Vn;if(F){var pn=ve(Ae?ln(dn,Tt):dn,Lt,Ae?gt(Zt,An):Zt);Te[ce]=pn,$e[ce]=pn-Lt}if(j){var en=ce==="x"?V:Z,Gr=ce==="x"?de:U,tn=Te[Pe],hn=tn+Ee[en],Ai=tn-Ee[Gr],Ci=ve(Ae?ln(hn,Tt):hn,tn,Ae?gt(Ai,An):Ai);Te[Pe]=Ci,$e[Pe]=Ci-tn}}a.modifiersData[D]=$e}}var ie={name:"preventOverflow",enabled:!0,phase:"main",fn:ee,requiresIfExists:["offset"]},x=function(a,b){return a=typeof a=="function"?a(Object.assign({},b.rects,{placement:b.placement})):a,fr(typeof a!="number"?a:ur(a,l))};function Ge(c){var a,b=c.state,D=c.name,T=c.options,F=b.elements.arrow,W=b.modifiersData.popperOffsets,j=ot(b.placement),q=dt(j),oe=[Z,U].indexOf(j)>=0,z=oe?"height":"width";if(!(!F||!W)){var De=x(T.padding,b),Le=P(F),Ae=q==="y"?V:Z,xe=q==="y"?de:U,Me=b.rects.reference[z]+b.rects.reference[q]-W[q]-b.rects.popper[z],Ee=W[q]-b.rects.reference[q],Be=J(F),Re=Be?q==="y"?Be.clientHeight||0:Be.clientWidth||0:0,He=Me/2-Ee/2,ce=De[Ae],Pe=Re-Le[z]-De[xe],Te=Re/2-Le[z]/2+He,Ne=ve(ce,Te,Pe),Fe=q;b.modifiersData[D]=(a={},a[Fe]=Ne,a.centerOffset=Ne-Te,a)}}function fe(c){var a=c.state,b=c.options,D=b.element,T=D===void 0?"[data-popper-arrow]":D;if(T!=null&&!(typeof T=="string"&&(T=a.elements.popper.querySelector(T),!T))){if(o(T)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),!kn(a.elements.popper,T)){console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}a.elements.arrow=T}}var Ft={name:"arrow",enabled:!0,phase:"main",fn:Ge,effect:fe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bt(c,a,b){return b===void 0&&(b={x:0,y:0}),{top:c.top-a.height-b.y,right:c.right-a.width+b.x,bottom:c.bottom-a.height+b.y,left:c.left-a.width-b.x}}function Gt(c){return[V,U,de,Z].some(function(a){return c[a]>=0})}function Kt(c){var a=c.state,b=c.name,D=a.rects.reference,T=a.rects.popper,F=a.modifiersData.preventOverflow,W=qt(a,{elementContext:"reference"}),j=qt(a,{altBoundary:!0}),q=bt(W,D),oe=bt(j,T,F),z=Gt(q),De=Gt(oe);a.modifiersData[b]={referenceClippingOffsets:q,popperEscapeOffsets:oe,isReferenceHidden:z,hasPopperEscaped:De},a.attributes.popper=Object.assign({},a.attributes.popper,{"data-popper-reference-hidden":z,"data-popper-escaped":De})}var Jt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kt},rt=[jn,Bn,y,Y],lt=En({defaultModifiers:rt}),yt=[jn,Bn,y,Y,be,re,ie,Ft,Jt],un=En({defaultModifiers:yt});t.applyStyles=Y,t.arrow=Ft,t.computeStyles=y,t.createPopper=un,t.createPopperLite=lt,t.defaultModifiers=yt,t.detectOverflow=qt,t.eventListeners=jn,t.flip=re,t.hide=Jt,t.offset=be,t.popperGenerator=En,t.popperOffsets=Bn,t.preventOverflow=ie}),No=Fo(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=us(),r='',n="tippy-box",i="tippy-content",o="tippy-backdrop",s="tippy-arrow",h="tippy-svg-arrow",u={passive:!0,capture:!0};function f(g,y){return{}.hasOwnProperty.call(g,y)}function w(g,y,A){if(Array.isArray(g)){var I=g[y];return I??(Array.isArray(A)?A[y]:A)}return g}function m(g,y){var A={}.toString.call(g);return A.indexOf("[object")===0&&A.indexOf(y+"]")>-1}function E(g,y){return typeof g=="function"?g.apply(void 0,y):g}function O(g,y){if(y===0)return g;var A;return function(I){clearTimeout(A),A=setTimeout(function(){g(I)},y)}}function S(g,y){var A=Object.assign({},g);return y.forEach(function(I){delete A[I]}),A}function P(g){return g.split(/\s+/).filter(Boolean)}function R(g){return[].concat(g)}function $(g,y){g.indexOf(y)===-1&&g.push(y)}function B(g){return g.filter(function(y,A){return g.indexOf(y)===A})}function K(g){return g.split("-")[0]}function X(g){return[].slice.call(g)}function ne(g){return Object.keys(g).reduce(function(y,A){return g[A]!==void 0&&(y[A]=g[A]),y},{})}function J(){return document.createElement("div")}function V(g){return["Element","Fragment"].some(function(y){return m(g,y)})}function de(g){return m(g,"NodeList")}function U(g){return m(g,"MouseEvent")}function Z(g){return!!(g&&g._tippy&&g._tippy.reference===g)}function me(g){return V(g)?[g]:de(g)?X(g):Array.isArray(g)?g:X(document.querySelectorAll(g))}function l(g,y){g.forEach(function(A){A&&(A.style.transitionDuration=y+"ms")})}function p(g,y){g.forEach(function(A){A&&A.setAttribute("data-state",y)})}function v(g){var y,A=R(g),I=A[0];return!(I==null||(y=I.ownerDocument)==null)&&y.body?I.ownerDocument:document}function d(g,y){var A=y.clientX,I=y.clientY;return g.every(function(Y){var H=Y.popperRect,k=Y.popperState,be=Y.props,le=be.interactiveBorder,pe=K(k.placement),ye=k.modifiersData.offset;if(!ye)return!0;var _e=pe==="bottom"?ye.top.y:0,je=pe==="top"?ye.bottom.y:0,Se=pe==="right"?ye.left.x:0,Ie=pe==="left"?ye.right.x:0,re=H.top-I+_e>le,he=I-H.bottom-je>le,ve=H.left-A+Se>le,ee=A-H.right-Ie>le;return re||he||ve||ee})}function N(g,y,A){var I=y+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(Y){g[I](Y,A)})}var _={isTouch:!1},M=0;function Q(){_.isTouch||(_.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ue))}function Ue(){var g=performance.now();g-M<20&&(_.isTouch=!1,document.removeEventListener("mousemove",Ue)),M=g}function Rt(){var g=document.activeElement;if(Z(g)){var y=g._tippy;g.blur&&!y.state.isVisible&&g.blur()}}function Vt(){document.addEventListener("touchstart",Q,u),window.addEventListener("blur",Rt)}var Lr=typeof window<"u"&&typeof document<"u",Nr=Lr?navigator.userAgent:"",kr=/MSIE |Trident\//.test(Nr);function zt(g){var y=g==="destroy"?"n already-":" ";return[g+"() was called on a"+y+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function nr(g){var y=/[ \t]{2,}/g,A=/^[ \t]*/gm;return g.replace(y," ").replace(A,"").trim()}function jr(g){return nr(` %ctippy.js - %c`+nr(m)+` + %c`+nr(g)+` %c\u{1F477}\u200D This is a development-only message. It will be removed in production. - `)}function rr(m){return[jr(m),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var It;Br();function Br(){It=new Set}function mt(m,w){if(m&&!It.has(w)){var S;It.add(w),(S=console).warn.apply(S,rr(w))}}function Ut(m,w){if(m&&!It.has(w)){var S;It.add(w),(S=console).error.apply(S,rr(w))}}function At(m){var w=!m,S=Object.prototype.toString.call(m)==="[object Object]"&&!m.addEventListener;Ut(w,["tippy() was passed","`"+String(m)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Ut(S,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Ct={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Hr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Qe=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ct,{},Hr),$r=Object.keys(Qe),Wr=function(w){gt(w,[]);var S=Object.keys(w);S.forEach(function(I){Qe[I]=w[I]})};function ot(m){var w=m.plugins||[],S=w.reduce(function(I,Y){var H=Y.name,k=Y.defaultValue;return H&&(I[H]=m[H]!==void 0?m[H]:k),I},{});return Object.assign({},m,{},S)}function Vr(m,w){var S=w?Object.keys(ot(Object.assign({},Qe,{plugins:w}))):$r,I=S.reduce(function(Y,H){var k=(m.getAttribute("data-tippy-"+H)||"").trim();if(!k)return Y;if(H==="content")Y[H]=k;else try{Y[H]=JSON.parse(k)}catch{Y[H]=k}return Y},{});return I}function ir(m,w){var S=Object.assign({},w,{content:A(w.content,[m])},w.ignoreAttributes?{}:Vr(m,w.plugins));return S.aria=Object.assign({},Qe.aria,{},S.aria),S.aria={expanded:S.aria.expanded==="auto"?w.interactive:S.aria.expanded,content:S.aria.content==="auto"?w.interactive?null:"describedby":S.aria.content},S}function gt(m,w){m===void 0&&(m={}),w===void 0&&(w=[]);var S=Object.keys(m);S.forEach(function(I){var Y=O(Qe,Object.keys(Ct)),H=!f(Y,I);H&&(H=w.filter(function(k){return k.name===I}).length===0),mt(H,["`"+I+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",` + `)}function rr(g){return[jr(g),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var It;Br();function Br(){It=new Set}function mt(g,y){if(g&&!It.has(y)){var A;It.add(y),(A=console).warn.apply(A,rr(y))}}function Ut(g,y){if(g&&!It.has(y)){var A;It.add(y),(A=console).error.apply(A,rr(y))}}function At(g){var y=!g,A=Object.prototype.toString.call(g)==="[object Object]"&&!g.addEventListener;Ut(y,["tippy() was passed","`"+String(g)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Ut(A,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Ct={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Hr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Qe=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ct,{},Hr),$r=Object.keys(Qe),Wr=function(y){gt(y,[]);var A=Object.keys(y);A.forEach(function(I){Qe[I]=y[I]})};function ot(g){var y=g.plugins||[],A=y.reduce(function(I,Y){var H=Y.name,k=Y.defaultValue;return H&&(I[H]=g[H]!==void 0?g[H]:k),I},{});return Object.assign({},g,{},A)}function Vr(g,y){var A=y?Object.keys(ot(Object.assign({},Qe,{plugins:y}))):$r,I=A.reduce(function(Y,H){var k=(g.getAttribute("data-tippy-"+H)||"").trim();if(!k)return Y;if(H==="content")Y[H]=k;else try{Y[H]=JSON.parse(k)}catch{Y[H]=k}return Y},{});return I}function ir(g,y){var A=Object.assign({},y,{content:E(y.content,[g])},y.ignoreAttributes?{}:Vr(g,y.plugins));return A.aria=Object.assign({},Qe.aria,{},A.aria),A.aria={expanded:A.aria.expanded==="auto"?y.interactive:A.aria.expanded,content:A.aria.content==="auto"?y.interactive?null:"describedby":A.aria.content},A}function gt(g,y){g===void 0&&(g={}),y===void 0&&(y=[]);var A=Object.keys(g);A.forEach(function(I){var Y=S(Qe,Object.keys(Ct)),H=!f(Y,I);H&&(H=y.filter(function(k){return k.name===I}).length===0),mt(H,["`"+I+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",` `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/ -`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ln=function(){return"innerHTML"};function Yt(m,w){m[ln()]=w}function or(m){var w=J();return m===!0?w.className=l:(w.className=h,V(m)?w.appendChild(m):Yt(w,m)),w}function kn(m,w){V(w.content)?(Yt(m,""),m.appendChild(w.content)):typeof w.content!="function"&&(w.allowHTML?Yt(m,w.content):m.textContent=w.content)}function Xt(m){var w=m.firstElementChild,S=X(w.children);return{box:w,content:S.find(function(I){return I.classList.contains(i)}),arrow:S.find(function(I){return I.classList.contains(l)||I.classList.contains(h)}),backdrop:S.find(function(I){return I.classList.contains(o)})}}function ar(m){var w=J(),S=J();S.className=n,S.setAttribute("data-state","hidden"),S.setAttribute("tabindex","-1");var I=J();I.className=i,I.setAttribute("data-state","hidden"),kn(I,m.props),w.appendChild(S),S.appendChild(I),Y(m.props,m.props);function Y(H,k){var be=Xt(w),le=be.box,pe=be.content,ye=be.arrow;k.theme?le.setAttribute("data-theme",k.theme):le.removeAttribute("data-theme"),typeof k.animation=="string"?le.setAttribute("data-animation",k.animation):le.removeAttribute("data-animation"),k.inertia?le.setAttribute("data-inertia",""):le.removeAttribute("data-inertia"),le.style.maxWidth=typeof k.maxWidth=="number"?k.maxWidth+"px":k.maxWidth,k.role?le.setAttribute("role",k.role):le.removeAttribute("role"),(H.content!==k.content||H.allowHTML!==k.allowHTML)&&kn(pe,m.props),k.arrow?ye?H.arrow!==k.arrow&&(le.removeChild(ye),le.appendChild(or(k.arrow))):le.appendChild(or(k.arrow)):ye&&le.removeChild(ye)}return{popper:w,onUpdate:Y}}ar.$$tippy=!0;var sr=1,yn=[],wn=[];function cn(m,w){var S=ir(m,Object.assign({},Qe,{},ot(ne(w)))),I,Y,H,k=!1,be=!1,le=!1,pe=!1,ye,_e,je,Se=[],Ie=E(Re,S.interactiveDebounce),re,he=sr++,ve=null,ee=B(S.plugins),ie={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},x={id:he,reference:m,popper:J(),popperInstance:ve,props:S,state:ie,plugins:ee,clearDelayTimeouts:Lt,setProps:dn,setContent:Zt,show:Nt,hide:$n,hideWithInteractivity:Qt,enable:wt,disable:et,unmount:Sn,destroy:Wn};if(!S.render)return Ut(!0,"render() function has not been supplied."),x;var Ge=S.render(x),fe=Ge.popper,Ft=Ge.onUpdate;fe.setAttribute("data-tippy-root",""),fe.id="tippy-"+x.id,x.popper=fe,m._tippy=x,fe._tippy=x;var bt=ee.map(function(C){return C.fn(x)}),Gt=m.hasAttribute("aria-expanded");return Me(),T(),a(),g("onCreate",[x]),S.showOnCreate&&$e(),fe.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),fe.addEventListener("mouseleave",function(C){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&(yt().addEventListener("mousemove",Ie),Ie(C))}),x;function Kt(){var C=x.props.touch;return Array.isArray(C)?C:[C,0]}function Jt(){return Kt()[0]==="hold"}function rt(){var C;return!!((C=x.props.render)!=null&&C.$$tippy)}function st(){return re||m}function yt(){var C=st().parentNode;return C?v(C):document}function un(){return Xt(fe)}function c(C){return x.state.isMounted&&!x.state.isVisible||_.isTouch||ye&&ye.type==="focus"?0:y(x.props.delay,C?0:1,Qe.delay)}function a(){fe.style.pointerEvents=x.props.interactive&&x.state.isVisible?"":"none",fe.style.zIndex=""+x.props.zIndex}function g(C,G,te){if(te===void 0&&(te=!0),bt.forEach(function(we){we[C]&&we[C].apply(void 0,G)}),te){var ge;(ge=x.props)[C].apply(ge,G)}}function D(){var C=x.props.aria;if(C.content){var G="aria-"+C.content,te=fe.id,ge=R(x.props.triggerTarget||m);ge.forEach(function(we){var Ke=we.getAttribute(G);if(x.state.isVisible)we.setAttribute(G,Ke?Ke+" "+te:te);else{var Je=Ke&&Ke.replace(te,"").trim();Je?we.setAttribute(G,Je):we.removeAttribute(G)}})}}function T(){if(!(Gt||!x.props.aria.expanded)){var C=R(x.props.triggerTarget||m);C.forEach(function(G){x.props.interactive?G.setAttribute("aria-expanded",x.state.isVisible&&G===st()?"true":"false"):G.removeAttribute("aria-expanded")})}}function F(){yt().removeEventListener("mousemove",Ie),yn=yn.filter(function(C){return C!==Ie})}function W(C){if(!(_.isTouch&&(le||C.type==="mousedown"))&&!(x.props.interactive&&fe.contains(C.target))){if(st().contains(C.target)){if(_.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else g("onClickOutside",[x,C]);x.props.hideOnClick===!0&&(x.clearDelayTimeouts(),x.hide(),be=!0,setTimeout(function(){be=!1}),x.state.isMounted||z())}}function j(){le=!0}function q(){le=!1}function oe(){var C=yt();C.addEventListener("mousedown",W,!0),C.addEventListener("touchend",W,u),C.addEventListener("touchstart",q,u),C.addEventListener("touchmove",j,u)}function z(){var C=yt();C.removeEventListener("mousedown",W,!0),C.removeEventListener("touchend",W,u),C.removeEventListener("touchstart",q,u),C.removeEventListener("touchmove",j,u)}function De(C,G){Ae(C,function(){!x.state.isVisible&&fe.parentNode&&fe.parentNode.contains(fe)&&G()})}function Le(C,G){Ae(C,G)}function Ae(C,G){var te=un().box;function ge(we){we.target===te&&(N(te,"remove",ge),G())}if(C===0)return G();N(te,"remove",_e),N(te,"add",ge),_e=ge}function xe(C,G,te){te===void 0&&(te=!1);var ge=R(x.props.triggerTarget||m);ge.forEach(function(we){we.addEventListener(C,G,te),Se.push({node:we,eventType:C,handler:G,options:te})})}function Me(){Jt()&&(xe("touchstart",Be,{passive:!0}),xe("touchend",He,{passive:!0})),P(x.props.trigger).forEach(function(C){if(C!=="manual")switch(xe(C,Be),C){case"mouseenter":xe("mouseleave",He);break;case"focus":xe(kr?"focusout":"blur",ce);break;case"focusin":xe("focusout",ce);break}})}function Ee(){Se.forEach(function(C){var G=C.node,te=C.eventType,ge=C.handler,we=C.options;G.removeEventListener(te,ge,we)}),Se=[]}function Be(C){var G,te=!1;if(!(!x.state.isEnabled||Pe(C)||be)){var ge=((G=ye)==null?void 0:G.type)==="focus";ye=C,re=C.currentTarget,T(),!x.state.isVisible&&U(C)&&yn.forEach(function(we){return we(C)}),C.type==="click"&&(x.props.trigger.indexOf("mouseenter")<0||k)&&x.props.hideOnClick!==!1&&x.state.isVisible?te=!0:$e(C),C.type==="click"&&(k=!te),te&&!ge&&Ve(C)}}function Re(C){var G=C.target,te=st().contains(G)||fe.contains(G);if(!(C.type==="mousemove"&&te)){var ge=Ye().concat(fe).map(function(we){var Ke,Je=we._tippy,Dt=(Ke=Je.popperInstance)==null?void 0:Ke.state;return Dt?{popperRect:we.getBoundingClientRect(),popperState:Dt,props:S}:null}).filter(Boolean);d(ge,C)&&(F(),Ve(C))}}function He(C){var G=Pe(C)||x.props.trigger.indexOf("click")>=0&&k;if(!G){if(x.props.interactive){x.hideWithInteractivity(C);return}Ve(C)}}function ce(C){x.props.trigger.indexOf("focusin")<0&&C.target!==st()||x.props.interactive&&C.relatedTarget&&fe.contains(C.relatedTarget)||Ve(C)}function Pe(C){return _.isTouch?Jt()!==C.type.indexOf("touch")>=0:!1}function Te(){Ne();var C=x.props,G=C.popperOptions,te=C.placement,ge=C.offset,we=C.getReferenceClientRect,Ke=C.moveTransition,Je=rt()?Xt(fe).arrow:null,Dt=we?{getBoundingClientRect:we,contextElement:we.contextElement||st()}:m,Vn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pn){var en=pn.state;if(rt()){var Gr=un(),tn=Gr.box;["placement","reference-hidden","escaped"].forEach(function(hn){hn==="placement"?tn.setAttribute("data-placement",en.placement):en.attributes.popper["data-popper-"+hn]?tn.setAttribute("data-"+hn,""):tn.removeAttribute("data-"+hn)}),en.attributes.popper={}}}},Tt=[{name:"offset",options:{offset:ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ke}},Vn];rt()&&Je&&Tt.push({name:"arrow",options:{element:Je,padding:3}}),Tt.push.apply(Tt,G?.modifiers||[]),x.popperInstance=e.createPopper(Dt,fe,Object.assign({},G,{placement:te,onFirstUpdate:je,modifiers:Tt}))}function Ne(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function Fe(){var C=x.props.appendTo,G,te=st();x.props.interactive&&C===Qe.appendTo||C==="parent"?G=te.parentNode:G=A(C,[te]),G.contains(fe)||G.appendChild(fe),Te(),mt(x.props.interactive&&C===Qe.appendTo&&te.nextElementSibling!==fe,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",` +`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ln=function(){return"innerHTML"};function Yt(g,y){g[ln()]=y}function or(g){var y=J();return g===!0?y.className=s:(y.className=h,V(g)?y.appendChild(g):Yt(y,g)),y}function kn(g,y){V(y.content)?(Yt(g,""),g.appendChild(y.content)):typeof y.content!="function"&&(y.allowHTML?Yt(g,y.content):g.textContent=y.content)}function Xt(g){var y=g.firstElementChild,A=X(y.children);return{box:y,content:A.find(function(I){return I.classList.contains(i)}),arrow:A.find(function(I){return I.classList.contains(s)||I.classList.contains(h)}),backdrop:A.find(function(I){return I.classList.contains(o)})}}function ar(g){var y=J(),A=J();A.className=n,A.setAttribute("data-state","hidden"),A.setAttribute("tabindex","-1");var I=J();I.className=i,I.setAttribute("data-state","hidden"),kn(I,g.props),y.appendChild(A),A.appendChild(I),Y(g.props,g.props);function Y(H,k){var be=Xt(y),le=be.box,pe=be.content,ye=be.arrow;k.theme?le.setAttribute("data-theme",k.theme):le.removeAttribute("data-theme"),typeof k.animation=="string"?le.setAttribute("data-animation",k.animation):le.removeAttribute("data-animation"),k.inertia?le.setAttribute("data-inertia",""):le.removeAttribute("data-inertia"),le.style.maxWidth=typeof k.maxWidth=="number"?k.maxWidth+"px":k.maxWidth,k.role?le.setAttribute("role",k.role):le.removeAttribute("role"),(H.content!==k.content||H.allowHTML!==k.allowHTML)&&kn(pe,g.props),k.arrow?ye?H.arrow!==k.arrow&&(le.removeChild(ye),le.appendChild(or(k.arrow))):le.appendChild(or(k.arrow)):ye&&le.removeChild(ye)}return{popper:y,onUpdate:Y}}ar.$$tippy=!0;var sr=1,yn=[],wn=[];function cn(g,y){var A=ir(g,Object.assign({},Qe,{},ot(ne(y)))),I,Y,H,k=!1,be=!1,le=!1,pe=!1,ye,_e,je,Se=[],Ie=O(Re,A.interactiveDebounce),re,he=sr++,ve=null,ee=B(A.plugins),ie={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},x={id:he,reference:g,popper:J(),popperInstance:ve,props:A,state:ie,plugins:ee,clearDelayTimeouts:Lt,setProps:dn,setContent:Zt,show:Nt,hide:$n,hideWithInteractivity:Qt,enable:wt,disable:et,unmount:Sn,destroy:Wn};if(!A.render)return Ut(!0,"render() function has not been supplied."),x;var Ge=A.render(x),fe=Ge.popper,Ft=Ge.onUpdate;fe.setAttribute("data-tippy-root",""),fe.id="tippy-"+x.id,x.popper=fe,g._tippy=x,fe._tippy=x;var bt=ee.map(function(C){return C.fn(x)}),Gt=g.hasAttribute("aria-expanded");return Me(),T(),a(),b("onCreate",[x]),A.showOnCreate&&$e(),fe.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),fe.addEventListener("mouseleave",function(C){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&(yt().addEventListener("mousemove",Ie),Ie(C))}),x;function Kt(){var C=x.props.touch;return Array.isArray(C)?C:[C,0]}function Jt(){return Kt()[0]==="hold"}function rt(){var C;return!!((C=x.props.render)!=null&&C.$$tippy)}function lt(){return re||g}function yt(){var C=lt().parentNode;return C?v(C):document}function un(){return Xt(fe)}function c(C){return x.state.isMounted&&!x.state.isVisible||_.isTouch||ye&&ye.type==="focus"?0:w(x.props.delay,C?0:1,Qe.delay)}function a(){fe.style.pointerEvents=x.props.interactive&&x.state.isVisible?"":"none",fe.style.zIndex=""+x.props.zIndex}function b(C,G,te){if(te===void 0&&(te=!0),bt.forEach(function(we){we[C]&&we[C].apply(void 0,G)}),te){var ge;(ge=x.props)[C].apply(ge,G)}}function D(){var C=x.props.aria;if(C.content){var G="aria-"+C.content,te=fe.id,ge=R(x.props.triggerTarget||g);ge.forEach(function(we){var Ke=we.getAttribute(G);if(x.state.isVisible)we.setAttribute(G,Ke?Ke+" "+te:te);else{var Je=Ke&&Ke.replace(te,"").trim();Je?we.setAttribute(G,Je):we.removeAttribute(G)}})}}function T(){if(!(Gt||!x.props.aria.expanded)){var C=R(x.props.triggerTarget||g);C.forEach(function(G){x.props.interactive?G.setAttribute("aria-expanded",x.state.isVisible&&G===lt()?"true":"false"):G.removeAttribute("aria-expanded")})}}function F(){yt().removeEventListener("mousemove",Ie),yn=yn.filter(function(C){return C!==Ie})}function W(C){if(!(_.isTouch&&(le||C.type==="mousedown"))&&!(x.props.interactive&&fe.contains(C.target))){if(lt().contains(C.target)){if(_.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[x,C]);x.props.hideOnClick===!0&&(x.clearDelayTimeouts(),x.hide(),be=!0,setTimeout(function(){be=!1}),x.state.isMounted||z())}}function j(){le=!0}function q(){le=!1}function oe(){var C=yt();C.addEventListener("mousedown",W,!0),C.addEventListener("touchend",W,u),C.addEventListener("touchstart",q,u),C.addEventListener("touchmove",j,u)}function z(){var C=yt();C.removeEventListener("mousedown",W,!0),C.removeEventListener("touchend",W,u),C.removeEventListener("touchstart",q,u),C.removeEventListener("touchmove",j,u)}function De(C,G){Ae(C,function(){!x.state.isVisible&&fe.parentNode&&fe.parentNode.contains(fe)&&G()})}function Le(C,G){Ae(C,G)}function Ae(C,G){var te=un().box;function ge(we){we.target===te&&(N(te,"remove",ge),G())}if(C===0)return G();N(te,"remove",_e),N(te,"add",ge),_e=ge}function xe(C,G,te){te===void 0&&(te=!1);var ge=R(x.props.triggerTarget||g);ge.forEach(function(we){we.addEventListener(C,G,te),Se.push({node:we,eventType:C,handler:G,options:te})})}function Me(){Jt()&&(xe("touchstart",Be,{passive:!0}),xe("touchend",He,{passive:!0})),P(x.props.trigger).forEach(function(C){if(C!=="manual")switch(xe(C,Be),C){case"mouseenter":xe("mouseleave",He);break;case"focus":xe(kr?"focusout":"blur",ce);break;case"focusin":xe("focusout",ce);break}})}function Ee(){Se.forEach(function(C){var G=C.node,te=C.eventType,ge=C.handler,we=C.options;G.removeEventListener(te,ge,we)}),Se=[]}function Be(C){var G,te=!1;if(!(!x.state.isEnabled||Pe(C)||be)){var ge=((G=ye)==null?void 0:G.type)==="focus";ye=C,re=C.currentTarget,T(),!x.state.isVisible&&U(C)&&yn.forEach(function(we){return we(C)}),C.type==="click"&&(x.props.trigger.indexOf("mouseenter")<0||k)&&x.props.hideOnClick!==!1&&x.state.isVisible?te=!0:$e(C),C.type==="click"&&(k=!te),te&&!ge&&Ve(C)}}function Re(C){var G=C.target,te=lt().contains(G)||fe.contains(G);if(!(C.type==="mousemove"&&te)){var ge=Ye().concat(fe).map(function(we){var Ke,Je=we._tippy,Dt=(Ke=Je.popperInstance)==null?void 0:Ke.state;return Dt?{popperRect:we.getBoundingClientRect(),popperState:Dt,props:A}:null}).filter(Boolean);d(ge,C)&&(F(),Ve(C))}}function He(C){var G=Pe(C)||x.props.trigger.indexOf("click")>=0&&k;if(!G){if(x.props.interactive){x.hideWithInteractivity(C);return}Ve(C)}}function ce(C){x.props.trigger.indexOf("focusin")<0&&C.target!==lt()||x.props.interactive&&C.relatedTarget&&fe.contains(C.relatedTarget)||Ve(C)}function Pe(C){return _.isTouch?Jt()!==C.type.indexOf("touch")>=0:!1}function Te(){Ne();var C=x.props,G=C.popperOptions,te=C.placement,ge=C.offset,we=C.getReferenceClientRect,Ke=C.moveTransition,Je=rt()?Xt(fe).arrow:null,Dt=we?{getBoundingClientRect:we,contextElement:we.contextElement||lt()}:g,Vn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pn){var en=pn.state;if(rt()){var Gr=un(),tn=Gr.box;["placement","reference-hidden","escaped"].forEach(function(hn){hn==="placement"?tn.setAttribute("data-placement",en.placement):en.attributes.popper["data-popper-"+hn]?tn.setAttribute("data-"+hn,""):tn.removeAttribute("data-"+hn)}),en.attributes.popper={}}}},Tt=[{name:"offset",options:{offset:ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ke}},Vn];rt()&&Je&&Tt.push({name:"arrow",options:{element:Je,padding:3}}),Tt.push.apply(Tt,G?.modifiers||[]),x.popperInstance=e.createPopper(Dt,fe,Object.assign({},G,{placement:te,onFirstUpdate:je,modifiers:Tt}))}function Ne(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function Fe(){var C=x.props.appendTo,G,te=lt();x.props.interactive&&C===Qe.appendTo||C==="parent"?G=te.parentNode:G=E(C,[te]),G.contains(fe)||G.appendChild(fe),Te(),mt(x.props.interactive&&C===Qe.appendTo&&te.nextElementSibling!==fe,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",` `,"Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.",` `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",` -`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ye(){return X(fe.querySelectorAll("[data-tippy-root]"))}function $e(C){x.clearDelayTimeouts(),C&&g("onTrigger",[x,C]),oe();var G=c(!0),te=Kt(),ge=te[0],we=te[1];_.isTouch&&ge==="hold"&&we&&(G=we),G?I=setTimeout(function(){x.show()},G):x.show()}function Ve(C){if(x.clearDelayTimeouts(),g("onUntrigger",[x,C]),!x.state.isVisible){z();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(C.type)>=0&&k)){var G=c(!1);G?Y=setTimeout(function(){x.state.isVisible&&x.hide()},G):H=requestAnimationFrame(function(){x.hide()})}}function wt(){x.state.isEnabled=!0}function et(){x.hide(),x.state.isEnabled=!1}function Lt(){clearTimeout(I),clearTimeout(Y),cancelAnimationFrame(H)}function dn(C){if(mt(x.state.isDestroyed,zt("setProps")),!x.state.isDestroyed){g("onBeforeUpdate",[x,C]),Ee();var G=x.props,te=ir(m,Object.assign({},x.props,{},C,{ignoreAttributes:!0}));x.props=te,Me(),G.interactiveDebounce!==te.interactiveDebounce&&(F(),Ie=E(Re,te.interactiveDebounce)),G.triggerTarget&&!te.triggerTarget?R(G.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):te.triggerTarget&&m.removeAttribute("aria-expanded"),T(),a(),Ft&&Ft(G,te),x.popperInstance&&(Te(),Ye().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),g("onAfterUpdate",[x,C])}}function Zt(C){x.setProps({content:C})}function Nt(){mt(x.state.isDestroyed,zt("show"));var C=x.state.isVisible,G=x.state.isDestroyed,te=!x.state.isEnabled,ge=_.isTouch&&!x.props.touch,we=y(x.props.duration,0,Qe.duration);if(!(C||G||te||ge)&&!st().hasAttribute("disabled")&&(g("onShow",[x],!1),x.props.onShow(x)!==!1)){if(x.state.isVisible=!0,rt()&&(fe.style.visibility="visible"),a(),oe(),x.state.isMounted||(fe.style.transition="none"),rt()){var Ke=un(),Je=Ke.box,Dt=Ke.content;s([Je,Dt],0)}je=function(){var Tt;if(!(!x.state.isVisible||pe)){if(pe=!0,fe.offsetHeight,fe.style.transition=x.props.moveTransition,rt()&&x.props.animation){var An=un(),pn=An.box,en=An.content;s([pn,en],we),p([pn,en],"visible")}D(),T(),$(wn,x),(Tt=x.popperInstance)==null||Tt.forceUpdate(),x.state.isMounted=!0,g("onMount",[x]),x.props.animation&&rt()&&Le(we,function(){x.state.isShown=!0,g("onShown",[x])})}},Fe()}}function $n(){mt(x.state.isDestroyed,zt("hide"));var C=!x.state.isVisible,G=x.state.isDestroyed,te=!x.state.isEnabled,ge=y(x.props.duration,1,Qe.duration);if(!(C||G||te)&&(g("onHide",[x],!1),x.props.onHide(x)!==!1)){if(x.state.isVisible=!1,x.state.isShown=!1,pe=!1,k=!1,rt()&&(fe.style.visibility="hidden"),F(),z(),a(),rt()){var we=un(),Ke=we.box,Je=we.content;x.props.animation&&(s([Ke,Je],ge),p([Ke,Je],"hidden"))}D(),T(),x.props.animation?rt()&&De(ge,x.unmount):x.unmount()}}function Qt(C){mt(x.state.isDestroyed,zt("hideWithInteractivity")),yt().addEventListener("mousemove",Ie),$(yn,Ie),Ie(C)}function Sn(){mt(x.state.isDestroyed,zt("unmount")),x.state.isVisible&&x.hide(),x.state.isMounted&&(Ne(),Ye().forEach(function(C){C._tippy.unmount()}),fe.parentNode&&fe.parentNode.removeChild(fe),wn=wn.filter(function(C){return C!==x}),x.state.isMounted=!1,g("onHidden",[x]))}function Wn(){mt(x.state.isDestroyed,zt("destroy")),!x.state.isDestroyed&&(x.clearDelayTimeouts(),x.unmount(),Ee(),delete m._tippy,x.state.isDestroyed=!0,g("onDestroy",[x]))}}function dt(m,w){w===void 0&&(w={});var S=Qe.plugins.concat(w.plugins||[]);At(m),gt(w,S),Vt();var I=Object.assign({},w,{plugins:S}),Y=me(m),H=V(I.content),k=Y.length>1;mt(H&&k,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",` +`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ye(){return X(fe.querySelectorAll("[data-tippy-root]"))}function $e(C){x.clearDelayTimeouts(),C&&b("onTrigger",[x,C]),oe();var G=c(!0),te=Kt(),ge=te[0],we=te[1];_.isTouch&&ge==="hold"&&we&&(G=we),G?I=setTimeout(function(){x.show()},G):x.show()}function Ve(C){if(x.clearDelayTimeouts(),b("onUntrigger",[x,C]),!x.state.isVisible){z();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(C.type)>=0&&k)){var G=c(!1);G?Y=setTimeout(function(){x.state.isVisible&&x.hide()},G):H=requestAnimationFrame(function(){x.hide()})}}function wt(){x.state.isEnabled=!0}function et(){x.hide(),x.state.isEnabled=!1}function Lt(){clearTimeout(I),clearTimeout(Y),cancelAnimationFrame(H)}function dn(C){if(mt(x.state.isDestroyed,zt("setProps")),!x.state.isDestroyed){b("onBeforeUpdate",[x,C]),Ee();var G=x.props,te=ir(g,Object.assign({},x.props,{},C,{ignoreAttributes:!0}));x.props=te,Me(),G.interactiveDebounce!==te.interactiveDebounce&&(F(),Ie=O(Re,te.interactiveDebounce)),G.triggerTarget&&!te.triggerTarget?R(G.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):te.triggerTarget&&g.removeAttribute("aria-expanded"),T(),a(),Ft&&Ft(G,te),x.popperInstance&&(Te(),Ye().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[x,C])}}function Zt(C){x.setProps({content:C})}function Nt(){mt(x.state.isDestroyed,zt("show"));var C=x.state.isVisible,G=x.state.isDestroyed,te=!x.state.isEnabled,ge=_.isTouch&&!x.props.touch,we=w(x.props.duration,0,Qe.duration);if(!(C||G||te||ge)&&!lt().hasAttribute("disabled")&&(b("onShow",[x],!1),x.props.onShow(x)!==!1)){if(x.state.isVisible=!0,rt()&&(fe.style.visibility="visible"),a(),oe(),x.state.isMounted||(fe.style.transition="none"),rt()){var Ke=un(),Je=Ke.box,Dt=Ke.content;l([Je,Dt],0)}je=function(){var Tt;if(!(!x.state.isVisible||pe)){if(pe=!0,fe.offsetHeight,fe.style.transition=x.props.moveTransition,rt()&&x.props.animation){var An=un(),pn=An.box,en=An.content;l([pn,en],we),p([pn,en],"visible")}D(),T(),$(wn,x),(Tt=x.popperInstance)==null||Tt.forceUpdate(),x.state.isMounted=!0,b("onMount",[x]),x.props.animation&&rt()&&Le(we,function(){x.state.isShown=!0,b("onShown",[x])})}},Fe()}}function $n(){mt(x.state.isDestroyed,zt("hide"));var C=!x.state.isVisible,G=x.state.isDestroyed,te=!x.state.isEnabled,ge=w(x.props.duration,1,Qe.duration);if(!(C||G||te)&&(b("onHide",[x],!1),x.props.onHide(x)!==!1)){if(x.state.isVisible=!1,x.state.isShown=!1,pe=!1,k=!1,rt()&&(fe.style.visibility="hidden"),F(),z(),a(),rt()){var we=un(),Ke=we.box,Je=we.content;x.props.animation&&(l([Ke,Je],ge),p([Ke,Je],"hidden"))}D(),T(),x.props.animation?rt()&&De(ge,x.unmount):x.unmount()}}function Qt(C){mt(x.state.isDestroyed,zt("hideWithInteractivity")),yt().addEventListener("mousemove",Ie),$(yn,Ie),Ie(C)}function Sn(){mt(x.state.isDestroyed,zt("unmount")),x.state.isVisible&&x.hide(),x.state.isMounted&&(Ne(),Ye().forEach(function(C){C._tippy.unmount()}),fe.parentNode&&fe.parentNode.removeChild(fe),wn=wn.filter(function(C){return C!==x}),x.state.isMounted=!1,b("onHidden",[x]))}function Wn(){mt(x.state.isDestroyed,zt("destroy")),!x.state.isDestroyed&&(x.clearDelayTimeouts(),x.unmount(),Ee(),delete g._tippy,x.state.isDestroyed=!0,b("onDestroy",[x]))}}function dt(g,y){y===void 0&&(y={});var A=Qe.plugins.concat(y.plugins||[]);At(g),gt(y,A),Vt();var I=Object.assign({},y,{plugins:A}),Y=me(g),H=V(I.content),k=Y.length>1;mt(H&&k,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",` `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",` `,`1) content: element.innerHTML -`,"2) content: () => element.cloneNode(true)"].join(" "));var be=Y.reduce(function(le,pe){var ye=pe&&cn(pe,I);return ye&&le.push(ye),le},[]);return V(m)?be[0]:be}dt.defaultProps=Qe,dt.setDefaultProps=Wr,dt.currentInput=_;var lr=function(w){var S=w===void 0?{}:w,I=S.exclude,Y=S.duration;wn.forEach(function(H){var k=!1;if(I&&(k=Z(I)?H.reference===I:H.popper===I.popper),!k){var be=H.props.duration;H.setProps({duration:Y}),H.hide(),H.state.isDestroyed||H.setProps({duration:be})}})},cr=Object.assign({},e.applyStyles,{effect:function(w){var S=w.state,I={popper:{position:S.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(S.elements.popper.style,I.popper),S.styles=I,S.elements.arrow&&Object.assign(S.elements.arrow.style,I.arrow)}}),fr=function(w,S){var I;S===void 0&&(S={}),Ut(!Array.isArray(w),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(w)].join(" "));var Y=w,H=[],k,be=S.overrides,le=[],pe=!1;function ye(){H=Y.map(function(ee){return ee.reference})}function _e(ee){Y.forEach(function(ie){ee?ie.enable():ie.disable()})}function je(ee){return Y.map(function(ie){var x=ie.setProps;return ie.setProps=function(Ge){x(Ge),ie.reference===k&&ee.setProps(Ge)},function(){ie.setProps=x}})}function Se(ee,ie){var x=H.indexOf(ie);if(ie!==k){k=ie;var Ge=(be||[]).concat("content").reduce(function(fe,Ft){return fe[Ft]=Y[x].props[Ft],fe},{});ee.setProps(Object.assign({},Ge,{getReferenceClientRect:typeof Ge.getReferenceClientRect=="function"?Ge.getReferenceClientRect:function(){return ie.getBoundingClientRect()}}))}}_e(!1),ye();var Ie={fn:function(){return{onDestroy:function(){_e(!0)},onHidden:function(){k=null},onClickOutside:function(x){x.props.showOnCreate&&!pe&&(pe=!0,k=null)},onShow:function(x){x.props.showOnCreate&&!pe&&(pe=!0,Se(x,H[0]))},onTrigger:function(x,Ge){Se(x,Ge.currentTarget)}}}},re=dt(J(),Object.assign({},O(S,["overrides"]),{plugins:[Ie].concat(S.plugins||[]),triggerTarget:H,popperOptions:Object.assign({},S.popperOptions,{modifiers:[].concat(((I=S.popperOptions)==null?void 0:I.modifiers)||[],[cr])})})),he=re.show;re.show=function(ee){if(he(),!k&&ee==null)return Se(re,H[0]);if(!(k&&ee==null)){if(typeof ee=="number")return H[ee]&&Se(re,H[ee]);if(Y.includes(ee)){var ie=ee.reference;return Se(re,ie)}if(H.includes(ee))return Se(re,ee)}},re.showNext=function(){var ee=H[0];if(!k)return re.show(0);var ie=H.indexOf(k);re.show(H[ie+1]||ee)},re.showPrevious=function(){var ee=H[H.length-1];if(!k)return re.show(ee);var ie=H.indexOf(k),x=H[ie-1]||ee;re.show(x)};var ve=re.setProps;return re.setProps=function(ee){be=ee.overrides||be,ve(ee)},re.setInstances=function(ee){_e(!0),le.forEach(function(ie){return ie()}),Y=ee,_e(!1),ye(),je(re),re.setProps({triggerTarget:H})},le=je(re),re},ur={mouseover:"mouseenter",focusin:"focus",click:"click"};function qt(m,w){Ut(!(w&&w.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var S=[],I=[],Y=!1,H=w.target,k=O(w,["target"]),be=Object.assign({},k,{trigger:"manual",touch:!1}),le=Object.assign({},k,{showOnCreate:!0}),pe=dt(m,be),ye=R(pe);function _e(he){if(!(!he.target||Y)){var ve=he.target.closest(H);if(ve){var ee=ve.getAttribute("data-tippy-trigger")||w.trigger||Qe.trigger;if(!ve._tippy&&!(he.type==="touchstart"&&typeof le.touch=="boolean")&&!(he.type!=="touchstart"&&ee.indexOf(ur[he.type])<0)){var ie=dt(ve,le);ie&&(I=I.concat(ie))}}}}function je(he,ve,ee,ie){ie===void 0&&(ie=!1),he.addEventListener(ve,ee,ie),S.push({node:he,eventType:ve,handler:ee,options:ie})}function Se(he){var ve=he.reference;je(ve,"touchstart",_e,u),je(ve,"mouseover",_e),je(ve,"focusin",_e),je(ve,"click",_e)}function Ie(){S.forEach(function(he){var ve=he.node,ee=he.eventType,ie=he.handler,x=he.options;ve.removeEventListener(ee,ie,x)}),S=[]}function re(he){var ve=he.destroy,ee=he.enable,ie=he.disable;he.destroy=function(x){x===void 0&&(x=!0),x&&I.forEach(function(Ge){Ge.destroy()}),I=[],Ie(),ve()},he.enable=function(){ee(),I.forEach(function(x){return x.enable()}),Y=!1},he.disable=function(){ie(),I.forEach(function(x){return x.disable()}),Y=!0},Se(he)}return ye.forEach(re),pe}var dr={name:"animateFill",defaultValue:!1,fn:function(w){var S;if(!((S=w.props.render)!=null&&S.$$tippy))return Ut(w.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var I=Xt(w.popper),Y=I.box,H=I.content,k=w.props.animateFill?zr():null;return{onCreate:function(){k&&(Y.insertBefore(k,Y.firstElementChild),Y.setAttribute("data-animatefill",""),Y.style.overflow="hidden",w.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(k){var le=Y.style.transitionDuration,pe=Number(le.replace("ms",""));H.style.transitionDelay=Math.round(pe/10)+"ms",k.style.transitionDuration=le,p([k],"visible")}},onShow:function(){k&&(k.style.transitionDuration="0ms")},onHide:function(){k&&p([k],"hidden")}}}};function zr(){var m=J();return m.className=o,p([m],"hidden"),m}var xn={clientX:0,clientY:0},fn=[];function En(m){var w=m.clientX,S=m.clientY;xn={clientX:w,clientY:S}}function On(m){m.addEventListener("mousemove",En)}function Ur(m){m.removeEventListener("mousemove",En)}var jn={name:"followCursor",defaultValue:!1,fn:function(w){var S=w.reference,I=v(w.props.triggerTarget||S),Y=!1,H=!1,k=!0,be=w.props;function le(){return w.props.followCursor==="initial"&&w.state.isVisible}function pe(){I.addEventListener("mousemove",je)}function ye(){I.removeEventListener("mousemove",je)}function _e(){Y=!0,w.setProps({getReferenceClientRect:null}),Y=!1}function je(re){var he=re.target?S.contains(re.target):!0,ve=w.props.followCursor,ee=re.clientX,ie=re.clientY,x=S.getBoundingClientRect(),Ge=ee-x.left,fe=ie-x.top;(he||!w.props.interactive)&&w.setProps({getReferenceClientRect:function(){var bt=S.getBoundingClientRect(),Gt=ee,Kt=ie;ve==="initial"&&(Gt=bt.left+Ge,Kt=bt.top+fe);var Jt=ve==="horizontal"?bt.top:Kt,rt=ve==="vertical"?bt.right:Gt,st=ve==="horizontal"?bt.bottom:Kt,yt=ve==="vertical"?bt.left:Gt;return{width:rt-yt,height:st-Jt,top:Jt,right:rt,bottom:st,left:yt}}})}function Se(){w.props.followCursor&&(fn.push({instance:w,doc:I}),On(I))}function Ie(){fn=fn.filter(function(re){return re.instance!==w}),fn.filter(function(re){return re.doc===I}).length===0&&Ur(I)}return{onCreate:Se,onDestroy:Ie,onBeforeUpdate:function(){be=w.props},onAfterUpdate:function(he,ve){var ee=ve.followCursor;Y||ee!==void 0&&be.followCursor!==ee&&(Ie(),ee?(Se(),w.state.isMounted&&!H&&!le()&&pe()):(ye(),_e()))},onMount:function(){w.props.followCursor&&!H&&(k&&(je(xn),k=!1),le()||pe())},onTrigger:function(he,ve){U(ve)&&(xn={clientX:ve.clientX,clientY:ve.clientY}),H=ve.type==="focus"},onHidden:function(){w.props.followCursor&&(_e(),ye(),k=!0)}}}};function Yr(m,w){var S;return{popperOptions:Object.assign({},m.popperOptions,{modifiers:[].concat((((S=m.popperOptions)==null?void 0:S.modifiers)||[]).filter(function(I){var Y=I.name;return Y!==w.name}),[w])})}}var Bn={name:"inlinePositioning",defaultValue:!1,fn:function(w){var S=w.reference;function I(){return!!w.props.inlinePositioning}var Y,H=-1,k=!1,be={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(je){var Se=je.state;I()&&(Y!==Se.placement&&w.setProps({getReferenceClientRect:function(){return le(Se.placement)}}),Y=Se.placement)}};function le(_e){return Xr(K(_e),S.getBoundingClientRect(),X(S.getClientRects()),H)}function pe(_e){k=!0,w.setProps(_e),k=!1}function ye(){k||pe(Yr(w.props,be))}return{onCreate:ye,onAfterUpdate:ye,onTrigger:function(je,Se){if(U(Se)){var Ie=X(w.reference.getClientRects()),re=Ie.find(function(he){return he.left-2<=Se.clientX&&he.right+2>=Se.clientX&&he.top-2<=Se.clientY&&he.bottom+2>=Se.clientY});H=Ie.indexOf(re)}},onUntrigger:function(){H=-1}}}};function Xr(m,w,S,I){if(S.length<2||m===null)return w;if(S.length===2&&I>=0&&S[0].left>S[1].right)return S[I]||w;switch(m){case"top":case"bottom":{var Y=S[0],H=S[S.length-1],k=m==="top",be=Y.top,le=H.bottom,pe=k?Y.left:H.left,ye=k?Y.right:H.right,_e=ye-pe,je=le-be;return{top:be,bottom:le,left:pe,right:ye,width:_e,height:je}}case"left":case"right":{var Se=Math.min.apply(Math,S.map(function(fe){return fe.left})),Ie=Math.max.apply(Math,S.map(function(fe){return fe.right})),re=S.filter(function(fe){return m==="left"?fe.left===Se:fe.right===Ie}),he=re[0].top,ve=re[re.length-1].bottom,ee=Se,ie=Ie,x=ie-ee,Ge=ve-he;return{top:he,bottom:ve,left:ee,right:ie,width:x,height:Ge}}default:return w}}var qr={name:"sticky",defaultValue:!1,fn:function(w){var S=w.reference,I=w.popper;function Y(){return w.popperInstance?w.popperInstance.state.elements.reference:S}function H(pe){return w.props.sticky===!0||w.props.sticky===pe}var k=null,be=null;function le(){var pe=H("reference")?Y().getBoundingClientRect():null,ye=H("popper")?I.getBoundingClientRect():null;(pe&&Hn(k,pe)||ye&&Hn(be,ye))&&w.popperInstance&&w.popperInstance.update(),k=pe,be=ye,w.state.isMounted&&requestAnimationFrame(le)}return{onMount:function(){w.props.sticky&&le()}}}};function Hn(m,w){return m&&w?m.top!==w.top||m.right!==w.right||m.bottom!==w.bottom||m.left!==w.left:!0}dt.setDefaultProps({render:ar}),t.animateFill=dr,t.createSingleton=fr,t.default=dt,t.delegate=qt,t.followCursor=jn,t.hideAll=lr,t.inlinePositioning=Bn,t.roundArrow=r,t.sticky=qr}),Ei=Fo(Lo()),ds=Fo(Lo()),ps=t=>{let e={plugins:[]},r=i=>t[t.indexOf(i)+1];if(t.includes("animation")&&(e.animation=r("animation")),t.includes("duration")&&(e.duration=parseInt(r("duration"))),t.includes("delay")){let i=r("delay");e.delay=i.includes("-")?i.split("-").map(o=>parseInt(o)):parseInt(i)}if(t.includes("cursor")){e.plugins.push(ds.followCursor);let i=r("cursor");["x","initial"].includes(i)?e.followCursor=i==="x"?"horizontal":"initial":e.followCursor=!0}t.includes("on")&&(e.trigger=r("on")),t.includes("arrowless")&&(e.arrow=!1),t.includes("html")&&(e.allowHTML=!0),t.includes("interactive")&&(e.interactive=!0),t.includes("border")&&e.interactive&&(e.interactiveBorder=parseInt(r("border"))),t.includes("debounce")&&e.interactive&&(e.interactiveDebounce=parseInt(r("debounce"))),t.includes("max-width")&&(e.maxWidth=parseInt(r("max-width"))),t.includes("theme")&&(e.theme=r("theme")),t.includes("placement")&&(e.placement=r("placement"));let n={};return t.includes("no-flip")&&(n.modifiers||(n.modifiers=[]),n.modifiers.push({name:"flip",enabled:!1})),e.popperOptions=n,e};function Oi(t){t.magic("tooltip",e=>(r,n={})=>{let i=n.timeout;delete n.timeout;let o=(0,Ei.default)(e,{content:r,trigger:"manual",...n});o.show(),setTimeout(()=>{o.hide(),setTimeout(()=>o.destroy(),n.duration||300)},i||2e3)}),t.directive("tooltip",(e,{modifiers:r,expression:n},{evaluateLater:i,effect:o})=>{let l=r.length>0?ps(r):{};e.__x_tippy||(e.__x_tippy=(0,Ei.default)(e,l));let h=()=>e.__x_tippy.enable(),u=()=>e.__x_tippy.disable(),f=y=>{y?(h(),e.__x_tippy.setContent(y)):u()};if(r.includes("raw"))f(n);else{let y=i(n);o(()=>{y(b=>{typeof b=="object"?(e.__x_tippy.setProps(b),h()):f(b)})})}})}Oi.defaultProps=t=>(Ei.default.setDefaultProps(t),Oi);var hs=Oi,No=hs;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(ro),window.Alpine.plugin(io),window.Alpine.plugin(Ro),window.Alpine.plugin(No)});var vs=function(t,e,r){function n(y,b){for(let A of y){let E=i(A,b);if(E!==null)return E}}function i(y,b){let A=y.match(/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s);if(A===null||A.length!==3)return null;let E=A[1],O=A[2];if(E.includes(",")){let[P,R]=E.split(",",2);if(R==="*"&&b>=P)return O;if(P==="*"&&b<=R)return O;if(b>=P&&b<=R)return O}return E==b?O:null}function o(y){return y.toString().charAt(0).toUpperCase()+y.toString().slice(1)}function l(y,b){if(b.length===0)return y;let A={};for(let[E,O]of Object.entries(b))A[":"+o(E??"")]=o(O??""),A[":"+E.toUpperCase()]=O.toString().toUpperCase(),A[":"+E]=O;return Object.entries(A).forEach(([E,O])=>{y=y.replaceAll(E,O)}),y}function h(y){return y.map(b=>b.replace(/^[\{\[]([^\[\]\{\}]*)[\}\]]/,""))}let u=t.split("|"),f=n(u,e);return f!=null?l(f.trim(),r):(u=h(u),l(u.length>1&&e>1?u[1]:u[0],r))};window.jsMd5=ko.md5;window.pluralize=vs;})(); +`,"2) content: () => element.cloneNode(true)"].join(" "));var be=Y.reduce(function(le,pe){var ye=pe&&cn(pe,I);return ye&&le.push(ye),le},[]);return V(g)?be[0]:be}dt.defaultProps=Qe,dt.setDefaultProps=Wr,dt.currentInput=_;var lr=function(y){var A=y===void 0?{}:y,I=A.exclude,Y=A.duration;wn.forEach(function(H){var k=!1;if(I&&(k=Z(I)?H.reference===I:H.popper===I.popper),!k){var be=H.props.duration;H.setProps({duration:Y}),H.hide(),H.state.isDestroyed||H.setProps({duration:be})}})},cr=Object.assign({},e.applyStyles,{effect:function(y){var A=y.state,I={popper:{position:A.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(A.elements.popper.style,I.popper),A.styles=I,A.elements.arrow&&Object.assign(A.elements.arrow.style,I.arrow)}}),fr=function(y,A){var I;A===void 0&&(A={}),Ut(!Array.isArray(y),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(y)].join(" "));var Y=y,H=[],k,be=A.overrides,le=[],pe=!1;function ye(){H=Y.map(function(ee){return ee.reference})}function _e(ee){Y.forEach(function(ie){ee?ie.enable():ie.disable()})}function je(ee){return Y.map(function(ie){var x=ie.setProps;return ie.setProps=function(Ge){x(Ge),ie.reference===k&&ee.setProps(Ge)},function(){ie.setProps=x}})}function Se(ee,ie){var x=H.indexOf(ie);if(ie!==k){k=ie;var Ge=(be||[]).concat("content").reduce(function(fe,Ft){return fe[Ft]=Y[x].props[Ft],fe},{});ee.setProps(Object.assign({},Ge,{getReferenceClientRect:typeof Ge.getReferenceClientRect=="function"?Ge.getReferenceClientRect:function(){return ie.getBoundingClientRect()}}))}}_e(!1),ye();var Ie={fn:function(){return{onDestroy:function(){_e(!0)},onHidden:function(){k=null},onClickOutside:function(x){x.props.showOnCreate&&!pe&&(pe=!0,k=null)},onShow:function(x){x.props.showOnCreate&&!pe&&(pe=!0,Se(x,H[0]))},onTrigger:function(x,Ge){Se(x,Ge.currentTarget)}}}},re=dt(J(),Object.assign({},S(A,["overrides"]),{plugins:[Ie].concat(A.plugins||[]),triggerTarget:H,popperOptions:Object.assign({},A.popperOptions,{modifiers:[].concat(((I=A.popperOptions)==null?void 0:I.modifiers)||[],[cr])})})),he=re.show;re.show=function(ee){if(he(),!k&&ee==null)return Se(re,H[0]);if(!(k&&ee==null)){if(typeof ee=="number")return H[ee]&&Se(re,H[ee]);if(Y.includes(ee)){var ie=ee.reference;return Se(re,ie)}if(H.includes(ee))return Se(re,ee)}},re.showNext=function(){var ee=H[0];if(!k)return re.show(0);var ie=H.indexOf(k);re.show(H[ie+1]||ee)},re.showPrevious=function(){var ee=H[H.length-1];if(!k)return re.show(ee);var ie=H.indexOf(k),x=H[ie-1]||ee;re.show(x)};var ve=re.setProps;return re.setProps=function(ee){be=ee.overrides||be,ve(ee)},re.setInstances=function(ee){_e(!0),le.forEach(function(ie){return ie()}),Y=ee,_e(!1),ye(),je(re),re.setProps({triggerTarget:H})},le=je(re),re},ur={mouseover:"mouseenter",focusin:"focus",click:"click"};function qt(g,y){Ut(!(y&&y.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var A=[],I=[],Y=!1,H=y.target,k=S(y,["target"]),be=Object.assign({},k,{trigger:"manual",touch:!1}),le=Object.assign({},k,{showOnCreate:!0}),pe=dt(g,be),ye=R(pe);function _e(he){if(!(!he.target||Y)){var ve=he.target.closest(H);if(ve){var ee=ve.getAttribute("data-tippy-trigger")||y.trigger||Qe.trigger;if(!ve._tippy&&!(he.type==="touchstart"&&typeof le.touch=="boolean")&&!(he.type!=="touchstart"&&ee.indexOf(ur[he.type])<0)){var ie=dt(ve,le);ie&&(I=I.concat(ie))}}}}function je(he,ve,ee,ie){ie===void 0&&(ie=!1),he.addEventListener(ve,ee,ie),A.push({node:he,eventType:ve,handler:ee,options:ie})}function Se(he){var ve=he.reference;je(ve,"touchstart",_e,u),je(ve,"mouseover",_e),je(ve,"focusin",_e),je(ve,"click",_e)}function Ie(){A.forEach(function(he){var ve=he.node,ee=he.eventType,ie=he.handler,x=he.options;ve.removeEventListener(ee,ie,x)}),A=[]}function re(he){var ve=he.destroy,ee=he.enable,ie=he.disable;he.destroy=function(x){x===void 0&&(x=!0),x&&I.forEach(function(Ge){Ge.destroy()}),I=[],Ie(),ve()},he.enable=function(){ee(),I.forEach(function(x){return x.enable()}),Y=!1},he.disable=function(){ie(),I.forEach(function(x){return x.disable()}),Y=!0},Se(he)}return ye.forEach(re),pe}var dr={name:"animateFill",defaultValue:!1,fn:function(y){var A;if(!((A=y.props.render)!=null&&A.$$tippy))return Ut(y.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var I=Xt(y.popper),Y=I.box,H=I.content,k=y.props.animateFill?zr():null;return{onCreate:function(){k&&(Y.insertBefore(k,Y.firstElementChild),Y.setAttribute("data-animatefill",""),Y.style.overflow="hidden",y.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(k){var le=Y.style.transitionDuration,pe=Number(le.replace("ms",""));H.style.transitionDelay=Math.round(pe/10)+"ms",k.style.transitionDuration=le,p([k],"visible")}},onShow:function(){k&&(k.style.transitionDuration="0ms")},onHide:function(){k&&p([k],"hidden")}}}};function zr(){var g=J();return g.className=o,p([g],"hidden"),g}var xn={clientX:0,clientY:0},fn=[];function En(g){var y=g.clientX,A=g.clientY;xn={clientX:y,clientY:A}}function On(g){g.addEventListener("mousemove",En)}function Ur(g){g.removeEventListener("mousemove",En)}var jn={name:"followCursor",defaultValue:!1,fn:function(y){var A=y.reference,I=v(y.props.triggerTarget||A),Y=!1,H=!1,k=!0,be=y.props;function le(){return y.props.followCursor==="initial"&&y.state.isVisible}function pe(){I.addEventListener("mousemove",je)}function ye(){I.removeEventListener("mousemove",je)}function _e(){Y=!0,y.setProps({getReferenceClientRect:null}),Y=!1}function je(re){var he=re.target?A.contains(re.target):!0,ve=y.props.followCursor,ee=re.clientX,ie=re.clientY,x=A.getBoundingClientRect(),Ge=ee-x.left,fe=ie-x.top;(he||!y.props.interactive)&&y.setProps({getReferenceClientRect:function(){var bt=A.getBoundingClientRect(),Gt=ee,Kt=ie;ve==="initial"&&(Gt=bt.left+Ge,Kt=bt.top+fe);var Jt=ve==="horizontal"?bt.top:Kt,rt=ve==="vertical"?bt.right:Gt,lt=ve==="horizontal"?bt.bottom:Kt,yt=ve==="vertical"?bt.left:Gt;return{width:rt-yt,height:lt-Jt,top:Jt,right:rt,bottom:lt,left:yt}}})}function Se(){y.props.followCursor&&(fn.push({instance:y,doc:I}),On(I))}function Ie(){fn=fn.filter(function(re){return re.instance!==y}),fn.filter(function(re){return re.doc===I}).length===0&&Ur(I)}return{onCreate:Se,onDestroy:Ie,onBeforeUpdate:function(){be=y.props},onAfterUpdate:function(he,ve){var ee=ve.followCursor;Y||ee!==void 0&&be.followCursor!==ee&&(Ie(),ee?(Se(),y.state.isMounted&&!H&&!le()&&pe()):(ye(),_e()))},onMount:function(){y.props.followCursor&&!H&&(k&&(je(xn),k=!1),le()||pe())},onTrigger:function(he,ve){U(ve)&&(xn={clientX:ve.clientX,clientY:ve.clientY}),H=ve.type==="focus"},onHidden:function(){y.props.followCursor&&(_e(),ye(),k=!0)}}}};function Yr(g,y){var A;return{popperOptions:Object.assign({},g.popperOptions,{modifiers:[].concat((((A=g.popperOptions)==null?void 0:A.modifiers)||[]).filter(function(I){var Y=I.name;return Y!==y.name}),[y])})}}var Bn={name:"inlinePositioning",defaultValue:!1,fn:function(y){var A=y.reference;function I(){return!!y.props.inlinePositioning}var Y,H=-1,k=!1,be={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(je){var Se=je.state;I()&&(Y!==Se.placement&&y.setProps({getReferenceClientRect:function(){return le(Se.placement)}}),Y=Se.placement)}};function le(_e){return Xr(K(_e),A.getBoundingClientRect(),X(A.getClientRects()),H)}function pe(_e){k=!0,y.setProps(_e),k=!1}function ye(){k||pe(Yr(y.props,be))}return{onCreate:ye,onAfterUpdate:ye,onTrigger:function(je,Se){if(U(Se)){var Ie=X(y.reference.getClientRects()),re=Ie.find(function(he){return he.left-2<=Se.clientX&&he.right+2>=Se.clientX&&he.top-2<=Se.clientY&&he.bottom+2>=Se.clientY});H=Ie.indexOf(re)}},onUntrigger:function(){H=-1}}}};function Xr(g,y,A,I){if(A.length<2||g===null)return y;if(A.length===2&&I>=0&&A[0].left>A[1].right)return A[I]||y;switch(g){case"top":case"bottom":{var Y=A[0],H=A[A.length-1],k=g==="top",be=Y.top,le=H.bottom,pe=k?Y.left:H.left,ye=k?Y.right:H.right,_e=ye-pe,je=le-be;return{top:be,bottom:le,left:pe,right:ye,width:_e,height:je}}case"left":case"right":{var Se=Math.min.apply(Math,A.map(function(fe){return fe.left})),Ie=Math.max.apply(Math,A.map(function(fe){return fe.right})),re=A.filter(function(fe){return g==="left"?fe.left===Se:fe.right===Ie}),he=re[0].top,ve=re[re.length-1].bottom,ee=Se,ie=Ie,x=ie-ee,Ge=ve-he;return{top:he,bottom:ve,left:ee,right:ie,width:x,height:Ge}}default:return y}}var qr={name:"sticky",defaultValue:!1,fn:function(y){var A=y.reference,I=y.popper;function Y(){return y.popperInstance?y.popperInstance.state.elements.reference:A}function H(pe){return y.props.sticky===!0||y.props.sticky===pe}var k=null,be=null;function le(){var pe=H("reference")?Y().getBoundingClientRect():null,ye=H("popper")?I.getBoundingClientRect():null;(pe&&Hn(k,pe)||ye&&Hn(be,ye))&&y.popperInstance&&y.popperInstance.update(),k=pe,be=ye,y.state.isMounted&&requestAnimationFrame(le)}return{onMount:function(){y.props.sticky&&le()}}}};function Hn(g,y){return g&&y?g.top!==y.top||g.right!==y.right||g.bottom!==y.bottom||g.left!==y.left:!0}dt.setDefaultProps({render:ar}),t.animateFill=dr,t.createSingleton=fr,t.default=dt,t.delegate=qt,t.followCursor=jn,t.hideAll=lr,t.inlinePositioning=Bn,t.roundArrow=r,t.sticky=qr}),Ei=Lo(No()),ds=Lo(No()),ps=t=>{let e={plugins:[]},r=i=>t[t.indexOf(i)+1];if(t.includes("animation")&&(e.animation=r("animation")),t.includes("duration")&&(e.duration=parseInt(r("duration"))),t.includes("delay")){let i=r("delay");e.delay=i.includes("-")?i.split("-").map(o=>parseInt(o)):parseInt(i)}if(t.includes("cursor")){e.plugins.push(ds.followCursor);let i=r("cursor");["x","initial"].includes(i)?e.followCursor=i==="x"?"horizontal":"initial":e.followCursor=!0}t.includes("on")&&(e.trigger=r("on")),t.includes("arrowless")&&(e.arrow=!1),t.includes("html")&&(e.allowHTML=!0),t.includes("interactive")&&(e.interactive=!0),t.includes("border")&&e.interactive&&(e.interactiveBorder=parseInt(r("border"))),t.includes("debounce")&&e.interactive&&(e.interactiveDebounce=parseInt(r("debounce"))),t.includes("max-width")&&(e.maxWidth=parseInt(r("max-width"))),t.includes("theme")&&(e.theme=r("theme")),t.includes("placement")&&(e.placement=r("placement"));let n={};return t.includes("no-flip")&&(n.modifiers||(n.modifiers=[]),n.modifiers.push({name:"flip",enabled:!1})),e.popperOptions=n,e};function Oi(t){t.magic("tooltip",e=>(r,n={})=>{let i=n.timeout;delete n.timeout;let o=(0,Ei.default)(e,{content:r,trigger:"manual",...n});o.show(),setTimeout(()=>{o.hide(),setTimeout(()=>o.destroy(),n.duration||300)},i||2e3)}),t.directive("tooltip",(e,{modifiers:r,expression:n},{evaluateLater:i,effect:o,cleanup:s})=>{let h=r.length>0?ps(r):{};e.__x_tippy||(e.__x_tippy=(0,Ei.default)(e,h)),s(()=>{e.__x_tippy&&(e.__x_tippy.destroy(),delete e.__x_tippy)});let u=()=>e.__x_tippy.enable(),f=()=>e.__x_tippy.disable(),w=m=>{m?(u(),e.__x_tippy.setContent(m)):f()};if(r.includes("raw"))w(n);else{let m=i(n);o(()=>{m(E=>{typeof E=="object"?(e.__x_tippy.setProps(E),u()):w(E)})})}})}Oi.defaultProps=t=>(Ei.default.setDefaultProps(t),Oi);var hs=Oi,ko=hs;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(ro),window.Alpine.plugin(io),window.Alpine.plugin(Io),window.Alpine.plugin(ko)});var vs=function(t,e,r){function n(w,m){for(let E of w){let O=i(E,m);if(O!==null)return O}}function i(w,m){let E=w.match(/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s);if(E===null||E.length!==3)return null;let O=E[1],S=E[2];if(O.includes(",")){let[P,R]=O.split(",",2);if(R==="*"&&m>=P)return S;if(P==="*"&&m<=R)return S;if(m>=P&&m<=R)return S}return O==m?S:null}function o(w){return w.toString().charAt(0).toUpperCase()+w.toString().slice(1)}function s(w,m){if(m.length===0)return w;let E={};for(let[O,S]of Object.entries(m))E[":"+o(O??"")]=o(S??""),E[":"+O.toUpperCase()]=S.toString().toUpperCase(),E[":"+O]=S;return Object.entries(E).forEach(([O,S])=>{w=w.replaceAll(O,S)}),w}function h(w){return w.map(m=>m.replace(/^[\{\[]([^\[\]\{\}]*)[\}\]]/,""))}let u=t.split("|"),f=n(u,e);return f!=null?s(f.trim(),r):(u=h(u),s(u.length>1&&e>1?u[1]:u[0],r))};window.jsMd5=jo.md5;window.pluralize=vs;})(); /*! Bundled license information: js-md5/src/md5.js: @@ -38,7 +38,7 @@ js-md5/src/md5.js: sortablejs/modular/sortable.esm.js: (**! - * Sortable 1.15.2 + * Sortable 1.15.3 * @author RubaXa * @author owenm * @license MIT diff --git a/public/js/filament/widgets/components/chart.js b/public/js/filament/widgets/components/chart.js index 5e136646..e7dd5bba 100644 --- a/public/js/filament/widgets/components/chart.js +++ b/public/js/filament/widgets/components/chart.js @@ -1,6 +1,6 @@ -function Ft(){}var Mo=function(){let s=0;return function(){return s++}}();function R(s){return s===null||typeof s>"u"}function $(s){if(Array.isArray&&Array.isArray(s))return!0;let t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function A(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}var K=s=>(typeof s=="number"||s instanceof Number)&&isFinite(+s);function mt(s,t){return K(s)?s:t}function I(s,t){return typeof s>"u"?t:s}var To=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:s/t,Tn=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function j(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function H(s,t,e,i){let n,r,o;if($(s))if(r=s.length,i)for(n=r-1;n>=0;n--)t.call(e,s[n],n);else for(n=0;ns,x:s=>s.x,y:s=>s.y};function Bt(s,t){return(co[t]||(co[t]=Tc(t)))(s)}function Tc(s){let t=vc(s);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function vc(s){let t=s.split("."),e=[],i="";for(let n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Mi(s){return s.charAt(0).toUpperCase()+s.slice(1)}var ft=s=>typeof s<"u",Ht=s=>typeof s=="function",vn=(s,t)=>{if(s.size!==t.size)return!1;for(let e of s)if(!t.has(e))return!1;return!0};function Oo(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}var Y=Math.PI,B=2*Y,Oc=B+Y,wi=Number.POSITIVE_INFINITY,Dc=Y/180,Z=Y/2,gs=Y/4,ho=Y*2/3,gt=Math.log10,Tt=Math.sign;function On(s){let t=Math.round(s);s=Ne(s,t,s/1e3)?t:s;let e=Math.pow(10,Math.floor(gt(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Do(s){let t=[],e=Math.sqrt(s),i;for(i=1;in-r).pop(),t}function pe(s){return!isNaN(parseFloat(s))&&isFinite(s)}function Ne(s,t,e){return Math.abs(s-t)=s}function Dn(s,t,e){let i,n,r;for(i=0,n=s.length;il&&c=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function vi(s,t,e){e=e||(o=>s[o]1;)r=n+i>>1,e(r)?n=r:i=r;return{lo:n,hi:i}}var Ct=(s,t,e,i)=>vi(s,e,i?n=>s[n][t]<=e:n=>s[n][t]vi(s,e,i=>s[i][t]>=e);function Fo(s,t,e){let i=0,n=s.length;for(;ii&&s[n-1]>e;)n--;return i>0||n{let i="_onData"+Mi(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...r){let o=n.apply(this,r);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Cn(s,t){let e=s._chartjs;if(!e)return;let i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(Ao.forEach(r=>{delete s[r]}),delete s._chartjs)}function Fn(s){let t=new Set,e,i;for(e=0,i=s.length;e"u"?function(s){return s()}:window.requestAnimationFrame}();function Ln(s,t,e){let i=e||(o=>Array.prototype.slice.call(o)),n=!1,r=[];return function(...o){r=i(o),n||(n=!0,An.call(window,()=>{n=!1,s.apply(t,r)}))}}function Po(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}var Oi=s=>s==="start"?"left":s==="end"?"right":"center",ot=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,No=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function Pn(s,t,e){let i=t.length,n=0,r=i;if(s._sorted){let{iScale:o,_parsed:a}=s,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(n=it(Math.min(Ct(a,o.axis,c).lo,e?i:Ct(t,l,o.getPixelForValue(c)).lo),0,i-1)),d?r=it(Math.max(Ct(a,o.axis,h,!0).hi+1,e?0:Ct(t,l,o.getPixelForValue(h),!0).hi+1),n,i)-n:r=i-n}return{start:n,count:r}}function Nn(s){let{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;let r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),r}var gi=s=>s===0||s===1,uo=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*B/e)),fo=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*B/e)+1,Ie={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*Z)+1,easeOutSine:s=>Math.sin(s*Z),easeInOutSine:s=>-.5*(Math.cos(Y*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>gi(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>gi(s)?s:uo(s,.075,.3),easeOutElastic:s=>gi(s)?s:fo(s,.075,.3),easeInOutElastic(s){return gi(s)?s:s<.5?.5*uo(s*2,.1125,.45):.5+.5*fo(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-Ie.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?Ie.easeInBounce(s*2)*.5:Ie.easeOutBounce(s*2-1)*.5+.5};function _s(s){return s+.5|0}var Kt=(s,t,e)=>Math.max(Math.min(s,e),t);function ps(s){return Kt(_s(s*2.55),0,255)}function Jt(s){return Kt(_s(s*255),0,255)}function Vt(s){return Kt(_s(s/2.55)/100,0,1)}function mo(s){return Kt(_s(s*100),0,100)}var _t={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},kn=[..."0123456789ABCDEF"],Ic=s=>kn[s&15],Cc=s=>kn[(s&240)>>4]+kn[s&15],pi=s=>(s&240)>>4===(s&15),Fc=s=>pi(s.r)&&pi(s.g)&&pi(s.b)&&pi(s.a);function Ac(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&_t[s[1]]*17,g:255&_t[s[2]]*17,b:255&_t[s[3]]*17,a:t===5?_t[s[4]]*17:255}:(t===7||t===9)&&(e={r:_t[s[1]]<<4|_t[s[2]],g:_t[s[3]]<<4|_t[s[4]],b:_t[s[5]]<<4|_t[s[6]],a:t===9?_t[s[7]]<<4|_t[s[8]]:255})),e}var Lc=(s,t)=>s<255?t(s):"";function Pc(s){var t=Fc(s)?Ic:Cc;return s?"#"+t(s.r)+t(s.g)+t(s.b)+Lc(s.a,t):void 0}var Nc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ro(s,t,e){let i=t*Math.min(e,1-e),n=(r,o=(r+s/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function Rc(s,t,e){let i=(n,r=(n+s/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Wc(s,t,e){let i=Ro(s,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function zc(s,t,e,i,n){return s===n?(t-e)/i+(t.5?h/(2-r-o):h/(r+o),l=zc(e,i,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Wn(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Jt)}function zn(s,t,e){return Wn(Ro,s,t,e)}function Vc(s,t,e){return Wn(Wc,s,t,e)}function Hc(s,t,e){return Wn(Rc,s,t,e)}function Wo(s){return(s%360+360)%360}function Bc(s){let t=Nc.exec(s),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?ps(+t[5]):Jt(+t[5]));let n=Wo(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Vc(n,r,o):t[1]==="hsv"?i=Hc(n,r,o):i=zn(n,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function $c(s,t){var e=Rn(s);e[0]=Wo(e[0]+t),e=zn(e),s.r=e[0],s.g=e[1],s.b=e[2]}function jc(s){if(!s)return;let t=Rn(s),e=t[0],i=mo(t[1]),n=mo(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${Vt(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}var go={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},po={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Uc(){let s={},t=Object.keys(po),e=Object.keys(go),i,n,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return s}var yi;function Yc(s){yi||(yi=Uc(),yi.transparent=[0,0,0,0]);let t=yi[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Zc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qc(s){let t=Zc.exec(s),e=255,i,n,r;if(t){if(t[7]!==i){let o=+t[7];e=t[8]?ps(o):Kt(o*255,0,255)}return i=+t[1],n=+t[3],r=+t[5],i=255&(t[2]?ps(i):Kt(i,0,255)),n=255&(t[4]?ps(n):Kt(n,0,255)),r=255&(t[6]?ps(r):Kt(r,0,255)),{r:i,g:n,b:r,a:e}}}function Gc(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${Vt(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}var xn=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Ee=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function Xc(s,t,e){let i=Ee(Vt(s.r)),n=Ee(Vt(s.g)),r=Ee(Vt(s.b));return{r:Jt(xn(i+e*(Ee(Vt(t.r))-i))),g:Jt(xn(n+e*(Ee(Vt(t.g))-n))),b:Jt(xn(r+e*(Ee(Vt(t.b))-r))),a:s.a+e*(t.a-s.a)}}function bi(s,t,e){if(s){let i=Rn(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=zn(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function zo(s,t){return s&&Object.assign(t||{},s)}function yo(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=Jt(s[3]))):(t=zo(s,{r:0,g:0,b:0,a:1}),t.a=Jt(t.a)),t}function Kc(s){return s.charAt(0)==="r"?qc(s):Bc(s)}var Fe=class{constructor(t){if(t instanceof Fe)return t;let e=typeof t,i;e==="object"?i=yo(t):e==="string"&&(i=Ac(t)||Yc(t)||Kc(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=zo(this._rgb);return t&&(t.a=Vt(t.a)),t}set rgb(t){this._rgb=yo(t)}rgbString(){return this._valid?Gc(this._rgb):void 0}hexString(){return this._valid?Pc(this._rgb):void 0}hslString(){return this._valid?jc(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,n=t.rgb,r,o=e===r?.5:e,a=2*o-1,l=i.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*n.r+.5,i.g=255&c*i.g+r*n.g+.5,i.b=255&c*i.b+r*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Xc(this._rgb,t._rgb,e)),this}clone(){return new Fe(this.rgb)}alpha(t){return this._rgb.a=Jt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=_s(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return bi(this._rgb,2,t),this}darken(t){return bi(this._rgb,2,-t),this}saturate(t){return bi(this._rgb,1,t),this}desaturate(t){return bi(this._rgb,1,-t),this}rotate(t){return $c(this._rgb,t),this}};function Vo(s){return new Fe(s)}function Ho(s){if(s&&typeof s=="object"){let t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Vn(s){return Ho(s)?s:Vo(s)}function _n(s){return Ho(s)?s:Vo(s).saturate(.5).darken(.1).hexString()}var Qt=Object.create(null),Di=Object.create(null);function ys(s,t){if(!t)return s;let e=t.split(".");for(let i=0,n=e.length;ie.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,i)=>_n(i.backgroundColor),this.hoverBorderColor=(e,i)=>_n(i.borderColor),this.hoverColor=(e,i)=>_n(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return wn(this,t,e)}get(t){return ys(this,t)}describe(t,e){return wn(Di,t,e)}override(t,e){return wn(Qt,t,e)}route(t,e,i,n){let r=ys(this,t),o=ys(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=o[n];return A(l)?Object.assign({},c,l):I(l,c)},set(l){this[a]=l}}})}},L=new Mn({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Jc(s){return!s||R(s.size)||R(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function bs(s,t,e,i,n){let r=t[n];return r||(r=t[n]=s.measureText(n).width,e.push(n)),r>i&&(i=r),i}function Bo(s,t,e,i){i=i||{};let n=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(n=i.data={},r=i.garbageCollect=[],i.font=t),s.save(),s.font=t;let o=0,a=e.length,l,c,h,u,d;for(l=0;le.length){for(l=0;l0&&s.stroke()}}function Ae(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.xt.top-e&&s.y0&&r.strokeColor!=="",l,c;for(s.save(),s.font=n.string,Qc(s,r),l=0;l+s||0;function Ii(s,t){let e={},i=A(t),n=i?Object.keys(t):t,r=A(s)?i?o=>I(s[o],s[t[o]]):o=>s[o]:()=>s;for(let o of n)e[o]=nh(r(o));return e}function $n(s){return Ii(s,{top:"y",right:"x",bottom:"y",left:"x"})}function se(s){return Ii(s,["topLeft","topRight","bottomLeft","bottomRight"])}function at(s){let t=$n(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function et(s,t){s=s||{},t=t||L.font;let e=I(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=I(s.style,t.style);i&&!(""+i).match(sh)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");let n={family:I(s.family,t.family),lineHeight:ih(I(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:I(s.weight,t.weight),string:""};return n.string=Jc(n),n}function ze(s,t,e,i){let n=!0,r,o,a;for(r=0,o=s.length;re&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(n,r)}}function $t(s,t){return Object.assign(Object.create(s),t)}function Ci(s,t=[""],e=s,i,n=()=>s[0]){ft(i)||(i=qo("_fallback",s));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:e,_fallback:i,_getTarget:n,override:o=>Ci([o,...s],t,e,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete s[0][a],!0},get(o,a){return Yo(o,a,()=>dh(a,t,s,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(o,a){return xo(o).includes(a)},ownKeys(o){return xo(o)},set(o,a,l){let c=o._storage||(o._storage=n());return o[a]=c[a]=l,delete o._keys,!0}})}function ge(s,t,e,i){let n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:jn(s,i),setContext:r=>ge(s,r,e,i),override:r=>ge(s.override(r),t,e,i)};return new Proxy(n,{deleteProperty(r,o){return delete r[o],delete s[o],!0},get(r,o,a){return Yo(r,o,()=>oh(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(s,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,o)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(r,o){return Reflect.has(s,o)},ownKeys(){return Reflect.ownKeys(s)},set(r,o,a){return s[o]=a,delete r[o],!0}})}function jn(s,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:Ht(e)?e:()=>e,isIndexable:Ht(i)?i:()=>i}}var rh=(s,t)=>s?s+Mi(t):t,Un=(s,t)=>A(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Yo(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t))return s[t];let i=e();return s[t]=i,i}function oh(s,t,e){let{_proxy:i,_context:n,_subProxy:r,_descriptors:o}=s,a=i[t];return Ht(a)&&o.isScriptable(t)&&(a=ah(t,a,s,e)),$(a)&&a.length&&(a=lh(t,a,s,o.isIndexable)),Un(t,a)&&(a=ge(a,n,r&&r[t],o)),a}function ah(s,t,e,i){let{_proxy:n,_context:r,_subProxy:o,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);return a.add(s),t=t(r,o||i),a.delete(s),Un(s,t)&&(t=Yn(n._scopes,n,s,t)),t}function lh(s,t,e,i){let{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=e;if(ft(r.index)&&i(s))t=t[r.index%t.length];else if(A(t[0])){let l=t,c=n._scopes.filter(h=>h!==l);t=[];for(let h of l){let u=Yn(c,n,s,h);t.push(ge(u,r,o&&o[s],a))}}return t}function Zo(s,t,e){return Ht(s)?s(t,e):s}var ch=(s,t)=>s===!0?t:typeof s=="string"?Bt(t,s):void 0;function hh(s,t,e,i,n){for(let r of t){let o=ch(e,r);if(o){s.add(o);let a=Zo(o._fallback,e,n);if(ft(a)&&a!==e&&a!==i)return a}else if(o===!1&&ft(i)&&e!==i)return null}return!1}function Yn(s,t,e,i){let n=t._rootScopes,r=Zo(t._fallback,e,i),o=[...s,...n],a=new Set;a.add(i);let l=bo(a,o,e,r||e,i);return l===null||ft(r)&&r!==e&&(l=bo(a,o,r,l,i),l===null)?!1:Ci(Array.from(a),[""],n,r,()=>uh(t,e,i))}function bo(s,t,e,i,n){for(;e;)e=hh(s,t,e,i,n);return e}function uh(s,t,e){let i=s._getTarget();t in i||(i[t]={});let n=i[t];return $(n)&&A(e)?e:n}function dh(s,t,e,i){let n;for(let r of t)if(n=qo(rh(r,s),e),ft(n))return Un(s,n)?Yn(e,i,s,n):n}function qo(s,t){for(let e of t){if(!e)continue;let i=e[s];if(ft(i))return i}}function xo(s){let t=s._keys;return t||(t=s._keys=fh(s._scopes)),t}function fh(s){let t=new Set;for(let e of s)for(let i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}function Zn(s,t,e,i){let{iScale:n}=s,{key:r="r"}=this._parsing,o=new Array(i),a,l,c,h;for(a=0,l=i;ats==="x"?"y":"x";function gh(s,t,e,i){let n=s.skip?t:s,r=t,o=e.skip?t:e,a=Si(r,n),l=Si(o,r),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let u=i*c,d=i*h;return{previous:{x:r.x-u*(o.x-n.x),y:r.y-u*(o.y-n.y)},next:{x:r.x+d*(o.x-n.x),y:r.y+d*(o.y-n.y)}}}function ph(s,t,e){let i=s.length,n,r,o,a,l,c=Le(s,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")bh(s,n);else{let c=i?s[s.length-1]:s[0];for(r=0,o=s.length;rwindow.getComputedStyle(s,null);function _h(s,t){return Ai(s).getPropertyValue(t)}var wh=["top","right","bottom","left"];function me(s,t,e){let i={};e=e?"-"+e:"";for(let n=0;n<4;n++){let r=wh[n];i[r]=parseFloat(s[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var Sh=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function kh(s,t){let e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:r}=i,o=!1,a,l;if(Sh(n,r,s.target))a=n,l=r;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function ie(s,t){if("native"in s)return s;let{canvas:e,currentDevicePixelRatio:i}=t,n=Ai(e),r=n.boxSizing==="border-box",o=me(n,"padding"),a=me(n,"border","width"),{x:l,y:c,box:h}=kh(s,e),u=o.left+(h&&a.left),d=o.top+(h&&a.top),{width:f,height:m}=t;return r&&(f-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-u)/f*e.width/i),y:Math.round((c-d)/m*e.height/i)}}function Mh(s,t,e){let i,n;if(t===void 0||e===void 0){let r=Fi(s);if(!r)t=s.clientWidth,e=s.clientHeight;else{let o=r.getBoundingClientRect(),a=Ai(r),l=me(a,"border","width"),c=me(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=ki(a.maxWidth,r,"clientWidth"),n=ki(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||wi,maxHeight:n||wi}}var Sn=s=>Math.round(s*10)/10;function Ko(s,t,e,i){let n=Ai(s),r=me(n,"margin"),o=ki(n.maxWidth,s,"clientWidth")||wi,a=ki(n.maxHeight,s,"clientHeight")||wi,l=Mh(s,t,e),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let u=me(n,"border","width"),d=me(n,"padding");c-=d.width+u.width,h-=d.height+u.height}return c=Math.max(0,c-r.width),h=Math.max(0,i?Math.floor(c/i):h-r.height),c=Sn(Math.min(c,o,l.maxWidth)),h=Sn(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Sn(c/2)),{width:c,height:h}}function Gn(s,t,e){let i=t||1,n=Math.floor(s.height*i),r=Math.floor(s.width*i);s.height=n/i,s.width=r/i;let o=s.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${s.height}px`,o.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||o.height!==n||o.width!==r?(s.currentDevicePixelRatio=i,o.height=n,o.width=r,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}var Jo=function(){let s=!1;try{let t={get passive(){return s=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return s}();function Xn(s,t){let e=_h(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Xt(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function Qo(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function ta(s,t,e,i){let n={x:s.cp2x,y:s.cp2y},r={x:t.cp1x,y:t.cp1y},o=Xt(s,n,e),a=Xt(n,r,e),l=Xt(r,t,e),c=Xt(o,a,e),h=Xt(a,l,e);return Xt(c,h,e)}var _o=new Map;function Th(s,t){t=t||{};let e=s+JSON.stringify(t),i=_o.get(e);return i||(i=new Intl.NumberFormat(s,t),_o.set(e,i)),i}function Ve(s,t,e){return Th(t,e).format(s)}var vh=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Oh=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function ye(s,t,e){return s?vh(t,e):Oh()}function Kn(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function Jn(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function ea(s){return s==="angle"?{between:Re,compare:Ec,normalize:ht}:{between:At,compare:(t,e)=>t-e,normalize:t=>t}}function wo({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function Dh(s,t,e){let{property:i,start:n,end:r}=e,{between:o,normalize:a}=ea(i),l=t.length,{start:c,end:h,loop:u}=s,d,f;if(u){for(c+=l,h+=l,d=0,f=l;dl(n,_,y)&&a(n,_)!==0,x=()=>a(r,y)===0||l(r,_,y),S=()=>g||w(),k=()=>!g||x();for(let O=h,T=h;O<=u;++O)b=t[O%o],!b.skip&&(y=c(b[i]),y!==_&&(g=l(y,n,r),p===null&&S()&&(p=a(y,n)===0?O:T),p!==null&&k()&&(m.push(wo({start:p,end:O,loop:d,count:o,style:f})),p=null),T=O,_=y));return p!==null&&m.push(wo({start:p,end:u,loop:d,count:o,style:f})),m}function tr(s,t){let e=[],i=s.segments;for(let n=0;nn&&s[r%t].skip;)r--;return r%=t,{start:n,end:r}}function Ih(s,t,e,i){let n=s.length,r=[],o=t,a=s[t],l;for(l=t+1;l<=e;++l){let c=s[l%n];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%n,end:(l-1)%n,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%n,end:o%n,loop:i}),r}function sa(s,t){let e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];let r=!!s._loop,{start:o,end:a}=Eh(e,n,r,i);if(i===!0)return So(s,[{start:o,end:a,loop:r}],e,t);let l=aa({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=An.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;let r=i.items,o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},jt=new hr,ia="transparent",Ah={boolean(s,t,e){return e>.5?t:s},color(s,t,e){let i=Vn(s||ia),n=i.valid&&Vn(t||ia);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}},ur=class{constructor(t,e,i,n){let r=e[i];n=ze([t.to,n,r,t.from]);let o=ze([t.from,r,n]);this._active=!0,this._fn=t.fn||Ah[t.type||typeof o],this._easing=Ie[t.easing]||Ie.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let n=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ze([t.to,e,n,t.from]),this._from=ze([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,n=this._prop,r=this._from,o=this._loop,a=this._to,l;if(this._active=r!==a&&(o||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(r,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let n=0;ns!=="onProgress"&&s!=="onComplete"&&s!=="fn"});L.set("animations",{colors:{type:"color",properties:Ph},numbers:{type:"number",properties:Lh}});L.describe("animations",{_fallback:"animation"});L.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:s=>s|0}}}});var Hi=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!A(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let n=t[i];if(!A(n))return;let r={};for(let o of Nh)r[o]=n[o];($(n.properties)&&n.properties||[i]).forEach(o=>{(o===i||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){let i=e.options,n=Wh(t,i);if(!n)return[];let r=this._createAnimations(n,i);return i.$shared&&Rh(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){let i=this._properties,n=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}let h=e[c],u=r[c],d=i.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}r[c]=u=new ur(d,t,c,h),n.push(u)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return jt.add(this._chart,i),!0}};function Rh(s,t){let e=[],i=Object.keys(t);for(let n=0;n0||!e&&r<0)return n.index}return null}function la(s,t){let{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,h=Bh(r,o,i),u=t.length,d;for(let f=0;fe[i].axis===t).shift()}function Uh(s,t){return $t(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Yh(s,t,e){return $t(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ks(s,t){let e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(let n of t){let r=n._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e]}}}var sr=s=>s==="reset"||s==="none",ca=(s,t)=>t?s:Object.assign({},s),Zh=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:qa(e,!0),values:null},pt=class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=oa(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&ks(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(u,d,f,m)=>u==="x"?d:u==="r"?m:f,r=e.xAxisID=I(i.xAxisID,er(t,"x")),o=e.yAxisID=I(i.yAxisID,er(t,"y")),a=e.rAxisID=I(i.rAxisID,er(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,r,o,a),h=e.vAxisID=n(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Cn(this._data,this),t._stacked&&ks(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(A(e))this._data=Hh(e);else if(i!==e){if(i){Cn(i,this);let n=this._cachedMeta;ks(n),n._parsed=[]}e&&Object.isExtensible(e)&&Lo(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();let r=e._stacked;e._stacked=oa(e.vScale,e),e.stack!==i.stack&&(n=!0,ks(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&la(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:o}=i,a=r.axis,l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,u,d;if(this._parsing===!1)i._parsed=n,i._sorted=!0,d=n;else{$(n[t])?d=this.parseArrayData(i,n,t,e):A(n[t])?d=this.parseObjectData(i,n,t,e):d=this.parsePrimitiveData(i,n,t,e);let f=()=>u[a]===null||c&&u[a]g||u=0;--d)if(!m()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],n,r,o;for(n=0,r=e.length;n=0&&tthis.getContext(i,n),g=c.resolveNamedOptions(d,f,m,u);return g.$shared&&(g.$shared=l,r[o]=Object.freeze(ca(g,l))),g}_resolveAnimations(t,e,i){let n=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(n.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,i,e))}let c=new Hi(n,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||sr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,n){sr(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!sr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;let r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let n=i.length,r=e.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;an-r))}return s._cache.$bar}function Gh(s){let t=s.iScale,e=qh(t,s.type),i=t._length,n,r,o,a,l=()=>{o===32767||o===-32768||(ft(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(n=0,r=e.length;n0?n[s-1]:null,a=sMath.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:r,min:o,max:a}}function Ga(s,t,e,i){return $(s)?Jh(s,t,e,i):t[e.axis]=e.parse(s,i),t}function ha(s,t,e,i){let n=s.iScale,r=s.vScale,o=n.getLabels(),a=n===r,l=[],c,h,u,d;for(c=e,h=e+i;c=e?1:-1)}function tu(s){let t,e,i,n,r;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{let c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(R(h)||isNaN(h))return!0};for(let l of n)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let n=this._getStacks(t,i),r=e!==void 0?n.indexOf(e):-1;return r===-1?n.length-1:r}_getRuler(){let t=this.options,e=this._cachedMeta,i=e.iScale,n=[],r,o;for(r=0,o=e.data.length;r=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:i,yScale:n}=e,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=n.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){let r=n==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=o.axis,u=a.axis;for(let d=e;dRe(_,a,l,!0)?1:Math.max(w,w*e,x,x*e),m=(_,w,x)=>Re(_,a,l,!0)?-1:Math.min(w,w*e,x,x*e),g=f(0,c,u),p=f(Z,h,d),y=m(Y,c,u),b=m(Y+Z,h,d);i=(g-y)/2,n=(p-b)/2,r=-(g+y)/2,o=-(p+b)/2}return{ratioX:i,ratioY:n,offsetX:r,offsetY:o}}var oe=class extends pt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let r=l=>+i[l];if(A(i[t])){let{key:l="value"}=this._parsing;r=c=>+Bt(i[c],l)}let o,a;for(o=t,a=t+e;o0&&!isNaN(t)?B*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=Ve(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0,i=this.chart,n,r,o,a,l;if(!t){for(n=0,r=i.data.datasets.length;ns!=="spacing",_indexable:s=>s!=="spacing"};oe.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){let t=s.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=s.legend.options;return t.labels.map((i,n)=>{let o=s.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(n),index:n}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(s){let t=s.label,e=": "+s.formattedValue;return $(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};var Ue=class extends pt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,o=this.chart._animationsDisabled,{start:a,count:l}=Pn(e,n,o);this._drawStart=a,this._drawCount=l,Nn(e)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,i,n){let r=n==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,n),d=o.axis,f=a.axis,{spanGaps:m,segment:g}=this.options,p=pe(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||n==="none",b=e>0&&this.getParsed(e-1);for(let _=e;_0&&Math.abs(x[d]-b[d])>p,g&&(S.parsed=x,S.raw=c.data[_]),u&&(S.options=h||this.resolveDataElementOptions(_,w.active?"active":n)),y||this.updateElement(w,_,S,n),b=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;let r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};Ue.id="line";Ue.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Ue.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Ye=class extends pt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=Ve(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return Zn.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(re.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,n){let r=n==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*Y,f=d,m,g=360/this.countVisibleElements();for(m=0;m{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?wt(this.resolveDataElementOptions(t,e).angle||i):0}};Ye.id="polarArea";Ye.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ye.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){let t=s.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=s.legend.options;return t.labels.map((i,n)=>{let o=s.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(n),index:n}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(s){return s.chart.data.labels[s.dataIndex]+": "+s.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var Is=class extends oe{};Is.id="pie";Is.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Ze=class extends pt{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Zn.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,t!=="resize"){let o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===n.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){let r=this._cachedMeta.rScale,o=n==="reset";for(let a=e;a{n[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),n}};yt.defaults={};yt.defaultRoutes=void 0;var Xa={values(s){return $(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";let i=this.chart.options.locale,n,r=s;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),r=ru(s,e)}let o=gt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ve(s,i,l)},logarithmic(s,t,e){if(s===0)return"0";let i=s/Math.pow(10,Math.floor(gt(s)));return i===1||i===2||i===5?Xa.numeric.call(this,s,t,e):""}};function ru(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var Zi={formatters:Xa};L.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(s,t)=>t.lineWidth,tickColor:(s,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Zi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});L.route("scale.ticks","color","","color");L.route("scale.grid","color","","borderColor");L.route("scale.grid","borderColor","","borderColor");L.route("scale.title","color","","color");L.describe("scale",{_fallback:!1,_scriptable:s=>!s.startsWith("before")&&!s.startsWith("after")&&s!=="callback"&&s!=="parser",_indexable:s=>s!=="borderDash"&&s!=="tickBorderDash"});L.describe("scales",{_fallback:"scale"});L.describe("scale.ticks",{_scriptable:s=>s!=="backdropPadding"&&s!=="callback",_indexable:s=>s!=="backdropPadding"});function ou(s,t){let e=s.options.ticks,i=e.maxTicksLimit||au(s),n=e.major.enabled?cu(t):[],r=n.length,o=n[0],a=n[r-1],l=[];if(r>i)return hu(t,l,n,r/i),l;let c=lu(n,t,i);if(r>0){let h,u,d=r>1?Math.round((a-o)/(r-1)):null;for(Li(t,l,c,R(d)?0:o-d,o),h=0,u=r-1;hn)return l}return Math.max(n,1)}function cu(s){let t=[],e,i;for(e=0,i=s.length;es==="left"?"right":s==="right"?"left":s,fa=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e;function ma(s,t){let e=[],i=s.length/t,n=s.length,r=0;for(;ro+a)))return l}function mu(s,t){H(s,e=>{let i=e.gc,n=i.length/2,r;if(n>t){for(r=0;ri?i:e,i=n&&e>i?e:i,{min:mt(e,mt(i,e)),max:mt(i,mt(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){j(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Uo(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=it(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),u+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Ms(t.grid)-e.padding-ga(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Ti(Math.min(Math.asin(it((h.highest.height+6)/a,-1,1)),Math.asin(it(l/c,-1,1))-Math.asin(it(d/c,-1,1)))),o=Math.max(n,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){j(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){j(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=ga(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ms(r)+l):(t.height=this.maxHeight,t.width=Ms(r)+l),i.display&&this.ticks.length){let{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=i.padding*2,m=wt(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){let y=i.mirror?0:p*u.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{let y=i.mirror?0:g*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,h,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){let{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;l?c?(d=n*t.width,f=i*e.height):(d=i*t.height,f=n*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=e.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){j(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:r[k]||0,height:o[k]||0});return{first:S(0),last:S(e-1),widest:S(w),highest:S(x),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Io(this._alignToPixels?te(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*n?a/i:l/n:l*n0}_computeGridLineItems(t){let e=this.axis,i=this.chart,n=this.options,{grid:r,position:o}=n,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),u=Ms(r),d=[],f=r.setContext(this.getContext()),m=f.drawBorder?f.borderWidth:0,g=m/2,p=function(E){return te(i,E,m)},y,b,_,w,x,S,k,O,T,F,W,P;if(o==="top")y=p(this.bottom),S=this.bottom-u,O=y-g,F=p(t.top)+g,P=t.bottom;else if(o==="bottom")y=p(this.top),F=t.top,P=p(t.bottom)-g,S=y+g,O=this.top+u;else if(o==="left")y=p(this.right),x=this.right-u,k=y-g,T=p(t.left)+g,W=t.right;else if(o==="right")y=p(this.left),T=t.left,W=p(t.right)-g,x=y+g,k=this.left+u;else if(e==="x"){if(o==="center")y=p((t.top+t.bottom)/2+.5);else if(A(o)){let E=Object.keys(o)[0],tt=o[E];y=p(this.chart.scales[E].getPixelForValue(tt))}F=t.top,P=t.bottom,S=y+g,O=S+u}else if(e==="y"){if(o==="center")y=p((t.left+t.right)/2);else if(A(o)){let E=Object.keys(o)[0],tt=o[E];y=p(this.chart.scales[E].getPixelForValue(tt))}x=y-g,k=x-u,T=t.left,W=t.right}let Q=I(n.ticks.maxTicksLimit,h),ct=Math.max(1,Math.ceil(h/Q));for(b=0;br.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,o,a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=n.length;r{this.draw(n)}}]:[{z:i,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[],r,o;for(r=0,o=e.length;r{let i=e.split("."),n=i.pop(),r=[s].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");L.route(r,n,l,a)})}function wu(s){return"id"in s&&"defaults"in s}var dr=class{constructor(){this.controllers=new Be(pt,"datasets",!0),this.elements=new Be(yt,"elements"),this.plugins=new Be(Object,"plugins"),this.scales=new Be(Yt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{let r=i||this._getRegistryForType(n);i||r.isForType(n)||r===this.plugins&&n.id?this._exec(t,r,n):H(n,o=>{let a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){let n=Mi(t);j(i["before"+n],[],i),e[t](i),j(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let w=e;w0&&Math.abs(S[f]-_[f])>y,p&&(k.parsed=S,k.raw=c.data[w]),d&&(k.options=u||this.resolveDataElementOptions(w,x.active?"active":n)),b||this.updateElement(x,w,k,n),_=S}this.updateSharedOptions(u,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;let r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,o)/2}};qe.id="scatter";qe.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};qe.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(s){return"("+s.label+", "+s.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Su=Object.freeze({__proto__:null,BarController:$e,BubbleController:je,DoughnutController:oe,LineController:Ue,PolarAreaController:Ye,PieController:Is,RadarController:Ze,ScatterController:qe});function be(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Cs=class{constructor(t){this.options=t||{}}init(t){}formats(){return be()}parse(t,e){return be()}format(t,e){return be()}add(t,e,i){return be()}diff(t,e,i){return be()}startOf(t,e,i){return be()}endOf(t,e){return be()}};Cs.override=function(s){Object.assign(Cs.prototype,s)};var kr={_date:Cs};function ku(s,t,e,i){let{controller:n,data:r,_sorted:o}=s,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){let l=a._reversePixels?Co:Ct;if(i){if(n._sharedOptions){let c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let u=l(r,t,e-h),d=l(r,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Ws(s,t,e,i,n){let r=s.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a{l[o](t[e],n)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),i&&!a?[]:r}var Ou={evaluateInteractionItems:Ws,modes:{index(s,t,e,i){let n=ie(t,s),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?nr(s,n,r,i,o):rr(s,n,r,!1,i,o),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(s,t,e,i){let n=ie(t,s),r=e.axis||"xy",o=e.includeInvisible||!1,a=e.intersect?nr(s,n,r,i,o):rr(s,n,r,!1,i,o);if(a.length>0){let l=a[0].datasetIndex,c=s.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function ya(s,t){return s.filter(e=>Ka.indexOf(e.pos)===-1&&e.box.axis===t)}function vs(s,t){return s.sort((e,i)=>{let n=t?i:e,r=t?e:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function Du(s){let t=[],e,i,n,r,o,a;for(e=0,i=(s||[]).length;ec.box.fullSize),!0),i=vs(Ts(t,"left"),!0),n=vs(Ts(t,"right")),r=vs(Ts(t,"top"),!0),o=vs(Ts(t,"bottom")),a=ya(t,"x"),l=ya(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:Ts(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function ba(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function Ja(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function Fu(s,t,e,i){let{pos:n,box:r}=e,o=s.maxPadding;if(!A(n)){e.size&&(s[n]-=e.size);let u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,s[n]+=e.size}r.getPadding&&Ja(o,r.getPadding());let a=Math.max(0,t.outerWidth-ba(o,s,"left","right")),l=Math.max(0,t.outerHeight-ba(o,s,"top","bottom")),c=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Au(s){let t=s.maxPadding;function e(i){let n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function Lu(s,t){let e=t.maxPadding;function i(n){let r={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(s?["left","right"]:["top","bottom"])}function Ds(s,t,e,i){let n=[],r,o,a,l,c,h;for(r=0,o=s.length,c=0;r{typeof g.beforeLayout=="function"&&g.beforeLayout()});let h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},n);Ja(d,at(i));let f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),m=Iu(l.concat(c),u);Ds(a.fullSize,f,u,m),Ds(l,f,u,m),Ds(c,f,u,m)&&Ds(l,f,u,m),Au(f),xa(a.leftAndTop,f,u,m),f.x+=f.w,f.y+=f.h,xa(a.rightAndBottom,f,u,m),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H(a.chartArea,g=>{let p=g.box;Object.assign(p,s.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},Bi=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}},fr=class extends Bi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Vi="$chartjs",Pu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},_a=s=>s===null||s==="";function Nu(s,t){let e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Vi]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",_a(n)){let r=Xn(s,"width");r!==void 0&&(s.width=r)}if(_a(i))if(s.style.height==="")s.height=s.width/(t||2);else{let r=Xn(s,"height");r!==void 0&&(s.height=r)}return s}var Qa=Jo?{passive:!0}:!1;function Ru(s,t,e){s.addEventListener(t,e,Qa)}function Wu(s,t,e){s.canvas.removeEventListener(t,e,Qa)}function zu(s,t){let e=Pu[s.type]||s.type,{x:i,y:n}=ie(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function $i(s,t){for(let e of s)if(e===t||e.contains(t))return!0}function Vu(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||$i(a.addedNodes,i),o=o&&!$i(a.removedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Hu(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||$i(a.removedNodes,i),o=o&&!$i(a.addedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}var Fs=new Map,wa=0;function tl(){let s=window.devicePixelRatio;s!==wa&&(wa=s,Fs.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Bu(s,t){Fs.size||window.addEventListener("resize",tl),Fs.set(s,t)}function $u(s){Fs.delete(s),Fs.size||window.removeEventListener("resize",tl)}function ju(s,t,e){let i=s.canvas,n=i&&Fi(i);if(!n)return;let r=Ln((a,l)=>{let c=n.clientWidth;e(a,l),c{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(n),Bu(s,r),o}function or(s,t,e){e&&e.disconnect(),t==="resize"&&$u(s)}function Uu(s,t,e){let i=s.canvas,n=Ln(r=>{s.ctx!==null&&e(zu(r,s))},s,r=>{let o=r[0];return[o,o.offsetX,o.offsetY]});return Ru(i,t,n),n}var mr=class extends Bi{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Nu(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[Vi])return!1;let i=e[Vi].initial;["height","width"].forEach(r=>{let o=i[r];R(o)?e.removeAttribute(r):e.setAttribute(r,o)});let n=i.style||{};return Object.keys(n).forEach(r=>{e.style[r]=n[r]}),e.width=e.width,delete e[Vi],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),o={attach:Vu,detach:Hu,resize:ju}[e]||Uu;n[e]=o(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:or,detach:or,resize:or}[e]||Wu)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Ko(t,e,i,n)}isAttached(t){let e=Fi(t);return!!(e&&e.isConnected)}};function Yu(s){return!qn()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?fr:mr}var gr=class{constructor(){this._init=[]}notify(t,e,i,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let r=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,n){n=n||{};for(let r of t){let o=r.plugin,a=o[i],l=[e,n,r.options];if(j(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){R(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,n=I(i.options&&i.options.plugins,{}),r=Zu(i);return n===!1&&!e?[]:Gu(t,r,n,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,n=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}};function Zu(s){let t={},e=[],i=Object.keys(Pt.plugins.items);for(let r=0;r{let l=i[a];if(!A(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let c=yr(a,l),h=Ju(c,n),u=e.scales||{};r[c]=r[c]||a,o[a]=Pe(Object.create(null),[{axis:c},l,u[c],u[h]])}),s.data.datasets.forEach(a=>{let l=a.type||s.type,c=a.indexAxis||pr(l,t),u=(Qt[l]||{}).scales||{};Object.keys(u).forEach(d=>{let f=Ku(d,c),m=a[f+"AxisID"]||r[f]||f;o[m]=o[m]||Object.create(null),Pe(o[m],[{axis:f},i[m],u[d]])})}),Object.keys(o).forEach(a=>{let l=o[a];Pe(l,[L.scales[l.type],L.scale])}),o}function el(s){let t=s.options||(s.options={});t.plugins=I(t.plugins,{}),t.scales=td(s,t)}function sl(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function ed(s){return s=s||{},s.data=sl(s.data),el(s),s}var Sa=new Map,il=new Set;function Ni(s,t){let e=Sa.get(s);return e||(e=t(),Sa.set(s,e),il.add(e)),e}var Os=(s,t,e)=>{let i=Bt(t,e);i!==void 0&&s.add(i)},br=class{constructor(t){this._config=ed(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=sl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),el(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ni(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ni(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ni(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return Ni(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){let{options:n,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Os(l,t,u))),h.forEach(u=>Os(l,n,u)),h.forEach(u=>Os(l,Qt[r]||{},u)),h.forEach(u=>Os(l,L,u)),h.forEach(u=>Os(l,Di,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),il.has(e)&&o.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,Qt[e]||{},L.datasets[e]||{},{type:e},L,Di]}resolveNamedOptions(t,e,i,n=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=ka(this._resolverCache,t,n),l=o;if(id(o,e)){r.$shared=!1,i=Ht(i)?i():i;let c=this.createResolver(t,i,a);l=ge(o,i,c)}for(let c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],n){let{resolver:r}=ka(this._resolverCache,t,i);return A(e)?ge(r,e,void 0,n):r}};function ka(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));let n=e.join(),r=i.get(n);return r||(r={resolver:Ci(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,r)),r}var sd=s=>A(s)&&Object.getOwnPropertyNames(s).reduce((t,e)=>t||Ht(s[e]),!1);function id(s,t){let{isScriptable:e,isIndexable:i}=jn(s);for(let n of t){let r=e(n),o=i(n),a=(o||r)&&s[n];if(r&&(Ht(a)||sd(a))||o&&$(a))return!0}return!1}var nd="3.9.1",rd=["top","bottom","left","right","chartArea"];function Ma(s,t){return s==="top"||s==="bottom"||rd.indexOf(s)===-1&&t==="x"}function Ta(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function va(s){let t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),j(e&&e.onComplete,[s],t)}function od(s){let t=s.chart,e=t.options.animation;j(e&&e.onProgress,[s],t)}function nl(s){return qn()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}var ji={},rl=s=>{let t=nl(s);return Object.values(ji).filter(e=>e.canvas===t).pop()};function ad(s,t,e){let i=Object.keys(s);for(let n of i){let r=+n;if(r>=t){let o=s[n];delete s[n],(e>0||r>t)&&(s[r+e]=o)}}}function ld(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}var xe=class{constructor(t,e){let i=this.config=new br(e),n=nl(t),r=rl(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Yu(n)),this.platform.updateConfig(i);let a=this.platform.acquireContext(n,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Mo(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Po(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],ji[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}jt.listen(this,"complete",va),jt.listen(this,"progress",od),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return R(t)?e&&r?r:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Gn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hn(this.canvas,this.ctx),this}stop(){return jt.stop(this),this}resize(t,e){jt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Gn(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),j(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};H(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{}),r=[];e&&(r=r.concat(Object.keys(e).map(o=>{let a=e[o],l=yr(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),H(r,o=>{let a=o.options,l=a.id,c=yr(l,a),h=I(a.type,o.dtype);(a.position===void 0||Ma(a.position,c)!==Ma(o.dposition))&&(a.position=o.dposition),n[l]=!0;let u=null;if(l in i&&i[l].type===h)u=i[l];else{let d=Pt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),H(n,(o,a)=>{o||delete i[a]}),H(i,o=>{lt.configure(this,o,o.options),lt.addBox(this,o)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,r)=>n.index-r.index),i>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ta("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){H(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!vn(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:n,count:r}of e){let o=i==="_removeElements"?-r:r;ad(t,n,o)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),n=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],H(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,r)=>{n._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,n=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(n&&ws(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&Ss(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Ae(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){let r=Ou.modes[e];return typeof r=="function"?r(this,t,i,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,n=i.filter(r=>r&&r._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=$t(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let n=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);ft(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),jt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,r,o),t[r]=o},n=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};H(this.options.events,r=>i(r,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)},o,a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let n=i?"set":"remove",r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!xs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){let n=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;let r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:n=[],options:r}=this,o=e,a=this._getActiveElements(t,n,i,o),l=Oo(t),c=ld(t,this._lastEvent,i,l);i&&(this._lastEvent=null,j(r.onHover,[t,a,this],this),l&&j(r.onClick,[t,a,this],this));let h=!xs(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}},Oa=()=>H(xe.instances,s=>s._plugins.invalidate()),ne=!0;Object.defineProperties(xe,{defaults:{enumerable:ne,value:L},instances:{enumerable:ne,value:ji},overrides:{enumerable:ne,value:Qt},registry:{enumerable:ne,value:Pt},version:{enumerable:ne,value:nd},getChart:{enumerable:ne,value:rl},register:{enumerable:ne,value:(...s)=>{Pt.add(...s),Oa()}},unregister:{enumerable:ne,value:(...s)=>{Pt.remove(...s),Oa()}}});function ol(s,t,e){let{startAngle:i,pixelMargin:n,x:r,y:o,outerRadius:a,innerRadius:l}=t,c=n/a;s.beginPath(),s.arc(r,o,a,i-c,e+c),l>n?(c=n/l,s.arc(r,o,l,e+c,i-c,!0)):s.arc(r,o,n,e+Z,i-Z),s.closePath(),s.clip()}function cd(s){return Ii(s,["outerStart","outerEnd","innerStart","innerEnd"])}function hd(s,t,e,i){let n=cd(s.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{let c=(e-Math.min(r,l))*i/2;return it(l,0,Math.min(r,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:it(n.innerStart,0,o),innerEnd:it(n.innerEnd,0,o)}}function He(s,t,e,i){return{x:e+s*Math.cos(t),y:i+s*Math.sin(t)}}function xr(s,t,e,i,n,r){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+i+e-c,0),d=h>0?h+i+e+c:0,f=0,m=n-l;if(i){let E=h>0?h-i:0,tt=u>0?u-i:0,J=(E+tt)/2,fe=J!==0?m*J/(J+i):m;f=(m-fe)/2}let g=Math.max(.001,m*u-e/Y)/u,p=(m-g)/2,y=l+p+f,b=n-p-f,{outerStart:_,outerEnd:w,innerStart:x,innerEnd:S}=hd(t,d,u,b-y),k=u-_,O=u-w,T=y+_/k,F=b-w/O,W=d+x,P=d+S,Q=y+x/W,ct=b-S/P;if(s.beginPath(),r){if(s.arc(o,a,u,T,F),w>0){let J=He(O,F,o,a);s.arc(J.x,J.y,w,F,b+Z)}let E=He(P,b,o,a);if(s.lineTo(E.x,E.y),S>0){let J=He(P,ct,o,a);s.arc(J.x,J.y,S,b+Z,ct+Math.PI)}if(s.arc(o,a,d,b-S/d,y+x/d,!0),x>0){let J=He(W,Q,o,a);s.arc(J.x,J.y,x,Q+Math.PI,y-Z)}let tt=He(k,y,o,a);if(s.lineTo(tt.x,tt.y),_>0){let J=He(k,T,o,a);s.arc(J.x,J.y,_,y-Z,T)}}else{s.moveTo(o,a);let E=Math.cos(T)*u+o,tt=Math.sin(T)*u+a;s.lineTo(E,tt);let J=Math.cos(F)*u+o,fe=Math.sin(F)*u+a;s.lineTo(J,fe)}s.closePath()}function ud(s,t,e,i,n){let{fullCircles:r,startAngle:o,circumference:a}=t,l=t.endAngle;if(r){xr(s,t,e,i,o+B,n);for(let c=0;c=B||Re(r,a,l),g=At(o,c+d,h+d);return m&&g}getCenterPoint(t){let{x:e,y:i,startAngle:n,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+r)/2,u=(o+a+c+l)/2;return{x:e+Math.cos(h)*u,y:i+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,n=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>B?Math.floor(i/B):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=Y&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=ud(t,this,a,r,o);fd(t,this,a,r,l,o),t.restore()}};Ge.id="arc";Ge.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ge.defaultRoutes={backgroundColor:"backgroundColor"};function al(s,t,e=t){s.lineCap=I(e.borderCapStyle,t.borderCapStyle),s.setLineDash(I(e.borderDash,t.borderDash)),s.lineDashOffset=I(e.borderDashOffset,t.borderDashOffset),s.lineJoin=I(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=I(e.borderWidth,t.borderWidth),s.strokeStyle=I(e.borderColor,t.borderColor)}function md(s,t,e){s.lineTo(e.x,e.y)}function gd(s){return s.stepped?$o:s.tension||s.cubicInterpolationMode==="monotone"?jo:md}function ll(s,t,e={}){let i=s.length,{start:n=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(n,o),c=Math.min(r,a),h=na&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-w:w))%r,_=()=>{g!==p&&(s.lineTo(h,p),s.lineTo(h,g),s.lineTo(h,y))};for(l&&(f=n[b(0)],s.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=n[b(d)],f.skip)continue;let w=f.x,x=f.y,S=w|0;S===m?(xp&&(p=x),h=(u*h+w)/++u):(_(),s.lineTo(w,x),m=S,u=0,g=p=x),y=x}_()}function _r(s){let t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?yd:pd}function bd(s){return s.stepped?Qo:s.tension||s.cubicInterpolationMode==="monotone"?ta:Xt}function xd(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),al(s,t.options),s.stroke(n)}function _d(s,t,e,i){let{segments:n,options:r}=t,o=_r(t);for(let a of n)al(s,r,a.style),s.beginPath(),o(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}var wd=typeof Path2D=="function";function Sd(s,t,e,i){wd&&!t.options.segment?xd(s,t,e,i):_d(s,t,e,i)}var Nt=class extends yt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let n=i.spanGaps?this._loop:this._fullLoop;Xo(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=sa(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,n=t[e],r=this.points,o=tr(this,{property:e,start:n,end:n});if(!o.length)return;let a=[],l=bd(i),c,h;for(c=0,h=o.length;cs!=="borderDash"&&s!=="fill"};function Da(s,t,e,i){let n=s.options,{[e]:r}=s.getProps([e],i);return Math.abs(t-r)=e)return s.slice(t,t+e);let o=[],a=(e-2)/(r-2),l=0,c=t+e-1,h=t,u,d,f,m,g;for(o[l++]=s[h],u=0;uf&&(f=m,d=s[b],g=b);o[l++]=d,h=g}return o[l++]=s[c],o}function Id(s,t,e,i){let n=0,r=0,o,a,l,c,h,u,d,f,m,g,p=[],y=t+e-1,b=s[t].x,w=s[y].x-b;for(o=t;og&&(g=c,d=o),n=(r*n+a.x)/++r;else{let S=o-1;if(!R(u)&&!R(d)){let k=Math.min(u,d),O=Math.max(u,d);k!==f&&k!==S&&p.push({...s[k],x:n}),O!==f&&O!==S&&p.push({...s[O],x:n})}o>0&&S!==f&&p.push(s[S]),p.push(a),h=x,r=0,m=g=c,u=d=f=o}}return p}function hl(s){if(s._decimated){let t=s._data;delete s._decimated,delete s._data,Object.defineProperty(s,"data",{value:t})}}function Ea(s){s.data.datasets.forEach(t=>{hl(t)})}function Cd(s,t){let e=t.length,i=0,n,{iScale:r}=s,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=it(Ct(t,r.axis,o).lo,0,e-1)),c?n=it(Ct(t,r.axis,a).hi+1,i,e)-i:n=e-i,{start:i,count:n}}var Fd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(s,t,e)=>{if(!e.enabled){Ea(s);return}let i=s.width;s.data.datasets.forEach((n,r)=>{let{_data:o,indexAxis:a}=n,l=s.getDatasetMeta(r),c=o||n.data;if(ze([a,s.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=s.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||s.options.parsing)return;let{start:u,count:d}=Cd(l,c),f=e.threshold||4*i;if(d<=f){hl(n);return}R(o)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=Ed(c,u,d,i,e);break;case"min-max":m=Id(c,u,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=m})},destroy(s){Ea(s)}};function Ad(s,t,e){let i=s.segments,n=s.points,r=t.points,o=[];for(let a of i){let{start:l,end:c}=a;c=Mr(l,c,n);let h=wr(e,n[l],n[c],a.loop);if(!t.segments){o.push({source:a,target:h,start:n[l],end:n[c]});continue}let u=tr(t,h);for(let d of u){let f=wr(e,r[d.start],r[d.end],d.loop),m=Qn(a,n,f);for(let g of m)o.push({source:g,target:d,start:{[e]:Ia(h,f,"start",Math.max)},end:{[e]:Ia(h,f,"end",Math.min)}})}}return o}function wr(s,t,e,i){if(i)return;let n=t[s],r=e[s];return s==="angle"&&(n=ht(n),r=ht(r)),{property:s,start:n,end:r}}function Ld(s,t){let{x:e=null,y:i=null}=s||{},n=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Mr(o,a,n);let l=n[o],c=n[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Mr(s,t,e){for(;t>s;t--){let i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Ia(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function ul(s,t){let e=[],i=!1;return $(s)?(i=!0,e=s):e=Ld(s,t),e.length?new Nt({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ca(s){return s&&s.fill!==!1}function Pd(s,t,e){let n=s[t].fill,r=[t],o;if(!e)return n;for(;n!==!1&&r.indexOf(n)===-1;){if(!K(n))return n;if(o=s[n],!o)return!1;if(o.visible)return n;r.push(n),n=o.fill}return!1}function Nd(s,t,e){let i=Vd(s);if(A(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return K(n)&&Math.floor(n)===n?Rd(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Rd(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Wd(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:A(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function zd(s,t,e){let i;return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:A(s)?i=s.value:i=t.getBaseValue(),i}function Vd(s){let t=s.options,e=t.fill,i=I(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Hd(s){let{scale:t,index:e,line:i}=s,n=[],r=i.segments,o=i.points,a=Bd(t,e);a.push(ul({x:null,y:t.bottom},i));for(let l=0;l=0;--o){let a=n[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&cr(s.ctx,a,r))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){let r=i[n].$filler;Ca(r)&&cr(s.ctx,r,s.chartArea)}},beforeDatasetDraw(s,t,e){let i=t.meta.$filler;!Ca(i)||e.drawTime!=="beforeDatasetDraw"||cr(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Pa=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Qd=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index,Yi=class extends yt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=j(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,n=et(i.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Pa(i,r),c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a,u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((m,g)=>{let p=i+e/2+r.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>o)&&(u+=h,c[c.length-(g>0?0:1)]=0,f+=h,d++),l[g]={left:0,top:f,row:d,width:p,height:n},c[c.length-1]+=p+a}),u}_fitCols(t,e,i,n){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t,u=a,d=0,f=0,m=0,g=0;return this.legendItems.forEach((p,y)=>{let b=i+e/2+r.measureText(p.text).width;y>0&&f+n+2*a>h&&(u+=d+a,c.push({width:d,height:f}),m+=d+a,g++,d=f=0),l[y]={left:m,top:f,col:g,width:b,height:n},d=Math.max(d,b),f+=n+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,o=ye(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ot(i,this.left+n,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=ot(i,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+n}else{let a=0,l=ot(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=ot(i,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;ws(t,this),this._draw(),Ss(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:o}=t,a=L.color,l=ye(t.rtl,this.left,this.width),c=et(o.font),{color:h,padding:u}=o,d=c.size,f=d/2,m;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:y}=Pa(o,d),b=function(k,O,T){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;n.save();let F=I(T.lineWidth,1);if(n.fillStyle=I(T.fillStyle,a),n.lineCap=I(T.lineCap,"butt"),n.lineDashOffset=I(T.lineDashOffset,0),n.lineJoin=I(T.lineJoin,"miter"),n.lineWidth=F,n.strokeStyle=I(T.strokeStyle,a),n.setLineDash(I(T.lineDash,[])),o.usePointStyle){let W={radius:p*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:F},P=l.xPlus(k,g/2),Q=O+f;Bn(n,W,P,Q,o.pointStyleWidth&&g)}else{let W=O+Math.max((d-p)/2,0),P=l.leftForLtr(k,g),Q=se(T.borderRadius);n.beginPath(),Object.values(Q).some(ct=>ct!==0)?We(n,{x:P,y:W,w:g,h:p,radius:Q}):n.rect(P,W,g,p),n.fill(),F!==0&&n.stroke()}n.restore()},_=function(k,O,T){ee(n,T.text,k,O+y/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?m={x:ot(r,this.left+u,this.right-i[0]),y:this.top+u+x,line:0}:m={x:this.left+u,y:ot(r,this.top+x+u,this.bottom-e[0].height),line:0},Kn(this.ctx,t.textDirection);let S=y+u;this.legendItems.forEach((k,O)=>{n.strokeStyle=k.fontColor||h,n.fillStyle=k.fontColor||h;let T=n.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),W=g+f+T,P=m.x,Q=m.y;l.setWidth(this.width),w?O>0&&P+W+u>this.right&&(Q=m.y+=S,m.line++,P=m.x=ot(r,this.left+u,this.right-i[m.line])):O>0&&Q+S>this.bottom&&(P=m.x=P+e[m.line].width+u,m.line++,Q=m.y=ot(r,this.top+x+u,this.bottom-e[m.line].height));let ct=l.x(P);b(ct,Q,k),P=No(F,P+g+f,w?P+W:this.right,t.rtl),_(l.x(P),Q,k),w?m.x+=W+u:m.y+=S}),Jn(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,i=et(e.font),n=at(e.padding);if(!e.display)return;let r=ye(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=n.top+l,h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=ot(t.align,u,this.right-d);else{let m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+ot(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}let f=ot(a,u,u+d);o.textAlign=r.textAlign(Oi(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ee(o,e.text,f,h,i)}_computeTitleHeight(){let t=this.options.title,e=et(t.font),i=at(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(At(t,this.left,this.right)&&At(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;is.chart.options.color,boxWidth:40,padding:10,generateLabels(s){let t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:r}}=s.legend.options;return s._getSortedDatasetMetas().map(o=>{let a=o.controller.getStyle(e?0:void 0),l=at(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}},As=class extends yt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let n=$(i.text)?i.text.length:1;this._padding=at(i.padding);let r=n*et(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:i,bottom:n,right:r,options:o}=this,a=o.align,l=0,c,h,u;return this.isHorizontal()?(h=ot(a,i,r),u=e+t,c=r-i):(o.position==="left"?(h=i+t,u=ot(a,n,e),l=Y*-.5):(h=r-t,u=ot(a,e,n),l=Y*.5),c=n-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=et(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);ee(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Oi(e.align),textBaseline:"middle",translation:[o,a]})}};function sf(s,t){let e=new As({ctx:s.ctx,options:t,chart:s});lt.configure(s,e,t),lt.addBox(s,e),s.titleBlock=e}var nf={id:"title",_element:As,start(s,t,e){sf(s,e)},stop(s){let t=s.titleBlock;lt.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){let i=s.titleBlock;lt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Ri=new WeakMap,rf={id:"subtitle",start(s,t,e){let i=new As({ctx:s.ctx,options:e,chart:s});lt.configure(s,i,e),lt.addBox(s,i),Ri.set(s,i)},stop(s){lt.removeBox(s,Ri.get(s)),Ri.delete(s)},beforeUpdate(s,t,e){let i=Ri.get(s);lt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Es={average(s){if(!s.length)return!1;let t,e,i=0,n=0,r=0;for(t=0,e=s.length;t"u"}function $(s){if(Array.isArray&&Array.isArray(s))return!0;let t=Object.prototype.toString.call(s);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function A(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}var K=s=>(typeof s=="number"||s instanceof Number)&&isFinite(+s);function mt(s,t){return K(s)?s:t}function C(s,t){return typeof s>"u"?t:s}var Eo=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:s/t,En=(s,t)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*t:+s;function j(s,t,e){if(s&&typeof s.call=="function")return s.apply(e,t)}function H(s,t,e,i){let n,r,o;if($(s))if(r=s.length,i)for(n=r-1;n>=0;n--)t.call(e,s[n],n);else for(n=0;ns,x:s=>s.x,y:s=>s.y};function Bt(s,t){return(mo[t]||(mo[t]=Cc(t)))(s)}function Cc(s){let t=Ic(s);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function Ic(s){let t=s.split("."),e=[],i="";for(let n of t)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Oi(s){return s.charAt(0).toUpperCase()+s.slice(1)}var ft=s=>typeof s<"u",Ht=s=>typeof s=="function",Cn=(s,t)=>{if(s.size!==t.size)return!1;for(let e of s)if(!t.has(e))return!1;return!0};function Io(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}var Y=Math.PI,B=2*Y,Fc=B+Y,Mi=Number.POSITIVE_INFINITY,Ac=Y/180,Z=Y/2,ys=Y/4,go=Y*2/3,gt=Math.log10,Tt=Math.sign;function In(s){let t=Math.round(s);s=Re(s,t,s/1e3)?t:s;let e=Math.pow(10,Math.floor(gt(s))),i=s/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Fo(s){let t=[],e=Math.sqrt(s),i;for(i=1;in-r).pop(),t}function pe(s){return!isNaN(parseFloat(s))&&isFinite(s)}function Re(s,t,e){return Math.abs(s-t)=s}function Fn(s,t,e){let i,n,r;for(i=0,n=s.length;il&&c=Math.min(t,e)-i&&s<=Math.max(t,e)+i}function Ei(s,t,e){e=e||(o=>s[o]1;)r=n+i>>1,e(r)?n=r:i=r;return{lo:n,hi:i}}var Ft=(s,t,e,i)=>Ei(s,e,i?n=>s[n][t]<=e:n=>s[n][t]Ei(s,e,i=>s[i][t]>=e);function Ro(s,t,e){let i=0,n=s.length;for(;ii&&s[n-1]>e;)n--;return i>0||n{let i="_onData"+Oi(e),n=s[e];Object.defineProperty(s,e,{configurable:!0,enumerable:!1,value(...r){let o=n.apply(this,r);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Pn(s,t){let e=s._chartjs;if(!e)return;let i=e.listeners,n=i.indexOf(t);n!==-1&&i.splice(n,1),!(i.length>0)&&(No.forEach(r=>{delete s[r]}),delete s._chartjs)}function Rn(s){let t=new Set,e,i;for(e=0,i=s.length;e"u"?function(s){return s()}:window.requestAnimationFrame}();function Wn(s,t,e){let i=e||(o=>Array.prototype.slice.call(o)),n=!1,r=[];return function(...o){r=i(o),n||(n=!0,Nn.call(window,()=>{n=!1,s.apply(t,r)}))}}function zo(s,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(s,t,i)):s.apply(this,i),t}}var Ci=s=>s==="start"?"left":s==="end"?"right":"center",ot=(s,t,e)=>s==="start"?t:s==="end"?e:(t+e)/2,Vo=(s,t,e,i)=>s===(i?"left":"right")?e:s==="center"?(t+e)/2:t;function zn(s,t,e){let i=t.length,n=0,r=i;if(s._sorted){let{iScale:o,_parsed:a}=s,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(n=it(Math.min(Ft(a,o.axis,c).lo,e?i:Ft(t,l,o.getPixelForValue(c)).lo),0,i-1)),d?r=it(Math.max(Ft(a,o.axis,h,!0).hi+1,e?0:Ft(t,l,o.getPixelForValue(h),!0).hi+1),n,i)-n:r=i-n}return{start:n,count:r}}function Vn(s){let{xScale:t,yScale:e,_scaleRanges:i}=s,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return s._scaleRanges=n,!0;let r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,n),r}var bi=s=>s===0||s===1,po=(s,t,e)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-t)*B/e)),yo=(s,t,e)=>Math.pow(2,-10*s)*Math.sin((s-t)*B/e)+1,Ce={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*Z)+1,easeOutSine:s=>Math.sin(s*Z),easeInOutSine:s=>-.5*(Math.cos(Y*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>bi(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>bi(s)?s:po(s,.075,.3),easeOutElastic:s=>bi(s)?s:yo(s,.075,.3),easeInOutElastic(s){return bi(s)?s:s<.5?.5*po(s*2,.1125,.45):.5+.5*yo(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let t=1.70158;return(s/=.5)<1?.5*(s*s*(((t*=1.525)+1)*s-t)):.5*((s-=2)*s*(((t*=1.525)+1)*s+t)+2)},easeInBounce:s=>1-Ce.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?Ce.easeInBounce(s*2)*.5:Ce.easeOutBounce(s*2-1)*.5+.5};function Ss(s){return s+.5|0}var Kt=(s,t,e)=>Math.max(Math.min(s,e),t);function bs(s){return Kt(Ss(s*2.55),0,255)}function Jt(s){return Kt(Ss(s*255),0,255)}function Vt(s){return Kt(Ss(s/2.55)/100,0,1)}function bo(s){return Kt(Ss(s*100),0,100)}var _t={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},On=[..."0123456789ABCDEF"],Pc=s=>On[s&15],Rc=s=>On[(s&240)>>4]+On[s&15],xi=s=>(s&240)>>4===(s&15),Nc=s=>xi(s.r)&&xi(s.g)&&xi(s.b)&&xi(s.a);function Wc(s){var t=s.length,e;return s[0]==="#"&&(t===4||t===5?e={r:255&_t[s[1]]*17,g:255&_t[s[2]]*17,b:255&_t[s[3]]*17,a:t===5?_t[s[4]]*17:255}:(t===7||t===9)&&(e={r:_t[s[1]]<<4|_t[s[2]],g:_t[s[3]]<<4|_t[s[4]],b:_t[s[5]]<<4|_t[s[6]],a:t===9?_t[s[7]]<<4|_t[s[8]]:255})),e}var zc=(s,t)=>s<255?t(s):"";function Vc(s){var t=Nc(s)?Pc:Rc;return s?"#"+t(s.r)+t(s.g)+t(s.b)+zc(s.a,t):void 0}var Hc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ho(s,t,e){let i=t*Math.min(e,1-e),n=(r,o=(r+s/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function Bc(s,t,e){let i=(n,r=(n+s/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function $c(s,t,e){let i=Ho(s,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)i[n]*=1-t-e,i[n]+=t;return i}function jc(s,t,e,i,n){return s===n?(t-e)/i+(t.5?h/(2-r-o):h/(r+o),l=jc(e,i,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Bn(s,t,e,i){return(Array.isArray(t)?s(t[0],t[1],t[2]):s(t,e,i)).map(Jt)}function $n(s,t,e){return Bn(Ho,s,t,e)}function Uc(s,t,e){return Bn($c,s,t,e)}function Yc(s,t,e){return Bn(Bc,s,t,e)}function Bo(s){return(s%360+360)%360}function Zc(s){let t=Hc.exec(s),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?bs(+t[5]):Jt(+t[5]));let n=Bo(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Uc(n,r,o):t[1]==="hsv"?i=Yc(n,r,o):i=$n(n,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function qc(s,t){var e=Hn(s);e[0]=Bo(e[0]+t),e=$n(e),s.r=e[0],s.g=e[1],s.b=e[2]}function Gc(s){if(!s)return;let t=Hn(s),e=t[0],i=bo(t[1]),n=bo(t[2]);return s.a<255?`hsla(${e}, ${i}%, ${n}%, ${Vt(s.a)})`:`hsl(${e}, ${i}%, ${n}%)`}var xo={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},_o={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Xc(){let s={},t=Object.keys(_o),e=Object.keys(xo),i,n,r,o,a;for(i=0;i>16&255,r>>8&255,r&255]}return s}var _i;function Kc(s){_i||(_i=Xc(),_i.transparent=[0,0,0,0]);let t=_i[s.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Jc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Qc(s){let t=Jc.exec(s),e=255,i,n,r;if(t){if(t[7]!==i){let o=+t[7];e=t[8]?bs(o):Kt(o*255,0,255)}return i=+t[1],n=+t[3],r=+t[5],i=255&(t[2]?bs(i):Kt(i,0,255)),n=255&(t[4]?bs(n):Kt(n,0,255)),r=255&(t[6]?bs(r):Kt(r,0,255)),{r:i,g:n,b:r,a:e}}}function th(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${Vt(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}var kn=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,Ee=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function eh(s,t,e){let i=Ee(Vt(s.r)),n=Ee(Vt(s.g)),r=Ee(Vt(s.b));return{r:Jt(kn(i+e*(Ee(Vt(t.r))-i))),g:Jt(kn(n+e*(Ee(Vt(t.g))-n))),b:Jt(kn(r+e*(Ee(Vt(t.b))-r))),a:s.a+e*(t.a-s.a)}}function wi(s,t,e){if(s){let i=Hn(s);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=$n(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function $o(s,t){return s&&Object.assign(t||{},s)}function wo(s){var t={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(t={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(t.a=Jt(s[3]))):(t=$o(s,{r:0,g:0,b:0,a:1}),t.a=Jt(t.a)),t}function sh(s){return s.charAt(0)==="r"?Qc(s):Zc(s)}var Fe=class{constructor(t){if(t instanceof Fe)return t;let e=typeof t,i;e==="object"?i=wo(t):e==="string"&&(i=Wc(t)||Kc(t)||sh(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=$o(this._rgb);return t&&(t.a=Vt(t.a)),t}set rgb(t){this._rgb=wo(t)}rgbString(){return this._valid?th(this._rgb):void 0}hexString(){return this._valid?Vc(this._rgb):void 0}hslString(){return this._valid?Gc(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,n=t.rgb,r,o=e===r?.5:e,a=2*o-1,l=i.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*n.r+.5,i.g=255&c*i.g+r*n.g+.5,i.b=255&c*i.b+r*n.b+.5,i.a=o*i.a+(1-o)*n.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=eh(this._rgb,t._rgb,e)),this}clone(){return new Fe(this.rgb)}alpha(t){return this._rgb.a=Jt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=Ss(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return wi(this._rgb,2,t),this}darken(t){return wi(this._rgb,2,-t),this}saturate(t){return wi(this._rgb,1,t),this}desaturate(t){return wi(this._rgb,1,-t),this}rotate(t){return qc(this._rgb,t),this}};function jo(s){return new Fe(s)}function Uo(s){if(s&&typeof s=="object"){let t=s.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function jn(s){return Uo(s)?s:jo(s)}function Mn(s){return Uo(s)?s:jo(s).saturate(.5).darken(.1).hexString()}var Qt=Object.create(null),Ii=Object.create(null);function xs(s,t){if(!t)return s;let e=t.split(".");for(let i=0,n=e.length;ie.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,i)=>Mn(i.backgroundColor),this.hoverBorderColor=(e,i)=>Mn(i.borderColor),this.hoverColor=(e,i)=>Mn(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Tn(this,t,e)}get(t){return xs(this,t)}describe(t,e){return Tn(Ii,t,e)}override(t,e){return Tn(Qt,t,e)}route(t,e,i,n){let r=xs(this,t),o=xs(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=o[n];return A(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}},L=new Dn({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ih(s){return!s||N(s.size)||N(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function _s(s,t,e,i,n){let r=t[n];return r||(r=t[n]=s.measureText(n).width,e.push(n)),r>i&&(i=r),i}function Yo(s,t,e,i){i=i||{};let n=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(n=i.data={},r=i.garbageCollect=[],i.font=t),s.save(),s.font=t;let o=0,a=e.length,l,c,h,u,d;for(l=0;le.length){for(l=0;l0&&s.stroke()}}function Ae(s,t,e){return e=e||.5,!t||s&&s.x>t.left-e&&s.xt.top-e&&s.y0&&r.strokeColor!=="",l,c;for(s.save(),s.font=n.string,nh(s,r),l=0;l+s||0;function Ai(s,t){let e={},i=A(t),n=i?Object.keys(t):t,r=A(s)?i?o=>C(s[o],s[t[o]]):o=>s[o]:()=>s;for(let o of n)e[o]=ch(r(o));return e}function Zn(s){return Ai(s,{top:"y",right:"x",bottom:"y",left:"x"})}function se(s){return Ai(s,["topLeft","topRight","bottomLeft","bottomRight"])}function at(s){let t=Zn(s);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function st(s,t){s=s||{},t=t||L.font;let e=C(s.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=C(s.style,t.style);i&&!(""+i).match(ah)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");let n={family:C(s.family,t.family),lineHeight:lh(C(s.lineHeight,t.lineHeight),e),size:e,style:i,weight:C(s.weight,t.weight),string:""};return n.string=ih(n),n}function ze(s,t,e,i){let n=!0,r,o,a;for(r=0,o=s.length;re&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(n,r)}}function $t(s,t){return Object.assign(Object.create(s),t)}function Li(s,t=[""],e=s,i,n=()=>s[0]){ft(i)||(i=Jo("_fallback",s));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:e,_fallback:i,_getTarget:n,override:o=>Li([o,...s],t,e,i)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete s[0][a],!0},get(o,a){return Xo(o,a,()=>yh(a,t,s,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(o,a){return ko(o).includes(a)},ownKeys(o){return ko(o)},set(o,a,l){let c=o._storage||(o._storage=n());return o[a]=c[a]=l,delete o._keys,!0}})}function ge(s,t,e,i){let n={_cacheable:!1,_proxy:s,_context:t,_subProxy:e,_stack:new Set,_descriptors:qn(s,i),setContext:r=>ge(s,r,e,i),override:r=>ge(s.override(r),t,e,i)};return new Proxy(n,{deleteProperty(r,o){return delete r[o],delete s[o],!0},get(r,o,a){return Xo(r,o,()=>uh(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(s,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,o)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(r,o){return Reflect.has(s,o)},ownKeys(){return Reflect.ownKeys(s)},set(r,o,a){return s[o]=a,delete r[o],!0}})}function qn(s,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:n=t.allKeys}=s;return{allKeys:n,scriptable:e,indexable:i,isScriptable:Ht(e)?e:()=>e,isIndexable:Ht(i)?i:()=>i}}var hh=(s,t)=>s?s+Oi(t):t,Gn=(s,t)=>A(t)&&s!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Xo(s,t,e){if(Object.prototype.hasOwnProperty.call(s,t))return s[t];let i=e();return s[t]=i,i}function uh(s,t,e){let{_proxy:i,_context:n,_subProxy:r,_descriptors:o}=s,a=i[t];return Ht(a)&&o.isScriptable(t)&&(a=dh(t,a,s,e)),$(a)&&a.length&&(a=fh(t,a,s,o.isIndexable)),Gn(t,a)&&(a=ge(a,n,r&&r[t],o)),a}function dh(s,t,e,i){let{_proxy:n,_context:r,_subProxy:o,_stack:a}=e;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);return a.add(s),t=t(r,o||i),a.delete(s),Gn(s,t)&&(t=Xn(n._scopes,n,s,t)),t}function fh(s,t,e,i){let{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=e;if(ft(r.index)&&i(s))t=t[r.index%t.length];else if(A(t[0])){let l=t,c=n._scopes.filter(h=>h!==l);t=[];for(let h of l){let u=Xn(c,n,s,h);t.push(ge(u,r,o&&o[s],a))}}return t}function Ko(s,t,e){return Ht(s)?s(t,e):s}var mh=(s,t)=>s===!0?t:typeof s=="string"?Bt(t,s):void 0;function gh(s,t,e,i,n){for(let r of t){let o=mh(e,r);if(o){s.add(o);let a=Ko(o._fallback,e,n);if(ft(a)&&a!==e&&a!==i)return a}else if(o===!1&&ft(i)&&e!==i)return null}return!1}function Xn(s,t,e,i){let n=t._rootScopes,r=Ko(t._fallback,e,i),o=[...s,...n],a=new Set;a.add(i);let l=So(a,o,e,r||e,i);return l===null||ft(r)&&r!==e&&(l=So(a,o,r,l,i),l===null)?!1:Li(Array.from(a),[""],n,r,()=>ph(t,e,i))}function So(s,t,e,i,n){for(;e;)e=gh(s,t,e,i,n);return e}function ph(s,t,e){let i=s._getTarget();t in i||(i[t]={});let n=i[t];return $(n)&&A(e)?e:n}function yh(s,t,e,i){let n;for(let r of t)if(n=Jo(hh(r,s),e),ft(n))return Gn(s,n)?Xn(e,i,s,n):n}function Jo(s,t){for(let e of t){if(!e)continue;let i=e[s];if(ft(i))return i}}function ko(s){let t=s._keys;return t||(t=s._keys=bh(s._scopes)),t}function bh(s){let t=new Set;for(let e of s)for(let i of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(i);return Array.from(t)}function Kn(s,t,e,i){let{iScale:n}=s,{key:r="r"}=this._parsing,o=new Array(i),a,l,c,h;for(a=0,l=i;ats==="x"?"y":"x";function _h(s,t,e,i){let n=s.skip?t:s,r=t,o=e.skip?t:e,a=Ti(r,n),l=Ti(o,r),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let u=i*c,d=i*h;return{previous:{x:r.x-u*(o.x-n.x),y:r.y-u*(o.y-n.y)},next:{x:r.x+d*(o.x-n.x),y:r.y+d*(o.y-n.y)}}}function wh(s,t,e){let i=s.length,n,r,o,a,l,c=Le(s,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")kh(s,n);else{let c=i?s[s.length-1]:s[0];for(r=0,o=s.length;rwindow.getComputedStyle(s,null);function Th(s,t){return Ri(s).getPropertyValue(t)}var vh=["top","right","bottom","left"];function me(s,t,e){let i={};e=e?"-"+e:"";for(let n=0;n<4;n++){let r=vh[n];i[r]=parseFloat(s[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var Oh=(s,t,e)=>(s>0||t>0)&&(!e||!e.shadowRoot);function Dh(s,t){let e=s.touches,i=e&&e.length?e[0]:s,{offsetX:n,offsetY:r}=i,o=!1,a,l;if(Oh(n,r,s.target))a=n,l=r;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function ie(s,t){if("native"in s)return s;let{canvas:e,currentDevicePixelRatio:i}=t,n=Ri(e),r=n.boxSizing==="border-box",o=me(n,"padding"),a=me(n,"border","width"),{x:l,y:c,box:h}=Dh(s,e),u=o.left+(h&&a.left),d=o.top+(h&&a.top),{width:f,height:m}=t;return r&&(f-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-u)/f*e.width/i),y:Math.round((c-d)/m*e.height/i)}}function Eh(s,t,e){let i,n;if(t===void 0||e===void 0){let r=Pi(s);if(!r)t=s.clientWidth,e=s.clientHeight;else{let o=r.getBoundingClientRect(),a=Ri(r),l=me(a,"border","width"),c=me(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=vi(a.maxWidth,r,"clientWidth"),n=vi(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Mi,maxHeight:n||Mi}}var vn=s=>Math.round(s*10)/10;function ea(s,t,e,i){let n=Ri(s),r=me(n,"margin"),o=vi(n.maxWidth,s,"clientWidth")||Mi,a=vi(n.maxHeight,s,"clientHeight")||Mi,l=Eh(s,t,e),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let u=me(n,"border","width"),d=me(n,"padding");c-=d.width+u.width,h-=d.height+u.height}return c=Math.max(0,c-r.width),h=Math.max(0,i?Math.floor(c/i):h-r.height),c=vn(Math.min(c,o,l.maxWidth)),h=vn(Math.min(h,a,l.maxHeight)),c&&!h&&(h=vn(c/2)),{width:c,height:h}}function Qn(s,t,e){let i=t||1,n=Math.floor(s.height*i),r=Math.floor(s.width*i);s.height=n/i,s.width=r/i;let o=s.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${s.height}px`,o.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||o.height!==n||o.width!==r?(s.currentDevicePixelRatio=i,o.height=n,o.width=r,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}var sa=function(){let s=!1;try{let t={get passive(){return s=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return s}();function tr(s,t){let e=Th(s,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Xt(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:s.y+e*(t.y-s.y)}}function ia(s,t,e,i){return{x:s.x+e*(t.x-s.x),y:i==="middle"?e<.5?s.y:t.y:i==="after"?e<1?s.y:t.y:e>0?t.y:s.y}}function na(s,t,e,i){let n={x:s.cp2x,y:s.cp2y},r={x:t.cp1x,y:t.cp1y},o=Xt(s,n,e),a=Xt(n,r,e),l=Xt(r,t,e),c=Xt(o,a,e),h=Xt(a,l,e);return Xt(c,h,e)}var Mo=new Map;function Ch(s,t){t=t||{};let e=s+JSON.stringify(t),i=Mo.get(e);return i||(i=new Intl.NumberFormat(s,t),Mo.set(e,i)),i}function Ve(s,t,e){return Ch(t,e).format(s)}var Ih=function(s,t){return{x(e){return s+s+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Fh=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,t){return s+t},leftForLtr(s,t){return s}}};function ye(s,t,e){return s?Ih(t,e):Fh()}function er(s,t){let e,i;(t==="ltr"||t==="rtl")&&(e=s.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),s.prevTextDirection=i)}function sr(s,t){t!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",t[0],t[1]))}function ra(s){return s==="angle"?{between:Ne,compare:Lc,normalize:ht}:{between:Lt,compare:(t,e)=>t-e,normalize:t=>t}}function To({start:s,end:t,count:e,loop:i,style:n}){return{start:s%e,end:t%e,loop:i&&(t-s+1)%e===0,style:n}}function Ah(s,t,e){let{property:i,start:n,end:r}=e,{between:o,normalize:a}=ra(i),l=t.length,{start:c,end:h,loop:u}=s,d,f;if(u){for(c+=l,h+=l,d=0,f=l;dl(n,_,y)&&a(n,_)!==0,x=()=>a(r,y)===0||l(r,_,y),S=()=>g||w(),k=()=>!g||x();for(let O=h,v=h;O<=u;++O)b=t[O%o],!b.skip&&(y=c(b[i]),y!==_&&(g=l(y,n,r),p===null&&S()&&(p=a(y,n)===0?O:v),p!==null&&k()&&(m.push(To({start:p,end:O,loop:d,count:o,style:f})),p=null),v=O,_=y));return p!==null&&m.push(To({start:p,end:u,loop:d,count:o,style:f})),m}function nr(s,t){let e=[],i=s.segments;for(let n=0;nn&&s[r%t].skip;)r--;return r%=t,{start:n,end:r}}function Ph(s,t,e,i){let n=s.length,r=[],o=t,a=s[t],l;for(l=t+1;l<=e;++l){let c=s[l%n];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%n,end:(l-1)%n,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%n,end:o%n,loop:i}),r}function oa(s,t){let e=s.points,i=s.options.spanGaps,n=e.length;if(!n)return[];let r=!!s._loop,{start:o,end:a}=Lh(e,n,r,i);if(i===!0)return vo(s,[{start:o,end:a,loop:r}],e,t);let l=aa({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Nn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;let r=i.items,o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),r.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},jt=new mr,aa="transparent",Wh={boolean(s,t,e){return e>.5?t:s},color(s,t,e){let i=jn(s||aa),n=i.valid&&jn(t||aa);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}},gr=class{constructor(t,e,i,n){let r=e[i];n=ze([t.to,n,r,t.from]);let o=ze([t.from,r,n]);this._active=!0,this._fn=t.fn||Wh[t.type||typeof o],this._easing=Ce[t.easing]||Ce.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let n=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ze([t.to,e,n,t.from]),this._from=ze([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,n=this._prop,r=this._from,o=this._loop,a=this._to,l;if(this._active=r!==a&&(o||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(r,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let n=0;ns!=="onProgress"&&s!=="onComplete"&&s!=="fn"});L.set("animations",{colors:{type:"color",properties:Vh},numbers:{type:"number",properties:zh}});L.describe("animations",{_fallback:"animation"});L.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:s=>s|0}}}});var ji=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!A(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{let n=t[i];if(!A(n))return;let r={};for(let o of Hh)r[o]=n[o];($(n.properties)&&n.properties||[i]).forEach(o=>{(o===i||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){let i=e.options,n=$h(t,i);if(!n)return[];let r=this._createAnimations(n,i);return i.$shared&&Bh(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){let i=this._properties,n=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}let h=e[c],u=r[c],d=i.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}r[c]=u=new gr(d,t,c,h),n.push(u)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return jt.add(this._chart,i),!0}};function Bh(s,t){let e=[],i=Object.keys(t);for(let n=0;n0||!e&&r<0)return n.index}return null}function da(s,t){let{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,h=Zh(r,o,i),u=t.length,d;for(let f=0;fe[i].axis===t).shift()}function Xh(s,t){return $t(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Kh(s,t,e){return $t(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ts(s,t){let e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(let n of t){let r=n._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e]}}}var or=s=>s==="reset"||s==="none",fa=(s,t)=>t?s:Object.assign({},s),Jh=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:Ja(e,!0),values:null},pt=class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ha(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ts(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(u,d,f,m)=>u==="x"?d:u==="r"?m:f,r=e.xAxisID=C(i.xAxisID,rr(t,"x")),o=e.yAxisID=C(i.yAxisID,rr(t,"y")),a=e.rAxisID=C(i.rAxisID,rr(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,r,o,a),h=e.vAxisID=n(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Pn(this._data,this),t._stacked&&Ts(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(A(e))this._data=Yh(e);else if(i!==e){if(i){Pn(i,this);let n=this._cachedMeta;Ts(n),n._parsed=[]}e&&Object.isExtensible(e)&&Wo(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();let r=e._stacked;e._stacked=ha(e.vScale,e),e.stack!==i.stack&&(n=!0,Ts(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&da(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:i,_data:n}=this,{iScale:r,_stacked:o}=i,a=r.axis,l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,u,d;if(this._parsing===!1)i._parsed=n,i._sorted=!0,d=n;else{$(n[t])?d=this.parseArrayData(i,n,t,e):A(n[t])?d=this.parseObjectData(i,n,t,e):d=this.parsePrimitiveData(i,n,t,e);let f=()=>u[a]===null||c&&u[a]g||u=0;--d)if(!m()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],n,r,o;for(n=0,r=e.length;n=0&&tthis.getContext(i,n),g=c.resolveNamedOptions(d,f,m,u);return g.$shared&&(g.$shared=l,r[o]=Object.freeze(fa(g,l))),g}_resolveAnimations(t,e,i){let n=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(n.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,i,e))}let c=new ji(n,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||or(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,n){or(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!or(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;let r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let n=i.length,r=e.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;an-r))}return s._cache.$bar}function tu(s){let t=s.iScale,e=Qh(t,s.type),i=t._length,n,r,o,a,l=()=>{o===32767||o===-32768||(ft(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(n=0,r=e.length;n0?n[s-1]:null,a=sMath.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:r,min:o,max:a}}function Qa(s,t,e,i){return $(s)?iu(s,t,e,i):t[e.axis]=e.parse(s,i),t}function ma(s,t,e,i){let n=s.iScale,r=s.vScale,o=n.getLabels(),a=n===r,l=[],c,h,u,d;for(c=e,h=e+i;c=e?1:-1)}function ru(s){let t,e,i,n,r;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{let c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(N(h)||isNaN(h))return!0};for(let l of n)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let n=this._getStacks(t,i),r=e!==void 0?n.indexOf(e):-1;return r===-1?n.length-1:r}_getRuler(){let t=this.options,e=this._cachedMeta,i=e.iScale,n=[],r,o;for(r=0,o=e.data.length;r=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:i,yScale:n}=e,r=this.getParsed(t),o=i.getLabelForValue(r.x),a=n.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,n){let r=n==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=o.axis,u=a.axis;for(let d=e;dNe(_,a,l,!0)?1:Math.max(w,w*e,x,x*e),m=(_,w,x)=>Ne(_,a,l,!0)?-1:Math.min(w,w*e,x,x*e),g=f(0,c,u),p=f(Z,h,d),y=m(Y,c,u),b=m(Y+Z,h,d);i=(g-y)/2,n=(p-b)/2,r=-(g+y)/2,o=-(p+b)/2}return{ratioX:i,ratioY:n,offsetX:r,offsetY:o}}var oe=class extends pt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let r=l=>+i[l];if(A(i[t])){let{key:l="value"}=this._parsing;r=c=>+Bt(i[c],l)}let o,a;for(o=t,a=t+e;o0&&!isNaN(t)?B*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=Ve(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0,i=this.chart,n,r,o,a,l;if(!t){for(n=0,r=i.data.datasets.length;ns!=="spacing",_indexable:s=>s!=="spacing"};oe.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){let t=s.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=s.legend.options;return t.labels.map((i,n)=>{let o=s.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(n),index:n}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(s){let t=s.label,e=": "+s.formattedValue;return $(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};var Ue=class extends pt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:n=[],_dataset:r}=e,o=this.chart._animationsDisabled,{start:a,count:l}=zn(e,n,o);this._drawStart=a,this._drawCount=l,Vn(e)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=n;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,i,n){let r=n==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,n),d=o.axis,f=a.axis,{spanGaps:m,segment:g}=this.options,p=pe(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||n==="none",b=e>0&&this.getParsed(e-1);for(let _=e;_0&&Math.abs(x[d]-b[d])>p,g&&(S.parsed=x,S.raw=c.data[_]),u&&(S.options=h||this.resolveDataElementOptions(_,w.active?"active":n)),y||this.updateElement(w,_,S,n),b=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;let r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};Ue.id="line";Ue.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Ue.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Ye=class extends pt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=Ve(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,i,n){return Kn.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(re.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,n){let r=n==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*Y,f=d,m,g=360/this.countVisibleElements();for(m=0;m{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?wt(this.resolveDataElementOptions(t,e).angle||i):0}};Ye.id="polarArea";Ye.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ye.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(s){let t=s.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=s.legend.options;return t.labels.map((i,n)=>{let o=s.getDatasetMeta(0).controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!s.getDataVisibility(n),index:n}})}return[]}},onClick(s,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(s){return s.chart.data.labels[s.dataIndex]+": "+s.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var Fs=class extends oe{};Fs.id="pie";Fs.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Ze=class extends pt{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,n){return Kn.bind(this)(t,e,i,n)}update(t){let e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,t!=="resize"){let o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===n.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,i,n){let r=this._cachedMeta.rScale,o=n==="reset";for(let a=e;a{n[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),n}};yt.defaults={};yt.defaultRoutes=void 0;var tl={values(s){return $(s)?s:""+s},numeric(s,t,e){if(s===0)return"0";let i=this.chart.options.locale,n,r=s;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),r=hu(s,e)}let o=gt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ve(s,i,l)},logarithmic(s,t,e){if(s===0)return"0";let i=s/Math.pow(10,Math.floor(gt(s)));return i===1||i===2||i===5?tl.numeric.call(this,s,t,e):""}};function hu(s,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&s!==Math.floor(s)&&(e=s-Math.floor(s)),e}var Xi={formatters:tl};L.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(s,t)=>t.lineWidth,tickColor:(s,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Xi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});L.route("scale.ticks","color","","color");L.route("scale.grid","color","","borderColor");L.route("scale.grid","borderColor","","borderColor");L.route("scale.title","color","","color");L.describe("scale",{_fallback:!1,_scriptable:s=>!s.startsWith("before")&&!s.startsWith("after")&&s!=="callback"&&s!=="parser",_indexable:s=>s!=="borderDash"&&s!=="tickBorderDash"});L.describe("scales",{_fallback:"scale"});L.describe("scale.ticks",{_scriptable:s=>s!=="backdropPadding"&&s!=="callback",_indexable:s=>s!=="backdropPadding"});function uu(s,t){let e=s.options.ticks,i=e.maxTicksLimit||du(s),n=e.major.enabled?mu(t):[],r=n.length,o=n[0],a=n[r-1],l=[];if(r>i)return gu(t,l,n,r/i),l;let c=fu(n,t,i);if(r>0){let h,u,d=r>1?Math.round((a-o)/(r-1)):null;for(Ni(t,l,c,N(d)?0:o-d,o),h=0,u=r-1;hn)return l}return Math.max(n,1)}function mu(s){let t=[],e,i;for(e=0,i=s.length;es==="left"?"right":s==="right"?"left":s,ya=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e;function ba(s,t){let e=[],i=s.length/t,n=s.length,r=0;for(;ro+a)))return l}function xu(s,t){H(s,e=>{let i=e.gc,n=i.length/2,r;if(n>t){for(r=0;ri?i:e,i=n&&e>i?e:i,{min:mt(e,mt(i,e)),max:mt(i,mt(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){j(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Go(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=it(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),u+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-vs(t.grid)-e.padding-xa(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Di(Math.min(Math.asin(it((h.highest.height+6)/a,-1,1)),Math.asin(it(l/c,-1,1))-Math.asin(it(d/c,-1,1)))),o=Math.max(n,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){j(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){j(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=xa(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=vs(r)+l):(t.height=this.maxHeight,t.width=vs(r)+l),i.display&&this.ticks.length){let{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=i.padding*2,m=wt(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){let y=i.mirror?0:p*u.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{let y=i.mirror?0:g*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,h,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){let{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;l?c?(d=n*t.width,f=i*e.height):(d=i*t.height,f=n*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=e.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){j(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:r[k]||0,height:o[k]||0});return{first:S(0),last:S(e-1),widest:S(w),highest:S(x),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Lo(this._alignToPixels?te(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*n?a/i:l/n:l*n0}_computeGridLineItems(t){let e=this.axis,i=this.chart,n=this.options,{grid:r,position:o}=n,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),u=vs(r),d=[],f=r.setContext(this.getContext()),m=f.drawBorder?f.borderWidth:0,g=m/2,p=function(E){return te(i,E,m)},y,b,_,w,x,S,k,O,v,F,W,R;if(o==="top")y=p(this.bottom),S=this.bottom-u,O=y-g,F=p(t.top)+g,R=t.bottom;else if(o==="bottom")y=p(this.top),F=t.top,R=p(t.bottom)-g,S=y+g,O=this.top+u;else if(o==="left")y=p(this.right),x=this.right-u,k=y-g,v=p(t.left)+g,W=t.right;else if(o==="right")y=p(this.left),v=t.left,W=p(t.right)-g,x=y+g,k=this.left+u;else if(e==="x"){if(o==="center")y=p((t.top+t.bottom)/2+.5);else if(A(o)){let E=Object.keys(o)[0],et=o[E];y=p(this.chart.scales[E].getPixelForValue(et))}F=t.top,R=t.bottom,S=y+g,O=S+u}else if(e==="y"){if(o==="center")y=p((t.left+t.right)/2);else if(A(o)){let E=Object.keys(o)[0],et=o[E];y=p(this.chart.scales[E].getPixelForValue(et))}x=y-g,k=x-u,v=t.left,W=t.right}let tt=C(n.ticks.maxTicksLimit,h),ct=Math.max(1,Math.ceil(h/tt));for(b=0;br.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,o,a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=n.length;r{this.draw(n)}}]:[{z:i,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[],r,o;for(r=0,o=e.length;r{let i=e.split("."),n=i.pop(),r=[s].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");L.route(r,n,l,a)})}function vu(s){return"id"in s&&"defaults"in s}var pr=class{constructor(){this.controllers=new Be(pt,"datasets",!0),this.elements=new Be(yt,"elements"),this.plugins=new Be(Object,"plugins"),this.scales=new Be(Yt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{let r=i||this._getRegistryForType(n);i||r.isForType(n)||r===this.plugins&&n.id?this._exec(t,r,n):H(n,o=>{let a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){let n=Oi(t);j(i["before"+n],[],i),e[t](i),j(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let w=e;w0&&Math.abs(S[f]-_[f])>y,p&&(k.parsed=S,k.raw=c.data[w]),d&&(k.options=u||this.resolveDataElementOptions(w,x.active?"active":n)),b||this.updateElement(x,w,k,n),_=S}this.updateSharedOptions(u,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let i=t.dataset,n=i.options&&i.options.borderWidth||0;if(!e.length)return n;let r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,o)/2}};qe.id="scatter";qe.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};qe.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(s){return"("+s.label+", "+s.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Ou=Object.freeze({__proto__:null,BarController:$e,BubbleController:je,DoughnutController:oe,LineController:Ue,PolarAreaController:Ye,PieController:Fs,RadarController:Ze,ScatterController:qe});function be(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var As=class{constructor(t){this.options=t||{}}init(t){}formats(){return be()}parse(t,e){return be()}format(t,e){return be()}add(t,e,i){return be()}diff(t,e,i){return be()}startOf(t,e,i){return be()}endOf(t,e){return be()}};As.override=function(s){Object.assign(As.prototype,s)};var Or={_date:As};function Du(s,t,e,i){let{controller:n,data:r,_sorted:o}=s,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){let l=a._reversePixels?Po:Ft;if(i){if(n._sharedOptions){let c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let u=l(r,t,e-h),d=l(r,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Vs(s,t,e,i,n){let r=s.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a{l[o](t[e],n)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),i&&!a?[]:r}var Fu={evaluateInteractionItems:Vs,modes:{index(s,t,e,i){let n=ie(t,s),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?lr(s,n,r,i,o):cr(s,n,r,!1,i,o),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(s,t,e,i){let n=ie(t,s),r=e.axis||"xy",o=e.includeInvisible||!1,a=e.intersect?lr(s,n,r,i,o):cr(s,n,r,!1,i,o);if(a.length>0){let l=a[0].datasetIndex,c=s.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function wa(s,t){return s.filter(e=>el.indexOf(e.pos)===-1&&e.box.axis===t)}function Ds(s,t){return s.sort((e,i)=>{let n=t?i:e,r=t?e:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function Au(s){let t=[],e,i,n,r,o,a;for(e=0,i=(s||[]).length;ec.box.fullSize),!0),i=Ds(Os(t,"left"),!0),n=Ds(Os(t,"right")),r=Ds(Os(t,"top"),!0),o=Ds(Os(t,"bottom")),a=wa(t,"x"),l=wa(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:Os(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function Sa(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function sl(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function Nu(s,t,e,i){let{pos:n,box:r}=e,o=s.maxPadding;if(!A(n)){e.size&&(s[n]-=e.size);let u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,s[n]+=e.size}r.getPadding&&sl(o,r.getPadding());let a=Math.max(0,t.outerWidth-Sa(o,s,"left","right")),l=Math.max(0,t.outerHeight-Sa(o,s,"top","bottom")),c=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Wu(s){let t=s.maxPadding;function e(i){let n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function zu(s,t){let e=t.maxPadding;function i(n){let r={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(s?["left","right"]:["top","bottom"])}function Cs(s,t,e,i){let n=[],r,o,a,l,c,h;for(r=0,o=s.length,c=0;r{typeof g.beforeLayout=="function"&&g.beforeLayout()});let h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},n);sl(d,at(i));let f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),m=Pu(l.concat(c),u);Cs(a.fullSize,f,u,m),Cs(l,f,u,m),Cs(c,f,u,m)&&Cs(l,f,u,m),Wu(f),ka(a.leftAndTop,f,u,m),f.x+=f.w,f.y+=f.h,ka(a.rightAndBottom,f,u,m),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H(a.chartArea,g=>{let p=g.box;Object.assign(p,s.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},Ui=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}},yr=class extends Ui{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},$i="$chartjs",Vu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ma=s=>s===null||s==="";function Hu(s,t){let e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[$i]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ma(n)){let r=tr(s,"width");r!==void 0&&(s.width=r)}if(Ma(i))if(s.style.height==="")s.height=s.width/(t||2);else{let r=tr(s,"height");r!==void 0&&(s.height=r)}return s}var il=sa?{passive:!0}:!1;function Bu(s,t,e){s.addEventListener(t,e,il)}function $u(s,t,e){s.canvas.removeEventListener(t,e,il)}function ju(s,t){let e=Vu[s.type]||s.type,{x:i,y:n}=ie(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function Yi(s,t){for(let e of s)if(e===t||e.contains(t))return!0}function Uu(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Yi(a.addedNodes,i),o=o&&!Yi(a.removedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Yu(s,t,e){let i=s.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Yi(a.removedNodes,i),o=o&&!Yi(a.addedNodes,i);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}var Ls=new Map,Ta=0;function nl(){let s=window.devicePixelRatio;s!==Ta&&(Ta=s,Ls.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function Zu(s,t){Ls.size||window.addEventListener("resize",nl),Ls.set(s,t)}function qu(s){Ls.delete(s),Ls.size||window.removeEventListener("resize",nl)}function Gu(s,t,e){let i=s.canvas,n=i&&Pi(i);if(!n)return;let r=Wn((a,l)=>{let c=n.clientWidth;e(a,l),c{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(n),Zu(s,r),o}function hr(s,t,e){e&&e.disconnect(),t==="resize"&&qu(s)}function Xu(s,t,e){let i=s.canvas,n=Wn(r=>{s.ctx!==null&&e(ju(r,s))},s,r=>{let o=r[0];return[o,o.offsetX,o.offsetY]});return Bu(i,t,n),n}var br=class extends Ui{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Hu(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[$i])return!1;let i=e[$i].initial;["height","width"].forEach(r=>{let o=i[r];N(o)?e.removeAttribute(r):e.setAttribute(r,o)});let n=i.style||{};return Object.keys(n).forEach(r=>{e.style[r]=n[r]}),e.width=e.width,delete e[$i],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),o={attach:Uu,detach:Yu,resize:Gu}[e]||Xu;n[e]=o(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:hr,detach:hr,resize:hr}[e]||$u)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return ea(t,e,i,n)}isAttached(t){let e=Pi(t);return!!(e&&e.isConnected)}};function Ku(s){return!Jn()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?yr:br}var xr=class{constructor(){this._init=[]}notify(t,e,i,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let r=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,n){n=n||{};for(let r of t){let o=r.plugin,a=o[i],l=[e,n,r.options];if(j(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,n=C(i.options&&i.options.plugins,{}),r=Ju(i);return n===!1&&!e?[]:td(t,r,n,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,n=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}};function Ju(s){let t={},e=[],i=Object.keys(Rt.plugins.items);for(let r=0;r{let l=i[a];if(!A(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let c=wr(a,l),h=id(c,n),u=e.scales||{};r[c]=r[c]||a,o[a]=Pe(Object.create(null),[{axis:c},l,u[c],u[h]])}),s.data.datasets.forEach(a=>{let l=a.type||s.type,c=a.indexAxis||_r(l,t),u=(Qt[l]||{}).scales||{};Object.keys(u).forEach(d=>{let f=sd(d,c),m=a[f+"AxisID"]||r[f]||f;o[m]=o[m]||Object.create(null),Pe(o[m],[{axis:f},i[m],u[d]])})}),Object.keys(o).forEach(a=>{let l=o[a];Pe(l,[L.scales[l.type],L.scale])}),o}function rl(s){let t=s.options||(s.options={});t.plugins=C(t.plugins,{}),t.scales=rd(s,t)}function ol(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function od(s){return s=s||{},s.data=ol(s.data),rl(s),s}var va=new Map,al=new Set;function zi(s,t){let e=va.get(s);return e||(e=t(),va.set(s,e),al.add(e)),e}var Es=(s,t,e)=>{let i=Bt(t,e);i!==void 0&&s.add(i)},Sr=class{constructor(t){this._config=od(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=ol(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),rl(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return zi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return zi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return zi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return zi(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){let{options:n,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Es(l,t,u))),h.forEach(u=>Es(l,n,u)),h.forEach(u=>Es(l,Qt[r]||{},u)),h.forEach(u=>Es(l,L,u)),h.forEach(u=>Es(l,Ii,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),al.has(e)&&o.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,Qt[e]||{},L.datasets[e]||{},{type:e},L,Ii]}resolveNamedOptions(t,e,i,n=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=Oa(this._resolverCache,t,n),l=o;if(ld(o,e)){r.$shared=!1,i=Ht(i)?i():i;let c=this.createResolver(t,i,a);l=ge(o,i,c)}for(let c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],n){let{resolver:r}=Oa(this._resolverCache,t,i);return A(e)?ge(r,e,void 0,n):r}};function Oa(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));let n=e.join(),r=i.get(n);return r||(r={resolver:Li(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,r)),r}var ad=s=>A(s)&&Object.getOwnPropertyNames(s).reduce((t,e)=>t||Ht(s[e]),!1);function ld(s,t){let{isScriptable:e,isIndexable:i}=qn(s);for(let n of t){let r=e(n),o=i(n),a=(o||r)&&s[n];if(r&&(Ht(a)||ad(a))||o&&$(a))return!0}return!1}var cd="3.9.1",hd=["top","bottom","left","right","chartArea"];function Da(s,t){return s==="top"||s==="bottom"||hd.indexOf(s)===-1&&t==="x"}function Ea(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function Ca(s){let t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),j(e&&e.onComplete,[s],t)}function ud(s){let t=s.chart,e=t.options.animation;j(e&&e.onProgress,[s],t)}function ll(s){return Jn()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}var Zi={},cl=s=>{let t=ll(s);return Object.values(Zi).filter(e=>e.canvas===t).pop()};function dd(s,t,e){let i=Object.keys(s);for(let n of i){let r=+n;if(r>=t){let o=s[n];delete s[n],(e>0||r>t)&&(s[r+e]=o)}}}function fd(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}var xe=class{constructor(t,e){let i=this.config=new Sr(e),n=ll(t),r=cl(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Ku(n)),this.platform.updateConfig(i);let a=this.platform.acquireContext(n,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Do(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=zo(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],Zi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}jt.listen(this,"complete",Ca),jt.listen(this,"progress",ud),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:r}=this;return N(t)?e&&r?r:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Un(this.canvas,this.ctx),this}stop(){return jt.stop(this),this}resize(t,e){jt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Qn(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),j(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};H(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{}),r=[];e&&(r=r.concat(Object.keys(e).map(o=>{let a=e[o],l=wr(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),H(r,o=>{let a=o.options,l=a.id,c=wr(l,a),h=C(a.type,o.dtype);(a.position===void 0||Da(a.position,c)!==Da(o.dposition))&&(a.position=o.dposition),n[l]=!0;let u=null;if(l in i&&i[l].type===h)u=i[l];else{let d=Rt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),H(n,(o,a)=>{o||delete i[a]}),H(i,o=>{lt.configure(this,o,o.options),lt.addBox(this,o)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,r)=>n.index-r.index),i>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ea("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){H(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Cn(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:n,count:r}of e){let o=i==="_removeElements"?-r:r;dd(t,n,o)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),n=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],H(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,r)=>{n._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,n=!i.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(n&&ks(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),n&&Ms(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Ae(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){let r=Fu.modes[e];return typeof r=="function"?r(this,t,i,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,n=i.filter(r=>r&&r._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=$t(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let n=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);ft(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),jt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,r,o),t[r]=o},n=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};H(this.options.events,r=>i(r,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)},o,a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let n=i?"set":"remove",r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!ws(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){let n=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;let r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:n=[],options:r}=this,o=e,a=this._getActiveElements(t,n,i,o),l=Io(t),c=fd(t,this._lastEvent,i,l);i&&(this._lastEvent=null,j(r.onHover,[t,a,this],this),l&&j(r.onClick,[t,a,this],this));let h=!ws(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}},Ia=()=>H(xe.instances,s=>s._plugins.invalidate()),ne=!0;Object.defineProperties(xe,{defaults:{enumerable:ne,value:L},instances:{enumerable:ne,value:Zi},overrides:{enumerable:ne,value:Qt},registry:{enumerable:ne,value:Rt},version:{enumerable:ne,value:cd},getChart:{enumerable:ne,value:cl},register:{enumerable:ne,value:(...s)=>{Rt.add(...s),Ia()}},unregister:{enumerable:ne,value:(...s)=>{Rt.remove(...s),Ia()}}});function hl(s,t,e){let{startAngle:i,pixelMargin:n,x:r,y:o,outerRadius:a,innerRadius:l}=t,c=n/a;s.beginPath(),s.arc(r,o,a,i-c,e+c),l>n?(c=n/l,s.arc(r,o,l,e+c,i-c,!0)):s.arc(r,o,n,e+Z,i-Z),s.closePath(),s.clip()}function md(s){return Ai(s,["outerStart","outerEnd","innerStart","innerEnd"])}function gd(s,t,e,i){let n=md(s.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{let c=(e-Math.min(r,l))*i/2;return it(l,0,Math.min(r,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:it(n.innerStart,0,o),innerEnd:it(n.innerEnd,0,o)}}function He(s,t,e,i){return{x:e+s*Math.cos(t),y:i+s*Math.sin(t)}}function kr(s,t,e,i,n,r){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+i+e-c,0),d=h>0?h+i+e+c:0,f=0,m=n-l;if(i){let E=h>0?h-i:0,et=u>0?u-i:0,Q=(E+et)/2,fe=Q!==0?m*Q/(Q+i):m;f=(m-fe)/2}let g=Math.max(.001,m*u-e/Y)/u,p=(m-g)/2,y=l+p+f,b=n-p-f,{outerStart:_,outerEnd:w,innerStart:x,innerEnd:S}=gd(t,d,u,b-y),k=u-_,O=u-w,v=y+_/k,F=b-w/O,W=d+x,R=d+S,tt=y+x/W,ct=b-S/R;if(s.beginPath(),r){if(s.arc(o,a,u,v,F),w>0){let Q=He(O,F,o,a);s.arc(Q.x,Q.y,w,F,b+Z)}let E=He(R,b,o,a);if(s.lineTo(E.x,E.y),S>0){let Q=He(R,ct,o,a);s.arc(Q.x,Q.y,S,b+Z,ct+Math.PI)}if(s.arc(o,a,d,b-S/d,y+x/d,!0),x>0){let Q=He(W,tt,o,a);s.arc(Q.x,Q.y,x,tt+Math.PI,y-Z)}let et=He(k,y,o,a);if(s.lineTo(et.x,et.y),_>0){let Q=He(k,v,o,a);s.arc(Q.x,Q.y,_,y-Z,v)}}else{s.moveTo(o,a);let E=Math.cos(v)*u+o,et=Math.sin(v)*u+a;s.lineTo(E,et);let Q=Math.cos(F)*u+o,fe=Math.sin(F)*u+a;s.lineTo(Q,fe)}s.closePath()}function pd(s,t,e,i,n){let{fullCircles:r,startAngle:o,circumference:a}=t,l=t.endAngle;if(r){kr(s,t,e,i,o+B,n);for(let c=0;c=B||Ne(r,a,l),g=Lt(o,c+d,h+d);return m&&g}getCenterPoint(t){let{x:e,y:i,startAngle:n,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+r)/2,u=(o+a+c+l)/2;return{x:e+Math.cos(h)*u,y:i+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,n=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>B?Math.floor(i/B):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=Y&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=pd(t,this,a,r,o);bd(t,this,a,r,l,o),t.restore()}};Ge.id="arc";Ge.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ge.defaultRoutes={backgroundColor:"backgroundColor"};function ul(s,t,e=t){s.lineCap=C(e.borderCapStyle,t.borderCapStyle),s.setLineDash(C(e.borderDash,t.borderDash)),s.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),s.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=C(e.borderWidth,t.borderWidth),s.strokeStyle=C(e.borderColor,t.borderColor)}function xd(s,t,e){s.lineTo(e.x,e.y)}function _d(s){return s.stepped?Zo:s.tension||s.cubicInterpolationMode==="monotone"?qo:xd}function dl(s,t,e={}){let i=s.length,{start:n=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(n,o),c=Math.min(r,a),h=na&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-w:w))%r,_=()=>{g!==p&&(s.lineTo(h,p),s.lineTo(h,g),s.lineTo(h,y))};for(l&&(f=n[b(0)],s.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=n[b(d)],f.skip)continue;let w=f.x,x=f.y,S=w|0;S===m?(xp&&(p=x),h=(u*h+w)/++u):(_(),s.lineTo(w,x),m=S,u=0,g=p=x),y=x}_()}function Mr(s){let t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Sd:wd}function kd(s){return s.stepped?ia:s.tension||s.cubicInterpolationMode==="monotone"?na:Xt}function Md(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),ul(s,t.options),s.stroke(n)}function Td(s,t,e,i){let{segments:n,options:r}=t,o=Mr(t);for(let a of n)ul(s,r,a.style),s.beginPath(),o(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}var vd=typeof Path2D=="function";function Od(s,t,e,i){vd&&!t.options.segment?Md(s,t,e,i):Td(s,t,e,i)}var Nt=class extends yt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let n=i.spanGaps?this._loop:this._fullLoop;ta(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=oa(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,n=t[e],r=this.points,o=nr(this,{property:e,start:n,end:n});if(!o.length)return;let a=[],l=kd(i),c,h;for(c=0,h=o.length;cs!=="borderDash"&&s!=="fill"};function Fa(s,t,e,i){let n=s.options,{[e]:r}=s.getProps([e],i);return Math.abs(t-r)=e)return s.slice(t,t+e);let o=[],a=(e-2)/(r-2),l=0,c=t+e-1,h=t,u,d,f,m,g;for(o[l++]=s[h],u=0;uf&&(f=m,d=s[b],g=b);o[l++]=d,h=g}return o[l++]=s[c],o}function Pd(s,t,e,i){let n=0,r=0,o,a,l,c,h,u,d,f,m,g,p=[],y=t+e-1,b=s[t].x,w=s[y].x-b;for(o=t;og&&(g=c,d=o),n=(r*n+a.x)/++r;else{let S=o-1;if(!N(u)&&!N(d)){let k=Math.min(u,d),O=Math.max(u,d);k!==f&&k!==S&&p.push({...s[k],x:n}),O!==f&&O!==S&&p.push({...s[O],x:n})}o>0&&S!==f&&p.push(s[S]),p.push(a),h=x,r=0,m=g=c,u=d=f=o}}return p}function ml(s){if(s._decimated){let t=s._data;delete s._decimated,delete s._data,Object.defineProperty(s,"data",{value:t})}}function Aa(s){s.data.datasets.forEach(t=>{ml(t)})}function Rd(s,t){let e=t.length,i=0,n,{iScale:r}=s,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=it(Ft(t,r.axis,o).lo,0,e-1)),c?n=it(Ft(t,r.axis,a).hi+1,i,e)-i:n=e-i,{start:i,count:n}}var Nd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(s,t,e)=>{if(!e.enabled){Aa(s);return}let i=s.width;s.data.datasets.forEach((n,r)=>{let{_data:o,indexAxis:a}=n,l=s.getDatasetMeta(r),c=o||n.data;if(ze([a,s.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=s.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||s.options.parsing)return;let{start:u,count:d}=Rd(l,c),f=e.threshold||4*i;if(d<=f){ml(n);return}N(o)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=Ld(c,u,d,i,e);break;case"min-max":m=Pd(c,u,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=m})},destroy(s){Aa(s)}};function Wd(s,t,e){let i=s.segments,n=s.points,r=t.points,o=[];for(let a of i){let{start:l,end:c}=a;c=Dr(l,c,n);let h=Tr(e,n[l],n[c],a.loop);if(!t.segments){o.push({source:a,target:h,start:n[l],end:n[c]});continue}let u=nr(t,h);for(let d of u){let f=Tr(e,r[d.start],r[d.end],d.loop),m=ir(a,n,f);for(let g of m)o.push({source:g,target:d,start:{[e]:La(h,f,"start",Math.max)},end:{[e]:La(h,f,"end",Math.min)}})}}return o}function Tr(s,t,e,i){if(i)return;let n=t[s],r=e[s];return s==="angle"&&(n=ht(n),r=ht(r)),{property:s,start:n,end:r}}function zd(s,t){let{x:e=null,y:i=null}=s||{},n=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Dr(o,a,n);let l=n[o],c=n[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Dr(s,t,e){for(;t>s;t--){let i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function La(s,t,e,i){return s&&t?i(s[e],t[e]):s?s[e]:t?t[e]:0}function gl(s,t){let e=[],i=!1;return $(s)?(i=!0,e=s):e=zd(s,t),e.length?new Nt({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Pa(s){return s&&s.fill!==!1}function Vd(s,t,e){let n=s[t].fill,r=[t],o;if(!e)return n;for(;n!==!1&&r.indexOf(n)===-1;){if(!K(n))return n;if(o=s[n],!o)return!1;if(o.visible)return n;r.push(n),n=o.fill}return!1}function Hd(s,t,e){let i=Ud(s);if(A(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return K(n)&&Math.floor(n)===n?Bd(i[0],t,n,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Bd(s,t,e,i){return(s==="-"||s==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function $d(s,t){let e=null;return s==="start"?e=t.bottom:s==="end"?e=t.top:A(s)?e=t.getPixelForValue(s.value):t.getBasePixel&&(e=t.getBasePixel()),e}function jd(s,t,e){let i;return s==="start"?i=e:s==="end"?i=t.options.reverse?t.min:t.max:A(s)?i=s.value:i=t.getBaseValue(),i}function Ud(s){let t=s.options,e=t.fill,i=C(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Yd(s){let{scale:t,index:e,line:i}=s,n=[],r=i.segments,o=i.points,a=Zd(t,e);a.push(gl({x:null,y:t.bottom},i));for(let l=0;l=0;--o){let a=n[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&fr(s.ctx,a,r))}},beforeDatasetsDraw(s,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){let r=i[n].$filler;Pa(r)&&fr(s.ctx,r,s.chartArea)}},beforeDatasetDraw(s,t,e){let i=t.meta.$filler;!Pa(i)||e.drawTime!=="beforeDatasetDraw"||fr(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},za=(s,t)=>{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},rf=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index,Gi=class extends yt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=j(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,n=st(i.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=za(i,r),c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a,u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((m,g)=>{let p=i+e/2+r.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>o)&&(u+=h,c[c.length-(g>0?0:1)]=0,f+=h,d++),l[g]={left:0,top:f,row:d,width:p,height:n},c[c.length-1]+=p+a}),u}_fitCols(t,e,i,n){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t,u=a,d=0,f=0,m=0,g=0;return this.legendItems.forEach((p,y)=>{let b=i+e/2+r.measureText(p.text).width;y>0&&f+n+2*a>h&&(u+=d+a,c.push({width:d,height:f}),m+=d+a,g++,d=f=0),l[y]={left:m,top:f,col:g,width:b,height:n},d=Math.max(d,b),f+=n+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:r}}=this,o=ye(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ot(i,this.left+n,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=ot(i,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+n}else{let a=0,l=ot(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=ot(i,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;ks(t,this),this._draw(),Ms(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:r,labels:o}=t,a=L.color,l=ye(t.rtl,this.left,this.width),c=st(o.font),{color:h,padding:u}=o,d=c.size,f=d/2,m;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:y}=za(o,d),b=function(k,O,v){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;n.save();let F=C(v.lineWidth,1);if(n.fillStyle=C(v.fillStyle,a),n.lineCap=C(v.lineCap,"butt"),n.lineDashOffset=C(v.lineDashOffset,0),n.lineJoin=C(v.lineJoin,"miter"),n.lineWidth=F,n.strokeStyle=C(v.strokeStyle,a),n.setLineDash(C(v.lineDash,[])),o.usePointStyle){let W={radius:p*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:F},R=l.xPlus(k,g/2),tt=O+f;Yn(n,W,R,tt,o.pointStyleWidth&&g)}else{let W=O+Math.max((d-p)/2,0),R=l.leftForLtr(k,g),tt=se(v.borderRadius);n.beginPath(),Object.values(tt).some(ct=>ct!==0)?We(n,{x:R,y:W,w:g,h:p,radius:tt}):n.rect(R,W,g,p),n.fill(),F!==0&&n.stroke()}n.restore()},_=function(k,O,v){ee(n,v.text,k,O+y/2,c,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?m={x:ot(r,this.left+u,this.right-i[0]),y:this.top+u+x,line:0}:m={x:this.left+u,y:ot(r,this.top+x+u,this.bottom-e[0].height),line:0},er(this.ctx,t.textDirection);let S=y+u;this.legendItems.forEach((k,O)=>{n.strokeStyle=k.fontColor||h,n.fillStyle=k.fontColor||h;let v=n.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),W=g+f+v,R=m.x,tt=m.y;l.setWidth(this.width),w?O>0&&R+W+u>this.right&&(tt=m.y+=S,m.line++,R=m.x=ot(r,this.left+u,this.right-i[m.line])):O>0&&tt+S>this.bottom&&(R=m.x=R+e[m.line].width+u,m.line++,tt=m.y=ot(r,this.top+x+u,this.bottom-e[m.line].height));let ct=l.x(R);b(ct,tt,k),R=Vo(F,R+g+f,w?R+W:this.right,t.rtl),_(l.x(R),tt,k),w?m.x+=W+u:m.y+=S}),sr(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,i=st(e.font),n=at(e.padding);if(!e.display)return;let r=ye(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=n.top+l,h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=ot(t.align,u,this.right-d);else{let m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+ot(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}let f=ot(a,u,u+d);o.textAlign=r.textAlign(Ci(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,ee(o,e.text,f,h,i)}_computeTitleHeight(){let t=this.options.title,e=st(t.font),i=at(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,r;if(Lt(t,this.left,this.right)&&Lt(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;is.chart.options.color,boxWidth:40,padding:10,generateLabels(s){let t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:r}}=s.legend.options;return s._getSortedDatasetMetas().map(o=>{let a=o.controller.getStyle(e?0:void 0),l=at(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}},Ps=class extends yt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let n=$(i.text)?i.text.length:1;this._padding=at(i.padding);let r=n*st(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:i,bottom:n,right:r,options:o}=this,a=o.align,l=0,c,h,u;return this.isHorizontal()?(h=ot(a,i,r),u=e+t,c=r-i):(o.position==="left"?(h=i+t,u=ot(a,n,e),l=Y*-.5):(h=r-t,u=ot(a,e,n),l=Y*.5),c=n-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=st(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);ee(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Ci(e.align),textBaseline:"middle",translation:[o,a]})}};function lf(s,t){let e=new Ps({ctx:s.ctx,options:t,chart:s});lt.configure(s,e,t),lt.addBox(s,e),s.titleBlock=e}var cf={id:"title",_element:Ps,start(s,t,e){lf(s,e)},stop(s){let t=s.titleBlock;lt.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){let i=s.titleBlock;lt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Vi=new WeakMap,hf={id:"subtitle",start(s,t,e){let i=new Ps({ctx:s.ctx,options:e,chart:s});lt.configure(s,i,e),lt.addBox(s,i),Vi.set(s,i)},stop(s){lt.removeBox(s,Vi.get(s)),Vi.delete(s)},beforeUpdate(s,t,e){let i=Vi.get(s);lt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Is={average(s){if(!s.length)return!1;let t,e,i=0,n=0,r=0;for(t=0,e=s.length;t-1?s.split(` -`):s}function of(s,t){let{element:e,datasetIndex:i,index:n}=t,r=s.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:s,label:o,parsed:r.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function Na(s,t){let e=s.chart.ctx,{body:i,footer:n,title:r}=s,{boxWidth:o,boxHeight:a}=t,l=et(t.bodyFont),c=et(t.titleFont),h=et(t.footerFont),u=r.length,d=n.length,f=i.length,m=at(t.padding),g=m.height,p=0,y=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(y+=s.beforeBody.length+s.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),y){let w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*w+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let b=0,_=function(w){p=Math.max(p,e.measureText(w).width+b)};return e.save(),e.font=c.string,H(s.title,_),e.font=l.string,H(s.beforeBody.concat(s.afterBody),_),b=t.displayColors?o+2+t.boxPadding:0,H(i,w=>{H(w.before,_),H(w.lines,_),H(w.after,_)}),b=0,e.font=h.string,H(s.footer,_),e.restore(),p+=m.width,{width:p,height:g}}function af(s,t){let{y:e,height:i}=t;return es.height-i/2?"bottom":"center"}function lf(s,t,e,i){let{x:n,width:r}=i,o=e.caretSize+e.caretPadding;if(s==="left"&&n+r+o>t.width||s==="right"&&n-r-o<0)return!0}function cf(s,t,e,i){let{x:n,width:r}=e,{width:o,chartArea:{left:a,right:l}}=s,c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),lf(c,s,t,e)&&(c="center"),c}function Ra(s,t,e){let i=e.yAlign||t.yAlign||af(s,e);return{xAlign:e.xAlign||t.xAlign||cf(s,t,e,i),yAlign:i}}function hf(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function uf(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function Wa(s,t,e,i){let{caretSize:n,caretPadding:r,cornerRadius:o}=s,{xAlign:a,yAlign:l}=e,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=se(o),m=hf(t,a),g=uf(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,d)+n:a==="right"&&(m+=Math.max(u,f)+n),{x:it(m,0,i.width-t.width),y:it(g,0,i.height-t.height)}}function Wi(s,t,e){let i=at(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function za(s){return Lt([],Ut(s))}function df(s,t,e){return $t(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Va(s,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}var Ls=class extends yt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new Hi(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=df(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]),a=[];return a=Lt(a,Ut(n)),a=Lt(a,Ut(r)),a=Lt(a,Ut(o)),a}getBeforeBody(t,e){return za(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:i}=e,n=[];return H(t,r=>{let o={before:[],lines:[],after:[]},a=Va(i,r);Lt(o.before,Ut(a.beforeLabel.call(this,r))),Lt(o.lines,a.label.call(this,r)),Lt(o.after,Ut(a.afterLabel.call(this,r))),n.push(o)}),n}getAfterBody(t,e){return za(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]),a=[];return a=Lt(a,Ut(n)),a=Lt(a,Ut(r)),a=Lt(a,Ut(o)),a}_createItems(t){let e=this._active,i=this.chart.data,n=[],r=[],o=[],a=[],l,c;for(l=0,c=e.length;lt.filter(h,u,d,i))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,i))),H(a,h=>{let u=Va(t.callbacks,h);n.push(u.labelColor.call(this,h)),r.push(u.labelPointStyle.call(this,h)),o.push(u.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),n=this._active,r,o=[];if(!n.length)this.opacity!==0&&(r={opacity:0});else{let a=Es[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);let l=this._size=Na(this,i),c=Object.assign({},a,l),h=Ra(this.chart,i,c),u=Wa(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){let r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){let{xAlign:n,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=se(a),{x:d,y:f}=t,{width:m,height:g}=e,p,y,b,_,w,x;return r==="center"?(w=f+g/2,n==="left"?(p=d,y=p-o,_=w+o,x=w-o):(p=d+m,y=p+o,_=w-o,x=w+o),b=p):(n==="left"?y=d+Math.max(l,h)+o:n==="right"?y=d+m-Math.max(c,u)-o:y=this.caretX,r==="top"?(_=f,w=_-o,p=y-o,b=y+o):(_=f+g,w=_+o,p=y+o,b=y-o),x=_),{x1:p,x2:y,x3:b,y1:_,y2:w,y3:x}}drawTitle(t,e,i){let n=this.title,r=n.length,o,a,l;if(r){let c=ye(i.rtl,this.x,this.width);for(t.x=Wi(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=et(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l_!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,We(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),We(t,{x:y,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:n}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,u=et(i.bodyFont),d=u.lineHeight,f=0,m=ye(i.rtl,this.x,this.width),g=function(O){e.fillText(O,m.x(t.x+f),t.y+d/2),t.y+=d+r},p=m.textAlign(o),y,b,_,w,x,S,k;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Wi(this,p,i),e.fillStyle=i.bodyColor,H(this.beforeBody,g),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,w=0,S=n.length;w0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){let o=Es[t.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=Na(this,t),l=Object.assign({},o,this._size),c=Ra(e,t,l),h=Wa(t,l,c,e);(n._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let o=at(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),Kn(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Jn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,n=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!xs(i,n),o=this._positionChanged(n,e);(r||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!xs(o,r)||a;return l&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){let r=this.options;if(t.type==="mouseout")return[];if(!n)return e;let o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:n,options:r}=this,o=Es[r.position].call(this,t,e);return o!==!1&&(i!==o.x||n!==o.y)}};Ls.positioners=Es;var ff={id:"tooltip",_element:Ls,positioners:Es,afterInit(s,t,e){e&&(s.tooltip=new Ls({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){let t=s.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){let e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:Ft,title(s){if(s.length>0){let t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndexs!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},mf=Object.freeze({__proto__:null,Decimation:Fd,Filler:Jd,Legend:ef,SubTitle:rf,Title:nf,Tooltip:ff}),gf=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function pf(s,t,e,i){let n=s.indexOf(t);if(n===-1)return gf(s,t,e,i);let r=s.lastIndexOf(t);return n!==r?e:n}var yf=(s,t)=>s===null?null:it(Math.round(s),0,t),Je=class extends Yt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let i=this.getLabels();for(let{index:n,label:r}of e)i[n]===r&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(R(t))return null;let i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:pf(i,t,I(e,t),this._addedLabels),yf(e,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,n=[],r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};Je.id="category";Je.defaults={ticks:{callback:Je.prototype.getLabelForValue}};function bf(s,t){let e=[],{bounds:n,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=s,f=r||1,m=h-1,{min:g,max:p}=t,y=!R(o),b=!R(a),_=!R(c),w=(p-g)/(u+1),x=On((p-g)/m/f)*f,S,k,O,T;if(x<1e-14&&!y&&!b)return[{value:g},{value:p}];T=Math.ceil(p/x)-Math.floor(g/x),T>m&&(x=On(T*x/m/f)*f),R(l)||(S=Math.pow(10,l),x=Math.ceil(x*S)/S),n==="ticks"?(k=Math.floor(g/x)*x,O=Math.ceil(p/x)*x):(k=g,O=p),y&&b&&r&&Eo((a-o)/r,x/1e3)?(T=Math.round(Math.min((a-o)/x,h)),x=(a-o)/T,k=o,O=a):_?(k=y?o:k,O=b?a:O,T=c-1,x=(O-k)/T):(T=(O-k)/x,Ne(T,Math.round(T),x/1e3)?T=Math.round(T):T=Math.ceil(T));let F=Math.max(En(x),En(k));S=Math.pow(10,R(l)?F:l),k=Math.round(k*S)/S,O=Math.round(O*S)/S;let W=0;for(y&&(d&&k!==o?(e.push({value:o}),kn=e?n:l,a=l=>r=i?r:l;if(t){let l=Tt(n),c=Tt(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(n-l)}this.min=n,this.max=r}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=bf(n,r);return t.bounds==="ticks"&&Dn(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ve(t,this.chart.options.locale,this.options.ticks.format)}},Ps=class extends Qe{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?t:0,this.max=K(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=wt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};Ps.id="linear";Ps.defaults={ticks:{callback:Zi.formatters.numeric}};function Ba(s){return s/Math.pow(10,Math.floor(gt(s)))===1}function xf(s,t){let e=Math.floor(gt(t.max)),i=Math.ceil(t.max/Math.pow(10,e)),n=[],r=mt(s.min,Math.pow(10,Math.floor(gt(t.min)))),o=Math.floor(gt(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do n.push({value:r,major:Ba(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?Math.max(0,t):null,this.max=K(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,n=this.max,r=l=>i=t?i:l,o=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(gt(l))+c);i===n&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(n,1)))),i<=0&&r(a(n,-1)),n<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=xf(e,this);return t.bounds==="ticks"&&Dn(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Ve(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=gt(t),this._valueRange=gt(this.max)-gt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(gt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};Ns.id="logarithmic";Ns.defaults={ticks:{callback:Zi.formatters.logarithmic,major:{enabled:!0}}};function Sr(s){let t=s.ticks;if(t.display&&s.display){let e=at(t.backdropPadding);return I(t.font&&t.font.size,L.font.size)+e.height}return 0}function _f(s,t,e){return e=$(e)?e:[e],{w:Bo(s,t.string,e),h:e.length*t.lineHeight}}function $a(s,t,e,i,n){return s===i||s===n?{start:t-e/2,end:t+e/2}:sn?{start:t-e,end:t}:{start:t,end:t+e}}function wf(s){let t={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},e=Object.assign({},t),i=[],n=[],r=s._pointLabels.length,o=s.options.pointLabels,a=o.centerPointLabels?Y/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,s.r=Math.max(s.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/o,s.b=Math.max(s.b,t.b+l))}function kf(s,t,e){let i=[],n=s._pointLabels.length,r=s.options,o=Sr(r)/2,a=s.drawingArea,l=r.pointLabels.centerPointLabels?Y/n:0;for(let c=0;c270||e<90)&&(s-=t),s}function Of(s,t){let{ctx:e,options:{pointLabels:i}}=s;for(let n=t-1;n>=0;n--){let r=i.setContext(s.getPointLabelContext(n)),o=et(r.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=s._pointLabelItems[n],{backdropColor:m}=r;if(!R(m)){let g=se(r.borderRadius),p=at(r.backdropPadding);e.fillStyle=m;let y=h-p.left,b=u-p.top,_=d-h+p.width,w=f-u+p.height;Object.values(g).some(x=>x!==0)?(e.beginPath(),We(e,{x:y,y:b,w:_,h:w,radius:g}),e.fill()):e.fillRect(y,b,_,w)}ee(e,s._pointLabels[n],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function dl(s,t,e,i){let{ctx:n}=s;if(e)n.arc(s.xCenter,s.yCenter,t,0,B);else{let r=s.getPointPosition(0,t);n.moveTo(r.x,r.y);for(let o=1;o{let n=j(this.options.pointLabels.callback,[e,i],this);return n||n===0?n:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?wf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){let e=B/(this._pointLabels.length||1),i=this.options.startAngle||0;return ht(t*e+wt(i))}getDistanceFromCenterForValue(t){if(R(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(R(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);let u=n.setContext(this.getContext(h-1));Df(this,u,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){let c=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:u}=c;!u||!h||(t.lineWidth=u,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let n=this.getIndexAngle(0),r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;let c=i.setContext(this.getContext(l)),h=et(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let u=at(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}ee(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}};_e.id="radialLinear";_e.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Zi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(s){return s},padding:5,centerPointLabels:!1}};_e.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};_e.descriptors={angleLines:{_fallback:"grid"}};var qi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ut=Object.keys(qi);function If(s,t){return s-t}function ja(s,t){if(R(t))return null;let e=s._adapter,{parser:i,round:n,isoWeekday:r}=s._parseOpts,o=t;return typeof i=="function"&&(o=i(o)),K(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(n&&(o=n==="week"&&(pe(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,n)),+o)}function Ua(s,t,e,i){let n=ut.length;for(let r=ut.indexOf(s);r=ut.indexOf(e);r--){let o=ut[r];if(qi[o].common&&s._adapter.diff(n,i,o)>=t-1)return o}return ut[e?ut.indexOf(e):0]}function Ff(s){for(let t=ut.indexOf(s)+1,e=ut.length;t=t?e[i]:e[n];s[r]=!0}}function Af(s,t,e,i){let n=s._adapter,r=+n.startOf(t[0].value,i),o=t[t.length-1].value,a,l;for(a=r;a<=o;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Za(s,t,e){let i=[],n={},r=t.length,o,a;for(o=0;o+t.value))}initOffsets(t){let e=0,i=0,n,r;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;e=it(e,0,o),i=it(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,o=r.unit||Ua(r.minUnit,e,i,this._getLabelCapacity(e)),a=I(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=pe(l)||l===!0,h={},u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);let m=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;dg-p).map(g=>+g)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){let r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],u=i[e],d=l&&h&&u&&u.major,f=this._adapter.format(t,n||(d?h:c)),m=r.ticks.callback;return m?j(m,[f,e,i],this):f}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Ct(s,"pos",t)),{pos:r,time:a}=s[i],{pos:o,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Ct(s,"time",t)),{time:r,pos:a}=s[i],{time:o,pos:l}=s[n]);let c=o-r;return c?a+(l-a)*(t-r)/c:a}var Rs=class extends we{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=zi(e,this.min),this._tableRange=zi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,n=[],r=[],o,a,l,c,h;for(o=0,a=t.length;o=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=n.length;o=0?m:1e3+m,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};var ml={};function zf(s,t={}){let e=JSON.stringify([s,t]),i=ml[e];return i||(i=new Intl.ListFormat(s,t),ml[e]=i),i}var Dr={};function Er(s,t={}){let e=JSON.stringify([s,t]),i=Dr[e];return i||(i=new Intl.DateTimeFormat(s,t),Dr[e]=i),i}var Ir={};function Vf(s,t={}){let e=JSON.stringify([s,t]),i=Ir[e];return i||(i=new Intl.NumberFormat(s,t),Ir[e]=i),i}var Cr={};function Hf(s,t={}){let{base:e,...i}=t,n=JSON.stringify([s,i]),r=Cr[n];return r||(r=new Intl.RelativeTimeFormat(s,t),Cr[n]=r),r}var ni=null;function Bf(){return ni||(ni=new Intl.DateTimeFormat().resolvedOptions().locale,ni)}var gl={};function $f(s){let t=gl[s];if(!t){let e=new Intl.Locale(s);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,gl[s]=t}return t}function jf(s){let t=s.indexOf("-x-");t!==-1&&(s=s.substring(0,t));let e=s.indexOf("-u-");if(e===-1)return[s];{let i,n;try{i=Er(s).resolvedOptions(),n=s}catch{let l=s.substring(0,e);i=Er(l).resolvedOptions(),n=l}let{numberingSystem:r,calendar:o}=i;return[n,r,o]}}function Uf(s,t,e){return(e||t)&&(s.includes("-u-")||(s+="-u"),e&&(s+=`-ca-${e}`),t&&(s+=`-nu-${t}`)),s}function Yf(s){let t=[];for(let e=1;e<=12;e++){let i=v.utc(2009,e,1);t.push(s(i))}return t}function Zf(s){let t=[];for(let e=1;e<=7;e++){let i=v.utc(2016,11,13+e);t.push(s(i))}return t}function sn(s,t,e,i){let n=s.listingMode();return n==="error"?null:n==="en"?e(t):i(t)}function qf(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||new Intl.DateTimeFormat(s.intl).resolvedOptions().numberingSystem==="latn"}var Fr=class{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:r,...o}=i;if(!e||Object.keys(o).length>0){let a={useGrouping:!1,...i};i.padTo>0&&(a.minimumIntegerDigits=i.padTo),this.inf=Vf(t,a)}}format(t){if(this.inf){let e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{let e=this.floor?Math.floor(t):ss(t,3);return q(e,this.padTo)}}},Ar=class{constructor(t,e,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let o=-1*(t.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&nt.create(a).valid?(n=a,this.dt=t):(n="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,n=t.zone.name):(n="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=Er(e,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:i}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},Lr=class{constructor(t,e,i){this.opts={style:"long",...i},!e&&nn()&&(this.rtf=Hf(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):pl(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}},Gf={firstDay:1,minimalDays:4,weekend:[6,7]},N=class{static fromOpts(t){return N.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,i,n,r=!1){let o=t||z.defaultLocale,a=o||(r?"en-US":Bf()),l=e||z.defaultNumberingSystem,c=i||z.defaultOutputCalendar,h=ri(n)||z.defaultWeekSettings;return new N(a,l,c,h,o)}static resetCache(){ni=null,Dr={},Ir={},Cr={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i,weekSettings:n}={}){return N.create(t,e,i,n)}constructor(t,e,i,n,r){let[o,a,l]=jf(t);this.locale=o,this.numberingSystem=e||a||null,this.outputCalendar=i||l||null,this.weekSettings=n,this.intl=Uf(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=qf(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:N.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,ri(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return sn(this,t,Pr,()=>{let i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=Yf(r=>this.extract(r,i,"month"))),this.monthsCache[n][t]})}weekdays(t,e=!1){return sn(this,t,Nr,()=>{let i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=Zf(r=>this.extract(r,i,"weekday"))),this.weekdaysCache[n][t]})}meridiems(){return sn(this,void 0,()=>Rr,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[v.utc(2016,11,13,9),v.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(t){return sn(this,t,Wr,()=>{let e={era:t};return this.eraCache[t]||(this.eraCache[t]=[v.utc(-40,1,1),v.utc(2017,1,1)].map(i=>this.extract(i,e,"era"))),this.eraCache[t]})}extract(t,e,i){let n=this.dtFormatter(t,e),r=n.formatToParts(),o=r.find(a=>a.type.toLowerCase()===i);return o?o.value:null}numberFormatter(t={}){return new Fr(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Ar(t,this.intl,e)}relFormatter(t={}){return new Lr(this.intl,this.isEnglish(),t)}listFormatter(t={}){return zf(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:rn()?$f(this.locale):Gf}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}};var Vr=null,G=class extends dt{static get utcInstance(){return Vr===null&&(Vr=new G(0)),Vr}static instance(t){return t===0?G.utcInstance:new G(t)}static parseSpecifier(t){if(t){let e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new G(Se(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${le(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${le(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return le(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};var is=class extends dt{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Et(s,t){let e;if(D(s)||s===null)return t;if(s instanceof dt)return s;if(yl(s)){let i=s.toLowerCase();return i==="default"?t:i==="local"||i==="system"?Wt.instance:i==="utc"||i==="gmt"?G.utcInstance:G.parseSpecifier(i)||nt.create(s)}else return zt(s)?G.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new is(s)}var bl=()=>Date.now(),xl="system",_l=null,wl=null,Sl=null,kl=60,Ml,Tl=null,z=class{static get now(){return bl}static set now(t){bl=t}static set defaultZone(t){xl=t}static get defaultZone(){return Et(xl,Wt.instance)}static get defaultLocale(){return _l}static set defaultLocale(t){_l=t}static get defaultNumberingSystem(){return wl}static set defaultNumberingSystem(t){wl=t}static get defaultOutputCalendar(){return Sl}static set defaultOutputCalendar(t){Sl=t}static get defaultWeekSettings(){return Tl}static set defaultWeekSettings(t){Tl=ri(t)}static get twoDigitCutoffYear(){return kl}static set twoDigitCutoffYear(t){kl=t%100}static get throwOnInvalid(){return Ml}static set throwOnInvalid(t){Ml=t}static resetCaches(){N.resetCache(),nt.resetCache()}};var rt=class{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var vl=[0,31,59,90,120,151,181,212,243,273,304,334],Ol=[0,31,60,91,121,152,182,213,244,274,305,335];function St(s,t){return new rt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${s}, which is invalid`)}function on(s,t,e){let i=new Date(Date.UTC(s,t-1,e));s<100&&s>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function Dl(s,t,e){return e+(Me(s)?Ol:vl)[t-1]}function El(s,t){let e=Me(s)?Ol:vl,i=e.findIndex(r=>rke(i,t,e)?(c=i+1,l=1):c=i,{weekYear:c,weekNumber:l,weekday:a,...li(s)}}function Hr(s,t=4,e=1){let{weekYear:i,weekNumber:n,weekday:r}=s,o=an(on(i,1,t),e),a=ce(i),l=n*7+r-o-7+t,c;l<1?(c=i-1,l+=ce(c)):l>a?(c=i+1,l-=ce(i)):c=i;let{month:h,day:u}=El(c,l);return{year:c,month:h,day:u,...li(s)}}function ln(s){let{year:t,month:e,day:i}=s,n=Dl(t,e,i);return{year:t,ordinal:n,...li(s)}}function Br(s){let{year:t,ordinal:e}=s,{month:i,day:n}=El(t,e);return{year:t,month:i,day:n,...li(s)}}function $r(s,t){if(!D(s.localWeekday)||!D(s.localWeekNumber)||!D(s.localWeekYear)){if(!D(s.weekday)||!D(s.weekNumber)||!D(s.weekYear))throw new vt("Cannot mix locale-based week fields with ISO-based week fields");return D(s.localWeekday)||(s.weekday=s.localWeekday),D(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),D(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Il(s,t=4,e=1){let i=ai(s.weekYear),n=xt(s.weekNumber,1,ke(s.weekYear,t,e)),r=xt(s.weekday,1,7);return i?n?r?!1:St("weekday",s.weekday):St("week",s.weekNumber):St("weekYear",s.weekYear)}function Cl(s){let t=ai(s.year),e=xt(s.ordinal,1,ce(s.year));return t?e?!1:St("ordinal",s.ordinal):St("year",s.year)}function jr(s){let t=ai(s.year),e=xt(s.month,1,12),i=xt(s.day,1,ns(s.year,s.month));return t?e?i?!1:St("day",s.day):St("month",s.month):St("year",s.year)}function Ur(s){let{hour:t,minute:e,second:i,millisecond:n}=s,r=xt(t,0,23)||t===24&&e===0&&i===0&&n===0,o=xt(e,0,59),a=xt(i,0,59),l=xt(n,0,999);return r?o?a?l?!1:St("millisecond",n):St("second",i):St("minute",e):St("hour",t)}function D(s){return typeof s>"u"}function zt(s){return typeof s=="number"}function ai(s){return typeof s=="number"&&s%1===0}function yl(s){return typeof s=="string"}function Al(s){return Object.prototype.toString.call(s)==="[object Date]"}function nn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function rn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ll(s){return Array.isArray(s)?s:[s]}function Yr(s,t,e){if(s.length!==0)return s.reduce((i,n)=>{let r=[t(n),n];return i&&e(i[0],r[0])===i[0]?i:r},null)[1]}function Pl(s,t){return t.reduce((e,i)=>(e[i]=s[i],e),{})}function he(s,t){return Object.prototype.hasOwnProperty.call(s,t)}function ri(s){if(s==null)return null;if(typeof s!="object")throw new st("Week settings must be an object");if(!xt(s.firstDay,1,7)||!xt(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(t=>!xt(t,1,7)))throw new st("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function xt(s,t,e){return ai(s)&&s>=t&&s<=e}function Xf(s,t){return s-t*Math.floor(s/t)}function q(s,t=2){let e=s<0,i;return e?i="-"+(""+-s).padStart(t,"0"):i=(""+s).padStart(t,"0"),i}function qt(s){if(!(D(s)||s===null||s===""))return parseInt(s,10)}function ue(s){if(!(D(s)||s===null||s===""))return parseFloat(s)}function ci(s){if(!(D(s)||s===null||s==="")){let t=parseFloat("0."+s)*1e3;return Math.floor(t)}}function ss(s,t,e=!1){let i=10**t;return(e?Math.trunc:Math.round)(s*i)/i}function Me(s){return s%4===0&&(s%100!==0||s%400===0)}function ce(s){return Me(s)?366:365}function ns(s,t){let e=Xf(t-1,12)+1,i=s+(t-e)/12;return e===2?Me(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function es(s){let t=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(t=new Date(t),t.setUTCFullYear(s.year,s.month-1,s.day)),+t}function Fl(s,t,e){return-an(on(s,1,t),e)+t-1}function ke(s,t=4,e=1){let i=Fl(s,t,e),n=Fl(s+1,t,e);return(ce(s)-i+n)/7}function hi(s){return s>99?s:s>z.twoDigitCutoffYear?1900+s:2e3+s}function Qi(s,t,e,i=null){let n=new Date(s),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(r.timeZone=i);let o={timeZoneName:t,...r},a=new Intl.DateTimeFormat(e,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Se(s,t){let e=parseInt(s,10);Number.isNaN(e)&&(e=0);let i=parseInt(t,10)||0,n=e<0||Object.is(e,-0)?-i:i;return e*60+n}function Zr(s){let t=Number(s);if(typeof s=="boolean"||s===""||Number.isNaN(t))throw new st(`Invalid unit value ${s}`);return t}function rs(s,t){let e={};for(let i in s)if(he(s,i)){let n=s[i];if(n==null)continue;e[t(i)]=Zr(n)}return e}function le(s,t){let e=Math.trunc(Math.abs(s/60)),i=Math.trunc(Math.abs(s%60)),n=s>=0?"+":"-";switch(t){case"short":return`${n}${q(e,2)}:${q(i,2)}`;case"narrow":return`${n}${e}${i>0?`:${i}`:""}`;case"techie":return`${n}${q(e,2)}${q(i,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function li(s){return Pl(s,["hour","minute","second","millisecond"])}var Kf=["January","February","March","April","May","June","July","August","September","October","November","December"],qr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Jf=["J","F","M","A","M","J","J","A","S","O","N","D"];function Pr(s){switch(s){case"narrow":return[...Jf];case"short":return[...qr];case"long":return[...Kf];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Gr=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Xr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Qf=["M","T","W","T","F","S","S"];function Nr(s){switch(s){case"narrow":return[...Qf];case"short":return[...Xr];case"long":return[...Gr];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Rr=["AM","PM"],tm=["Before Christ","Anno Domini"],em=["BC","AD"],sm=["B","A"];function Wr(s){switch(s){case"narrow":return[...sm];case"short":return[...em];case"long":return[...tm];default:return null}}function Nl(s){return Rr[s.hour<12?0:1]}function Rl(s,t){return Nr(t)[s.weekday-1]}function Wl(s,t){return Pr(t)[s.month-1]}function zl(s,t){return Wr(t)[s.year<0?0:1]}function pl(s,t,e="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(s)===-1;if(e==="auto"&&r){let u=s==="days";switch(t){case 1:return u?"tomorrow":`next ${n[s][0]}`;case-1:return u?"yesterday":`last ${n[s][0]}`;case 0:return u?"today":`this ${n[s][0]}`;default:}}let o=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=n[s],h=i?l?c[1]:c[2]||c[1]:l?n[s][0]:s;return o?`${a} ${h} ago`:`in ${a} ${h}`}function Vl(s,t){let e="";for(let i of s)i.literal?e+=i.val:e+=t(i.val);return e}var im={D:ae,DD:zs,DDD:Vs,DDDD:Hs,t:Bs,tt:$s,ttt:js,tttt:Us,T:Ys,TT:Zs,TTT:qs,TTTT:Gs,f:Xs,ff:Js,fff:ti,ffff:si,F:Ks,FF:Qs,FFF:ei,FFFF:ii},X=class{static create(t,e={}){return new X(t,e)}static parseFormat(t){let e=null,i="",n=!1,r=[];for(let o=0;o0&&r.push({literal:n||/^\s+$/.test(i),val:i}),e=null,i="",n=!n):n||a===e?i+=a:(i.length>0&&r.push({literal:/^\s+$/.test(i),val:i}),i=a,e=a)}return i.length>0&&r.push({literal:n||/^\s+$/.test(i),val:i}),r}static macroTokenToFormatOpts(t){return im[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return q(t,e);let i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(f,m)=>this.loc.extract(t,f,m),o=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>i?Nl(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,m)=>i?Wl(t,f):r(m?{month:f}:{month:f,day:"numeric"},"month"),c=(f,m)=>i?Rl(t,f):r(m?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),h=f=>{let m=X.macroTokenToFormatOpts(f);return m?this.formatWithSystemDefault(t,m):f},u=f=>i?zl(t,f):r({era:f},"era"),d=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return n?r({day:"numeric"},"day"):this.num(t.day);case"dd":return n?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return n?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?r({month:"numeric"},"month"):this.num(t.month);case"MM":return n?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?r({year:"numeric"},"year"):this.num(t.year);case"yy":return n?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(f)}};return Vl(X.parseFormat(e),d)}formatDurationFromString(t,e){let i=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=l=>c=>{let h=i(c);return h?this.num(l.get(h),c.length):c},r=X.parseFormat(e),o=r.reduce((l,{literal:c,val:h})=>c?l:l.concat(h),[]),a=t.shiftTo(...o.map(i).filter(l=>l));return Vl(r,n(a))}};var Bl=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function as(...s){let t=s.reduce((e,i)=>e+i.source,"");return RegExp(`^${t}$`)}function ls(...s){return t=>s.reduce(([e,i,n],r)=>{let[o,a,l]=r(t,n);return[{...e,...o},a||i,l]},[{},null,1]).slice(0,2)}function cs(s,...t){if(s==null)return[null,null];for(let[e,i]of t){let n=e.exec(s);if(n)return i(n)}return[null,null]}function $l(...s){return(t,e)=>{let i={},n;for(n=0;nf!==void 0&&(m||f&&h)?-f:f;return[{years:d(ue(e)),months:d(ue(i)),weeks:d(ue(n)),days:d(ue(r)),hours:d(ue(o)),minutes:d(ue(a)),seconds:d(ue(l),l==="-0"),milliseconds:d(ci(c),u)}]}var pm={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Qr(s,t,e,i,n,r,o){let a={year:t.length===2?hi(qt(t)):qt(t),month:qr.indexOf(e)+1,day:qt(i),hour:qt(n),minute:qt(r)};return o&&(a.second=qt(o)),s&&(a.weekday=s.length>3?Gr.indexOf(s)+1:Xr.indexOf(s)+1),a}var ym=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function bm(s){let[,t,e,i,n,r,o,a,l,c,h,u]=s,d=Qr(t,n,i,e,r,o,a),f;return l?f=pm[l]:c?f=0:f=Se(h,u),[d,new G(f)]}function xm(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var _m=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,wm=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Sm=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Hl(s){let[,t,e,i,n,r,o,a]=s;return[Qr(t,n,i,e,r,o,a),G.utcInstance]}function km(s){let[,t,e,i,n,r,o,a]=s;return[Qr(t,a,e,i,n,r,o),G.utcInstance]}var Mm=as(rm,Jr),Tm=as(om,Jr),vm=as(am,Jr),Om=as(Ul),Zl=ls(dm,hs,ui,di),Dm=ls(lm,hs,ui,di),Em=ls(cm,hs,ui,di),Im=ls(hs,ui,di);function ql(s){return cs(s,[Mm,Zl],[Tm,Dm],[vm,Em],[Om,Im])}function Gl(s){return cs(xm(s),[ym,bm])}function Xl(s){return cs(s,[_m,Hl],[wm,Hl],[Sm,km])}function Kl(s){return cs(s,[mm,gm])}var Cm=ls(hs);function Jl(s){return cs(s,[fm,Cm])}var Fm=as(hm,um),Am=as(Yl),Lm=ls(hs,ui,di);function Ql(s){return cs(s,[Fm,Zl],[Am,Lm])}var tc="Invalid Duration",sc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Pm={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...sc},kt=146097/400,us=146097/4800,Nm={years:{quarters:4,months:12,weeks:kt/7,days:kt,hours:kt*24,minutes:kt*24*60,seconds:kt*24*60*60,milliseconds:kt*24*60*60*1e3},quarters:{months:3,weeks:kt/28,days:kt/4,hours:kt*24/4,minutes:kt*24*60/4,seconds:kt*24*60*60/4,milliseconds:kt*24*60*60*1e3/4},months:{weeks:us/7,days:us,hours:us*24,minutes:us*24*60,seconds:us*24*60*60,milliseconds:us*24*60*60*1e3},...sc},Te=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Rm=Te.slice(0).reverse();function de(s,t,e=!1){let i={values:e?t.values:{...s.values,...t.values||{}},loc:s.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||s.conversionAccuracy,matrix:t.matrix||s.matrix};return new C(i)}function ic(s,t){let e=t.milliseconds??0;for(let i of Rm.slice(1))t[i]&&(e+=t[i]*s[i].milliseconds);return e}function ec(s,t){let e=ic(s,t)<0?-1:1;Te.reduceRight((i,n)=>{if(D(t[n]))return i;if(i){let r=t[i]*e,o=s[n][i],a=Math.floor(r/o);t[n]+=a*e,t[i]-=a*o*e}return n},null),Te.reduce((i,n)=>{if(D(t[n]))return i;if(i){let r=t[i]%1;t[i]-=r,t[n]+=r*s[i][n]}return n},null)}function Wm(s){let t={};for(let[e,i]of Object.entries(s))i!==0&&(t[e]=i);return t}var C=class{constructor(t){let e=t.conversionAccuracy==="longterm"||!1,i=e?Nm:Pm;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||N.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,e){return C.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new st(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new C({values:rs(t,C.normalizeUnit),loc:N.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(zt(t))return C.fromMillis(t);if(C.isDuration(t))return t;if(typeof t=="object")return C.fromObject(t);throw new st(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){let[i]=Kl(t);return i?C.fromObject(i,e):C.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){let[i]=Jl(t);return i?C.fromObject(i,e):C.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new st("need to specify a reason the Duration is invalid");let i=t instanceof rt?t:new rt(t,e);if(z.throwOnInvalid)throw new Ki(i);return new C({invalid:i})}static normalizeUnit(t){let e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!e)throw new ts(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){let i={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?X.create(this.loc,i).formatDurationFromString(this,t):tc}toHuman(t={}){if(!this.isValid)return tc;let e=Te.map(i=>{let n=this.values[i];return D(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:i.slice(0,-1)}).format(n)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ss(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},v.fromMillis(e,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?ic(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let e=C.fromDurationLike(t),i={};for(let n of Te)(he(e.values,n)||he(this.values,n))&&(i[n]=e.get(n)+this.get(n));return de(this,{values:i},!0)}minus(t){if(!this.isValid)return this;let e=C.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;let e={};for(let i of Object.keys(this.values))e[i]=Zr(t(this.values[i],i));return de(this,{values:e},!0)}get(t){return this[C.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let e={...this.values,...rs(t,C.normalizeUnit)};return de(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i,matrix:n}={}){let o={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:i};return de(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return ec(this.matrix,t),de(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=Wm(this.normalize().shiftToAll().toObject());return de(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>C.normalizeUnit(o));let e={},i={},n=this.toObject(),r;for(let o of Te)if(t.indexOf(o)>=0){r=o;let a=0;for(let c in i)a+=this.matrix[c][o]*i[c],i[c]=0;zt(n[o])&&(a+=n[o]);let l=Math.trunc(a);e[o]=l,i[o]=(a*1e3-l*1e3)/1e3}else zt(n[o])&&(i[o]=n[o]);for(let o in i)i[o]!==0&&(e[r]+=o===r?i[o]:i[o]/this.matrix[r][o]);return ec(this.matrix,e),de(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return de(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of Te)if(!e(this.values[i],t.values[i]))return!1;return!0}};var ds="Invalid Interval";function zm(s,t){return!s||!s.isValid?U.invalid("missing or invalid start"):!t||!t.isValid?U.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?U.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];let e=t.map(fs).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),i=[],{s:n}=this,r=0;for(;n+this.e?this.e:o;i.push(U.fromDateTimes(n,a)),n=a,r+=1}return i}splitBy(t){let e=C.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s:i}=this,n=1,r,o=[];for(;il*n));r=+a>+this.e?this.e:a,o.push(U.fromDateTimes(i,r)),i=r,n+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let e=this.s>t.s?this.s:t.s,i=this.e=i?null:U.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;let e=this.st.e?this.e:t.e;return U.fromDateTimes(e,i)}static merge(t){let[e,i]=t.sort((n,r)=>n.s-r.s).reduce(([n,r],o)=>r?r.overlaps(o)||r.abutsStart(o)?[n,r.union(o)]:[n.concat([r]),o]:[n,o],[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0,n=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...r),a=o.sort((l,c)=>l.time-c.time);for(let l of a)i+=l.type==="s"?1:-1,i===1?e=l.time:(e&&+e!=+l.time&&n.push(U.fromDateTimes(e,l.time)),e=null);return U.merge(n)}difference(...t){return U.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:ds}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=ae,e={}){return this.isValid?X.create(this.s.loc.clone(e),t).formatInterval(this):ds}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:ds}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ds}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:ds}toFormat(t,{separator:e=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:ds}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):C.invalid(this.invalidReason)}mapEndpoints(t){return U.fromDateTimes(t(this.s),t(this.e))}};var Gt=class{static hasDST(t=z.defaultZone){let e=v.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return nt.isValidZone(t)}static normalizeZone(t){return Et(t,z.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||N.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||N.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||N.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||N.create(e,i,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||N.create(e,i,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||N.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||N.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return N.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return N.create(e,null,"gregory").eras(t)}static features(){return{relative:nn(),localeWeek:rn()}}};function nc(s,t){let e=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=e(t)-e(s);return Math.floor(C.fromMillis(i).as("days"))}function Vm(s,t,e){let i=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{let h=nc(l,c);return(h-h%7)/7}],["days",nc]],n={},r=s,o,a;for(let[l,c]of i)e.indexOf(l)>=0&&(o=l,n[l]=c(s,t),a=r.plus(n),a>t?(n[l]--,s=r.plus(n),s>t&&(a=s,n[l]--,s=r.plus(n))):s=a);return[s,n,a,o]}function rc(s,t,e,i){let[n,r,o,a]=Vm(s,t,e),l=t-n,c=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);c.length===0&&(o0?C.fromMillis(l,i).shiftTo(...c).plus(h):h}var to={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},oc={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Hm=to.hanidec.replace(/[\[|\]]/g,"").split("");function ac(s){let t=parseInt(s,10);if(isNaN(t)){t="";for(let e=0;e=r&&i<=o&&(t+=i-r)}}return parseInt(t,10)}else return t}function Mt({numberingSystem:s},t=""){return new RegExp(`${to[s||"latn"]}${t}`)}var Bm="missing Intl.DateTimeFormat.formatToParts support";function V(s,t=e=>e){return{regex:s,deser:([e])=>t(ac(e))}}var $m=String.fromCharCode(160),hc=`[ ${$m}]`,uc=new RegExp(hc,"g");function jm(s){return s.replace(/\./g,"\\.?").replace(uc,hc)}function lc(s){return s.replace(/\./g,"").replace(uc," ").toLowerCase()}function It(s,t){return s===null?null:{regex:RegExp(s.map(jm).join("|")),deser:([e])=>s.findIndex(i=>lc(e)===lc(i))+t}}function cc(s,t){return{regex:s,deser:([,e,i])=>Se(e,i),groups:t}}function cn(s){return{regex:s,deser:([t])=>t}}function Um(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ym(s,t){let e=Mt(t),i=Mt(t,"{2}"),n=Mt(t,"{3}"),r=Mt(t,"{4}"),o=Mt(t,"{6}"),a=Mt(t,"{1,2}"),l=Mt(t,"{1,3}"),c=Mt(t,"{1,6}"),h=Mt(t,"{1,9}"),u=Mt(t,"{2,4}"),d=Mt(t,"{4,6}"),f=p=>({regex:RegExp(Um(p.val)),deser:([y])=>y,literal:!0}),g=(p=>{if(s.literal)return f(p);switch(p.val){case"G":return It(t.eras("short"),0);case"GG":return It(t.eras("long"),0);case"y":return V(c);case"yy":return V(u,hi);case"yyyy":return V(r);case"yyyyy":return V(d);case"yyyyyy":return V(o);case"M":return V(a);case"MM":return V(i);case"MMM":return It(t.months("short",!0),1);case"MMMM":return It(t.months("long",!0),1);case"L":return V(a);case"LL":return V(i);case"LLL":return It(t.months("short",!1),1);case"LLLL":return It(t.months("long",!1),1);case"d":return V(a);case"dd":return V(i);case"o":return V(l);case"ooo":return V(n);case"HH":return V(i);case"H":return V(a);case"hh":return V(i);case"h":return V(a);case"mm":return V(i);case"m":return V(a);case"q":return V(a);case"qq":return V(i);case"s":return V(a);case"ss":return V(i);case"S":return V(l);case"SSS":return V(n);case"u":return cn(h);case"uu":return cn(a);case"uuu":return V(e);case"a":return It(t.meridiems(),0);case"kkkk":return V(r);case"kk":return V(u,hi);case"W":return V(a);case"WW":return V(i);case"E":case"c":return V(e);case"EEE":return It(t.weekdays("short",!1),1);case"EEEE":return It(t.weekdays("long",!1),1);case"ccc":return It(t.weekdays("short",!0),1);case"cccc":return It(t.weekdays("long",!0),1);case"Z":case"ZZ":return cc(new RegExp(`([+-]${a.source})(?::(${i.source}))?`),2);case"ZZZ":return cc(new RegExp(`([+-]${a.source})(${i.source})?`),2);case"z":return cn(/[a-z_+-/]{1,256}?/i);case" ":return cn(/[^\S\n\r]/);default:return f(p)}})(s)||{invalidReason:Bm};return g.token=s,g}var Zm={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function qm(s,t,e){let{type:i,value:n}=s;if(i==="literal"){let l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}let r=t[i],o=i;i==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=e.hour12?"hour12":"hour24");let a=Zm[o];if(typeof a=="object"&&(a=a[r]),a)return{literal:!1,val:a}}function Gm(s){return[`^${s.map(e=>e.regex).reduce((e,i)=>`${e}(${i.source})`,"")}$`,s]}function Xm(s,t,e){let i=s.match(t);if(i){let n={},r=1;for(let o in e)if(he(e,o)){let a=e[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(i.slice(r,r+l))),r+=l}return[i,n]}else return[i,{}]}function Km(s){let t=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},e=null,i;return D(s.z)||(e=nt.create(s.z)),D(s.Z)||(e||(e=new G(s.Z)),i=s.Z),D(s.q)||(s.M=(s.q-1)*3+1),D(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),D(s.u)||(s.S=ci(s.u)),[Object.keys(s).reduce((r,o)=>{let a=t(o);return a&&(r[a]=s[o]),r},{}),e,i]}var eo=null;function Jm(){return eo||(eo=v.fromMillis(1555555555555)),eo}function Qm(s,t){if(s.literal)return s;let e=X.macroTokenToFormatOpts(s.val),i=no(e,t);return i==null||i.includes(void 0)?s:i}function so(s,t){return Array.prototype.concat(...s.map(e=>Qm(e,t)))}function io(s,t,e){let i=so(X.parseFormat(e),s),n=i.map(o=>Ym(o,s)),r=n.find(o=>o.invalidReason);if(r)return{input:t,tokens:i,invalidReason:r.invalidReason};{let[o,a]=Gm(n),l=RegExp(o,"i"),[c,h]=Xm(t,l,a),[u,d,f]=h?Km(h):[null,null,void 0];if(he(h,"a")&&he(h,"H"))throw new vt("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:i,regex:l,rawMatches:c,matches:h,result:u,zone:d,specificOffset:f}}}function dc(s,t,e){let{result:i,zone:n,specificOffset:r,invalidReason:o}=io(s,t,e);return[i,n,r,o]}function no(s,t){if(!s)return null;let i=X.create(t,s).dtFormatter(Jm()),n=i.formatToParts(),r=i.resolvedOptions();return n.map(o=>qm(o,s,r))}var ro="Invalid DateTime",fc=864e13;function hn(s){return new rt("unsupported zone",`the zone "${s.name}" is not supported`)}function oo(s){return s.weekData===null&&(s.weekData=oi(s.c)),s.weekData}function ao(s){return s.localWeekData===null&&(s.localWeekData=oi(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function ve(s,t){let e={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new v({...e,...t,old:e})}function _c(s,t,e){let i=s-t*60*1e3,n=e.offset(i);if(t===n)return[i,t];i-=(n-t)*60*1e3;let r=e.offset(i);return n===r?[i,n]:[s-Math.min(n,r)*60*1e3,Math.max(n,r)]}function un(s,t){s+=t*60*1e3;let e=new Date(s);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function fn(s,t,e){return _c(es(s),t,e)}function mc(s,t){let e=s.o,i=s.c.year+Math.trunc(t.years),n=s.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...s.c,year:i,month:n,day:Math.min(s.c.day,ns(i,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=C.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=es(r),[l,c]=_c(a,e,s.zone);return o!==0&&(l+=o,c=s.zone.offset(l)),{ts:l,o:c}}function fi(s,t,e,i,n,r){let{setZone:o,zone:a}=e;if(s&&Object.keys(s).length!==0||t){let l=t||a,c=v.fromObject(s,{...e,zone:l,specificOffset:r});return o?c:c.setZone(a)}else return v.invalid(new rt("unparsable",`the input "${n}" can't be parsed as ${i}`))}function dn(s,t,e=!0){return s.isValid?X.create(N.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(s,t):null}function lo(s,t){let e=s.c.year>9999||s.c.year<0,i="";return e&&s.c.year>=0&&(i+="+"),i+=q(s.c.year,e?6:4),t?(i+="-",i+=q(s.c.month),i+="-",i+=q(s.c.day)):(i+=q(s.c.month),i+=q(s.c.day)),i}function gc(s,t,e,i,n,r){let o=q(s.c.hour);return t?(o+=":",o+=q(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!e)&&(o+=":")):o+=q(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!e)&&(o+=q(s.c.second),(s.c.millisecond!==0||!i)&&(o+=".",o+=q(s.c.millisecond,3))),n&&(s.isOffsetFixed&&s.offset===0&&!r?o+="Z":s.o<0?(o+="-",o+=q(Math.trunc(-s.o/60)),o+=":",o+=q(Math.trunc(-s.o%60))):(o+="+",o+=q(Math.trunc(s.o/60)),o+=":",o+=q(Math.trunc(s.o%60)))),r&&(o+="["+s.zone.ianaName+"]"),o}var wc={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},tg={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},eg={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Sc=["year","month","day","hour","minute","second","millisecond"],sg=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ig=["year","ordinal","hour","minute","second","millisecond"];function ng(s){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[s.toLowerCase()];if(!t)throw new ts(s);return t}function pc(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ng(s)}}function yc(s,t){let e=Et(t.zone,z.defaultZone),i=N.fromObject(t),n=z.now(),r,o;if(D(s.year))r=n;else{for(let c of Sc)D(s[c])&&(s[c]=wc[c]);let a=jr(s)||Ur(s);if(a)return v.invalid(a);let l=e.offset(n);[r,o]=fn(s,l,e)}return new v({ts:r,zone:e,loc:i,o})}function bc(s,t,e){let i=D(e.round)?!0:e.round,n=(o,a)=>(o=ss(o,i||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(o,a)),r=o=>e.calendary?t.hasSame(s,o)?0:t.startOf(o).diff(s.startOf(o),o).get(o):t.diff(s,o).get(o);if(e.unit)return n(r(e.unit),e.unit);for(let o of e.units){let a=r(o);if(Math.abs(a)>=1)return n(a,o)}return n(s>t?-0:0,e.units[e.units.length-1])}function xc(s){let t={},e;return s.length>0&&typeof s[s.length-1]=="object"?(t=s[s.length-1],e=Array.from(s).slice(0,s.length-1)):e=Array.from(s),[t,e]}var v=class{constructor(t){let e=t.zone||z.defaultZone,i=t.invalid||(Number.isNaN(t.ts)?new rt("invalid input"):null)||(e.isValid?null:hn(e));this.ts=D(t.ts)?z.now():t.ts;let n=null,r=null;if(!i)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,r]=[t.old.c,t.old.o];else{let a=e.offset(this.ts);n=un(this.ts,a),i=Number.isNaN(n.year)?new rt("invalid input"):null,n=i?null:n,r=i?null:a}this._zone=e,this.loc=t.loc||N.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new v({})}static local(){let[t,e]=xc(arguments),[i,n,r,o,a,l,c]=e;return yc({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static utc(){let[t,e]=xc(arguments),[i,n,r,o,a,l,c]=e;return t.zone=G.utcInstance,yc({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){let i=Al(t)?t.valueOf():NaN;if(Number.isNaN(i))return v.invalid("invalid input");let n=Et(e.zone,z.defaultZone);return n.isValid?new v({ts:i,zone:n,loc:N.fromObject(e)}):v.invalid(hn(n))}static fromMillis(t,e={}){if(zt(t))return t<-fc||t>fc?v.invalid("Timestamp out of range"):new v({ts:t,zone:Et(e.zone,z.defaultZone),loc:N.fromObject(e)});throw new st(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(zt(t))return new v({ts:t*1e3,zone:Et(e.zone,z.defaultZone),loc:N.fromObject(e)});throw new st("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};let i=Et(e.zone,z.defaultZone);if(!i.isValid)return v.invalid(hn(i));let n=N.fromObject(e),r=rs(t,pc),{minDaysInFirstWeek:o,startOfWeek:a}=$r(r,n),l=z.now(),c=D(e.specificOffset)?i.offset(l):e.specificOffset,h=!D(r.ordinal),u=!D(r.year),d=!D(r.month)||!D(r.day),f=u||d,m=r.weekYear||r.weekNumber;if((f||h)&&m)throw new vt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new vt("Can't mix ordinal dates with month/day");let g=m||r.weekday&&!f,p,y,b=un(l,c);g?(p=sg,y=tg,b=oi(b,o,a)):h?(p=ig,y=eg,b=ln(b)):(p=Sc,y=wc);let _=!1;for(let F of p){let W=r[F];D(W)?_?r[F]=y[F]:r[F]=b[F]:_=!0}let w=g?Il(r,o,a):h?Cl(r):jr(r),x=w||Ur(r);if(x)return v.invalid(x);let S=g?Hr(r,o,a):h?Br(r):r,[k,O]=fn(S,c,i),T=new v({ts:k,zone:i,o:O,loc:n});return r.weekday&&f&&t.weekday!==T.weekday?v.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${T.toISO()}`):T}static fromISO(t,e={}){let[i,n]=ql(t);return fi(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){let[i,n]=Gl(t);return fi(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){let[i,n]=Xl(t);return fi(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(D(t)||D(e))throw new st("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:r=null}=i,o=N.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,l,c,h]=dc(o,t,e);return h?v.invalid(h):fi(a,l,i,`format ${e}`,t,c)}static fromString(t,e,i={}){return v.fromFormat(t,e,i)}static fromSQL(t,e={}){let[i,n]=Ql(t);return fi(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new st("need to specify a reason the DateTime is invalid");let i=t instanceof rt?t:new rt(t,e);if(z.throwOnInvalid)throw new Gi(i);return new v({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){let i=no(t,N.fromObject(e));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return so(X.parseFormat(t),N.fromObject(e)).map(n=>n.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?oo(this).weekYear:NaN}get weekNumber(){return this.isValid?oo(this).weekNumber:NaN}get weekday(){return this.isValid?oo(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ao(this).weekday:NaN}get localWeekNumber(){return this.isValid?ao(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ao(this).weekYear:NaN}get ordinal(){return this.isValid?ln(this.c).ordinal:NaN}get monthShort(){return this.isValid?Gt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Gt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Gt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Gt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,e=6e4,i=es(this.c),n=this.zone.offset(i-t),r=this.zone.offset(i+t),o=this.zone.offset(i-n*e),a=this.zone.offset(i-r*e);if(o===a)return[this];let l=i-o*e,c=i-a*e,h=un(l,o),u=un(c,a);return h.hour===u.hour&&h.minute===u.minute&&h.second===u.second&&h.millisecond===u.millisecond?[ve(this,{ts:l}),ve(this,{ts:c})]:[this]}get isInLeapYear(){return Me(this.year)}get daysInMonth(){return ns(this.year,this.month)}get daysInYear(){return this.isValid?ce(this.year):NaN}get weeksInWeekYear(){return this.isValid?ke(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ke(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:e,numberingSystem:i,calendar:n}=X.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(G.instance(t),e)}toLocal(){return this.setZone(z.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if(t=Et(t,z.defaultZone),t.equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){let r=t.offset(this.ts),o=this.toObject();[n]=fn(o,r,t)}return ve(this,{ts:n,zone:t})}else return v.invalid(hn(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){let n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i});return ve(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let e=rs(t,pc),{minDaysInFirstWeek:i,startOfWeek:n}=$r(e,this.loc),r=!D(e.weekYear)||!D(e.weekNumber)||!D(e.weekday),o=!D(e.ordinal),a=!D(e.year),l=!D(e.month)||!D(e.day),c=a||l,h=e.weekYear||e.weekNumber;if((c||o)&&h)throw new vt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new vt("Can't mix ordinal dates with month/day");let u;r?u=Hr({...oi(this.c,i,n),...e},i,n):D(e.ordinal)?(u={...this.toObject(),...e},D(e.day)&&(u.day=Math.min(ns(u.year,u.month),u.day))):u=Br({...ln(this.c),...e});let[d,f]=fn(u,this.o,this.zone);return ve(this,{ts:d,o:f})}plus(t){if(!this.isValid)return this;let e=C.fromDurationLike(t);return ve(this,mc(this,e))}minus(t){if(!this.isValid)return this;let e=C.fromDurationLike(t).negate();return ve(this,mc(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;let i={},n=C.normalizeUnit(t);switch(n){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break;case"milliseconds":break}if(n==="weeks")if(e){let r=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),a=o?this:t,l=o?t:this,c=rc(a,l,r,n);return o?c.negate():c}diffNow(t="milliseconds",e={}){return this.diff(v.now(),t,e)}until(t){return this.isValid?U.fromDateTimes(this,t):this}hasSame(t,e,i){if(!this.isValid)return!1;let n=t.valueOf(),r=this.setZone(t.zone,{keepLocalTime:!0});return r.startOf(e,i)<=n&&n<=r.endOf(e,i)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let e=t.base||v.fromObject({},{zone:this.zone}),i=t.padding?thise.valueOf(),Math.min)}static max(...t){if(!t.every(v.isDateTime))throw new st("max requires all arguments be DateTimes");return Yr(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,i={}){let{locale:n=null,numberingSystem:r=null}=i,o=N.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return io(o,t,e)}static fromStringExplain(t,e,i={}){return v.fromFormatExplain(t,e,i)}static get DATE_SHORT(){return ae}static get DATE_MED(){return zs}static get DATE_MED_WITH_WEEKDAY(){return Tr}static get DATE_FULL(){return Vs}static get DATE_HUGE(){return Hs}static get TIME_SIMPLE(){return Bs}static get TIME_WITH_SECONDS(){return $s}static get TIME_WITH_SHORT_OFFSET(){return js}static get TIME_WITH_LONG_OFFSET(){return Us}static get TIME_24_SIMPLE(){return Ys}static get TIME_24_WITH_SECONDS(){return Zs}static get TIME_24_WITH_SHORT_OFFSET(){return qs}static get TIME_24_WITH_LONG_OFFSET(){return Gs}static get DATETIME_SHORT(){return Xs}static get DATETIME_SHORT_WITH_SECONDS(){return Ks}static get DATETIME_MED(){return Js}static get DATETIME_MED_WITH_SECONDS(){return Qs}static get DATETIME_MED_WITH_WEEKDAY(){return vr}static get DATETIME_FULL(){return ti}static get DATETIME_FULL_WITH_SECONDS(){return ei}static get DATETIME_HUGE(){return si}static get DATETIME_HUGE_WITH_SECONDS(){return ii}};function fs(s){if(v.isDateTime(s))return s;if(s&&s.valueOf&&zt(s.valueOf()))return v.fromJSDate(s);if(s&&typeof s=="object")return v.fromObject(s);throw new st(`Unknown datetime argument: ${s}, of type ${typeof s}`)}var rg={datetime:v.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:v.TIME_WITH_SECONDS,minute:v.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};kr._date.override({_id:"luxon",_create:function(s){return v.fromMillis(s,this.options)},init(s){this.options.locale||(this.options.locale=s.locale)},formats:function(){return rg},parse:function(s,t){let e=this.options,i=typeof s;return s===null||i==="undefined"?null:(i==="number"?s=this._create(s):i==="string"?typeof t=="string"?s=v.fromFormat(s,t,e):s=v.fromISO(s,e):s instanceof Date?s=v.fromJSDate(s,e):i==="object"&&!(s instanceof v)&&(s=v.fromObject(s,e)),s.isValid?s.valueOf():null)},format:function(s,t){let e=this._create(s);return typeof t=="string"?e.toFormat(t):e.toLocaleString(t)},add:function(s,t,e){let i={};return i[e]=t,this._create(s).plus(i).valueOf()},diff:function(s,t,e){return this._create(s).diff(this._create(t)).as(e).valueOf()},startOf:function(s,t,e){if(t==="isoWeek"){e=Math.trunc(Math.min(Math.max(0,e),6));let i=this._create(s);return i.minus({days:(i.weekday-e+7)%7}).startOf("day").valueOf()}return t?this._create(s).startOf(t).valueOf():s},endOf:function(s,t){return this._create(s).endOf(t).valueOf()}});function mn({cachedData:s,options:t,type:e}){return{init:function(){this.initChart(),this.$wire.$on("updateChartData",({data:i})=>{mn=this.getChart(),mn.data=i,mn.update("resize")}),Alpine.effect(()=>{Alpine.store("theme"),this.$nextTick(()=>{this.getChart()&&(this.getChart().destroy(),this.initChart())})}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Alpine.store("theme")==="system"&&this.$nextTick(()=>{this.getChart().destroy(),this.initChart()})})},initChart:function(i=null){var o,a,l,c,h,u,d;Rt.defaults.animation.duration=0,Rt.defaults.backgroundColor=getComputedStyle(this.$refs.backgroundColorElement).color;let n=getComputedStyle(this.$refs.borderColorElement).color;Rt.defaults.borderColor=n,Rt.defaults.color=getComputedStyle(this.$refs.textColorElement).color,Rt.defaults.font.family=getComputedStyle(this.$el).fontFamily,Rt.defaults.plugins.legend.labels.boxWidth=12,Rt.defaults.plugins.legend.position="bottom";let r=getComputedStyle(this.$refs.gridColorElement).color;return t??(t={}),t.borderWidth??(t.borderWidth=2),t.pointBackgroundColor??(t.pointBackgroundColor=n),t.pointHitRadius??(t.pointHitRadius=4),t.pointRadius??(t.pointRadius=2),t.scales??(t.scales={}),(o=t.scales).x??(o.x={}),(a=t.scales.x).grid??(a.grid={}),t.scales.x.grid.color=r,(l=t.scales.x.grid).display??(l.display=!1),(c=t.scales.x.grid).drawBorder??(c.drawBorder=!1),(h=t.scales).y??(h.y={}),(u=t.scales.y).grid??(u.grid={}),t.scales.y.grid.color=r,(d=t.scales.y.grid).drawBorder??(d.drawBorder=!1),new Rt(this.$refs.canvas,{type:e,data:i??s,options:t,plugins:window.filamentChartJsPlugins??[]})},getChart:function(){return Rt.getChart(this.$refs.canvas)}}}export{mn as default}; +`):s}function uf(s,t){let{element:e,datasetIndex:i,index:n}=t,r=s.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:s,label:o,parsed:r.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function Va(s,t){let e=s.chart.ctx,{body:i,footer:n,title:r}=s,{boxWidth:o,boxHeight:a}=t,l=st(t.bodyFont),c=st(t.titleFont),h=st(t.footerFont),u=r.length,d=n.length,f=i.length,m=at(t.padding),g=m.height,p=0,y=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(y+=s.beforeBody.length+s.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),y){let w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*w+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let b=0,_=function(w){p=Math.max(p,e.measureText(w).width+b)};return e.save(),e.font=c.string,H(s.title,_),e.font=l.string,H(s.beforeBody.concat(s.afterBody),_),b=t.displayColors?o+2+t.boxPadding:0,H(i,w=>{H(w.before,_),H(w.lines,_),H(w.after,_)}),b=0,e.font=h.string,H(s.footer,_),e.restore(),p+=m.width,{width:p,height:g}}function df(s,t){let{y:e,height:i}=t;return es.height-i/2?"bottom":"center"}function ff(s,t,e,i){let{x:n,width:r}=i,o=e.caretSize+e.caretPadding;if(s==="left"&&n+r+o>t.width||s==="right"&&n-r-o<0)return!0}function mf(s,t,e,i){let{x:n,width:r}=e,{width:o,chartArea:{left:a,right:l}}=s,c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),ff(c,s,t,e)&&(c="center"),c}function Ha(s,t,e){let i=e.yAlign||t.yAlign||df(s,e);return{xAlign:e.xAlign||t.xAlign||mf(s,t,e,i),yAlign:i}}function gf(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function pf(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function Ba(s,t,e,i){let{caretSize:n,caretPadding:r,cornerRadius:o}=s,{xAlign:a,yAlign:l}=e,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=se(o),m=gf(t,a),g=pf(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,d)+n:a==="right"&&(m+=Math.max(u,f)+n),{x:it(m,0,i.width-t.width),y:it(g,0,i.height-t.height)}}function Hi(s,t,e){let i=at(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function $a(s){return Pt([],Ut(s))}function yf(s,t,e){return $t(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ja(s,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}var Rs=class extends yt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new ji(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=yf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,n=i.beforeTitle.apply(this,[t]),r=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]),a=[];return a=Pt(a,Ut(n)),a=Pt(a,Ut(r)),a=Pt(a,Ut(o)),a}getBeforeBody(t,e){return $a(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:i}=e,n=[];return H(t,r=>{let o={before:[],lines:[],after:[]},a=ja(i,r);Pt(o.before,Ut(a.beforeLabel.call(this,r))),Pt(o.lines,a.label.call(this,r)),Pt(o.after,Ut(a.afterLabel.call(this,r))),n.push(o)}),n}getAfterBody(t,e){return $a(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:i}=e,n=i.beforeFooter.apply(this,[t]),r=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]),a=[];return a=Pt(a,Ut(n)),a=Pt(a,Ut(r)),a=Pt(a,Ut(o)),a}_createItems(t){let e=this._active,i=this.chart.data,n=[],r=[],o=[],a=[],l,c;for(l=0,c=e.length;lt.filter(h,u,d,i))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,i))),H(a,h=>{let u=ja(t.callbacks,h);n.push(u.labelColor.call(this,h)),r.push(u.labelPointStyle.call(this,h)),o.push(u.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),n=this._active,r,o=[];if(!n.length)this.opacity!==0&&(r={opacity:0});else{let a=Is[i.position].call(this,n,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);let l=this._size=Va(this,i),c=Object.assign({},a,l),h=Ha(this.chart,i,c),u=Ba(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){let r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){let{xAlign:n,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=se(a),{x:d,y:f}=t,{width:m,height:g}=e,p,y,b,_,w,x;return r==="center"?(w=f+g/2,n==="left"?(p=d,y=p-o,_=w+o,x=w-o):(p=d+m,y=p+o,_=w-o,x=w+o),b=p):(n==="left"?y=d+Math.max(l,h)+o:n==="right"?y=d+m-Math.max(c,u)-o:y=this.caretX,r==="top"?(_=f,w=_-o,p=y-o,b=y+o):(_=f+g,w=_+o,p=y+o,b=y-o),x=_),{x1:p,x2:y,x3:b,y1:_,y2:w,y3:x}}drawTitle(t,e,i){let n=this.title,r=n.length,o,a,l;if(r){let c=ye(i.rtl,this.x,this.width);for(t.x=Hi(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=st(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l_!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,We(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),We(t,{x:y,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:n}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,u=st(i.bodyFont),d=u.lineHeight,f=0,m=ye(i.rtl,this.x,this.width),g=function(O){e.fillText(O,m.x(t.x+f),t.y+d/2),t.y+=d+r},p=m.textAlign(o),y,b,_,w,x,S,k;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Hi(this,p,i),e.fillStyle=i.bodyColor,H(this.beforeBody,g),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,w=0,S=n.length;w0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){let o=Is[t.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=Va(this,t),l=Object.assign({},o,this._size),c=Ha(e,t,l),h=Ba(t,l,c,e);(n._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let o=at(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),er(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),sr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,n=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!ws(i,n),o=this._positionChanged(n,e);(r||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!ws(o,r)||a;return l&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){let r=this.options;if(t.type==="mouseout")return[];if(!n)return e;let o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:i,caretY:n,options:r}=this,o=Is[r.position].call(this,t,e);return o!==!1&&(i!==o.x||n!==o.y)}};Rs.positioners=Is;var bf={id:"tooltip",_element:Rs,positioners:Is,afterInit(s,t,e){e&&(s.tooltip=new Rs({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){let t=s.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){let e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:At,title(s){if(s.length>0){let t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndexs!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},xf=Object.freeze({__proto__:null,Decimation:Nd,Filler:nf,Legend:af,SubTitle:hf,Title:cf,Tooltip:bf}),_f=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function wf(s,t,e,i){let n=s.indexOf(t);if(n===-1)return _f(s,t,e,i);let r=s.lastIndexOf(t);return n!==r?e:n}var Sf=(s,t)=>s===null?null:it(Math.round(s),0,t),Je=class extends Yt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let i=this.getLabels();for(let{index:n,label:r}of e)i[n]===r&&i.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(N(t))return null;let i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:wf(i,t,C(e,t),this._addedLabels),Sf(e,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,n=[],r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};Je.id="category";Je.defaults={ticks:{callback:Je.prototype.getLabelForValue}};function kf(s,t){let e=[],{bounds:n,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=s,f=r||1,m=h-1,{min:g,max:p}=t,y=!N(o),b=!N(a),_=!N(c),w=(p-g)/(u+1),x=In((p-g)/m/f)*f,S,k,O,v;if(x<1e-14&&!y&&!b)return[{value:g},{value:p}];v=Math.ceil(p/x)-Math.floor(g/x),v>m&&(x=In(v*x/m/f)*f),N(l)||(S=Math.pow(10,l),x=Math.ceil(x*S)/S),n==="ticks"?(k=Math.floor(g/x)*x,O=Math.ceil(p/x)*x):(k=g,O=p),y&&b&&r&&Ao((a-o)/r,x/1e3)?(v=Math.round(Math.min((a-o)/x,h)),x=(a-o)/v,k=o,O=a):_?(k=y?o:k,O=b?a:O,v=c-1,x=(O-k)/v):(v=(O-k)/x,Re(v,Math.round(v),x/1e3)?v=Math.round(v):v=Math.ceil(v));let F=Math.max(An(x),An(k));S=Math.pow(10,N(l)?F:l),k=Math.round(k*S)/S,O=Math.round(O*S)/S;let W=0;for(y&&(d&&k!==o?(e.push({value:o}),kn=e?n:l,a=l=>r=i?r:l;if(t){let l=Tt(n),c=Tt(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(n-l)}this.min=n,this.max=r}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=kf(n,r);return t.bounds==="ticks"&&Fn(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ve(t,this.chart.options.locale,this.options.ticks.format)}},Ns=class extends Qe{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?t:0,this.max=K(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=wt(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};Ns.id="linear";Ns.defaults={ticks:{callback:Xi.formatters.numeric}};function Ya(s){return s/Math.pow(10,Math.floor(gt(s)))===1}function Mf(s,t){let e=Math.floor(gt(t.max)),i=Math.ceil(t.max/Math.pow(10,e)),n=[],r=mt(s.min,Math.pow(10,Math.floor(gt(t.min)))),o=Math.floor(gt(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do n.push({value:r,major:Ya(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?Math.max(0,t):null,this.max=K(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,n=this.max,r=l=>i=t?i:l,o=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(gt(l))+c);i===n&&(i<=0?(r(1),o(10)):(r(a(i,-1)),o(a(n,1)))),i<=0&&r(a(n,-1)),n<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&r(a(i,-1)),this.min=i,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=Mf(e,this);return t.bounds==="ticks"&&Fn(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":Ve(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=gt(t),this._valueRange=gt(this.max)-gt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(gt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};Ws.id="logarithmic";Ws.defaults={ticks:{callback:Xi.formatters.logarithmic,major:{enabled:!0}}};function vr(s){let t=s.ticks;if(t.display&&s.display){let e=at(t.backdropPadding);return C(t.font&&t.font.size,L.font.size)+e.height}return 0}function Tf(s,t,e){return e=$(e)?e:[e],{w:Yo(s,t.string,e),h:e.length*t.lineHeight}}function Za(s,t,e,i,n){return s===i||s===n?{start:t-e/2,end:t+e/2}:sn?{start:t-e,end:t}:{start:t,end:t+e}}function vf(s){let t={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},e=Object.assign({},t),i=[],n=[],r=s._pointLabels.length,o=s.options.pointLabels,a=o.centerPointLabels?Y/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,s.r=Math.max(s.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/o,s.b=Math.max(s.b,t.b+l))}function Df(s,t,e){let i=[],n=s._pointLabels.length,r=s.options,o=vr(r)/2,a=s.drawingArea,l=r.pointLabels.centerPointLabels?Y/n:0;for(let c=0;c270||e<90)&&(s-=t),s}function Ff(s,t){let{ctx:e,options:{pointLabels:i}}=s;for(let n=t-1;n>=0;n--){let r=i.setContext(s.getPointLabelContext(n)),o=st(r.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=s._pointLabelItems[n],{backdropColor:m}=r;if(!N(m)){let g=se(r.borderRadius),p=at(r.backdropPadding);e.fillStyle=m;let y=h-p.left,b=u-p.top,_=d-h+p.width,w=f-u+p.height;Object.values(g).some(x=>x!==0)?(e.beginPath(),We(e,{x:y,y:b,w:_,h:w,radius:g}),e.fill()):e.fillRect(y,b,_,w)}ee(e,s._pointLabels[n],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function pl(s,t,e,i){let{ctx:n}=s;if(e)n.arc(s.xCenter,s.yCenter,t,0,B);else{let r=s.getPointPosition(0,t);n.moveTo(r.x,r.y);for(let o=1;o{let n=j(this.options.pointLabels.callback,[e,i],this);return n||n===0?n:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?vf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}getIndexAngle(t){let e=B/(this._pointLabels.length||1),i=this.options.startAngle||0;return ht(t*e+wt(i))}getDistanceFromCenterForValue(t){if(N(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(N(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);let u=n.setContext(this.getContext(h-1));Af(this,u,a,r)}}),i.display){for(t.save(),o=r-1;o>=0;o--){let c=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:u}=c;!u||!h||(t.lineWidth=u,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let n=this.getIndexAngle(0),r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;let c=i.setContext(this.getContext(l)),h=st(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let u=at(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}ee(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}};_e.id="radialLinear";_e.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Xi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(s){return s},padding:5,centerPointLabels:!1}};_e.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};_e.descriptors={angleLines:{_fallback:"grid"}};var Ki={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ut=Object.keys(Ki);function Pf(s,t){return s-t}function qa(s,t){if(N(t))return null;let e=s._adapter,{parser:i,round:n,isoWeekday:r}=s._parseOpts,o=t;return typeof i=="function"&&(o=i(o)),K(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(n&&(o=n==="week"&&(pe(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,n)),+o)}function Ga(s,t,e,i){let n=ut.length;for(let r=ut.indexOf(s);r=ut.indexOf(e);r--){let o=ut[r];if(Ki[o].common&&s._adapter.diff(n,i,o)>=t-1)return o}return ut[e?ut.indexOf(e):0]}function Nf(s){for(let t=ut.indexOf(s)+1,e=ut.length;t=t?e[i]:e[n];s[r]=!0}}function Wf(s,t,e,i){let n=s._adapter,r=+n.startOf(t[0].value,i),o=t[t.length-1].value,a,l;for(a=r;a<=o;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Ka(s,t,e){let i=[],n={},r=t.length,o,a;for(o=0;o+t.value))}initOffsets(t){let e=0,i=0,n,r;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;e=it(e,0,o),i=it(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,n=this.options,r=n.time,o=r.unit||Ga(r.minUnit,e,i,this._getLabelCapacity(e)),a=C(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=pe(l)||l===!0,h={},u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);let m=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;dg-p).map(g=>+g)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,n){let r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],u=i[e],d=l&&h&&u&&u.major,f=this._adapter.format(t,n||(d?h:c)),m=r.ticks.callback;return m?j(m,[f,e,i],this):f}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Ft(s,"pos",t)),{pos:r,time:a}=s[i],{pos:o,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Ft(s,"time",t)),{time:r,pos:a}=s[i],{time:o,pos:l}=s[n]);let c=o-r;return c?a+(l-a)*(t-r)/c:a}var zs=class extends we{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Bi(e,this.min),this._tableRange=Bi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,n=[],r=[],o,a,l,c,h;for(o=0,a=t.length;o=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=n.length;o=0?m:1e3+m,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};var bl={};function jf(s,t={}){let e=JSON.stringify([s,t]),i=bl[e];return i||(i=new Intl.ListFormat(s,t),bl[e]=i),i}var Fr={};function Ar(s,t={}){let e=JSON.stringify([s,t]),i=Fr[e];return i||(i=new Intl.DateTimeFormat(s,t),Fr[e]=i),i}var Lr={};function Uf(s,t={}){let e=JSON.stringify([s,t]),i=Lr[e];return i||(i=new Intl.NumberFormat(s,t),Lr[e]=i),i}var Pr={};function Yf(s,t={}){let{base:e,...i}=t,n=JSON.stringify([s,i]),r=Pr[n];return r||(r=new Intl.RelativeTimeFormat(s,t),Pr[n]=r),r}var oi=null;function Zf(){return oi||(oi=new Intl.DateTimeFormat().resolvedOptions().locale,oi)}var xl={};function qf(s){let t=xl[s];if(!t){let e=new Intl.Locale(s);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,xl[s]=t}return t}function Gf(s){let t=s.indexOf("-x-");t!==-1&&(s=s.substring(0,t));let e=s.indexOf("-u-");if(e===-1)return[s];{let i,n;try{i=Ar(s).resolvedOptions(),n=s}catch{let l=s.substring(0,e);i=Ar(l).resolvedOptions(),n=l}let{numberingSystem:r,calendar:o}=i;return[n,r,o]}}function Xf(s,t,e){return(e||t)&&(s.includes("-u-")||(s+="-u"),e&&(s+=`-ca-${e}`),t&&(s+=`-nu-${t}`)),s}function Kf(s){let t=[];for(let e=1;e<=12;e++){let i=T.utc(2009,e,1);t.push(s(i))}return t}function Jf(s){let t=[];for(let e=1;e<=7;e++){let i=T.utc(2016,11,13+e);t.push(s(i))}return t}function on(s,t,e,i){let n=s.listingMode();return n==="error"?null:n==="en"?e(t):i(t)}function Qf(s){return s.numberingSystem&&s.numberingSystem!=="latn"?!1:s.numberingSystem==="latn"||!s.locale||s.locale.startsWith("en")||new Intl.DateTimeFormat(s.intl).resolvedOptions().numberingSystem==="latn"}var Rr=class{constructor(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;let{padTo:n,floor:r,...o}=i;if(!e||Object.keys(o).length>0){let a={useGrouping:!1,...i};i.padTo>0&&(a.minimumIntegerDigits=i.padTo),this.inf=Uf(t,a)}}format(t){if(this.inf){let e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{let e=this.floor?Math.floor(t):ss(t,3);return q(e,this.padTo)}}},Nr=class{constructor(t,e,i){this.opts=i,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let o=-1*(t.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&nt.create(a).valid?(n=a,this.dt=t):(n="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,n=t.zone.name):(n="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=Ar(e,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){let i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:i}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},Wr=class{constructor(t,e,i){this.opts={style:"long",...i},!e&&an()&&(this.rtf=Yf(t,i))}format(t,e){return this.rtf?this.rtf.format(t,e):_l(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}},tm={firstDay:1,minimalDays:4,weekend:[6,7]},P=class{static fromOpts(t){return P.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,i,n,r=!1){let o=t||z.defaultLocale,a=o||(r?"en-US":Zf()),l=e||z.defaultNumberingSystem,c=i||z.defaultOutputCalendar,h=ai(n)||z.defaultWeekSettings;return new P(a,l,c,h,o)}static resetCache(){oi=null,Fr={},Lr={},Pr={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:i,weekSettings:n}={}){return P.create(t,e,i,n)}constructor(t,e,i,n,r){let[o,a,l]=Gf(t);this.locale=o,this.numberingSystem=e||a||null,this.outputCalendar=i||l||null,this.weekSettings=n,this.intl=Xf(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Qf(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:P.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,ai(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return on(this,t,zr,()=>{let i=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=Kf(r=>this.extract(r,i,"month"))),this.monthsCache[n][t]})}weekdays(t,e=!1){return on(this,t,Vr,()=>{let i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=Jf(r=>this.extract(r,i,"weekday"))),this.weekdaysCache[n][t]})}meridiems(){return on(this,void 0,()=>Hr,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[T.utc(2016,11,13,9),T.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(t){return on(this,t,Br,()=>{let e={era:t};return this.eraCache[t]||(this.eraCache[t]=[T.utc(-40,1,1),T.utc(2017,1,1)].map(i=>this.extract(i,e,"era"))),this.eraCache[t]})}extract(t,e,i){let n=this.dtFormatter(t,e),r=n.formatToParts(),o=r.find(a=>a.type.toLowerCase()===i);return o?o.value:null}numberFormatter(t={}){return new Rr(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Nr(t,this.intl,e)}relFormatter(t={}){return new Wr(this.intl,this.isEnglish(),t)}listFormatter(t={}){return jf(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:ln()?qf(this.locale):tm}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}};var jr=null,G=class extends dt{static get utcInstance(){return jr===null&&(jr=new G(0)),jr}static instance(t){return t===0?G.utcInstance:new G(t)}static parseSpecifier(t){if(t){let e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new G(Se(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${le(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${le(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return le(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};var is=class extends dt{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Et(s,t){let e;if(D(s)||s===null)return t;if(s instanceof dt)return s;if(wl(s)){let i=s.toLowerCase();return i==="default"?t:i==="local"||i==="system"?zt.instance:i==="utc"||i==="gmt"?G.utcInstance:G.parseSpecifier(i)||nt.create(s)}else return Ct(s)?G.instance(s):typeof s=="object"&&"offset"in s&&typeof s.offset=="function"?s:new is(s)}var Ur={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Sl={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},em=Ur.hanidec.replace(/[\[|\]]/g,"").split("");function kl(s){let t=parseInt(s,10);if(isNaN(t)){t="";for(let e=0;e=r&&i<=o&&(t+=i-r)}}return parseInt(t,10)}else return t}var ns={};function Ml(){ns={}}function St({numberingSystem:s},t=""){let e=s||"latn";return ns[e]||(ns[e]={}),ns[e][t]||(ns[e][t]=new RegExp(`${Ur[e]}${t}`)),ns[e][t]}var Tl=()=>Date.now(),vl="system",Ol=null,Dl=null,El=null,Cl=60,Il,Fl=null,z=class{static get now(){return Tl}static set now(t){Tl=t}static set defaultZone(t){vl=t}static get defaultZone(){return Et(vl,zt.instance)}static get defaultLocale(){return Ol}static set defaultLocale(t){Ol=t}static get defaultNumberingSystem(){return Dl}static set defaultNumberingSystem(t){Dl=t}static get defaultOutputCalendar(){return El}static set defaultOutputCalendar(t){El=t}static get defaultWeekSettings(){return Fl}static set defaultWeekSettings(t){Fl=ai(t)}static get twoDigitCutoffYear(){return Cl}static set twoDigitCutoffYear(t){Cl=t%100}static get throwOnInvalid(){return Il}static set throwOnInvalid(t){Il=t}static resetCaches(){P.resetCache(),nt.resetCache(),T.resetCache(),Ml()}};var rt=class{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var Al=[0,31,59,90,120,151,181,212,243,273,304,334],Ll=[0,31,60,91,121,152,182,213,244,274,305,335];function kt(s,t){return new rt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${s}, which is invalid`)}function cn(s,t,e){let i=new Date(Date.UTC(s,t-1,e));s<100&&s>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);let n=i.getUTCDay();return n===0?7:n}function Pl(s,t,e){return e+(Me(s)?Ll:Al)[t-1]}function Rl(s,t){let e=Me(s)?Ll:Al,i=e.findIndex(r=>rke(i,t,e)?(c=i+1,l=1):c=i,{weekYear:c,weekNumber:l,weekday:a,...hi(s)}}function Yr(s,t=4,e=1){let{weekYear:i,weekNumber:n,weekday:r}=s,o=hn(cn(i,1,t),e),a=ce(i),l=n*7+r-o-7+t,c;l<1?(c=i-1,l+=ce(c)):l>a?(c=i+1,l-=ce(i)):c=i;let{month:h,day:u}=Rl(c,l);return{year:c,month:h,day:u,...hi(s)}}function un(s){let{year:t,month:e,day:i}=s,n=Pl(t,e,i);return{year:t,ordinal:n,...hi(s)}}function Zr(s){let{year:t,ordinal:e}=s,{month:i,day:n}=Rl(t,e);return{year:t,month:i,day:n,...hi(s)}}function qr(s,t){if(!D(s.localWeekday)||!D(s.localWeekNumber)||!D(s.localWeekYear)){if(!D(s.weekday)||!D(s.weekNumber)||!D(s.weekYear))throw new vt("Cannot mix locale-based week fields with ISO-based week fields");return D(s.localWeekday)||(s.weekday=s.localWeekday),D(s.localWeekNumber)||(s.weekNumber=s.localWeekNumber),D(s.localWeekYear)||(s.weekYear=s.localWeekYear),delete s.localWeekday,delete s.localWeekNumber,delete s.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Nl(s,t=4,e=1){let i=ci(s.weekYear),n=xt(s.weekNumber,1,ke(s.weekYear,t,e)),r=xt(s.weekday,1,7);return i?n?r?!1:kt("weekday",s.weekday):kt("week",s.weekNumber):kt("weekYear",s.weekYear)}function Wl(s){let t=ci(s.year),e=xt(s.ordinal,1,ce(s.year));return t?e?!1:kt("ordinal",s.ordinal):kt("year",s.year)}function Gr(s){let t=ci(s.year),e=xt(s.month,1,12),i=xt(s.day,1,rs(s.year,s.month));return t?e?i?!1:kt("day",s.day):kt("month",s.month):kt("year",s.year)}function Xr(s){let{hour:t,minute:e,second:i,millisecond:n}=s,r=xt(t,0,23)||t===24&&e===0&&i===0&&n===0,o=xt(e,0,59),a=xt(i,0,59),l=xt(n,0,999);return r?o?a?l?!1:kt("millisecond",n):kt("second",i):kt("minute",e):kt("hour",t)}function D(s){return typeof s>"u"}function Ct(s){return typeof s=="number"}function ci(s){return typeof s=="number"&&s%1===0}function wl(s){return typeof s=="string"}function Vl(s){return Object.prototype.toString.call(s)==="[object Date]"}function an(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function ln(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Hl(s){return Array.isArray(s)?s:[s]}function Kr(s,t,e){if(s.length!==0)return s.reduce((i,n)=>{let r=[t(n),n];return i&&e(i[0],r[0])===i[0]?i:r},null)[1]}function Bl(s,t){return t.reduce((e,i)=>(e[i]=s[i],e),{})}function he(s,t){return Object.prototype.hasOwnProperty.call(s,t)}function ai(s){if(s==null)return null;if(typeof s!="object")throw new J("Week settings must be an object");if(!xt(s.firstDay,1,7)||!xt(s.minimalDays,1,7)||!Array.isArray(s.weekend)||s.weekend.some(t=>!xt(t,1,7)))throw new J("Invalid week settings");return{firstDay:s.firstDay,minimalDays:s.minimalDays,weekend:Array.from(s.weekend)}}function xt(s,t,e){return ci(s)&&s>=t&&s<=e}function sm(s,t){return s-t*Math.floor(s/t)}function q(s,t=2){let e=s<0,i;return e?i="-"+(""+-s).padStart(t,"0"):i=(""+s).padStart(t,"0"),i}function qt(s){if(!(D(s)||s===null||s===""))return parseInt(s,10)}function ue(s){if(!(D(s)||s===null||s===""))return parseFloat(s)}function ui(s){if(!(D(s)||s===null||s==="")){let t=parseFloat("0."+s)*1e3;return Math.floor(t)}}function ss(s,t,e=!1){let i=10**t;return(e?Math.trunc:Math.round)(s*i)/i}function Me(s){return s%4===0&&(s%100!==0||s%400===0)}function ce(s){return Me(s)?366:365}function rs(s,t){let e=sm(t-1,12)+1,i=s+(t-e)/12;return e===2?Me(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function es(s){let t=Date.UTC(s.year,s.month-1,s.day,s.hour,s.minute,s.second,s.millisecond);return s.year<100&&s.year>=0&&(t=new Date(t),t.setUTCFullYear(s.year,s.month-1,s.day)),+t}function zl(s,t,e){return-hn(cn(s,1,t),e)+t-1}function ke(s,t=4,e=1){let i=zl(s,t,e),n=zl(s+1,t,e);return(ce(s)-i+n)/7}function di(s){return s>99?s:s>z.twoDigitCutoffYear?1900+s:2e3+s}function sn(s,t,e,i=null){let n=new Date(s),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(r.timeZone=i);let o={timeZoneName:t,...r},a=new Intl.DateTimeFormat(e,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Se(s,t){let e=parseInt(s,10);Number.isNaN(e)&&(e=0);let i=parseInt(t,10)||0,n=e<0||Object.is(e,-0)?-i:i;return e*60+n}function Jr(s){let t=Number(s);if(typeof s=="boolean"||s===""||Number.isNaN(t))throw new J(`Invalid unit value ${s}`);return t}function os(s,t){let e={};for(let i in s)if(he(s,i)){let n=s[i];if(n==null)continue;e[t(i)]=Jr(n)}return e}function le(s,t){let e=Math.trunc(Math.abs(s/60)),i=Math.trunc(Math.abs(s%60)),n=s>=0?"+":"-";switch(t){case"short":return`${n}${q(e,2)}:${q(i,2)}`;case"narrow":return`${n}${e}${i>0?`:${i}`:""}`;case"techie":return`${n}${q(e,2)}${q(i,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function hi(s){return Bl(s,["hour","minute","second","millisecond"])}var im=["January","February","March","April","May","June","July","August","September","October","November","December"],Qr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nm=["J","F","M","A","M","J","J","A","S","O","N","D"];function zr(s){switch(s){case"narrow":return[...nm];case"short":return[...Qr];case"long":return[...im];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var to=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],eo=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],rm=["M","T","W","T","F","S","S"];function Vr(s){switch(s){case"narrow":return[...rm];case"short":return[...eo];case"long":return[...to];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Hr=["AM","PM"],om=["Before Christ","Anno Domini"],am=["BC","AD"],lm=["B","A"];function Br(s){switch(s){case"narrow":return[...lm];case"short":return[...am];case"long":return[...om];default:return null}}function $l(s){return Hr[s.hour<12?0:1]}function jl(s,t){return Vr(t)[s.weekday-1]}function Ul(s,t){return zr(t)[s.month-1]}function Yl(s,t){return Br(t)[s.year<0?0:1]}function _l(s,t,e="always",i=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(s)===-1;if(e==="auto"&&r){let u=s==="days";switch(t){case 1:return u?"tomorrow":`next ${n[s][0]}`;case-1:return u?"yesterday":`last ${n[s][0]}`;case 0:return u?"today":`this ${n[s][0]}`;default:}}let o=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=n[s],h=i?l?c[1]:c[2]||c[1]:l?n[s][0]:s;return o?`${a} ${h} ago`:`in ${a} ${h}`}function Zl(s,t){let e="";for(let i of s)i.literal?e+=i.val:e+=t(i.val);return e}var cm={D:ae,DD:Hs,DDD:Bs,DDDD:$s,t:js,tt:Us,ttt:Ys,tttt:Zs,T:qs,TT:Gs,TTT:Xs,TTTT:Ks,f:Js,ff:ti,fff:si,ffff:ni,F:Qs,FF:ei,FFF:ii,FFFF:ri},X=class{static create(t,e={}){return new X(t,e)}static parseFormat(t){let e=null,i="",n=!1,r=[];for(let o=0;o0&&r.push({literal:n||/^\s+$/.test(i),val:i}),e=null,i="",n=!n):n||a===e?i+=a:(i.length>0&&r.push({literal:/^\s+$/.test(i),val:i}),i=a,e=a)}return i.length>0&&r.push({literal:n||/^\s+$/.test(i),val:i}),r}static macroTokenToFormatOpts(t){return cm[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return q(t,e);let i={...this.opts};return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)}formatDateTimeFromString(t,e){let i=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(f,m)=>this.loc.extract(t,f,m),o=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>i?$l(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,m)=>i?Ul(t,f):r(m?{month:f}:{month:f,day:"numeric"},"month"),c=(f,m)=>i?jl(t,f):r(m?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),h=f=>{let m=X.macroTokenToFormatOpts(f);return m?this.formatWithSystemDefault(t,m):f},u=f=>i?Yl(t,f):r({era:f},"era"),d=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return n?r({day:"numeric"},"day"):this.num(t.day);case"dd":return n?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return n?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?r({month:"numeric"},"month"):this.num(t.month);case"MM":return n?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?r({year:"numeric"},"year"):this.num(t.year);case"yy":return n?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(f)}};return Zl(X.parseFormat(e),d)}formatDurationFromString(t,e){let i=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=l=>c=>{let h=i(c);return h?this.num(l.get(h),c.length):c},r=X.parseFormat(e),o=r.reduce((l,{literal:c,val:h})=>c?l:l.concat(h),[]),a=t.shiftTo(...o.map(i).filter(l=>l));return Zl(r,n(a))}};var Gl=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ls(...s){let t=s.reduce((e,i)=>e+i.source,"");return RegExp(`^${t}$`)}function cs(...s){return t=>s.reduce(([e,i,n],r)=>{let[o,a,l]=r(t,n);return[{...e,...o},a||i,l]},[{},null,1]).slice(0,2)}function hs(s,...t){if(s==null)return[null,null];for(let[e,i]of t){let n=e.exec(s);if(n)return i(n)}return[null,null]}function Xl(...s){return(t,e)=>{let i={},n;for(n=0;nf!==void 0&&(m||f&&h)?-f:f;return[{years:d(ue(e)),months:d(ue(i)),weeks:d(ue(n)),days:d(ue(r)),hours:d(ue(o)),minutes:d(ue(a)),seconds:d(ue(l),l==="-0"),milliseconds:d(ui(c),u)}]}var Sm={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function no(s,t,e,i,n,r,o){let a={year:t.length===2?di(qt(t)):qt(t),month:Qr.indexOf(e)+1,day:qt(i),hour:qt(n),minute:qt(r)};return o&&(a.second=qt(o)),s&&(a.weekday=s.length>3?to.indexOf(s)+1:eo.indexOf(s)+1),a}var km=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Mm(s){let[,t,e,i,n,r,o,a,l,c,h,u]=s,d=no(t,n,i,e,r,o,a),f;return l?f=Sm[l]:c?f=0:f=Se(h,u),[d,new G(f)]}function Tm(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var vm=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Om=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Dm=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ql(s){let[,t,e,i,n,r,o,a]=s;return[no(t,n,i,e,r,o,a),G.utcInstance]}function Em(s){let[,t,e,i,n,r,o,a]=s;return[no(t,a,e,i,n,r,o),G.utcInstance]}var Cm=ls(um,io),Im=ls(dm,io),Fm=ls(fm,io),Am=ls(Jl),tc=cs(bm,us,fi,mi),Lm=cs(mm,us,fi,mi),Pm=cs(gm,us,fi,mi),Rm=cs(us,fi,mi);function ec(s){return hs(s,[Cm,tc],[Im,Lm],[Fm,Pm],[Am,Rm])}function sc(s){return hs(Tm(s),[km,Mm])}function ic(s){return hs(s,[vm,ql],[Om,ql],[Dm,Em])}function nc(s){return hs(s,[_m,wm])}var Nm=cs(us);function rc(s){return hs(s,[xm,Nm])}var Wm=ls(pm,ym),zm=ls(Ql),Vm=cs(us,fi,mi);function oc(s){return hs(s,[Wm,tc],[zm,Vm])}var ac="Invalid Duration",cc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Hm={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...cc},Mt=146097/400,ds=146097/4800,Bm={years:{quarters:4,months:12,weeks:Mt/7,days:Mt,hours:Mt*24,minutes:Mt*24*60,seconds:Mt*24*60*60,milliseconds:Mt*24*60*60*1e3},quarters:{months:3,weeks:Mt/28,days:Mt/4,hours:Mt*24/4,minutes:Mt*24*60/4,seconds:Mt*24*60*60/4,milliseconds:Mt*24*60*60*1e3/4},months:{weeks:ds/7,days:ds,hours:ds*24,minutes:ds*24*60,seconds:ds*24*60*60,milliseconds:ds*24*60*60*1e3},...cc},Te=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],$m=Te.slice(0).reverse();function de(s,t,e=!1){let i={values:e?t.values:{...s.values,...t.values||{}},loc:s.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||s.conversionAccuracy,matrix:t.matrix||s.matrix};return new I(i)}function hc(s,t){let e=t.milliseconds??0;for(let i of $m.slice(1))t[i]&&(e+=t[i]*s[i].milliseconds);return e}function lc(s,t){let e=hc(s,t)<0?-1:1;Te.reduceRight((i,n)=>{if(D(t[n]))return i;if(i){let r=t[i]*e,o=s[n][i],a=Math.floor(r/o);t[n]+=a*e,t[i]-=a*o*e}return n},null),Te.reduce((i,n)=>{if(D(t[n]))return i;if(i){let r=t[i]%1;t[i]-=r,t[n]+=r*s[i][n]}return n},null)}function jm(s){let t={};for(let[e,i]of Object.entries(s))i!==0&&(t[e]=i);return t}var I=class{constructor(t){let e=t.conversionAccuracy==="longterm"||!1,i=e?Bm:Hm;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||P.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(t,e){return I.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new J(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new I({values:os(t,I.normalizeUnit),loc:P.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Ct(t))return I.fromMillis(t);if(I.isDuration(t))return t;if(typeof t=="object")return I.fromObject(t);throw new J(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){let[i]=nc(t);return i?I.fromObject(i,e):I.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){let[i]=rc(t);return i?I.fromObject(i,e):I.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new J("need to specify a reason the Duration is invalid");let i=t instanceof rt?t:new rt(t,e);if(z.throwOnInvalid)throw new tn(i);return new I({invalid:i})}static normalizeUnit(t){let e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!e)throw new ts(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){let i={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?X.create(this.loc,i).formatDurationFromString(this,t):ac}toHuman(t={}){if(!this.isValid)return ac;let e=Te.map(i=>{let n=this.values[i];return D(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:i.slice(0,-1)}).format(n)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ss(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},T.fromMillis(e,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?hc(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let e=I.fromDurationLike(t),i={};for(let n of Te)(he(e.values,n)||he(this.values,n))&&(i[n]=e.get(n)+this.get(n));return de(this,{values:i},!0)}minus(t){if(!this.isValid)return this;let e=I.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;let e={};for(let i of Object.keys(this.values))e[i]=Jr(t(this.values[i],i));return de(this,{values:e},!0)}get(t){return this[I.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let e={...this.values,...os(t,I.normalizeUnit)};return de(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:i,matrix:n}={}){let o={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:i};return de(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return lc(this.matrix,t),de(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=jm(this.normalize().shiftToAll().toObject());return de(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>I.normalizeUnit(o));let e={},i={},n=this.toObject(),r;for(let o of Te)if(t.indexOf(o)>=0){r=o;let a=0;for(let c in i)a+=this.matrix[c][o]*i[c],i[c]=0;Ct(n[o])&&(a+=n[o]);let l=Math.trunc(a);e[o]=l,i[o]=(a*1e3-l*1e3)/1e3}else Ct(n[o])&&(i[o]=n[o]);for(let o in i)i[o]!==0&&(e[r]+=o===r?i[o]:i[o]/this.matrix[r][o]);return lc(this.matrix,e),de(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return de(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(i,n){return i===void 0||i===0?n===void 0||n===0:i===n}for(let i of Te)if(!e(this.values[i],t.values[i]))return!1;return!0}};var fs="Invalid Interval";function Um(s,t){return!s||!s.isValid?U.invalid("missing or invalid start"):!t||!t.isValid?U.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?U.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];let e=t.map(ms).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),i=[],{s:n}=this,r=0;for(;n+this.e?this.e:o;i.push(U.fromDateTimes(n,a)),n=a,r+=1}return i}splitBy(t){let e=I.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s:i}=this,n=1,r,o=[];for(;il*n));r=+a>+this.e?this.e:a,o.push(U.fromDateTimes(i,r)),i=r,n+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let e=this.s>t.s?this.s:t.s,i=this.e=i?null:U.fromDateTimes(e,i)}union(t){if(!this.isValid)return this;let e=this.st.e?this.e:t.e;return U.fromDateTimes(e,i)}static merge(t){let[e,i]=t.sort((n,r)=>n.s-r.s).reduce(([n,r],o)=>r?r.overlaps(o)||r.abutsStart(o)?[n,r.union(o)]:[n.concat([r]),o]:[n,o],[[],null]);return i&&e.push(i),e}static xor(t){let e=null,i=0,n=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...r),a=o.sort((l,c)=>l.time-c.time);for(let l of a)i+=l.type==="s"?1:-1,i===1?e=l.time:(e&&+e!=+l.time&&n.push(U.fromDateTimes(e,l.time)),e=null);return U.merge(n)}difference(...t){return U.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:fs}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=ae,e={}){return this.isValid?X.create(this.s.loc.clone(e),t).formatInterval(this):fs}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:fs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:fs}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:fs}toFormat(t,{separator:e=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:fs}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):I.invalid(this.invalidReason)}mapEndpoints(t){return U.fromDateTimes(t(this.s),t(this.e))}};var Gt=class{static hasDST(t=z.defaultZone){let e=T.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return nt.isValidZone(t)}static normalizeZone(t){return Et(t,z.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||P.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||P.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||P.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||P.create(e,i,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||P.create(e,i,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||P.create(e,i,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:i=null,locObj:n=null}={}){return(n||P.create(e,i,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return P.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return P.create(e,null,"gregory").eras(t)}static features(){return{relative:an(),localeWeek:ln()}}};function uc(s,t){let e=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=e(t)-e(s);return Math.floor(I.fromMillis(i).as("days"))}function Ym(s,t,e){let i=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{let h=uc(l,c);return(h-h%7)/7}],["days",uc]],n={},r=s,o,a;for(let[l,c]of i)e.indexOf(l)>=0&&(o=l,n[l]=c(s,t),a=r.plus(n),a>t?(n[l]--,s=r.plus(n),s>t&&(a=s,n[l]--,s=r.plus(n))):s=a);return[s,n,a,o]}function dc(s,t,e,i){let[n,r,o,a]=Ym(s,t,e),l=t-n,c=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);c.length===0&&(o0?I.fromMillis(l,i).shiftTo(...c).plus(h):h}var Zm="missing Intl.DateTimeFormat.formatToParts support";function V(s,t=e=>e){return{regex:s,deser:([e])=>t(kl(e))}}var qm=String.fromCharCode(160),gc=`[ ${qm}]`,pc=new RegExp(gc,"g");function Gm(s){return s.replace(/\./g,"\\.?").replace(pc,gc)}function fc(s){return s.replace(/\./g,"").replace(pc," ").toLowerCase()}function It(s,t){return s===null?null:{regex:RegExp(s.map(Gm).join("|")),deser:([e])=>s.findIndex(i=>fc(e)===fc(i))+t}}function mc(s,t){return{regex:s,deser:([,e,i])=>Se(e,i),groups:t}}function dn(s){return{regex:s,deser:([t])=>t}}function Xm(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Km(s,t){let e=St(t),i=St(t,"{2}"),n=St(t,"{3}"),r=St(t,"{4}"),o=St(t,"{6}"),a=St(t,"{1,2}"),l=St(t,"{1,3}"),c=St(t,"{1,6}"),h=St(t,"{1,9}"),u=St(t,"{2,4}"),d=St(t,"{4,6}"),f=p=>({regex:RegExp(Xm(p.val)),deser:([y])=>y,literal:!0}),g=(p=>{if(s.literal)return f(p);switch(p.val){case"G":return It(t.eras("short"),0);case"GG":return It(t.eras("long"),0);case"y":return V(c);case"yy":return V(u,di);case"yyyy":return V(r);case"yyyyy":return V(d);case"yyyyyy":return V(o);case"M":return V(a);case"MM":return V(i);case"MMM":return It(t.months("short",!0),1);case"MMMM":return It(t.months("long",!0),1);case"L":return V(a);case"LL":return V(i);case"LLL":return It(t.months("short",!1),1);case"LLLL":return It(t.months("long",!1),1);case"d":return V(a);case"dd":return V(i);case"o":return V(l);case"ooo":return V(n);case"HH":return V(i);case"H":return V(a);case"hh":return V(i);case"h":return V(a);case"mm":return V(i);case"m":return V(a);case"q":return V(a);case"qq":return V(i);case"s":return V(a);case"ss":return V(i);case"S":return V(l);case"SSS":return V(n);case"u":return dn(h);case"uu":return dn(a);case"uuu":return V(e);case"a":return It(t.meridiems(),0);case"kkkk":return V(r);case"kk":return V(u,di);case"W":return V(a);case"WW":return V(i);case"E":case"c":return V(e);case"EEE":return It(t.weekdays("short",!1),1);case"EEEE":return It(t.weekdays("long",!1),1);case"ccc":return It(t.weekdays("short",!0),1);case"cccc":return It(t.weekdays("long",!0),1);case"Z":case"ZZ":return mc(new RegExp(`([+-]${a.source})(?::(${i.source}))?`),2);case"ZZZ":return mc(new RegExp(`([+-]${a.source})(${i.source})?`),2);case"z":return dn(/[a-z_+-/]{1,256}?/i);case" ":return dn(/[^\S\n\r]/);default:return f(p)}})(s)||{invalidReason:Zm};return g.token=s,g}var Jm={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Qm(s,t,e){let{type:i,value:n}=s;if(i==="literal"){let l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}let r=t[i],o=i;i==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=e.hour12?"hour12":"hour24");let a=Jm[o];if(typeof a=="object"&&(a=a[r]),a)return{literal:!1,val:a}}function tg(s){return[`^${s.map(e=>e.regex).reduce((e,i)=>`${e}(${i.source})`,"")}$`,s]}function eg(s,t,e){let i=s.match(t);if(i){let n={},r=1;for(let o in e)if(he(e,o)){let a=e[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(i.slice(r,r+l))),r+=l}return[i,n]}else return[i,{}]}function sg(s){let t=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},e=null,i;return D(s.z)||(e=nt.create(s.z)),D(s.Z)||(e||(e=new G(s.Z)),i=s.Z),D(s.q)||(s.M=(s.q-1)*3+1),D(s.h)||(s.h<12&&s.a===1?s.h+=12:s.h===12&&s.a===0&&(s.h=0)),s.G===0&&s.y&&(s.y=-s.y),D(s.u)||(s.S=ui(s.u)),[Object.keys(s).reduce((r,o)=>{let a=t(o);return a&&(r[a]=s[o]),r},{}),e,i]}var ro=null;function ig(){return ro||(ro=T.fromMillis(1555555555555)),ro}function ng(s,t){if(s.literal)return s;let e=X.macroTokenToFormatOpts(s.val),i=lo(e,t);return i==null||i.includes(void 0)?s:i}function oo(s,t){return Array.prototype.concat(...s.map(e=>ng(e,t)))}var gi=class{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=oo(X.parseFormat(e),t),this.units=this.tokens.map(i=>Km(i,t)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){let[i,n]=tg(this.units);this.regex=RegExp(i,"i"),this.handlers=n}}explainFromTokens(t){if(this.isValid){let[e,i]=eg(t,this.regex,this.handlers),[n,r,o]=i?sg(i):[null,null,void 0];if(he(i,"a")&&he(i,"H"))throw new vt("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:i,result:n,zone:r,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function ao(s,t,e){return new gi(s,e).explainFromTokens(t)}function yc(s,t,e){let{result:i,zone:n,specificOffset:r,invalidReason:o}=ao(s,t,e);return[i,n,r,o]}function lo(s,t){if(!s)return null;let i=X.create(t,s).dtFormatter(ig()),n=i.formatToParts(),r=i.resolvedOptions();return n.map(o=>Qm(o,s,r))}var co="Invalid DateTime",bc=864e13;function pi(s){return new rt("unsupported zone",`the zone "${s.name}" is not supported`)}function ho(s){return s.weekData===null&&(s.weekData=li(s.c)),s.weekData}function uo(s){return s.localWeekData===null&&(s.localWeekData=li(s.c,s.loc.getMinDaysInFirstWeek(),s.loc.getStartOfWeek())),s.localWeekData}function ve(s,t){let e={ts:s.ts,zone:s.zone,c:s.c,o:s.o,loc:s.loc,invalid:s.invalid};return new T({...e,...t,old:e})}function Tc(s,t,e){let i=s-t*60*1e3,n=e.offset(i);if(t===n)return[i,t];i-=(n-t)*60*1e3;let r=e.offset(i);return n===r?[i,n]:[s-Math.min(n,r)*60*1e3,Math.max(n,r)]}function fn(s,t){s+=t*60*1e3;let e=new Date(s);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function gn(s,t,e){return Tc(es(s),t,e)}function xc(s,t){let e=s.o,i=s.c.year+Math.trunc(t.years),n=s.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...s.c,year:i,month:n,day:Math.min(s.c.day,rs(i,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=I.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=es(r),[l,c]=Tc(a,e,s.zone);return o!==0&&(l+=o,c=s.zone.offset(l)),{ts:l,o:c}}function gs(s,t,e,i,n,r){let{setZone:o,zone:a}=e;if(s&&Object.keys(s).length!==0||t){let l=t||a,c=T.fromObject(s,{...e,zone:l,specificOffset:r});return o?c:c.setZone(a)}else return T.invalid(new rt("unparsable",`the input "${n}" can't be parsed as ${i}`))}function mn(s,t,e=!0){return s.isValid?X.create(P.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(s,t):null}function fo(s,t){let e=s.c.year>9999||s.c.year<0,i="";return e&&s.c.year>=0&&(i+="+"),i+=q(s.c.year,e?6:4),t?(i+="-",i+=q(s.c.month),i+="-",i+=q(s.c.day)):(i+=q(s.c.month),i+=q(s.c.day)),i}function _c(s,t,e,i,n,r){let o=q(s.c.hour);return t?(o+=":",o+=q(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!e)&&(o+=":")):o+=q(s.c.minute),(s.c.millisecond!==0||s.c.second!==0||!e)&&(o+=q(s.c.second),(s.c.millisecond!==0||!i)&&(o+=".",o+=q(s.c.millisecond,3))),n&&(s.isOffsetFixed&&s.offset===0&&!r?o+="Z":s.o<0?(o+="-",o+=q(Math.trunc(-s.o/60)),o+=":",o+=q(Math.trunc(-s.o%60))):(o+="+",o+=q(Math.trunc(s.o/60)),o+=":",o+=q(Math.trunc(s.o%60)))),r&&(o+="["+s.zone.ianaName+"]"),o}var vc={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},rg={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},og={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Oc=["year","month","day","hour","minute","second","millisecond"],ag=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],lg=["year","ordinal","hour","minute","second","millisecond"];function cg(s){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[s.toLowerCase()];if(!t)throw new ts(s);return t}function wc(s){switch(s.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return cg(s)}}function hg(s){return yn[s]||(pn===void 0&&(pn=z.now()),yn[s]=s.offset(pn)),yn[s]}function Sc(s,t){let e=Et(t.zone,z.defaultZone);if(!e.isValid)return T.invalid(pi(e));let i=P.fromObject(t),n,r;if(D(s.year))n=z.now();else{for(let l of Oc)D(s[l])&&(s[l]=vc[l]);let o=Gr(s)||Xr(s);if(o)return T.invalid(o);let a=hg(e);[n,r]=gn(s,a,e)}return new T({ts:n,zone:e,loc:i,o:r})}function kc(s,t,e){let i=D(e.round)?!0:e.round,n=(o,a)=>(o=ss(o,i||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(o,a)),r=o=>e.calendary?t.hasSame(s,o)?0:t.startOf(o).diff(s.startOf(o),o).get(o):t.diff(s,o).get(o);if(e.unit)return n(r(e.unit),e.unit);for(let o of e.units){let a=r(o);if(Math.abs(a)>=1)return n(a,o)}return n(s>t?-0:0,e.units[e.units.length-1])}function Mc(s){let t={},e;return s.length>0&&typeof s[s.length-1]=="object"?(t=s[s.length-1],e=Array.from(s).slice(0,s.length-1)):e=Array.from(s),[t,e]}var pn,yn={},T=class{constructor(t){let e=t.zone||z.defaultZone,i=t.invalid||(Number.isNaN(t.ts)?new rt("invalid input"):null)||(e.isValid?null:pi(e));this.ts=D(t.ts)?z.now():t.ts;let n=null,r=null;if(!i)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,r]=[t.old.c,t.old.o];else{let a=Ct(t.o)&&!t.old?t.o:e.offset(this.ts);n=fn(this.ts,a),i=Number.isNaN(n.year)?new rt("invalid input"):null,n=i?null:n,r=i?null:a}this._zone=e,this.loc=t.loc||P.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new T({})}static local(){let[t,e]=Mc(arguments),[i,n,r,o,a,l,c]=e;return Sc({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static utc(){let[t,e]=Mc(arguments),[i,n,r,o,a,l,c]=e;return t.zone=G.utcInstance,Sc({year:i,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){let i=Vl(t)?t.valueOf():NaN;if(Number.isNaN(i))return T.invalid("invalid input");let n=Et(e.zone,z.defaultZone);return n.isValid?new T({ts:i,zone:n,loc:P.fromObject(e)}):T.invalid(pi(n))}static fromMillis(t,e={}){if(Ct(t))return t<-bc||t>bc?T.invalid("Timestamp out of range"):new T({ts:t,zone:Et(e.zone,z.defaultZone),loc:P.fromObject(e)});throw new J(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Ct(t))return new T({ts:t*1e3,zone:Et(e.zone,z.defaultZone),loc:P.fromObject(e)});throw new J("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};let i=Et(e.zone,z.defaultZone);if(!i.isValid)return T.invalid(pi(i));let n=P.fromObject(e),r=os(t,wc),{minDaysInFirstWeek:o,startOfWeek:a}=qr(r,n),l=z.now(),c=D(e.specificOffset)?i.offset(l):e.specificOffset,h=!D(r.ordinal),u=!D(r.year),d=!D(r.month)||!D(r.day),f=u||d,m=r.weekYear||r.weekNumber;if((f||h)&&m)throw new vt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new vt("Can't mix ordinal dates with month/day");let g=m||r.weekday&&!f,p,y,b=fn(l,c);g?(p=ag,y=rg,b=li(b,o,a)):h?(p=lg,y=og,b=un(b)):(p=Oc,y=vc);let _=!1;for(let F of p){let W=r[F];D(W)?_?r[F]=y[F]:r[F]=b[F]:_=!0}let w=g?Nl(r,o,a):h?Wl(r):Gr(r),x=w||Xr(r);if(x)return T.invalid(x);let S=g?Yr(r,o,a):h?Zr(r):r,[k,O]=gn(S,c,i),v=new T({ts:k,zone:i,o:O,loc:n});return r.weekday&&f&&t.weekday!==v.weekday?T.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${v.toISO()}`):v.isValid?v:T.invalid(v.invalid)}static fromISO(t,e={}){let[i,n]=ec(t);return gs(i,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){let[i,n]=sc(t);return gs(i,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){let[i,n]=ic(t);return gs(i,n,e,"HTTP",e)}static fromFormat(t,e,i={}){if(D(t)||D(e))throw new J("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:r=null}=i,o=P.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,l,c,h]=yc(o,t,e);return h?T.invalid(h):gs(a,l,i,`format ${e}`,t,c)}static fromString(t,e,i={}){return T.fromFormat(t,e,i)}static fromSQL(t,e={}){let[i,n]=oc(t);return gs(i,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new J("need to specify a reason the DateTime is invalid");let i=t instanceof rt?t:new rt(t,e);if(z.throwOnInvalid)throw new Ji(i);return new T({invalid:i})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){let i=lo(t,P.fromObject(e));return i?i.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return oo(X.parseFormat(t),P.fromObject(e)).map(n=>n.val).join("")}static resetCache(){pn=void 0,yn={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ho(this).weekYear:NaN}get weekNumber(){return this.isValid?ho(this).weekNumber:NaN}get weekday(){return this.isValid?ho(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?uo(this).weekday:NaN}get localWeekNumber(){return this.isValid?uo(this).weekNumber:NaN}get localWeekYear(){return this.isValid?uo(this).weekYear:NaN}get ordinal(){return this.isValid?un(this.c).ordinal:NaN}get monthShort(){return this.isValid?Gt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Gt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Gt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Gt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,e=6e4,i=es(this.c),n=this.zone.offset(i-t),r=this.zone.offset(i+t),o=this.zone.offset(i-n*e),a=this.zone.offset(i-r*e);if(o===a)return[this];let l=i-o*e,c=i-a*e,h=fn(l,o),u=fn(c,a);return h.hour===u.hour&&h.minute===u.minute&&h.second===u.second&&h.millisecond===u.millisecond?[ve(this,{ts:l}),ve(this,{ts:c})]:[this]}get isInLeapYear(){return Me(this.year)}get daysInMonth(){return rs(this.year,this.month)}get daysInYear(){return this.isValid?ce(this.year):NaN}get weeksInWeekYear(){return this.isValid?ke(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ke(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:e,numberingSystem:i,calendar:n}=X.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:i,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(G.instance(t),e)}toLocal(){return this.setZone(z.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:i=!1}={}){if(t=Et(t,z.defaultZone),t.equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||i){let r=t.offset(this.ts),o=this.toObject();[n]=gn(o,r,t)}return ve(this,{ts:n,zone:t})}else return T.invalid(pi(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:i}={}){let n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:i});return ve(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let e=os(t,wc),{minDaysInFirstWeek:i,startOfWeek:n}=qr(e,this.loc),r=!D(e.weekYear)||!D(e.weekNumber)||!D(e.weekday),o=!D(e.ordinal),a=!D(e.year),l=!D(e.month)||!D(e.day),c=a||l,h=e.weekYear||e.weekNumber;if((c||o)&&h)throw new vt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new vt("Can't mix ordinal dates with month/day");let u;r?u=Yr({...li(this.c,i,n),...e},i,n):D(e.ordinal)?(u={...this.toObject(),...e},D(e.day)&&(u.day=Math.min(rs(u.year,u.month),u.day))):u=Zr({...un(this.c),...e});let[d,f]=gn(u,this.o,this.zone);return ve(this,{ts:d,o:f})}plus(t){if(!this.isValid)return this;let e=I.fromDurationLike(t);return ve(this,xc(this,e))}minus(t){if(!this.isValid)return this;let e=I.fromDurationLike(t).negate();return ve(this,xc(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;let i={},n=I.normalizeUnit(t);switch(n){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break;case"milliseconds":break}if(n==="weeks")if(e){let r=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),a=o?this:t,l=o?t:this,c=dc(a,l,r,n);return o?c.negate():c}diffNow(t="milliseconds",e={}){return this.diff(T.now(),t,e)}until(t){return this.isValid?U.fromDateTimes(this,t):this}hasSame(t,e,i){if(!this.isValid)return!1;let n=t.valueOf(),r=this.setZone(t.zone,{keepLocalTime:!0});return r.startOf(e,i)<=n&&n<=r.endOf(e,i)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let e=t.base||T.fromObject({},{zone:this.zone}),i=t.padding?thise.valueOf(),Math.min)}static max(...t){if(!t.every(T.isDateTime))throw new J("max requires all arguments be DateTimes");return Kr(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,i={}){let{locale:n=null,numberingSystem:r=null}=i,o=P.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return ao(o,t,e)}static fromStringExplain(t,e,i={}){return T.fromFormatExplain(t,e,i)}static buildFormatParser(t,e={}){let{locale:i=null,numberingSystem:n=null}=e,r=P.fromOpts({locale:i,numberingSystem:n,defaultToEN:!0});return new gi(r,t)}static fromFormatParser(t,e,i={}){if(D(t)||D(e))throw new J("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:r=null}=i,o=P.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});if(!o.equals(e.locale))throw new J(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${e.locale}`);let{result:a,zone:l,specificOffset:c,invalidReason:h}=e.explainFromTokens(t);return h?T.invalid(h):gs(a,l,i,`format ${e.format}`,t,c)}static get DATE_SHORT(){return ae}static get DATE_MED(){return Hs}static get DATE_MED_WITH_WEEKDAY(){return Er}static get DATE_FULL(){return Bs}static get DATE_HUGE(){return $s}static get TIME_SIMPLE(){return js}static get TIME_WITH_SECONDS(){return Us}static get TIME_WITH_SHORT_OFFSET(){return Ys}static get TIME_WITH_LONG_OFFSET(){return Zs}static get TIME_24_SIMPLE(){return qs}static get TIME_24_WITH_SECONDS(){return Gs}static get TIME_24_WITH_SHORT_OFFSET(){return Xs}static get TIME_24_WITH_LONG_OFFSET(){return Ks}static get DATETIME_SHORT(){return Js}static get DATETIME_SHORT_WITH_SECONDS(){return Qs}static get DATETIME_MED(){return ti}static get DATETIME_MED_WITH_SECONDS(){return ei}static get DATETIME_MED_WITH_WEEKDAY(){return Cr}static get DATETIME_FULL(){return si}static get DATETIME_FULL_WITH_SECONDS(){return ii}static get DATETIME_HUGE(){return ni}static get DATETIME_HUGE_WITH_SECONDS(){return ri}};function ms(s){if(T.isDateTime(s))return s;if(s&&s.valueOf&&Ct(s.valueOf()))return T.fromJSDate(s);if(s&&typeof s=="object")return T.fromObject(s);throw new J(`Unknown datetime argument: ${s}, of type ${typeof s}`)}var ug={datetime:T.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:T.TIME_WITH_SECONDS,minute:T.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Or._date.override({_id:"luxon",_create:function(s){return T.fromMillis(s,this.options)},init(s){this.options.locale||(this.options.locale=s.locale)},formats:function(){return ug},parse:function(s,t){let e=this.options,i=typeof s;return s===null||i==="undefined"?null:(i==="number"?s=this._create(s):i==="string"?typeof t=="string"?s=T.fromFormat(s,t,e):s=T.fromISO(s,e):s instanceof Date?s=T.fromJSDate(s,e):i==="object"&&!(s instanceof T)&&(s=T.fromObject(s,e)),s.isValid?s.valueOf():null)},format:function(s,t){let e=this._create(s);return typeof t=="string"?e.toFormat(t):e.toLocaleString(t)},add:function(s,t,e){let i={};return i[e]=t,this._create(s).plus(i).valueOf()},diff:function(s,t,e){return this._create(s).diff(this._create(t)).as(e).valueOf()},startOf:function(s,t,e){if(t==="isoWeek"){e=Math.trunc(Math.min(Math.max(0,e),6));let i=this._create(s);return i.minus({days:(i.weekday-e+7)%7}).startOf("day").valueOf()}return t?this._create(s).startOf(t).valueOf():s},endOf:function(s,t){return this._create(s).endOf(t).valueOf()}});function bn({cachedData:s,options:t,type:e}){return{init:function(){this.initChart(),this.$wire.$on("updateChartData",({data:i})=>{bn=this.getChart(),bn.data=i,bn.update("resize")}),Alpine.effect(()=>{Alpine.store("theme"),this.$nextTick(()=>{this.getChart()&&(this.getChart().destroy(),this.initChart())})}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Alpine.store("theme")==="system"&&this.$nextTick(()=>{this.getChart().destroy(),this.initChart()})})},initChart:function(i=null){var o,a,l,c,h,u,d;Wt.defaults.animation.duration=0,Wt.defaults.backgroundColor=getComputedStyle(this.$refs.backgroundColorElement).color;let n=getComputedStyle(this.$refs.borderColorElement).color;Wt.defaults.borderColor=n,Wt.defaults.color=getComputedStyle(this.$refs.textColorElement).color,Wt.defaults.font.family=getComputedStyle(this.$el).fontFamily,Wt.defaults.plugins.legend.labels.boxWidth=12,Wt.defaults.plugins.legend.position="bottom";let r=getComputedStyle(this.$refs.gridColorElement).color;return t??(t={}),t.borderWidth??(t.borderWidth=2),t.pointBackgroundColor??(t.pointBackgroundColor=n),t.pointHitRadius??(t.pointHitRadius=4),t.pointRadius??(t.pointRadius=2),t.scales??(t.scales={}),(o=t.scales).x??(o.x={}),(a=t.scales.x).grid??(a.grid={}),t.scales.x.grid.color=r,(l=t.scales.x.grid).display??(l.display=!1),(c=t.scales.x.grid).drawBorder??(c.drawBorder=!1),(h=t.scales).y??(h.y={}),(u=t.scales.y).grid??(u.grid={}),t.scales.y.grid.color=r,(d=t.scales.y.grid).drawBorder??(d.drawBorder=!1),new Wt(this.$refs.canvas,{type:e,data:i??s,options:t,plugins:window.filamentChartJsPlugins??[]})},getChart:function(){return Wt.getChart(this.$refs.canvas)}}}export{bn as default}; /*! Bundled license information: chart.js/dist/chunks/helpers.segment.mjs: From 96b2dc80f3abbb0d76a0a911b5d16a49d9502a23 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:14:01 +0200 Subject: [PATCH 034/137] feat: the report changes form is made user friendly with pre-filled fields Accordingly changed the actions and eloquent queries. Commented out the table actions for now since they do not allow for approval of changes. --- .../Dashboard/Resources/ReportResource.php | 716 ++++++++---------- 1 file changed, 322 insertions(+), 394 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index e717152b..25f001ff 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -13,6 +13,7 @@ use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Checkbox; +use Filament\Forms\Components\Fieldset; use Filament\Forms\Components\Grid; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; @@ -45,6 +46,17 @@ class ReportResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; + protected static $molecule = null; + + protected static $approved_changes = null; + + protected static $overall_changes = null; + + public function __construct() + { + self::$molecule = request()->has('compound_id') ? Molecule::where('identifier', request()->compound_id)->first() : null; + } + public static function form(Form $form): Form { return $form @@ -60,15 +72,19 @@ public static function form(Form $form): Form true => 'Request Changes to Data', ]) ->inline() - ->hidden(function () { - return request()->has('type'); + ->hidden(function (string $operation, $record) { + return $operation == 'create' ? request()->has('type') : true; }) ->columnSpan(2), Actions::make([ Action::make('approve') - ->form([ - Textarea::make('reason'), - ]) + ->form(function ($record, $livewire) { + self::$approved_changes = self::prepareApprovedChanges($record, $livewire); + $key_value_fields = getChangesToDisplayModal(self::$approved_changes); + array_unshift($key_value_fields, Textarea::make('reason')); + + return $key_value_fields; + }) ->hidden(function (Get $get, string $operation) { return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; }) @@ -90,7 +106,7 @@ public static function form(Form $form): Form }), Action::make('viewCompoundPage') ->color('info') - ->url(fn (): string => env('APP_URL').'/compounds/'.request()->compound_id) + ->url(fn (string $operation, $record): string => $operation === 'create' ? env('APP_URL').'/compounds/'.request()->compound_id : env('APP_URL').'/compounds/'.$record->mol_id_csv) ->openUrlInNewTab(), ]) ->verticalAlignment(VerticalAlignment::End) @@ -112,7 +128,7 @@ public static function form(Form $form): Form ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Title of the report. This is required.') ->default(function () { if (request()->type == 'change' && request()->has('compound_id')) { - return 'Request changes'; + return 'Request changes to '.request()->compound_id; } }) ->required(), @@ -124,275 +140,192 @@ public static function form(Form $form): Form }), Tabs::make('suggested_changes') ->tabs([ - Tabs\Tab::make('organisms_changes') - ->label('Organisms') + Tabs\Tab::make('compound_info_changes') + ->label('Compound Info') ->schema([ - Repeater::make('organisms_changes') + Fieldset::make('Geo Locations') ->schema([ - Checkbox::make('approve') + Checkbox::make('approve_geo_locations') + ->label('Approve') ->inline(false) ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->disabled(false), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('organisms') - ->label('Organism') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->organisms()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('organisms.name', 'organisms.id')->toArray() ?? []; - }) - ->getOptionLabelUsing(fn ($value): ?string => Organism::find($value)?->name) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; - }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; - }) - ->columnSpan(2), - Grid::make('new_organism_details') - ->schema(Organism::getForm())->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(1), + Select::make('existing_geo_locations') + ->label('Existing') + ->multiple() + ->options(function (): array { + $geo_locations = []; + if (self::$molecule) { + $geo_locations = self::$molecule->geo_locations->pluck('name', 'id')->toArray(); + } + + return $geo_locations; }) - ->columnStart(2), + ->columnSpan(4), + TagsInput::make('new_geo_locations') + ->label('New') + ->separator(',') + ->splitKeys([',']) + ->columnSpan(4), ]) - ->reorderable(false) - ->columns(7), - - ]), - Tabs\Tab::make('geo_locations_changes') - ->label('Geo Locations') - ->schema([ - Repeater::make('geo_locations_changes') + ->columns(9), + Fieldset::make('Synonyms') ->schema([ - Checkbox::make('approve') + Checkbox::make('approve_synonyms') + ->label('Approve') ->inline(false) ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('geo_locations') - ->label('Geo Location') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->geo_locations()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('geo_locations.name', 'geo_locations.id')->toArray(); }) - ->getOptionLabelUsing(fn ($value): ?string => GeoLocation::find($value)?->name) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; - }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; - }) - ->columnSpan(2), - Grid::make('new_geo_locations_details') - ->schema(GeoLocation::getForm())->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(1), + Select::make('existing_synonyms') + ->label('Existing') + ->multiple() + ->options(function (): array { + $synonyms = []; + if (self::$molecule) { + $synonyms = self::$molecule->synonyms; + } + + return $synonyms; }) - ->columnStart(2), + ->columnSpan(4), + TagsInput::make('new_synonyms') + ->label('New') + ->separator(',') + ->splitKeys([',']) + ->columnSpan(4), ]) - ->reorderable(false) - ->columns(7), - ]), - Tabs\Tab::make('synonyms') - ->label('Synonyms') - ->schema([ - Repeater::make('synonyms_changes') + ->columns(9), + Fieldset::make('Name') ->schema([ - Checkbox::make('approve') + Checkbox::make('approve_name') + ->label('Approve') ->inline(false) ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('synonyms') - ->label('Synonym') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - $synonyms = Molecule::select('synonyms')->where('identifier', $get('../../mol_id_csv'))->get()[0]['synonyms']; - $matched_synonyms = []; - $associative_matched_synonyms = []; - foreach ($synonyms as $synonym) { - str_contains(strtolower($synonym), strtolower($search)) ? array_push($matched_synonyms, $synonym) : null; - } - foreach ($matched_synonyms as $item) { - $associative_matched_synonyms[$item] = $item; - } - - return $associative_matched_synonyms; }) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; + ->columnSpan(1), + Textarea::make('name') + ->default(function () { + if (self::$molecule) { + return self::$molecule->name; + } }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; + ->columnSpan(4), + ]) + ->columns(9), + Fieldset::make('CAS') + ->schema([ + Checkbox::make('approve_cas') + ->label('Approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->columnSpan(2), - Grid::make('new_synonym_details') - ->schema([ - TagsInput::make('new_synonym') - ->label('New Synonym') - ->separator(',') - ->splitKeys([',']), - ])->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(1), + Select::make('existing_cas') + ->label('Existing') + ->multiple() + ->options(function () { + if (self::$molecule) { + return self::$molecule->cas; + } }) - ->columnStart(2), + ->columnSpan(4), + TagsInput::make('new_cas') + ->label('New') + ->separator(',') + ->splitKeys([',']) + ->columnSpan(4), ]) - ->reorderable(false) - ->columns(7), + ->columns(9), ]), - Tabs\Tab::make('identifiers') - ->label('Identifiers') + Tabs\Tab::make('organisms_changes') + ->label('Organisms') ->schema([ - Repeater::make('identifiers_changes') + Fieldset::make('Organisms') ->schema([ - Checkbox::make('approve') - ->inline(false) + Checkbox::make('approve_existing_organisms') + ->label('Approve') ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('change') - ->options([ - 'name' => 'Name', - 'cas' => 'CAS', - ]) - ->default('name') - ->live(), - Select::make('current_Name') - ->options(function (Get $get): array { - $name = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->name ?? ''; - - return [$name => $name]; }) - ->hidden(function (Get $get) { - return $get('change') == 'cas'; - }) - ->columnSpan(2), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->hidden(function (Get $get) { - return $get('change') == 'name'; - }) - ->live() - ->columnSpan(2), - Select::make('current_cas') - ->label('Current CAS') - ->options(function (Get $get): array { - $cas_ids = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->cas ?? ''; - $associative_cas_ids = []; - foreach ($cas_ids as $item) { - $associative_cas_ids[$item] = $item; + ->columnSpanFull(), + Select::make('existing_organisms') + ->label('Existing') + ->multiple() + ->options(function () { + if (self::$molecule) { + return self::$molecule->organisms->pluck('name', 'id')->toArray(); } - - return $associative_cas_ids; }) ->hidden(function (Get $get) { - return $get('change') == 'name' || $get('operation') == 'add'; - }) - ->columnSpan(2), - TextInput::make('new_name') - ->label(function (Get $get) { - return $get('change') == 'name' ? 'New Name' : 'New CAS'; + return $get('operation') == 'add'; }) - ->hidden(function (Get $get) { - return $get('operation') == 'remove'; + ->columnSpan(9), + ]) + ->columns(9), + + Repeater::make('new_organisms') + ->label('') + ->schema([ + Checkbox::make('approve_new_organism') + ->label('Approve') + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->columnSpan(2), + ->disabled(false) + ->columnSpanFull(), + Grid::make('new_organism') + ->schema(Organism::getForm())->columns(4), ]) ->reorderable(false) - ->columns(7), + ->addActionLabel('Add New Organism') + ->defaultItems(0) + ->columns(9), + ]), Tabs\Tab::make('citations') ->label('Citations') ->schema([ - Repeater::make('citations_changes') + Fieldset::make('Citations') ->schema([ - Checkbox::make('approve') - ->inline(false) + Checkbox::make('approve_existing_citations') + ->label('Approve') ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('citations') - ->label('Citation') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->citations()->where('title', 'ilike', "%{$search}%")->limit(10)->pluck('citations.title', 'citations.id')->toArray(); - }) - ->getOptionLabelUsing(fn ($value): ?string => Citation::find($value)?->name) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; + ->columnSpanFull(), + Select::make('existing_citations') + ->label('Existing') + ->multiple() + ->options(function () { + if (self::$molecule) { + return self::$molecule->citations->where('title', '!=', null)->pluck('title', 'id')->toArray(); + } }) - ->columnSpan(2), - Grid::make('new_citation_details') - ->schema(Citation::getForm())->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(9), + ]) + ->columns(9), + Repeater::make('new_citations') + ->label('') + ->schema([ + Checkbox::make('approve_new_citation') + ->label('Approve') + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->columnStart(2), + ->columnSpanFull(), + Grid::make('new_citation') + ->schema(Citation::getForm())->columns(4), ]) ->reorderable(false) - ->columns(7), + ->addActionLabel('Add New Citation') + ->defaultItems(0) + ->columns(9), ]), ]) @@ -411,8 +344,8 @@ public static function form(Form $form): Form shouldOpenInNewTab: true, ), ) - ->hidden(function () { - return request()->has('type') && request()->type == 'change'; + ->hidden(function (string $operation, $record) { + return $operation == 'create' ? request()->has('type') && request()->type == 'change' : $record->is_change; }), Select::make('collections') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Select the Collections you want to report. This will help our Curators in reviewing your report.') @@ -550,30 +483,30 @@ public static function table(Table $table): Table ->visible(function ($record) { return auth()->user()->roles()->exists() && $record['status'] == 'submitted'; }), - Tables\Actions\Action::make('approve') - // ->button() - ->hidden(function (Report $record) { - return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; - }) - ->form([ - Textarea::make('reason'), - ]) - ->action(function (array $data, Report $record, Molecule $molecule, $livewire): void { - self::approveReport($data, $record, $molecule, $livewire); - }), - Tables\Actions\Action::make('reject') - // ->button() - ->color('danger') - ->hidden(function (Report $record) { - return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; - }) - ->form([ - Textarea::make('reason'), - - ]) - ->action(function (array $data, Report $record): void { - self::rejectReport($data, $record); - }), + // Tables\Actions\Action::make('approve') + // // ->button() + // ->hidden(function (Report $record) { + // return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; + // }) + // ->form([ + // Textarea::make('reason'), + // ]) + // ->action(function (array $data, Report $record, Molecule $molecule, $livewire): void { + // self::approveReport($data, $record, $molecule, $livewire); + // }), + // Tables\Actions\Action::make('reject') + // // ->button() + // ->color('danger') + // ->hidden(function (Report $record) { + // return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; + // }) + // ->form([ + // Textarea::make('reason'), + + // ]) + // ->action(function (array $data, Report $record): void { + // self::rejectReport($data, $record); + // }), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ @@ -613,10 +546,9 @@ public static function getEloquentQuery(): Builder return parent::getEloquentQuery(); } - public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void + public static function prepareApprovedChanges(Report $record, $livewire) { - $record['status'] = 'approved'; - $record['comment'] = $data['reason']; + $approved_changes = []; // In case of reporting a synthetic molecule, Deactivate Molecules if ($record['mol_id_csv'] && ! $record['is_change']) { @@ -629,27 +561,67 @@ public static function approveReport(array $data, Report $record, Molecule $mole } // In case of Changes, run SQL queries for the approved changes + $approved_changes['mol_id_csv'] = $record['mol_id_csv']; if ($record['is_change']) { - // To remove null values from the arrays before we assign them below - // dd(array_map(function($subArray) { - // return array_filter($subArray, function($value) { - // return !is_null($value); - // }); - // }, $livewire->data['organisms_changes'])); - - $suggestedChanges = $record->suggested_changes; - $suggestedChanges['organisms_changes'] = $livewire->data['organisms_changes']; - $suggestedChanges['geo_locations_changes'] = $livewire->data['geo_locations_changes']; - $suggestedChanges['synonyms_changes'] = $livewire->data['synonyms_changes']; - $suggestedChanges['identifiers_changes'] = $livewire->data['identifiers_changes']; - $suggestedChanges['citations_changes'] = $livewire->data['citations_changes']; - $record->suggested_changes = $suggestedChanges; + if ($livewire->data['approve_geo_locations']) { + $approved_changes['existing_geo_locations'] = $livewire->data['existing_geo_locations']; + $approved_changes['new_geo_locations'] = $livewire->data['new_geo_locations']; + } + + if ($livewire->data['approve_synonyms']) { + $approved_changes['existing_synonyms'] = $livewire->data['existing_synonyms']; + $approved_changes['new_synonyms'] = $livewire->data['new_synonyms']; + } + + if ($livewire->data['approve_name']) { + $approved_changes['name'] = $livewire->data['name']; + } + + if ($livewire->data['approve_cas']) { + $approved_changes['existing_cas'] = $livewire->data['existing_cas']; + $approved_changes['new_cas'] = $livewire->data['new_cas']; + } + + if ($livewire->data['approve_existing_organisms']) { + $approved_changes['existing_organisms'] = $livewire->data['existing_organisms']; + } + if (count($livewire->data['new_organisms']) > 0) { + foreach ($livewire->data['new_organisms'] as $key => $organism) { + if ($organism['approve_new_organism']) { + $approved_changes['new_organisms'][] = $organism; + } + } + } + + if ($livewire->data['approve_existing_citations']) { + $approved_changes['existing_citations'] = $livewire->data['existing_citations']; + } + if (count($livewire->data['new_citations']) > 0) { + foreach ($livewire->data['new_citations'] as $key => $citation) { + if ($citation['approve_new_citation']) { + $approved_changes['new_citations'][] = $citation; + } + } + } } + return $approved_changes; + } + + public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void + { + // dd($data, $record, $molecule, $livewire); // Run SQL queries for the approved changes self::runSQLQueries($record); + $suggested_changes = $record['suggested_changes']; + + $suggested_changes['approved_changes'] = self::$overall_changes; + $record['suggested_changes'] = $suggested_changes; + $record['comment'] = $data['reason']; + $record['status'] = 'approved'; + // Save the report record in any case $record->save(); } @@ -664,147 +636,103 @@ public static function rejectReport(array $data, Report $record): void public static function runSQLQueries(Report $record): void { DB::transaction(function () use ($record) { - // Check if organisms_changes exists and process it - if (isset($record->suggested_changes['organisms_changes'])) { - foreach ($record->suggested_changes['organisms_changes'] as $organism) { - if ($organism['approve'] && $organism['operation'] === 'update' && ! is_null($organism['organisms'])) { - // Perform update only if organisms ID is not null - // --------check if the organism name already exists - // --------need to handle iri and other fields of Organism for authentication - $db_organism = Organism::find($organism['organisms']); - $db_organism->name = $organism['name']; - $db_organism->save(); - } elseif ($organism['approve'] && $organism['operation'] === 'remove' && ! is_null($organism['organisms'])) { - // Perform delete only if organisms ID is not null - $db_organism = Organism::find($organism['organisms']); - $db_organism->delete(); - } elseif ($organism['approve'] && $organism['operation'] === 'add' && ! is_null($organism['name'])) { - // Perform insert only if name is not null (and other required fields can be checked too) - Organism::create([ - 'name' => $organism['name'], - 'iri' => $organism['iri'], - 'rank' => $organism['rank'], - ]); + self::$overall_changes = getOverallChanges(self::$approved_changes); + // dd(self::$overall_changes); + + // Check if 'molecule_id' is provided or use a default molecule for association/dissociation + $molecule = Molecule::where('identifier', $record['mol_id_csv'])->first(); + + // Apply Geo Location Changes + if (array_key_exists('geo_location_changes', self::$overall_changes)) { + if (! empty(self::$overall_changes['geo_location_changes']['delete'])) { + $detachable_geo_locations_ids = GeoLocation::whereIn('name', self::$overall_changes['geo_location_changes']['delete'])->pluck('id')->toArray(); + $molecule->auditDetach('geo_locations', $detachable_geo_locations_ids); + } + if (! empty(self::$overall_changes['geo_location_changes']['add'])) { + $geoLocations = explode(',', self::$overall_changes['geo_location_changes']['add']); + foreach ($geoLocations as $newLocation) { + $geo_location = GeoLocation::firstOrCreate(['name' => $newLocation]); + $molecule->auditAttach('geo_locations', $geo_location); } } } - // Check if geo_locations_changes exists and process it - if (isset($record->suggested_changes['geo_locations_changes'])) { - foreach ($record->suggested_changes['geo_locations_changes'] as $geo_location) { - if ($geo_location['approve'] && $geo_location['operation'] === 'update' && ! is_null($geo_location['geo_locations'])) { - // Perform update only if geo_locations ID is not null - $db_geo_location = GeoLocation::find($geo_location['geo_locations']); - $db_geo_location->name = $geo_location['name']; - $db_geo_location->save(); - } elseif ($geo_location['approve'] && $geo_location['operation'] === 'remove' && ! is_null($geo_location['geo_locations'])) { - // Perform delete only if geo_locations ID is not null - $db_geo_location = GeoLocation::find($geo_location['geo_locations']); - $db_geo_location->delete(); - } elseif ($geo_location['approve'] && $geo_location['operation'] === 'add' && ! is_null($geo_location['name'])) { - // Perform insert only if name is not null - GeoLocation::create(['name' => $geo_location['name']]); - } + // Apply Synonym Changes + if (array_key_exists('synonym_changes', self::$overall_changes)) { + $db_synonyms = $molecule->synonyms; + if (! empty(self::$overall_changes['synonym_changes']['delete'])) { + $db_synonyms = array_diff($db_synonyms, self::$overall_changes['synonym_changes']['delete']); + $molecule->synonyms = $db_synonyms; + } + if (! empty(self::$overall_changes['synonym_changes']['add'])) { + $synonyms = explode(',', self::$overall_changes['synonym_changes']['add']); + $db_synonyms = array_merge($db_synonyms, $synonyms); + $molecule->synonyms = $db_synonyms; } } - // Check if synonyms_changes exists and process it - if (isset($record->suggested_changes['synonyms_changes'])) { - foreach ($record->suggested_changes['synonyms_changes'] as $synonym) { - if ($synonym['approve'] && $synonym['operation'] === 'update' && ! is_null($synonym['synonyms'])) { - // Perform update only if synonym name is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $synonyms = $db_molecule->synonyms; - foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { - $synonyms[$key] = $synonym['name']; - } - $db_molecule->synonyms = $synonyms; - $db_molecule->save(); - } elseif ($synonym['approve'] && $synonym['operation'] === 'remove' && ! is_null($synonym['synonyms'])) { - // Perform delete only if synonym name is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $synonyms = $db_molecule->synonyms; - foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { - unset($synonyms[$key]); - } - $db_molecule->synonyms = $synonyms; - $db_molecule->save(); - } elseif ($synonym['approve'] && $synonym['operation'] === 'add' && ! empty($synonym['new_synonym'])) { - // Perform insert only if new_synonym is not empty - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $synonyms = $db_molecule->synonyms; - $synonyms = array_merge($synonyms, $synonym['new_synonym']); - $db_molecule->synonyms = $synonyms; - $db_molecule->save(); - } + // Apply Name Changes + if (array_key_exists('name_change', self::$overall_changes)) { + $molecule->name = self::$overall_changes['name_change']['new']; + $molecule->save(); + $molecule->refresh(); + } + + // Apply CAS Changes + if (array_key_exists('cas_changes', self::$overall_changes)) { + $db_cas = $molecule->cas; + if (! empty(self::$overall_changes['cas_changes']['delete'])) { + $db_cas = array_diff($db_cas, self::$overall_changes['cas_changes']['delete']); + $molecule->cas = $db_cas; + } + if (! empty(self::$overall_changes['cas_changes']['add'])) { + $cas = explode(',', self::$overall_changes['cas_changes']['add']); + $db_cas = array_merge($db_cas, $cas); + $molecule->cas = $db_cas; } } - // Check if identifiers_changes exists and process it - if (isset($record->suggested_changes['identifiers_changes'])) { - foreach ($record->suggested_changes['identifiers_changes'] as $identifier) { - if ($identifier['approve'] && $identifier['change'] === 'name' && ! is_null($identifier['current_Name']) && ! is_null($identifier['new_name'])) { - // Update name if current name and new name are not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $db_molecule->name = $identifier['new_name']; - $db_molecule->save(); - } elseif ($identifier['change'] == 'cas') { - if ($identifier['approve'] && $identifier['operation'] === 'update' && ! is_null($identifier['current_cas']) && ! is_null($identifier['new_name'])) { - // Update CAS if the current CAS and new name is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $cas = $db_molecule->cas; - foreach (array_keys($cas, $identifier['current_cas']) as $key) { - $cas[$key] = $identifier['new_name']; - } - $db_molecule->cas = $cas; - $db_molecule->save(); - } elseif ($identifier['approve'] && $identifier['operation'] === 'remove' && ! is_null($identifier['current_cas'])) { - // Perform delete only if CAS is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $cas = $db_molecule->cas; - foreach (array_keys($cas, $identifier['current_cas']) as $key) { - unset($cas[$key]); - } - $db_molecule->cas = $cas; - $db_molecule->save(); - } elseif ($identifier['approve'] && $identifier['operation'] === 'add' && ! is_null($identifier['new_name'])) { - // Perform insert only if new_name (CAS) is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $cas = $db_molecule->cas; - $cas[] = $identifier['new_name']; - $db_molecule->cas = $cas; - $db_molecule->save(); - } + // Apply Organism Changes: Dissociate from Molecule + if (array_key_exists('organism_changes', self::$overall_changes)) { + if (! empty(self::$overall_changes['organism_changes']['delete'])) { + $organismIds = Organism::whereIn('name', self::$overall_changes['organism_changes']['delete'])->pluck('id')->toArray(); + $molecule->auditDetach('organisms', $organismIds); + } + if (! empty(self::$overall_changes['organism_changes']['add'])) { + foreach (self::$overall_changes['organism_changes']['add'] as $newOrganism) { + $organism = Organism::firstOrCreate([ + 'name' => $newOrganism['name'], + 'iri' => $newOrganism['iri'], + 'rank' => $newOrganism['rank'], + 'molecule_count' => 1, + 'slug' => Str::slug($newOrganism['name']), + ]); + $molecule->auditAttach('organisms', $organism); } } } - // Check if citations_changes exists and process it - if (isset($record->suggested_changes['citations_changes'])) { - foreach ($record->suggested_changes['citations_changes'] as $citation) { - if ($citation['approve'] && $citation['operation'] === 'update' && ! is_null($citation['citations'])) { - // Perform update only if citation ID is not null - $db_citation = Citation::find($citation['citations']); - // $db_citation->doi = $citation['doi']; - $db_citation->title = $citation['name']; - // $db_citation->authors = $citation['authors']; - // $db_citation->citation_text = $citation['citation_text']; - $db_citation->save(); - } elseif ($citation['approve'] && $citation['operation'] === 'remove' && ! is_null($citation['citations'])) { - // Perform delete only if citation ID is not null - $db_citation = Citation::find($citation['citations']); - $db_citation->delete(); - } elseif ($citation['approve'] && $citation['operation'] === 'add' && ! is_null($citation['name'])) { - // Perform insert only if name (citation ID) is not null - $db_citation = new Citation; - $db_citation->doi = $citation['doi']; - $db_citation->title = $citation['title']; - $db_citation->authors = $citation['authors']; - $db_citation->citation_text = $citation['citation_text']; - $db_citation->save(); + // Apply Citation Changes: Dissociate from Molecule + if (array_key_exists('citation_changes', self::$overall_changes)) { + if (! empty(self::$overall_changes['citation_changes']['delete'])) { + $citations = Citation::whereIn('title', self::$overall_changes['citation_changes']['delete'])->get(); + $citationIds = $citations->pluck('id')->toArray(); + $molecule->auditDetach('citations', $citationIds); + } + if (! empty(self::$overall_changes['citation_changes']['add'])) { + foreach (self::$overall_changes['citation_changes']['add'] as $newCitation) { + $citation = Citation::firstOrCreate([ + 'doi' => $newCitation['doi'], + 'title' => $newCitation['title'], + 'authors' => $newCitation['authors'], + 'citation_text' => $newCitation['citation_text'], + ]); + $molecule->auditAttach('citations', $citation); } } } + + $molecule->save(); }); } } From 2c1149ff90d1ee831b2a4e200eb2a52e06c9b353 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:16:16 +0200 Subject: [PATCH 035/137] feat: enabled create time pop-up modal to display overall changes being requested The data structure of suggested changes is altered to suit the needs. --- .../ReportResource/Pages/CreateReport.php | 76 ++++++++++++++++--- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index f9e0b47d..53cfb665 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -8,30 +8,46 @@ use App\Models\Collection; use App\Models\Molecule; use App\Models\Organism; +use Filament\Actions\Action; use Filament\Resources\Pages\CreateRecord; class CreateReport extends CreateRecord { protected static string $resource = ReportResource::class; + protected $molecule; + public function getTitle(): string { $title = 'Create Report'; request()->type == 'change' ? $title = 'Request Changes' : $title = 'Report '; if (request()->has('compound_id')) { - $molecule = Molecule::where('identifier', request()->compound_id)->first(); - $title = $title.' - '.$molecule->name.' ('.$molecule->identifier.')'; + $title = $title.' - '.$this->molecule->name.' ('.$this->molecule->identifier.')'; } return __($title); } + protected function beforeFill(): void + { + if (request()->has('compound_id')) { + $this->molecule = Molecule::where('identifier', request()->compound_id)->first(); + } + } + protected function afterFill(): void { $request = request(); + $this->data['compound_id'] = $request->compound_id; if ($request->type == 'change') { $this->data['is_change'] = true; + $this->data['existing_geo_locations'] = $this->molecule->geo_locations->pluck('name')->toArray(); + $this->data['existing_synonyms'] = $this->molecule->synonyms; + $this->data['existing_cas'] = array_values($this->molecule->cas); + $this->data['existing_organisms'] = $this->molecule->organisms->pluck('name')->toArray(); + $this->data['existing_citations'] = $this->molecule->citations->where('title', '!=', null)->pluck('title')->toArray(); } + if ($request->has('collection_uuid')) { $collection = Collection::where('uuid', $request->collection_uuid)->get(); $id = $collection[0]->id; @@ -79,14 +95,40 @@ protected function mutateFormDataBeforeCreate(array $data): array $data['user_id'] = auth()->id(); $data['status'] = 'submitted'; - $suggested_changes = []; - $suggested_changes['organisms_changes'] = $data['organisms_changes']; - $suggested_changes['geo_locations_changes'] = $data['geo_locations_changes']; - $suggested_changes['synonyms_changes'] = $data['synonyms_changes']; - $suggested_changes['identifiers_changes'] = $data['identifiers_changes']; - $suggested_changes['citations_changes'] = $data['citations_changes']; + if ($data['is_change'] == true) { + $suggested_changes = []; + $suggested_changes['existing_geo_locations'] = $data['existing_geo_locations']; + $suggested_changes['new_geo_locations'] = $data['new_geo_locations']; + $suggested_changes['approve_geo_locations'] = false; + + $suggested_changes['existing_synonyms'] = $data['existing_synonyms']; + $suggested_changes['new_synonyms'] = $data['new_synonyms']; + $suggested_changes['approve_synonyms'] = false; + + $suggested_changes['name'] = $data['name']; + $suggested_changes['approve_name'] = false; + + $suggested_changes['existing_cas'] = $data['existing_cas']; + $suggested_changes['new_cas'] = $data['new_cas']; + $suggested_changes['approve_cas'] = false; - $data['suggested_changes'] = $suggested_changes; + $suggested_changes['existing_organisms'] = $data['existing_organisms']; + $suggested_changes['approve_existing_organisms'] = false; + + $suggested_changes['new_organisms'] = $data['new_organisms']; + + $suggested_changes['existing_citations'] = $data['existing_citations']; + $suggested_changes['approve_existing_citations'] = false; + + $suggested_changes['new_citations'] = $data['new_citations']; + + $suggested_changes['overall_changes'] = getOverallChanges($data); + + // seperate copy for Curators + $suggested_changes['curator'] = $suggested_changes; + + $data['suggested_changes'] = $suggested_changes; + } return $data; } @@ -104,4 +146,20 @@ protected function afterCreate(): void ReportSubmitted::dispatch($this->record); } + + protected function getCreateFormAction(): Action + { + return parent::getCreateFormAction() + ->submit(null) + ->form(function () { + return getChangesToDisplayModal($this->data); + }) + ->modalHidden(function () { + return ! $this->data['is_change']; + }) + ->action(function () { + $this->closeActionModal(); + $this->create(); + }); + } } From 8f8113d004475837a1811e1582bb9e76fbd1ad76 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:21:12 +0200 Subject: [PATCH 036/137] feat: altered the edit and view pages to load the new structure of the suggested changes View and edit pages now use a separate curator copy of suggested changes so as to allow further modifications. --- .../ReportResource/Pages/EditReport.php | 65 +++++++++++++++++-- .../ReportResource/Pages/ViewReport.php | 32 +++++++-- 2 files changed, 87 insertions(+), 10 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index 5471d32c..e3a7475b 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -12,11 +12,66 @@ class EditReport extends EditRecord protected function mutateFormDataBeforeFill(array $data): array { - $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; - $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; - $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; - $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; - $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + if ($data['is_change'] == true) { + $curators_copy_changes = $data['suggested_changes']['curator']; + $data['existing_geo_locations'] = $curators_copy_changes['existing_geo_locations']; + $data['new_geo_locations'] = $curators_copy_changes['new_geo_locations']; + $data['approve_geo_locations'] = $curators_copy_changes['approve_geo_locations']; + + $data['existing_synonyms'] = $curators_copy_changes['existing_synonyms']; + $data['new_synonyms'] = $curators_copy_changes['new_synonyms']; + $data['approve_synonyms'] = $curators_copy_changes['approve_synonyms']; + + $data['name'] = $curators_copy_changes['name']; + $data['approve_name'] = $curators_copy_changes['approve_name']; + + $data['existing_cas'] = $curators_copy_changes['existing_cas']; + $data['new_cas'] = $curators_copy_changes['new_cas']; + $data['approve_cas'] = $curators_copy_changes['approve_cas']; + + $data['existing_organisms'] = $curators_copy_changes['existing_organisms']; + $data['approve_existing_organisms'] = $curators_copy_changes['approve_existing_organisms']; + + $data['new_organisms'] = $curators_copy_changes['new_organisms']; + + $data['existing_citations'] = $curators_copy_changes['existing_citations']; + $data['approve_existing_citations'] = $curators_copy_changes['approve_existing_citations']; + + $data['new_citations'] = $curators_copy_changes['new_citations']; + } + + return $data; + } + + protected function mutateFormDataBeforeSave(array $data): array + { + if ($data['is_change'] == true) { + $data['suggested_changes']['curator']['existing_geo_locations'] = $data['existing_geo_locations']; + $data['suggested_changes']['curator']['new_geo_locations'] = $data['new_geo_locations']; + $data['suggested_changes']['curator']['approve_geo_locations'] = $data['approve_geo_locations']; + + $data['suggested_changes']['curator']['existing_synonyms'] = $data['existing_synonyms']; + $data['suggested_changes']['curator']['new_synonyms'] = $data['new_synonyms']; + $data['suggested_changes']['curator']['approve_synonyms'] = $data['approve_synonyms']; + + $data['suggested_changes']['curator']['name'] = $data['name']; + $data['suggested_changes']['curator']['approve_name'] = $data['approve_name']; + + $data['suggested_changes']['curator']['existing_cas'] = $data['existing_cas']; + $data['suggested_changes']['curator']['new_cas'] = $data['new_cas']; + $data['suggested_changes']['curator']['approve_cas'] = $data['approve_cas']; + + $data['suggested_changes']['curator']['existing_organisms'] = $data['existing_organisms']; + $data['suggested_changes']['curator']['approve_existing_organisms'] = $data['approve_existing_organisms']; + + $data['suggested_changes']['curator']['new_organisms'] = $data['new_organisms']; + + $data['suggested_changes']['curator']['existing_citations'] = $data['existing_citations']; + $data['suggested_changes']['curator']['approve_existing_citations'] = $data['approve_existing_citations']; + + $data['suggested_changes']['curator']['new_citations'] = $data['new_citations']; + + } return $data; } diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php index 6e3966f4..fedf1343 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php @@ -11,11 +11,33 @@ class ViewReport extends ViewRecord protected function mutateFormDataBeforeFill(array $data): array { - $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; - $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; - $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; - $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; - $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + if ($data['is_change'] == true) { + $curators_copy_changes = $data['suggested_changes']['curator']; + $data['existing_geo_locations'] = $curators_copy_changes['existing_geo_locations']; + $data['new_geo_locations'] = $curators_copy_changes['new_geo_locations']; + $data['approve_geo_locations'] = $curators_copy_changes['approve_geo_locations']; + + $data['existing_synonyms'] = $curators_copy_changes['existing_synonyms']; + $data['new_synonyms'] = $curators_copy_changes['new_synonyms']; + $data['approve_synonyms'] = $curators_copy_changes['approve_synonyms']; + + $data['name'] = $curators_copy_changes['name']; + $data['approve_name'] = $curators_copy_changes['approve_name']; + + $data['existing_cas'] = $curators_copy_changes['existing_cas']; + $data['new_cas'] = $curators_copy_changes['new_cas']; + $data['approve_cas'] = $curators_copy_changes['approve_cas']; + + $data['existing_organisms'] = $curators_copy_changes['existing_organisms']; + $data['approve_existing_organisms'] = $curators_copy_changes['approve_existing_organisms']; + + $data['new_organisms'] = $curators_copy_changes['new_organisms']; + + $data['existing_citations'] = $curators_copy_changes['existing_citations']; + $data['approve_existing_citations'] = $curators_copy_changes['approve_existing_citations']; + + $data['new_citations'] = $curators_copy_changes['new_citations']; + } return $data; } From bc36e7d1d8d90af60e6376986d7c0032204a1764 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:23:01 +0200 Subject: [PATCH 037/137] feat: new helper functions and fixes to the old ones to accommodate report suggestions workflow. --- app/Helper.php | 150 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 149 insertions(+), 1 deletion(-) diff --git a/app/Helper.php b/app/Helper.php index 3c4d62f2..65b2508c 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -1,6 +1,8 @@ 'id', 'name' => 'name', + 'title' => 'title', // 'identifier' => 'identifier', ]; @@ -194,12 +197,15 @@ function changeAudit(array $data): array $data[$key_type][$changed_model] = []; foreach ($changed_data_values as $key => $value) { $value = is_array($value) ? $value : $value->toArray(); - if ($value) { + if (array_key_exists('name', $value)) { if (array_key_exists('identifier', $value)) { $value['name'] = $value['name'].' (ID: '.$value['id'].')'.' (COCONUT ID: '.$value['identifier'].')'; } else { + // ! array_key_exists('name', $value) ? dd($value) : ''; $value['name'] = $value['name'].' (ID: '.$value['id'].')'; } + } else { + $value['title'] = $value['title'].' (ID: '.$value['id'].')'; } $data[$key_type][$changed_model][$key] = array_intersect_key($value, $whitelist); } @@ -232,3 +238,145 @@ function flattenArray(array $array, $prefix = ''): array return $result; } + +function getChangesToDisplayModal($data) +{ + $key_values = []; + $overall_changes = getOverallChanges($data); + + foreach ($overall_changes as $key => $value) { + if (count($value['changes']) == 0) { + continue; + } + array_push($key_values, KeyValue::make($key) + ->addable(false) + ->deletable(false) + ->keyLabel($value['key']) + ->valueLabel($value['value']) + ->editableKeys(false) + ->editableValues(false) + ->default( + $value['changes'] + )); + } + + return $key_values; +} + +function getOverallChanges($data) +{ + $overall_changes = []; + $geo_location_changes = []; + $molecule = Molecule::where('identifier', $data['mol_id_csv'])->first(); + + $db_geo_locations = $molecule->geo_locations->pluck('name')->toArray(); + $deletable_locations = array_key_exists('existing_geo_locations', $data) ? array_diff($db_geo_locations, $data['existing_geo_locations']) : []; + $new_locations = array_key_exists('new_geo_locations', $data) ? (is_string($data['new_geo_locations']) ? $data['new_geo_locations'] : implode(',', $data['new_geo_locations'])) : null; + if (count($deletable_locations) > 0 || $new_locations) { + $key = implode(',', $deletable_locations) == '' ? ' ' : implode(',', $deletable_locations); + $geo_location_changes[$key] = $new_locations; + $overall_changes['geo_location_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $geo_location_changes, + 'delete' => $deletable_locations, + 'add' => $new_locations, + ]; + } + + $synonym_changes = []; + $db_synonyms = $molecule->synonyms; + $deletable_synonyms = array_key_exists('existing_synonyms', $data) ? array_diff($db_synonyms, $data['existing_synonyms']) : []; + $new_synonyms = array_key_exists('new_synonyms', $data) ? (is_string($data['new_synonyms']) ? $data['new_synonyms'] : implode(',', $data['new_synonyms'])) : null; + if (count($deletable_synonyms) > 0 || $new_synonyms) { + $key = implode(',', $deletable_synonyms) == '' ? ' ' : implode(',', $deletable_synonyms); + $synonym_changes[$key] = $new_synonyms; + $overall_changes['synonym_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $synonym_changes, + 'delete' => $deletable_synonyms, + 'add' => $new_synonyms, + ]; + } + + $name_change = []; + if (array_key_exists('name', $data) && $data['name'] && $data['name'] != $molecule->name) { + $name_change[$molecule->name] = $data['name']; + $overall_changes['name_change'] = [ + 'key' => 'Old', + 'value' => 'New', + 'changes' => $name_change, + 'old' => $molecule->name, + 'new' => $data['name'], + ]; + } + + $cas_changes = []; + $db_cas = $molecule->cas; + $deletable_cas = array_key_exists('existing_cas', $data) ? array_diff($db_cas, $data['existing_cas']) : []; + $new_cas = array_key_exists('new_cas', $data) ? (is_string($data['new_cas']) ? $data['new_cas'] : implode(',', $data['new_cas'])) : null; + if (count($deletable_cas) > 0 || $new_cas) { + $key = implode(',', $deletable_cas) == '' ? ' ' : implode(',', $deletable_cas); + $cas_changes[$key] = $new_cas; + $overall_changes['cas_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $cas_changes, + 'delete' => $deletable_cas, + 'add' => $new_cas, + ]; + } + + $organism_changes = []; + $db_organisms = $molecule->organisms->pluck('name')->toArray(); + $deletable_organisms = array_key_exists('existing_organisms', $data) ? array_diff($db_organisms, $data['existing_organisms']) : []; + $new_organisms = []; + $new_organisms_form_data = []; + if (array_key_exists('new_organisms', $data)) { + foreach ($data['new_organisms'] as $organism) { + if ($organism['name']) { + $new_organisms[] = $organism['name']; + $new_organisms_form_data[] = $organism; + } + } + } + if (count($deletable_organisms) > 0 || count($new_organisms) > 0) { + $key = implode(',', $deletable_organisms) == '' ? ' ' : implode(',', $deletable_organisms); + $organism_changes[$key] = implode(',', $new_organisms); + $overall_changes['organism_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $organism_changes, + 'delete' => $deletable_organisms, + 'add' => $new_organisms_form_data, + ]; + } + + $citation_changes = []; + $db_citations = $molecule->citations->where('title', '<>', null)->pluck('title')->toArray(); + $deletable_citations = array_key_exists('existing_citations', $data) ? array_diff($db_citations, $data['existing_citations']) : []; + $new_citations = []; + $new_citations_form_data = []; + if (array_key_exists('new_citations', $data)) { + foreach ($data['new_citations'] as $ciation) { + if ($ciation['title']) { + $new_citations[] = $ciation['title']; + $new_citations_form_data[] = $ciation; + } + } + } + if (count($deletable_citations) > 0 || count($new_citations) > 0) { + $key = implode(',', $deletable_citations) == '' ? ' ' : implode(',', $deletable_citations); + $citation_changes[$key] = implode(',', $new_citations); + $overall_changes['citation_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $citation_changes, + 'delete' => $deletable_citations, + 'add' => $new_citations_form_data, + ]; + } + + return $overall_changes; +} From cceba8e5406961751f91b58ecc755d3099b9996f Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:23:37 +0200 Subject: [PATCH 038/137] feat: now timeline can handle citations --- .../views/livewire/molecule-history-timeline.blade.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index 702cb219..036d0579 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -71,6 +71,14 @@ Added:
{{implode(', ',array_diff($column_values['new_value'], $column_values['old_value']))}}
@endif @break + @case('citations') + @if ($column_values['old_value']) + Detached from:
{{$column_values['old_value']?:'N/A'}}
+ @endif + @if ($column_values['new_value']) + Attached to:
{{$column_values['new_value']?:'N/A'}}
+ @endif + @break @default Old Value:
{{$column_values['old_value']??'N/A'}}
New Value:
{{$column_values['new_value']??'N/A'}} From ae4bd28e39a6a2bcfc542de9eee09a3e46f781d2 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:25:09 +0200 Subject: [PATCH 039/137] chore: removed dd statements. --- app/Filament/Dashboard/Resources/ReportResource.php | 2 -- app/Helper.php | 1 - app/Livewire/MoleculeHistoryTimeline.php | 3 --- 3 files changed, 6 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 25f001ff..185cbe68 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -611,7 +611,6 @@ public static function prepareApprovedChanges(Report $record, $livewire) public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void { - // dd($data, $record, $molecule, $livewire); // Run SQL queries for the approved changes self::runSQLQueries($record); @@ -637,7 +636,6 @@ public static function runSQLQueries(Report $record): void { DB::transaction(function () use ($record) { self::$overall_changes = getOverallChanges(self::$approved_changes); - // dd(self::$overall_changes); // Check if 'molecule_id' is provided or use a default molecule for association/dissociation $molecule = Molecule::where('identifier', $record['mol_id_csv'])->first(); diff --git a/app/Helper.php b/app/Helper.php index 65b2508c..f1dffad3 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -201,7 +201,6 @@ function changeAudit(array $data): array if (array_key_exists('identifier', $value)) { $value['name'] = $value['name'].' (ID: '.$value['id'].')'.' (COCONUT ID: '.$value['identifier'].')'; } else { - // ! array_key_exists('name', $value) ? dd($value) : ''; $value['name'] = $value['name'].' (ID: '.$value['id'].')'; } } else { diff --git a/app/Livewire/MoleculeHistoryTimeline.php b/app/Livewire/MoleculeHistoryTimeline.php index 2c79262f..29675c18 100644 --- a/app/Livewire/MoleculeHistoryTimeline.php +++ b/app/Livewire/MoleculeHistoryTimeline.php @@ -18,8 +18,6 @@ public function getHistory() $audit_data[$index]['user_name'] = $audit->getMetadata()['user_name']; $audit_data[$index]['event'] = $audit->getMetadata()['audit_event']; $audit_data[$index]['created_at'] = date('Y/m/d', strtotime($audit->getMetadata()['audit_created_at'])); - // dd($audit->old_values, $audit->new_values); - // dd($audit->getModified()); $key = null; $old_key = $audit->old_values ? explode('.', array_keys($audit->old_values)[0])[0] : null; @@ -41,7 +39,6 @@ public function getHistory() array_push($audit_data, $initial_audit); $this->audit_data = $audit_data; - // dd($audit_data); } public function render() From dbf6c0dc0069ac935194d5b300dd24964561f210 Mon Sep 17 00:00:00 2001 From: Kohulan Rajan Date: Wed, 2 Oct 2024 13:47:09 +0200 Subject: [PATCH 040/137] fix: typo --- resources/views/livewire/molecule-details.blade.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index 81443122..c7277048 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -773,8 +773,7 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm">
-

Parent (With - out +

Parent (Without stereo definitions)

From 87363b3c620c71a65a291ea950162e30bf48776c Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 14:48:45 +0200 Subject: [PATCH 041/137] fix: conditional checks were refined to work with the data structures of audits. --- app/Livewire/MoleculeHistoryTimeline.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/Livewire/MoleculeHistoryTimeline.php b/app/Livewire/MoleculeHistoryTimeline.php index f12a0364..e5c70752 100644 --- a/app/Livewire/MoleculeHistoryTimeline.php +++ b/app/Livewire/MoleculeHistoryTimeline.php @@ -19,16 +19,19 @@ public function getHistory() $audit_data[$index]['event'] = $audit->getMetadata()['audit_event']; $audit_data[$index]['created_at'] = date('Y/m/d', strtotime($audit->getMetadata()['audit_created_at'])); - if (str_contains('.', array_keys($audit->old_values)[0])) { - $old_key = $audit->old_values ? explode('.', array_keys($audit->old_values)[0])[0] : null; - $new_key = $audit->new_values ? explode('.', array_keys($audit->new_values)[0])[0] : null; - - $old_key = $old_key ?: $new_key; - $new_key = $new_key ?: $old_key; + $values = !empty($audit->old_values) ? $audit->old_values : $audit->new_values; + $first_affected_column = !empty($values) ? array_keys($values)[0] : null; + + if (str_contains($first_affected_column, '.')) { + $affected_column = explode('.', $first_affected_column)[0]; + + $audit_data[$index]['affected_columns'][$affected_column]['old_value'] = $audit->old_values ? array_values($audit->old_values)[0] : null; + $audit_data[$index]['affected_columns'][$affected_column]['new_value'] = $audit->new_values ? array_values($audit->new_values)[0] : null; } else { - foreach ($audit->getModified() as $key => $value) { - $audit_data[$index]['affected_columns'][$key]['old_value'] = $value['old'] ?: null; - $audit_data[$index]['affected_columns'][$key]['new_value'] = $value['new'] ?: null; + foreach ($audit->getModified() as $affected_column => $value) { + + $audit_data[$index]['affected_columns'][$affected_column]['old_value'] = array_key_exists('old', $value) ? $value['old'] : null; + $audit_data[$index]['affected_columns'][$affected_column]['new_value'] = array_key_exists('new', $value) ? $value['new'] : null; } } } @@ -42,7 +45,6 @@ public function getHistory() array_push($audit_data, $initial_audit); $this->audit_data = $audit_data; - // dd($audit_data); } public function render() From 54bc73fdeadb6149993c2cfb3a8327ef8fd8eccc Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 15:02:15 +0200 Subject: [PATCH 042/137] fix: to capture audits from citations --- app/Helper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Helper.php b/app/Helper.php index 3c4d62f2..297eff94 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -180,6 +180,7 @@ function changeAudit(array $data): array $whitelist = [ // 'id' => 'id', 'name' => 'name', + 'title' => 'title', // 'identifier' => 'identifier', ]; From c71fbc265a3b9049afb5c1b49cd65f0feb2a3044 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 15:05:17 +0200 Subject: [PATCH 043/137] fix: additional checks --- app/Helper.php | 4 +++- app/Livewire/MoleculeHistoryTimeline.php | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Helper.php b/app/Helper.php index 297eff94..39e3df31 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -195,12 +195,14 @@ function changeAudit(array $data): array $data[$key_type][$changed_model] = []; foreach ($changed_data_values as $key => $value) { $value = is_array($value) ? $value : $value->toArray(); - if ($value) { + if (array_key_exists('name', $value)) { if (array_key_exists('identifier', $value)) { $value['name'] = $value['name'].' (ID: '.$value['id'].')'.' (COCONUT ID: '.$value['identifier'].')'; } else { $value['name'] = $value['name'].' (ID: '.$value['id'].')'; } + } else { + $value['name'] = $value['title'].' (ID: '.$value['id'].')'; } $data[$key_type][$changed_model][$key] = array_intersect_key($value, $whitelist); } diff --git a/app/Livewire/MoleculeHistoryTimeline.php b/app/Livewire/MoleculeHistoryTimeline.php index e5c70752..dddb734f 100644 --- a/app/Livewire/MoleculeHistoryTimeline.php +++ b/app/Livewire/MoleculeHistoryTimeline.php @@ -19,12 +19,12 @@ public function getHistory() $audit_data[$index]['event'] = $audit->getMetadata()['audit_event']; $audit_data[$index]['created_at'] = date('Y/m/d', strtotime($audit->getMetadata()['audit_created_at'])); - $values = !empty($audit->old_values) ? $audit->old_values : $audit->new_values; - $first_affected_column = !empty($values) ? array_keys($values)[0] : null; + $values = ! empty($audit->old_values) ? $audit->old_values : $audit->new_values; + $first_affected_column = ! empty($values) ? array_keys($values)[0] : null; if (str_contains($first_affected_column, '.')) { $affected_column = explode('.', $first_affected_column)[0]; - + $audit_data[$index]['affected_columns'][$affected_column]['old_value'] = $audit->old_values ? array_values($audit->old_values)[0] : null; $audit_data[$index]['affected_columns'][$affected_column]['new_value'] = $audit->new_values ? array_values($audit->new_values)[0] : null; } else { From ceba3a99b99b98a9b439844bca81e7306e6cce4c Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 24 Sep 2024 00:57:48 +0200 Subject: [PATCH 044/137] fix: key issue fixed --- app/Livewire/MoleculeHistoryTimeline.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Livewire/MoleculeHistoryTimeline.php b/app/Livewire/MoleculeHistoryTimeline.php index dddb734f..fdb71291 100644 --- a/app/Livewire/MoleculeHistoryTimeline.php +++ b/app/Livewire/MoleculeHistoryTimeline.php @@ -18,6 +18,8 @@ public function getHistory() $audit_data[$index]['user_name'] = $audit->getMetadata()['user_name']; $audit_data[$index]['event'] = $audit->getMetadata()['audit_event']; $audit_data[$index]['created_at'] = date('Y/m/d', strtotime($audit->getMetadata()['audit_created_at'])); + // dd($audit->old_values, $audit->new_values); + // dd($audit->getModified()); $values = ! empty($audit->old_values) ? $audit->old_values : $audit->new_values; $first_affected_column = ! empty($values) ? array_keys($values)[0] : null; From f858ec03e252442ad4be2a84a03377e609c99539 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 24 Sep 2024 12:44:02 +0200 Subject: [PATCH 045/137] fix: disabled logging empty values and enabled handling of existing empty values in both old and new columns --- config/audit.php | 2 +- resources/views/livewire/molecule-history-timeline.blade.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/audit.php b/config/audit.php index df6dd561..bf34de57 100644 --- a/config/audit.php +++ b/config/audit.php @@ -101,7 +101,7 @@ | */ - 'empty_values' => true, + 'empty_values' => false, 'allowed_empty_values' => [ 'retrieved', ], diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index 65542b72..589ccd15 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -9,6 +9,7 @@
    @foreach ($audit_data as $audit) + @if (array_key_exists('affected_columns', $audit))
  • @@ -62,6 +63,7 @@ @endforeach
  • + @endif @endforeach
From 6396ce9e328e90b54edaa081de6b1ee391bf9eda Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 24 Sep 2024 12:49:29 +0200 Subject: [PATCH 046/137] fix: now the timestamps are auto managed for the pivot table molecule_sample_location --- app/Models/Molecule.php | 2 +- app/Models/SampleLocation.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Molecule.php b/app/Models/Molecule.php index 707e5cb3..1387e7c0 100644 --- a/app/Models/Molecule.php +++ b/app/Models/Molecule.php @@ -129,7 +129,7 @@ public function geo_locations(): BelongsToMany public function sampleLocations(): BelongsToMany { - return $this->belongsToMany(SampleLocation::class); + return $this->belongsToMany(SampleLocation::class)->withTimestamps(); } /** diff --git a/app/Models/SampleLocation.php b/app/Models/SampleLocation.php index c7f64a54..c54ec90e 100644 --- a/app/Models/SampleLocation.php +++ b/app/Models/SampleLocation.php @@ -38,7 +38,7 @@ public function organisms(): HasOne public function molecules(): BelongsToMany { - return $this->belongsToMany(Molecule::class); + return $this->belongsToMany(Molecule::class)->withTimestamps(); } public function transformAudit(array $data): array From cb40e705202d7131ccdd9c0dfcca235c6b04f8eb Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 18 Sep 2024 02:00:13 +0200 Subject: [PATCH 047/137] wip: suggested changes are now stored in the reports table. SQL queries need to be built at the time of approving the report --- app/Actions/Coconut/SearchMolecule.php | 1 - .../Dashboard/Resources/CitationResource.php | 88 +------ .../Resources/CollectionResource.php | 3 - .../Resources/GeoLocationResource.php | 7 +- .../Dashboard/Resources/OrganismResource.php | 99 +------- .../Dashboard/Resources/ReportResource.php | 232 +++++++++++++++++- .../ReportResource/Pages/CreateReport.php | 9 + app/Http/Controllers/API/SearchController.php | 4 - app/Models/Citation.php | 91 +++++++ app/Models/GeoLocation.php | 10 + app/Models/Organism.php | 100 ++++++++ app/Models/Report.php | 7 +- 12 files changed, 445 insertions(+), 206 deletions(-) diff --git a/app/Actions/Coconut/SearchMolecule.php b/app/Actions/Coconut/SearchMolecule.php index c360495b..cdb3e5c5 100644 --- a/app/Actions/Coconut/SearchMolecule.php +++ b/app/Actions/Coconut/SearchMolecule.php @@ -354,7 +354,6 @@ private function executeQuery($statement) $ids_array = collect($hits)->pluck('id')->toArray(); $ids = implode(',', $ids_array); - // dd($ids); if ($ids != '') { diff --git a/app/Filament/Dashboard/Resources/CitationResource.php b/app/Filament/Dashboard/Resources/CitationResource.php index 00776312..28ee9b40 100644 --- a/app/Filament/Dashboard/Resources/CitationResource.php +++ b/app/Filament/Dashboard/Resources/CitationResource.php @@ -6,18 +6,12 @@ use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\CollectionRelationManager; use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\MoleculeRelationManager; use App\Models\Citation; -use Closure; -use Filament\Forms\Components\Section; -use Filament\Forms\Components\Textarea; -use Filament\Forms\Components\TextInput; use Filament\Forms\Form; -use Filament\Forms\Get; use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; use Illuminate\Support\Facades\Cache; -use Illuminate\Support\HtmlString; use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager; class CitationResource extends Resource @@ -35,87 +29,7 @@ class CitationResource extends Resource public static function form(Form $form): Form { return $form - ->schema([ - Section::make() - ->schema([ - TextInput::make('failMessage') - ->default('') - ->hidden() - ->disabled(), - TextInput::make('doi') - ->label('DOI') - ->live(onBlur: true) - ->afterStateUpdated(function ($set, $state) { - if (doiRegxMatch($state)) { - $citationDetails = fetchDOICitation($state); - if ($citationDetails) { - $set('title', $citationDetails['title']); - $set('authors', $citationDetails['authors']); - $set('citation_text', $citationDetails['citation_text']); - $set('failMessage', 'Success'); - } else { - $set('failMessage', 'No citation found. Please fill in the details manually'); - } - } else { - $set('failMessage', 'Invalid DOI'); - } - }) - ->helperText(function ($get) { - - if ($get('failMessage') == 'Fetching') { - return new HtmlString(' - - - '); - } elseif ($get('failMessage') != 'Success') { - return new HtmlString(''.$get('failMessage').''); - } else { - return null; - } - }) - ->required() - ->unique() - ->rules([ - fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { - if ($get('failMessage') != 'No citation found. Please fill in the details manually') { - $fail($get('failMessage')); - } - }, - ]) - ->validationMessages([ - 'unique' => 'The DOI already exists.', - ]), - ]), - - Section::make() - ->schema([ - TextInput::make('title') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - TextInput::make('authors') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - Textarea::make('citation_text') - ->label('Citation text / URL') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - ])->columns(1), - ]); + ->schema(Citation::getForm()); } public static function table(Table $table): Table diff --git a/app/Filament/Dashboard/Resources/CollectionResource.php b/app/Filament/Dashboard/Resources/CollectionResource.php index 500fe6cb..72d72403 100644 --- a/app/Filament/Dashboard/Resources/CollectionResource.php +++ b/app/Filament/Dashboard/Resources/CollectionResource.php @@ -131,9 +131,6 @@ public static function table(Table $table): Table public static function getRelations(): array { - // $record = static::getOwner(); - // dd(static::getOwner()); - // dd(static::$model::molecules()->get()); $arr = [ EntriesRelationManager::class, CitationsRelationManager::class, diff --git a/app/Filament/Dashboard/Resources/GeoLocationResource.php b/app/Filament/Dashboard/Resources/GeoLocationResource.php index 9288ff9c..2e96fcb7 100644 --- a/app/Filament/Dashboard/Resources/GeoLocationResource.php +++ b/app/Filament/Dashboard/Resources/GeoLocationResource.php @@ -5,7 +5,6 @@ use App\Filament\Dashboard\Resources\GeoLocationResource\Pages; use App\Filament\Dashboard\Resources\GeoLocationResource\Widgets\GeoLocationStats; use App\Models\GeoLocation; -use Filament\Forms\Components\TextInput; use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; @@ -26,11 +25,7 @@ class GeoLocationResource extends Resource public static function form(Form $form): Form { return $form - ->schema([ - TextInput::make('name') - ->required() - ->maxLength(255), - ]); + ->schema(GeoLocation::getForm()); } public static function table(Table $table): Table diff --git a/app/Filament/Dashboard/Resources/OrganismResource.php b/app/Filament/Dashboard/Resources/OrganismResource.php index 2f162e54..9624a38e 100644 --- a/app/Filament/Dashboard/Resources/OrganismResource.php +++ b/app/Filament/Dashboard/Resources/OrganismResource.php @@ -9,8 +9,6 @@ use App\Forms\Components\OrganismsTable; use App\Models\Organism; use Archilex\AdvancedTables\Filters\AdvancedFilter; -use Filament\Forms; -use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Grid; use Filament\Forms\Components\Group; use Filament\Forms\Components\Section; @@ -43,102 +41,9 @@ public static function form(Form $form): Form Group::make() ->schema([ Section::make('') - ->schema([ - Forms\Components\TextInput::make('name') - ->required() - ->unique() - ->maxLength(255) - ->suffixAction( - Action::make('infoFromSources') - ->icon('heroicon-m-clipboard') - // ->fillForm(function ($record, callable $get): array { - // $entered_name = $get('name'); - // $name = ucfirst(trim($entered_name)); - // $data = null; - // $iri = null; - // $organism = null; - // $rank = null; - - // if ($name && $name != '') { - // $data = Self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - // } - // return [ - // 'name' => $name, - // 'iri' => $iri, - // 'rank' => $rank, - // ]; - // }) - // ->form([ - // Forms\Components\TextInput::make('name')->readOnly(), - // Forms\Components\TextInput::make('iri')->readOnly(), - // Forms\Components\TextInput::make('rank')->readOnly(), - // ]) - // ->action(fn ( $record) => $record->advance()) - ->modalContent(function ($record, $get): View { - $name = ucfirst(trim($get('name'))); - $data = null; - // $iri = null; - // $organism = null; - // $rank = null; - - if ($name && $name != '') { - $data = self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - } - - return view( - 'forms.components.organism-info', - [ - 'data' => $data, - ], - ); - }) - ->action(function (array $data, Organism $record): void { - // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); - }) - ->slideOver() - ), - Forms\Components\TextInput::make('iri') - ->label('IRI') - ->maxLength(255), - Forms\Components\TextInput::make('rank') - ->maxLength(255), - ]), + ->schema(Organism::getForm()), ]) ->columnSpan(1), - Group::make() ->schema([ Section::make('') @@ -254,7 +159,6 @@ protected static function getGNFMatches($name, $organism) $responseBody = json_decode($response->getBody(), true); return $responseBody; - // dd($responseBody); // if (isset($responseBody['names']) && count($responseBody['names']) > 0) { // $r_name = $responseBody['names'][0]; @@ -293,7 +197,6 @@ protected static function getGNFMatches($name, $organism) protected static function updateOrganismModel($name, $iri, $organism = null, $rank = null) { - // dd($name, $iri, $organism, $rank); if (! $organism) { $organism = Organism::where('name', $name)->first(); } diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index a26e7ad1..97997f4e 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -5,15 +5,20 @@ use App\Filament\Dashboard\Resources\ReportResource\Pages; use App\Filament\Dashboard\Resources\ReportResource\RelationManagers; use App\Models\Citation; +use App\Models\GeoLocation; use App\Models\Molecule; +use App\Models\Organism; use App\Models\Report; use Archilex\AdvancedTables\Filters\AdvancedFilter; use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Grid; use Filament\Forms\Components\KeyValue; +use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; use Filament\Forms\Components\SpatieTagsInput; +use Filament\Forms\Components\Tabs; +use Filament\Forms\Components\TagsInput; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\ToggleButtons; @@ -125,11 +130,228 @@ public static function form(Form $form): Form ->hidden(function (Get $get) { return $get('is_change'); }), - KeyValue::make('suggested_changes') - ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') - ->addActionLabel('Add property') - ->keyLabel('Property') - ->valueLabel('Suggested change') + // KeyValue::make('suggested_changes') + // ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') + // ->addActionLabel('Add property') + // ->keyLabel('Property') + // ->valueLabel('Suggested change') + // ->hidden(function (Get $get) { + // return ! $get('is_change'); + // }), + Tabs::make('Tabs') + ->tabs([ + Tabs\Tab::make('organisms_changes') + ->label('Organisms') + ->schema([ + Repeater::make('organisms_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('organisms') + ->label('Organism') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->organisms()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('organisms.name', 'organisms.id')->toArray() ?? []; + }) + ->getOptionLabelUsing(fn ($value): ?string => Organism::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_organism_details') + ->schema(Organism::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + + ]), + Tabs\Tab::make('geo_locations_changes') + ->label('Geo Locations') + ->schema([ + Repeater::make('geo_locations_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('geo_locations') + ->label('Geo Location') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->geo_locations()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('geo_locations.name', 'geo_locations.id')->toArray(); + }) + ->getOptionLabelUsing(fn ($value): ?string => GeoLocation::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_geo_locations_details') + ->schema(GeoLocation::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('synonyms') + ->label('Synonyms') + ->schema([ + Repeater::make('synonyms_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('synonyms') + ->label('Synonym') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + $synonyms = Molecule::select('synonyms')->where('identifier', $get('../../mol_id_csv'))->get()[0]['synonyms']; + $matched_synonyms = []; + foreach ($synonyms as $synonym) { + str_contains(strtolower($synonym), strtolower($search)) ? array_push($matched_synonyms, $synonym) : null; + } + + return $matched_synonyms; + }) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_synonym_details') + ->schema([ + TagsInput::make('new_synonym') + ->label('New Synonym') + ->separator(',') + ->splitKeys([',']), + ])->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('identifiers') + ->label('Identifiers') + ->schema([ + Repeater::make('identifiers_changes') + ->schema([ + Select::make('identifer_to_change') + ->options([ + 'name' => 'Name', + 'cas' => 'CAS', + ]) + ->default('name') + ->live(), + Select::make('current_Name') + ->options(function (Get $get): array { + return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->name ?? '']; + }) + ->default(0) + ->disabled() + ->hidden(function (Get $get) { + return $get('identifer_to_change') == 'cas'; + }), + Select::make('current_CAS') + ->options(function (Get $get): array { + return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->cas]; + }) + ->default(0) + ->disabled() + ->hidden(function (Get $get) { + return $get('identifer_to_change') == 'name'; + }), + TextInput::make('new_name') + ->label(function (Get $get) { + return $get('identifer_to_change') == 'name' ? 'New Name' : 'New CAS'; + }), + ]) + ->reorderable(false) + ->columns(4), + ]), + Tabs\Tab::make('citations') + ->label('Citations') + ->schema([ + Repeater::make('citations_changes') + ->schema([ + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->live(), + Select::make('citations') + ->label('Citation') + ->searchable() + ->searchDebounce(500) + ->getSearchResultsUsing(function (string $search, Get $get): array { + return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->citations()->where('title', 'ilike', "%{$search}%")->limit(10)->pluck('citations.title', 'citations.id')->toArray(); + }) + ->getOptionLabelUsing(fn ($value): ?string => Citation::find($value)?->name) + ->hidden(function (Get $get) { + return $get('operation') == 'add'; + }), + TextInput::make('name') + ->label('Change to') + ->hidden(function (Get $get) { + return $get('operation') != 'update'; + }), + Grid::make('new_citation_details') + ->schema(Citation::getForm())->columns(3) + ->hidden(function (Get $get) { + return $get('operation') != 'add'; + }) + ->columnStart(2), + ]) + ->reorderable(false) + ->columns(4), + + ]), + + Tabs\Tab::make('Chemical Classifications') + ->schema([ + // ... + ]), + ]) ->hidden(function (Get $get) { return ! $get('is_change'); }), diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 937c3131..2878f2c6 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -67,6 +67,15 @@ protected function mutateFormDataBeforeCreate(array $data): array $data['user_id'] = auth()->id(); $data['status'] = 'submitted'; + $suggested_changes = []; + $suggested_changes['organisms_changes'] = $data['organisms_changes']; + $suggested_changes['geo_locations_changes'] = $data['geo_locations_changes']; + $suggested_changes['synonyms_changes'] = $data['synonyms_changes']; + $suggested_changes['identifiers_changes'] = $data['identifiers_changes']; + $suggested_changes['citations_changes'] = $data['citations_changes']; + + $data['suggested_changes'] = $suggested_changes; + return $data; } diff --git a/app/Http/Controllers/API/SearchController.php b/app/Http/Controllers/API/SearchController.php index 8cd31eb8..2a21f544 100644 --- a/app/Http/Controllers/API/SearchController.php +++ b/app/Http/Controllers/API/SearchController.php @@ -19,8 +19,6 @@ public function search(Request $request) $queryType = 'text'; $results = []; - //dd($request); - $limit = $request->query('limit'); $sort = $request->query('sort'); $limit = $limit ? $limit : 24; @@ -218,7 +216,6 @@ public function search(Request $request) $statement = $statement.')'; } $statement = $statement.' LIMIT '.$limit; - // dd($statement ); } else { if ($query) { $query = str_replace("'", "''", $query); @@ -289,7 +286,6 @@ public function search(Request $request) $page ); - //dd($pagination); return $pagination; } catch (QueryException $exception) { $message = $exception->getMessage(); diff --git a/app/Models/Citation.php b/app/Models/Citation.php index 3cc86333..94542b75 100644 --- a/app/Models/Citation.php +++ b/app/Models/Citation.php @@ -2,9 +2,15 @@ namespace App\Models; +use Closure; +use Filament\Forms\Components\Section; +use Filament\Forms\Components\Textarea; +use Filament\Forms\Components\TextInput; +use Filament\Forms\Get; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Support\HtmlString; use OwenIt\Auditing\Contracts\Auditable; class Citation extends Model implements Auditable @@ -52,4 +58,89 @@ public function transformAudit(array $data): array { return changeAudit($data); } + + public static function getForm() + { + return [ + Section::make() + ->schema([ + TextInput::make('failMessage') + ->default('') + ->hidden() + ->disabled(), + TextInput::make('doi') + ->label('DOI') + ->live(onBlur: true) + ->afterStateUpdated(function ($set, $state) { + if (doiRegxMatch($state)) { + $citationDetails = fetchDOICitation($state); + if ($citationDetails) { + $set('title', $citationDetails['title']); + $set('authors', $citationDetails['authors']); + $set('citation_text', $citationDetails['citation_text']); + $set('failMessage', 'Success'); + } else { + $set('failMessage', 'No citation found. Please fill in the details manually'); + } + } else { + $set('failMessage', 'Invalid DOI'); + } + }) + ->helperText(function ($get) { + + if ($get('failMessage') == 'Fetching') { + return new HtmlString(' + + + '); + } elseif ($get('failMessage') != 'Success') { + return new HtmlString(''.$get('failMessage').''); + } else { + return null; + } + }) + ->required() + ->unique() + ->rules([ + fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { + if ($get('failMessage') != 'No citation found. Please fill in the details manually') { + $fail($get('failMessage')); + } + }, + ]) + ->validationMessages([ + 'unique' => 'The DOI already exists.', + ]), + ]), + + Section::make() + ->schema([ + TextInput::make('title') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + TextInput::make('authors') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + Textarea::make('citation_text') + ->label('Citation text / URL') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + ])->columns(1), + ]; + } } diff --git a/app/Models/GeoLocation.php b/app/Models/GeoLocation.php index 12ae9b35..28bcd5ef 100644 --- a/app/Models/GeoLocation.php +++ b/app/Models/GeoLocation.php @@ -2,6 +2,7 @@ namespace App\Models; +use Filament\Forms\Components\TextInput; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use OwenIt\Auditing\Contracts\Auditable; @@ -29,4 +30,13 @@ public function transformAudit(array $data): array { return changeAudit($data); } + + public static function getForm(): array + { + return [ + TextInput::make('name') + ->required() + ->maxLength(255), + ]; + } } diff --git a/app/Models/Organism.php b/app/Models/Organism.php index 52be6e4d..ad4c09ab 100644 --- a/app/Models/Organism.php +++ b/app/Models/Organism.php @@ -2,6 +2,9 @@ namespace App\Models; +use Filament\Forms; +use Filament\Forms\Components\Actions\Action; +use Illuminate\Contracts\View\View; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -51,4 +54,101 @@ public function transformAudit(array $data): array { return changeAudit($data); } + + public static function getForm(): array + { + return [ + Forms\Components\TextInput::make('name') + ->required() + ->unique(Organism::class, 'name') + ->maxLength(255) + ->suffixAction( + Action::make('infoFromSources') + ->icon('heroicon-m-clipboard') + // ->fillForm(function ($record, callable $get): array { + // $entered_name = $get('name'); + // $name = ucfirst(trim($entered_name)); + // $data = null; + // $iri = null; + // $organism = null; + // $rank = null; + + // if ($name && $name != '') { + // $data = Self::getOLSIRI($name, 'species'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'species'); + // Self::info("Mapped and updated: $name"); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // Self::info("Mapped and updated: $name"); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // Self::info("Mapped and updated: $name"); + // } else { + // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // } + // } + // } + // } + // return [ + // 'name' => $name, + // 'iri' => $iri, + // 'rank' => $rank, + // ]; + // }) + // ->form([ + // Forms\Components\TextInput::make('name')->readOnly(), + // Forms\Components\TextInput::make('iri')->readOnly(), + // Forms\Components\TextInput::make('rank')->readOnly(), + // ]) + // ->action(fn ( $record) => $record->advance()) + ->modalContent(function ($record, $get): View { + $name = ucfirst(trim($get('name'))); + $data = null; + // $iri = null; + // $organism = null; + // $rank = null; + + if ($name && $name != '') { + $data = self::getOLSIRI($name, 'species'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'species'); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // } else { + // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // if ($data) { + // Self::updateOrganismModel($name, $data, $record, 'genus'); + // } else { + // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // } + // } + // } + } + + return view( + 'forms.components.organism-info', + [ + 'data' => $data, + ], + ); + }) + ->action(function (array $data, Organism $record): void { + // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); + }) + ->slideOver() + ), + Forms\Components\TextInput::make('iri') + ->label('IRI') + ->maxLength(255), + Forms\Components\TextInput::make('rank') + ->maxLength(255), + ]; + } } diff --git a/app/Models/Report.php b/app/Models/Report.php index f6e45e66..71793af8 100644 --- a/app/Models/Report.php +++ b/app/Models/Report.php @@ -2,7 +2,6 @@ namespace App\Models; -use App\States\Report\ReportState; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -38,7 +37,6 @@ class Report extends Model implements Auditable protected $casts = [ 'suggested_changes' => 'array', - // 'status' => ReportState::class, ]; /** @@ -70,6 +68,11 @@ public function organisms(): MorphToMany return $this->morphedByMany(Organism::class, 'reportable'); } + // public function geoLocations(): MorphToMany + // { + // return $this->morphedByMany(Organism::class, 'reportable'); + // } + /** * Get all of the users that are assigned this report. */ From 367e9ca22a2f026c5d84b38d5c9cde079ddc3529 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 18 Sep 2024 02:00:13 +0200 Subject: [PATCH 048/137] wip: suggested changes are now stored in the reports table. SQL queries need to be built at the time of approving the report --- .../RelationManagers/MoleculesRelationManager.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php b/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php index df039774..c897b900 100644 --- a/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php +++ b/app/Filament/Dashboard/Resources/OrganismResource/RelationManagers/MoleculesRelationManager.php @@ -245,7 +245,6 @@ function (Molecule $molecule, $record): HtmlString { foreach ($molecues_with_muliple_locations as $molecule) { $current_sample_locations_subset = SampleLocation::findOrFail($molecule['sampleLocations']); $current_sample_locations_multiple = $records->where('id', $molecule['id'])[0]->sampleLocations()->where('organism_id', $this->getOwnerRecord()->id)->get(); - // dd($current_sample_locations_multiple, $current_sample_locations_subset); if ($current_sample_locations_multiple->pluck('id') == $current_sample_locations_subset->pluck('id')) { $currentOrganism->auditDetach('molecules', $molecule['id']); } From 49b918d8bf003d7daaebf0414d61058fda1531d3 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:33:11 +0200 Subject: [PATCH 049/137] feat: improved suggestions by replacing the old key value pairs with tabs that can be approved by curators --- .../Dashboard/Resources/ReportResource.php | 398 ++++++++++++++---- .../ReportResource/Pages/EditReport.php | 11 + .../ReportResource/Pages/ViewReport.php | 11 + 3 files changed, 333 insertions(+), 87 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 97997f4e..19ff713f 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -12,8 +12,8 @@ use Archilex\AdvancedTables\Filters\AdvancedFilter; use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; +use Filament\Forms\Components\Checkbox; use Filament\Forms\Components\Grid; -use Filament\Forms\Components\KeyValue; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; use Filament\Forms\Components\SpatieTagsInput; @@ -30,6 +30,7 @@ use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Facades\DB; use Illuminate\Support\HtmlString; use Illuminate\Support\Str; use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager; @@ -62,46 +63,26 @@ public static function form(Form $form): Form ->columnSpan(2), Actions::make([ Action::make('approve') - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create'; - }) ->form([ Textarea::make('reason'), ]) - ->action(function (array $data, Report $record, Molecule $molecule, $set): void { - - $record['status'] = 'approved'; - $record['reason'] = $data['reason']; - $record->save(); - - $set('status', 'rejected'); - - if ($record['mol_id_csv'] && ! $record['is_change']) { - $molecule_ids = explode(',', $record['mol_id_csv']); - $molecule = Molecule::whereIn('id', $molecule_ids)->get(); - foreach ($molecule as $mol) { - $mol->active = false; - $mol->save(); - } - } + ->action(function (array $data, Report $record, Molecule $molecule, $set, $livewire): void { + self::approveReport($data, $record, $molecule, $livewire); + $set('status', 'approved'); }), Action::make('reject') ->color('danger') - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create'; - }) ->form([ Textarea::make('reason'), ]) ->action(function (array $data, Report $record, $set): void { - - $record['status'] = 'rejected'; - $record['reason'] = $data['reason']; - $record->save(); - + self::rejectReport($data, $record); $set('status', 'rejected'); }), ]) + ->hidden(function (Get $get, string $operation) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; + }) ->verticalAlignment(VerticalAlignment::End) ->columnStart(4), ]) @@ -130,21 +111,19 @@ public static function form(Form $form): Form ->hidden(function (Get $get) { return $get('is_change'); }), - // KeyValue::make('suggested_changes') - // ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Enter the property (in the left column) and suggested change (in the right column)') - // ->addActionLabel('Add property') - // ->keyLabel('Property') - // ->valueLabel('Suggested change') - // ->hidden(function (Get $get) { - // return ! $get('is_change'); - // }), - Tabs::make('Tabs') + Tabs::make('suggested_changes') ->tabs([ Tabs\Tab::make('organisms_changes') ->label('Organisms') ->schema([ Repeater::make('organisms_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }) + ->disabled(false), Select::make('operation') ->options([ 'update' => 'Update', @@ -152,7 +131,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('organisms') ->label('Organism') ->searchable() @@ -163,12 +143,14 @@ public static function form(Form $form): Form ->getOptionLabelUsing(fn ($value): ?string => Organism::find($value)?->name) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_organism_details') ->schema(Organism::getForm())->columns(3) ->hidden(function (Get $get) { @@ -177,7 +159,7 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('geo_locations_changes') @@ -185,6 +167,11 @@ public static function form(Form $form): Form ->schema([ Repeater::make('geo_locations_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), Select::make('operation') ->options([ 'update' => 'Update', @@ -192,7 +179,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('geo_locations') ->label('Geo Location') ->searchable() @@ -203,12 +191,14 @@ public static function form(Form $form): Form ->getOptionLabelUsing(fn ($value): ?string => GeoLocation::find($value)?->name) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_geo_locations_details') ->schema(GeoLocation::getForm())->columns(3) ->hidden(function (Get $get) { @@ -217,13 +207,18 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('synonyms') ->label('Synonyms') ->schema([ Repeater::make('synonyms_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), Select::make('operation') ->options([ 'update' => 'Update', @@ -231,7 +226,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('synonyms') ->label('Synonym') ->searchable() @@ -239,20 +235,26 @@ public static function form(Form $form): Form ->getSearchResultsUsing(function (string $search, Get $get): array { $synonyms = Molecule::select('synonyms')->where('identifier', $get('../../mol_id_csv'))->get()[0]['synonyms']; $matched_synonyms = []; + $associative_matched_synonyms = []; foreach ($synonyms as $synonym) { str_contains(strtolower($synonym), strtolower($search)) ? array_push($matched_synonyms, $synonym) : null; } + foreach ($matched_synonyms as $item) { + $associative_matched_synonyms[$item] = $item; + } - return $matched_synonyms; + return $associative_matched_synonyms; }) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_synonym_details') ->schema([ TagsInput::make('new_synonym') @@ -266,14 +268,19 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('identifiers') ->label('Identifiers') ->schema([ Repeater::make('identifiers_changes') ->schema([ - Select::make('identifer_to_change') + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), + Select::make('change') ->options([ 'name' => 'Name', 'cas' => 'CAS', @@ -282,35 +289,63 @@ public static function form(Form $form): Form ->live(), Select::make('current_Name') ->options(function (Get $get): array { - return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->name ?? '']; + $name = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->name ?? ''; + + return [$name => $name]; }) - ->default(0) - ->disabled() ->hidden(function (Get $get) { - return $get('identifer_to_change') == 'cas'; - }), - Select::make('current_CAS') + return $get('change') == 'cas'; + }) + ->columnSpan(2), + Select::make('operation') + ->options([ + 'update' => 'Update', + 'remove' => 'Remove', + 'add' => 'Add', + ]) + ->default('update') + ->hidden(function (Get $get) { + return $get('change') == 'name'; + }) + ->live() + ->columnSpan(2), + Select::make('current_cas') + ->label('Current CAS') ->options(function (Get $get): array { - return [Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->cas]; + $cas_ids = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->cas ?? ''; + $associative_cas_ids = []; + foreach ($cas_ids as $item) { + $associative_cas_ids[$item] = $item; + } + + return $associative_cas_ids; }) - ->default(0) - ->disabled() ->hidden(function (Get $get) { - return $get('identifer_to_change') == 'name'; - }), + return $get('change') == 'name' || $get('operation') == 'add'; + }) + ->columnSpan(2), TextInput::make('new_name') ->label(function (Get $get) { - return $get('identifer_to_change') == 'name' ? 'New Name' : 'New CAS'; - }), + return $get('change') == 'name' ? 'New Name' : 'New CAS'; + }) + ->hidden(function (Get $get) { + return $get('operation') == 'remove'; + }) + ->columnSpan(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('citations') ->label('Citations') ->schema([ Repeater::make('citations_changes') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), Select::make('operation') ->options([ 'update' => 'Update', @@ -318,7 +353,8 @@ public static function form(Form $form): Form 'add' => 'Add', ]) ->default('update') - ->live(), + ->live() + ->columnSpan(2), Select::make('citations') ->label('Citation') ->searchable() @@ -329,12 +365,14 @@ public static function form(Form $form): Form ->getOptionLabelUsing(fn ($value): ?string => Citation::find($value)?->name) ->hidden(function (Get $get) { return $get('operation') == 'add'; - }), + }) + ->columnSpan(2), TextInput::make('name') ->label('Change to') ->hidden(function (Get $get) { return $get('operation') != 'update'; - }), + }) + ->columnSpan(2), Grid::make('new_citation_details') ->schema(Citation::getForm())->columns(3) ->hidden(function (Get $get) { @@ -343,12 +381,17 @@ public static function form(Form $form): Form ->columnStart(2), ]) ->reorderable(false) - ->columns(4), + ->columns(7), ]), Tabs\Tab::make('Chemical Classifications') ->schema([ + Checkbox::make('approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; + }), // ... ]), ]) @@ -452,6 +495,7 @@ public static function form(Form $form): Form return true; } }) + ->live() ->hidden(function (Get $get, string $operation) { if ($operation != 'create') { return true; @@ -509,20 +553,8 @@ public static function table(Table $table): Table ->form([ Textarea::make('reason'), ]) - ->action(function (array $data, Report $record, Molecule $molecule): void { - - $record['status'] = 'approved'; - $record['reason'] = $data['reason']; - $record->save(); - - if ($record['mol_id_csv'] && ! $record['is_change']) { - $molecule_ids = explode(',', $record['mol_id_csv']); - $molecule = Molecule::whereIn('id', $molecule_ids)->get(); - foreach ($molecule as $mol) { - $mol->active = false; - $mol->save(); - } - } + ->action(function (array $data, Report $record, Molecule $molecule, $livewire): void { + self::approveReport($data, $record, $molecule, $livewire); }), Tables\Actions\Action::make('reject') // ->button() @@ -535,10 +567,7 @@ public static function table(Table $table): Table ]) ->action(function (array $data, Report $record): void { - - $record['status'] = 'rejected'; - $record['reason'] = $data['reason']; - $record->save(); + self::rejectReport($data, $record); }), ]) ->bulkActions([ @@ -578,4 +607,199 @@ public static function getEloquentQuery(): Builder return parent::getEloquentQuery(); } + + public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void + { + $record['status'] = 'approved'; + $record['comment'] = $data['reason']; + + // In case of reporting a synthetic molecule, Deactivate Molecules + if ($record['mol_id_csv'] && ! $record['is_change']) { + $molecule_ids = explode(',', $record['mol_id_csv']); + $molecule = Molecule::whereIn('id', $molecule_ids)->get(); + foreach ($molecule as $mol) { + $mol->active = false; + $mol->save(); + } + } + + // In case of Changes, run SQL queries for the approved changes + if ($record['is_change']) { + + // To remove null values from the arrays before we assign them below + // dd(array_map(function($subArray) { + // return array_filter($subArray, function($value) { + // return !is_null($value); + // }); + // }, $livewire->data['organisms_changes'])); + + $suggestedChanges = $record->suggested_changes; + $suggestedChanges['organisms_changes'] = $livewire->data['organisms_changes']; + $suggestedChanges['geo_locations_changes'] = $livewire->data['geo_locations_changes']; + $suggestedChanges['synonyms_changes'] = $livewire->data['synonyms_changes']; + $suggestedChanges['identifiers_changes'] = $livewire->data['identifiers_changes']; + $suggestedChanges['citations_changes'] = $livewire->data['citations_changes']; + $record->suggested_changes = $suggestedChanges; + } + + // Run SQL queries for the approved changes + self::runSQLQueries($record); + + // Save the report record in any case + $record->save(); + } + + public static function rejectReport(array $data, Report $record): void + { + $record['status'] = 'rejected'; + $record['comment'] = $data['reason']; + $record->save(); + } + + public static function runSQLQueries(Report $record): void + { + DB::transaction(function () use ($record) { + // Check if organisms_changes exists and process it + if (isset($record->suggested_changes['organisms_changes'])) { + foreach ($record->suggested_changes['organisms_changes'] as $organism) { + if ($organism['approve'] && $organism['operation'] === 'update' && ! is_null($organism['organisms'])) { + // Perform update only if organisms ID is not null + // --------check if the organism name already exists + // --------need to handle iri and other fields of Organism for authentication + $db_organism = Organism::find($organism['organisms']); + $db_organism->name = $organism['name']; + $db_organism->save(); + } elseif ($organism['approve'] && $organism['operation'] === 'remove' && ! is_null($organism['organisms'])) { + // Perform delete only if organisms ID is not null + $db_organism = Organism::find($organism['organisms']); + $db_organism->delete(); + } elseif ($organism['approve'] && $organism['operation'] === 'add' && ! is_null($organism['name'])) { + // Perform insert only if name is not null (and other required fields can be checked too) + Organism::create([ + 'name' => $organism['name'], + 'iri' => $organism['iri'], + 'rank' => $organism['rank'], + ]); + } + } + } + + // Check if geo_locations_changes exists and process it + if (isset($record->suggested_changes['geo_locations_changes'])) { + foreach ($record->suggested_changes['geo_locations_changes'] as $geo_location) { + if ($geo_location['approve'] && $geo_location['operation'] === 'update' && ! is_null($geo_location['geo_locations'])) { + // Perform update only if geo_locations ID is not null + $db_geo_location = GeoLocation::find($geo_location['geo_locations']); + $db_geo_location->name = $geo_location['name']; + $db_geo_location->save(); + } elseif ($geo_location['approve'] && $geo_location['operation'] === 'remove' && ! is_null($geo_location['geo_locations'])) { + // Perform delete only if geo_locations ID is not null + $db_geo_location = GeoLocation::find($geo_location['geo_locations']); + $db_geo_location->delete(); + } elseif ($geo_location['approve'] && $geo_location['operation'] === 'add' && ! is_null($geo_location['name'])) { + // Perform insert only if name is not null + GeoLocation::create(['name' => $geo_location['name']]); + } + } + } + + // Check if synonyms_changes exists and process it + if (isset($record->suggested_changes['synonyms_changes'])) { + foreach ($record->suggested_changes['synonyms_changes'] as $synonym) { + if ($synonym['approve'] && $synonym['operation'] === 'update' && ! is_null($synonym['synonyms'])) { + // Perform update only if synonym name is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $synonyms = $db_molecule->synonyms; + foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { + $synonyms[$key] = $synonym['name']; + } + $db_molecule->synonyms = $synonyms; + $db_molecule->save(); + } elseif ($synonym['approve'] && $synonym['operation'] === 'remove' && ! is_null($synonym['synonyms'])) { + // Perform delete only if synonym name is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $synonyms = $db_molecule->synonyms; + foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { + unset($synonyms[$key]); + } + $db_molecule->synonyms = $synonyms; + $db_molecule->save(); + } elseif ($synonym['approve'] && $synonym['operation'] === 'add' && ! empty($synonym['new_synonym'])) { + // Perform insert only if new_synonym is not empty + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $synonyms = $db_molecule->synonyms; + $synonyms = array_merge($synonyms, $synonym['new_synonym']); + $db_molecule->synonyms = $synonyms; + $db_molecule->save(); + } + } + } + + // Check if identifiers_changes exists and process it + if (isset($record->suggested_changes['identifiers_changes'])) { + foreach ($record->suggested_changes['identifiers_changes'] as $identifier) { + if ($identifier['approve'] && $identifier['change'] === 'name' && ! is_null($identifier['current_Name']) && ! is_null($identifier['new_name'])) { + // Update name if current name and new name are not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $db_molecule->name = $identifier['new_name']; + $db_molecule->save(); + } elseif ($identifier['change'] == 'cas') { + if ($identifier['approve'] && $identifier['operation'] === 'update' && ! is_null($identifier['current_cas']) && ! is_null($identifier['new_name'])) { + // Update CAS if the current CAS and new name is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $cas = $db_molecule->cas; + foreach (array_keys($cas, $identifier['current_cas']) as $key) { + $cas[$key] = $identifier['new_name']; + } + $db_molecule->cas = $cas; + $db_molecule->save(); + } elseif ($identifier['approve'] && $identifier['operation'] === 'remove' && ! is_null($identifier['current_cas'])) { + // Perform delete only if CAS is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $cas = $db_molecule->cas; + foreach (array_keys($cas, $identifier['current_cas']) as $key) { + unset($cas[$key]); + } + $db_molecule->cas = $cas; + $db_molecule->save(); + } elseif ($identifier['approve'] && $identifier['operation'] === 'add' && ! is_null($identifier['new_name'])) { + // Perform insert only if new_name (CAS) is not null + $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); + $cas = $db_molecule->cas; + $cas[] = $identifier['new_name']; + $db_molecule->cas = $cas; + $db_molecule->save(); + } + } + } + } + + // Check if citations_changes exists and process it + if (isset($record->suggested_changes['citations_changes'])) { + foreach ($record->suggested_changes['citations_changes'] as $citation) { + if ($citation['approve'] && $citation['operation'] === 'update' && ! is_null($citation['citations'])) { + // Perform update only if citation ID is not null + $db_citation = Citation::find($citation['citations']); + // $db_citation->doi = $citation['doi']; + $db_citation->title = $citation['name']; + // $db_citation->authors = $citation['authors']; + // $db_citation->citation_text = $citation['citation_text']; + $db_citation->save(); + } elseif ($citation['approve'] && $citation['operation'] === 'remove' && ! is_null($citation['citations'])) { + // Perform delete only if citation ID is not null + $db_citation = Citation::find($citation['citations']); + $db_citation->delete(); + } elseif ($citation['approve'] && $citation['operation'] === 'add' && ! is_null($citation['name'])) { + // Perform insert only if name (citation ID) is not null + $db_citation = new Citation; + $db_citation->doi = $citation['doi']; + $db_citation->title = $citation['title']; + $db_citation->authors = $citation['authors']; + $db_citation->citation_text = $citation['citation_text']; + $db_citation->save(); + } + } + } + }); + } } diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index faec4f41..5471d32c 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -10,6 +10,17 @@ class EditReport extends EditRecord { protected static string $resource = ReportResource::class; + protected function mutateFormDataBeforeFill(array $data): array + { + $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; + $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; + $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; + $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; + $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + + return $data; + } + protected function getHeaderActions(): array { return [ diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php index 379e42c1..6e3966f4 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php @@ -8,4 +8,15 @@ class ViewReport extends ViewRecord { protected static string $resource = ReportResource::class; + + protected function mutateFormDataBeforeFill(array $data): array + { + $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; + $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; + $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; + $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; + $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + + return $data; + } } From 5a669ccb5b88817c65dcb53e76f2d3e0143b6500 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:34:17 +0200 Subject: [PATCH 050/137] fix: now the time line shows synonym and cas changes properly --- .../molecule-history-timeline.blade.php | 62 +++++++++++++------ 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index 589ccd15..f3dd91bd 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -36,25 +36,49 @@ - - @switch(explode('.', $column_name)[0]) - @case('comment') - {{ $column_values['new_value'][0]['comment'] ?? 'N/A' }} - @break - @case('active') - {{ $column_values['new_value'] ? 'Activated' : 'Deactivated' }} - @break - @case('created') - Initial creation of the compound on COCONUT - @break - @case('organisms') - @case('sampleLocations') - Detached from:
{{ $column_values['old_value'] ?: 'N/A' }}
- Attached to:
{{ $column_values['new_value'] ?: 'N/A' }}
- @break - @default - Old Value:
{{ $column_values['old_value'] ?: 'N/A' }}
- New Value:
{{ $column_values['new_value'] ?: 'N/A' }} + + @switch(explode('.',$column_name)[0]) + @case('comment') + {{$column_values['new_value'][0]['comment'] ?? 'N/A'}} + @break + @case('active') + @if ($column_values['new_value']) + Activated + @else + Deactivated + @endif + @break + @case('created') + Initial creation of the compound on COCONUT + @break + @case('organisms') + @case('sampleLocations') + @if ($column_values['old_value']) + Detached from:
{{$column_values['old_value']?:'N/A'}}
+ @endif + @if ($column_values['new_value']) + Attached to:
{{$column_values['new_value']?:'N/A'}}
+ @endif + @break + @case('synonyms') + @if (array_diff($column_values['old_value'], $column_values['new_value'])) + Removed:
{{implode(', ',array_diff($column_values['old_value'], $column_values['new_value']))}}
+ @endif + @if (array_diff($column_values['new_value'], $column_values['old_value'])) + Added:
{{implode(', ',array_diff($column_values['new_value'], $column_values['old_value']))}}
+ @endif + @break + @case('cas') + @if (array_diff($column_values['old_value'], $column_values['new_value'])) + Removed:
{{implode(', ',array_diff($column_values['old_value'], $column_values['new_value']))}}
+ @endif + @if (array_diff($column_values['new_value'], $column_values['old_value'])) + Added:
{{implode(', ',array_diff($column_values['new_value'], $column_values['old_value']))}}
+ @endif + @break + @default + Old Value:
{{$column_values['old_value']??'N/A'}}
+ New Value:
{{$column_values['new_value']??'N/A'}} @endswitch
--}} From 51510be16f28d5132587473e5e02c7d56001c86b Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:35:19 +0200 Subject: [PATCH 051/137] chore: commented out the slide over (wip) --- app/Models/Organism.php | 159 ++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/app/Models/Organism.php b/app/Models/Organism.php index ad4c09ab..489d5458 100644 --- a/app/Models/Organism.php +++ b/app/Models/Organism.php @@ -62,88 +62,89 @@ public static function getForm(): array ->required() ->unique(Organism::class, 'name') ->maxLength(255) - ->suffixAction( - Action::make('infoFromSources') - ->icon('heroicon-m-clipboard') - // ->fillForm(function ($record, callable $get): array { - // $entered_name = $get('name'); - // $name = ucfirst(trim($entered_name)); - // $data = null; - // $iri = null; - // $organism = null; - // $rank = null; + // ->suffixAction( + // Action::make('infoFromSources') + // ->icon('heroicon-m-clipboard') + // // ->fillForm(function ($record, callable $get): array { + // // $entered_name = $get('name'); + // // $name = ucfirst(trim($entered_name)); + // // $data = null; + // // $iri = null; + // // $organism = null; + // // $rank = null; - // if ($name && $name != '') { - // $data = Self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // Self::info("Mapped and updated: $name"); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - // } - // return [ - // 'name' => $name, - // 'iri' => $iri, - // 'rank' => $rank, - // ]; - // }) - // ->form([ - // Forms\Components\TextInput::make('name')->readOnly(), - // Forms\Components\TextInput::make('iri')->readOnly(), - // Forms\Components\TextInput::make('rank')->readOnly(), - // ]) - // ->action(fn ( $record) => $record->advance()) - ->modalContent(function ($record, $get): View { - $name = ucfirst(trim($get('name'))); - $data = null; - // $iri = null; - // $organism = null; - // $rank = null; + // // if ($name && $name != '') { + // // $data = Self::getOLSIRI($name, 'species'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'species'); + // // Self::info("Mapped and updated: $name"); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // Self::info("Mapped and updated: $name"); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // Self::info("Mapped and updated: $name"); + // // } else { + // // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // // } + // // } + // // } + // // } + // // return [ + // // 'name' => $name, + // // 'iri' => $iri, + // // 'rank' => $rank, + // // ]; + // // }) + // // ->form([ + // // Forms\Components\TextInput::make('name')->readOnly(), + // // Forms\Components\TextInput::make('iri')->readOnly(), + // // Forms\Components\TextInput::make('rank')->readOnly(), + // // ]) + // // ->action(fn ( $record) => $record->advance()) + // ->modalContent(function ($record, $get): View { + // $name = ucfirst(trim($get('name'))); + // $data = null; + // // $iri = null; + // // $organism = null; + // // $rank = null; - if ($name && $name != '') { - $data = self::getOLSIRI($name, 'species'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'species'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); - // if ($data) { - // Self::updateOrganismModel($name, $data, $record, 'genus'); - // } else { - // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); - // } - // } - // } - } + // if ($name && $name != '') { + // $data = self::getOLSIRI($name, 'species'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'species'); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'genus'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // } else { + // // $data = Self::getOLSIRI(explode(' ', $name)[0], 'family'); + // // if ($data) { + // // Self::updateOrganismModel($name, $data, $record, 'genus'); + // // } else { + // // [$name, $iri, $organism, $rank] = Self::getGNFMatches($name, $record); + // // } + // // } + // // } + // } - return view( - 'forms.components.organism-info', - [ - 'data' => $data, - ], - ); - }) - ->action(function (array $data, Organism $record): void { - // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); - }) - ->slideOver() - ), + // return view( + // 'forms.components.organism-info', + // [ + // 'data' => $data, + // ], + // ); + // }) + // ->action(function (array $data, Organism $record): void { + // // Self::updateOrganismModel($data['name'], $data['iri'], $record, $data['rank']); + // }) + // ->slideOver() + // ) + , Forms\Components\TextInput::make('iri') ->label('IRI') ->maxLength(255), From b75caa4eff6762705d76fdc2256a52b7722aacf3 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 26 Sep 2024 17:36:04 +0200 Subject: [PATCH 052/137] fix: minor fix related to creating citations --- app/Models/Citation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/Citation.php b/app/Models/Citation.php index 94542b75..61f3d1c4 100644 --- a/app/Models/Citation.php +++ b/app/Models/Citation.php @@ -73,6 +73,7 @@ public static function getForm() ->live(onBlur: true) ->afterStateUpdated(function ($set, $state) { if (doiRegxMatch($state)) { + $set('failMessage', 'Fetching'); $citationDetails = fetchDOICitation($state); if ($citationDetails) { $set('title', $citationDetails['title']); @@ -103,7 +104,7 @@ public static function getForm() ->unique() ->rules([ fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { - if ($get('failMessage') != 'No citation found. Please fill in the details manually') { + if ($get('failMessage') != 'Success') { $fail($get('failMessage')); } }, From 1475c470d5e054afffb9646f1674e4ee80bb9e46 Mon Sep 17 00:00:00 2001 From: Sagar Date: Sun, 29 Sep 2024 20:04:11 +0200 Subject: [PATCH 053/137] feat: improved the user friendliness (wip) --- .../Dashboard/Resources/ReportResource.php | 47 ++++++++++--------- .../ReportResource/Pages/CreateReport.php | 12 +++++ 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 19ff713f..e717152b 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -60,12 +60,18 @@ public static function form(Form $form): Form true => 'Request Changes to Data', ]) ->inline() + ->hidden(function () { + return request()->has('type'); + }) ->columnSpan(2), Actions::make([ Action::make('approve') ->form([ Textarea::make('reason'), ]) + ->hidden(function (Get $get, string $operation) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; + }) ->action(function (array $data, Report $record, Molecule $molecule, $set, $livewire): void { self::approveReport($data, $record, $molecule, $livewire); $set('status', 'approved'); @@ -75,14 +81,18 @@ public static function form(Form $form): Form ->form([ Textarea::make('reason'), ]) + ->hidden(function (Get $get, string $operation) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; + }) ->action(function (array $data, Report $record, $set): void { self::rejectReport($data, $record); $set('status', 'rejected'); }), + Action::make('viewCompoundPage') + ->color('info') + ->url(fn (): string => env('APP_URL').'/compounds/'.request()->compound_id) + ->openUrlInNewTab(), ]) - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; - }) ->verticalAlignment(VerticalAlignment::End) ->columnStart(4), ]) @@ -96,14 +106,15 @@ public static function form(Form $form): Form return getReportTypes(); }) ->hidden(function (string $operation) { - if ($operation == 'create') { - return false; - } else { - return true; - } + return $operation != 'create' || request()->has('type'); }), TextInput::make('title') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Title of the report. This is required.') + ->default(function () { + if (request()->type == 'change' && request()->has('compound_id')) { + return 'Request changes'; + } + }) ->required(), Textarea::make('evidence') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Please provide Evidence/Comment to support your claims in this report. This will help our Curators in reviewing your report.') @@ -384,16 +395,6 @@ public static function form(Form $form): Form ->columns(7), ]), - - Tabs\Tab::make('Chemical Classifications') - ->schema([ - Checkbox::make('approve') - ->inline(false) - ->hidden(function (string $operation) { - return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - // ... - ]), ]) ->hidden(function (Get $get) { return ! $get('is_change'); @@ -409,7 +410,10 @@ public static function form(Form $form): Form $state, shouldOpenInNewTab: true, ), - ), + ) + ->hidden(function () { + return request()->has('type') && request()->type == 'change'; + }), Select::make('collections') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Select the Collections you want to report. This will help our Curators in reviewing your report.') ->relationship('collections', 'title') @@ -497,9 +501,10 @@ public static function form(Form $form): Form }) ->live() ->hidden(function (Get $get, string $operation) { - if ($operation != 'create') { + if ($operation != 'create' || request()->type == 'change') { return true; - } elseif (! request()->has('compound_id') && $get('report_type') != 'molecule') { + } + if (! request()->has('compound_id') && $get('report_type') != 'molecule') { return true; } }) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 2878f2c6..f9e0b47d 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -14,6 +14,18 @@ class CreateReport extends CreateRecord { protected static string $resource = ReportResource::class; + public function getTitle(): string + { + $title = 'Create Report'; + request()->type == 'change' ? $title = 'Request Changes' : $title = 'Report '; + if (request()->has('compound_id')) { + $molecule = Molecule::where('identifier', request()->compound_id)->first(); + $title = $title.' - '.$molecule->name.' ('.$molecule->identifier.')'; + } + + return __($title); + } + protected function afterFill(): void { $request = request(); From f650aee14efb75e65cb27a345ff1d53a2c8bbe79 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:14:01 +0200 Subject: [PATCH 054/137] feat: the report changes form is made user friendly with pre-filled fields Accordingly changed the actions and eloquent queries. Commented out the table actions for now since they do not allow for approval of changes. --- .../Dashboard/Resources/ReportResource.php | 716 ++++++++---------- 1 file changed, 322 insertions(+), 394 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index e717152b..25f001ff 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -13,6 +13,7 @@ use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Checkbox; +use Filament\Forms\Components\Fieldset; use Filament\Forms\Components\Grid; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Select; @@ -45,6 +46,17 @@ class ReportResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; + protected static $molecule = null; + + protected static $approved_changes = null; + + protected static $overall_changes = null; + + public function __construct() + { + self::$molecule = request()->has('compound_id') ? Molecule::where('identifier', request()->compound_id)->first() : null; + } + public static function form(Form $form): Form { return $form @@ -60,15 +72,19 @@ public static function form(Form $form): Form true => 'Request Changes to Data', ]) ->inline() - ->hidden(function () { - return request()->has('type'); + ->hidden(function (string $operation, $record) { + return $operation == 'create' ? request()->has('type') : true; }) ->columnSpan(2), Actions::make([ Action::make('approve') - ->form([ - Textarea::make('reason'), - ]) + ->form(function ($record, $livewire) { + self::$approved_changes = self::prepareApprovedChanges($record, $livewire); + $key_value_fields = getChangesToDisplayModal(self::$approved_changes); + array_unshift($key_value_fields, Textarea::make('reason')); + + return $key_value_fields; + }) ->hidden(function (Get $get, string $operation) { return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; }) @@ -90,7 +106,7 @@ public static function form(Form $form): Form }), Action::make('viewCompoundPage') ->color('info') - ->url(fn (): string => env('APP_URL').'/compounds/'.request()->compound_id) + ->url(fn (string $operation, $record): string => $operation === 'create' ? env('APP_URL').'/compounds/'.request()->compound_id : env('APP_URL').'/compounds/'.$record->mol_id_csv) ->openUrlInNewTab(), ]) ->verticalAlignment(VerticalAlignment::End) @@ -112,7 +128,7 @@ public static function form(Form $form): Form ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Title of the report. This is required.') ->default(function () { if (request()->type == 'change' && request()->has('compound_id')) { - return 'Request changes'; + return 'Request changes to '.request()->compound_id; } }) ->required(), @@ -124,275 +140,192 @@ public static function form(Form $form): Form }), Tabs::make('suggested_changes') ->tabs([ - Tabs\Tab::make('organisms_changes') - ->label('Organisms') + Tabs\Tab::make('compound_info_changes') + ->label('Compound Info') ->schema([ - Repeater::make('organisms_changes') + Fieldset::make('Geo Locations') ->schema([ - Checkbox::make('approve') + Checkbox::make('approve_geo_locations') + ->label('Approve') ->inline(false) ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->disabled(false), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('organisms') - ->label('Organism') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->organisms()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('organisms.name', 'organisms.id')->toArray() ?? []; - }) - ->getOptionLabelUsing(fn ($value): ?string => Organism::find($value)?->name) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; - }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; - }) - ->columnSpan(2), - Grid::make('new_organism_details') - ->schema(Organism::getForm())->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(1), + Select::make('existing_geo_locations') + ->label('Existing') + ->multiple() + ->options(function (): array { + $geo_locations = []; + if (self::$molecule) { + $geo_locations = self::$molecule->geo_locations->pluck('name', 'id')->toArray(); + } + + return $geo_locations; }) - ->columnStart(2), + ->columnSpan(4), + TagsInput::make('new_geo_locations') + ->label('New') + ->separator(',') + ->splitKeys([',']) + ->columnSpan(4), ]) - ->reorderable(false) - ->columns(7), - - ]), - Tabs\Tab::make('geo_locations_changes') - ->label('Geo Locations') - ->schema([ - Repeater::make('geo_locations_changes') + ->columns(9), + Fieldset::make('Synonyms') ->schema([ - Checkbox::make('approve') + Checkbox::make('approve_synonyms') + ->label('Approve') ->inline(false) ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('geo_locations') - ->label('Geo Location') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->geo_locations()->where('name', 'ilike', "%{$search}%")->limit(10)->pluck('geo_locations.name', 'geo_locations.id')->toArray(); }) - ->getOptionLabelUsing(fn ($value): ?string => GeoLocation::find($value)?->name) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; - }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; - }) - ->columnSpan(2), - Grid::make('new_geo_locations_details') - ->schema(GeoLocation::getForm())->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(1), + Select::make('existing_synonyms') + ->label('Existing') + ->multiple() + ->options(function (): array { + $synonyms = []; + if (self::$molecule) { + $synonyms = self::$molecule->synonyms; + } + + return $synonyms; }) - ->columnStart(2), + ->columnSpan(4), + TagsInput::make('new_synonyms') + ->label('New') + ->separator(',') + ->splitKeys([',']) + ->columnSpan(4), ]) - ->reorderable(false) - ->columns(7), - ]), - Tabs\Tab::make('synonyms') - ->label('Synonyms') - ->schema([ - Repeater::make('synonyms_changes') + ->columns(9), + Fieldset::make('Name') ->schema([ - Checkbox::make('approve') + Checkbox::make('approve_name') + ->label('Approve') ->inline(false) ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('synonyms') - ->label('Synonym') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - $synonyms = Molecule::select('synonyms')->where('identifier', $get('../../mol_id_csv'))->get()[0]['synonyms']; - $matched_synonyms = []; - $associative_matched_synonyms = []; - foreach ($synonyms as $synonym) { - str_contains(strtolower($synonym), strtolower($search)) ? array_push($matched_synonyms, $synonym) : null; - } - foreach ($matched_synonyms as $item) { - $associative_matched_synonyms[$item] = $item; - } - - return $associative_matched_synonyms; }) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; + ->columnSpan(1), + Textarea::make('name') + ->default(function () { + if (self::$molecule) { + return self::$molecule->name; + } }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; + ->columnSpan(4), + ]) + ->columns(9), + Fieldset::make('CAS') + ->schema([ + Checkbox::make('approve_cas') + ->label('Approve') + ->inline(false) + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->columnSpan(2), - Grid::make('new_synonym_details') - ->schema([ - TagsInput::make('new_synonym') - ->label('New Synonym') - ->separator(',') - ->splitKeys([',']), - ])->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(1), + Select::make('existing_cas') + ->label('Existing') + ->multiple() + ->options(function () { + if (self::$molecule) { + return self::$molecule->cas; + } }) - ->columnStart(2), + ->columnSpan(4), + TagsInput::make('new_cas') + ->label('New') + ->separator(',') + ->splitKeys([',']) + ->columnSpan(4), ]) - ->reorderable(false) - ->columns(7), + ->columns(9), ]), - Tabs\Tab::make('identifiers') - ->label('Identifiers') + Tabs\Tab::make('organisms_changes') + ->label('Organisms') ->schema([ - Repeater::make('identifiers_changes') + Fieldset::make('Organisms') ->schema([ - Checkbox::make('approve') - ->inline(false) + Checkbox::make('approve_existing_organisms') + ->label('Approve') ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('change') - ->options([ - 'name' => 'Name', - 'cas' => 'CAS', - ]) - ->default('name') - ->live(), - Select::make('current_Name') - ->options(function (Get $get): array { - $name = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->name ?? ''; - - return [$name => $name]; }) - ->hidden(function (Get $get) { - return $get('change') == 'cas'; - }) - ->columnSpan(2), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->hidden(function (Get $get) { - return $get('change') == 'name'; - }) - ->live() - ->columnSpan(2), - Select::make('current_cas') - ->label('Current CAS') - ->options(function (Get $get): array { - $cas_ids = Molecule::where('identifier', $get('../../mol_id_csv'))->first()->cas ?? ''; - $associative_cas_ids = []; - foreach ($cas_ids as $item) { - $associative_cas_ids[$item] = $item; + ->columnSpanFull(), + Select::make('existing_organisms') + ->label('Existing') + ->multiple() + ->options(function () { + if (self::$molecule) { + return self::$molecule->organisms->pluck('name', 'id')->toArray(); } - - return $associative_cas_ids; }) ->hidden(function (Get $get) { - return $get('change') == 'name' || $get('operation') == 'add'; - }) - ->columnSpan(2), - TextInput::make('new_name') - ->label(function (Get $get) { - return $get('change') == 'name' ? 'New Name' : 'New CAS'; + return $get('operation') == 'add'; }) - ->hidden(function (Get $get) { - return $get('operation') == 'remove'; + ->columnSpan(9), + ]) + ->columns(9), + + Repeater::make('new_organisms') + ->label('') + ->schema([ + Checkbox::make('approve_new_organism') + ->label('Approve') + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->columnSpan(2), + ->disabled(false) + ->columnSpanFull(), + Grid::make('new_organism') + ->schema(Organism::getForm())->columns(4), ]) ->reorderable(false) - ->columns(7), + ->addActionLabel('Add New Organism') + ->defaultItems(0) + ->columns(9), + ]), Tabs\Tab::make('citations') ->label('Citations') ->schema([ - Repeater::make('citations_changes') + Fieldset::make('Citations') ->schema([ - Checkbox::make('approve') - ->inline(false) + Checkbox::make('approve_existing_citations') + ->label('Approve') ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; - }), - Select::make('operation') - ->options([ - 'update' => 'Update', - 'remove' => 'Remove', - 'add' => 'Add', - ]) - ->default('update') - ->live() - ->columnSpan(2), - Select::make('citations') - ->label('Citation') - ->searchable() - ->searchDebounce(500) - ->getSearchResultsUsing(function (string $search, Get $get): array { - return Molecule::where('identifier', $get('../../mol_id_csv'))->get()[0]->citations()->where('title', 'ilike', "%{$search}%")->limit(10)->pluck('citations.title', 'citations.id')->toArray(); - }) - ->getOptionLabelUsing(fn ($value): ?string => Citation::find($value)?->name) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; }) - ->columnSpan(2), - TextInput::make('name') - ->label('Change to') - ->hidden(function (Get $get) { - return $get('operation') != 'update'; + ->columnSpanFull(), + Select::make('existing_citations') + ->label('Existing') + ->multiple() + ->options(function () { + if (self::$molecule) { + return self::$molecule->citations->where('title', '!=', null)->pluck('title', 'id')->toArray(); + } }) - ->columnSpan(2), - Grid::make('new_citation_details') - ->schema(Citation::getForm())->columns(3) - ->hidden(function (Get $get) { - return $get('operation') != 'add'; + ->columnSpan(9), + ]) + ->columns(9), + Repeater::make('new_citations') + ->label('') + ->schema([ + Checkbox::make('approve_new_citation') + ->label('Approve') + ->hidden(function (string $operation) { + return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->columnStart(2), + ->columnSpanFull(), + Grid::make('new_citation') + ->schema(Citation::getForm())->columns(4), ]) ->reorderable(false) - ->columns(7), + ->addActionLabel('Add New Citation') + ->defaultItems(0) + ->columns(9), ]), ]) @@ -411,8 +344,8 @@ public static function form(Form $form): Form shouldOpenInNewTab: true, ), ) - ->hidden(function () { - return request()->has('type') && request()->type == 'change'; + ->hidden(function (string $operation, $record) { + return $operation == 'create' ? request()->has('type') && request()->type == 'change' : $record->is_change; }), Select::make('collections') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Select the Collections you want to report. This will help our Curators in reviewing your report.') @@ -550,30 +483,30 @@ public static function table(Table $table): Table ->visible(function ($record) { return auth()->user()->roles()->exists() && $record['status'] == 'submitted'; }), - Tables\Actions\Action::make('approve') - // ->button() - ->hidden(function (Report $record) { - return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; - }) - ->form([ - Textarea::make('reason'), - ]) - ->action(function (array $data, Report $record, Molecule $molecule, $livewire): void { - self::approveReport($data, $record, $molecule, $livewire); - }), - Tables\Actions\Action::make('reject') - // ->button() - ->color('danger') - ->hidden(function (Report $record) { - return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; - }) - ->form([ - Textarea::make('reason'), - - ]) - ->action(function (array $data, Report $record): void { - self::rejectReport($data, $record); - }), + // Tables\Actions\Action::make('approve') + // // ->button() + // ->hidden(function (Report $record) { + // return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; + // }) + // ->form([ + // Textarea::make('reason'), + // ]) + // ->action(function (array $data, Report $record, Molecule $molecule, $livewire): void { + // self::approveReport($data, $record, $molecule, $livewire); + // }), + // Tables\Actions\Action::make('reject') + // // ->button() + // ->color('danger') + // ->hidden(function (Report $record) { + // return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; + // }) + // ->form([ + // Textarea::make('reason'), + + // ]) + // ->action(function (array $data, Report $record): void { + // self::rejectReport($data, $record); + // }), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ @@ -613,10 +546,9 @@ public static function getEloquentQuery(): Builder return parent::getEloquentQuery(); } - public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void + public static function prepareApprovedChanges(Report $record, $livewire) { - $record['status'] = 'approved'; - $record['comment'] = $data['reason']; + $approved_changes = []; // In case of reporting a synthetic molecule, Deactivate Molecules if ($record['mol_id_csv'] && ! $record['is_change']) { @@ -629,27 +561,67 @@ public static function approveReport(array $data, Report $record, Molecule $mole } // In case of Changes, run SQL queries for the approved changes + $approved_changes['mol_id_csv'] = $record['mol_id_csv']; if ($record['is_change']) { - // To remove null values from the arrays before we assign them below - // dd(array_map(function($subArray) { - // return array_filter($subArray, function($value) { - // return !is_null($value); - // }); - // }, $livewire->data['organisms_changes'])); - - $suggestedChanges = $record->suggested_changes; - $suggestedChanges['organisms_changes'] = $livewire->data['organisms_changes']; - $suggestedChanges['geo_locations_changes'] = $livewire->data['geo_locations_changes']; - $suggestedChanges['synonyms_changes'] = $livewire->data['synonyms_changes']; - $suggestedChanges['identifiers_changes'] = $livewire->data['identifiers_changes']; - $suggestedChanges['citations_changes'] = $livewire->data['citations_changes']; - $record->suggested_changes = $suggestedChanges; + if ($livewire->data['approve_geo_locations']) { + $approved_changes['existing_geo_locations'] = $livewire->data['existing_geo_locations']; + $approved_changes['new_geo_locations'] = $livewire->data['new_geo_locations']; + } + + if ($livewire->data['approve_synonyms']) { + $approved_changes['existing_synonyms'] = $livewire->data['existing_synonyms']; + $approved_changes['new_synonyms'] = $livewire->data['new_synonyms']; + } + + if ($livewire->data['approve_name']) { + $approved_changes['name'] = $livewire->data['name']; + } + + if ($livewire->data['approve_cas']) { + $approved_changes['existing_cas'] = $livewire->data['existing_cas']; + $approved_changes['new_cas'] = $livewire->data['new_cas']; + } + + if ($livewire->data['approve_existing_organisms']) { + $approved_changes['existing_organisms'] = $livewire->data['existing_organisms']; + } + if (count($livewire->data['new_organisms']) > 0) { + foreach ($livewire->data['new_organisms'] as $key => $organism) { + if ($organism['approve_new_organism']) { + $approved_changes['new_organisms'][] = $organism; + } + } + } + + if ($livewire->data['approve_existing_citations']) { + $approved_changes['existing_citations'] = $livewire->data['existing_citations']; + } + if (count($livewire->data['new_citations']) > 0) { + foreach ($livewire->data['new_citations'] as $key => $citation) { + if ($citation['approve_new_citation']) { + $approved_changes['new_citations'][] = $citation; + } + } + } } + return $approved_changes; + } + + public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void + { + // dd($data, $record, $molecule, $livewire); // Run SQL queries for the approved changes self::runSQLQueries($record); + $suggested_changes = $record['suggested_changes']; + + $suggested_changes['approved_changes'] = self::$overall_changes; + $record['suggested_changes'] = $suggested_changes; + $record['comment'] = $data['reason']; + $record['status'] = 'approved'; + // Save the report record in any case $record->save(); } @@ -664,147 +636,103 @@ public static function rejectReport(array $data, Report $record): void public static function runSQLQueries(Report $record): void { DB::transaction(function () use ($record) { - // Check if organisms_changes exists and process it - if (isset($record->suggested_changes['organisms_changes'])) { - foreach ($record->suggested_changes['organisms_changes'] as $organism) { - if ($organism['approve'] && $organism['operation'] === 'update' && ! is_null($organism['organisms'])) { - // Perform update only if organisms ID is not null - // --------check if the organism name already exists - // --------need to handle iri and other fields of Organism for authentication - $db_organism = Organism::find($organism['organisms']); - $db_organism->name = $organism['name']; - $db_organism->save(); - } elseif ($organism['approve'] && $organism['operation'] === 'remove' && ! is_null($organism['organisms'])) { - // Perform delete only if organisms ID is not null - $db_organism = Organism::find($organism['organisms']); - $db_organism->delete(); - } elseif ($organism['approve'] && $organism['operation'] === 'add' && ! is_null($organism['name'])) { - // Perform insert only if name is not null (and other required fields can be checked too) - Organism::create([ - 'name' => $organism['name'], - 'iri' => $organism['iri'], - 'rank' => $organism['rank'], - ]); + self::$overall_changes = getOverallChanges(self::$approved_changes); + // dd(self::$overall_changes); + + // Check if 'molecule_id' is provided or use a default molecule for association/dissociation + $molecule = Molecule::where('identifier', $record['mol_id_csv'])->first(); + + // Apply Geo Location Changes + if (array_key_exists('geo_location_changes', self::$overall_changes)) { + if (! empty(self::$overall_changes['geo_location_changes']['delete'])) { + $detachable_geo_locations_ids = GeoLocation::whereIn('name', self::$overall_changes['geo_location_changes']['delete'])->pluck('id')->toArray(); + $molecule->auditDetach('geo_locations', $detachable_geo_locations_ids); + } + if (! empty(self::$overall_changes['geo_location_changes']['add'])) { + $geoLocations = explode(',', self::$overall_changes['geo_location_changes']['add']); + foreach ($geoLocations as $newLocation) { + $geo_location = GeoLocation::firstOrCreate(['name' => $newLocation]); + $molecule->auditAttach('geo_locations', $geo_location); } } } - // Check if geo_locations_changes exists and process it - if (isset($record->suggested_changes['geo_locations_changes'])) { - foreach ($record->suggested_changes['geo_locations_changes'] as $geo_location) { - if ($geo_location['approve'] && $geo_location['operation'] === 'update' && ! is_null($geo_location['geo_locations'])) { - // Perform update only if geo_locations ID is not null - $db_geo_location = GeoLocation::find($geo_location['geo_locations']); - $db_geo_location->name = $geo_location['name']; - $db_geo_location->save(); - } elseif ($geo_location['approve'] && $geo_location['operation'] === 'remove' && ! is_null($geo_location['geo_locations'])) { - // Perform delete only if geo_locations ID is not null - $db_geo_location = GeoLocation::find($geo_location['geo_locations']); - $db_geo_location->delete(); - } elseif ($geo_location['approve'] && $geo_location['operation'] === 'add' && ! is_null($geo_location['name'])) { - // Perform insert only if name is not null - GeoLocation::create(['name' => $geo_location['name']]); - } + // Apply Synonym Changes + if (array_key_exists('synonym_changes', self::$overall_changes)) { + $db_synonyms = $molecule->synonyms; + if (! empty(self::$overall_changes['synonym_changes']['delete'])) { + $db_synonyms = array_diff($db_synonyms, self::$overall_changes['synonym_changes']['delete']); + $molecule->synonyms = $db_synonyms; + } + if (! empty(self::$overall_changes['synonym_changes']['add'])) { + $synonyms = explode(',', self::$overall_changes['synonym_changes']['add']); + $db_synonyms = array_merge($db_synonyms, $synonyms); + $molecule->synonyms = $db_synonyms; } } - // Check if synonyms_changes exists and process it - if (isset($record->suggested_changes['synonyms_changes'])) { - foreach ($record->suggested_changes['synonyms_changes'] as $synonym) { - if ($synonym['approve'] && $synonym['operation'] === 'update' && ! is_null($synonym['synonyms'])) { - // Perform update only if synonym name is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $synonyms = $db_molecule->synonyms; - foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { - $synonyms[$key] = $synonym['name']; - } - $db_molecule->synonyms = $synonyms; - $db_molecule->save(); - } elseif ($synonym['approve'] && $synonym['operation'] === 'remove' && ! is_null($synonym['synonyms'])) { - // Perform delete only if synonym name is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $synonyms = $db_molecule->synonyms; - foreach (array_keys($synonyms, $synonym['synonyms']) as $key) { - unset($synonyms[$key]); - } - $db_molecule->synonyms = $synonyms; - $db_molecule->save(); - } elseif ($synonym['approve'] && $synonym['operation'] === 'add' && ! empty($synonym['new_synonym'])) { - // Perform insert only if new_synonym is not empty - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $synonyms = $db_molecule->synonyms; - $synonyms = array_merge($synonyms, $synonym['new_synonym']); - $db_molecule->synonyms = $synonyms; - $db_molecule->save(); - } + // Apply Name Changes + if (array_key_exists('name_change', self::$overall_changes)) { + $molecule->name = self::$overall_changes['name_change']['new']; + $molecule->save(); + $molecule->refresh(); + } + + // Apply CAS Changes + if (array_key_exists('cas_changes', self::$overall_changes)) { + $db_cas = $molecule->cas; + if (! empty(self::$overall_changes['cas_changes']['delete'])) { + $db_cas = array_diff($db_cas, self::$overall_changes['cas_changes']['delete']); + $molecule->cas = $db_cas; + } + if (! empty(self::$overall_changes['cas_changes']['add'])) { + $cas = explode(',', self::$overall_changes['cas_changes']['add']); + $db_cas = array_merge($db_cas, $cas); + $molecule->cas = $db_cas; } } - // Check if identifiers_changes exists and process it - if (isset($record->suggested_changes['identifiers_changes'])) { - foreach ($record->suggested_changes['identifiers_changes'] as $identifier) { - if ($identifier['approve'] && $identifier['change'] === 'name' && ! is_null($identifier['current_Name']) && ! is_null($identifier['new_name'])) { - // Update name if current name and new name are not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $db_molecule->name = $identifier['new_name']; - $db_molecule->save(); - } elseif ($identifier['change'] == 'cas') { - if ($identifier['approve'] && $identifier['operation'] === 'update' && ! is_null($identifier['current_cas']) && ! is_null($identifier['new_name'])) { - // Update CAS if the current CAS and new name is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $cas = $db_molecule->cas; - foreach (array_keys($cas, $identifier['current_cas']) as $key) { - $cas[$key] = $identifier['new_name']; - } - $db_molecule->cas = $cas; - $db_molecule->save(); - } elseif ($identifier['approve'] && $identifier['operation'] === 'remove' && ! is_null($identifier['current_cas'])) { - // Perform delete only if CAS is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $cas = $db_molecule->cas; - foreach (array_keys($cas, $identifier['current_cas']) as $key) { - unset($cas[$key]); - } - $db_molecule->cas = $cas; - $db_molecule->save(); - } elseif ($identifier['approve'] && $identifier['operation'] === 'add' && ! is_null($identifier['new_name'])) { - // Perform insert only if new_name (CAS) is not null - $db_molecule = Molecule::where('identifier', $record->mol_id_csv)->first(); - $cas = $db_molecule->cas; - $cas[] = $identifier['new_name']; - $db_molecule->cas = $cas; - $db_molecule->save(); - } + // Apply Organism Changes: Dissociate from Molecule + if (array_key_exists('organism_changes', self::$overall_changes)) { + if (! empty(self::$overall_changes['organism_changes']['delete'])) { + $organismIds = Organism::whereIn('name', self::$overall_changes['organism_changes']['delete'])->pluck('id')->toArray(); + $molecule->auditDetach('organisms', $organismIds); + } + if (! empty(self::$overall_changes['organism_changes']['add'])) { + foreach (self::$overall_changes['organism_changes']['add'] as $newOrganism) { + $organism = Organism::firstOrCreate([ + 'name' => $newOrganism['name'], + 'iri' => $newOrganism['iri'], + 'rank' => $newOrganism['rank'], + 'molecule_count' => 1, + 'slug' => Str::slug($newOrganism['name']), + ]); + $molecule->auditAttach('organisms', $organism); } } } - // Check if citations_changes exists and process it - if (isset($record->suggested_changes['citations_changes'])) { - foreach ($record->suggested_changes['citations_changes'] as $citation) { - if ($citation['approve'] && $citation['operation'] === 'update' && ! is_null($citation['citations'])) { - // Perform update only if citation ID is not null - $db_citation = Citation::find($citation['citations']); - // $db_citation->doi = $citation['doi']; - $db_citation->title = $citation['name']; - // $db_citation->authors = $citation['authors']; - // $db_citation->citation_text = $citation['citation_text']; - $db_citation->save(); - } elseif ($citation['approve'] && $citation['operation'] === 'remove' && ! is_null($citation['citations'])) { - // Perform delete only if citation ID is not null - $db_citation = Citation::find($citation['citations']); - $db_citation->delete(); - } elseif ($citation['approve'] && $citation['operation'] === 'add' && ! is_null($citation['name'])) { - // Perform insert only if name (citation ID) is not null - $db_citation = new Citation; - $db_citation->doi = $citation['doi']; - $db_citation->title = $citation['title']; - $db_citation->authors = $citation['authors']; - $db_citation->citation_text = $citation['citation_text']; - $db_citation->save(); + // Apply Citation Changes: Dissociate from Molecule + if (array_key_exists('citation_changes', self::$overall_changes)) { + if (! empty(self::$overall_changes['citation_changes']['delete'])) { + $citations = Citation::whereIn('title', self::$overall_changes['citation_changes']['delete'])->get(); + $citationIds = $citations->pluck('id')->toArray(); + $molecule->auditDetach('citations', $citationIds); + } + if (! empty(self::$overall_changes['citation_changes']['add'])) { + foreach (self::$overall_changes['citation_changes']['add'] as $newCitation) { + $citation = Citation::firstOrCreate([ + 'doi' => $newCitation['doi'], + 'title' => $newCitation['title'], + 'authors' => $newCitation['authors'], + 'citation_text' => $newCitation['citation_text'], + ]); + $molecule->auditAttach('citations', $citation); } } } + + $molecule->save(); }); } } From 97a11dbe46e24b9d2db238d3604ca2f3ae8a9a99 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:16:16 +0200 Subject: [PATCH 055/137] feat: enabled create time pop-up modal to display overall changes being requested The data structure of suggested changes is altered to suit the needs. --- .../ReportResource/Pages/CreateReport.php | 76 ++++++++++++++++--- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index f9e0b47d..53cfb665 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -8,30 +8,46 @@ use App\Models\Collection; use App\Models\Molecule; use App\Models\Organism; +use Filament\Actions\Action; use Filament\Resources\Pages\CreateRecord; class CreateReport extends CreateRecord { protected static string $resource = ReportResource::class; + protected $molecule; + public function getTitle(): string { $title = 'Create Report'; request()->type == 'change' ? $title = 'Request Changes' : $title = 'Report '; if (request()->has('compound_id')) { - $molecule = Molecule::where('identifier', request()->compound_id)->first(); - $title = $title.' - '.$molecule->name.' ('.$molecule->identifier.')'; + $title = $title.' - '.$this->molecule->name.' ('.$this->molecule->identifier.')'; } return __($title); } + protected function beforeFill(): void + { + if (request()->has('compound_id')) { + $this->molecule = Molecule::where('identifier', request()->compound_id)->first(); + } + } + protected function afterFill(): void { $request = request(); + $this->data['compound_id'] = $request->compound_id; if ($request->type == 'change') { $this->data['is_change'] = true; + $this->data['existing_geo_locations'] = $this->molecule->geo_locations->pluck('name')->toArray(); + $this->data['existing_synonyms'] = $this->molecule->synonyms; + $this->data['existing_cas'] = array_values($this->molecule->cas); + $this->data['existing_organisms'] = $this->molecule->organisms->pluck('name')->toArray(); + $this->data['existing_citations'] = $this->molecule->citations->where('title', '!=', null)->pluck('title')->toArray(); } + if ($request->has('collection_uuid')) { $collection = Collection::where('uuid', $request->collection_uuid)->get(); $id = $collection[0]->id; @@ -79,14 +95,40 @@ protected function mutateFormDataBeforeCreate(array $data): array $data['user_id'] = auth()->id(); $data['status'] = 'submitted'; - $suggested_changes = []; - $suggested_changes['organisms_changes'] = $data['organisms_changes']; - $suggested_changes['geo_locations_changes'] = $data['geo_locations_changes']; - $suggested_changes['synonyms_changes'] = $data['synonyms_changes']; - $suggested_changes['identifiers_changes'] = $data['identifiers_changes']; - $suggested_changes['citations_changes'] = $data['citations_changes']; + if ($data['is_change'] == true) { + $suggested_changes = []; + $suggested_changes['existing_geo_locations'] = $data['existing_geo_locations']; + $suggested_changes['new_geo_locations'] = $data['new_geo_locations']; + $suggested_changes['approve_geo_locations'] = false; + + $suggested_changes['existing_synonyms'] = $data['existing_synonyms']; + $suggested_changes['new_synonyms'] = $data['new_synonyms']; + $suggested_changes['approve_synonyms'] = false; + + $suggested_changes['name'] = $data['name']; + $suggested_changes['approve_name'] = false; + + $suggested_changes['existing_cas'] = $data['existing_cas']; + $suggested_changes['new_cas'] = $data['new_cas']; + $suggested_changes['approve_cas'] = false; - $data['suggested_changes'] = $suggested_changes; + $suggested_changes['existing_organisms'] = $data['existing_organisms']; + $suggested_changes['approve_existing_organisms'] = false; + + $suggested_changes['new_organisms'] = $data['new_organisms']; + + $suggested_changes['existing_citations'] = $data['existing_citations']; + $suggested_changes['approve_existing_citations'] = false; + + $suggested_changes['new_citations'] = $data['new_citations']; + + $suggested_changes['overall_changes'] = getOverallChanges($data); + + // seperate copy for Curators + $suggested_changes['curator'] = $suggested_changes; + + $data['suggested_changes'] = $suggested_changes; + } return $data; } @@ -104,4 +146,20 @@ protected function afterCreate(): void ReportSubmitted::dispatch($this->record); } + + protected function getCreateFormAction(): Action + { + return parent::getCreateFormAction() + ->submit(null) + ->form(function () { + return getChangesToDisplayModal($this->data); + }) + ->modalHidden(function () { + return ! $this->data['is_change']; + }) + ->action(function () { + $this->closeActionModal(); + $this->create(); + }); + } } From 0f2acbe1701cf1baf766c4319fa400088717540d Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:21:12 +0200 Subject: [PATCH 056/137] feat: altered the edit and view pages to load the new structure of the suggested changes View and edit pages now use a separate curator copy of suggested changes so as to allow further modifications. --- .../ReportResource/Pages/EditReport.php | 65 +++++++++++++++++-- .../ReportResource/Pages/ViewReport.php | 32 +++++++-- 2 files changed, 87 insertions(+), 10 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index 5471d32c..e3a7475b 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -12,11 +12,66 @@ class EditReport extends EditRecord protected function mutateFormDataBeforeFill(array $data): array { - $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; - $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; - $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; - $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; - $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + if ($data['is_change'] == true) { + $curators_copy_changes = $data['suggested_changes']['curator']; + $data['existing_geo_locations'] = $curators_copy_changes['existing_geo_locations']; + $data['new_geo_locations'] = $curators_copy_changes['new_geo_locations']; + $data['approve_geo_locations'] = $curators_copy_changes['approve_geo_locations']; + + $data['existing_synonyms'] = $curators_copy_changes['existing_synonyms']; + $data['new_synonyms'] = $curators_copy_changes['new_synonyms']; + $data['approve_synonyms'] = $curators_copy_changes['approve_synonyms']; + + $data['name'] = $curators_copy_changes['name']; + $data['approve_name'] = $curators_copy_changes['approve_name']; + + $data['existing_cas'] = $curators_copy_changes['existing_cas']; + $data['new_cas'] = $curators_copy_changes['new_cas']; + $data['approve_cas'] = $curators_copy_changes['approve_cas']; + + $data['existing_organisms'] = $curators_copy_changes['existing_organisms']; + $data['approve_existing_organisms'] = $curators_copy_changes['approve_existing_organisms']; + + $data['new_organisms'] = $curators_copy_changes['new_organisms']; + + $data['existing_citations'] = $curators_copy_changes['existing_citations']; + $data['approve_existing_citations'] = $curators_copy_changes['approve_existing_citations']; + + $data['new_citations'] = $curators_copy_changes['new_citations']; + } + + return $data; + } + + protected function mutateFormDataBeforeSave(array $data): array + { + if ($data['is_change'] == true) { + $data['suggested_changes']['curator']['existing_geo_locations'] = $data['existing_geo_locations']; + $data['suggested_changes']['curator']['new_geo_locations'] = $data['new_geo_locations']; + $data['suggested_changes']['curator']['approve_geo_locations'] = $data['approve_geo_locations']; + + $data['suggested_changes']['curator']['existing_synonyms'] = $data['existing_synonyms']; + $data['suggested_changes']['curator']['new_synonyms'] = $data['new_synonyms']; + $data['suggested_changes']['curator']['approve_synonyms'] = $data['approve_synonyms']; + + $data['suggested_changes']['curator']['name'] = $data['name']; + $data['suggested_changes']['curator']['approve_name'] = $data['approve_name']; + + $data['suggested_changes']['curator']['existing_cas'] = $data['existing_cas']; + $data['suggested_changes']['curator']['new_cas'] = $data['new_cas']; + $data['suggested_changes']['curator']['approve_cas'] = $data['approve_cas']; + + $data['suggested_changes']['curator']['existing_organisms'] = $data['existing_organisms']; + $data['suggested_changes']['curator']['approve_existing_organisms'] = $data['approve_existing_organisms']; + + $data['suggested_changes']['curator']['new_organisms'] = $data['new_organisms']; + + $data['suggested_changes']['curator']['existing_citations'] = $data['existing_citations']; + $data['suggested_changes']['curator']['approve_existing_citations'] = $data['approve_existing_citations']; + + $data['suggested_changes']['curator']['new_citations'] = $data['new_citations']; + + } return $data; } diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php index 6e3966f4..fedf1343 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/ViewReport.php @@ -11,11 +11,33 @@ class ViewReport extends ViewRecord protected function mutateFormDataBeforeFill(array $data): array { - $data['organisms_changes'] = $data['suggested_changes']['organisms_changes']; - $data['geo_locations_changes'] = $data['suggested_changes']['geo_locations_changes']; - $data['synonyms_changes'] = $data['suggested_changes']['synonyms_changes']; - $data['identifiers_changes'] = $data['suggested_changes']['identifiers_changes']; - $data['citations_changes'] = $data['suggested_changes']['citations_changes']; + if ($data['is_change'] == true) { + $curators_copy_changes = $data['suggested_changes']['curator']; + $data['existing_geo_locations'] = $curators_copy_changes['existing_geo_locations']; + $data['new_geo_locations'] = $curators_copy_changes['new_geo_locations']; + $data['approve_geo_locations'] = $curators_copy_changes['approve_geo_locations']; + + $data['existing_synonyms'] = $curators_copy_changes['existing_synonyms']; + $data['new_synonyms'] = $curators_copy_changes['new_synonyms']; + $data['approve_synonyms'] = $curators_copy_changes['approve_synonyms']; + + $data['name'] = $curators_copy_changes['name']; + $data['approve_name'] = $curators_copy_changes['approve_name']; + + $data['existing_cas'] = $curators_copy_changes['existing_cas']; + $data['new_cas'] = $curators_copy_changes['new_cas']; + $data['approve_cas'] = $curators_copy_changes['approve_cas']; + + $data['existing_organisms'] = $curators_copy_changes['existing_organisms']; + $data['approve_existing_organisms'] = $curators_copy_changes['approve_existing_organisms']; + + $data['new_organisms'] = $curators_copy_changes['new_organisms']; + + $data['existing_citations'] = $curators_copy_changes['existing_citations']; + $data['approve_existing_citations'] = $curators_copy_changes['approve_existing_citations']; + + $data['new_citations'] = $curators_copy_changes['new_citations']; + } return $data; } From ed645af1020a8607daad6e2ed9f567b66300bab8 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:23:01 +0200 Subject: [PATCH 057/137] feat: new helper functions and fixes to the old ones to accommodate report suggestions workflow. --- app/Helper.php | 149 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 148 insertions(+), 1 deletion(-) diff --git a/app/Helper.php b/app/Helper.php index 39e3df31..76386b5f 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -1,6 +1,8 @@ 'id', 'name' => 'name', 'title' => 'title', + 'title' => 'title', // 'identifier' => 'identifier', ]; @@ -195,14 +198,16 @@ function changeAudit(array $data): array $data[$key_type][$changed_model] = []; foreach ($changed_data_values as $key => $value) { $value = is_array($value) ? $value : $value->toArray(); + if (array_key_exists('name', $value)) { if (array_key_exists('name', $value)) { if (array_key_exists('identifier', $value)) { $value['name'] = $value['name'].' (ID: '.$value['id'].')'.' (COCONUT ID: '.$value['identifier'].')'; } else { + // ! array_key_exists('name', $value) ? dd($value) : ''; $value['name'] = $value['name'].' (ID: '.$value['id'].')'; } } else { - $value['name'] = $value['title'].' (ID: '.$value['id'].')'; + $value['title'] = $value['title'].' (ID: '.$value['id'].')'; } $data[$key_type][$changed_model][$key] = array_intersect_key($value, $whitelist); } @@ -235,3 +240,145 @@ function flattenArray(array $array, $prefix = ''): array return $result; } + +function getChangesToDisplayModal($data) +{ + $key_values = []; + $overall_changes = getOverallChanges($data); + + foreach ($overall_changes as $key => $value) { + if (count($value['changes']) == 0) { + continue; + } + array_push($key_values, KeyValue::make($key) + ->addable(false) + ->deletable(false) + ->keyLabel($value['key']) + ->valueLabel($value['value']) + ->editableKeys(false) + ->editableValues(false) + ->default( + $value['changes'] + )); + } + + return $key_values; +} + +function getOverallChanges($data) +{ + $overall_changes = []; + $geo_location_changes = []; + $molecule = Molecule::where('identifier', $data['mol_id_csv'])->first(); + + $db_geo_locations = $molecule->geo_locations->pluck('name')->toArray(); + $deletable_locations = array_key_exists('existing_geo_locations', $data) ? array_diff($db_geo_locations, $data['existing_geo_locations']) : []; + $new_locations = array_key_exists('new_geo_locations', $data) ? (is_string($data['new_geo_locations']) ? $data['new_geo_locations'] : implode(',', $data['new_geo_locations'])) : null; + if (count($deletable_locations) > 0 || $new_locations) { + $key = implode(',', $deletable_locations) == '' ? ' ' : implode(',', $deletable_locations); + $geo_location_changes[$key] = $new_locations; + $overall_changes['geo_location_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $geo_location_changes, + 'delete' => $deletable_locations, + 'add' => $new_locations, + ]; + } + + $synonym_changes = []; + $db_synonyms = $molecule->synonyms; + $deletable_synonyms = array_key_exists('existing_synonyms', $data) ? array_diff($db_synonyms, $data['existing_synonyms']) : []; + $new_synonyms = array_key_exists('new_synonyms', $data) ? (is_string($data['new_synonyms']) ? $data['new_synonyms'] : implode(',', $data['new_synonyms'])) : null; + if (count($deletable_synonyms) > 0 || $new_synonyms) { + $key = implode(',', $deletable_synonyms) == '' ? ' ' : implode(',', $deletable_synonyms); + $synonym_changes[$key] = $new_synonyms; + $overall_changes['synonym_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $synonym_changes, + 'delete' => $deletable_synonyms, + 'add' => $new_synonyms, + ]; + } + + $name_change = []; + if (array_key_exists('name', $data) && $data['name'] && $data['name'] != $molecule->name) { + $name_change[$molecule->name] = $data['name']; + $overall_changes['name_change'] = [ + 'key' => 'Old', + 'value' => 'New', + 'changes' => $name_change, + 'old' => $molecule->name, + 'new' => $data['name'], + ]; + } + + $cas_changes = []; + $db_cas = $molecule->cas; + $deletable_cas = array_key_exists('existing_cas', $data) ? array_diff($db_cas, $data['existing_cas']) : []; + $new_cas = array_key_exists('new_cas', $data) ? (is_string($data['new_cas']) ? $data['new_cas'] : implode(',', $data['new_cas'])) : null; + if (count($deletable_cas) > 0 || $new_cas) { + $key = implode(',', $deletable_cas) == '' ? ' ' : implode(',', $deletable_cas); + $cas_changes[$key] = $new_cas; + $overall_changes['cas_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $cas_changes, + 'delete' => $deletable_cas, + 'add' => $new_cas, + ]; + } + + $organism_changes = []; + $db_organisms = $molecule->organisms->pluck('name')->toArray(); + $deletable_organisms = array_key_exists('existing_organisms', $data) ? array_diff($db_organisms, $data['existing_organisms']) : []; + $new_organisms = []; + $new_organisms_form_data = []; + if (array_key_exists('new_organisms', $data)) { + foreach ($data['new_organisms'] as $organism) { + if ($organism['name']) { + $new_organisms[] = $organism['name']; + $new_organisms_form_data[] = $organism; + } + } + } + if (count($deletable_organisms) > 0 || count($new_organisms) > 0) { + $key = implode(',', $deletable_organisms) == '' ? ' ' : implode(',', $deletable_organisms); + $organism_changes[$key] = implode(',', $new_organisms); + $overall_changes['organism_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $organism_changes, + 'delete' => $deletable_organisms, + 'add' => $new_organisms_form_data, + ]; + } + + $citation_changes = []; + $db_citations = $molecule->citations->where('title', '<>', null)->pluck('title')->toArray(); + $deletable_citations = array_key_exists('existing_citations', $data) ? array_diff($db_citations, $data['existing_citations']) : []; + $new_citations = []; + $new_citations_form_data = []; + if (array_key_exists('new_citations', $data)) { + foreach ($data['new_citations'] as $ciation) { + if ($ciation['title']) { + $new_citations[] = $ciation['title']; + $new_citations_form_data[] = $ciation; + } + } + } + if (count($deletable_citations) > 0 || count($new_citations) > 0) { + $key = implode(',', $deletable_citations) == '' ? ' ' : implode(',', $deletable_citations); + $citation_changes[$key] = implode(',', $new_citations); + $overall_changes['citation_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $citation_changes, + 'delete' => $deletable_citations, + 'add' => $new_citations_form_data, + ]; + } + + return $overall_changes; +} From 6c1c1aa8619cea273a96b8133e117b8e6602440f Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:23:37 +0200 Subject: [PATCH 058/137] feat: now timeline can handle citations --- .../views/livewire/molecule-history-timeline.blade.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/views/livewire/molecule-history-timeline.blade.php b/resources/views/livewire/molecule-history-timeline.blade.php index f3dd91bd..b7c3bc5c 100644 --- a/resources/views/livewire/molecule-history-timeline.blade.php +++ b/resources/views/livewire/molecule-history-timeline.blade.php @@ -76,6 +76,14 @@ Added:
{{implode(', ',array_diff($column_values['new_value'], $column_values['old_value']))}}
@endif @break + @case('citations') + @if ($column_values['old_value']) + Detached from:
{{$column_values['old_value']?:'N/A'}}
+ @endif + @if ($column_values['new_value']) + Attached to:
{{$column_values['new_value']?:'N/A'}}
+ @endif + @break @default Old Value:
{{$column_values['old_value']??'N/A'}}
New Value:
{{$column_values['new_value']??'N/A'}} From 0eb2497dd5628a63bdd4492446f5ed3b38982a26 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 01:25:09 +0200 Subject: [PATCH 059/137] chore: removed dd statements. --- app/Filament/Dashboard/Resources/ReportResource.php | 2 -- app/Helper.php | 1 - app/Livewire/MoleculeHistoryTimeline.php | 2 -- 3 files changed, 5 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 25f001ff..185cbe68 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -611,7 +611,6 @@ public static function prepareApprovedChanges(Report $record, $livewire) public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void { - // dd($data, $record, $molecule, $livewire); // Run SQL queries for the approved changes self::runSQLQueries($record); @@ -637,7 +636,6 @@ public static function runSQLQueries(Report $record): void { DB::transaction(function () use ($record) { self::$overall_changes = getOverallChanges(self::$approved_changes); - // dd(self::$overall_changes); // Check if 'molecule_id' is provided or use a default molecule for association/dissociation $molecule = Molecule::where('identifier', $record['mol_id_csv'])->first(); diff --git a/app/Helper.php b/app/Helper.php index 76386b5f..1a24fd47 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -203,7 +203,6 @@ function changeAudit(array $data): array if (array_key_exists('identifier', $value)) { $value['name'] = $value['name'].' (ID: '.$value['id'].')'.' (COCONUT ID: '.$value['identifier'].')'; } else { - // ! array_key_exists('name', $value) ? dd($value) : ''; $value['name'] = $value['name'].' (ID: '.$value['id'].')'; } } else { diff --git a/app/Livewire/MoleculeHistoryTimeline.php b/app/Livewire/MoleculeHistoryTimeline.php index fdb71291..dddb734f 100644 --- a/app/Livewire/MoleculeHistoryTimeline.php +++ b/app/Livewire/MoleculeHistoryTimeline.php @@ -18,8 +18,6 @@ public function getHistory() $audit_data[$index]['user_name'] = $audit->getMetadata()['user_name']; $audit_data[$index]['event'] = $audit->getMetadata()['audit_event']; $audit_data[$index]['created_at'] = date('Y/m/d', strtotime($audit->getMetadata()['audit_created_at'])); - // dd($audit->old_values, $audit->new_values); - // dd($audit->getModified()); $values = ! empty($audit->old_values) ? $audit->old_values : $audit->new_values; $first_affected_column = ! empty($values) ? array_keys($values)[0] : null; From 206dc4b7f998d84dd3750b2c6ca00a65bf499481 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 17:41:29 +0200 Subject: [PATCH 060/137] feat: now only the fields requested for changes are available and the rest are disabled in edit page --- .../Dashboard/Resources/ReportResource.php | 34 +++++++++++++++++-- .../ReportResource/Pages/CreateReport.php | 5 +-- .../ReportResource/Pages/EditReport.php | 27 ++++++++++++++- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 185cbe68..7326af3a 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -163,11 +163,17 @@ public static function form(Form $form): Form return $geo_locations; }) + ->disabled(function (Get $get) { + return ! $get('show_geo_location_existing'); + }) ->columnSpan(4), TagsInput::make('new_geo_locations') ->label('New') ->separator(',') ->splitKeys([',']) + ->disabled(function (Get $get) { + return ! $get('show_geo_location_new'); + }) ->columnSpan(4), ]) ->columns(9), @@ -191,11 +197,17 @@ public static function form(Form $form): Form return $synonyms; }) + ->disabled(function (Get $get) { + return ! $get('show_synonym_existing'); + }) ->columnSpan(4), TagsInput::make('new_synonyms') ->label('New') ->separator(',') ->splitKeys([',']) + ->disabled(function (Get $get) { + return ! $get('show_synonym_new'); + }) ->columnSpan(4), ]) ->columns(9), @@ -214,6 +226,9 @@ public static function form(Form $form): Form return self::$molecule->name; } }) + ->disabled(function (Get $get) { + return ! $get('show_name_change'); + }) ->columnSpan(4), ]) ->columns(9), @@ -234,11 +249,17 @@ public static function form(Form $form): Form return self::$molecule->cas; } }) + ->disabled(function (Get $get) { + return ! $get('show_cas_existing'); + }) ->columnSpan(4), TagsInput::make('new_cas') ->label('New') ->separator(',') ->splitKeys([',']) + ->disabled(function (Get $get) { + return ! $get('show_cas_new'); + }) ->columnSpan(4), ]) ->columns(9), @@ -262,8 +283,8 @@ public static function form(Form $form): Form return self::$molecule->organisms->pluck('name', 'id')->toArray(); } }) - ->hidden(function (Get $get) { - return $get('operation') == 'add'; + ->disabled(function (Get $get) { + return ! $get('show_organism_existing'); }) ->columnSpan(9), ]) @@ -285,6 +306,9 @@ public static function form(Form $form): Form ->reorderable(false) ->addActionLabel('Add New Organism') ->defaultItems(0) + ->disabled(function (Get $get) { + return ! $get('show_organism_new'); + }) ->columns(9), ]), @@ -307,6 +331,9 @@ public static function form(Form $form): Form return self::$molecule->citations->where('title', '!=', null)->pluck('title', 'id')->toArray(); } }) + ->disabled(function (Get $get) { + return ! $get('show_citation_existing'); + }) ->columnSpan(9), ]) ->columns(9), @@ -325,6 +352,9 @@ public static function form(Form $form): Form ->reorderable(false) ->addActionLabel('Add New Citation') ->defaultItems(0) + ->disabled(function (Get $get) { + return ! $get('show_citation_new'); + }) ->columns(9), ]), diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 53cfb665..b65c15bc 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -122,11 +122,12 @@ protected function mutateFormDataBeforeCreate(array $data): array $suggested_changes['new_citations'] = $data['new_citations']; - $suggested_changes['overall_changes'] = getOverallChanges($data); - // seperate copy for Curators $suggested_changes['curator'] = $suggested_changes; + // Overall Changes suggested + $suggested_changes['overall_changes'] = getOverallChanges($data); + $data['suggested_changes'] = $suggested_changes; } diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index e3a7475b..ffaaa40e 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -13,6 +13,32 @@ class EditReport extends EditRecord protected function mutateFormDataBeforeFill(array $data): array { if ($data['is_change'] == true) { + // initiate the flags to show only the fields that need to be shown + $data['show_geo_location_existing'] = $data['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; + if (array_key_exists('geo_location_changes', $data['suggested_changes']['overall_changes'])) { + $data['show_geo_location_existing'] = $data['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; + $data['show_geo_location_new'] = $data['suggested_changes']['overall_changes']['geo_location_changes']['add'] ? true : false; + } + if (array_key_exists('synonym_changes', $data['suggested_changes']['overall_changes'])) { + $data['show_synonym_existing'] = $data['suggested_changes']['overall_changes']['synonym_changes']['delete'] ? true : false; + $data['show_synonym_new'] = $data['suggested_changes']['overall_changes']['synonym_changes']['add'] ? true : false; + } + if (array_key_exists('name_change', $data['suggested_changes']['overall_changes'])) { + $data['show_name_change'] = $data['suggested_changes']['overall_changes']['name_change'] ? true : false; + } + if (array_key_exists('cas_changes', $data['suggested_changes']['overall_changes'])) { + $data['show_cas_existing'] = $data['suggested_changes']['overall_changes']['cas_changes']['delete'] ? true : false; + $data['show_cas_new'] = $data['suggested_changes']['overall_changes']['cas_changes']['add'] ? true : false; + } + if (array_key_exists('organism_changes', $data['suggested_changes']['overall_changes'])) { + $data['show_organism_existing'] = $data['suggested_changes']['overall_changes']['organism_changes']['delete'] ? true : false; + $data['show_organism_new'] = $data['suggested_changes']['overall_changes']['organism_changes']['add'] ? true : false; + } + if (array_key_exists('citation_changes', $data['suggested_changes']['overall_changes'])) { + $data['show_citation_existing'] = $data['suggested_changes']['overall_changes']['citation_changes']['delete'] ? true : false; + $data['show_citation_new'] = $data['suggested_changes']['overall_changes']['citation_changes']['add'] ? true : false; + } + $curators_copy_changes = $data['suggested_changes']['curator']; $data['existing_geo_locations'] = $curators_copy_changes['existing_geo_locations']; $data['new_geo_locations'] = $curators_copy_changes['new_geo_locations']; @@ -70,7 +96,6 @@ protected function mutateFormDataBeforeSave(array $data): array $data['suggested_changes']['curator']['approve_existing_citations'] = $data['approve_existing_citations']; $data['suggested_changes']['curator']['new_citations'] = $data['new_citations']; - } return $data; From 3e7733bb1b5897910d0bb45696bbbfeea859bca2 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Wed, 2 Oct 2024 23:53:02 +0200 Subject: [PATCH 061/137] feat: updated october 2024 release --- resources/views/livewire/download.blade.php | 96 ++++++++++++++------- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/resources/views/livewire/download.blade.php b/resources/views/livewire/download.blade.php index 7c007c14..eb9ab6b7 100644 --- a/resources/views/livewire/download.blade.php +++ b/resources/views/livewire/download.blade.php @@ -1,18 +1,27 @@
-
-
+
+
-

+

Downloads

-
+

Cite us

-

Sorokina, M., Merseburger, P., Rajan, K. et al. COCONUT online: COlleCtion +

+ ChemRxiv + - preprint
+ Nainala VC, Rajan K, Kanakam SRS, Sharma N, Weißenborn V, Schaub J, et al. COCONUT 2.0: A + comprehensive overhaul and curation of the collection of open natural products database. + ChemRxiv. 2024; doi:10.26434/chemrxiv-2024-fxq2s +

+

Version + 1
Sorokina, M., Merseburger, P., Rajan, K. et al. COCONUT online: COlleCtion of Open Natural prodUcTs database. J Cheminform 13, 2 (2021). https://doi.org/10.1186/s13321-020-00478-9

@@ -31,10 +40,13 @@ class="text-sm font-semibold leading-6 text-indigo-600"
-
+
+ October 2024 - release + notes

COCONUT data is released under @@ -46,10 +58,16 @@ class="mx-auto w-full px-6 md:px-0 max-w-2xl border-t border-gray-900/10 pt-12 s

Natural Products - SDF
-
@@ -57,34 +75,45 @@ class="text-sm font-semibold leading-6 text-indigo-600 hover:text-indigo-500">Do Complete (active/inactive) COCONUT dataset
- Download - (coconut-09-2024.sql / 1.82 GB) + (coconut-dump-10-2024 / 1.84 GB)
-
@@ -105,7 +134,7 @@ class="absolute inset-0 h-full w-full rounded-2xl bg-gray-50 object-cover"> Version: August 2024 - Fragment Analysis
@@ -253,8 +282,8 @@ class="absolute inset-0 h-full w-full rounded-2xl bg-gray-50 object-cover">
Version: - August 2024 + class="relative rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100 -ml-1">Version: + August 2024 Drug Discovery @@ -303,8 +332,8 @@ class="absolute inset-0 h-full w-full rounded-2xl bg-gray-50 object-cover">
Version: - September 2024 + class="relative rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100 -ml-1">Version: + September 2024 Mass Spec @@ -324,9 +353,10 @@ class="mt-3 text-lg font-semibold leading-6 text-gray-900 group-hover:text-gray-
- - CompoundDiscovererCOCONUT_ 2.csv (Sept 2024) + CompoundDiscovererCOCONUT_ 2.csv (Sept 2024)
From 7e83f7b3c9ba4b2236c1cf201056dec040bb7dad Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 23:56:12 +0200 Subject: [PATCH 062/137] fix: the disabling of non-suggested fields is restricted only to edit --- .../Dashboard/Resources/ReportResource.php | 58 +++++++++++-------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 7326af3a..c926a01e 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -163,17 +163,19 @@ public static function form(Form $form): Form return $geo_locations; }) - ->disabled(function (Get $get) { - return ! $get('show_geo_location_existing'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_geo_location_existing') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(4), TagsInput::make('new_geo_locations') ->label('New') ->separator(',') ->splitKeys([',']) - ->disabled(function (Get $get) { - return ! $get('show_geo_location_new'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_geo_location_new') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(4), ]) ->columns(9), @@ -197,17 +199,19 @@ public static function form(Form $form): Form return $synonyms; }) - ->disabled(function (Get $get) { - return ! $get('show_synonym_existing'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_synonym_existing') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(4), TagsInput::make('new_synonyms') ->label('New') ->separator(',') ->splitKeys([',']) - ->disabled(function (Get $get) { - return ! $get('show_synonym_new'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_synonym_new') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(4), ]) ->columns(9), @@ -226,9 +230,10 @@ public static function form(Form $form): Form return self::$molecule->name; } }) - ->disabled(function (Get $get) { - return ! $get('show_name_change'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_name_change') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(4), ]) ->columns(9), @@ -249,17 +254,19 @@ public static function form(Form $form): Form return self::$molecule->cas; } }) - ->disabled(function (Get $get) { - return ! $get('show_cas_existing'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_cas_existing') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(4), TagsInput::make('new_cas') ->label('New') ->separator(',') ->splitKeys([',']) - ->disabled(function (Get $get) { - return ! $get('show_cas_new'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_cas_new') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(4), ]) ->columns(9), @@ -283,9 +290,10 @@ public static function form(Form $form): Form return self::$molecule->organisms->pluck('name', 'id')->toArray(); } }) - ->disabled(function (Get $get) { - return ! $get('show_organism_existing'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_organism_existing') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(9), ]) ->columns(9), @@ -298,7 +306,6 @@ public static function form(Form $form): Form ->hidden(function (string $operation) { return ! auth()->user()->roles()->exists() || $operation == 'create'; }) - ->disabled(false) ->columnSpanFull(), Grid::make('new_organism') ->schema(Organism::getForm())->columns(4), @@ -306,9 +313,10 @@ public static function form(Form $form): Form ->reorderable(false) ->addActionLabel('Add New Organism') ->defaultItems(0) - ->disabled(function (Get $get) { - return ! $get('show_organism_new'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_organism_new') && $operation == 'edit'; }) + ->dehydrated() ->columns(9), ]), @@ -331,9 +339,10 @@ public static function form(Form $form): Form return self::$molecule->citations->where('title', '!=', null)->pluck('title', 'id')->toArray(); } }) - ->disabled(function (Get $get) { - return ! $get('show_citation_existing'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_citation_existing') && $operation == 'edit'; }) + ->dehydrated() ->columnSpan(9), ]) ->columns(9), @@ -352,9 +361,10 @@ public static function form(Form $form): Form ->reorderable(false) ->addActionLabel('Add New Citation') ->defaultItems(0) - ->disabled(function (Get $get) { - return ! $get('show_citation_new'); + ->disabled(function (Get $get, string $operation) { + return ! $get('show_citation_new') && $operation == 'edit'; }) + ->dehydrated() ->columns(9), ]), @@ -646,7 +656,7 @@ public static function approveReport(array $data, Report $record, Molecule $mole $suggested_changes = $record['suggested_changes']; - $suggested_changes['approved_changes'] = self::$overall_changes; + $suggested_changes['curator']['approved_changes'] = self::$overall_changes; $record['suggested_changes'] = $suggested_changes; $record['comment'] = $data['reason']; $record['status'] = 'approved'; From 607535c06e0cb0753193872c621a12d62fc36155 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 23:56:52 +0200 Subject: [PATCH 063/137] fix: saving the overall suggested changes so that they are available in both the original and curator jsons --- .../Resources/ReportResource/Pages/CreateReport.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index b65c15bc..17fa0d54 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -122,12 +122,12 @@ protected function mutateFormDataBeforeCreate(array $data): array $suggested_changes['new_citations'] = $data['new_citations']; - // seperate copy for Curators - $suggested_changes['curator'] = $suggested_changes; - // Overall Changes suggested $suggested_changes['overall_changes'] = getOverallChanges($data); + // seperate copy for Curators + $suggested_changes['curator'] = $suggested_changes; + $data['suggested_changes'] = $suggested_changes; } From 9c2d3f343c729a37929a6d5e452228a3ce1151d2 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 2 Oct 2024 23:58:30 +0200 Subject: [PATCH 064/137] feat: original suggestions are saved and never touched, instead a separate copy is made available for curators to work on --- .../ReportResource/Pages/EditReport.php | 80 ++++++++++--------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index ffaaa40e..0983d19d 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -12,34 +12,34 @@ class EditReport extends EditRecord protected function mutateFormDataBeforeFill(array $data): array { - if ($data['is_change'] == true) { - // initiate the flags to show only the fields that need to be shown - $data['show_geo_location_existing'] = $data['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; - if (array_key_exists('geo_location_changes', $data['suggested_changes']['overall_changes'])) { - $data['show_geo_location_existing'] = $data['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; - $data['show_geo_location_new'] = $data['suggested_changes']['overall_changes']['geo_location_changes']['add'] ? true : false; + if ($this->record['is_change'] == true) { + // initiate the flags to show only the fields that need to be shown - overall changes are always from the initial suggestions + $data['show_geo_location_existing'] = $this->record['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; + if (array_key_exists('geo_location_changes', $this->record['suggested_changes']['overall_changes'])) { + $data['show_geo_location_existing'] = $this->record['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; + $data['show_geo_location_new'] = $this->record['suggested_changes']['overall_changes']['geo_location_changes']['add'] ? true : false; } - if (array_key_exists('synonym_changes', $data['suggested_changes']['overall_changes'])) { - $data['show_synonym_existing'] = $data['suggested_changes']['overall_changes']['synonym_changes']['delete'] ? true : false; - $data['show_synonym_new'] = $data['suggested_changes']['overall_changes']['synonym_changes']['add'] ? true : false; + if (array_key_exists('synonym_changes', $this->record['suggested_changes']['overall_changes'])) { + $data['show_synonym_existing'] = $this->record['suggested_changes']['overall_changes']['synonym_changes']['delete'] ? true : false; + $data['show_synonym_new'] = $this->record['suggested_changes']['overall_changes']['synonym_changes']['add'] ? true : false; } - if (array_key_exists('name_change', $data['suggested_changes']['overall_changes'])) { - $data['show_name_change'] = $data['suggested_changes']['overall_changes']['name_change'] ? true : false; + if (array_key_exists('name_change', $this->record['suggested_changes']['overall_changes'])) { + $data['show_name_change'] = $this->record['suggested_changes']['overall_changes']['name_change'] ? true : false; } - if (array_key_exists('cas_changes', $data['suggested_changes']['overall_changes'])) { - $data['show_cas_existing'] = $data['suggested_changes']['overall_changes']['cas_changes']['delete'] ? true : false; - $data['show_cas_new'] = $data['suggested_changes']['overall_changes']['cas_changes']['add'] ? true : false; + if (array_key_exists('cas_changes', $this->record['suggested_changes']['overall_changes'])) { + $data['show_cas_existing'] = $this->record['suggested_changes']['overall_changes']['cas_changes']['delete'] ? true : false; + $data['show_cas_new'] = $this->record['suggested_changes']['overall_changes']['cas_changes']['add'] ? true : false; } - if (array_key_exists('organism_changes', $data['suggested_changes']['overall_changes'])) { - $data['show_organism_existing'] = $data['suggested_changes']['overall_changes']['organism_changes']['delete'] ? true : false; - $data['show_organism_new'] = $data['suggested_changes']['overall_changes']['organism_changes']['add'] ? true : false; + if (array_key_exists('organism_changes', $this->record['suggested_changes']['overall_changes'])) { + $data['show_organism_existing'] = $this->record['suggested_changes']['overall_changes']['organism_changes']['delete'] ? true : false; + $data['show_organism_new'] = $this->record['suggested_changes']['overall_changes']['organism_changes']['add'] ? true : false; } - if (array_key_exists('citation_changes', $data['suggested_changes']['overall_changes'])) { - $data['show_citation_existing'] = $data['suggested_changes']['overall_changes']['citation_changes']['delete'] ? true : false; - $data['show_citation_new'] = $data['suggested_changes']['overall_changes']['citation_changes']['add'] ? true : false; + if (array_key_exists('citation_changes', $this->record['suggested_changes']['overall_changes'])) { + $data['show_citation_existing'] = $this->record['suggested_changes']['overall_changes']['citation_changes']['delete'] ? true : false; + $data['show_citation_new'] = $this->record['suggested_changes']['overall_changes']['citation_changes']['add'] ? true : false; } - $curators_copy_changes = $data['suggested_changes']['curator']; + $curators_copy_changes = $this->record['suggested_changes']['curator']; $data['existing_geo_locations'] = $curators_copy_changes['existing_geo_locations']; $data['new_geo_locations'] = $curators_copy_changes['new_geo_locations']; $data['approve_geo_locations'] = $curators_copy_changes['approve_geo_locations']; @@ -71,31 +71,33 @@ protected function mutateFormDataBeforeFill(array $data): array protected function mutateFormDataBeforeSave(array $data): array { - if ($data['is_change'] == true) { - $data['suggested_changes']['curator']['existing_geo_locations'] = $data['existing_geo_locations']; - $data['suggested_changes']['curator']['new_geo_locations'] = $data['new_geo_locations']; - $data['suggested_changes']['curator']['approve_geo_locations'] = $data['approve_geo_locations']; - $data['suggested_changes']['curator']['existing_synonyms'] = $data['existing_synonyms']; - $data['suggested_changes']['curator']['new_synonyms'] = $data['new_synonyms']; - $data['suggested_changes']['curator']['approve_synonyms'] = $data['approve_synonyms']; + if ($this->record->is_change) { + $temp = $data; + $data = $this->record->toArray(); - $data['suggested_changes']['curator']['name'] = $data['name']; - $data['suggested_changes']['curator']['approve_name'] = $data['approve_name']; + $data['suggested_changes']['curator']['existing_geo_locations'] = $temp['existing_geo_locations'] ?? $this->record['suggested_changes']['curator']['existing_geo_locations']; + $data['suggested_changes']['curator']['new_geo_locations'] = $temp['new_geo_locations'] ?? $this->record['suggested_changes']['curator']['new_geo_locations']; + $data['suggested_changes']['curator']['approve_geo_locations'] = $temp['approve_geo_locations']; - $data['suggested_changes']['curator']['existing_cas'] = $data['existing_cas']; - $data['suggested_changes']['curator']['new_cas'] = $data['new_cas']; - $data['suggested_changes']['curator']['approve_cas'] = $data['approve_cas']; + $data['suggested_changes']['curator']['existing_synonyms'] = $temp['existing_synonyms'] ?? $this->record['suggested_changes']['curator']['existing_synonyms']; + $data['suggested_changes']['curator']['new_synonyms'] = $temp['new_synonyms'] ?? $this->record['suggested_changes']['curator']['new_synonyms']; + $data['suggested_changes']['curator']['approve_synonyms'] = $temp['approve_synonyms']; - $data['suggested_changes']['curator']['existing_organisms'] = $data['existing_organisms']; - $data['suggested_changes']['curator']['approve_existing_organisms'] = $data['approve_existing_organisms']; + $data['suggested_changes']['curator']['name'] = $temp['name'] ?? $this->record['suggested_changes']['curator']['name']; + $data['suggested_changes']['curator']['approve_name'] = $temp['approve_name']; - $data['suggested_changes']['curator']['new_organisms'] = $data['new_organisms']; + $data['suggested_changes']['curator']['existing_cas'] = $temp['existing_cas'] ?? $this->record['suggested_changes']['curator']['existing_cas']; + $data['suggested_changes']['curator']['new_cas'] = $temp['new_cas'] ?? $this->record['suggested_changes']['curator']['new_cas']; + $data['suggested_changes']['curator']['approve_cas'] = $temp['approve_cas']; - $data['suggested_changes']['curator']['existing_citations'] = $data['existing_citations']; - $data['suggested_changes']['curator']['approve_existing_citations'] = $data['approve_existing_citations']; + $data['suggested_changes']['curator']['existing_organisms'] = $temp['existing_organisms'] ?? $this->record['suggested_changes']['curator']['existing_organisms']; + $data['suggested_changes']['curator']['new_organisms'] = $temp['new_organisms'] ?? $this->record['suggested_changes']['curator']['new_organisms']; + $data['suggested_changes']['curator']['approve_existing_organisms'] = $temp['approve_existing_organisms']; - $data['suggested_changes']['curator']['new_citations'] = $data['new_citations']; + $data['suggested_changes']['curator']['existing_citations'] = $temp['existing_citations'] ?? $this->record['suggested_changes']['curator']['existing_citations']; + $data['suggested_changes']['curator']['new_citations'] = $temp['new_citations'] ?? $this->record['suggested_changes']['curator']['new_citations']; + $data['suggested_changes']['curator']['approve_existing_citations'] = $temp['approve_existing_citations']; } return $data; From 31ddfb038febdef6c36a746eeaf1084c92c036d6 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 3 Oct 2024 00:59:02 +0200 Subject: [PATCH 065/137] fix: deleted the old statement --- .../Dashboard/Resources/ReportResource/Pages/EditReport.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index 0983d19d..341c5358 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -14,7 +14,6 @@ protected function mutateFormDataBeforeFill(array $data): array { if ($this->record['is_change'] == true) { // initiate the flags to show only the fields that need to be shown - overall changes are always from the initial suggestions - $data['show_geo_location_existing'] = $this->record['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; if (array_key_exists('geo_location_changes', $this->record['suggested_changes']['overall_changes'])) { $data['show_geo_location_existing'] = $this->record['suggested_changes']['overall_changes']['geo_location_changes']['delete'] ? true : false; $data['show_geo_location_new'] = $this->record['suggested_changes']['overall_changes']['geo_location_changes']['add'] ? true : false; From 9ad664155d9567d2d85614dfc4a9068afaacb813 Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 7 Oct 2024 11:06:37 +0200 Subject: [PATCH 066/137] fix: auto flush removed for dash widgets and geo-locations' widgets get the data on the fly when the page is accessed. --- app/Console/Commands/DashWidgetsRefresh.php | 20 +++++++++---------- .../Widgets/GeoLocationStats.php | 9 +++++++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/Console/Commands/DashWidgetsRefresh.php b/app/Console/Commands/DashWidgetsRefresh.php index 1dfdf142..7b1e030b 100644 --- a/app/Console/Commands/DashWidgetsRefresh.php +++ b/app/Console/Commands/DashWidgetsRefresh.php @@ -29,52 +29,52 @@ class DashWidgetsRefresh extends Command public function handle() { // Clear the cache for all widgets - // Cache::flush(); + Cache::flush(); // Create the cache for all DashboardStats widgets - Cache::remember('stats.collections', 172800, function () { + Cache::rememberForever('stats.collections', function () { return DB::table('collections')->selectRaw('count(*)')->get()[0]->count; }); $this->info('Cache for collections refreshed.'); - Cache::remember('stats.citations', 172800, function () { + Cache::rememberForever('stats.citations', function () { return DB::table('citations')->selectRaw('count(*)')->get()[0]->count; }); $this->info('Cache for citations refreshed.'); - Cache::remember('stats.organisms', 172800, function () { + Cache::rememberForever('stats.organisms', function () { return DB::table('organisms')->selectRaw('count(*)')->get()[0]->count; }); $this->info('Cache for organisms refreshed.'); - Cache::remember('stats.geo_locations', 172800, function () { + Cache::rememberForever('stats.geo_locations', function () { return DB::table('geo_locations')->selectRaw('count(*)')->get()[0]->count; }); $this->info('Cache for geo locations refreshed.'); - Cache::remember('stats.reports', 172800, function () { + Cache::rememberForever('stats.reports', function () { return DB::table('reports')->selectRaw('count(*)')->get()[0]->count; }); $this->info('Cache for reports refreshed.'); // Create the cache for all DashboardStatsMid widgets - Cache::remember('stats.molecules.non_stereo', 172800, function () { + Cache::rememberForever('stats.molecules.non_stereo', function () { return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=false and is_parent=false')->get()[0]->count; }); $this->info('Cache for molecules non-stereo refreshed.'); - Cache::remember('stats.molecules.stereo', 172800, function () { + Cache::rememberForever('stats.molecules.stereo', function () { return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=true')->get()[0]->count; }); $this->info('Cache for molecules stereo refreshed.'); - Cache::remember('stats.molecules.parent', 172800, function () { + Cache::rememberForever('stats.molecules.parent', function () { return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=false and is_parent=true')->get()[0]->count; }); $this->info('Cache for molecules parent refreshed.'); - Cache::remember('stats.molecules', 172800, function () { + Cache::rememberForever('stats.molecules', function () { return DB::table('molecules')->selectRaw('count(*)')->whereRaw('active=true and NOT (is_parent=true AND has_variants=true)')->get()[0]->count; }); $this->info('Cache for molecules refreshed.'); diff --git a/app/Filament/Dashboard/Resources/GeoLocationResource/Widgets/GeoLocationStats.php b/app/Filament/Dashboard/Resources/GeoLocationResource/Widgets/GeoLocationStats.php index abab44bf..94a9eef5 100644 --- a/app/Filament/Dashboard/Resources/GeoLocationResource/Widgets/GeoLocationStats.php +++ b/app/Filament/Dashboard/Resources/GeoLocationResource/Widgets/GeoLocationStats.php @@ -6,6 +6,7 @@ use Filament\Widgets\StatsOverviewWidget as BaseWidget; use Filament\Widgets\StatsOverviewWidget\Stat; use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\DB; class GeoLocationStats extends BaseWidget { @@ -14,8 +15,12 @@ class GeoLocationStats extends BaseWidget protected function getStats(): array { return [ - Stat::make('Total Molecules', Cache::get('stats.geo_locations'.$this->record->id.'molecules.count')), - Stat::make('Total Organisms', Cache::get('stats.geo_locations'.$this->record->id.'organisms.count')), + Stat::make('Total Molecules', Cache::rememberForever('stats.geo_locations'.$this->record->id.'molecules.count', function () { + return DB::table('geo_location_molecule')->selectRaw('count(*)')->whereRaw('geo_location_id='.$this->record->id)->get()[0]->count; + })), + Stat::make('Total Organisms', Cache::rememberForever('stats.geo_locations'.$this->record->id.'organisms.count', function () { + return DB::table('geo_location_molecule')->selectRaw('count(*)')->whereRaw('geo_location_id='.$this->record->id)->Join('molecule_organism', 'geo_location_molecule.molecule_id', '=', 'molecule_organism.molecule_id')->get()[0]->count; + })), ]; } } From 3ce816a0da60f9d49896a55416816782c0ef9f1c Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 7 Oct 2024 11:11:09 +0200 Subject: [PATCH 067/137] chore: formatting changes --- app/Console/Commands/DashWidgetsRefresh.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/DashWidgetsRefresh.php b/app/Console/Commands/DashWidgetsRefresh.php index 7b1e030b..90cbef5c 100644 --- a/app/Console/Commands/DashWidgetsRefresh.php +++ b/app/Console/Commands/DashWidgetsRefresh.php @@ -52,24 +52,24 @@ public function handle() }); $this->info('Cache for geo locations refreshed.'); - Cache::rememberForever('stats.reports', function () { + Cache::rememberForever('stats.reports', function () { return DB::table('reports')->selectRaw('count(*)')->get()[0]->count; }); $this->info('Cache for reports refreshed.'); // Create the cache for all DashboardStatsMid widgets - Cache::rememberForever('stats.molecules.non_stereo', function () { + Cache::rememberForever('stats.molecules.non_stereo', function () { return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=false and is_parent=false')->get()[0]->count; }); $this->info('Cache for molecules non-stereo refreshed.'); - Cache::rememberForever('stats.molecules.stereo', function () { + Cache::rememberForever('stats.molecules.stereo', function () { return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=true')->get()[0]->count; }); $this->info('Cache for molecules stereo refreshed.'); - Cache::rememberForever('stats.molecules.parent', function () { + Cache::rememberForever('stats.molecules.parent', function () { return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=false and is_parent=true')->get()[0]->count; }); $this->info('Cache for molecules parent refreshed.'); From a275b0249d72c83bae898c814fedd611b49d2b7a Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 7 Oct 2024 15:07:22 +0200 Subject: [PATCH 068/137] fix: the status of the molecule now sets to revoked while deactivation --- app/Filament/Dashboard/Resources/MoleculeResource.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Filament/Dashboard/Resources/MoleculeResource.php b/app/Filament/Dashboard/Resources/MoleculeResource.php index 79ed12c5..c2e68b1a 100644 --- a/app/Filament/Dashboard/Resources/MoleculeResource.php +++ b/app/Filament/Dashboard/Resources/MoleculeResource.php @@ -125,6 +125,7 @@ public static function table(Table $table): Table ]) ->action(function (array $data, Molecule $record): void { $record->active = ! $record->active; + $record->active ? $record->status = 'APPROVED' : $record->status = 'REVOKED'; self::saveComment($record, $data['reason']); }) ->modalHidden(function (Molecule $record) { @@ -144,6 +145,7 @@ public static function table(Table $table): Table ->action(function (array $data, Collection $records): void { foreach ($records as $record) { $record->active = ! $record->active; + $record->active ? $record->status = 'APPROVED' : $record->status = 'REVOKED'; self::saveComment($record, $data['reason']); } }) From f56ef21dfe59aa748939e0a4541bf2092d8b37d6 Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 7 Oct 2024 16:08:49 +0200 Subject: [PATCH 069/137] feat: observer is created on molecule model to flush the model from cache after update --- app/Models/Molecule.php | 3 +++ app/Observers/MoleculeObserver.php | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 app/Observers/MoleculeObserver.php diff --git a/app/Models/Molecule.php b/app/Models/Molecule.php index 707e5cb3..b27f9906 100644 --- a/app/Models/Molecule.php +++ b/app/Models/Molecule.php @@ -2,6 +2,8 @@ namespace App\Models; +use App\Observers\MoleculeObserver; +use Illuminate\Database\Eloquent\Attributes\ObservedBy; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -13,6 +15,7 @@ use Spatie\SchemaOrg\Schema; use Spatie\Tags\HasTags; +#[ObservedBy([MoleculeObserver::class])] class Molecule extends Model implements Auditable { use HasFactory; diff --git a/app/Observers/MoleculeObserver.php b/app/Observers/MoleculeObserver.php new file mode 100644 index 00000000..fff0e260 --- /dev/null +++ b/app/Observers/MoleculeObserver.php @@ -0,0 +1,17 @@ +identifier}"); + } +} From 0dc55356cb874f6a4803118c136af34a75279a2a Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 7 Oct 2024 16:09:28 +0200 Subject: [PATCH 070/137] chore: refactored the code --- .../Dashboard/Resources/MoleculeResource.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Filament/Dashboard/Resources/MoleculeResource.php b/app/Filament/Dashboard/Resources/MoleculeResource.php index c2e68b1a..ddab1b17 100644 --- a/app/Filament/Dashboard/Resources/MoleculeResource.php +++ b/app/Filament/Dashboard/Resources/MoleculeResource.php @@ -124,9 +124,7 @@ public static function table(Table $table): Table }), ]) ->action(function (array $data, Molecule $record): void { - $record->active = ! $record->active; - $record->active ? $record->status = 'APPROVED' : $record->status = 'REVOKED'; - self::saveComment($record, $data['reason']); + self::changeMoleculeStatus($record, $data['reason']); }) ->modalHidden(function (Molecule $record) { return ! $record['active']; @@ -144,9 +142,7 @@ public static function table(Table $table): Table ]) ->action(function (array $data, Collection $records): void { foreach ($records as $record) { - $record->active = ! $record->active; - $record->active ? $record->status = 'APPROVED' : $record->status = 'REVOKED'; - self::saveComment($record, $data['reason']); + self::changeMoleculeStatus($record, $data['reason']); } }) // ->modalHidden(function (Molecule $record) { @@ -210,8 +206,11 @@ public static function getNavigationBadge(): ?string return Cache::get('stats.molecules'); } - public static function saveComment($record, $reason) + public static function changeMoleculeStatus($record, $reason) { + $record->active = ! $record->active; + $record->active ? $record->status = 'APPROVED' : $record->status = 'REVOKED'; + $record->comment = [[ 'timestamp' => now(), 'changed_by' => auth()->user()->id, From 53847b0a3c477004955d546d6d22b51dfd9ddcf9 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 8 Oct 2024 12:18:51 +0200 Subject: [PATCH 071/137] fix: which items received approval is now saved when approved, no need to save the form before approval --- .../Dashboard/Resources/ReportResource.php | 3 ++ .../ReportResource/Pages/EditReport.php | 27 +--------------- app/Helper.php | 31 +++++++++++++++++++ 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index c926a01e..479a9d77 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -660,6 +660,9 @@ public static function approveReport(array $data, Report $record, Molecule $mole $record['suggested_changes'] = $suggested_changes; $record['comment'] = $data['reason']; $record['status'] = 'approved'; + $formData = copyChangesToCuratorJSON($record, $livewire->data); + $suggested_changes['curator'] = $formData['suggested_changes']['curator']; + $record['suggested_changes'] = $suggested_changes; // Save the report record in any case $record->save(); diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php index 341c5358..ac45b0c8 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/EditReport.php @@ -70,33 +70,8 @@ protected function mutateFormDataBeforeFill(array $data): array protected function mutateFormDataBeforeSave(array $data): array { - if ($this->record->is_change) { - $temp = $data; - $data = $this->record->toArray(); - - $data['suggested_changes']['curator']['existing_geo_locations'] = $temp['existing_geo_locations'] ?? $this->record['suggested_changes']['curator']['existing_geo_locations']; - $data['suggested_changes']['curator']['new_geo_locations'] = $temp['new_geo_locations'] ?? $this->record['suggested_changes']['curator']['new_geo_locations']; - $data['suggested_changes']['curator']['approve_geo_locations'] = $temp['approve_geo_locations']; - - $data['suggested_changes']['curator']['existing_synonyms'] = $temp['existing_synonyms'] ?? $this->record['suggested_changes']['curator']['existing_synonyms']; - $data['suggested_changes']['curator']['new_synonyms'] = $temp['new_synonyms'] ?? $this->record['suggested_changes']['curator']['new_synonyms']; - $data['suggested_changes']['curator']['approve_synonyms'] = $temp['approve_synonyms']; - - $data['suggested_changes']['curator']['name'] = $temp['name'] ?? $this->record['suggested_changes']['curator']['name']; - $data['suggested_changes']['curator']['approve_name'] = $temp['approve_name']; - - $data['suggested_changes']['curator']['existing_cas'] = $temp['existing_cas'] ?? $this->record['suggested_changes']['curator']['existing_cas']; - $data['suggested_changes']['curator']['new_cas'] = $temp['new_cas'] ?? $this->record['suggested_changes']['curator']['new_cas']; - $data['suggested_changes']['curator']['approve_cas'] = $temp['approve_cas']; - - $data['suggested_changes']['curator']['existing_organisms'] = $temp['existing_organisms'] ?? $this->record['suggested_changes']['curator']['existing_organisms']; - $data['suggested_changes']['curator']['new_organisms'] = $temp['new_organisms'] ?? $this->record['suggested_changes']['curator']['new_organisms']; - $data['suggested_changes']['curator']['approve_existing_organisms'] = $temp['approve_existing_organisms']; - - $data['suggested_changes']['curator']['existing_citations'] = $temp['existing_citations'] ?? $this->record['suggested_changes']['curator']['existing_citations']; - $data['suggested_changes']['curator']['new_citations'] = $temp['new_citations'] ?? $this->record['suggested_changes']['curator']['new_citations']; - $data['suggested_changes']['curator']['approve_existing_citations'] = $temp['approve_existing_citations']; + $data = copyChangesToCuratorJSON($this->record, $data); } return $data; diff --git a/app/Helper.php b/app/Helper.php index f1dffad3..36ab3aae 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -379,3 +379,34 @@ function getOverallChanges($data) return $overall_changes; } + +function copyChangesToCuratorJSON($record, $data) +{ + $temp = $data; + $data = $record->toArray(); + + $data['suggested_changes']['curator']['existing_geo_locations'] = $temp['existing_geo_locations'] ?? $record['suggested_changes']['curator']['existing_geo_locations']; + $data['suggested_changes']['curator']['new_geo_locations'] = $temp['new_geo_locations'] ?? $record['suggested_changes']['curator']['new_geo_locations']; + $data['suggested_changes']['curator']['approve_geo_locations'] = $temp['approve_geo_locations'] ?? false; + + $data['suggested_changes']['curator']['existing_synonyms'] = $temp['existing_synonyms'] ?? $record['suggested_changes']['curator']['existing_synonyms']; + $data['suggested_changes']['curator']['new_synonyms'] = $temp['new_synonyms'] ?? $record['suggested_changes']['curator']['new_synonyms']; + $data['suggested_changes']['curator']['approve_synonyms'] = $temp['approve_synonyms'] ?? false; + + $data['suggested_changes']['curator']['name'] = $temp['name'] ?? $record['suggested_changes']['curator']['name']; + $data['suggested_changes']['curator']['approve_name'] = $temp['approve_name'] ?? false; + + $data['suggested_changes']['curator']['existing_cas'] = $temp['existing_cas'] ?? $record['suggested_changes']['curator']['existing_cas']; + $data['suggested_changes']['curator']['new_cas'] = $temp['new_cas'] ?? $record['suggested_changes']['curator']['new_cas']; + $data['suggested_changes']['curator']['approve_cas'] = $temp['approve_cas'] ?? false; + + $data['suggested_changes']['curator']['existing_organisms'] = $temp['existing_organisms'] ?? $record['suggested_changes']['curator']['existing_organisms']; + $data['suggested_changes']['curator']['new_organisms'] = $temp['new_organisms'] ?? $record['suggested_changes']['curator']['new_organisms']; + $data['suggested_changes']['curator']['approve_existing_organisms'] = $temp['approve_existing_organisms'] ?? false; + + $data['suggested_changes']['curator']['existing_citations'] = $temp['existing_citations'] ?? $record['suggested_changes']['curator']['existing_citations']; + $data['suggested_changes']['curator']['new_citations'] = $temp['new_citations'] ?? $record['suggested_changes']['curator']['new_citations']; + $data['suggested_changes']['curator']['approve_existing_citations'] = $temp['approve_existing_citations'] ?? false; + + return $data; +} From 0ded27821bb44bc9c1b0bd1678d4c48421c76983 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 8 Oct 2024 12:34:30 +0200 Subject: [PATCH 072/137] fix: redirect to view page after the report is approved --- app/Filament/Dashboard/Resources/ReportResource.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 479a9d77..d337071f 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -100,8 +100,8 @@ public static function form(Form $form): Form ->hidden(function (Get $get, string $operation) { return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; }) - ->action(function (array $data, Report $record, $set): void { - self::rejectReport($data, $record); + ->action(function (array $data, Report $record, $set, $livewire): void { + self::rejectReport($data, $record, $livewire); $set('status', 'rejected'); }), Action::make('viewCompoundPage') @@ -545,7 +545,7 @@ public static function table(Table $table): Table // ]) // ->action(function (array $data, Report $record): void { - // self::rejectReport($data, $record); + // self::rejectReport($data, $record, $livewire); // }), ]) ->bulkActions([ @@ -666,13 +666,17 @@ public static function approveReport(array $data, Report $record, Molecule $mole // Save the report record in any case $record->save(); + + $livewire->redirect(ReportResource::getUrl('view', ['record' => $record->id])); } - public static function rejectReport(array $data, Report $record): void + public static function rejectReport(array $data, Report $record, $livewire): void { $record['status'] = 'rejected'; $record['comment'] = $data['reason']; $record->save(); + + $livewire->redirect(ReportResource::getUrl('view', ['record' => $record->id])); } public static function runSQLQueries(Report $record): void From 5670f315438e52c401ab34b70f95c876fd5db469 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 8 Oct 2024 19:45:25 +0200 Subject: [PATCH 073/137] fix: save modal is only displayed if it is a change --- .../Dashboard/Resources/ReportResource/Pages/CreateReport.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 17fa0d54..c23f02c0 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -150,6 +150,9 @@ protected function afterCreate(): void protected function getCreateFormAction(): Action { + if (! $this->data['is_change']) { + return parent::getCreateFormAction(); + } return parent::getCreateFormAction() ->submit(null) ->form(function () { From 658ff2f4e1eba5da2b421f804d908ffca8c171ca Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 8 Oct 2024 19:46:09 +0200 Subject: [PATCH 074/137] fix: saving doi for reporting --- app/Filament/Dashboard/Resources/ReportResource.php | 5 ++--- app/Models/Report.php | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index d337071f..5fd48424 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -375,7 +375,6 @@ public static function form(Form $form): Form TextInput::make('doi') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Provide the DOI link to the resource you are reporting so as to help curators verify.') ->label('DOI') - ->url() ->suffixAction( fn (?string $state): Action => Action::make('visit') ->icon('heroicon-s-link') @@ -385,7 +384,7 @@ public static function form(Form $form): Form ), ) ->hidden(function (string $operation, $record) { - return $operation == 'create' ? request()->has('type') && request()->type == 'change' : $record->is_change; + return $operation == 'create' && request()->has('type') && request()->type == 'change' ? true : false; }), Select::make('collections') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Select the Collections you want to report. This will help our Curators in reviewing your report.') @@ -474,7 +473,7 @@ public static function form(Form $form): Form }) ->live() ->hidden(function (Get $get, string $operation) { - if ($operation != 'create' || request()->type == 'change') { + if ($operation != 'create' || request()->has('type')) { return true; } if (! request()->has('compound_id') && $get('report_type') != 'molecule') { diff --git a/app/Models/Report.php b/app/Models/Report.php index 71793af8..f6713949 100644 --- a/app/Models/Report.php +++ b/app/Models/Report.php @@ -33,6 +33,7 @@ class Report extends Model implements Auditable 'user_id', 'suggested_changes', 'is_change', + 'doi', ]; protected $casts = [ From fa75c2766c81f32eff3e5e67287e136216abddcb Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Wed, 9 Oct 2024 12:32:27 +0200 Subject: [PATCH 075/137] fix: removed cache flush from the coconut cache command --- app/Console/Commands/DashWidgetsRefresh.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/DashWidgetsRefresh.php b/app/Console/Commands/DashWidgetsRefresh.php index 90cbef5c..d8e4a823 100644 --- a/app/Console/Commands/DashWidgetsRefresh.php +++ b/app/Console/Commands/DashWidgetsRefresh.php @@ -29,7 +29,7 @@ class DashWidgetsRefresh extends Command public function handle() { // Clear the cache for all widgets - Cache::flush(); + // Cache::flush(); // Create the cache for all DashboardStats widgets Cache::rememberForever('stats.collections', function () { From ca3dfdf4f629b0d124643e3a6155ce6ff3a58cbe Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 10 Oct 2024 16:49:59 +0200 Subject: [PATCH 076/137] fix: various fixes to the reporting workflow --- .../Dashboard/Resources/MoleculeResource.php | 19 ++--- .../Dashboard/Resources/ReportResource.php | 76 +++++++++++-------- .../ReportResource/Pages/CreateReport.php | 8 +- app/Helper.php | 9 +++ 4 files changed, 63 insertions(+), 49 deletions(-) diff --git a/app/Filament/Dashboard/Resources/MoleculeResource.php b/app/Filament/Dashboard/Resources/MoleculeResource.php index 79ed12c5..52aed617 100644 --- a/app/Filament/Dashboard/Resources/MoleculeResource.php +++ b/app/Filament/Dashboard/Resources/MoleculeResource.php @@ -125,7 +125,9 @@ public static function table(Table $table): Table ]) ->action(function (array $data, Molecule $record): void { $record->active = ! $record->active; - self::saveComment($record, $data['reason']); + $record->active ? $record->status = 'APPROVED' : $record->status = 'REVOKED'; + $record->comment = prepareComment($data['reason']); + $record->save(); }) ->modalHidden(function (Molecule $record) { return ! $record['active']; @@ -144,7 +146,9 @@ public static function table(Table $table): Table ->action(function (array $data, Collection $records): void { foreach ($records as $record) { $record->active = ! $record->active; - self::saveComment($record, $data['reason']); + $record->active ? $record->status = 'APPROVED' : $record->status = 'REVOKED'; + $record->comment = prepareComment($data['reason']); + $record->save(); } }) // ->modalHidden(function (Molecule $record) { @@ -207,15 +211,4 @@ public static function getNavigationBadge(): ?string { return Cache::get('stats.molecules'); } - - public static function saveComment($record, $reason) - { - $record->comment = [[ - 'timestamp' => now(), - 'changed_by' => auth()->user()->id, - 'comment' => $reason, - ]]; - - $record->save(); - } } diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 5fd48424..7a065ade 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -79,11 +79,15 @@ public static function form(Form $form): Form Actions::make([ Action::make('approve') ->form(function ($record, $livewire) { - self::$approved_changes = self::prepareApprovedChanges($record, $livewire); - $key_value_fields = getChangesToDisplayModal(self::$approved_changes); - array_unshift($key_value_fields, Textarea::make('reason')); - - return $key_value_fields; + if ($record['is_change']) { + self::$approved_changes = self::prepareApprovedChanges($record, $livewire); + $key_value_fields = getChangesToDisplayModal(self::$approved_changes); + array_unshift($key_value_fields, Textarea::make('reason')); + + return $key_value_fields; + } else { + return [Textarea::make('reason')]; + } }) ->hidden(function (Get $get, string $operation) { return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation != 'edit'; @@ -107,8 +111,14 @@ public static function form(Form $form): Form Action::make('viewCompoundPage') ->color('info') ->url(fn (string $operation, $record): string => $operation === 'create' ? env('APP_URL').'/compounds/'.request()->compound_id : env('APP_URL').'/compounds/'.$record->mol_id_csv) - ->openUrlInNewTab(), + ->openUrlInNewTab() + ->hidden(function (Get $get, string $operation) { + return ! request()->has('type'); + }), ]) + ->hidden(function (Get $get) { + return $get('report_type') != 'molecule'; + }) ->verticalAlignment(VerticalAlignment::End) ->columnStart(4), ]) @@ -589,17 +599,6 @@ public static function prepareApprovedChanges(Report $record, $livewire) { $approved_changes = []; - // In case of reporting a synthetic molecule, Deactivate Molecules - if ($record['mol_id_csv'] && ! $record['is_change']) { - $molecule_ids = explode(',', $record['mol_id_csv']); - $molecule = Molecule::whereIn('id', $molecule_ids)->get(); - foreach ($molecule as $mol) { - $mol->active = false; - $mol->save(); - } - } - - // In case of Changes, run SQL queries for the approved changes $approved_changes['mol_id_csv'] = $record['mol_id_csv']; if ($record['is_change']) { @@ -650,22 +649,33 @@ public static function prepareApprovedChanges(Report $record, $livewire) public static function approveReport(array $data, Report $record, Molecule $molecule, $livewire): void { - // Run SQL queries for the approved changes - self::runSQLQueries($record); - - $suggested_changes = $record['suggested_changes']; - - $suggested_changes['curator']['approved_changes'] = self::$overall_changes; - $record['suggested_changes'] = $suggested_changes; - $record['comment'] = $data['reason']; - $record['status'] = 'approved'; - $formData = copyChangesToCuratorJSON($record, $livewire->data); - $suggested_changes['curator'] = $formData['suggested_changes']['curator']; - $record['suggested_changes'] = $suggested_changes; - - // Save the report record in any case - $record->save(); - + // In case of reporting a synthetic molecule, Deactivate Molecules + if ($record['mol_id_csv'] && ! $record['is_change']) { + $molecule_ids = explode(',', $record['mol_id_csv']); + $molecule = Molecule::whereIn('identifier', $molecule_ids)->get(); + foreach ($molecule as $mol) { + $mol->active = false; + $mol->status = 'REVOKED'; + $mol->comment = prepareComment($data['reason']); + $mol->save(); + } + } else { + // In case of Changes + // Run SQL queries for the approved changes + self::runSQLQueries($record); + + $suggested_changes = $record['suggested_changes']; + + $suggested_changes['curator']['approved_changes'] = self::$overall_changes; + $record['suggested_changes'] = $suggested_changes; + $record->comment = prepareComment($data['reason']); + $record['status'] = 'approved'; + $formData = copyChangesToCuratorJSON($record, $livewire->data); + $suggested_changes['curator'] = $formData['suggested_changes']['curator']; + $record['suggested_changes'] = $suggested_changes; + + $record->save(); + } $livewire->redirect(ReportResource::getUrl('view', ['record' => $record->id])); } diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index c23f02c0..d42df368 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -43,9 +43,11 @@ protected function afterFill(): void $this->data['is_change'] = true; $this->data['existing_geo_locations'] = $this->molecule->geo_locations->pluck('name')->toArray(); $this->data['existing_synonyms'] = $this->molecule->synonyms; - $this->data['existing_cas'] = array_values($this->molecule->cas); + $this->data['existing_cas'] = array_values($this->molecule->cas ?? []); $this->data['existing_organisms'] = $this->molecule->organisms->pluck('name')->toArray(); $this->data['existing_citations'] = $this->molecule->citations->where('title', '!=', null)->pluck('title')->toArray(); + } else { + $this->data['is_change'] = false; } if ($request->has('collection_uuid')) { @@ -94,8 +96,7 @@ protected function mutateFormDataBeforeCreate(array $data): array { $data['user_id'] = auth()->id(); $data['status'] = 'submitted'; - - if ($data['is_change'] == true) { + if ($data['is_change']) { $suggested_changes = []; $suggested_changes['existing_geo_locations'] = $data['existing_geo_locations']; $suggested_changes['new_geo_locations'] = $data['new_geo_locations']; @@ -153,6 +154,7 @@ protected function getCreateFormAction(): Action if (! $this->data['is_change']) { return parent::getCreateFormAction(); } + return parent::getCreateFormAction() ->submit(null) ->form(function () { diff --git a/app/Helper.php b/app/Helper.php index 36ab3aae..47688cc8 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -410,3 +410,12 @@ function copyChangesToCuratorJSON($record, $data) return $data; } + +function prepareComment($reason) +{ + return [[ + 'timestamp' => now(), + 'changed_by' => auth()->user()->id, + 'comment' => $reason, + ]]; +} From c2d3c52be77fe00b5efe1cde57f64477048c414f Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 10 Oct 2024 16:55:58 +0200 Subject: [PATCH 077/137] feat: now IUPAC names are displayed with proper italicisation. --- app/Helper.php | 205 +++++++++++++++++- .../views/livewire/molecule-details.blade.php | 4 +- 2 files changed, 206 insertions(+), 3 deletions(-) diff --git a/app/Helper.php b/app/Helper.php index 3c4d62f2..9300b8cd 100644 --- a/app/Helper.php +++ b/app/Helper.php @@ -1,6 +1,8 @@ 'id', 'name' => 'name', + 'title' => 'title', // 'identifier' => 'identifier', ]; @@ -194,12 +197,14 @@ function changeAudit(array $data): array $data[$key_type][$changed_model] = []; foreach ($changed_data_values as $key => $value) { $value = is_array($value) ? $value : $value->toArray(); - if ($value) { + if (array_key_exists('name', $value)) { if (array_key_exists('identifier', $value)) { $value['name'] = $value['name'].' (ID: '.$value['id'].')'.' (COCONUT ID: '.$value['identifier'].')'; } else { $value['name'] = $value['name'].' (ID: '.$value['id'].')'; } + } else { + $value['title'] = $value['title'].' (ID: '.$value['id'].')'; } $data[$key_type][$changed_model][$key] = array_intersect_key($value, $whitelist); } @@ -232,3 +237,201 @@ function flattenArray(array $array, $prefix = ''): array return $result; } + +function getChangesToDisplayModal($data) +{ + $key_values = []; + $overall_changes = getOverallChanges($data); + + foreach ($overall_changes as $key => $value) { + if (count($value['changes']) == 0) { + continue; + } + array_push($key_values, KeyValue::make($key) + ->addable(false) + ->deletable(false) + ->keyLabel($value['key']) + ->valueLabel($value['value']) + ->editableKeys(false) + ->editableValues(false) + ->default( + $value['changes'] + )); + } + + return $key_values; +} + +function getOverallChanges($data) +{ + $overall_changes = []; + $geo_location_changes = []; + $molecule = Molecule::where('identifier', $data['mol_id_csv'])->first(); + + $db_geo_locations = $molecule->geo_locations->pluck('name')->toArray(); + $deletable_locations = array_key_exists('existing_geo_locations', $data) ? array_diff($db_geo_locations, $data['existing_geo_locations']) : []; + $new_locations = array_key_exists('new_geo_locations', $data) ? (is_string($data['new_geo_locations']) ? $data['new_geo_locations'] : implode(',', $data['new_geo_locations'])) : null; + if (count($deletable_locations) > 0 || $new_locations) { + $key = implode(',', $deletable_locations) == '' ? ' ' : implode(',', $deletable_locations); + $geo_location_changes[$key] = $new_locations; + $overall_changes['geo_location_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $geo_location_changes, + 'delete' => $deletable_locations, + 'add' => $new_locations, + ]; + } + + $synonym_changes = []; + $db_synonyms = $molecule->synonyms; + $deletable_synonyms = array_key_exists('existing_synonyms', $data) ? array_diff($db_synonyms, $data['existing_synonyms']) : []; + $new_synonyms = array_key_exists('new_synonyms', $data) ? (is_string($data['new_synonyms']) ? $data['new_synonyms'] : implode(',', $data['new_synonyms'])) : null; + if (count($deletable_synonyms) > 0 || $new_synonyms) { + $key = implode(',', $deletable_synonyms) == '' ? ' ' : implode(',', $deletable_synonyms); + $synonym_changes[$key] = $new_synonyms; + $overall_changes['synonym_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $synonym_changes, + 'delete' => $deletable_synonyms, + 'add' => $new_synonyms, + ]; + } + + $name_change = []; + if (array_key_exists('name', $data) && $data['name'] && $data['name'] != $molecule->name) { + $name_change[$molecule->name] = $data['name']; + $overall_changes['name_change'] = [ + 'key' => 'Old', + 'value' => 'New', + 'changes' => $name_change, + 'old' => $molecule->name, + 'new' => $data['name'], + ]; + } + + $cas_changes = []; + $db_cas = $molecule->cas; + $deletable_cas = array_key_exists('existing_cas', $data) ? array_diff($db_cas, $data['existing_cas']) : []; + $new_cas = array_key_exists('new_cas', $data) ? (is_string($data['new_cas']) ? $data['new_cas'] : implode(',', $data['new_cas'])) : null; + if (count($deletable_cas) > 0 || $new_cas) { + $key = implode(',', $deletable_cas) == '' ? ' ' : implode(',', $deletable_cas); + $cas_changes[$key] = $new_cas; + $overall_changes['cas_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $cas_changes, + 'delete' => $deletable_cas, + 'add' => $new_cas, + ]; + } + + $organism_changes = []; + $db_organisms = $molecule->organisms->pluck('name')->toArray(); + $deletable_organisms = array_key_exists('existing_organisms', $data) ? array_diff($db_organisms, $data['existing_organisms']) : []; + $new_organisms = []; + $new_organisms_form_data = []; + if (array_key_exists('new_organisms', $data)) { + foreach ($data['new_organisms'] as $organism) { + if ($organism['name']) { + $new_organisms[] = $organism['name']; + $new_organisms_form_data[] = $organism; + } + } + } + if (count($deletable_organisms) > 0 || count($new_organisms) > 0) { + $key = implode(',', $deletable_organisms) == '' ? ' ' : implode(',', $deletable_organisms); + $organism_changes[$key] = implode(',', $new_organisms); + $overall_changes['organism_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $organism_changes, + 'delete' => $deletable_organisms, + 'add' => $new_organisms_form_data, + ]; + } + + $citation_changes = []; + $db_citations = $molecule->citations->where('title', '<>', null)->pluck('title')->toArray(); + $deletable_citations = array_key_exists('existing_citations', $data) ? array_diff($db_citations, $data['existing_citations']) : []; + $new_citations = []; + $new_citations_form_data = []; + if (array_key_exists('new_citations', $data)) { + foreach ($data['new_citations'] as $ciation) { + if ($ciation['title']) { + $new_citations[] = $ciation['title']; + $new_citations_form_data[] = $ciation; + } + } + } + if (count($deletable_citations) > 0 || count($new_citations) > 0) { + $key = implode(',', $deletable_citations) == '' ? ' ' : implode(',', $deletable_citations); + $citation_changes[$key] = implode(',', $new_citations); + $overall_changes['citation_changes'] = [ + 'key' => 'Delete', + 'value' => 'Add', + 'changes' => $citation_changes, + 'delete' => $deletable_citations, + 'add' => $new_citations_form_data, + ]; + } + + return $overall_changes; +} + +function copyChangesToCuratorJSON($record, $data) +{ + $temp = $data; + $data = $record->toArray(); + + $data['suggested_changes']['curator']['existing_geo_locations'] = $temp['existing_geo_locations'] ?? $record['suggested_changes']['curator']['existing_geo_locations']; + $data['suggested_changes']['curator']['new_geo_locations'] = $temp['new_geo_locations'] ?? $record['suggested_changes']['curator']['new_geo_locations']; + $data['suggested_changes']['curator']['approve_geo_locations'] = $temp['approve_geo_locations'] ?? false; + + $data['suggested_changes']['curator']['existing_synonyms'] = $temp['existing_synonyms'] ?? $record['suggested_changes']['curator']['existing_synonyms']; + $data['suggested_changes']['curator']['new_synonyms'] = $temp['new_synonyms'] ?? $record['suggested_changes']['curator']['new_synonyms']; + $data['suggested_changes']['curator']['approve_synonyms'] = $temp['approve_synonyms'] ?? false; + + $data['suggested_changes']['curator']['name'] = $temp['name'] ?? $record['suggested_changes']['curator']['name']; + $data['suggested_changes']['curator']['approve_name'] = $temp['approve_name'] ?? false; + + $data['suggested_changes']['curator']['existing_cas'] = $temp['existing_cas'] ?? $record['suggested_changes']['curator']['existing_cas']; + $data['suggested_changes']['curator']['new_cas'] = $temp['new_cas'] ?? $record['suggested_changes']['curator']['new_cas']; + $data['suggested_changes']['curator']['approve_cas'] = $temp['approve_cas'] ?? false; + + $data['suggested_changes']['curator']['existing_organisms'] = $temp['existing_organisms'] ?? $record['suggested_changes']['curator']['existing_organisms']; + $data['suggested_changes']['curator']['new_organisms'] = $temp['new_organisms'] ?? $record['suggested_changes']['curator']['new_organisms']; + $data['suggested_changes']['curator']['approve_existing_organisms'] = $temp['approve_existing_organisms'] ?? false; + + $data['suggested_changes']['curator']['existing_citations'] = $temp['existing_citations'] ?? $record['suggested_changes']['curator']['existing_citations']; + $data['suggested_changes']['curator']['new_citations'] = $temp['new_citations'] ?? $record['suggested_changes']['curator']['new_citations']; + $data['suggested_changes']['curator']['approve_existing_citations'] = $temp['approve_existing_citations'] ?? false; + + return $data; +} + +function prepareComment($reason) +{ + return [[ + 'timestamp' => now(), + 'changed_by' => auth()->user()->id, + 'comment' => $reason, + ]]; +} + +function convert_italics_notation($text) +{ + // Use preg_replace to replace ~{text} with text + $converted_text = preg_replace('/~\{([^}]*)\}/', '$1', $text); + + return $converted_text; +} + +function remove_italics_notation($text) +{ + // Use preg_replace to find all instances of ~{something} and replace with just something + $converted_text = preg_replace('/~\{([^}]*)\}/', '$1', $text); + + return $converted_text; +} diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index c7277048..dbc73d2a 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -264,10 +264,10 @@ class="text-sm font-medium text-gray-500 sm:flex sm:justify-between"> IUPAC name
- {{ $molecule->iupac_name }} + {!! convert_italics_notation($molecule->iupac_name) !!}
From 22187a3835f2bf24e039d30c1f8aac3e43b862e0 Mon Sep 17 00:00:00 2001 From: Sagar Date: Sun, 13 Oct 2024 12:20:31 +0200 Subject: [PATCH 078/137] fix: to handle italicised display of iupac name when name is not available --- resources/views/livewire/molecule-card.blade.php | 6 +----- resources/views/livewire/molecule-details.blade.php | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/resources/views/livewire/molecule-card.blade.php b/resources/views/livewire/molecule-card.blade.php index 69a21836..b17348a0 100644 --- a/resources/views/livewire/molecule-card.blade.php +++ b/resources/views/livewire/molecule-card.blade.php @@ -19,11 +19,7 @@

- @if ($molecule->name) - {{ $molecule->name }} - @else - {{ $molecule->iupac_name }} - @endif + {!! convert_italics_notation( $molecule->name ? $molecule->name : $molecule->iupac_name) !!}

diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index dbc73d2a..af70e5be 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -36,7 +36,7 @@ class="lg:py-10 py-5 mx-auto max-w-3xl px-4 sm:px-6 md:flex md:items-center md:j

{{ $molecule->identifier }}

- {{ $molecule->name ? $molecule->name : $molecule->iupac_name }} + {!! convert_italics_notation($molecule->name ? $molecule->name : $molecule->iupac_name) !!}

Created on · Last @@ -252,7 +252,7 @@ class="text-sm font-medium text-gray-500 sm:flex sm:justify-between"> Name

- {{ $molecule->name ? $molecule->name : '-' }} + {!! convert_italics_notation($molecule->name ? $molecule->name : '-') !!} From 335fdc259a5ba167d80e9e975dbfa981d5e4646d Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 14 Oct 2024 15:23:36 +0200 Subject: [PATCH 079/137] fix: copy buttons now have a time out of 4 seconds to reset --- resources/views/livewire/copy-button.blade.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/copy-button.blade.php b/resources/views/livewire/copy-button.blade.php index 8f3dc872..14be0e9b 100644 --- a/resources/views/livewire/copy-button.blade.php +++ b/resources/views/livewire/copy-button.blade.php @@ -1,6 +1,9 @@ -
\ No newline at end of file diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index af70e5be..05cc9cb5 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -923,7 +923,7 @@ class="ml-3 text-base text-gray-500">Lipinski
-
From 46c3a16c0afa36b23afe0810507c6c64bf58bf8d Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 14 Oct 2024 15:46:45 +0200 Subject: [PATCH 081/137] feat: on hover now indicates which source the file is being downloaded from --- resources/views/livewire/molecule-depict2d.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/livewire/molecule-depict2d.blade.php b/resources/views/livewire/molecule-depict2d.blade.php index 2b3708b9..7e3e808e 100644 --- a/resources/views/livewire/molecule-depict2d.blade.php +++ b/resources/views/livewire/molecule-depict2d.blade.php @@ -34,7 +34,7 @@ class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> - + From 10711c4c59943c24b2125684808bbb40e83475b8 Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 14 Oct 2024 16:45:01 +0200 Subject: [PATCH 082/137] feat: now the search allows for partial inchikey search --- app/Actions/Coconut/SearchMolecule.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Actions/Coconut/SearchMolecule.php b/app/Actions/Coconut/SearchMolecule.php index c360495b..7fd7c0de 100644 --- a/app/Actions/Coconut/SearchMolecule.php +++ b/app/Actions/Coconut/SearchMolecule.php @@ -73,11 +73,9 @@ public function query($query, $size, $type, $sort, $tagType, $page) } return [$results, $this->collection, $this->organisms]; - } catch (QueryException $exception) { return $this->handleException($exception); - } } @@ -89,6 +87,7 @@ private function determineQueryType($query) $patterns = [ 'inchi' => '/^((InChI=)?[^J][0-9BCOHNSOPrIFla+\-\(\)\\\\\/,pqbtmsih]{6,})$/i', 'inchikey' => '/^([0-9A-Z\-]{27})$/i', // Modified to ensure exact length + 'parttialinchikey' => '/^([A-Z]{14})$/i', 'smiles' => '/^([^J][0-9BCOHNSOPrIFla@+\-\[\]\(\)\\\\\/%=#$]{6,})$/i', ]; @@ -102,6 +101,8 @@ private function determineQueryType($query) return 'inchi'; } elseif ($type == 'inchikey' && substr($query, 14, 1) == '-' && strlen($query) == 27) { return 'inchikey'; + } elseif ($type == 'parttialinchikey' && strlen($query) == 14) { + return 'parttialinchikey'; } elseif ($type == 'smiles') { return 'smiles'; } @@ -179,6 +180,7 @@ private function buildStatement($queryType, $offset, $filterMap) break; case 'inchikey': + case 'parttialinchikey': $statement = "SELECT id, COUNT(*) OVER () FROM molecules WHERE standard_inchi_key LIKE '%{$this->query}%' @@ -330,7 +332,7 @@ private function buildDefaultStatement($offset) WHEN \"name\"::TEXT ILIKE '%{$this->query}%' THEN 4 WHEN \"synonyms\"::TEXT ILIKE '%{$this->query}%' THEN 5 WHEN \"identifier\"::TEXT ILIKE '%{$this->query}%' THEN 6 - ELSE 7 + ELSE 7 END LIMIT {$this->size} OFFSET {$offset}"; } else { From 43b88f706f32b6354e76bf5a661d82070931dc0d Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 15 Oct 2024 13:31:34 +0200 Subject: [PATCH 083/137] fix: references to the compounds' source links are correctly parsed and displayed. --- app/Livewire/MoleculeDetails.php | 12 + .../views/livewire/molecule-details.blade.php | 1321 +++++++++-------- 2 files changed, 678 insertions(+), 655 deletions(-) diff --git a/app/Livewire/MoleculeDetails.php b/app/Livewire/MoleculeDetails.php index 4c68b249..a25ae907 100644 --- a/app/Livewire/MoleculeDetails.php +++ b/app/Livewire/MoleculeDetails.php @@ -60,6 +60,18 @@ public function placeholder() HTML; } + public function getReferenceUrls($pivot) + { + $references = explode('|', $pivot->reference); + $urls = explode('|', $pivot->url); + $combined = array_combine($references, $urls); + $combined = array_map(function ($key, $value) { + return [$key => $value]; + }, $references, $urls); + + return $combined; + } + public function render(): View { return view('livewire.molecule-details'); diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index 05cc9cb5..08d1bc94 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -1,33 +1,34 @@
@if ($molecule->status == 'REVOKED') -
-
-
- -
-
-

STATUS: {{ $molecule->status }}

-

This compound has been removed from the COCONUT - database due to the lack - of conclusive evidence supporting its classification as a natural product.

-
-
    -
  • {{ $molecule->comment[0]['comment'] }}
    - Last update: {{ $molecule->comment[0]['timestamp'] }} -
  • -
-
- Request - changes to this page +
+
+
+ +
+
+

STATUS: {{ $molecule->status }}

+

This compound has been removed from the COCONUT + database due to the lack + of conclusive evidence supporting its classification as a natural product.

+
+
    +
  • {{ $molecule->comment[0]['comment'] }}
    + Last update: {{ $molecule->comment[0]['timestamp'] }} + +
  • +
+ Request + changes to this page
+
@endif
@@ -46,48 +47,48 @@ class="mb-2 text-2xl break-all font-bold leading-7 break-words text-gray-900 sm:
@if ($molecule->properties) -
-
-
-
NPLikeness -
- - NP Likeness Score: The likelihood of the compound to be a - natural - product, ranges from -5 (less likely) to 5 (very likely). -
-
-
-
-
- @foreach (range(0, ceil(npScore($molecule->properties->np_likeness))) as $i) -
- @endforeach -
- {{ $molecule->properties->np_likeness }} -
+
+
+
+
NPLikeness +
+ + NP Likeness Score: The likelihood of the compound to be a + natural + product, ranges from -5 (less likely) to 5 (very likely).
+
+
+
+
+ @foreach (range(0, ceil(npScore($molecule->properties->np_likeness))) as $i) +
+ @endforeach +
+ {{ $molecule->properties->np_likeness }} +
-
-
-
Annotation Level
-
- @for ($i = 0; $i < $molecule->annotation_level; $i++) - ★ - @endfor - @for ($i = $molecule->annotation_level; $i < 5; $i++) - ☆ - @endfor -
+
+
+
+
Annotation Level
+
+ @for ($i = 0; $i < $molecule->annotation_level; $i++) + ★ + @endfor + @for ($i = $molecule->annotation_level; $i < 5; $i++) + ☆ + @endfor +
@if ($molecule->organisms && count($molecule->organisms) > 0) -
-
-
-

- Organisms ({{ count($molecule->organisms) }}) -

-
-
-
- - @if (count($molecule->organisms) > 10) -
- - -
+
+
+
+

+ Organisms ({{ count($molecule->organisms) }}) +

+
+
+
+ + @if (count($molecule->organisms) > 10) +
+ +
+ @endif
-
+
+
@endif @if ($molecule->geo_locations && count($molecule->geo_locations) > 0) -
-
-
-

- Geolocations

-
-
-
-
    - @foreach ($molecule->geo_locations as $geo_location) - @if ($geo_location != '') -
  • - - {{ $geo_location->name }} - -
  • - @endif - @endforeach -
-
+
+
+
+

+ Geolocations

+
+
+
+
    + @foreach ($molecule->geo_locations as $geo_location) + @if ($geo_location != '') +
  • + + {{ $geo_location->name }} + +
  • + @endif + @endforeach +
-
+
+
@endif
@@ -264,7 +265,7 @@ class="text-sm font-medium text-gray-500 sm:flex sm:justify-between"> IUPAC name
- {!! convert_italics_notation($molecule->iupac_name) !!} + {!! convert_italics_notation($molecule->iupac_name) !!}
@if ($molecule->properties) -
-
-
Murcko - Framework -
-
-
- {{ $molecule->properties->murcko_framework ? $molecule->properties->murcko_framework : '-' }} - +
+
+
Murcko + Framework
+
+ {{ $molecule->properties->murcko_framework ? $molecule->properties->murcko_framework : '-' }} + +
+
@endif @if ($molecule->synonyms && count($molecule->synonyms) > 0) -
-
- Synonyms -
+
+
+ Synonyms +
-
-
-
    - @foreach ($molecule->synonyms as $index => $synonym) - @if ($synonym != '') -
  • - - {{ $synonym }} - -
  • - @endif - @endforeach -
- @if ($molecule->synonym_count > 10) -
- - -
+
+
+
    + @foreach ($molecule->synonyms as $index => $synonym) + @if ($synonym != '') +
  • + + {{ $synonym }} + +
  • @endif + @endforeach +
+ @if ($molecule->synonym_count > 10) +
+ +
+ @endif
+
@endif
@@ -373,94 +374,94 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm"> @if ($molecule->properties) -
-
@endif @if ($molecule->properties) -
-
@endif @@ -475,251 +476,261 @@ class="ml-3 text-base">Is glycoside:

Citations

@if (count($molecule->citations) > 0) -
-
- @foreach ($molecule->citations as $index => $citation) - @if ($citation->title != '') -
- -
- -

- - {{ $citation->title }} - -

-

- - {{ $citation->authors }} - -

-

- - {{ $citation->doi }} - -

-
-
- @endif - @endforeach - -
- @if (count($molecule->citations) > 6) -
- - +
+
+ @foreach ($molecule->citations as $index => $citation) + @if ($citation->title != '') +
+ +
+ +

+ + {{ $citation->title }} + +

+

+ + {{ $citation->authors }} + +

+

+ + {{ $citation->doi }} + +

+
@endif + @endforeach +
+ @if (count($molecule->citations) > 6) +
+ + +
+ @endif +
@else -

No citations

+

No citations

@endif

Collections

@if (count($molecule->collections) > 0) -
- @foreach ($molecule->collections as $index => $collection) -
-
-
-
+ @foreach ($molecule->collections as $index => $collection) +
+
+
+ + + {{ $collection->title }} + + + + +

+ {{ $collection->description }} +

+

+ {{ $collection->doi }} +

+

+ @foreach($this->getReferenceUrls($collection->pivot) as $key => $item) + @foreach ( $item as $reference => $url) + @if (!empty($url)) + + {{ $reference }} + + + - - {{ $collection->title }} - - - - -

- {{ $collection->description }} -

-

- {{ $collection->doi }} -

-

- @if (!empty($collection->pivot->url)) - - @endif - {{ $collection->pivot->reference }} - -   - - @if (!empty($collection->pivot->url)) - - - - - - @endif -

-
-
-
- @endforeach - @if (count($molecule->collections) > 6) -
- - + + + + + + @else + {{ $reference }} + + + + + @endif + @endforeach + @endforeach + +
- @endif +
+
+ @endforeach + @if (count($molecule->collections) > 6) +
+ +
+ @endif +
@else -

No collections

+

No collections

@endif
@@ -729,196 +740,196 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm"> @if ($molecule->related && count($molecule->related) > 0) -
-
-
-
-

Tautomers

-
-
-
- @foreach ($molecule->related as $tautomer) - - @endforeach -
+
+
+
+
+

Tautomers

+
+
+
+ @foreach ($molecule->related as $tautomer) + + @endforeach
-
+
+
@endif @if ($molecule->is_parent && $molecule->has_variants) -
-
-
-
-

Stereochemical - Variants -

-
-
-
- @foreach ($molecule->variants as $variant) - - @endforeach -
+
+
+
+
+

Stereochemical + Variants +

+
+
+
+ @foreach ($molecule->variants as $variant) + + @endforeach
-
+
+
@endif @if ($molecule->parent_id != null) -
-
-
-
-

Parent (Without - stereo definitions) -

-
-
-
-
- -
+
+
+
+
+

Parent (Without + stereo definitions) +

+
+
+
+
+
-
+
+
@endif @if ($molecule->properties) -
-
-
-
-

Molecular - Properties -

-
-
-
-
    -
  • Mol. Formula : - {{ $molecule->properties->molecular_formula }} -
  • -
  • - Mol. Weight - - - - -
    - Exact Isotopic Mass is calculated using RDKit - https://www.rdkit.org/docs/source/rdkit.Chem.Descriptors.html -
    -
    {{ $molecule->properties->exact_molecular_weight }}
    -
  • -
  • Total - atom number : - {{ $molecule->properties->total_atom_count }} -
  • -
  • Heavy - atom number : - {{ $molecule->properties->heavy_atom_count }}
  • -
  • Aromatic Ring Count : - {{ $molecule->properties->aromatic_rings_count }}
  • -
  • Rotatable Bond count : - {{ $molecule->properties->rotatable_bond_count }}
  • -
  • Minimal number of rings - : {{ $molecule->properties->number_of_minimal_rings }} -
  • -
  • Formal Charge : - {{ $molecule->properties->total_atom_count }}
  • -
  • Contains Sugar : - {{ $molecule->properties->contains_sugar ? 'True' : 'False' }} -
  • -
  • Contains Ring Sugars : - {{ $molecule->properties->contains_ring_sugars ? 'True' : 'False' }} -
  • -
  • Contains Linear Sugars - : - {{ $molecule->properties->contains_linear_sugars ? 'True' : 'False' }} -
  • -
-
-
+
+
+
+
+

Molecular + Properties +

-
-
- -
-
-
-
-

Molecular - Descriptors -

-
-
-
    +
    +
    +
    • NP-likeness scores : - {{ $molecule->properties->np_likeness }}
    • -
    • Alogp - : - {{ $molecule->properties->alogp }}
    • + class="ml-3 text-base text-gray-500">Mol. Formula : + {{ $molecule->properties->molecular_formula }} + +
    • + Mol. Weight + + + + +
      + Exact Isotopic Mass is calculated using RDKit - https://www.rdkit.org/docs/source/rdkit.Chem.Descriptors.html +
      +
      {{ $molecule->properties->exact_molecular_weight }}
      +
    • TopoPSA : - {{ $molecule->properties->topological_polar_surface_area }} + class="ml-3 text-base text-gray-500">Total + atom number : + {{ $molecule->properties->total_atom_count }}
    • -
    • Fsp3 - : - {{ $molecule->properties->fractioncsp3 }}
    • Hydrogen - Bond Acceptor Count - : {{ $molecule->properties->hydrogen_bond_acceptors }}
    • + class="ml-3 text-base text-gray-500">Heavy + atom number : + {{ $molecule->properties->heavy_atom_count }} +
    • Aromatic Ring Count : + {{ $molecule->properties->aromatic_rings_count }}
    • +
    • Rotatable Bond count : + {{ $molecule->properties->rotatable_bond_count }}
    • Hydrogen - Bond Donor Count : - {{ $molecule->properties->hydrogen_bond_donors }} + class="ml-3 text-base text-gray-500">Minimal number of rings + : {{ $molecule->properties->number_of_minimal_rings }}
    • Lipinski - Hydrogen Bond - Acceptor Count : - {{ $molecule->properties->hydrogen_bond_acceptors_lipinski }} + class="ml-3 text-base text-gray-500">Formal Charge : + {{ $molecule->properties->total_atom_count }}
    • +
    • Contains Sugar : + {{ $molecule->properties->contains_sugar ? 'True' : 'False' }}
    • Lipinski - Hydrogen Bond Donor - Count : - {{ $molecule->properties->hydrogen_bond_donors_lipinski }} + class="ml-3 text-base text-gray-500">Contains Ring Sugars : + {{ $molecule->properties->contains_ring_sugars ? 'True' : 'False' }}
    • Lipinski - RO5 Violations : - {{ $molecule->properties->lipinski_rule_of_five_violations }} + class="ml-3 text-base text-gray-500">Contains Linear Sugars + : + {{ $molecule->properties->contains_linear_sugars ? 'True' : 'False' }}
-
+
+
+ +
+
+
+
+

Molecular + Descriptors +

+
+
+
    +
  • NP-likeness scores : + {{ $molecule->properties->np_likeness }}
  • +
  • Alogp + : + {{ $molecule->properties->alogp }}
  • +
  • TopoPSA : + {{ $molecule->properties->topological_polar_surface_area }} +
  • +
  • Fsp3 + : + {{ $molecule->properties->fractioncsp3 }}
  • +
  • Hydrogen + Bond Acceptor Count + : {{ $molecule->properties->hydrogen_bond_acceptors }}
  • +
  • Hydrogen + Bond Donor Count : + {{ $molecule->properties->hydrogen_bond_donors }} +
  • +
  • Lipinski + Hydrogen Bond + Acceptor Count : + {{ $molecule->properties->hydrogen_bond_acceptors_lipinski }} +
  • +
  • Lipinski + Hydrogen Bond Donor + Count : + {{ $molecule->properties->hydrogen_bond_donors_lipinski }} +
  • +
  • Lipinski + RO5 Violations : + {{ $molecule->properties->lipinski_rule_of_five_violations }} +
  • +
+
+
+
+
@endif
@@ -945,4 +956,4 @@ class="ml-3 text-base text-gray-500">Lipinski
-
+ \ No newline at end of file From 3f999a4f0c72e585521733f0dedf50389518d34b Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 16 Oct 2024 11:02:33 +0200 Subject: [PATCH 084/137] fix: to open reporting in a new tab --- resources/views/livewire/molecule-details.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index 05cc9cb5..d87df849 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -932,10 +932,10 @@ class="ml-3 text-base text-gray-500">Lipinski
From 7e0fe0f7ecb650a71a780c3140a72ca30b7e373e Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 16 Oct 2024 16:46:42 +0200 Subject: [PATCH 085/137] fix: the request now goes to rdkit instead of opedbabel which was throwing bad gateway error. --- app/Livewire/MoleculeDepict3d.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Livewire/MoleculeDepict3d.php b/app/Livewire/MoleculeDepict3d.php index a4cafd91..2d196328 100644 --- a/app/Livewire/MoleculeDepict3d.php +++ b/app/Livewire/MoleculeDepict3d.php @@ -18,7 +18,7 @@ class MoleculeDepict3d extends Component #[Computed] public function source() { - return env('CM_API').'depict/3D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width.'&CIP='.$this->CIP.'&toolkit=openbabel'; + return env('CM_API').'depict/3D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width.'&CIP='.$this->CIP.'&toolkit=rdkit'; } public function render() From c2c4b4956e1cdcef9fa520880b875d5d8c2baf55 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 5 Nov 2024 09:53:53 +0100 Subject: [PATCH 086/137] fix: cookie consent privacy and terms of use links are pointed to the proper routes --- routes/web.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 58fd3592..1060d75a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -32,8 +32,8 @@ Route::get('/', ApplicationController::class); -Route::get('/policy', Policy::class); -Route::get('/terms', Terms::class); +Route::get('/privacy-policy', Policy::class); +Route::get('/terms-of-service', Terms::class); Route::get('/guidelines', Guides::class); Route::get('/about', About::class); Route::get('/download', Download::class); From efab97f4efe79f8c81cbf9fc90d67225591147b6 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 6 Nov 2024 09:40:27 +0100 Subject: [PATCH 087/137] fix: refactored the form into the Citations model and applied a minor fix to creating citations. --- .../Dashboard/Resources/CitationResource.php | 88 +----------------- app/Models/Citation.php | 92 +++++++++++++++++++ 2 files changed, 93 insertions(+), 87 deletions(-) diff --git a/app/Filament/Dashboard/Resources/CitationResource.php b/app/Filament/Dashboard/Resources/CitationResource.php index 00776312..28ee9b40 100644 --- a/app/Filament/Dashboard/Resources/CitationResource.php +++ b/app/Filament/Dashboard/Resources/CitationResource.php @@ -6,18 +6,12 @@ use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\CollectionRelationManager; use App\Filament\Dashboard\Resources\CitationResource\RelationManagers\MoleculeRelationManager; use App\Models\Citation; -use Closure; -use Filament\Forms\Components\Section; -use Filament\Forms\Components\Textarea; -use Filament\Forms\Components\TextInput; use Filament\Forms\Form; -use Filament\Forms\Get; use Filament\Resources\Resource; use Filament\Tables; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; use Illuminate\Support\Facades\Cache; -use Illuminate\Support\HtmlString; use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager; class CitationResource extends Resource @@ -35,87 +29,7 @@ class CitationResource extends Resource public static function form(Form $form): Form { return $form - ->schema([ - Section::make() - ->schema([ - TextInput::make('failMessage') - ->default('') - ->hidden() - ->disabled(), - TextInput::make('doi') - ->label('DOI') - ->live(onBlur: true) - ->afterStateUpdated(function ($set, $state) { - if (doiRegxMatch($state)) { - $citationDetails = fetchDOICitation($state); - if ($citationDetails) { - $set('title', $citationDetails['title']); - $set('authors', $citationDetails['authors']); - $set('citation_text', $citationDetails['citation_text']); - $set('failMessage', 'Success'); - } else { - $set('failMessage', 'No citation found. Please fill in the details manually'); - } - } else { - $set('failMessage', 'Invalid DOI'); - } - }) - ->helperText(function ($get) { - - if ($get('failMessage') == 'Fetching') { - return new HtmlString(' - - - '); - } elseif ($get('failMessage') != 'Success') { - return new HtmlString(''.$get('failMessage').''); - } else { - return null; - } - }) - ->required() - ->unique() - ->rules([ - fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { - if ($get('failMessage') != 'No citation found. Please fill in the details manually') { - $fail($get('failMessage')); - } - }, - ]) - ->validationMessages([ - 'unique' => 'The DOI already exists.', - ]), - ]), - - Section::make() - ->schema([ - TextInput::make('title') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - TextInput::make('authors') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - Textarea::make('citation_text') - ->label('Citation text / URL') - ->disabled(function ($get, string $operation) { - if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { - return false; - } else { - return true; - } - }), - ])->columns(1), - ]); + ->schema(Citation::getForm()); } public static function table(Table $table): Table diff --git a/app/Models/Citation.php b/app/Models/Citation.php index 3cc86333..10979896 100644 --- a/app/Models/Citation.php +++ b/app/Models/Citation.php @@ -2,9 +2,15 @@ namespace App\Models; +use Closure; +use Filament\Forms\Components\Section; +use Filament\Forms\Components\Textarea; +use Filament\Forms\Components\TextInput; +use Filament\Forms\Get; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphToMany; +use Illuminate\Support\HtmlString; use OwenIt\Auditing\Contracts\Auditable; class Citation extends Model implements Auditable @@ -52,4 +58,90 @@ public function transformAudit(array $data): array { return changeAudit($data); } + + public static function getForm(): array + { + return [ + Section::make() + ->schema([ + TextInput::make('failMessage') + ->default('') + ->hidden() + ->disabled(), + TextInput::make('doi') + ->label('DOI') + ->live(onBlur: true) + ->afterStateUpdated(function ($set, $state) { + if (doiRegxMatch($state)) { + $set('failMessage', 'Fetching'); + $citationDetails = fetchDOICitation($state); + if ($citationDetails) { + $set('title', $citationDetails['title']); + $set('authors', $citationDetails['authors']); + $set('citation_text', $citationDetails['citation_text']); + $set('failMessage', 'Success'); + } else { + $set('failMessage', 'No citation found. Please fill in the details manually'); + } + } else { + $set('failMessage', 'Invalid DOI'); + } + }) + ->helperText(function ($get) { + + if ($get('failMessage') == 'Fetching') { + return new HtmlString(' + + + '); + } elseif ($get('failMessage') != 'Success') { + return new HtmlString(''.$get('failMessage').''); + } else { + return null; + } + }) + ->required() + ->unique() + ->rules([ + fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) { + if ($get('failMessage') != 'Success') { + $fail($get('failMessage')); + } + }, + ]) + ->validationMessages([ + 'unique' => 'The DOI already exists.', + ]), + ]), + + Section::make() + ->schema([ + TextInput::make('title') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + TextInput::make('authors') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + Textarea::make('citation_text') + ->label('Citation text / URL') + ->disabled(function ($get, string $operation) { + if ($operation = 'edit' || $get('failMessage') == 'No citation found. Please fill in the details manually') { + return false; + } else { + return true; + } + }), + ])->columns(1), + ]; + } } From 71645e523a9d66b0207cb239227a82f6003ed98f Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 6 Nov 2024 09:42:26 +0100 Subject: [PATCH 088/137] feat: molecule citation relation can now be searched by doi as well to attach citations to the molecule. --- .../RelationManagers/CitationsRelationManager.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Filament/Dashboard/Resources/MoleculeResource/RelationManagers/CitationsRelationManager.php b/app/Filament/Dashboard/Resources/MoleculeResource/RelationManagers/CitationsRelationManager.php index 728e0e5c..08d7d923 100644 --- a/app/Filament/Dashboard/Resources/MoleculeResource/RelationManagers/CitationsRelationManager.php +++ b/app/Filament/Dashboard/Resources/MoleculeResource/RelationManagers/CitationsRelationManager.php @@ -2,6 +2,7 @@ namespace App\Filament\Dashboard\Resources\MoleculeResource\RelationManagers; +use App\Models\Citation; use Filament\Forms\Form; use Filament\Resources\RelationManagers\RelationManager; use Filament\Tables; @@ -28,7 +29,10 @@ public function table(Table $table): Table // ]) ->headerActions([ - Tables\Actions\AttachAction::make(), + Tables\Actions\AttachAction::make() + ->recordSelectSearchColumns(['title', 'authors', 'doi']), + Tables\Actions\CreateAction::make() + ->form(Citation::getForm()), ]) ->actions([ Tables\Actions\EditAction::make(), From 0726de48affa73f8e88fef2df3dbd2304b32eabc Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 6 Nov 2024 09:44:12 +0100 Subject: [PATCH 089/137] feat: now citations can be searched by doi from the report's molecule relation manager. --- .../RelationManagers/CitationsRelationManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/RelationManagers/CitationsRelationManager.php b/app/Filament/Dashboard/Resources/ReportResource/RelationManagers/CitationsRelationManager.php index 7278d29b..4a901ca4 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/RelationManagers/CitationsRelationManager.php +++ b/app/Filament/Dashboard/Resources/ReportResource/RelationManagers/CitationsRelationManager.php @@ -36,7 +36,7 @@ public function table(Table $table): Table ->headerActions([ Tables\Actions\AttachAction::make() ->multiple() - ->recordSelectSearchColumns(['title', 'authors']), + ->recordSelectSearchColumns(['title', 'authors', 'doi']), ]) ->actions([ Tables\Actions\DetachAction::make(), From 0e3278be396bd6d0ae68396f1e0ffb5b7b7dd4e6 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 7 Nov 2024 17:28:30 +0100 Subject: [PATCH 090/137] feat: new column assinged_to is added to the reports table --- ..._150749_add_columns_on_reports_table_1.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2024_11_07_150749_add_columns_on_reports_table_1.php diff --git a/database/migrations/2024_11_07_150749_add_columns_on_reports_table_1.php b/database/migrations/2024_11_07_150749_add_columns_on_reports_table_1.php new file mode 100644 index 00000000..944b80a4 --- /dev/null +++ b/database/migrations/2024_11_07_150749_add_columns_on_reports_table_1.php @@ -0,0 +1,28 @@ +foreignId('assigned_to')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('reports', function (Blueprint $table) { + $table->dropColumn(['assigned_to']); + }); + } +}; From 2cabe52440411f7de072b1e37cdfc8effea066c3 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 7 Nov 2024 17:29:51 +0100 Subject: [PATCH 091/137] feat: relation to retrieve the assigned user is added to the user model --- app/Models/Report.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Models/Report.php b/app/Models/Report.php index f6e45e66..a0d808c6 100644 --- a/app/Models/Report.php +++ b/app/Models/Report.php @@ -78,6 +78,11 @@ public function users(): BelongsTo return $this->belongsTo(User::class); } + public function assignedTo(): BelongsTo + { + return $this->belongsTo(User::class); + } + public function transformAudit(array $data): array { return changeAudit($data); From 6987ddf07b13e2092329045a50dd1b4b29ce07fd Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 7 Nov 2024 17:36:06 +0100 Subject: [PATCH 092/137] feat: users with any roles can now assign reports for curation --- .../Dashboard/Resources/ReportResource.php | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index a26e7ad1..fe201b80 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -7,11 +7,13 @@ use App\Models\Citation; use App\Models\Molecule; use App\Models\Report; +use App\Models\User; use Archilex\AdvancedTables\Filters\AdvancedFilter; use Filament\Forms\Components\Actions; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Grid; use Filament\Forms\Components\KeyValue; +use Filament\Forms\Components\Radio; use Filament\Forms\Components\Select; use Filament\Forms\Components\SpatieTagsInput; use Filament\Forms\Components\Textarea; @@ -55,10 +57,27 @@ public static function form(Form $form): Form ]) ->inline() ->columnSpan(2), + Actions::make([ + Action::make('assign') + ->hidden(function (Get $get, string $operation, Report $record) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != null; + }) + ->form([ + Radio::make('curator') + ->label('Choose a curator') + ->options(function () { + return $users = User::whereHas('roles')->pluck('name', 'id'); + }), + ]) + ->action(function (array $data, Report $record): void { + $record['assigned_to'] = $data['curator']; + $record->save(); + $record->refresh(); + }), Action::make('approve') - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create'; + ->hidden(function (Get $get, string $operation, Report $record) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != auth()->id(); }) ->form([ Textarea::make('reason'), @@ -82,8 +101,8 @@ public static function form(Form $form): Form }), Action::make('reject') ->color('danger') - ->hidden(function (Get $get, string $operation) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create'; + ->hidden(function (Get $get, string $operation, Report $record) { + return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != auth()->id(); }) ->form([ Textarea::make('reason'), @@ -277,7 +296,7 @@ public static function table(Table $table): Table Tables\Actions\ViewAction::make(), Tables\Actions\EditAction::make() ->visible(function ($record) { - return auth()->user()->roles()->exists() && $record['status'] == 'submitted'; + return auth()->user()->roles()->exists() && $record['status'] == 'submitted' && ($record['assigned_to'] == null || $record['assigned_to'] == auth()->id()); }), Tables\Actions\Action::make('approve') // ->button() From 0c2af6047a33794ac5c17e7b634df02d5a4f25f9 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 7 Nov 2024 17:58:09 +0100 Subject: [PATCH 093/137] fix: only assigned users now have access to edit view of reports --- app/Policies/ReportPolicy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Policies/ReportPolicy.php b/app/Policies/ReportPolicy.php index a4713d8f..5aae4064 100644 --- a/app/Policies/ReportPolicy.php +++ b/app/Policies/ReportPolicy.php @@ -42,11 +42,11 @@ public function create(User $user): bool */ public function update(User $user, Report $report): bool { - if ($user->id == $report->user_id) { + if (($user->can('update_report') && ($report->assigned_to == null || $report->assigned_to == $user->id)) || ($user->id == $report->user_id && $report->status != null)) { return true; + } else { + return false; } - - return $user->can('update_report'); } /** From ed4e0d11392c66b0ce23eab7e5f9f1c9b10fce5b Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 7 Nov 2024 18:09:40 +0100 Subject: [PATCH 094/137] fix: users can not edit the submitted reports and creation time null report record is handled. --- app/Filament/Dashboard/Resources/ReportResource.php | 6 +++--- app/Policies/ReportPolicy.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index fe201b80..414a6816 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -60,7 +60,7 @@ public static function form(Form $form): Form Actions::make([ Action::make('assign') - ->hidden(function (Get $get, string $operation, Report $record) { + ->hidden(function (Get $get, string $operation, ?Report $record) { return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != null; }) ->form([ @@ -76,7 +76,7 @@ public static function form(Form $form): Form $record->refresh(); }), Action::make('approve') - ->hidden(function (Get $get, string $operation, Report $record) { + ->hidden(function (Get $get, string $operation, ?Report $record) { return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != auth()->id(); }) ->form([ @@ -101,7 +101,7 @@ public static function form(Form $form): Form }), Action::make('reject') ->color('danger') - ->hidden(function (Get $get, string $operation, Report $record) { + ->hidden(function (Get $get, string $operation, ?Report $record) { return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != auth()->id(); }) ->form([ diff --git a/app/Policies/ReportPolicy.php b/app/Policies/ReportPolicy.php index 5aae4064..fa5aa2f3 100644 --- a/app/Policies/ReportPolicy.php +++ b/app/Policies/ReportPolicy.php @@ -42,7 +42,7 @@ public function create(User $user): bool */ public function update(User $user, Report $report): bool { - if (($user->can('update_report') && ($report->assigned_to == null || $report->assigned_to == $user->id)) || ($user->id == $report->user_id && $report->status != null)) { + if (($user->can('update_report') && ($report->assigned_to == null || $report->assigned_to == $user->id)) || ($user->id == $report->user_id && $report->status == null)) { return true; } else { return false; From fe580af297cee8732bea718d5c4d795b17f39a2c Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 12 Nov 2024 22:54:07 +0100 Subject: [PATCH 095/137] feat: added foreign key on structures table linking it to molecules table and added the relation in the models --- app/Models/Molecule.php | 5 ++++ app/Models/Structure.php | 17 +++++++++++ ...150749_add_columns_on_structures_table.php | 28 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 database/migrations/2024_11_12_150749_add_columns_on_structures_table.php diff --git a/app/Models/Molecule.php b/app/Models/Molecule.php index b27f9906..eea1d992 100644 --- a/app/Models/Molecule.php +++ b/app/Models/Molecule.php @@ -90,6 +90,11 @@ public function properties(): HasOne return $this->hasOne(Properties::class); } + public function structures(): HasOne + { + return $this->hasOne(Structure::class); + } + /** * Get the variants associated with the molecule. */ diff --git a/app/Models/Structure.php b/app/Models/Structure.php index eefb56f1..ca8dda42 100644 --- a/app/Models/Structure.php +++ b/app/Models/Structure.php @@ -10,4 +10,21 @@ class Structure extends Model implements Auditable { use HasFactory; use \OwenIt\Auditing\Auditable; + + protected $fillable = [ + 'molecule_id', + '2d', + '3d', + 'mol', + ]; + + public function molecule() + { + return $this->belongsTo(Molecule::class, 'molecule_id'); + } + + public function transformAudit(array $data): array + { + return changeAudit($data); + } } diff --git a/database/migrations/2024_11_12_150749_add_columns_on_structures_table.php b/database/migrations/2024_11_12_150749_add_columns_on_structures_table.php new file mode 100644 index 00000000..58f9be8a --- /dev/null +++ b/database/migrations/2024_11_12_150749_add_columns_on_structures_table.php @@ -0,0 +1,28 @@ +foreignId('molecule_id')->unique()->constrained()->onDelete('cascade')->after('id'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('structures', function (Blueprint $table) { + $table->dropColumn(['molecule_id']); + }); + } +}; From 1569b81473936ea73a4ccc19c760742c53b3b536 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 12 Nov 2024 22:59:51 +0100 Subject: [PATCH 096/137] feat: new command to import the 2d SDFs into structures table --- app/Console/Commands/Import2DSDFs.php | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 app/Console/Commands/Import2DSDFs.php diff --git a/app/Console/Commands/Import2DSDFs.php b/app/Console/Commands/Import2DSDFs.php new file mode 100644 index 00000000..5ff12277 --- /dev/null +++ b/app/Console/Commands/Import2DSDFs.php @@ -0,0 +1,78 @@ +argument('file')); + if (! file_exists($file) || ! is_readable($file)) { + $this->error('File not found or not readable.'); + + return 1; + } + + $batchSize = 1000; + $header = null; + $data = []; + $rowCount = 0; + $json = file_get_contents($file); + $json_data = json_decode($json, true); + if ($json === false) { + exit('Error reading the JSON file'); + } + + $batchSize = 10000; // Number of molecules to process in each batch + $data = []; // Array to store data for batch updating + $totalElements = count($json_data); + + for ($i = 0; $i < $totalElements; $i += $batchSize) { + $this->info('Processing batch '.($i / $batchSize + 1).' of '.ceil($totalElements / $batchSize)); + $batch = array_slice($json_data, $i, $totalElements - $i < $batchSize ? $totalElements - $i : $batchSize); + $this->insertBatch($batch); + } + + $this->info('Annotation scores generated successfully.'); + } + + /** + * Update a batch of data into the database. + * + * @return void + */ + private function insertBatch(array $data) + { + DB::transaction(function () use ($data) { + foreach ($data as $identifier => $sdf_2d) { + $molecule = Molecule::select('id')->where('identifier', $identifier)->first(); + $structure = new Structure; + $structure['molecule_id'] = $molecule->id; + $structure['2d'] = json_encode($sdf_2d); + $structure->save(); + } + }); + } +} From a4109d8b13b39817fa552f14fd826dd5a868885b Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 12 Nov 2024 23:19:55 +0100 Subject: [PATCH 097/137] feat: audits on the structures table are added to the timeline --- app/Livewire/MoleculeHistoryTimeline.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Livewire/MoleculeHistoryTimeline.php b/app/Livewire/MoleculeHistoryTimeline.php index f12a0364..5898da06 100644 --- a/app/Livewire/MoleculeHistoryTimeline.php +++ b/app/Livewire/MoleculeHistoryTimeline.php @@ -14,6 +14,9 @@ public function getHistory() { $audit_data = []; $audits_collection = $this->mol->audits->merge($this->mol->properties()->get()[0]->audits); + if ($this->mol->structures()->get()->count() > 0) { + $audits_collection = $audits_collection->merge($this->mol->structures()->get()[0]->audits); + } foreach ($audits_collection->sortByDesc('created_at') as $index => $audit) { $audit_data[$index]['user_name'] = $audit->getMetadata()['user_name']; $audit_data[$index]['event'] = $audit->getMetadata()['audit_event']; From 8ac4729de46e015dccfde178287a5f47bc440a85 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 13 Nov 2024 10:51:26 +0100 Subject: [PATCH 098/137] fix: 2d download is now fetched from the db --- app/Livewire/MoleculeDepict2d.php | 13 ++++++++----- .../views/livewire/molecule-depict2d.blade.php | 4 ++-- resources/views/livewire/molecule-details.blade.php | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/Livewire/MoleculeDepict2d.php b/app/Livewire/MoleculeDepict2d.php index f1e82aa1..fe14a2f1 100644 --- a/app/Livewire/MoleculeDepict2d.php +++ b/app/Livewire/MoleculeDepict2d.php @@ -2,12 +2,13 @@ namespace App\Livewire; -use Illuminate\Support\Facades\Http; use Livewire\Attributes\Computed; use Livewire\Component; class MoleculeDepict2d extends Component { + public $molecule = null; + public $smiles = null; public $name = null; @@ -38,11 +39,13 @@ public function preview() public function downloadMolFile($toolkit) { - $response = Http::get(env('CM_API').'convert/mol2D?smiles='.urlencode($this->smiles).'&toolkit='.$toolkit); + $structureData = json_decode($this->molecule->structures->getAttributes()['2d'], true); - return response()->streamDownload(function () use ($response) { - echo $response->body(); - }, $this->identifier.'.mol'); + return response()->streamDownload(function () use ($structureData) { + echo $structureData; + }, $this->identifier.'.sdf', [ + 'Content-Type' => 'chemical/x-mdl-sdfile', + ]); } public function render() diff --git a/resources/views/livewire/molecule-depict2d.blade.php b/resources/views/livewire/molecule-depict2d.blade.php index 7e3e808e..e8adcfbb 100644 --- a/resources/views/livewire/molecule-depict2d.blade.php +++ b/resources/views/livewire/molecule-depict2d.blade.php @@ -8,7 +8,7 @@ class="relative flex cursor-pointer rounded-lg bg-white p-3 focus:outline-none c CDK - + - + diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index 1528c853..a5d7647f 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -934,7 +934,7 @@ class="ml-3 text-base text-gray-500">Lipinski
-
From 42c027450dbe2c2ad127e530f52787e18e0ddeec Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 13 Nov 2024 13:24:53 +0100 Subject: [PATCH 099/137] feat: download button for 3d molecules is now available --- app/Livewire/MoleculeDepict3d.php | 11 +++++++++++ resources/views/livewire/molecule-depict3d.blade.php | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Livewire/MoleculeDepict3d.php b/app/Livewire/MoleculeDepict3d.php index 2d196328..a1e6780c 100644 --- a/app/Livewire/MoleculeDepict3d.php +++ b/app/Livewire/MoleculeDepict3d.php @@ -21,6 +21,17 @@ public function source() return env('CM_API').'depict/3D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width.'&CIP='.$this->CIP.'&toolkit=rdkit'; } + public function downloadMolFile($toolkit) + { + $structureData = json_decode($this->molecule->structures->getAttributes()['3d'], true); + + return response()->streamDownload(function () use ($structureData) { + echo $structureData; + }, $this->identifier.'.sdf', [ + 'Content-Type' => 'chemical/x-mdl-sdfile', + ]); + } + public function render() { return view('livewire.molecule-depict3d'); diff --git a/resources/views/livewire/molecule-depict3d.blade.php b/resources/views/livewire/molecule-depict3d.blade.php index c1e1c9ab..6c54d9f3 100644 --- a/resources/views/livewire/molecule-depict3d.blade.php +++ b/resources/views/livewire/molecule-depict3d.blade.php @@ -2,10 +2,17 @@
- 3D Structure + 3D Structure (by RDKit) Interactive JSMol molecular viewer + + + + + + +

© 2024 COCONUT. All rights reserved.

-
From bf48f25b69d1c19169abbb1a5e25628b8494ea5a Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Wed, 13 Nov 2024 15:41:10 +0100 Subject: [PATCH 101/137] fix: conditional hidden issue fix --- app/Filament/Dashboard/Resources/ReportResource.php | 4 ++-- .../Dashboard/Resources/ReportResource/Pages/CreateReport.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 7a065ade..be36d481 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -72,8 +72,8 @@ public static function form(Form $form): Form true => 'Request Changes to Data', ]) ->inline() - ->hidden(function (string $operation, $record) { - return $operation == 'create' ? request()->has('type') : true; + ->hidden(function (string $operation, $get) { + return $get('type') == 'change' ? true : false; }) ->columnSpan(2), Actions::make([ diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index d42df368..9881cd99 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -39,7 +39,9 @@ protected function afterFill(): void { $request = request(); $this->data['compound_id'] = $request->compound_id; + if ($request->type == 'change') { + $this->data['type'] = $request->type; $this->data['is_change'] = true; $this->data['existing_geo_locations'] = $this->molecule->geo_locations->pluck('name')->toArray(); $this->data['existing_synonyms'] = $this->molecule->synonyms; From 38268006586851e984ebe4d6f142296b9a786fb0 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 13 Nov 2024 23:46:32 +0100 Subject: [PATCH 102/137] fix: access restrictions and improved user-friendliness --- .../Dashboard/Resources/ReportResource.php | 120 ++++++++---------- app/Models/Report.php | 4 +- 2 files changed, 57 insertions(+), 67 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index 414a6816..d9629fae 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -24,10 +24,10 @@ use Filament\Resources\Resource; use Filament\Support\Enums\VerticalAlignment; use Filament\Tables; +use Filament\Tables\Actions\Action as TableAction; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; -use Illuminate\Support\HtmlString; use Illuminate\Support\Str; use Tapp\FilamentAuditing\RelationManagers\AuditsRelationManager; @@ -59,25 +59,9 @@ public static function form(Form $form): Form ->columnSpan(2), Actions::make([ - Action::make('assign') - ->hidden(function (Get $get, string $operation, ?Report $record) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != null; - }) - ->form([ - Radio::make('curator') - ->label('Choose a curator') - ->options(function () { - return $users = User::whereHas('roles')->pluck('name', 'id'); - }), - ]) - ->action(function (array $data, Report $record): void { - $record['assigned_to'] = $data['curator']; - $record->save(); - $record->refresh(); - }), Action::make('approve') ->hidden(function (Get $get, string $operation, ?Report $record) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != auth()->id(); + return ! (auth()->user()->roles()->exists() && ($operation == 'view' || $operation == 'edit') && ($get('status') != 'approved' || $get('status') != 'rejected') && ($record['assigned_to'] == null || $record['assigned_to'] == auth()->id())); }) ->form([ Textarea::make('reason'), @@ -102,7 +86,7 @@ public static function form(Form $form): Form Action::make('reject') ->color('danger') ->hidden(function (Get $get, string $operation, ?Report $record) { - return ! auth()->user()->roles()->exists() || $get('status') == 'rejected' || $get('status') == 'approved' || $operation == 'create' || $record['assigned_to'] != auth()->id(); + return ! (auth()->user()->roles()->exists() && ($operation == 'view' || $operation == 'edit') && ($get('status') != 'approved' || $get('status') != 'rejected') && ($record['assigned_to'] == null || $record['assigned_to'] == auth()->id())); }) ->form([ Textarea::make('reason'), @@ -115,6 +99,33 @@ public static function form(Form $form): Form $set('status', 'rejected'); }), + Action::make('assign') + ->hidden(function (Get $get, string $operation, ?Report $record) { + return ! (auth()->user()->roles()->exists() && ($operation == 'view' || $operation == 'edit') && ($get('status') != 'approved' || $get('status') != 'rejected')); + }) + ->form([ + Radio::make('curator') + ->label('Choose a curator') + ->options(function () { + return $users = User::whereHas('roles')->pluck('name', 'id'); + }), + ]) + ->action(function (array $data, Report $record): void { + $record['assigned_to'] = $data['curator']; + $record->save(); + $record->refresh(); + }) + ->modalHeading('') + ->modalSubmitActionLabel('Assign') + ->iconButton() + ->icon('heroicon-m-user-group') + // ->badge(function (?Report $record) { + // return $record->curator->name ?? null; + // }) + ->extraAttributes([ + 'class' => 'ml-1 mr-0', + ]) + ->size('xl'), ]) ->verticalAlignment(VerticalAlignment::End) ->columnStart(4), @@ -280,12 +291,30 @@ public static function table(Table $table): Table TextColumn::make('title') ->wrap() ->description(fn (Report $record): string => Str::of($record->evidence)->words(10)), - Tables\Columns\TextColumn::make('name')->searchable() - ->formatStateUsing( - fn (Report $record): HtmlString => new HtmlString("DOI: {$record->doi}") - ) - ->description(fn (Report $record): string => $record->comment ?? '') - ->wrap(), + Tables\Columns\TextColumn::make('curator.name') + ->searchable() + ->placeholder('Choose a curator') + ->action( + TableAction::make('select') + ->label('') + ->form([ + Radio::make('curator') + ->label('Choose a curator') + ->default(function ($record) { + return $record->assigned_to; + }) + ->options(function () { + return $users = User::whereHas('roles')->pluck('name', 'id'); + }), + ]) + ->action(function (array $data, Report $record): void { + $record['assigned_to'] = $data['curator']; + $record->save(); + $record->refresh(); + }) + ->modalSubmitActionLabel('Assign') + ->modalHidden(fn (): bool => ! auth()->user()->roles()->exists()), + ), ]) ->defaultSort('created_at', 'desc') ->filters([ @@ -293,50 +322,11 @@ public static function table(Table $table): Table ->includeColumns(), ]) ->actions([ - Tables\Actions\ViewAction::make(), Tables\Actions\EditAction::make() ->visible(function ($record) { return auth()->user()->roles()->exists() && $record['status'] == 'submitted' && ($record['assigned_to'] == null || $record['assigned_to'] == auth()->id()); }), - Tables\Actions\Action::make('approve') - // ->button() - ->hidden(function (Report $record) { - return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; - }) - ->form([ - Textarea::make('reason'), - ]) - ->action(function (array $data, Report $record, Molecule $molecule): void { - - $record['status'] = 'approved'; - $record['reason'] = $data['reason']; - $record->save(); - - if ($record['mol_id_csv'] && ! $record['is_change']) { - $molecule_ids = explode(',', $record['mol_id_csv']); - $molecule = Molecule::whereIn('id', $molecule_ids)->get(); - foreach ($molecule as $mol) { - $mol->active = false; - $mol->save(); - } - } - }), - Tables\Actions\Action::make('reject') - // ->button() - ->color('danger') - ->hidden(function (Report $record) { - return ! auth()->user()->roles()->exists() || $record['status'] == 'draft' || $record['status'] == 'rejected' || $record['status'] == 'approved'; - }) - ->form([ - Textarea::make('reason'), - - ]) - ->action(function (array $data, Report $record): void { - - $record['status'] = 'rejected'; - $record['reason'] = $data['reason']; - $record->save(); - }), + Tables\Actions\ViewAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ diff --git a/app/Models/Report.php b/app/Models/Report.php index a0d808c6..3abaacac 100644 --- a/app/Models/Report.php +++ b/app/Models/Report.php @@ -78,9 +78,9 @@ public function users(): BelongsTo return $this->belongsTo(User::class); } - public function assignedTo(): BelongsTo + public function curator(): BelongsTo { - return $this->belongsTo(User::class); + return $this->belongsTo(User::class, 'assigned_to'); } public function transformAudit(array $data): array From efca0a4ea1827d0007a58e2b443e3ede74cadb64 Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 14 Nov 2024 11:14:38 +0100 Subject: [PATCH 103/137] wip: 3d depiction --- app/Livewire/MoleculeDepict3d.php | 57 +++++++++++++++++-- .../views/livewire/molecule-details.blade.php | 2 +- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/app/Livewire/MoleculeDepict3d.php b/app/Livewire/MoleculeDepict3d.php index a1e6780c..bfb67293 100644 --- a/app/Livewire/MoleculeDepict3d.php +++ b/app/Livewire/MoleculeDepict3d.php @@ -4,9 +4,12 @@ use Livewire\Attributes\Computed; use Livewire\Component; +use Illuminate\Support\Facades\Log; class MoleculeDepict3d extends Component { + public $molecule = null; + public $smiles = null; public $height = 200; @@ -17,9 +20,55 @@ class MoleculeDepict3d extends Component #[Computed] public function source() - { - return env('CM_API').'depict/3D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width.'&CIP='.$this->CIP.'&toolkit=rdkit'; - } +{ + $mol_sdf = $this->molecule->structures->getAttributes()['3d']; + dd([ + 'raw_data' => $mol_sdf, + 'type' => gettype($mol_sdf), + 'is_json' => json_decode($mol_sdf) !== null + ]); + + // Replace line breaks with \n + $mol = str_replace(["\r\n", "\r", "\n"], "\\n", $mol_sdf); + // Remove the SDF terminator + $mol = str_replace("$$$$", "", $mol); + // Escape quotes + $mol = str_replace('"', '\"', $mol); + + $mol_template = << + + 3D Molecule Viewer + + + + + +
+ + + +HTML; + + return $mol_template; +} public function downloadMolFile($toolkit) { @@ -27,7 +76,7 @@ public function downloadMolFile($toolkit) return response()->streamDownload(function () use ($structureData) { echo $structureData; - }, $this->identifier.'.sdf', [ + }, $this->identifier . '.sdf', [ 'Content-Type' => 'chemical/x-mdl-sdfile', ]); } diff --git a/resources/views/livewire/molecule-details.blade.php b/resources/views/livewire/molecule-details.blade.php index a5d7647f..021752e8 100644 --- a/resources/views/livewire/molecule-details.blade.php +++ b/resources/views/livewire/molecule-details.blade.php @@ -938,7 +938,7 @@ class="ml-3 text-base text-gray-500">Lipinski lazy="on-load">
- +
From efd46261bad36599c79e25c93c5d039940619db8 Mon Sep 17 00:00:00 2001 From: Sagar Date: Fri, 15 Nov 2024 09:55:47 +0100 Subject: [PATCH 104/137] feat: new command to fix duplicates and missing links for the molecules pointing to the source datasets online. --- .../DedupeFixCollectionSourceLinks.php | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 app/Console/Commands/DedupeFixCollectionSourceLinks.php diff --git a/app/Console/Commands/DedupeFixCollectionSourceLinks.php b/app/Console/Commands/DedupeFixCollectionSourceLinks.php new file mode 100644 index 00000000..6a139653 --- /dev/null +++ b/app/Console/Commands/DedupeFixCollectionSourceLinks.php @@ -0,0 +1,185 @@ + "https://bidd.group/NPASS/compound.php?compoundID=", + 42 => "http://langelabtools.wsu.edu/nmr/record/", + 43 => "http://132.230.102.198:8000/streptomedb/get_drugcard/", + 54 => "https://go.drugbank.com/drugs/", + 58 => "https://www.way2drug.com/phyto4health/compound_card.php?compound_id=" + ]; + + // Process all molecules in chunks to avoid memory exhaustion + DB::table('collection_molecule') + ->select('id', 'collection_id', 'molecule_id', 'url', 'reference') + ->orderBy('id') + ->chunk($batchSize, function ($collection_molecules) use (&$data, $db_links) { + $this->info('started batch '); + foreach ($collection_molecules as $collection_molecule) { + $url = null; + $reference = null; + + // Get the source URL and reference for the molecule + $entries = DB::select("SELECT link, reference_id FROM entries WHERE collection_id = {$collection_molecule->collection_id} and molecule_id = {$collection_molecule->molecule_id};"); + + foreach ($entries as $index => $entry) { + + if ($index == 0) { + switch ($collection_molecule->collection_id) { + case 30: + case 42: + case 43: + case 54: + case 58: + $url = $db_links[$collection_molecule->collection_id] . $entry->reference_id; + break; + default: + $url = $entry->link; + break; + } + $reference = $entry->reference_id; + } else { + switch ($collection_molecule->collection_id) { + case 30: + case 42: + case 43: + case 54: + case 58: + $url .= '|' . $db_links[$collection_molecule->collection_id] . $entry->reference_id; + break; + default: + $url .= '|' . $entry->link; + break; + } + $reference .= '|' . $entry->reference_id; + } + } + + // Prepare data for batch update + array_push($data, [ + 'collection_id' => $collection_molecule->collection_id, + 'molecule_id' => $collection_molecule->molecule_id, + 'url' => $url, + 'reference' => $reference, + ]); + } + + // Update the database with the calculated scores in batch + if (! empty($data)) { + $this->info('Updating rows up to molecule ID: ' . end($data)['collection_id']); + $this->updateBatch($data); + $data = []; // Reset the data array for the next batch + } + }); + + // Ensure any remaining data is updated after the last chunk + if (! empty($data)) { + $this->updateBatch($data); + } + + // Process parent molecules + $data = []; + DB::table('molecules') + ->select('id') + ->where('is_parent', true) + ->orderBy('id') + ->chunk($batchSize, function ($parent_molecules) use (&$data) { + $this->info('started parent batch '); + $ids_string = implode(',', $parent_molecules->pluck('id')->toArray()); + + $patents_pivot_rows = DB::select("SELECT collection_id, molecule_id, url, reference FROM collection_molecule WHERE molecule_id in ({$ids_string});"); + + foreach ($patents_pivot_rows as $parent_pivot_row) { + $url = null; + $reference = null; + $children_ids = collect(DB::select("SELECT id FROM molecules WHERE parent_id = {$parent_pivot_row->molecule_id};")); + $children_ids_string = implode(',', $children_ids->pluck('id')->toArray()); + $children_pivot_rows = DB::select("SELECT collection_id, molecule_id, url, reference FROM collection_molecule WHERE collection_id = {$parent_pivot_row->collection_id} and molecule_id in ({$children_ids_string});"); + + foreach ($children_pivot_rows as $children_pivot_row) { + if (!$parent_pivot_row->url) { + $url = $children_pivot_row->url; + $reference = $children_pivot_row->reference; + } else { + $url .= '|' . $children_pivot_row->url; + $reference .= '|' . $children_pivot_row->reference; + } + + // push each parent data for update + array_push($data, [ + 'collection_id' => $parent_pivot_row->collection_id, + 'molecule_id' => $parent_pivot_row->molecule_id, + 'url' => $url, + 'reference' => $reference, + ]); + } + } + + // Update the database with the calculated scores in batch + if (! empty($data)) { + $this->info('Updating rows up to molecule ID: ' . end($data)['collection_id']); + $this->updateBatch($data); + $data = []; // Reset the data array for the next batch + } + }); + + + // Ensure any remaining data is updated after the last chunk + if (! empty($data)) { + $this->updateBatch($data); + } + + $this->info('Updated successfully.'); + } + + + private function updateBatch(array $data) + { + DB::transaction(function () use ($data) { + foreach ($data as $row) { + $molecule = Molecule::find($row['molecule_id']); + $currentPivotData = $molecule->collections()->wherePivot('collection_id', $row['collection_id'])->first()->pivot->toArray(); + $molecule->collections()->updateExistingPivot($row['collection_id'], ['url' => $row['url'], 'reference' => $row['reference']]); + $molecule->auditEvent = 'moleculeCollectionUpdate'; + $molecule->isCustomEvent = true; + $molecule->auditCustomOld = [ + 'url' => $currentPivotData['url'], + 'reference' => $currentPivotData['reference'] + ]; + $molecule->auditCustomNew = [ + 'url' => $row['url'], + 'reference' => $row['reference'] + ]; + Event::dispatch(AuditCustom::class, [$molecule]); + } + }); + } +} From 8d224dd8f4e405194c30a160ba30ca296ac57cad Mon Sep 17 00:00:00 2001 From: Sagar Date: Fri, 15 Nov 2024 14:58:42 +0100 Subject: [PATCH 105/137] fix: hidden field issues are fixed --- .../Dashboard/Resources/ReportResource.php | 40 ++++++++++++++----- .../ReportResource/Pages/CreateReport.php | 27 ++++++++++++- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource.php b/app/Filament/Dashboard/Resources/ReportResource.php index be36d481..76f94812 100644 --- a/app/Filament/Dashboard/Resources/ReportResource.php +++ b/app/Filament/Dashboard/Resources/ReportResource.php @@ -73,7 +73,7 @@ public static function form(Form $form): Form ]) ->inline() ->hidden(function (string $operation, $get) { - return $get('type') == 'change' ? true : false; + return $operation == 'create' ? $get('type') != null : true; }) ->columnSpan(2), Actions::make([ @@ -82,11 +82,23 @@ public static function form(Form $form): Form if ($record['is_change']) { self::$approved_changes = self::prepareApprovedChanges($record, $livewire); $key_value_fields = getChangesToDisplayModal(self::$approved_changes); - array_unshift($key_value_fields, Textarea::make('reason')); + array_unshift($key_value_fields, + Textarea::make('reason') + ->helperText(function ($get) { + if (count(self::$approved_changes) <= 1) { + return new HtmlString(' You must select at least one change to approve '); + } else { + return null; + } + }) + ->disabled(count(self::$approved_changes) <= 1) + ); return $key_value_fields; } else { - return [Textarea::make('reason')]; + return [ + Textarea::make('reason'), + ]; } }) ->hidden(function (Get $get, string $operation) { @@ -95,6 +107,11 @@ public static function form(Form $form): Form ->action(function (array $data, Report $record, Molecule $molecule, $set, $livewire): void { self::approveReport($data, $record, $molecule, $livewire); $set('status', 'approved'); + }) + ->modalSubmitAction(function () { + if (count(self::$approved_changes) <= 1) { + return false; + } }), Action::make('reject') ->color('danger') @@ -113,7 +130,7 @@ public static function form(Form $form): Form ->url(fn (string $operation, $record): string => $operation === 'create' ? env('APP_URL').'/compounds/'.request()->compound_id : env('APP_URL').'/compounds/'.$record->mol_id_csv) ->openUrlInNewTab() ->hidden(function (Get $get, string $operation) { - return ! request()->has('type'); + return ! $get('type'); }), ]) ->hidden(function (Get $get) { @@ -131,13 +148,13 @@ public static function form(Form $form): Form ->options(function () { return getReportTypes(); }) - ->hidden(function (string $operation) { - return $operation != 'create' || request()->has('type'); + ->hidden(function (string $operation, $get) { + return $operation != 'create' || $get('type'); }), TextInput::make('title') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Title of the report. This is required.') - ->default(function () { - if (request()->type == 'change' && request()->has('compound_id')) { + ->default(function ($get) { + if ($get('type') == 'change' && request()->has('compound_id')) { return 'Request changes to '.request()->compound_id; } }) @@ -393,8 +410,9 @@ public static function form(Form $form): Form shouldOpenInNewTab: true, ), ) - ->hidden(function (string $operation, $record) { - return $operation == 'create' && request()->has('type') && request()->type == 'change' ? true : false; + ->hidden(function (string $operation, $get, ?Report $record) { + return true; + // return $operation == 'create' && $get('type') && $get('type') == 'change' ? true : false; }), Select::make('collections') ->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Select the Collections you want to report. This will help our Curators in reviewing your report.') @@ -483,7 +501,7 @@ public static function form(Form $form): Form }) ->live() ->hidden(function (Get $get, string $operation) { - if ($operation != 'create' || request()->has('type')) { + if ($operation != 'create' || $get('type')) { return true; } if (! request()->has('compound_id') && $get('report_type') != 'molecule') { diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php index 9881cd99..91d33a89 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/CreateReport.php @@ -17,6 +17,14 @@ class CreateReport extends CreateRecord protected $molecule; + protected $is_change = false; + + protected $mol_id_csv = null; + + protected $report_type = null; + + protected $evidence = null; + public function getTitle(): string { $title = 'Create Report'; @@ -30,6 +38,8 @@ public function getTitle(): string protected function beforeFill(): void { + $this->data['type'] = request()->type; + if (request()->has('compound_id')) { $this->molecule = Molecule::where('identifier', request()->compound_id)->first(); } @@ -39,10 +49,12 @@ protected function afterFill(): void { $request = request(); $this->data['compound_id'] = $request->compound_id; + $this->data['type'] = $request->type; if ($request->type == 'change') { - $this->data['type'] = $request->type; $this->data['is_change'] = true; + $this->is_change = true; + $this->data['existing_geo_locations'] = $this->molecule->geo_locations->pluck('name')->toArray(); $this->data['existing_synonyms'] = $this->molecule->synonyms; $this->data['existing_cas'] = array_values($this->molecule->cas ?? []); @@ -73,6 +85,14 @@ protected function afterFill(): void } } + protected function afterValidate(): void + { + $this->mol_id_csv = $this->data['mol_id_csv']; + $this->is_change = $this->data['is_change']; + $this->report_type = $this->data['report_type']; + $this->evidence = $this->data['evidence']; + } + protected function beforeCreate(): void { if ($this->data['report_type'] == 'collection') { @@ -98,6 +118,11 @@ protected function mutateFormDataBeforeCreate(array $data): array { $data['user_id'] = auth()->id(); $data['status'] = 'submitted'; + $data['mol_id_csv'] = $this->mol_id_csv; + $data['is_change'] = $this->is_change; + $data['report_type'] = $this->report_type; + $data['evidence'] = $this->evidence; + if ($data['is_change']) { $suggested_changes = []; $suggested_changes['existing_geo_locations'] = $data['existing_geo_locations']; From be708bcf674e1df41097041e023807bbd53f1b93 Mon Sep 17 00:00:00 2001 From: Sagar Date: Mon, 18 Nov 2024 15:27:37 +0100 Subject: [PATCH 106/137] feat: new command to import a set of jsons in a folder --- app/Console/Commands/Import3DSDFs.php | 89 +++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 app/Console/Commands/Import3DSDFs.php diff --git a/app/Console/Commands/Import3DSDFs.php b/app/Console/Commands/Import3DSDFs.php new file mode 100644 index 00000000..1f07a557 --- /dev/null +++ b/app/Console/Commands/Import3DSDFs.php @@ -0,0 +1,89 @@ +argument('file')); + $file_suffix = (int) $file[strpos($file, '.json') - 1]; + $file_name_without_id = substr($file, 0, strpos($file, '.json') - 1); + + // loop runs though all the files + for (; $file_suffix <= 18; $file_suffix++) { + $file_name = $file_name_without_id.$file_suffix.'.json'; + $this->info('Starting loop for file '.$file_name); + if (! file_exists($file_name) || ! is_readable($file_name)) { + $this->error('File not found or not readable: '.$file_name); + + return 1; + } + + $batchSize = 1000; + $header = null; + $data = []; + $rowCount = 0; + + $json = file_get_contents($file); + if ($json === false) { + exit('Error reading the JSON file'); + } + $this->info('File read'); + + $json_data = json_decode($json, true); + $this->info('Total elements successfully read: '.count($json_data)); + + $batchSize = 10000; // Number of molecules to process in each batch + $data = []; // Array to store data for batch updating + + $totalElements = count($json_data); + $this->info('Total elements: '.$totalElements); + for ($i = 0; $i < $totalElements; $i += $batchSize) { + $this->info('Processing batch '.($i / $batchSize + 1).' of '.ceil($totalElements / $batchSize)); + $batch = array_slice($json_data, $i, $totalElements - $i < $batchSize ? $totalElements - $i : $batchSize); + $this->insertBatch($batch); + } + + } + + $this->info('Annotation scores generated successfully.'); + } + + /** + * Update a batch of data into the database. + * + * @return void + */ + private function insertBatch(array $data) + { + DB::transaction(function () use ($data) { + foreach ($data as $identifier => $sdf_3d) { + $structure = Molecule::where('identifier', $identifier)->first()->structures; + $structure['3d'] = json_encode($sdf_3d); + $structure->save(); + } + }); + } +} From 5893c54981b4379f9769b66d5bf8f637b07896e9 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 19 Nov 2024 14:57:38 +0100 Subject: [PATCH 107/137] fix: fixed the file name issue --- app/Console/Commands/Import3DSDFs.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/app/Console/Commands/Import3DSDFs.php b/app/Console/Commands/Import3DSDFs.php index 1f07a557..6dc5c2ab 100644 --- a/app/Console/Commands/Import3DSDFs.php +++ b/app/Console/Commands/Import3DSDFs.php @@ -20,19 +20,25 @@ class Import3DSDFs extends Command * * @var string */ - protected $description = 'Imports 3D SDFs from a JSON file into Structures table'; + protected $description = 'Imports 3D SDFs from multiple JSON file into Structures table'; /** * Execute the console command. */ public function handle() { + $batchSize = 10000; // Number of molecules to process in each batch + $file = storage_path($this->argument('file')); $file_suffix = (int) $file[strpos($file, '.json') - 1]; $file_name_without_id = substr($file, 0, strpos($file, '.json') - 1); // loop runs though all the files for (; $file_suffix <= 18; $file_suffix++) { + + $json = null; + $json_data = []; + $file_name = $file_name_without_id.$file_suffix.'.json'; $this->info('Starting loop for file '.$file_name); if (! file_exists($file_name) || ! is_readable($file_name)) { @@ -41,33 +47,25 @@ public function handle() return 1; } - $batchSize = 1000; - $header = null; - $data = []; - $rowCount = 0; - - $json = file_get_contents($file); + $json = file_get_contents($file_name); if ($json === false) { exit('Error reading the JSON file'); } $this->info('File read'); $json_data = json_decode($json, true); - $this->info('Total elements successfully read: '.count($json_data)); - - $batchSize = 10000; // Number of molecules to process in each batch - $data = []; // Array to store data for batch updating + $keys = array_keys($json_data); + $this->info(end($keys)); $totalElements = count($json_data); $this->info('Total elements: '.$totalElements); + for ($i = 0; $i < $totalElements; $i += $batchSize) { $this->info('Processing batch '.($i / $batchSize + 1).' of '.ceil($totalElements / $batchSize)); $batch = array_slice($json_data, $i, $totalElements - $i < $batchSize ? $totalElements - $i : $batchSize); $this->insertBatch($batch); } - } - $this->info('Annotation scores generated successfully.'); } From a061a35784557012d108ed596f48d81697da87da Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 19 Nov 2024 14:58:10 +0100 Subject: [PATCH 108/137] fix: reverted to pinging the api for now --- app/Livewire/MoleculeDepict3d.php | 57 +++---------------------------- 1 file changed, 5 insertions(+), 52 deletions(-) diff --git a/app/Livewire/MoleculeDepict3d.php b/app/Livewire/MoleculeDepict3d.php index bfb67293..c5d57095 100644 --- a/app/Livewire/MoleculeDepict3d.php +++ b/app/Livewire/MoleculeDepict3d.php @@ -4,7 +4,6 @@ use Livewire\Attributes\Computed; use Livewire\Component; -use Illuminate\Support\Facades\Log; class MoleculeDepict3d extends Component { @@ -20,63 +19,17 @@ class MoleculeDepict3d extends Component #[Computed] public function source() -{ - $mol_sdf = $this->molecule->structures->getAttributes()['3d']; - dd([ - 'raw_data' => $mol_sdf, - 'type' => gettype($mol_sdf), - 'is_json' => json_decode($mol_sdf) !== null - ]); - - // Replace line breaks with \n - $mol = str_replace(["\r\n", "\r", "\n"], "\\n", $mol_sdf); - // Remove the SDF terminator - $mol = str_replace("$$$$", "", $mol); - // Escape quotes - $mol = str_replace('"', '\"', $mol); - - $mol_template = << - - 3D Molecule Viewer - - - - - -
- - - -HTML; - - return $mol_template; -} + { + return env('CM_API').'depict/3D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width.'&CIP='.$this->CIP.'&toolkit=rdkit'; + } - public function downloadMolFile($toolkit) + public function downloadSDFFile() { $structureData = json_decode($this->molecule->structures->getAttributes()['3d'], true); return response()->streamDownload(function () use ($structureData) { echo $structureData; - }, $this->identifier . '.sdf', [ + }, $this->molecule->identifier.'.sdf', [ 'Content-Type' => 'chemical/x-mdl-sdfile', ]); } From c373d45c41c34a19bda0c81551a459bc917957e3 Mon Sep 17 00:00:00 2001 From: Sagar Date: Tue, 19 Nov 2024 14:58:53 +0100 Subject: [PATCH 109/137] fix: removed the toolkit as we are only using RDKit --- resources/views/livewire/molecule-depict3d.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/livewire/molecule-depict3d.blade.php b/resources/views/livewire/molecule-depict3d.blade.php index 6c54d9f3..d7b6a80a 100644 --- a/resources/views/livewire/molecule-depict3d.blade.php +++ b/resources/views/livewire/molecule-depict3d.blade.php @@ -7,7 +7,7 @@ - + From 905f092c45c2b33e8de65947bb204fc601bb5357 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 20 Nov 2024 13:52:20 +0100 Subject: [PATCH 110/137] fix: the missing molecules are excluded --- .../DedupeFixCollectionSourceLinks.php | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/app/Console/Commands/DedupeFixCollectionSourceLinks.php b/app/Console/Commands/DedupeFixCollectionSourceLinks.php index 6a139653..92c84fe2 100644 --- a/app/Console/Commands/DedupeFixCollectionSourceLinks.php +++ b/app/Console/Commands/DedupeFixCollectionSourceLinks.php @@ -36,12 +36,13 @@ public function handle() 54 => "https://go.drugbank.com/drugs/", 58 => "https://www.way2drug.com/phyto4health/compound_card.php?compound_id=" ]; + $batchCount = 1; // Process all molecules in chunks to avoid memory exhaustion DB::table('collection_molecule') ->select('id', 'collection_id', 'molecule_id', 'url', 'reference') ->orderBy('id') - ->chunk($batchSize, function ($collection_molecules) use (&$data, $db_links) { + ->chunk($batchSize, function ($collection_molecules) use (&$data, $db_links, &$batchCount) { $this->info('started batch '); foreach ($collection_molecules as $collection_molecule) { $url = null; @@ -94,8 +95,9 @@ public function handle() // Update the database with the calculated scores in batch if (! empty($data)) { - $this->info('Updating rows up to molecule ID: ' . end($data)['collection_id']); + $this->info('Updating batch '. $batchCount); $this->updateBatch($data); + $batchCount = $batchCount + 1; $data = []; // Reset the data array for the next batch } }); @@ -107,11 +109,12 @@ public function handle() // Process parent molecules $data = []; + $batchCount = 1; DB::table('molecules') ->select('id') ->where('is_parent', true) ->orderBy('id') - ->chunk($batchSize, function ($parent_molecules) use (&$data) { + ->chunk($batchSize, function ($parent_molecules) use (&$data, &$batchCount) { $this->info('started parent batch '); $ids_string = implode(',', $parent_molecules->pluck('id')->toArray()); @@ -145,8 +148,9 @@ public function handle() // Update the database with the calculated scores in batch if (! empty($data)) { - $this->info('Updating rows up to molecule ID: ' . end($data)['collection_id']); + $this->info('Updating parent batch '. $batchCount); $this->updateBatch($data); + $batchCount = $batchCount + 1; $data = []; // Reset the data array for the next batch } }); @@ -165,20 +169,22 @@ private function updateBatch(array $data) { DB::transaction(function () use ($data) { foreach ($data as $row) { - $molecule = Molecule::find($row['molecule_id']); - $currentPivotData = $molecule->collections()->wherePivot('collection_id', $row['collection_id'])->first()->pivot->toArray(); - $molecule->collections()->updateExistingPivot($row['collection_id'], ['url' => $row['url'], 'reference' => $row['reference']]); - $molecule->auditEvent = 'moleculeCollectionUpdate'; - $molecule->isCustomEvent = true; - $molecule->auditCustomOld = [ - 'url' => $currentPivotData['url'], - 'reference' => $currentPivotData['reference'] - ]; - $molecule->auditCustomNew = [ - 'url' => $row['url'], - 'reference' => $row['reference'] - ]; - Event::dispatch(AuditCustom::class, [$molecule]); + if($row['molecule_id']!=293023 || $row['molecule_id']!=427142 || $row['molecule_id']!=395531 || $row['molecule_id']!=292092 || $row['molecule_id']!=186065 || $row['molecule_id']!=23452 || $row['molecule_id']!=33176) { + $molecule = Molecule::find($row['molecule_id']); + $currentPivotData = $molecule->collections()->wherePivot('collection_id', $row['collection_id'])->first()->pivot->toArray(); + $molecule->collections()->updateExistingPivot($row['collection_id'], ['url' => $row['url'], 'reference' => $row['reference']]); + $molecule->auditEvent = 'moleculeCollectionUpdate'; + $molecule->isCustomEvent = true; + $molecule->auditCustomOld = [ + 'url' => $currentPivotData['url'], + 'reference' => $currentPivotData['reference'] + ]; + $molecule->auditCustomNew = [ + 'url' => $row['url'], + 'reference' => $row['reference'] + ]; + Event::dispatch(AuditCustom::class, [$molecule]); + } } }); } From 885c2dbbdf90a3657276e059f73a715f007e0e58 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 20 Nov 2024 16:21:44 +0100 Subject: [PATCH 111/137] fix: replaced the or with and condition --- .../DedupeFixCollectionSourceLinks.php | 176 +++++++++--------- 1 file changed, 92 insertions(+), 84 deletions(-) diff --git a/app/Console/Commands/DedupeFixCollectionSourceLinks.php b/app/Console/Commands/DedupeFixCollectionSourceLinks.php index 92c84fe2..f6523b99 100644 --- a/app/Console/Commands/DedupeFixCollectionSourceLinks.php +++ b/app/Console/Commands/DedupeFixCollectionSourceLinks.php @@ -5,8 +5,8 @@ use App\Models\Molecule; use DB; use Illuminate\Console\Command; -use \OwenIt\Auditing\Events\AuditCustom; use Illuminate\Support\Facades\Event; +use OwenIt\Auditing\Events\AuditCustom; class DedupeFixCollectionSourceLinks extends Command { @@ -24,17 +24,16 @@ class DedupeFixCollectionSourceLinks extends Command */ protected $description = 'Dedupes and fixes source links for specific collections mentioned in the command'; - public function handle() { $batchSize = 1000; // Number of molecules to process in each batch $data = []; // Array to store data for batch updating $db_links = [ - 30 => "https://bidd.group/NPASS/compound.php?compoundID=", - 42 => "http://langelabtools.wsu.edu/nmr/record/", - 43 => "http://132.230.102.198:8000/streptomedb/get_drugcard/", - 54 => "https://go.drugbank.com/drugs/", - 58 => "https://www.way2drug.com/phyto4health/compound_card.php?compound_id=" + 30 => 'https://bidd.group/NPASS/compound.php?compoundID=', + 42 => 'http://langelabtools.wsu.edu/nmr/record/', + 43 => 'http://132.230.102.198:8000/streptomedb/get_drugcard/', + 54 => 'https://go.drugbank.com/drugs/', + 58 => 'https://www.way2drug.com/phyto4health/compound_card.php?compound_id=', ]; $batchCount = 1; @@ -44,62 +43,64 @@ public function handle() ->orderBy('id') ->chunk($batchSize, function ($collection_molecules) use (&$data, $db_links, &$batchCount) { $this->info('started batch '); - foreach ($collection_molecules as $collection_molecule) { - $url = null; - $reference = null; - - // Get the source URL and reference for the molecule - $entries = DB::select("SELECT link, reference_id FROM entries WHERE collection_id = {$collection_molecule->collection_id} and molecule_id = {$collection_molecule->molecule_id};"); - - foreach ($entries as $index => $entry) { - - if ($index == 0) { - switch ($collection_molecule->collection_id) { - case 30: - case 42: - case 43: - case 54: - case 58: - $url = $db_links[$collection_molecule->collection_id] . $entry->reference_id; - break; - default: - $url = $entry->link; - break; + if ($batchCount >= 29) { + foreach ($collection_molecules as $collection_molecule) { + $url = null; + $reference = null; + + // Get the source URL and reference for the molecule + $entries = DB::select("SELECT link, reference_id FROM entries WHERE collection_id = {$collection_molecule->collection_id} and molecule_id = {$collection_molecule->molecule_id};"); + + foreach ($entries as $index => $entry) { + + if ($index == 0) { + switch ($collection_molecule->collection_id) { + case 30: + case 42: + case 43: + case 54: + case 58: + $url = $db_links[$collection_molecule->collection_id].$entry->reference_id; + break; + default: + $url = $entry->link; + break; + } + $reference = $entry->reference_id; + } else { + switch ($collection_molecule->collection_id) { + case 30: + case 42: + case 43: + case 54: + case 58: + $url .= '|'.$db_links[$collection_molecule->collection_id].$entry->reference_id; + break; + default: + $url .= '|'.$entry->link; + break; + } + $reference .= '|'.$entry->reference_id; } - $reference = $entry->reference_id; - } else { - switch ($collection_molecule->collection_id) { - case 30: - case 42: - case 43: - case 54: - case 58: - $url .= '|' . $db_links[$collection_molecule->collection_id] . $entry->reference_id; - break; - default: - $url .= '|' . $entry->link; - break; - } - $reference .= '|' . $entry->reference_id; } - } - // Prepare data for batch update - array_push($data, [ - 'collection_id' => $collection_molecule->collection_id, - 'molecule_id' => $collection_molecule->molecule_id, - 'url' => $url, - 'reference' => $reference, - ]); - } + // Prepare data for batch update + array_push($data, [ + 'collection_id' => $collection_molecule->collection_id, + 'molecule_id' => $collection_molecule->molecule_id, + 'url' => $url, + 'reference' => $reference, + ]); + } - // Update the database with the calculated scores in batch - if (! empty($data)) { - $this->info('Updating batch '. $batchCount); - $this->updateBatch($data); - $batchCount = $batchCount + 1; - $data = []; // Reset the data array for the next batch + // Update the database with the calculated scores in batch + if (! empty($data)) { + $this->info('Updating batch '.$batchCount); + $this->updateBatch($data); + $data = []; // Reset the data array for the next batch + } } + $batchCount = $batchCount + 1; }); // Ensure any remaining data is updated after the last chunk @@ -128,12 +129,12 @@ public function handle() $children_pivot_rows = DB::select("SELECT collection_id, molecule_id, url, reference FROM collection_molecule WHERE collection_id = {$parent_pivot_row->collection_id} and molecule_id in ({$children_ids_string});"); foreach ($children_pivot_rows as $children_pivot_row) { - if (!$parent_pivot_row->url) { + if (! $parent_pivot_row->url) { $url = $children_pivot_row->url; $reference = $children_pivot_row->reference; } else { - $url .= '|' . $children_pivot_row->url; - $reference .= '|' . $children_pivot_row->reference; + $url .= '|'.$children_pivot_row->url; + $reference .= '|'.$children_pivot_row->reference; } // push each parent data for update @@ -148,13 +149,13 @@ public function handle() // Update the database with the calculated scores in batch if (! empty($data)) { - $this->info('Updating parent batch '. $batchCount); + $this->info('Updating parent batch '.$batchCount); $this->updateBatch($data); - $batchCount = $batchCount + 1; $data = []; // Reset the data array for the next batch } - }); + $batchCount = $batchCount + 1; + }); // Ensure any remaining data is updated after the last chunk if (! empty($data)) { @@ -164,28 +165,35 @@ public function handle() $this->info('Updated successfully.'); } - private function updateBatch(array $data) { - DB::transaction(function () use ($data) { - foreach ($data as $row) { - if($row['molecule_id']!=293023 || $row['molecule_id']!=427142 || $row['molecule_id']!=395531 || $row['molecule_id']!=292092 || $row['molecule_id']!=186065 || $row['molecule_id']!=23452 || $row['molecule_id']!=33176) { - $molecule = Molecule::find($row['molecule_id']); - $currentPivotData = $molecule->collections()->wherePivot('collection_id', $row['collection_id'])->first()->pivot->toArray(); - $molecule->collections()->updateExistingPivot($row['collection_id'], ['url' => $row['url'], 'reference' => $row['reference']]); - $molecule->auditEvent = 'moleculeCollectionUpdate'; - $molecule->isCustomEvent = true; - $molecule->auditCustomOld = [ - 'url' => $currentPivotData['url'], - 'reference' => $currentPivotData['reference'] - ]; - $molecule->auditCustomNew = [ - 'url' => $row['url'], - 'reference' => $row['reference'] - ]; - Event::dispatch(AuditCustom::class, [$molecule]); + try { + DB::transaction(function () use ($data) { + foreach ($data as $row) { + if ($row['molecule_id'] != 293023 && $row['molecule_id'] != 427142 && $row['molecule_id'] != 395531 && $row['molecule_id'] != 292092 && $row['molecule_id'] != 186065 && $row['molecule_id'] != 23452 && $row['molecule_id'] != 33176) { + $molecule = Molecule::find($row['molecule_id']); + if (! $molecule) { + dd($row); + } + $currentPivotData = $molecule->collections()->wherePivot('collection_id', $row['collection_id'])->first()->pivot->toArray(); + $molecule->collections()->updateExistingPivot($row['collection_id'], ['url' => $row['url'], 'reference' => $row['reference']]); + $molecule->auditEvent = 'moleculeCollectionUpdate'; + $molecule->isCustomEvent = true; + $molecule->auditCustomOld = [ + 'url' => $currentPivotData['url'], + 'reference' => $currentPivotData['reference'], + ]; + $molecule->auditCustomNew = [ + 'url' => $row['url'], + 'reference' => $row['reference'], + ]; + Event::dispatch(AuditCustom::class, [$molecule]); + } } - } - }); + }); + } catch (\Exception $e) { + exec('afplay /System/Library/Sounds/Ping.aiff'); + dd($e); + } } } From 21838e93ebaace0d16925437ac77a12f3aa480e2 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 20 Nov 2024 16:52:47 +0100 Subject: [PATCH 112/137] feat: users with any role can now see an additional filter tab assigned. The rest of the queries are scoped as per the access privileges. --- .../ReportResource/Pages/ListReports.php | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php index dc0f0dff..1e1fb3b9 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php @@ -24,23 +24,50 @@ protected function getHeaderActions(): array public function getPresetViews(): array { - return [ + $presetViews = [ 'submitted' => PresetView::make() ->modifyQueryUsing(fn ($query) => $query->where('status', 'submitted')) ->favorite() - ->badge(Report::query()->where('status', 'submitted')->count()) + ->badge(function () { + if (auth()->user()->roles()->exists()) { + return Report::query()->where('status', 'submitted')->count(); + } + + return Report::query()->where('user_id', auth()->id())->where('status', 'submitted')->count(); + }) ->preserveAll() ->default(), 'approved' => PresetView::make() ->modifyQueryUsing(fn ($query) => $query->where('status', 'approved')) ->favorite() - ->badge(Report::query()->where('status', 'approved')->count()) + ->badge(function () { + if (auth()->user()->roles()->exists()) { + return Report::query()->where('status', 'approved')->count(); + } + + return Report::query()->where('user_id', auth()->id())->where('status', 'approved')->count(); + }) ->preserveAll(), 'rejected' => PresetView::make() ->modifyQueryUsing(fn ($query) => $query->where('status', 'rejected')) ->favorite() - ->badge(Report::query()->where('status', 'rejected')->count()) + ->badge(function () { + if (auth()->user()->roles()->exists()) { + return Report::query()->where('status', 'rejected')->count(); + } + + return Report::query()->where('user_id', auth()->id())->where('status', 'rejected')->count(); + }) ->preserveAll(), ]; + if (auth()->user()->roles()->exists()) { + $presetViews['assigned'] = PresetView::make() + ->modifyQueryUsing(fn ($query) => $query->where('assigned_to', auth()->id())) + ->favorite() + ->badge(Report::query()->where('assigned_to', auth()->id())->count()) + ->preserveAll(); + } + + return $presetViews; } } From ddde34b8000395fe1238f94adb4c2a5df317d7c3 Mon Sep 17 00:00:00 2001 From: Sagar Date: Wed, 20 Nov 2024 17:19:54 +0100 Subject: [PATCH 113/137] fix: curators can only see open reports in the assigned tab --- .../Dashboard/Resources/ReportResource/Pages/ListReports.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php b/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php index 1e1fb3b9..526602af 100644 --- a/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php +++ b/app/Filament/Dashboard/Resources/ReportResource/Pages/ListReports.php @@ -64,7 +64,7 @@ public function getPresetViews(): array $presetViews['assigned'] = PresetView::make() ->modifyQueryUsing(fn ($query) => $query->where('assigned_to', auth()->id())) ->favorite() - ->badge(Report::query()->where('assigned_to', auth()->id())->count()) + ->badge(Report::query()->where('assigned_to', auth()->id())->where('status', 'submitted')->count()) ->preserveAll(); } From 1ba14ec89f7b3cd7411c6579324093190a1d584c Mon Sep 17 00:00:00 2001 From: Sagar Date: Thu, 21 Nov 2024 14:41:54 +0100 Subject: [PATCH 114/137] fix: fixes the array for the parents --- .../DedupeFixCollectionSourceLinks.php | 214 ++++++++++-------- 1 file changed, 115 insertions(+), 99 deletions(-) diff --git a/app/Console/Commands/DedupeFixCollectionSourceLinks.php b/app/Console/Commands/DedupeFixCollectionSourceLinks.php index f6523b99..e4a63936 100644 --- a/app/Console/Commands/DedupeFixCollectionSourceLinks.php +++ b/app/Console/Commands/DedupeFixCollectionSourceLinks.php @@ -35,108 +35,120 @@ public function handle() 54 => 'https://go.drugbank.com/drugs/', 58 => 'https://www.way2drug.com/phyto4health/compound_card.php?compound_id=', ]; - $batchCount = 1; - - // Process all molecules in chunks to avoid memory exhaustion - DB::table('collection_molecule') - ->select('id', 'collection_id', 'molecule_id', 'url', 'reference') - ->orderBy('id') - ->chunk($batchSize, function ($collection_molecules) use (&$data, $db_links, &$batchCount) { - $this->info('started batch '); - if ($batchCount >= 29) { - foreach ($collection_molecules as $collection_molecule) { - $url = null; - $reference = null; - - // Get the source URL and reference for the molecule - $entries = DB::select("SELECT link, reference_id FROM entries WHERE collection_id = {$collection_molecule->collection_id} and molecule_id = {$collection_molecule->molecule_id};"); - - foreach ($entries as $index => $entry) { - - if ($index == 0) { - switch ($collection_molecule->collection_id) { - case 30: - case 42: - case 43: - case 54: - case 58: - $url = $db_links[$collection_molecule->collection_id].$entry->reference_id; - break; - default: - $url = $entry->link; - break; - } - $reference = $entry->reference_id; - } else { - switch ($collection_molecule->collection_id) { - case 30: - case 42: - case 43: - case 54: - case 58: - $url .= '|'.$db_links[$collection_molecule->collection_id].$entry->reference_id; - break; - default: - $url .= '|'.$entry->link; - break; - } - $reference .= '|'.$entry->reference_id; - } - } - - // Prepare data for batch update - array_push($data, [ - 'collection_id' => $collection_molecule->collection_id, - 'molecule_id' => $collection_molecule->molecule_id, - 'url' => $url, - 'reference' => $reference, - ]); - } - - // Update the database with the calculated scores in batch - if (! empty($data)) { - $this->info('Updating batch '.$batchCount); - $this->updateBatch($data); - $data = []; // Reset the data array for the next batch - } - } - $batchCount = $batchCount + 1; - }); - - // Ensure any remaining data is updated after the last chunk - if (! empty($data)) { - $this->updateBatch($data); - } + // $batchCount = 1; + + // // Process all molecules in chunks to avoid memory exhaustion + // DB::table('collection_molecule') + // ->select('id', 'collection_id', 'molecule_id', 'url', 'reference') + // ->orderBy('id') + // ->chunk($batchSize, function ($collection_molecules) use (&$data, $db_links, &$batchCount) { + // $this->info('started batch '); + // if ($batchCount >= 29) { + // foreach ($collection_molecules as $collection_molecule) { + // $url = null; + // $reference = null; + + // // Get the source URL and reference for the molecule + // $entries = DB::select("SELECT link, reference_id FROM entries WHERE collection_id = {$collection_molecule->collection_id} and molecule_id = {$collection_molecule->molecule_id};"); + + // foreach ($entries as $index => $entry) { + + // if ($index == 0) { + // switch ($collection_molecule->collection_id) { + // case 30: + // case 42: + // case 43: + // case 54: + // case 58: + // $url = $db_links[$collection_molecule->collection_id].$entry->reference_id; + // break; + // default: + // $url = $entry->link; + // break; + // } + // $reference = $entry->reference_id; + // } else { + // switch ($collection_molecule->collection_id) { + // case 30: + // case 42: + // case 43: + // case 54: + // case 58: + // $url .= '|'.$db_links[$collection_molecule->collection_id].$entry->reference_id; + // break; + // default: + // $url .= '|'.$entry->link; + // break; + // } + // $reference .= '|'.$entry->reference_id; + // } + // } + + // // Prepare data for batch update + // array_push($data, [ + // 'collection_id' => $collection_molecule->collection_id, + // 'molecule_id' => $collection_molecule->molecule_id, + // 'url' => $url, + // 'reference' => $reference, + // ]); + // } + + // // Update the database with the calculated scores in batch + // if (! empty($data)) { + // $this->info('Updating batch '.$batchCount); + // $this->updateBatch($data); + // $data = []; // Reset the data array for the next batch + // } + // } + // $batchCount = $batchCount + 1; + // }); + + // // Ensure any remaining data is updated after the last chunk + // if (! empty($data)) { + // $this->updateBatch($data); + // } // Process parent molecules $data = []; $batchCount = 1; + $total_parent_molecules = DB::select('SELECT count(*) FROM molecules WHERE is_parent = true;')[0]->count; DB::table('molecules') ->select('id') ->where('is_parent', true) ->orderBy('id') - ->chunk($batchSize, function ($parent_molecules) use (&$data, &$batchCount) { - $this->info('started parent batch '); - $ids_string = implode(',', $parent_molecules->pluck('id')->toArray()); - - $patents_pivot_rows = DB::select("SELECT collection_id, molecule_id, url, reference FROM collection_molecule WHERE molecule_id in ({$ids_string});"); - - foreach ($patents_pivot_rows as $parent_pivot_row) { - $url = null; - $reference = null; - $children_ids = collect(DB::select("SELECT id FROM molecules WHERE parent_id = {$parent_pivot_row->molecule_id};")); - $children_ids_string = implode(',', $children_ids->pluck('id')->toArray()); - $children_pivot_rows = DB::select("SELECT collection_id, molecule_id, url, reference FROM collection_molecule WHERE collection_id = {$parent_pivot_row->collection_id} and molecule_id in ({$children_ids_string});"); - - foreach ($children_pivot_rows as $children_pivot_row) { - if (! $parent_pivot_row->url) { - $url = $children_pivot_row->url; - $reference = $children_pivot_row->reference; - } else { - $url .= '|'.$children_pivot_row->url; - $reference .= '|'.$children_pivot_row->reference; + ->chunk($batchSize, function ($parent_molecules) use (&$data, &$batchCount, $total_parent_molecules, $batchSize) { + $this->info('started parent batch '.$batchCount.' of '.ceil($total_parent_molecules / $batchSize)); + // $ids_string = implode(',', $parent_molecules->pluck('id')->toArray()); + if ($batchCount >= 2) { + $patents_pivot_rows = DB::table('collection_molecule') + ->selectRaw('collection_id, molecule_id, url, reference') + ->whereIntegerInRaw('molecule_id', $parent_molecules->pluck('id')->toArray()) + ->get(); + $total_parent_molecules = count($patents_pivot_rows); + + // $molecule_number = 1; + $progressBar = $this->output->createProgressBar($total_parent_molecules); + foreach ($patents_pivot_rows as $parent_pivot_row) { + $url = null; + $reference = null; + $children_ids = collect(DB::select("SELECT id FROM molecules WHERE parent_id = {$parent_pivot_row->molecule_id};")); + // $children_ids_string = implode(',', $children_ids->pluck('id')->toArray()); + + $children_pivot_rows = DB::table('collection_molecule') + ->selectRaw('collection_id, molecule_id, url, reference') + ->whereRaw('collection_id=?', [$parent_pivot_row->collection_id]) + ->whereIntegerInRaw('molecule_id', $children_ids->pluck('id')->toArray()) + ->get(); + + foreach ($children_pivot_rows as $children_pivot_row) { + if (! $parent_pivot_row->url) { + $url = $children_pivot_row->url; + $reference = $children_pivot_row->reference; + } else { + $url .= '|'.$children_pivot_row->url; + $reference .= '|'.$children_pivot_row->reference; + } } - // push each parent data for update array_push($data, [ 'collection_id' => $parent_pivot_row->collection_id, @@ -144,14 +156,18 @@ public function handle() 'url' => $url, 'reference' => $reference, ]); + $progressBar->advance(); + // $this->info($molecule_number .' of '.$total_parent_molecules); + // $molecule_number++; } - } - // Update the database with the calculated scores in batch - if (! empty($data)) { - $this->info('Updating parent batch '.$batchCount); - $this->updateBatch($data); - $data = []; // Reset the data array for the next batch + // Update the database with the calculated scores in batch + if (! empty($data)) { + $this->info('Updating parent batch '.$batchCount); + $this->updateBatch($data); + $progressBar->finish(); + $data = []; // Reset the data array for the next batch + } } $batchCount = $batchCount + 1; From e9947a36627f64eda80a383754d48d8ccb186647 Mon Sep 17 00:00:00 2001 From: Sagar Date: Fri, 22 Nov 2024 11:35:57 +0100 Subject: [PATCH 115/137] chore: rearranged the look and descriptions of the download --- resources/views/livewire/molecule-depict2d.blade.php | 7 ++++--- resources/views/livewire/molecule-depict3d.blade.php | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/resources/views/livewire/molecule-depict2d.blade.php b/resources/views/livewire/molecule-depict2d.blade.php index e8adcfbb..d72a9418 100644 --- a/resources/views/livewire/molecule-depict2d.blade.php +++ b/resources/views/livewire/molecule-depict2d.blade.php @@ -1,5 +1,5 @@
-
+
- - + + 2D + diff --git a/resources/views/livewire/molecule-depict3d.blade.php b/resources/views/livewire/molecule-depict3d.blade.php index d7b6a80a..a133baf4 100644 --- a/resources/views/livewire/molecule-depict3d.blade.php +++ b/resources/views/livewire/molecule-depict3d.blade.php @@ -2,13 +2,13 @@
- 3D Structure (by RDKit) - Interactive JSMol molecular viewer + 3D Structure + (by RDKit) Interactive JSmol molecular viewer - - + 3D + From b6c4d6b8e9a3ffaa033d747d4161347911054423 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Fri, 22 Nov 2024 15:11:23 +0100 Subject: [PATCH 116/137] fix: enabled cookie banner display on smaller screens --- .../views/vendor/cookie-consent/dialogContents.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/vendor/cookie-consent/dialogContents.blade.php b/resources/views/vendor/cookie-consent/dialogContents.blade.php index 8717f542..f0b366db 100644 --- a/resources/views/vendor/cookie-consent/dialogContents.blade.php +++ b/resources/views/vendor/cookie-consent/dialogContents.blade.php @@ -1,8 +1,8 @@