From a4053a08a2a34022ea89e8163ee7d271d7590d6e Mon Sep 17 00:00:00 2001 From: Danny Collier <294724+dcollie2@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:31:40 -0500 Subject: [PATCH 01/11] Wire up standard rails JS --- .node-version | 1 - Dockerfile | 18 +- Gemfile | 2 +- Gemfile.lock | 36 +- Procfile.dev | 2 +- .../stylesheets/application.bootstrap.scss | 2 - app/assets/stylesheets/application.sass.scss | 1 + app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/sessions.css | 59 -- app/javascript/application.js | 1 - app/views/layouts/application.html.erb | 5 + bin/setup | 3 - config/importmap.rb | 1 - package.json | 23 - yarn.lock | 744 ------------------ 15 files changed, 45 insertions(+), 854 deletions(-) delete mode 100644 .node-version delete mode 100644 app/assets/stylesheets/application.bootstrap.scss create mode 100644 app/assets/stylesheets/application.sass.scss create mode 100644 app/assets/stylesheets/application.scss delete mode 100644 app/assets/stylesheets/sessions.css delete mode 100644 package.json delete mode 100644 yarn.lock diff --git a/.node-version b/.node-version deleted file mode 100644 index 728f7de..0000000 --- a/.node-version +++ /dev/null @@ -1 +0,0 @@ -22.9.0 diff --git a/Dockerfile b/Dockerfile index 56cc69a..6c34fdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,30 +28,17 @@ ENV RAILS_ENV="production" \ # Throw-away build stage to reduce size of final image FROM base AS build -# Install packages needed to build gems and node modules +# Install packages needed to build gems RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y build-essential git libpq-dev node-gyp pkg-config python-is-python3 && \ + apt-get install --no-install-recommends -y build-essential git libpq-dev pkg-config && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives -# Install JavaScript dependencies -ARG NODE_VERSION=22.9.0 -ARG YARN_VERSION=1.22.22 -ENV PATH=/usr/local/node/bin:$PATH -RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \ - /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \ - npm install -g yarn@$YARN_VERSION && \ - rm -rf /tmp/node-build-master - # Install application gems COPY Gemfile Gemfile.lock ./ RUN bundle install && \ rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ bundle exec bootsnap precompile --gemfile -# Install node modules -COPY package.json yarn.lock ./ -RUN yarn install --frozen-lockfile - # Copy application code COPY . . @@ -62,7 +49,6 @@ RUN bundle exec bootsnap precompile app/ lib/ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile -RUN rm -rf node_modules # Final stage for app image diff --git a/Gemfile b/Gemfile index bfe38f3..c49ce97 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem "turbo-rails" # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] gem "stimulus-rails" # Bundle and process CSS [https://github.com/rails/cssbundling-rails] -gem "cssbundling-rails" +gem "dartsass-rails" # Build JSON APIs with ease [https://github.com/rails/jbuilder] gem "jbuilder" diff --git a/Gemfile.lock b/Gemfile.lock index d557e55..02ef087 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,8 +87,9 @@ GEM concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) - cssbundling-rails (1.4.1) + dartsass-rails (0.5.1) railties (>= 6.0.0) + sass-embedded (~> 1.63) date (3.4.1) debug (1.10.0) irb (~> 1.10) @@ -111,6 +112,24 @@ GEM raabro (~> 1.4) globalid (1.2.1) activesupport (>= 6.1) + google-protobuf (4.29.3) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-aarch64-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86_64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86_64-linux) + bigdecimal + rake (>= 13) i18n (1.14.6) concurrent-ruby (~> 1.0) importmap-rails (2.1.0) @@ -290,6 +309,19 @@ GEM rubocop-performance rubocop-rails ruby-progressbar (1.13.0) + sass-embedded (1.83.4) + google-protobuf (~> 4.29) + rake (>= 13) + sass-embedded (1.83.4-aarch64-linux-gnu) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-arm-linux-gnueabihf) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-arm64-darwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-x86_64-darwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-x86_64-linux-gnu) + google-protobuf (~> 4.29) securerandom (0.4.1) shoulda-matchers (6.4.0) activesupport (>= 5.2.0) @@ -363,7 +395,7 @@ DEPENDENCIES bcrypt (~> 3.1.7) bootsnap brakeman - cssbundling-rails + dartsass-rails debug factory_bot_rails importmap-rails diff --git a/Procfile.dev b/Procfile.dev index 18f64d2..6e70024 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,2 +1,2 @@ web: env RUBY_DEBUG_OPEN=true bin/rails server -css: yarn watch:css +css: bin/rails dartsass:watch diff --git a/app/assets/stylesheets/application.bootstrap.scss b/app/assets/stylesheets/application.bootstrap.scss deleted file mode 100644 index b61b612..0000000 --- a/app/assets/stylesheets/application.bootstrap.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import 'bootstrap/scss/bootstrap'; -@import 'bootstrap-icons/font/bootstrap-icons'; diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss new file mode 100644 index 0000000..88d24c9 --- /dev/null +++ b/app/assets/stylesheets/application.sass.scss @@ -0,0 +1 @@ +// Entry point for your Sass build diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss new file mode 100644 index 0000000..8d7af90 --- /dev/null +++ b/app/assets/stylesheets/application.scss @@ -0,0 +1 @@ +// Sassy diff --git a/app/assets/stylesheets/sessions.css b/app/assets/stylesheets/sessions.css deleted file mode 100644 index 6468762..0000000 --- a/app/assets/stylesheets/sessions.css +++ /dev/null @@ -1,59 +0,0 @@ -body { - background-color: var(--bs-body-bg); -} - -#auth { - height: 100vh; - overflow-x: hidden; -} - -#auth #auth-right { - height: 100%; - - background: url(../png/4853433.png), linear-gradient(90deg, #2d499d, #3f5491); -} - -#auth #auth-left { - padding: 5rem; -} - -#auth #auth-left .auth-title { - font-size: 4rem; - margin-bottom: 1rem; -} - -#auth #auth-left .auth-subtitle { - font-size: 1.7rem; - line-height: 2.5rem; - color: #a8aebb; -} - -#auth #auth-left .auth-logo { - margin-bottom: 7rem; -} - -#auth #auth-left .auth-logo img { - height: 2rem; -} - -@media screen and (max-width: 1399.9px) { - #auth #auth-left { - padding: 3rem; - } -} - -@media screen and (max-width: 767px) { - #auth #auth-left { - padding: 5rem; - } -} - -@media screen and (max-width: 576px) { - #auth #auth-left { - padding: 5rem 3rem; - } -} - -html[data-bs-theme=dark] #auth-right { - background: url(../png/4853433.png), linear-gradient(90deg, #2d499d, #3f5491); -} diff --git a/app/javascript/application.js b/app/javascript/application.js index d16fcbe..0d7b494 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,4 +1,3 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" import "controllers" -import * as bootstrap from "bootstrap" diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ad33e9c..b941546 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -28,6 +28,10 @@ + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> diff --git a/bin/setup b/bin/setup index 6b62a32..be3db3c 100755 --- a/bin/setup +++ b/bin/setup @@ -15,9 +15,6 @@ FileUtils.chdir APP_ROOT do puts "== Installing dependencies ==" system("bundle check") || system!("bundle install") - # Install JavaScript dependencies - system("yarn install --check-files") - # puts "\n== Copying sample files ==" # unless File.exist?("config/database.yml") # FileUtils.cp "config/database.yml.sample", "config/database.yml" diff --git a/config/importmap.rb b/config/importmap.rb index 5d077af..909dfc5 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -5,4 +5,3 @@ pin "@hotwired/stimulus", to: "stimulus.min.js" pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" pin_all_from "app/javascript/controllers", under: "controllers" -pin "bootstrap", to: "bootstrap.min.js" diff --git a/package.json b/package.json deleted file mode 100644 index 993bc68..0000000 --- a/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "app", - "private": "true", - "dependencies": { - "@popperjs/core": "^2.11.8", - "autoprefixer": "^10.4.20", - "bootstrap": "^5.3.3", - "bootstrap-icons": "^1.11.3", - "nodemon": "^3.1.7", - "postcss": "^8.4.49", - "postcss-cli": "^11.0.0", - "sass": "^1.82.0" - }, - "scripts": { - "build:css:compile": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules", - "build:css:prefix": "postcss ./app/assets/builds/application.css --use=autoprefixer --output=./app/assets/builds/application.css", - "build:css": "yarn build:css:compile && yarn build:css:prefix", - "watch:css": "nodemon --watch ./app/assets/stylesheets/ --ext scss --exec \"yarn build:css\"" - }, - "browserslist": [ - "defaults" - ] -} diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index a7c335b..0000000 --- a/yarn.lock +++ /dev/null @@ -1,744 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@parcel/watcher-android-arm64@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz#e32d3dda6647791ee930556aee206fcd5ea0fb7a" - integrity sha512-qlX4eS28bUcQCdribHkg/herLe+0A9RyYC+mm2PXpncit8z5b3nSqGVzMNR3CmtAOgRutiZ02eIJJgP/b1iEFQ== - -"@parcel/watcher-darwin-arm64@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.0.tgz#0d9e680b7e9ec1c8f54944f1b945aa8755afb12f" - integrity sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw== - -"@parcel/watcher-darwin-x64@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.0.tgz#f9f1d5ce9d5878d344f14ef1856b7a830c59d1bb" - integrity sha512-9rhlwd78saKf18fT869/poydQK8YqlU26TMiNg7AIu7eBp9adqbJZqmdFOsbZ5cnLp5XvRo9wcFmNHgHdWaGYA== - -"@parcel/watcher-freebsd-x64@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.0.tgz#2b77f0c82d19e84ff4c21de6da7f7d096b1a7e82" - integrity sha512-syvfhZzyM8kErg3VF0xpV8dixJ+RzbUaaGaeb7uDuz0D3FK97/mZ5AJQ3XNnDsXX7KkFNtyQyFrXZzQIcN49Tw== - -"@parcel/watcher-linux-arm-glibc@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.0.tgz#92ed322c56dbafa3d2545dcf2803334aee131e42" - integrity sha512-0VQY1K35DQET3dVYWpOaPFecqOT9dbuCfzjxoQyif1Wc574t3kOSkKevULddcR9znz1TcklCE7Ht6NIxjvTqLA== - -"@parcel/watcher-linux-arm-musl@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.0.tgz#cd48e9bfde0cdbbd2ecd9accfc52967e22f849a4" - integrity sha512-6uHywSIzz8+vi2lAzFeltnYbdHsDm3iIB57d4g5oaB9vKwjb6N6dRIgZMujw4nm5r6v9/BQH0noq6DzHrqr2pA== - -"@parcel/watcher-linux-arm64-glibc@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.0.tgz#7b81f6d5a442bb89fbabaf6c13573e94a46feb03" - integrity sha512-BfNjXwZKxBy4WibDb/LDCriWSKLz+jJRL3cM/DllnHH5QUyoiUNEp3GmL80ZqxeumoADfCCP19+qiYiC8gUBjA== - -"@parcel/watcher-linux-arm64-musl@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.0.tgz#dcb8ff01077cdf59a18d9e0a4dff7a0cfe5fd732" - integrity sha512-S1qARKOphxfiBEkwLUbHjCY9BWPdWnW9j7f7Hb2jPplu8UZ3nes7zpPOW9bkLbHRvWM0WDTsjdOTUgW0xLBN1Q== - -"@parcel/watcher-linux-x64-glibc@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.0.tgz#2e254600fda4e32d83942384d1106e1eed84494d" - integrity sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw== - -"@parcel/watcher-linux-x64-musl@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.0.tgz#01fcea60fedbb3225af808d3f0a7b11229792eef" - integrity sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA== - -"@parcel/watcher-win32-arm64@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.0.tgz#87cdb16e0783e770197e52fb1dc027bb0c847154" - integrity sha512-twtft1d+JRNkM5YbmexfcH/N4znDtjgysFaV9zvZmmJezQsKpkfLYJ+JFV3uygugK6AtIM2oADPkB2AdhBrNig== - -"@parcel/watcher-win32-ia32@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.0.tgz#778c39b56da33e045ba21c678c31a9f9d7c6b220" - integrity sha512-+rgpsNRKwo8A53elqbbHXdOMtY/tAtTzManTWShB5Kk54N8Q9mzNWV7tV+IbGueCbcj826MfWGU3mprWtuf1TA== - -"@parcel/watcher-win32-x64@2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.0.tgz#33873876d0bbc588aacce38e90d1d7480ce81cb7" - integrity sha512-lPrxve92zEHdgeff3aiu4gDOIt4u7sJYha6wbdEZDCDUhtjTsOMiaJzG5lMY4GkWH8p0fMmO2Ppq5G5XXG+DQw== - -"@parcel/watcher@^2.4.1": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.5.0.tgz#5c88818b12b8de4307a9d3e6dc3e28eba0dfbd10" - integrity sha512-i0GV1yJnm2n3Yq1qw6QrUrd/LI9bE8WEBOTtOkpCXHHdyN3TAGgqAK/DAT05z4fq2x04cARXt2pDmjWjL92iTQ== - dependencies: - detect-libc "^1.0.3" - is-glob "^4.0.3" - micromatch "^4.0.5" - node-addon-api "^7.0.0" - optionalDependencies: - "@parcel/watcher-android-arm64" "2.5.0" - "@parcel/watcher-darwin-arm64" "2.5.0" - "@parcel/watcher-darwin-x64" "2.5.0" - "@parcel/watcher-freebsd-x64" "2.5.0" - "@parcel/watcher-linux-arm-glibc" "2.5.0" - "@parcel/watcher-linux-arm-musl" "2.5.0" - "@parcel/watcher-linux-arm64-glibc" "2.5.0" - "@parcel/watcher-linux-arm64-musl" "2.5.0" - "@parcel/watcher-linux-x64-glibc" "2.5.0" - "@parcel/watcher-linux-x64-musl" "2.5.0" - "@parcel/watcher-win32-arm64" "2.5.0" - "@parcel/watcher-win32-ia32" "2.5.0" - "@parcel/watcher-win32-x64" "2.5.0" - -"@popperjs/core@^2.11.8": - version "2.11.8" - resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" - integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== - -"@sindresorhus/merge-streams@^2.1.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz#719df7fb41766bc143369eaa0dd56d8dc87c9958" - integrity sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg== - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -autoprefixer@^10.4.20: - version "10.4.20" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.20.tgz#5caec14d43976ef42e32dcb4bd62878e96be5b3b" - integrity sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g== - dependencies: - browserslist "^4.23.3" - caniuse-lite "^1.0.30001646" - fraction.js "^4.3.7" - normalize-range "^0.1.2" - picocolors "^1.0.1" - postcss-value-parser "^4.2.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -binary-extensions@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" - integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== - -bootstrap-icons@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/bootstrap-icons/-/bootstrap-icons-1.11.3.tgz#03f9cb754ec005c52f9ee616e2e84a82cab3084b" - integrity sha512-+3lpHrCw/it2/7lBL15VR0HEumaBss0+f/Lb6ZvHISn1mlK83jjFpooTLsMWbIjJMDjDjOExMsTxnXSIT4k4ww== - -bootstrap@^5.3.3: - version "5.3.3" - resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.3.tgz#de35e1a765c897ac940021900fcbb831602bac38" - integrity sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.3, braces@~3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -browserslist@^4.23.3: - version "4.24.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.3.tgz#5fc2725ca8fb3c1432e13dac278c7cc103e026d2" - integrity sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA== - dependencies: - caniuse-lite "^1.0.30001688" - electron-to-chromium "^1.5.73" - node-releases "^2.0.19" - update-browserslist-db "^1.1.1" - -caniuse-lite@^1.0.30001646, caniuse-lite@^1.0.30001688: - version "1.0.30001690" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz#f2d15e3aaf8e18f76b2b8c1481abde063b8104c8" - integrity sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w== - -chokidar@^3.3.0, chokidar@^3.5.2: - version "3.6.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" - integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chokidar@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-4.0.3.tgz#7be37a4c03c9aee1ecfe862a4a23b2c70c205d30" - integrity sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA== - dependencies: - readdirp "^4.0.1" - -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -debug@^4: - version "4.4.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== - dependencies: - ms "^2.1.3" - -dependency-graph@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" - integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg== - -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== - -electron-to-chromium@^1.5.73: - version "1.5.76" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.76.tgz#db20295c5061b68f07c8ea4dfcbd701485d94a3d" - integrity sha512-CjVQyG7n7Sr+eBXE86HIulnL5N8xZY1sgmOPGuq/F0Rr0FJq63lg0kEtOIDfZBk44FnDLf6FUJ+dsJcuiUDdDQ== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -escalade@^3.1.1, escalade@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" - integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== - -fast-glob@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" - integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fastq@^1.6.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.18.0.tgz#d631d7e25faffea81887fe5ea8c9010e1b36fee0" - integrity sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw== - dependencies: - reusify "^1.0.4" - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -fraction.js@^4.3.7: - version "4.3.7" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" - integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== - -fs-extra@^11.0.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" - integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-stdin@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-9.0.0.tgz#3983ff82e03d56f1b2ea0d3e60325f39d703a575" - integrity sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA== - -glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -globby@^14.0.0: - version "14.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-14.0.2.tgz#06554a54ccfe9264e5a9ff8eded46aa1e306482f" - integrity sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw== - dependencies: - "@sindresorhus/merge-streams" "^2.1.0" - fast-glob "^3.3.2" - ignore "^5.2.4" - path-type "^5.0.0" - slash "^5.1.0" - unicorn-magic "^0.1.0" - -graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -ignore-by-default@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" - integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA== - -ignore@^5.2.4: - version "5.3.2" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" - integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== - -immutable@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-5.0.3.tgz#aa037e2313ea7b5d400cd9298fa14e404c933db1" - integrity sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -lilconfig@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.3.tgz#a1bcfd6257f9585bf5ae14ceeebb7b559025e4c4" - integrity sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw== - -merge2@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4, micromatch@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" - integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== - dependencies: - braces "^3.0.3" - picomatch "^2.3.1" - -minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -ms@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -nanoid@^3.3.7: - version "3.3.8" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" - integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== - -node-addon-api@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" - integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== - -node-releases@^2.0.19: - version "2.0.19" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" - integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== - -nodemon@^3.1.7: - version "3.1.9" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-3.1.9.tgz#df502cdc3b120e1c3c0c6e4152349019efa7387b" - integrity sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg== - dependencies: - chokidar "^3.5.2" - debug "^4" - ignore-by-default "^1.0.1" - minimatch "^3.1.2" - pstree.remy "^1.1.8" - semver "^7.5.3" - simple-update-notifier "^2.0.0" - supports-color "^5.5.0" - touch "^3.1.0" - undefsafe "^2.0.5" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-range@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" - integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== - -path-type@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-5.0.0.tgz#14b01ed7aea7ddf9c7c3f46181d4d04f9c785bb8" - integrity sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg== - -picocolors@^1.0.0, picocolors@^1.0.1, picocolors@^1.1.0, picocolors@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" - integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== - -postcss-cli@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/postcss-cli/-/postcss-cli-11.0.0.tgz#649f4b9af447501feb6cbca7f7505a132f90442b" - integrity sha512-xMITAI7M0u1yolVcXJ9XTZiO9aO49mcoKQy6pCDFdMh9kGqhzLVpWxeD/32M/QBmkhcGypZFFOLNLmIW4Pg4RA== - dependencies: - chokidar "^3.3.0" - dependency-graph "^0.11.0" - fs-extra "^11.0.0" - get-stdin "^9.0.0" - globby "^14.0.0" - picocolors "^1.0.0" - postcss-load-config "^5.0.0" - postcss-reporter "^7.0.0" - pretty-hrtime "^1.0.3" - read-cache "^1.0.0" - slash "^5.0.0" - yargs "^17.0.0" - -postcss-load-config@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-5.1.0.tgz#4ded23410da973e05edae9d41fa99bb5c1d5477f" - integrity sha512-G5AJ+IX0aD0dygOE0yFZQ/huFFMSNneyfp0e3/bT05a8OfPC5FUoZRPfGijUdGOJNMewJiwzcHJXFafFzeKFVA== - dependencies: - lilconfig "^3.1.1" - yaml "^2.4.2" - -postcss-reporter@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/postcss-reporter/-/postcss-reporter-7.1.0.tgz#5ec476d224e2fe25a054e3c66d9b2901d4fab422" - integrity sha512-/eoEylGWyy6/DOiMP5lmFRdmDKThqgn7D6hP2dXKJI/0rJSO1ADFNngZfDzxL0YAxFvws+Rtpuji1YIHj4mySA== - dependencies: - picocolors "^1.0.0" - thenby "^1.3.4" - -postcss-value-parser@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" - integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== - -postcss@^8.4.49: - version "8.4.49" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.49.tgz#4ea479048ab059ab3ae61d082190fabfd994fe19" - integrity sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA== - dependencies: - nanoid "^3.3.7" - picocolors "^1.1.1" - source-map-js "^1.2.1" - -pretty-hrtime@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - integrity sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A== - -pstree.remy@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" - integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -read-cache@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" - integrity sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA== - dependencies: - pify "^2.3.0" - -readdirp@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.0.2.tgz#388fccb8b75665da3abffe2d8f8ed59fe74c230a" - integrity sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA== - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -sass@^1.82.0: - version "1.83.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.83.0.tgz#e36842c0b88a94ed336fd16249b878a0541d536f" - integrity sha512-qsSxlayzoOjdvXMVLkzF84DJFc2HZEL/rFyGIKbbilYtAvlCxyuzUeff9LawTn4btVnLKg75Z8MMr1lxU1lfGw== - dependencies: - chokidar "^4.0.0" - immutable "^5.0.2" - source-map-js ">=0.6.2 <2.0.0" - optionalDependencies: - "@parcel/watcher" "^2.4.1" - -semver@^7.5.3: - version "7.6.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - -simple-update-notifier@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz#d70b92bdab7d6d90dfd73931195a30b6e3d7cebb" - integrity sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w== - dependencies: - semver "^7.5.3" - -slash@^5.0.0, slash@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-5.1.0.tgz#be3adddcdf09ac38eebe8dcdc7b1a57a75b095ce" - integrity sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg== - -"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" - integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -supports-color@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -thenby@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/thenby/-/thenby-1.3.4.tgz#81581f6e1bb324c6dedeae9bfc28e59b1a2201cc" - integrity sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -touch@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.1.tgz#097a23d7b161476435e5c1344a95c0f75b4a5694" - integrity sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA== - -undefsafe@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" - integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== - -unicorn-magic@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz#1bb9a51c823aaf9d73a8bfcd3d1a23dde94b0ce4" - integrity sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ== - -universalify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" - integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== - -update-browserslist-db@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" - integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== - dependencies: - escalade "^3.2.0" - picocolors "^1.1.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yaml@^2.4.2: - version "2.7.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.7.0.tgz#aef9bb617a64c937a9a748803786ad8d3ffe1e98" - integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== - -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - -yargs@^17.0.0: - version "17.7.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" From e4d82bb02d3e96d80bb6229ceeef8b9ca3aed6f5 Mon Sep 17 00:00:00 2001 From: Danny Collier <294724+dcollie2@users.noreply.github.com> Date: Thu, 16 Jan 2025 18:45:15 -0500 Subject: [PATCH 02/11] Include JS in all layouts. Add sweetalert via Importmap --- app/javascript/application.js | 20 + app/views/layouts/sessions.html.erb | 4 + app/views/layouts/static.html.erb | 4 + config/importmap.rb | 1 + vendor/javascript/sweetalert2.js | 1097 +++++++++++++++++++++++++++ 5 files changed, 1126 insertions(+) create mode 100644 vendor/javascript/sweetalert2.js diff --git a/app/javascript/application.js b/app/javascript/application.js index 0d7b494..f727dc3 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,3 +1,23 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" import "controllers" +import Swal from 'sweetalert2'; + +document.addEventListener('DOMContentLoaded', () => { + const Toast = Swal.mixin({ + toast: true, + position: "top-end", + showConfirmButton: false, + timer: 3000, + timerProgressBar: true, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; + } + }); + // Toast.fire({ + // icon: "success", + // title: "Signed in successfully" + // }); + +}); diff --git a/app/views/layouts/sessions.html.erb b/app/views/layouts/sessions.html.erb index e1988d9..df7b76b 100644 --- a/app/views/layouts/sessions.html.erb +++ b/app/views/layouts/sessions.html.erb @@ -17,6 +17,10 @@ + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + diff --git a/app/views/layouts/static.html.erb b/app/views/layouts/static.html.erb index 6f35954..ee73df2 100644 --- a/app/views/layouts/static.html.erb +++ b/app/views/layouts/static.html.erb @@ -27,6 +27,10 @@ + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> + <%= javascript_importmap_tags %> + diff --git a/config/importmap.rb b/config/importmap.rb index 909dfc5..0ab3094 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -5,3 +5,4 @@ pin "@hotwired/stimulus", to: "stimulus.min.js" pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" pin_all_from "app/javascript/controllers", under: "controllers" +pin "sweetalert2" # @11.15.10 diff --git a/vendor/javascript/sweetalert2.js b/vendor/javascript/sweetalert2.js new file mode 100644 index 0000000..468f603 --- /dev/null +++ b/vendor/javascript/sweetalert2.js @@ -0,0 +1,1097 @@ +// sweetalert2@11.15.10 downloaded from https://ga.jspm.io/npm:sweetalert2@11.15.10/dist/sweetalert2.all.js + +var e=typeof globalThis!=="undefined"?globalThis:typeof self!=="undefined"?self:global;var t={};(function(e,n){t=n()})(0,(function(){function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet2(e,t){return e.get(_assertClassBrand(e,t))}function _classPrivateFieldInitSpec(e,t,n){_checkPrivateRedeclaration(e,t),t.set(e,n)}function _classPrivateFieldSet2(e,t,n){return e.set(_assertClassBrand(e,t),n),n}const t=100; +/** @type {GlobalState} */const n={};const focusPreviousActiveElement=()=>{if(n.previousActiveElement instanceof HTMLElement){n.previousActiveElement.focus();n.previousActiveElement=null}else document.body&&document.body.focus()}; +/** + * Restore previous active (focused) element + * + * @param {boolean} returnFocus + * @returns {Promise} + */const restoreActiveElement=e=>new Promise((o=>{if(!e)return o();const s=window.scrollX;const a=window.scrollY;n.restoreFocusTimeout=setTimeout((()=>{focusPreviousActiveElement();o()}),t);window.scrollTo(s,a)}));const o="swal2-"; +/** + * @typedef {Record} SwalClasses + */ +/** + * @typedef {'success' | 'warning' | 'info' | 'question' | 'error'} SwalIcon + * @typedef {Record} SwalIcons + */ +/** @type {SwalClass[]} */const s=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"];const a=s.reduce(((e,t)=>{e[t]=o+t;return e}),/** @type {SwalClasses} */{}); +/** @type {SwalIcon[]} */const i=["success","warning","info","question","error"];const r=i.reduce(((e,t)=>{e[t]=o+t;return e}),/** @type {SwalIcons} */{});const l="SweetAlert2:"; +/** + * Capitalize the first letter of a string + * + * @param {string} str + * @returns {string} + */const capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1) +/** + * Standardize console warnings + * + * @param {string | string[]} message + */;const warn=e=>{console.warn(`${l} ${typeof e==="object"?e.join(" "):e}`)}; +/** + * Standardize console errors + * + * @param {string} message + */const error=e=>{console.error(`${l} ${e}`)}; +/** + * Private global state for `warnOnce` + * + * @type {string[]} + * @private + */const c=[]; +/** + * Show a console warning, but only if it hasn't already been shown + * + * @param {string} message + */const warnOnce=e=>{if(!c.includes(e)){c.push(e);warn(e)}}; +/** + * Show a one-time console warning about deprecated params/methods + * + * @param {string} deprecatedParam + * @param {string?} useInstead + */const warnAboutDeprecation=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;warnOnce(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)}; +/** + * If `arg` is a function, call it (with no arguments or context) and return the result. + * Otherwise, just pass the value through + * + * @param {Function | any} arg + * @returns {any} + */const callIfFunction=e=>typeof e==="function"?e():e +/** + * @param {any} arg + * @returns {boolean} + */;const hasToPromiseFn=e=>e&&typeof e.toPromise==="function" +/** + * @param {any} arg + * @returns {Promise} + */;const asPromise=e=>hasToPromiseFn(e)?e.toPromise():Promise.resolve(e) +/** + * @param {any} arg + * @returns {boolean} + */;const isPromise=e=>e&&Promise.resolve(e)===e +/** + * Gets the popup container which contains the backdrop and the popup itself. + * + * @returns {HTMLElement | null} + */;const getContainer=()=>document.body.querySelector(`.${a.container}`) +/** + * @param {string} selectorString + * @returns {HTMLElement | null} + */;const elementBySelector=e=>{const t=getContainer();return t?t.querySelector(e):null}; +/** + * @param {string} className + * @returns {HTMLElement | null} + */const elementByClass=e=>elementBySelector(`.${e}`); +/** + * @returns {HTMLElement | null} + */const getPopup=()=>elementByClass(a.popup) +/** + * @returns {HTMLElement | null} + */;const getIcon=()=>elementByClass(a.icon) +/** + * @returns {HTMLElement | null} + */;const getIconContent=()=>elementByClass(a["icon-content"]) +/** + * @returns {HTMLElement | null} + */;const getTitle=()=>elementByClass(a.title) +/** + * @returns {HTMLElement | null} + */;const getHtmlContainer=()=>elementByClass(a["html-container"]) +/** + * @returns {HTMLElement | null} + */;const getImage=()=>elementByClass(a.image) +/** + * @returns {HTMLElement | null} + */;const getProgressSteps=()=>elementByClass(a["progress-steps"]) +/** + * @returns {HTMLElement | null} + */;const getValidationMessage=()=>elementByClass(a["validation-message"]) +/** + * @returns {HTMLButtonElement | null} + */;const getConfirmButton=()=>/** @type {HTMLButtonElement} */elementBySelector(`.${a.actions} .${a.confirm}`) +/** + * @returns {HTMLButtonElement | null} + */;const getCancelButton=()=>/** @type {HTMLButtonElement} */elementBySelector(`.${a.actions} .${a.cancel}`) +/** + * @returns {HTMLButtonElement | null} + */;const getDenyButton=()=>/** @type {HTMLButtonElement} */elementBySelector(`.${a.actions} .${a.deny}`) +/** + * @returns {HTMLElement | null} + */;const getInputLabel=()=>elementByClass(a["input-label"]) +/** + * @returns {HTMLElement | null} + */;const getLoader=()=>elementBySelector(`.${a.loader}`) +/** + * @returns {HTMLElement | null} + */;const getActions=()=>elementByClass(a.actions) +/** + * @returns {HTMLElement | null} + */;const getFooter=()=>elementByClass(a.footer) +/** + * @returns {HTMLElement | null} + */;const getTimerProgressBar=()=>elementByClass(a["timer-progress-bar"]) +/** + * @returns {HTMLElement | null} + */;const getCloseButton=()=>elementByClass(a.close);const d='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n'; +/** + * @returns {HTMLElement[]} + */const getFocusableElements=()=>{const e=getPopup();if(!e)return[]; +/** @type {NodeListOf} */const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])');const n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0");const o=parseInt(t.getAttribute("tabindex")||"0");return n>o?1:n} */const o=e.querySelectorAll(d);const s=Array.from(o).filter((e=>e.getAttribute("tabindex")!=="-1"));return[...new Set(n.concat(s))].filter((e=>isVisible$1(e)))}; +/** + * @returns {boolean} + */const isModal=()=>hasClass(document.body,a.shown)&&!hasClass(document.body,a["toast-shown"])&&!hasClass(document.body,a["no-backdrop"]); +/** + * @returns {boolean} + */const isToast=()=>{const e=getPopup();return!!e&&hasClass(e,a.toast)}; +/** + * @returns {boolean} + */const isLoading=()=>{const e=getPopup();return!!e&&e.hasAttribute("data-loading")}; +/** + * Securely set innerHTML of an element + * https://github.com/sweetalert2/sweetalert2/issues/1926 + * + * @param {HTMLElement} elem + * @param {string} html + */const setInnerHtml=(e,t)=>{e.textContent="";if(t){const n=new DOMParser;const o=n.parseFromString(t,"text/html");const s=o.querySelector("head");s&&Array.from(s.childNodes).forEach((t=>{e.appendChild(t)}));const a=o.querySelector("body");a&&Array.from(a.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(true)):e.appendChild(t)}))}}; +/** + * @param {HTMLElement} elem + * @param {string} className + * @returns {boolean} + */const hasClass=(e,t)=>{if(!t)return false;const n=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach((n=>{Object.values(a).includes(n)||Object.values(r).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))}; +/** + * @param {HTMLElement} elem + * @param {SweetAlertOptions} params + * @param {string} className + */const applyCustomClass=(e,t,n)=>{removeCustomClasses(e,t);if(!t.customClass)return;const o=t.customClass[/** @type {keyof SweetAlertCustomClass} */n];o&&(typeof o==="string"||o.forEach?addClass(e,o):warn(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof o}"`))}; +/** + * @param {HTMLElement} popup + * @param {import('./renderers/renderInput').InputClass | SweetAlertInput} inputClass + * @returns {HTMLInputElement | null} + */const getInput$1=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${a.popup} > .${a[t]}`);case"checkbox":return e.querySelector(`.${a.popup} > .${a.checkbox} input`);case"radio":return e.querySelector(`.${a.popup} > .${a.radio} input:checked`)||e.querySelector(`.${a.popup} > .${a.radio} input:first-child`);case"range":return e.querySelector(`.${a.popup} > .${a.range} input`);default:return e.querySelector(`.${a.popup} > .${a.input}`)}}; +/** + * @param {HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement} input + */const focusInput=e=>{e.focus();if(e.type!=="file"){const t=e.value;e.value="";e.value=t}}; +/** + * @param {HTMLElement | HTMLElement[] | null} target + * @param {string | string[] | readonly string[] | undefined} classList + * @param {boolean} condition + */const toggleClass=(e,t,n)=>{if(e&&t){typeof t==="string"&&(t=t.split(/\s+/).filter(Boolean));t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)}))}}; +/** + * @param {HTMLElement | HTMLElement[] | null} target + * @param {string | string[] | readonly string[] | undefined} classList + */const addClass=(e,t)=>{toggleClass(e,t,true)}; +/** + * @param {HTMLElement | HTMLElement[] | null} target + * @param {string | string[] | readonly string[] | undefined} classList + */const removeClass=(e,t)=>{toggleClass(e,t,false)}; +/** + * Get direct child of an element by class name + * + * @param {HTMLElement} elem + * @param {string} className + * @returns {HTMLElement | undefined} + */const getDirectChildByClass=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n));n||parseInt(n)===0?e.style.setProperty(t,typeof n==="number"?`${n}px`:n):e.style.removeProperty(t)}; +/** + * @param {HTMLElement | null} elem + * @param {string} display + */const show=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"flex";e&&(e.style.display=t)}; +/** + * @param {HTMLElement | null} elem + */const hide=e=>{e&&(e.style.display="none")}; +/** + * @param {HTMLElement | null} elem + * @param {string} display + */const showWhenInnerHtmlPresent=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"block";e&&new MutationObserver((()=>{toggle(e,e.innerHTML,t)})).observe(e,{childList:true,subtree:true})}; +/** + * @param {HTMLElement} parent + * @param {string} selector + * @param {string} property + * @param {string} value + */const setStyle=(e,t,n,o)=>{ +/** @type {HTMLElement | null} */ +const s=e.querySelector(t);s&&s.style.setProperty(n,o)}; +/** + * @param {HTMLElement} elem + * @param {any} condition + * @param {string} display + */const toggle=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"flex";t?show(e,n):hide(e)}; +/** + * borrowed from jquery $(elem).is(':visible') implementation + * + * @param {HTMLElement | null} elem + * @returns {boolean} + */const isVisible$1=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)) +/** + * @returns {boolean} + */;const allButtonsAreHidden=()=>!isVisible$1(getConfirmButton())&&!isVisible$1(getDenyButton())&&!isVisible$1(getCancelButton()) +/** + * @param {HTMLElement} elem + * @returns {boolean} + */;const isScrollable=e=>!!(e.scrollHeight>e.clientHeight) +/** + * borrowed from https://stackoverflow.com/a/46352119 + * + * @param {HTMLElement} elem + * @returns {boolean} + */;const hasCssAnimation=e=>{const t=window.getComputedStyle(e);const n=parseFloat(t.getPropertyValue("animation-duration")||"0");const o=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||o>0}; +/** + * @param {number} timer + * @param {boolean} reset + */const animateTimerProgressBar=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const n=getTimerProgressBar();if(n&&isVisible$1(n)){if(t){n.style.transition="none";n.style.width="100%"}setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`;n.style.width="0%"}),10)}};const stopTimerProgressBar=()=>{const e=getTimerProgressBar();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition");e.style.width="100%";const n=parseInt(window.getComputedStyle(e).width);const o=t/n*100;e.style.width=`${o}%`}; +/** + * Detect Node env + * + * @returns {boolean} + */const isNodeEnv=()=>typeof window==="undefined"||typeof document==="undefined";const u=`\n
\n \n
    \n
    \n \n

    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n`.replace(/(^|\n)\s*/g,""); +/** + * @returns {boolean} + */const resetOldContainer=()=>{const e=getContainer();if(!e)return false;e.remove();removeClass([document.documentElement,document.body],[a["no-backdrop"],a["toast-shown"],a["has-column"]]);return true};const resetValidationMessage$1=()=>{n.currentInstance.resetValidationMessage()};const addInputChangeListeners=()=>{const e=getPopup();const t=getDirectChildByClass(e,a.input);const n=getDirectChildByClass(e,a.file); +/** @type {HTMLInputElement} */const o=e.querySelector(`.${a.range} input`); +/** @type {HTMLOutputElement} */const s=e.querySelector(`.${a.range} output`);const i=getDirectChildByClass(e,a.select); +/** @type {HTMLInputElement} */const r=e.querySelector(`.${a.checkbox} input`);const l=getDirectChildByClass(e,a.textarea);t.oninput=resetValidationMessage$1;n.onchange=resetValidationMessage$1;i.onchange=resetValidationMessage$1;r.onchange=resetValidationMessage$1;l.oninput=resetValidationMessage$1;o.oninput=()=>{resetValidationMessage$1();s.value=o.value};o.onchange=()=>{resetValidationMessage$1();s.value=o.value}}; +/** + * @param {string | HTMLElement} target + * @returns {HTMLElement} + */const getTarget=e=>typeof e==="string"?document.querySelector(e):e +/** + * @param {SweetAlertOptions} params + */;const setupAccessibility=e=>{const t=getPopup();t.setAttribute("role",e.toast?"alert":"dialog");t.setAttribute("aria-live",e.toast?"polite":"assertive");e.toast||t.setAttribute("aria-modal","true")}; +/** + * @param {HTMLElement} targetElement + */const setupRTL=e=>{window.getComputedStyle(e).direction==="rtl"&&addClass(getContainer(),a.rtl)}; +/** + * Add modal + backdrop + no-war message for Russians to DOM + * + * @param {SweetAlertOptions} params + */const init=e=>{const t=resetOldContainer();if(isNodeEnv()){error("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=a.container;t&&addClass(n,a["no-transition"]);setInnerHtml(n,u);const o=getTarget(e.target);o.appendChild(n);setupAccessibility(e);setupRTL(o);addInputChangeListeners()}; +/** + * @param {HTMLElement | object | string} param + * @param {HTMLElement} target + */const parseHtmlToContainer=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e==="object"?handleObject(e,t):e&&setInnerHtml(t,e)}; +/** + * @param {any} param + * @param {HTMLElement} target + */const handleObject=(e,t)=>{e.jquery?handleJqueryElem(t,e):setInnerHtml(t,e.toString())}; +/** + * @param {HTMLElement} target + * @param {any} elem + */const handleJqueryElem=(e,t)=>{e.textContent="";if(0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(true));else e.appendChild(t.cloneNode(true))}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderActions=(e,t)=>{const n=getActions();const o=getLoader();if(n&&o){t.showConfirmButton||t.showDenyButton||t.showCancelButton?show(n):hide(n);applyCustomClass(n,t,"actions");renderButtons(n,o,t);setInnerHtml(o,t.loaderHtml||"");applyCustomClass(o,t,"loader")}}; +/** + * @param {HTMLElement} actions + * @param {HTMLElement} loader + * @param {SweetAlertOptions} params + */function renderButtons(e,t,n){const o=getConfirmButton();const s=getDenyButton();const a=getCancelButton();if(o&&s&&a){renderButton(o,"confirm",n);renderButton(s,"deny",n);renderButton(a,"cancel",n);handleButtonsStyling(o,s,a,n);if(n.reverseButtons)if(n.toast){e.insertBefore(a,o);e.insertBefore(s,o)}else{e.insertBefore(a,t);e.insertBefore(s,t);e.insertBefore(o,t)}}} +/** + * @param {HTMLElement} confirmButton + * @param {HTMLElement} denyButton + * @param {HTMLElement} cancelButton + * @param {SweetAlertOptions} params + */function handleButtonsStyling(e,t,n,o){if(o.buttonsStyling){addClass([e,t,n],a.styled);if(o.confirmButtonColor){e.style.backgroundColor=o.confirmButtonColor;addClass(e,a["default-outline"])}if(o.denyButtonColor){t.style.backgroundColor=o.denyButtonColor;addClass(t,a["default-outline"])}if(o.cancelButtonColor){n.style.backgroundColor=o.cancelButtonColor;addClass(n,a["default-outline"])}}else removeClass([e,t,n],a.styled)} +/** + * @param {HTMLElement} button + * @param {'confirm' | 'deny' | 'cancel'} buttonType + * @param {SweetAlertOptions} params + */function renderButton(e,t,n){const o=/** @type {'Confirm' | 'Deny' | 'Cancel'} */capitalizeFirstLetter(t);toggle(e,n[`show${o}Button`],"inline-block");setInnerHtml(e,n[`${t}ButtonText`]||"");e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||"");e.className=a[t];applyCustomClass(e,n,`${t}Button`)} +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderCloseButton=(e,t)=>{const n=getCloseButton();if(n){setInnerHtml(n,t.closeButtonHtml||"");applyCustomClass(n,t,"closeButton");toggle(n,t.showCloseButton);n.setAttribute("aria-label",t.closeButtonAriaLabel||"")}}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderContainer=(e,t)=>{const n=getContainer();if(n){handleBackdropParam(n,t.backdrop);handlePositionParam(n,t.position);handleGrowParam(n,t.grow);applyCustomClass(n,t,"container")}}; +/** + * @param {HTMLElement} container + * @param {SweetAlertOptions['backdrop']} backdrop + */function handleBackdropParam(e,t){typeof t==="string"?e.style.background=t:t||addClass([document.documentElement,document.body],a["no-backdrop"])} +/** + * @param {HTMLElement} container + * @param {SweetAlertOptions['position']} position + */function handlePositionParam(e,t){if(t)if(t in a)addClass(e,a[t]);else{warn('The "position" parameter is not valid, defaulting to "center"');addClass(e,a.center)}} +/** + * @param {HTMLElement} container + * @param {SweetAlertOptions['grow']} grow + */function handleGrowParam(e,t){t&&addClass(e,a[`grow-${t}`])}var w={innerParams:new WeakMap,domCache:new WeakMap}; +/** @type {InputClass[]} */const m=["input","file","range","select","radio","checkbox","textarea"]; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderInput=(e,t)=>{const n=getPopup();if(!n)return;const o=w.innerParams.get(e);const s=!o||t.input!==o.input;m.forEach((e=>{const o=getDirectChildByClass(n,a[e]);if(o){setAttributes(e,t.inputAttributes);o.className=a[e];s&&hide(o)}}));if(t.input){s&&showInput(t);setCustomClass(t)}}; +/** + * @param {SweetAlertOptions} params + */const showInput=e=>{if(!e.input)return;if(!p[e.input]){error(`Unexpected type of input! Expected ${Object.keys(p).join(" | ")}, got "${e.input}"`);return}const t=getInputContainer(e.input);if(!t)return;const n=p[e.input](t,e);show(t);e.inputAutoFocus&&setTimeout((()=>{focusInput(n)}))}; +/** + * @param {HTMLInputElement} input + */const removeAttributes=e=>{for(let t=0;t{const n=getPopup();if(!n)return;const o=getInput$1(n,e);if(o){removeAttributes(o);for(const e in t)o.setAttribute(e,t[e])}}; +/** + * @param {SweetAlertOptions} params + */const setCustomClass=e=>{if(!e.input)return;const t=getInputContainer(e.input);t&&applyCustomClass(t,e,"input")}; +/** + * @param {HTMLInputElement | HTMLTextAreaElement} input + * @param {SweetAlertOptions} params + */const setInputPlaceholder=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)}; +/** + * @param {Input} input + * @param {Input} prependTo + * @param {SweetAlertOptions} params + */const setInputLabel=(e,t,n)=>{if(n.inputLabel){const o=document.createElement("label");const s=a["input-label"];o.setAttribute("for",e.id);o.className=s;typeof n.customClass==="object"&&addClass(o,n.customClass.inputLabel);o.innerText=n.inputLabel;t.insertAdjacentElement("beforebegin",o)}}; +/** + * @param {SweetAlertInput} inputType + * @returns {HTMLElement | undefined} + */const getInputContainer=e=>{const t=getPopup();if(t)return getDirectChildByClass(t,a[/** @type {SwalClass} */e]||a.input)}; +/** + * @param {HTMLInputElement | HTMLOutputElement | HTMLTextAreaElement} input + * @param {SweetAlertOptions['inputValue']} inputValue + */const checkAndSetInputValue=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:isPromise(t)||warn(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)}; +/** @type {Record Input>} */const p={}; +/** + * @param {HTMLInputElement} input + * @param {SweetAlertOptions} params + * @returns {HTMLInputElement} + */p.text=p.email=p.password=p.number=p.tel=p.url=p.search=p.date=p["datetime-local"]=p.time=p.week=p.month=/** @type {(input: Input | HTMLElement, params: SweetAlertOptions) => Input} */ +(e,t)=>{checkAndSetInputValue(e,t.inputValue);setInputLabel(e,e,t);setInputPlaceholder(e,t);e.type=t.input;return e}; +/** + * @param {HTMLInputElement} input + * @param {SweetAlertOptions} params + * @returns {HTMLInputElement} + */p.file=(e,t)=>{setInputLabel(e,e,t);setInputPlaceholder(e,t);return e}; +/** + * @param {HTMLInputElement} range + * @param {SweetAlertOptions} params + * @returns {HTMLInputElement} + */p.range=(e,t)=>{const n=e.querySelector("input");const o=e.querySelector("output");checkAndSetInputValue(n,t.inputValue);n.type=t.input;checkAndSetInputValue(o,t.inputValue);setInputLabel(n,e,t);return e}; +/** + * @param {HTMLSelectElement} select + * @param {SweetAlertOptions} params + * @returns {HTMLSelectElement} + */p.select=(e,t)=>{e.textContent="";if(t.inputPlaceholder){const n=document.createElement("option");setInnerHtml(n,t.inputPlaceholder);n.value="";n.disabled=true;n.selected=true;e.appendChild(n)}setInputLabel(e,e,t);return e}; +/** + * @param {HTMLInputElement} radio + * @returns {HTMLInputElement} + */p.radio=e=>{e.textContent="";return e}; +/** + * @param {HTMLLabelElement} checkboxContainer + * @param {SweetAlertOptions} params + * @returns {HTMLInputElement} + */p.checkbox=(e,t)=>{const n=getInput$1(getPopup(),"checkbox");n.value="1";n.checked=Boolean(t.inputValue);const o=e.querySelector("span");setInnerHtml(o,t.inputPlaceholder||t.inputLabel);return n}; +/** + * @param {HTMLTextAreaElement} textarea + * @param {SweetAlertOptions} params + * @returns {HTMLTextAreaElement} + */p.textarea=(e,t)=>{checkAndSetInputValue(e,t.inputValue);setInputPlaceholder(e,t);setInputLabel(e,e,t); +/** + * @param {HTMLElement} el + * @returns {number} + */const getMargin=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(getPopup()).width);const textareaResizeHandler=()=>{if(!document.body.contains(e))return;const o=e.offsetWidth+getMargin(e);o>n?getPopup().style.width=`${o}px`:applyNumericalStyle(getPopup(),"width",t.width)};new MutationObserver(textareaResizeHandler).observe(e,{attributes:true,attributeFilter:["style"]})}}));return e}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderContent=(e,t)=>{const n=getHtmlContainer();if(n){showWhenInnerHtmlPresent(n);applyCustomClass(n,t,"htmlContainer");if(t.html){parseHtmlToContainer(t.html,n);show(n,"block")}else if(t.text){n.textContent=t.text;show(n,"block")}else hide(n);renderInput(e,t)}}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderFooter=(e,t)=>{const n=getFooter();if(n){showWhenInnerHtmlPresent(n);toggle(n,t.footer,"block");t.footer&&parseHtmlToContainer(t.footer,n);applyCustomClass(n,t,"footer")}}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderIcon=(e,t)=>{const n=w.innerParams.get(e);const o=getIcon();if(o)if(n&&t.icon===n.icon){setContent(o,t);applyStyles(o,t)}else if(t.icon||t.iconHtml)if(t.icon&&Object.keys(r).indexOf(t.icon)===-1){error(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`);hide(o)}else{show(o);setContent(o,t);applyStyles(o,t);addClass(o,t.showClass&&t.showClass.icon)}else hide(o)}; +/** + * @param {HTMLElement} icon + * @param {SweetAlertOptions} params + */const applyStyles=(e,t)=>{for(const[n,o]of Object.entries(r))t.icon!==n&&removeClass(e,o);addClass(e,t.icon&&r[t.icon]);setColor(e,t);adjustSuccessIconBackgroundColor();applyCustomClass(e,t,"icon")};const adjustSuccessIconBackgroundColor=()=>{const e=getPopup();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"); +/** @type {NodeListOf} */const n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML;let o="";if(t.iconHtml)o=iconContent(t.iconHtml);else if(t.icon==="success"){o=h;n=n.replace(/ style=".*?"/g,"")}else if(t.icon==="error")o=g;else if(t.icon){const e={question:"?",warning:"!",info:"i"};o=iconContent(e[t.icon])}n.trim()!==o.trim()&&setInnerHtml(e,o)}; +/** + * @param {HTMLElement} icon + * @param {SweetAlertOptions} params + */const setColor=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor;e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])setStyle(e,n,"background-color",t.iconColor);setStyle(e,".swal2-success-ring","border-color",t.iconColor)}}; +/** + * @param {string} content + * @returns {string} + */const iconContent=e=>`
    ${e}
    ` +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */;const renderImage=(e,t)=>{const n=getImage();if(n)if(t.imageUrl){show(n,"");n.setAttribute("src",t.imageUrl);n.setAttribute("alt",t.imageAlt||"");applyNumericalStyle(n,"width",t.imageWidth);applyNumericalStyle(n,"height",t.imageHeight);n.className=a.image;applyCustomClass(n,t,"image")}else hide(n)};let f=false;let b=0;let v=0;let y=0;let x=0; +/** + * @param {HTMLElement} popup + */const addDraggableListeners=e=>{e.addEventListener("mousedown",down);document.body.addEventListener("mousemove",move);e.addEventListener("mouseup",up);e.addEventListener("touchstart",down);document.body.addEventListener("touchmove",move);e.addEventListener("touchend",up)}; +/** + * @param {HTMLElement} popup + */const removeDraggableListeners=e=>{e.removeEventListener("mousedown",down);document.body.removeEventListener("mousemove",move);e.removeEventListener("mouseup",up);e.removeEventListener("touchstart",down);document.body.removeEventListener("touchmove",move);e.removeEventListener("touchend",up)}; +/** + * @param {MouseEvent | TouchEvent} event + */const down=e=>{const t=getPopup();if(e.target===t||getIcon().contains(/** @type {HTMLElement} */e.target)){f=true;const n=getClientXY(e);b=n.clientX;v=n.clientY;y=parseInt(t.style.insetInlineStart)||0;x=parseInt(t.style.insetBlockStart)||0;addClass(t,"swal2-dragging")}}; +/** + * @param {MouseEvent | TouchEvent} event + */const move=e=>{const t=getPopup();if(f){let{clientX:n,clientY:o}=getClientXY(e);t.style.insetInlineStart=`${y+(n-b)}px`;t.style.insetBlockStart=`${x+(o-v)}px`}};const up=()=>{const e=getPopup();f=false;removeClass(e,"swal2-dragging")}; +/** + * @param {MouseEvent | TouchEvent} event + * @returns {{ clientX: number, clientY: number }} + */const getClientXY=e=>{let t=0,n=0;if(e.type.startsWith("mouse")){t=/** @type {MouseEvent} */e.clientX;n=/** @type {MouseEvent} */e.clientY}else if(e.type.startsWith("touch")){t=/** @type {TouchEvent} */e.touches[0].clientX;n=/** @type {TouchEvent} */e.touches[0].clientY}return{clientX:t,clientY:n}}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderPopup=(e,t)=>{const n=getContainer();const o=getPopup();if(n&&o){if(t.toast){applyNumericalStyle(n,"width",t.width);o.style.width="100%";const e=getLoader();e&&o.insertBefore(e,getIcon())}else applyNumericalStyle(o,"width",t.width);applyNumericalStyle(o,"padding",t.padding);t.color&&(o.style.color=t.color);t.background&&(o.style.background=t.background);hide(getValidationMessage());addClasses$1(o,t);if(t.draggable&&!t.toast){addClass(o,a.draggable);addDraggableListeners(o)}else{removeClass(o,a.draggable);removeDraggableListeners(o)}}}; +/** + * @param {HTMLElement} popup + * @param {SweetAlertOptions} params + */const addClasses$1=(e,t)=>{const n=t.showClass||{};e.className=`${a.popup} ${isVisible$1(e)?n.popup:""}`;if(t.toast){addClass([document.documentElement,document.body],a["toast-shown"]);addClass(e,a.toast)}else addClass(e,a.modal);applyCustomClass(e,t,"popup");typeof t.customClass==="string"&&addClass(e,t.customClass);t.icon&&addClass(e,a[`icon-${t.icon}`])}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderProgressSteps=(e,t)=>{const n=getProgressSteps();if(!n)return;const{progressSteps:o,currentProgressStep:s}=t;if(o&&o.length!==0&&s!==void 0){show(n);n.textContent="";s>=o.length&&warn("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)");o.forEach(((e,i)=>{const r=createStepElement(e);n.appendChild(r);i===s&&addClass(r,a["active-progress-step"]);if(i!==o.length-1){const e=createLineElement(t);n.appendChild(e)}}))}else hide(n)}; +/** + * @param {string} step + * @returns {HTMLLIElement} + */const createStepElement=e=>{const t=document.createElement("li");addClass(t,a["progress-step"]);setInnerHtml(t,e);return t}; +/** + * @param {SweetAlertOptions} params + * @returns {HTMLLIElement} + */const createLineElement=e=>{const t=document.createElement("li");addClass(t,a["progress-step-line"]);e.progressStepsDistance&&applyNumericalStyle(t,"width",e.progressStepsDistance);return t}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const renderTitle=(e,t)=>{const n=getTitle();if(n){showWhenInnerHtmlPresent(n);toggle(n,t.title||t.titleText,"block");t.title&&parseHtmlToContainer(t.title,n);t.titleText&&(n.innerText=t.titleText);applyCustomClass(n,t,"title")}}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const render=(e,t)=>{renderPopup(e,t);renderContainer(e,t);renderProgressSteps(e,t);renderIcon(e,t);renderImage(e,t);renderTitle(e,t);renderCloseButton(e,t);renderContent(e,t);renderActions(e,t);renderFooter(e,t);const o=getPopup();typeof t.didRender==="function"&&o&&t.didRender(o);n.eventEmitter.emit("didRender",o)};const isVisible=()=>isVisible$1(getPopup());const clickConfirm=()=>{var e;return(e=getConfirmButton())===null||e===void 0?void 0:e.click()};const clickDeny=()=>{var e;return(e=getDenyButton())===null||e===void 0?void 0:e.click()};const clickCancel=()=>{var e;return(e=getCancelButton())===null||e===void 0?void 0:e.click()}; +/** @typedef {'cancel' | 'backdrop' | 'close' | 'esc' | 'timer'} DismissReason */ +/** @type {Record} */const k=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}); +/** + * @param {GlobalState} globalState + */const removeKeydownHandler=e=>{if(e.keydownTarget&&e.keydownHandlerAdded){e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture});e.keydownHandlerAdded=false}}; +/** + * @param {GlobalState} globalState + * @param {SweetAlertOptions} innerParams + * @param {*} dismissWith + */const addKeydownHandler=(e,t,n)=>{removeKeydownHandler(e);if(!t.toast){e.keydownHandler=e=>keydownHandler(t,e,n);e.keydownTarget=t.keydownListenerCapture?window:getPopup();e.keydownListenerCapture=t.keydownListenerCapture;e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture});e.keydownHandlerAdded=true}}; +/** + * @param {number} index + * @param {number} increment + */const setFocus=(e,t)=>{var n;const o=getFocusableElements();if(o.length){e+=t;e===o.length?e=0:e===-1&&(e=o.length-1);o[e].focus()}else(n=getPopup())===null||n===void 0||n.focus()};const C=["ArrowRight","ArrowDown"];const A=["ArrowLeft","ArrowUp"]; +/** + * @param {SweetAlertOptions} innerParams + * @param {KeyboardEvent} event + * @param {Function} dismissWith + */const keydownHandler=(e,t,n)=>{if(e&&!t.isComposing&&t.keyCode!==229){e.stopKeydownPropagation&&t.stopPropagation();t.key==="Enter"?handleEnter(t,e):t.key==="Tab"?handleTab(t):[...C,...A].includes(t.key)?handleArrows(t.key):t.key==="Escape"&&handleEsc(t,e,n)}}; +/** + * @param {KeyboardEvent} event + * @param {SweetAlertOptions} innerParams + */const handleEnter=(e,t)=>{if(!callIfFunction(t.allowEnterKey))return;const n=getInput$1(getPopup(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;clickConfirm();e.preventDefault()}}; +/** + * @param {KeyboardEvent} event + */const handleTab=e=>{const t=e.target;const n=getFocusableElements();let o=-1;for(let e=0;e{const t=getActions();const n=getConfirmButton();const o=getDenyButton();const s=getCancelButton();if(!t||!n||!o||!s)return; +/** @type HTMLElement[] */const a=[n,o,s];if(document.activeElement instanceof HTMLElement&&!a.includes(document.activeElement))return;const i=C.includes(e)?"nextElementSibling":"previousElementSibling";let r=document.activeElement;if(r){for(let e=0;e{if(callIfFunction(t.allowEscapeKey)){e.preventDefault();n(k.esc)}};var E={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const setAriaHidden=()=>{const e=getContainer();const t=Array.from(document.body.children);t.forEach((t=>{if(!t.contains(e)){t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||"");t.setAttribute("aria-hidden","true")}}))};const unsetAriaHidden=()=>{const e=Array.from(document.body.children);e.forEach((e=>{if(e.hasAttribute("data-previous-aria-hidden")){e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||"");e.removeAttribute("data-previous-aria-hidden")}else e.removeAttribute("aria-hidden")}))};const B=typeof window!=="undefined"&&!!window.GestureEvent;const iOSfix=()=>{if(B&&!hasClass(document.body,a.iosfix)){const e=document.body.scrollTop;document.body.style.top=e*-1+"px";addClass(document.body,a.iosfix);lockBodyScroll()}};const lockBodyScroll=()=>{const e=getContainer();if(!e)return; +/** @type {boolean} */let t; +/** + * @param {TouchEvent} event + */e.ontouchstart=e=>{t=shouldPreventTouchMove(e)}; +/** + * @param {TouchEvent} event + */e.ontouchmove=e=>{if(t){e.preventDefault();e.stopPropagation()}}}; +/** + * @param {TouchEvent} event + * @returns {boolean} + */const shouldPreventTouchMove=e=>{const t=e.target;const n=getContainer();const o=getHtmlContainer();return!(!n||!o)&&(!isStylus(e)&&!isZoom(e)&&(t===n||!isScrollable(n)&&t instanceof HTMLElement&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&(!isScrollable(o)||!o.contains(t))))}; +/** + * https://github.com/sweetalert2/sweetalert2/issues/1786 + * + * @param {*} event + * @returns {boolean} + */const isStylus=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus"; +/** + * https://github.com/sweetalert2/sweetalert2/issues/1891 + * + * @param {TouchEvent} event + * @returns {boolean} + */const isZoom=e=>e.touches&&e.touches.length>1;const undoIOSfix=()=>{if(hasClass(document.body,a.iosfix)){const e=parseInt(document.body.style.top,10);removeClass(document.body,a.iosfix);document.body.style.top="";document.body.scrollTop=e*-1}}; +/** + * Measure scrollbar width for padding body during modal show/hide + * https://github.com/twbs/bootstrap/blob/master/js/src/modal.js + * + * @returns {number} + */const measureScrollbar=()=>{const e=document.createElement("div");e.className=a["scrollbar-measure"];document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;document.body.removeChild(e);return t}; +/** + * Remember state in cases where opening and handling a modal will fiddle with it. + * @type {number | null} + */let P=null; +/** + * @param {string} initialBodyOverflow + */const replaceScrollbarWithPadding=e=>{if(P===null&&(document.body.scrollHeight>window.innerHeight||e==="scroll")){P=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"));document.body.style.paddingRight=`${P+measureScrollbar()}px`}};const undoReplaceScrollbarWithPadding=()=>{if(P!==null){document.body.style.paddingRight=`${P}px`;P=null}}; +/** + * @param {SweetAlert} instance + * @param {HTMLElement} container + * @param {boolean} returnFocus + * @param {Function} didClose + */function removePopupAndResetState(e,t,o,s){if(isToast())triggerDidCloseAndDispose(e,s);else{restoreActiveElement(o).then((()=>triggerDidCloseAndDispose(e,s)));removeKeydownHandler(n)}if(B){t.setAttribute("style","display:none !important");t.removeAttribute("class");t.innerHTML=""}else t.remove();if(isModal()){undoReplaceScrollbarWithPadding();undoIOSfix();unsetAriaHidden()}removeBodyClasses()}function removeBodyClasses(){removeClass([document.documentElement,document.body],[a.shown,a["height-auto"],a["no-backdrop"],a["toast-shown"]])} +/** + * Instance method to close sweetAlert + * + * @param {any} resolveValue + */function close(t){t=prepareResolveValue(t);const n=E.swalPromiseResolve.get(this||e);const o=triggerClosePopup(this||e);if((this||e).isAwaitingPromise){if(!t.isDismissed){handleAwaitingPromise(this||e);n(t)}}else o&&n(t)}const triggerClosePopup=e=>{const t=getPopup();if(!t)return false;const n=w.innerParams.get(e);if(!n||hasClass(t,n.hideClass.popup))return false;removeClass(t,n.showClass.popup);addClass(t,n.hideClass.popup);const o=getContainer();removeClass(o,n.showClass.backdrop);addClass(o,n.hideClass.backdrop);handlePopupAnimation(e,t,n);return true}; +/** + * @param {any} error + */function rejectPromise(t){const n=E.swalPromiseReject.get(this||e);handleAwaitingPromise(this||e);n&&n(t)} +/** + * @param {SweetAlert} instance + */const handleAwaitingPromise=e=>{if(e.isAwaitingPromise){delete e.isAwaitingPromise;w.innerParams.get(e)||e._destroy()}}; +/** + * @param {any} resolveValue + * @returns {SweetAlertResult} + */const prepareResolveValue=e=>typeof e==="undefined"?{isConfirmed:false,isDenied:false,isDismissed:true}:Object.assign({isConfirmed:false,isDenied:false,isDismissed:false},e); +/** + * @param {SweetAlert} instance + * @param {HTMLElement} popup + * @param {SweetAlertOptions} innerParams + */const handlePopupAnimation=(e,t,o)=>{var s;const a=getContainer();const i=hasCssAnimation(t);typeof o.willClose==="function"&&o.willClose(t);(s=n.eventEmitter)===null||s===void 0||s.emit("willClose",t);i?animatePopup(e,t,a,o.returnFocus,o.didClose):removePopupAndResetState(e,a,o.returnFocus,o.didClose)}; +/** + * @param {SweetAlert} instance + * @param {HTMLElement} popup + * @param {HTMLElement} container + * @param {boolean} returnFocus + * @param {Function} didClose + */const animatePopup=(e,t,o,s,a)=>{n.swalCloseEventFinishedCallback=removePopupAndResetState.bind(null,e,o,s,a); +/** + * @param {AnimationEvent | TransitionEvent} e + */const swalCloseAnimationFinished=function(e){if(e.target===t){var o;(o=n.swalCloseEventFinishedCallback)===null||o===void 0||o.call(n);delete n.swalCloseEventFinishedCallback;t.removeEventListener("animationend",swalCloseAnimationFinished);t.removeEventListener("transitionend",swalCloseAnimationFinished)}};t.addEventListener("animationend",swalCloseAnimationFinished);t.addEventListener("transitionend",swalCloseAnimationFinished)}; +/** + * @param {SweetAlert} instance + * @param {Function} didClose + */const triggerDidCloseAndDispose=(e,t)=>{setTimeout((()=>{var o;typeof t==="function"&&t.bind(e.params)();(o=n.eventEmitter)===null||o===void 0||o.emit("didClose");e._destroy&&e._destroy()}))}; +/** + * Shows loader (spinner), this is useful with AJAX requests. + * By default the loader be shown instead of the "Confirm" button. + * + * @param {HTMLButtonElement | null} [buttonToReplace] + */const showLoading=e=>{let t=getPopup();t||new F;t=getPopup();if(!t)return;const n=getLoader();isToast()?hide(getIcon()):replaceButton(t,e);show(n);t.setAttribute("data-loading","true");t.setAttribute("aria-busy","true");t.focus()}; +/** + * @param {HTMLElement} popup + * @param {HTMLButtonElement | null} [buttonToReplace] + */const replaceButton=(e,t)=>{const n=getActions();const o=getLoader();if(n&&o){!t&&isVisible$1(getConfirmButton())&&(t=getConfirmButton());show(n);if(t){hide(t);o.setAttribute("data-button-to-replace",t.className);n.insertBefore(o,t)}addClass([e,n],a.loading)}}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const handleInputOptionsAndValue=(e,t)=>{if(t.input==="select"||t.input==="radio")handleInputOptions(e,t);else if(["text","email","number","tel","textarea"].some((e=>e===t.input))&&(hasToPromiseFn(t.inputValue)||isPromise(t.inputValue))){showLoading(getConfirmButton());handleInputValue(e,t)}}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} innerParams + * @returns {SweetAlertInputValue} + */const getInputValue=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return getCheckboxValue(n);case"radio":return getRadioValue(n);case"file":return getFileValue(n);default:return t.inputAutoTrim?n.value.trim():n.value}}; +/** + * @param {HTMLInputElement} input + * @returns {number} + */const getCheckboxValue=e=>e.checked?1:0 +/** + * @param {HTMLInputElement} input + * @returns {string | null} + */;const getRadioValue=e=>e.checked?e.value:null +/** + * @param {HTMLInputElement} input + * @returns {FileList | File | null} + */;const getFileValue=e=>e.files&&e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */;const handleInputOptions=(e,t)=>{const n=getPopup();if(!n)return; +/** + * @param {Record} inputOptions + */const processInputOptions=e=>{t.input==="select"?populateSelectOptions(n,formatInputOptions(e),t):t.input==="radio"&&populateRadioOptions(n,formatInputOptions(e),t)};if(hasToPromiseFn(t.inputOptions)||isPromise(t.inputOptions)){showLoading(getConfirmButton());asPromise(t.inputOptions).then((t=>{e.hideLoading();processInputOptions(t)}))}else typeof t.inputOptions==="object"?processInputOptions(t.inputOptions):error("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertOptions} params + */const handleInputValue=(e,t)=>{const n=e.getInput();if(n){hide(n);asPromise(t.inputValue).then((o=>{n.value=t.input==="number"?`${parseFloat(o)||0}`:`${o}`;show(n);n.focus();e.hideLoading()})).catch((t=>{error(`Error in inputValue promise: ${t}`);n.value="";show(n);n.focus();e.hideLoading()}))}}; +/** + * @param {HTMLElement} popup + * @param {InputOptionFlattened[]} inputOptions + * @param {SweetAlertOptions} params + */function populateSelectOptions(e,t,n){const o=getDirectChildByClass(e,a.select);if(!o)return; +/** + * @param {HTMLElement} parent + * @param {string} optionLabel + * @param {string} optionValue + */const renderOption=(e,t,o)=>{const s=document.createElement("option");s.value=o;setInnerHtml(s,t);s.selected=isSelected(o,n.inputValue);e.appendChild(s)};t.forEach((e=>{const t=e[0];const n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t;e.disabled=false;o.appendChild(e);n.forEach((t=>renderOption(e,t[1],t[0])))}else renderOption(o,n,t)}));o.focus()} +/** + * @param {HTMLElement} popup + * @param {InputOptionFlattened[]} inputOptions + * @param {SweetAlertOptions} params + */function populateRadioOptions(e,t,n){const o=getDirectChildByClass(e,a.radio);if(!o)return;t.forEach((e=>{const t=e[0];const s=e[1];const i=document.createElement("input");const r=document.createElement("label");i.type="radio";i.name=a.radio;i.value=t;isSelected(t,n.inputValue)&&(i.checked=true);const l=document.createElement("span");setInnerHtml(l,s);l.className=a.label;r.appendChild(i);r.appendChild(l);o.appendChild(r)}));const s=o.querySelectorAll("input");s.length&&s[0].focus()} +/** + * Converts `inputOptions` into an array of `[value, label]`s + * + * @param {Record} inputOptions + * @typedef {string[]} InputOptionFlattened + * @returns {InputOptionFlattened[]} + */const formatInputOptions=e=>{ +/** @type {InputOptionFlattened[]} */ +const t=[];e instanceof Map?e.forEach(((e,n)=>{let o=e;typeof o==="object"&&(o=formatInputOptions(o));t.push([n,o])})):Object.keys(e).forEach((n=>{let o=e[n];typeof o==="object"&&(o=formatInputOptions(o));t.push([n,o])}));return t}; +/** + * @param {string} optionValue + * @param {SweetAlertInputValue} inputValue + * @returns {boolean} + */const isSelected=(e,t)=>!!t&&t.toString()===e.toString(); +/** + * @param {SweetAlert} instance + */const handleConfirmButtonClick=e=>{const t=w.innerParams.get(e);e.disableButtons();t.input?handleConfirmOrDenyWithInput(e,"confirm"):confirm(e,true)}; +/** + * @param {SweetAlert} instance + */const handleDenyButtonClick=e=>{const t=w.innerParams.get(e);e.disableButtons();t.returnInputValueOnDeny?handleConfirmOrDenyWithInput(e,"deny"):deny(e,false)}; +/** + * @param {SweetAlert} instance + * @param {Function} dismissWith + */const handleCancelButtonClick=(e,t)=>{e.disableButtons();t(k.cancel)}; +/** + * @param {SweetAlert} instance + * @param {'confirm' | 'deny'} type + */const handleConfirmOrDenyWithInput=(e,t)=>{const n=w.innerParams.get(e);if(!n.input){error(`The "input" parameter is needed to be set when using returnInputValueOn${capitalizeFirstLetter(t)}`);return}const o=e.getInput();const s=getInputValue(e,n);if(n.inputValidator)handleInputValidator(e,s,t);else if(o&&!o.checkValidity()){e.enableButtons();e.showValidationMessage(n.validationMessage||o.validationMessage)}else t==="deny"?deny(e,s):confirm(e,s)}; +/** + * @param {SweetAlert} instance + * @param {SweetAlertInputValue} inputValue + * @param {'confirm' | 'deny'} type + */const handleInputValidator=(e,t,n)=>{const o=w.innerParams.get(e);e.disableInput();const s=Promise.resolve().then((()=>asPromise(o.inputValidator(t,o.validationMessage))));s.then((o=>{e.enableButtons();e.enableInput();o?e.showValidationMessage(o):n==="deny"?deny(e,t):confirm(e,t)}))}; +/** + * @param {SweetAlert} instance + * @param {any} value + */const deny=(e,t)=>{const n=w.innerParams.get(e||void 0);n.showLoaderOnDeny&&showLoading(getDenyButton());if(n.preDeny){e.isAwaitingPromise=true;const o=Promise.resolve().then((()=>asPromise(n.preDeny(t,n.validationMessage))));o.then((n=>{if(n===false){e.hideLoading();handleAwaitingPromise(e)}else e.close({isDenied:true,value:typeof n==="undefined"?t:n})})).catch((t=>rejectWith(e||void 0,t)))}else e.close({isDenied:true,value:t})}; +/** + * @param {SweetAlert} instance + * @param {any} value + */const succeedWith=(e,t)=>{e.close({isConfirmed:true,value:t})}; +/** + * + * @param {SweetAlert} instance + * @param {string} error + */const rejectWith=(e,t)=>{e.rejectPromise(t)}; +/** + * + * @param {SweetAlert} instance + * @param {any} value + */const confirm=(e,t)=>{const n=w.innerParams.get(e||void 0);n.showLoaderOnConfirm&&showLoading();if(n.preConfirm){e.resetValidationMessage();e.isAwaitingPromise=true;const o=Promise.resolve().then((()=>asPromise(n.preConfirm(t,n.validationMessage))));o.then((n=>{if(isVisible$1(getValidationMessage())||n===false){e.hideLoading();handleAwaitingPromise(e)}else succeedWith(e,typeof n==="undefined"?t:n)})).catch((t=>rejectWith(e||void 0,t)))}else succeedWith(e,t)};function hideLoading(){const t=w.innerParams.get(this||e);if(!t)return;const n=w.domCache.get(this||e);hide(n.loader);isToast()?t.icon&&show(getIcon()):showRelatedButton(n);removeClass([n.popup,n.actions],a.loading);n.popup.removeAttribute("aria-busy");n.popup.removeAttribute("data-loading");n.confirmButton.disabled=false;n.denyButton.disabled=false;n.cancelButton.disabled=false}const showRelatedButton=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?show(t[0],"inline-block"):allButtonsAreHidden()&&hide(e.actions)}; +/** + * Gets the input DOM node, this method works with input parameter. + * + * @returns {HTMLInputElement | null} + */function getInput(){const t=w.innerParams.get(this||e);const n=w.domCache.get(this||e);return n?getInput$1(n.popup,t.input):null} +/** + * @param {SweetAlert} instance + * @param {string[]} buttons + * @param {boolean} disabled + */function setButtonsDisabled(e,t,n){const o=w.domCache.get(e);t.forEach((e=>{o[e].disabled=n}))} +/** + * @param {HTMLInputElement | null} input + * @param {boolean} disabled + */function setInputDisabled(e,t){const n=getPopup();if(n&&e)if(e.type==="radio"){ +/** @type {NodeListOf} */ +const e=n.querySelectorAll(`[name="${a.radio}"]`);for(let n=0;n} */const S={allowEnterKey:void 0};const T=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"]; +/** + * Is valid parameter + * + * @param {string} paramName + * @returns {boolean} + */const isValidParameter=e=>Object.prototype.hasOwnProperty.call($,e); +/** + * Is valid parameter for Swal.update() method + * + * @param {string} paramName + * @returns {boolean} + */const isUpdatableParameter=e=>L.indexOf(e)!==-1; +/** + * Is deprecated parameter + * + * @param {string} paramName + * @returns {string | undefined} + */const isDeprecatedParameter=e=>S[e]; +/** + * @param {string} param + */const checkIfParamIsValid=e=>{isValidParameter(e)||warn(`Unknown parameter "${e}"`)}; +/** + * @param {string} param + */const checkIfToastParamIsValid=e=>{T.includes(e)&&warn(`The parameter "${e}" is incompatible with toasts`)}; +/** + * @param {string} param + */const checkIfParamIsDeprecated=e=>{const t=isDeprecatedParameter(e);t&&warnAboutDeprecation(e,t)}; +/** + * Show relevant warnings for given params + * + * @param {SweetAlertOptions} params + */const showWarningsForParams=e=>{e.backdrop===false&&e.allowOutsideClick&&warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e){checkIfParamIsValid(t);e.toast&&checkIfToastParamIsValid(t);checkIfParamIsDeprecated(t)}}; +/** + * Updates popup parameters. + * + * @param {SweetAlertOptions} params + */function update(t){const n=getPopup();const o=w.innerParams.get(this||e);if(!n||hasClass(n,o.hideClass.popup)){warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");return}const s=filterValidParams(t);const a=Object.assign({},o,s);render(this||e,a);w.innerParams.set(this||e,a);Object.defineProperties(this||e,{params:{value:Object.assign({},(this||e).params,t),writable:false,enumerable:true}})} +/** + * @param {SweetAlertOptions} params + * @returns {SweetAlertOptions} + */const filterValidParams=e=>{const t={};Object.keys(e).forEach((n=>{isUpdatableParameter(n)?t[n]=e[n]:warn(`Invalid parameter to update: ${n}`)}));return t};function _destroy(){const t=w.domCache.get(this||e);const o=w.innerParams.get(this||e);if(o){if(t.popup&&n.swalCloseEventFinishedCallback){n.swalCloseEventFinishedCallback();delete n.swalCloseEventFinishedCallback}typeof o.didDestroy==="function"&&o.didDestroy();n.eventEmitter.emit("didDestroy");disposeSwal(this||e)}else disposeWeakMaps(this||e)} +/** + * @param {SweetAlert} instance + */const disposeSwal=e=>{disposeWeakMaps(e);delete e.params;delete n.keydownHandler;delete n.keydownTarget;delete n.currentInstance}; +/** + * @param {SweetAlert} instance + */const disposeWeakMaps=e=>{if(e.isAwaitingPromise){unsetWeakMaps(w,e);e.isAwaitingPromise=true}else{unsetWeakMaps(E,e);unsetWeakMaps(w,e);delete e.isAwaitingPromise;delete e.disableButtons;delete e.enableButtons;delete e.getInput;delete e.disableInput;delete e.enableInput;delete e.hideLoading;delete e.disableLoading;delete e.showValidationMessage;delete e.resetValidationMessage;delete e.close;delete e.closePopup;delete e.closeModal;delete e.closeToast;delete e.rejectPromise;delete e.update;delete e._destroy}}; +/** + * @param {object} obj + * @param {SweetAlert} instance + */const unsetWeakMaps=(e,t)=>{for(const n in e)e[n].delete(t)};var O=Object.freeze({__proto__:null,_destroy:_destroy,close:close,closeModal:close,closePopup:close,closeToast:close,disableButtons:disableButtons,disableInput:disableInput,disableLoading:hideLoading,enableButtons:enableButtons,enableInput:enableInput,getInput:getInput,handleAwaitingPromise:handleAwaitingPromise,hideLoading:hideLoading,rejectPromise:rejectPromise,resetValidationMessage:resetValidationMessage,showValidationMessage:showValidationMessage,update:update}); +/** + * @param {SweetAlertOptions} innerParams + * @param {DomCache} domCache + * @param {Function} dismissWith + */const handlePopupClick=(e,t,n)=>{if(e.toast)handleToastClick(e,t,n);else{handleModalMousedown(t);handleContainerMousedown(t);handleModalClick(e,t,n)}}; +/** + * @param {SweetAlertOptions} innerParams + * @param {DomCache} domCache + * @param {Function} dismissWith + */const handleToastClick=(e,t,n)=>{t.popup.onclick=()=>{e&&(isAnyButtonShown(e)||e.timer||e.input)||n(k.close)}}; +/** + * @param {SweetAlertOptions} innerParams + * @returns {boolean} + */const isAnyButtonShown=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let I=false; +/** + * @param {DomCache} domCache + */const handleModalMousedown=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{};t.target===e.container&&(I=true)}}}; +/** + * @param {DomCache} domCache + */const handleContainerMousedown=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault();e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{};(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(I=true)}}}; +/** + * @param {SweetAlertOptions} innerParams + * @param {DomCache} domCache + * @param {Function} dismissWith + */const handleModalClick=(e,t,n)=>{t.container.onclick=o=>{I?I=false:o.target===t.container&&callIfFunction(e.allowOutsideClick)&&n(k.backdrop)}};const isJqueryElement=e=>typeof e==="object"&&e.jquery;const isElement=e=>e instanceof Element||isJqueryElement(e);const argsToParams=e=>{const t={};typeof e[0]!=="object"||isElement(e[0])?["title","html","icon"].forEach(((n,o)=>{const s=e[o];typeof s==="string"||isElement(s)?t[n]=s:s!==void 0&&error(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`)})):Object.assign(t,e[0]);return t}; +/** + * Main method to create a new SweetAlert2 popup + * + * @param {...SweetAlertOptions} args + * @returns {Promise} + */function fire(){for(var t=arguments.length,n=new Array(t),o=0;on.timeout&&n.timeout.getTimerLeft(); +/** + * Stop timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + * + * @returns {number | undefined} + */const stopTimer=()=>{if(n.timeout){stopTimerProgressBar();return n.timeout.stop()}}; +/** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + * + * @returns {number | undefined} + */const resumeTimer=()=>{if(n.timeout){const e=n.timeout.start();animateTimerProgressBar(e);return e}}; +/** + * Resume timer. Returns number of milliseconds of timer remained. + * If `timer` parameter isn't set, returns undefined. + * + * @returns {number | undefined} + */const toggleTimer=()=>{const e=n.timeout;return e&&(e.running?stopTimer():resumeTimer())}; +/** + * Increase timer. Returns number of milliseconds of an updated timer. + * If `timer` parameter isn't set, returns undefined. + * + * @param {number} ms + * @returns {number | undefined} + */const increaseTimer=e=>{if(n.timeout){const t=n.timeout.increase(e);animateTimerProgressBar(t,true);return t}}; +/** + * Check if timer is running. Returns true if timer is running + * or false if timer is paused or stopped. + * If `timer` parameter isn't set, returns undefined + * + * @returns {boolean} + */const isTimerRunning=()=>!!(n.timeout&&n.timeout.isRunning());let M=false;const j={}; +/** + * @param {string} attr + */function bindClickHandler(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";j[t]=this||e;if(!M){document.body.addEventListener("click",bodyClickListener);M=true}}const bodyClickListener=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in j){const n=t.getAttribute(e);if(n){j[e].fire({template:n});return}}};class EventEmitter{constructor(){ +/** @type {Events} */ +this.events={}} +/** + * @param {string} eventName + * @returns {EventHandlers} + */_getHandlersByEventName(e){typeof this.events[e]==="undefined"&&(this.events[e]=[]);return this.events[e]} +/** + * @param {string} eventName + * @param {EventHandler} eventHandler + */on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)} +/** + * @param {string} eventName + * @param {EventHandler} eventHandler + */once(e,t){var n=this; +/** + * @param {Array} args + */const onceFn=function(){n.removeListener(e,onceFn);for(var o=arguments.length,s=new Array(o),a=0;a1?t-1:0),o=1;o{try{e.apply(this,n)}catch(e){console.error(e)}}))} +/** + * @param {string} eventName + * @param {EventHandler} eventHandler + */removeListener(e,t){const n=this._getHandlersByEventName(e);const o=n.indexOf(t);o>-1&&n.splice(o,1)} +/** + * @param {string} eventName + */removeAllListeners(e){this.events[e]!==void 0&&(this.events[e].length=0)}reset(){this.events={}}}n.eventEmitter=new EventEmitter; +/** + * @param {string} eventName + * @param {EventHandler} eventHandler + */const on=(e,t)=>{n.eventEmitter.on(e,t)}; +/** + * @param {string} eventName + * @param {EventHandler} eventHandler + */const once=(e,t)=>{n.eventEmitter.once(e,t)}; +/** + * @param {string} [eventName] + * @param {EventHandler} [eventHandler] + */const off=(e,t)=>{e?t?n.eventEmitter.removeListener(e,t):n.eventEmitter.removeAllListeners(e):n.eventEmitter.reset()};var H=Object.freeze({__proto__:null,argsToParams:argsToParams,bindClickHandler:bindClickHandler,clickCancel:clickCancel,clickConfirm:clickConfirm,clickDeny:clickDeny,enableLoading:showLoading,fire:fire,getActions:getActions,getCancelButton:getCancelButton,getCloseButton:getCloseButton,getConfirmButton:getConfirmButton,getContainer:getContainer,getDenyButton:getDenyButton,getFocusableElements:getFocusableElements,getFooter:getFooter,getHtmlContainer:getHtmlContainer,getIcon:getIcon,getIconContent:getIconContent,getImage:getImage,getInputLabel:getInputLabel,getLoader:getLoader,getPopup:getPopup,getProgressSteps:getProgressSteps,getTimerLeft:getTimerLeft,getTimerProgressBar:getTimerProgressBar,getTitle:getTitle,getValidationMessage:getValidationMessage,increaseTimer:increaseTimer,isDeprecatedParameter:isDeprecatedParameter,isLoading:isLoading,isTimerRunning:isTimerRunning,isUpdatableParameter:isUpdatableParameter,isValidParameter:isValidParameter,isVisible:isVisible,mixin:mixin,off:off,on:on,once:once,resumeTimer:resumeTimer,showLoading:showLoading,stopTimer:stopTimer,toggleTimer:toggleTimer});class Timer{ +/** + * @param {Function} callback + * @param {number} delay + */ +constructor(e,t){this.callback=e;this.remaining=t;this.running=false;this.start()} +/** + * @returns {number} + */start(){if(!this.running){this.running=true;this.started=new Date;this.id=setTimeout(this.callback,this.remaining)}return this.remaining} +/** + * @returns {number} + */stop(){if(this.started&&this.running){this.running=false;clearTimeout(this.id);this.remaining-=(new Date).getTime()-this.started.getTime()}return this.remaining} +/** + * @param {number} n + * @returns {number} + */increase(e){const t=this.running;t&&this.stop();this.remaining+=e;t&&this.start();return this.remaining} +/** + * @returns {number} + */getTimerLeft(){if(this.running){this.stop();this.start()}return this.remaining} +/** + * @returns {boolean} + */isRunning(){return this.running}}const z=["swal-title","swal-html","swal-footer"]; +/** + * @param {SweetAlertOptions} params + * @returns {SweetAlertOptions} + */const getTemplateParams=e=>{const t=typeof e.template==="string"?/** @type {HTMLTemplateElement} */document.querySelector(e.template):e.template;if(!t)return{}; +/** @type {DocumentFragment} */const n=t.content;showWarningsForElements(n);const o=Object.assign(getSwalParams(n),getSwalFunctionParams(n),getSwalButtons(n),getSwalImage(n),getSwalIcon(n),getSwalInput(n),getSwalStringParams(n,z));return o}; +/** + * @param {DocumentFragment} templateContent + * @returns {Record} + */const getSwalParams=e=>{ +/** @type {Record} */ +const t={}; +/** @type {HTMLElement[]} */const n=Array.from(e.querySelectorAll("swal-param"));n.forEach((e=>{showWarningsForAttributes(e,["name","value"]);const n=/** @type {keyof SweetAlertOptions} */e.getAttribute("name");const o=e.getAttribute("value");n&&o&&(typeof $[n]==="boolean"?t[n]=o!=="false":typeof $[n]==="object"?t[n]=JSON.parse(o):t[n]=o)}));return t}; +/** + * @param {DocumentFragment} templateContent + * @returns {Record} + */const getSwalFunctionParams=e=>{ +/** @type {Record} */ +const t={}; +/** @type {HTMLElement[]} */const n=Array.from(e.querySelectorAll("swal-function-param"));n.forEach((e=>{const n=/** @type {keyof SweetAlertOptions} */e.getAttribute("name");const o=e.getAttribute("value");n&&o&&(t[n]=new Function(`return ${o}`)())}));return t}; +/** + * @param {DocumentFragment} templateContent + * @returns {Record} + */const getSwalButtons=e=>{ +/** @type {Record} */ +const t={}; +/** @type {HTMLElement[]} */const n=Array.from(e.querySelectorAll("swal-button"));n.forEach((e=>{showWarningsForAttributes(e,["type","color","aria-label"]);const n=e.getAttribute("type");if(n&&["confirm","cancel","deny"].includes(n)){t[`${n}ButtonText`]=e.innerHTML;t[`show${capitalizeFirstLetter(n)}Button`]=true;e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color"));e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label"))}}));return t}; +/** + * @param {DocumentFragment} templateContent + * @returns {Pick} + */const getSwalImage=e=>{const t={}; +/** @type {HTMLElement | null} */const n=e.querySelector("swal-image");if(n){showWarningsForAttributes(n,["src","width","height","alt"]);n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0);n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0);n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0);n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)}return t}; +/** + * @param {DocumentFragment} templateContent + * @returns {Record} + */const getSwalIcon=e=>{const t={}; +/** @type {HTMLElement | null} */const n=e.querySelector("swal-icon");if(n){showWarningsForAttributes(n,["type","color"]);n.hasAttribute("type")&&(t.icon=n.getAttribute("type"));n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color"));t.iconHtml=n.innerHTML}return t}; +/** + * @param {DocumentFragment} templateContent + * @returns {Record} + */const getSwalInput=e=>{ +/** @type {Record} */ +const t={}; +/** @type {HTMLElement | null} */const n=e.querySelector("swal-input");if(n){showWarningsForAttributes(n,["type","label","placeholder","value"]);t.input=n.getAttribute("type")||"text";n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label"));n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder"));n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value"))} +/** @type {HTMLElement[]} */const o=Array.from(e.querySelectorAll("swal-input-option"));if(o.length){t.inputOptions={};o.forEach((e=>{showWarningsForAttributes(e,["value"]);const n=e.getAttribute("value");if(!n)return;const o=e.innerHTML;t.inputOptions[n]=o}))}return t}; +/** + * @param {DocumentFragment} templateContent + * @param {string[]} paramNames + * @returns {Record} + */const getSwalStringParams=(e,t)=>{ +/** @type {Record} */ +const n={};for(const o in t){const s=t[o]; +/** @type {HTMLElement | null} */const a=e.querySelector(s);if(a){showWarningsForAttributes(a,[]);n[s.replace(/^swal-/,"")]=a.innerHTML.trim()}}return n}; +/** + * @param {DocumentFragment} templateContent + */const showWarningsForElements=e=>{const t=z.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||warn(`Unrecognized element <${n}>`)}))}; +/** + * @param {HTMLElement} el + * @param {string[]} allowedAttributes + */const showWarningsForAttributes=(e,t)=>{Array.from(e.attributes).forEach((n=>{t.indexOf(n.name)===-1&&warn([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))};const D=10; +/** + * Open popup, add necessary classes and styles, fix scrollbar + * + * @param {SweetAlertOptions} params + */const openPopup=e=>{const t=getContainer();const o=getPopup();typeof e.willOpen==="function"&&e.willOpen(o);n.eventEmitter.emit("willOpen",o);const s=window.getComputedStyle(document.body);const i=s.overflowY;addClasses(t,o,e);setTimeout((()=>{setScrollingVisibility(t,o)}),D);if(isModal()){fixScrollContainer(t,e.scrollbarPadding,i);setAriaHidden()}isToast()||n.previousActiveElement||(n.previousActiveElement=document.activeElement);typeof e.didOpen==="function"&&setTimeout((()=>e.didOpen(o)));n.eventEmitter.emit("didOpen",o);removeClass(t,a["no-transition"])}; +/** + * @param {AnimationEvent} event + */const swalOpenAnimationFinished=e=>{const t=getPopup();if(e.target!==t)return;const n=getContainer();t.removeEventListener("animationend",swalOpenAnimationFinished);t.removeEventListener("transitionend",swalOpenAnimationFinished);n.style.overflowY="auto"}; +/** + * @param {HTMLElement} container + * @param {HTMLElement} popup + */const setScrollingVisibility=(e,t)=>{if(hasCssAnimation(t)){e.style.overflowY="hidden";t.addEventListener("animationend",swalOpenAnimationFinished);t.addEventListener("transitionend",swalOpenAnimationFinished)}else e.style.overflowY="auto"}; +/** + * @param {HTMLElement} container + * @param {boolean} scrollbarPadding + * @param {string} initialBodyOverflow + */const fixScrollContainer=(e,t,n)=>{iOSfix();t&&n!=="hidden"&&replaceScrollbarWithPadding(n);setTimeout((()=>{e.scrollTop=0}))}; +/** + * @param {HTMLElement} container + * @param {HTMLElement} popup + * @param {SweetAlertOptions} params + */const addClasses=(e,t,n)=>{addClass(e,n.showClass.backdrop);if(n.animation){t.style.setProperty("opacity","0","important");show(t,"grid");setTimeout((()=>{addClass(t,n.showClass.popup);t.style.removeProperty("opacity")}),D)}else show(t,"grid");addClass([document.documentElement,document.body],a.shown);n.heightAuto&&n.backdrop&&!n.toast&&addClass([document.documentElement,document.body],a["height-auto"])};var V={ +/** + * @param {string} string + * @param {string} [validationMessage] + * @returns {Promise} + */ +email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"), +/** + * @param {string} string + * @param {string} [validationMessage] + * @returns {Promise} + */ +url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")}; +/** + * @param {SweetAlertOptions} params + */function setDefaultInputValidators(e){if(!e.inputValidator){e.input==="email"&&(e.inputValidator=V.email);e.input==="url"&&(e.inputValidator=V.url)}} +/** + * @param {SweetAlertOptions} params + */function validateCustomTargetElement(e){if(!e.target||typeof e.target==="string"&&!document.querySelector(e.target)||typeof e.target!=="string"&&!e.target.appendChild){warn('Target parameter is not valid, defaulting to "body"');e.target="body"}} +/** + * Set type, text and actions on popup + * + * @param {SweetAlertOptions} params + */function setParameters(e){setDefaultInputValidators(e);e.showLoaderOnConfirm&&!e.preConfirm&&warn("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request");validateCustomTargetElement(e);typeof e.title==="string"&&(e.title=e.title.split("\n").join("
    "));init(e)} +/** @type {SweetAlert} */let q;var _=new WeakMap;class SweetAlert{ +/** + * @param {...any} args + * @this {SweetAlert} + */ +constructor(){ +/** + * @type {Promise} + */ +_classPrivateFieldInitSpec(this,_,void 0);if(typeof window==="undefined")return;q=this;for(var e=arguments.length,t=new Array(e),n=0;n} */this.params=o; +/** @type {boolean} */this.isAwaitingPromise=false;_classPrivateFieldSet2(_,this,this._main(q.params))}_main(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};showWarningsForParams(Object.assign({},t,e));if(n.currentInstance){const e=E.swalPromiseResolve.get(n.currentInstance);const{isAwaitingPromise:t}=n.currentInstance;n.currentInstance._destroy();t||e({isDismissed:true});isModal()&&unsetAriaHidden()}n.currentInstance=q;const o=prepareParams(e,t);setParameters(o);Object.freeze(o);if(n.timeout){n.timeout.stop();delete n.timeout}clearTimeout(n.restoreFocusTimeout);const s=populateDomCache(q);render(q,o);w.innerParams.set(q,o);return swalPromise(q,s,o)}then(e){return _classPrivateFieldGet2(_,this).then(e)}finally(e){return _classPrivateFieldGet2(_,this).finally(e)}} +/** + * @param {SweetAlert} instance + * @param {DomCache} domCache + * @param {SweetAlertOptions} innerParams + * @returns {Promise} + */const swalPromise=(e,t,o)=>new Promise(((s,a)=>{ +/** + * @param {DismissReason} dismiss + */ +const dismissWith=t=>{e.close({isDismissed:true,dismiss:t})};E.swalPromiseResolve.set(e,s);E.swalPromiseReject.set(e,a);t.confirmButton.onclick=()=>{handleConfirmButtonClick(e)};t.denyButton.onclick=()=>{handleDenyButtonClick(e)};t.cancelButton.onclick=()=>{handleCancelButtonClick(e,dismissWith)};t.closeButton.onclick=()=>{dismissWith(k.close)};handlePopupClick(o,t,dismissWith);addKeydownHandler(n,o,dismissWith);handleInputOptionsAndValue(e,o);openPopup(o);setupTimer(n,o,dismissWith);initFocus(t,o);setTimeout((()=>{t.container.scrollTop=0}))})); +/** + * @param {SweetAlertOptions} userParams + * @param {SweetAlertOptions} mixinParams + * @returns {SweetAlertOptions} + */const prepareParams=(e,t)=>{const n=getTemplateParams(e);const o=Object.assign({},$,t,n,e);o.showClass=Object.assign({},$.showClass,o.showClass);o.hideClass=Object.assign({},$.hideClass,o.hideClass);if(o.animation===false){o.showClass={backdrop:"swal2-noanimation"};o.hideClass={}}return o}; +/** + * @param {SweetAlert} instance + * @returns {DomCache} + */const populateDomCache=e=>{const t={popup:getPopup(),container:getContainer(),actions:getActions(),confirmButton:getConfirmButton(),denyButton:getDenyButton(),cancelButton:getCancelButton(),loader:getLoader(),closeButton:getCloseButton(),validationMessage:getValidationMessage(),progressSteps:getProgressSteps()};w.domCache.set(e,t);return t}; +/** + * @param {GlobalState} globalState + * @param {SweetAlertOptions} innerParams + * @param {Function} dismissWith + */const setupTimer=(e,t,n)=>{const o=getTimerProgressBar();hide(o);if(t.timer){e.timeout=new Timer((()=>{n("timer");delete e.timeout}),t.timer);if(t.timerProgressBar){show(o);applyCustomClass(o,t,"timerProgressBar");setTimeout((()=>{e.timeout&&e.timeout.running&&animateTimerProgressBar(t.timer)}))}}}; +/** + * Initialize focus in the popup: + * + * 1. If `toast` is `true`, don't steal focus from the document. + * 2. Else if there is an [autofocus] element, focus it. + * 3. Else if `focusConfirm` is `true` and confirm button is visible, focus it. + * 4. Else if `focusDeny` is `true` and deny button is visible, focus it. + * 5. Else if `focusCancel` is `true` and cancel button is visible, focus it. + * 6. Else focus the first focusable element in a popup (if any). + * + * @param {DomCache} domCache + * @param {SweetAlertOptions} innerParams + */const initFocus=(e,t)=>{if(!t.toast)if(callIfFunction(t.allowEnterKey))focusAutofocus(e)||focusButton(e,t)||setFocus(-1,1);else{warnAboutDeprecation("allowEnterKey");blurActiveElement()}}; +/** + * @param {DomCache} domCache + * @returns {boolean} + */const focusAutofocus=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&isVisible$1(e)){e.focus();return true}return false}; +/** + * @param {DomCache} domCache + * @param {SweetAlertOptions} innerParams + * @returns {boolean} + */const focusButton=(e,t)=>{if(t.focusDeny&&isVisible$1(e.denyButton)){e.denyButton.focus();return true}if(t.focusCancel&&isVisible$1(e.cancelButton)){e.cancelButton.focus();return true}if(t.focusConfirm&&isVisible$1(e.confirmButton)){e.confirmButton.focus();return true}return false};const blurActiveElement=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur==="function"&&document.activeElement.blur()};if(typeof window!=="undefined"&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date;const t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3";e.loop=true;document.body.appendChild(e);setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}SweetAlert.prototype.disableButtons=disableButtons;SweetAlert.prototype.enableButtons=enableButtons;SweetAlert.prototype.getInput=getInput;SweetAlert.prototype.disableInput=disableInput;SweetAlert.prototype.enableInput=enableInput;SweetAlert.prototype.hideLoading=hideLoading;SweetAlert.prototype.disableLoading=hideLoading;SweetAlert.prototype.showValidationMessage=showValidationMessage;SweetAlert.prototype.resetValidationMessage=resetValidationMessage;SweetAlert.prototype.close=close;SweetAlert.prototype.closePopup=close;SweetAlert.prototype.closeModal=close;SweetAlert.prototype.closeToast=close;SweetAlert.prototype.rejectPromise=rejectPromise;SweetAlert.prototype.update=update;SweetAlert.prototype._destroy=_destroy;Object.assign(SweetAlert,H);Object.keys(O).forEach((e=>{ +/** + * @param {...any} args + * @returns {any | undefined} + */ +SweetAlert[e]=function(){return q&&q[e]?q[e](...arguments):null}}));SweetAlert.DismissReason=k;SweetAlert.version="11.15.10";const F=SweetAlert;F.default=F;return F}));typeof t!=="undefined"&&t.Sweetalert2&&(t.swal=t.sweetAlert=t.Swal=t.SweetAlert=t.Sweetalert2);"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}');var n=t;export{n as default}; + From 819cb997776d846bd1793ca9c6f69b18a6b646ec Mon Sep 17 00:00:00 2001 From: Sean Marcia Date: Thu, 16 Jan 2025 19:50:48 -0500 Subject: [PATCH 03/11] Wip --- .../controllers/flash_controller.js | 26 +++++++++++++++++++ app/views/layouts/application.html.erb | 9 +++++-- app/views/regions/show.html.erb | 3 --- 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 app/javascript/controllers/flash_controller.js diff --git a/app/javascript/controllers/flash_controller.js b/app/javascript/controllers/flash_controller.js new file mode 100644 index 0000000..026f37e --- /dev/null +++ b/app/javascript/controllers/flash_controller.js @@ -0,0 +1,26 @@ +import { Controller } from "@hotwired/stimulus" +import Swal from 'sweetalert2' + +export default class extends Controller { + static values = { + message: String, + type: String + } + + connect() { + if (this.messageValue) { + const Toast = Swal.mixin({ + toast: true, + position: 'top-end', + showConfirmButton: false, + timer: 3000, + timerProgressBar: true + }) + + Toast.fire({ + icon: this.typeValue || 'success', + title: this.messageValue + }) + } + } +} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b941546..34992f3 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -77,10 +77,15 @@
    - <%= sidebar %> - + <%= sidebar %>