From 0cefc629b0f86c43957d72a338fbfcee6f321abf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:47:01 +0000 Subject: [PATCH 01/16] chore(deps): update dependency sass-loader to v14.1.1 --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2622246..5ee08b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4534,9 +4534,9 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sass-loader@^14.0.0: - version "14.1.0" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-14.1.0.tgz#43ba90e0cd8a15a1e932e818c525b0115a0ce8a3" - integrity sha512-LS2mLeFWA+orYxHNu+O18Xe4jR0kyamNOOUsE3NyBP4DvIL+8stHpNX0arYTItdPe80kluIiJ7Wfe/9iHSRO0Q== + version "14.1.1" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-14.1.1.tgz#2c9d2277c5b1c5fe789cd0570c046d8ad23cb7ca" + integrity sha512-QX8AasDg75monlybel38BZ49JP5Z+uSKfKwF2rO7S74BywaRmGQMUBw9dtkS+ekyM/QnP+NOrRYq8ABMZ9G8jw== dependencies: neo-async "^2.6.2" From c046d650b7c757e0d77839069d726419df7d779d Mon Sep 17 00:00:00 2001 From: Andrii Date: Tue, 20 Feb 2024 13:08:25 +0200 Subject: [PATCH 02/16] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7b4ba48..bd6ece5 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ ## Want to know more? [Please check](https://github.com/timber/timber) +For woocommerce [check](https://github.com/lastofpudge/wp-theme/tree/feature/woocommerce-integration) ## How to Use From d6dbd473f83aec125e5cfca9452729f159e55c36 Mon Sep 17 00:00:00 2001 From: Andrii Date: Tue, 20 Feb 2024 17:13:22 +0200 Subject: [PATCH 03/16] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd6ece5..5324f4f 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,9 @@ - Easy deployment on hosting platforms with [All-in-One WP Migration](https://wordpress.org/plugins/all-in-one-wp-migration/) plugin. 🚀 ## Want to know more? -[Please check](https://github.com/timber/timber) -For woocommerce [check](https://github.com/lastofpudge/wp-theme/tree/feature/woocommerce-integration) +[Timber](https://github.com/timber/timber) + +For woocommerce please [check](https://github.com/lastofpudge/wp-theme/tree/feature/woocommerce-integration) ## How to Use From 54bb518a5306e992ff53966d4c0a1fc157b7ec63 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 03:20:36 +0000 Subject: [PATCH 04/16] chore(deps): update dependency sass to v1.71.1 --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 810d35a..a58a708 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4729,9 +4729,9 @@ sass-loader@^14.0.0: neo-async "^2.6.2" sass@^1.70.0: - version "1.71.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.71.0.tgz#b3085759b9b2ab503a977aecb7e91153bf941117" - integrity sha512-HKKIKf49Vkxlrav3F/w6qRuPcmImGVbIXJ2I3Kg0VMA+3Bav+8yE9G5XmP5lMj6nl4OlqbPftGAscNaNu28b8w== + version "1.71.1" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.71.1.tgz#dfb09c63ce63f89353777bbd4a88c0a38386ee54" + integrity sha512-wovtnV2PxzteLlfNzbgm1tFXPLoZILYAMJtvoXXkD7/+1uP41eKkIt1ypWq5/q2uT94qHjXehEYfmjKOvjL9sg== dependencies: chokidar ">=3.0.0 <4.0.0" immutable "^4.0.0" From 48f0828a279539d34047bd996f699bebf6fd1ec8 Mon Sep 17 00:00:00 2001 From: lastofpudge Date: Wed, 21 Feb 2024 12:40:20 +0200 Subject: [PATCH 05/16] fix: header links --- composer.json | 2 +- resources/views/components/header.twig | 8 ++++---- style.css | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index d7b5ce9..6a966a1 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "theme/blank", "type": "wp-theme", - "version": "2.0.17", + "version": "2.0.18", "description": "Wordpress starter theme with Timber/Twig", "license": "GPL-3.0-or-later", "authors": [ diff --git a/resources/views/components/header.twig b/resources/views/components/header.twig index d1cafd5..2f7b66e 100644 --- a/resources/views/components/header.twig +++ b/resources/views/components/header.twig @@ -2,20 +2,20 @@
-
{% endfor %} {% include 'components/pagination.twig' %} + {% endblock %} diff --git a/style.css b/style.css index e1d1e50..2a096ff 100644 --- a/style.css +++ b/style.css @@ -1,7 +1,7 @@ /* Theme Name: wp-theme Theme URI:https://github.com/lastofpudge/wp-theme -Version: 2.0.19 +Version: 2.0.20 License: GNU General Public License v3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html Requires PHP: 8.0 From 22485aea103e1d93c437839e43961d9711c9ee28 Mon Sep 17 00:00:00 2001 From: lastofpudge Date: Thu, 22 Feb 2024 10:29:57 +0200 Subject: [PATCH 08/16] fix: tiny fix read more --- resources/views/pages/list.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/pages/list.twig b/resources/views/pages/list.twig index 613ff48..5e77d2b 100644 --- a/resources/views/pages/list.twig +++ b/resources/views/pages/list.twig @@ -10,7 +10,7 @@ {% if post.thumbnail %} {{ post.title }} {% else %} - {{ post.excerpt(20, false, '', true) }} + {{ post.excerpt({ words: 20, read_more: '' }) }}
{% endfor %} From 29593ffc6ebcc4e7f82161521ce11dd925c7f466 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 09:46:58 +0000 Subject: [PATCH 09/16] chore(deps): update dependency git-commit-msg-linter to v5.0.7 --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3bea07c..6aa4d25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2941,9 +2941,9 @@ get-stream@^6.0.0: integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== git-commit-msg-linter@^5.0.0: - version "5.0.6" - resolved "https://registry.yarnpkg.com/git-commit-msg-linter/-/git-commit-msg-linter-5.0.6.tgz#cb055c0c340d5e3e0acf8d8ff979a29c2cf039a6" - integrity sha512-Lp8JpY9JWHkBriZ37ln83DGK0iYQRx9dTJ4ut83XF+kBAc+kDtRU9GL5b8Cd9oujr5F3NYG+LWwZc3tYXZRK+w== + version "5.0.7" + resolved "https://registry.yarnpkg.com/git-commit-msg-linter/-/git-commit-msg-linter-5.0.7.tgz#d12453b25e3dd4eb1af647168fc06de3a8e98922" + integrity sha512-9bciWCVSpI2Yqpy6WYTEy/AeEA87OurCFPH/QROKh8NMOfZFg3BtHgomfHjvDBPoHJxtfhZmToHSHx/4sSwquA== dependencies: chalk "^2.4.2" commit-msg-linter "^1.0.0" From 01a5450f7caf826a1b45452fe4b6f4e48152f71f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:12:53 +0000 Subject: [PATCH 10/16] fix(deps): update dependency sweetalert2 to v11.10.6 --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3bea07c..6e63efe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5127,9 +5127,9 @@ svgo@^2.7.0: stable "^0.1.8" sweetalert2@^11.6.15: - version "11.10.5" - resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.10.5.tgz#ff01f45b40ad678ca1f0c2e6c98800d79a74c49f" - integrity sha512-q9eE3EKhMcpIDU/Xcz7z5lk8axCGkgxwK47gXGrrfncnBJWxHPPHnBVAjfsVXcTt8Yi8U6HNEcBRSu+qGeyFdA== + version "11.10.6" + resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.10.6.tgz#77c55271f786e62ea6710b84893a98c27319b3c9" + integrity sha512-CINZPLZXZRSZqSOE7H7j1F7X8e8O1kLOiXPmtJn1DYxvXsKBr3d16d90+IcwTTs7dJww20h8r8QIxIwsLGX+6A== tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" From 62c6577aae74315e4ddd8c25e452723888591962 Mon Sep 17 00:00:00 2001 From: Andrii Date: Fri, 8 Mar 2024 22:05:49 +0200 Subject: [PATCH 11/16] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dfb793a..8bd4451 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "timber" ], "require": { - "php": "7.4|8.*", + "php": "8.*", "htmlburger/carbon-fields": "^3.6", "timber/timber": "^2.0.0", "twig/twig": "^v3.8.0", From 0e29c7a9688d3b9e875b052c45ab697988be8e2c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 23:18:01 +0000 Subject: [PATCH 12/16] chore(deps): update dependency sass to v1.72.0 --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3bea07c..80ed080 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4729,9 +4729,9 @@ sass-loader@^14.0.0: neo-async "^2.6.2" sass@^1.70.0: - version "1.71.1" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.71.1.tgz#dfb09c63ce63f89353777bbd4a88c0a38386ee54" - integrity sha512-wovtnV2PxzteLlfNzbgm1tFXPLoZILYAMJtvoXXkD7/+1uP41eKkIt1ypWq5/q2uT94qHjXehEYfmjKOvjL9sg== + version "1.72.0" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.72.0.tgz#5b9978943fcfb32b25a6a5acb102fc9dabbbf41c" + integrity sha512-Gpczt3WA56Ly0Mn8Sl21Vj94s1axi9hDIzDFn9Ph9x3C3p4nNyvsqJoQyVXKou6cBlfFWEgRW4rT8Tb4i3XnVA== dependencies: chokidar ">=3.0.0 <4.0.0" immutable "^4.0.0" From 9290a9dcf9a7facbc90f9c34d765742925e4c309 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:08:44 +0000 Subject: [PATCH 13/16] fix(deps): update dependency axios to v1.6.8 --- yarn.lock | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3bea07c..fd2ffea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1604,11 +1604,11 @@ autoprefixer@^10.4.0: postcss-value-parser "^4.2.0" axios@^1.6.7: - version "1.6.7" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" - integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== dependencies: - follow-redirects "^1.15.4" + follow-redirects "^1.15.6" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -2856,11 +2856,16 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -follow-redirects@^1.0.0, follow-redirects@^1.15.4: +follow-redirects@^1.0.0: version "1.15.5" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" From d3e58163cd5b0b5673f2696920edb69f87e05610 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 19:54:49 +0000 Subject: [PATCH 14/16] build(deps): bump follow-redirects from 1.15.5 to 1.15.6 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fd2ffea..85acea3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2856,12 +2856,7 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -follow-redirects@^1.0.0: - version "1.15.5" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" - integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== - -follow-redirects@^1.15.6: +follow-redirects@^1.0.0, follow-redirects@^1.15.6: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== From 6f53b4454bb3be132f7e70629b5dd92d4b6bfcd5 Mon Sep 17 00:00:00 2001 From: lastofpudge Date: Sat, 16 Mar 2024 22:07:12 +0200 Subject: [PATCH 15/16] fix: remove wrong --- app/Admin/AdminOptions.php | 3 - app/{CustomFields => CarbonFields}/Blocks.php | 0 .../Blocks/example.css | 0 .../Blocks/example.php | 2 +- .../Blocks/example.view.php | 0 .../Fields/about.php | 0 .../Fields/home.php | 0 .../OptionFields.php | 0 .../PostFields.php | 3 - app/Controllers/CategoryController.php | 2 +- app/Controllers/Controller.php | 8 - app/Controllers/ProductController.php | 62 - app/CustomFields/Fields/product.php | 11 - app/CustomFields/Fields/product_variants.php | 5 - app/Handlers/AjaxHandlers/addToCart.php | 51 - app/Handlers/AjaxHandlers/applyCoupon.php | 5 - app/Handlers/AjaxHandlers/removeFromCart.php | 25 - app/Handlers/ajax.php | 4 - composer.json | 8 +- jsconfig.json | 8 - package.json | 2 - resources/assets/dist/css/bundle.min.css | 1432 +- resources/assets/dist/js/app.min.js | 13883 +--------------- resources/assets/src/scripts/app.js | 8 +- resources/assets/src/scripts/cart/add.js | 91 - resources/assets/src/scripts/cart/cart.js | 11 - resources/assets/src/scripts/cart/quantity.js | 10 - resources/assets/src/scripts/cart/remove.js | 51 - .../assets/src/scripts/cart/variations.js | 11 - resources/assets/src/scripts/rangeSlider.js | 44 - resources/assets/src/styles/_plugins.scss | 1 - resources/assets/src/styles/bundle.scss | 19 - resources/views/categories/category.twig | 4 +- resources/views/components/footer.twig | 10 +- resources/views/components/head.twig | 11 +- resources/views/components/header.twig | 36 +- resources/views/woocommerce/account.twig | 24 - resources/views/woocommerce/cart.twig | 130 - resources/views/woocommerce/checkout.twig | 24 - .../woocommerce/components/cartSmall.twig | 90 - resources/views/woocommerce/product.twig | 156 - resources/views/woocommerce/shop.twig | 92 - routes/base.php | 17 - todo.md | 34 - webpack.mix.js | 27 +- woocommerce/archive-product.php | 6 - woocommerce/auth/footer.php | 25 - woocommerce/auth/form-grant-access.php | 61 - woocommerce/auth/form-login.php | 54 - woocommerce/auth/header.php | 33 - woocommerce/block-notices/error.php | 50 - woocommerce/block-notices/notice.php | 37 - woocommerce/block-notices/success.php | 37 - woocommerce/cart/cart-empty.php | 39 - woocommerce/cart/cart-item-data.php | 26 - woocommerce/cart/cart-shipping.php | 96 - woocommerce/cart/cart-totals.php | 112 - woocommerce/cart/cart.php | 209 - woocommerce/cart/cross-sells.php | 51 - woocommerce/cart/mini-cart.php | 102 - .../cart/proceed-to-checkout-button.php | 27 - woocommerce/cart/shipping-calculator.php | 96 - woocommerce/checkout/cart-errors.php | 25 - woocommerce/checkout/form-billing.php | 74 - woocommerce/checkout/form-checkout.php | 66 - woocommerce/checkout/form-coupon.php | 43 - woocommerce/checkout/form-login.php | 36 - woocommerce/checkout/form-pay.php | 109 - woocommerce/checkout/form-shipping.php | 70 - woocommerce/checkout/form-verify-email.php | 53 - woocommerce/checkout/order-receipt.php | 46 - woocommerce/checkout/order-received.php | 42 - woocommerce/checkout/payment-method.php | 33 - woocommerce/checkout/payment.php | 63 - woocommerce/checkout/review-order.php | 110 - woocommerce/checkout/terms.php | 40 - woocommerce/checkout/thankyou.php | 90 - woocommerce/emails/admin-cancelled-order.php | 60 - woocommerce/emails/admin-failed-order.php | 61 - woocommerce/emails/admin-new-order.php | 58 - .../emails/customer-completed-order.php | 61 - woocommerce/emails/customer-invoice.php | 98 - .../emails/customer-new-account-blocks.php | 44 - woocommerce/emails/customer-new-account.php | 39 - woocommerce/emails/customer-note.php | 66 - woocommerce/emails/customer-on-hold-order.php | 60 - .../emails/customer-processing-order.php | 63 - .../emails/customer-refunded-order.php | 70 - .../emails/customer-reset-password.php | 47 - woocommerce/emails/email-addresses.php | 80 - woocommerce/emails/email-customer-details.php | 31 - woocommerce/emails/email-downloads.php | 68 - woocommerce/emails/email-footer.php | 75 - woocommerce/emails/email-header.php | 72 - woocommerce/emails/email-mobile-messaging.php | 20 - woocommerce/emails/email-order-details.php | 90 - woocommerce/emails/email-order-items.php | 104 - woocommerce/emails/email-styles.php | 264 - .../emails/plain/admin-cancelled-order.php | 58 - .../emails/plain/admin-failed-order.php | 58 - woocommerce/emails/plain/admin-new-order.php | 58 - .../emails/plain/customer-completed-order.php | 60 - woocommerce/emails/plain/customer-invoice.php | 78 - .../plain/customer-new-account-blocks.php | 45 - .../emails/plain/customer-new-account.php | 46 - woocommerce/emails/plain/customer-note.php | 67 - .../emails/plain/customer-on-hold-order.php | 59 - .../plain/customer-processing-order.php | 60 - .../emails/plain/customer-refunded-order.php | 65 - .../emails/plain/customer-reset-password.php | 43 - woocommerce/emails/plain/email-addresses.php | 66 - .../emails/plain/email-customer-details.php | 26 - woocommerce/emails/plain/email-downloads.php | 50 - .../emails/plain/email-order-details.php | 54 - .../emails/plain/email-order-items.php | 66 - woocommerce/global/breadcrumb.php | 43 - woocommerce/global/form-login.php | 61 - woocommerce/global/quantity-input.php | 64 - woocommerce/global/sidebar.php | 24 - woocommerce/global/wrapper-end.php | 52 - woocommerce/global/wrapper-start.php | 49 - woocommerce/loop/add-to-cart.php | 36 - woocommerce/loop/loop-end.php | 22 - woocommerce/loop/loop-start.php | 22 - woocommerce/loop/no-products-found.php | 23 - woocommerce/loop/orderby.php | 31 - woocommerce/loop/pagination.php | 51 - woocommerce/loop/price.php | 27 - woocommerce/loop/rating.php | 28 - woocommerce/loop/result-count.php | 40 - woocommerce/loop/sale-flash.php | 32 - woocommerce/myaccount/dashboard.php | 81 - woocommerce/myaccount/downloads.php | 47 - .../myaccount/form-add-payment-method.php | 61 - woocommerce/myaccount/form-edit-account.php | 76 - woocommerce/myaccount/form-edit-address.php | 56 - woocommerce/myaccount/form-login.php | 119 - woocommerce/myaccount/form-lost-password.php | 45 - woocommerce/myaccount/form-reset-password.php | 52 - .../myaccount/lost-password-confirmation.php | 27 - woocommerce/myaccount/my-account.php | 36 - woocommerce/myaccount/my-address.php | 77 - woocommerce/myaccount/my-downloads.php | 52 - woocommerce/myaccount/my-orders.php | 95 - woocommerce/myaccount/navigation.php | 35 - woocommerce/myaccount/orders.php | 104 - woocommerce/myaccount/payment-methods.php | 78 - woocommerce/myaccount/view-order.php | 56 - woocommerce/notices/error.php | 33 - woocommerce/notices/notice.php | 32 - woocommerce/notices/success.php | 30 - woocommerce/order/attribution-details.php | 112 - woocommerce/order/customer-history.php | 59 - woocommerce/order/form-tracking.php | 61 - woocommerce/order/order-again.php | 23 - woocommerce/order/order-details-customer.php | 66 - woocommerce/order/order-details-item.php | 68 - woocommerce/order/order-details.php | 115 - woocommerce/order/order-downloads.php | 73 - woocommerce/order/tracking.php | 60 - woocommerce/single-product.php | 6 - yarn.lock | 17 +- 162 files changed, 45 insertions(+), 23278 deletions(-) rename app/{CustomFields => CarbonFields}/Blocks.php (100%) rename app/{CustomFields => CarbonFields}/Blocks/example.css (100%) rename app/{CustomFields => CarbonFields}/Blocks/example.php (90%) rename app/{CustomFields => CarbonFields}/Blocks/example.view.php (100%) rename app/{CustomFields => CarbonFields}/Fields/about.php (100%) rename app/{CustomFields => CarbonFields}/Fields/home.php (100%) rename app/{CustomFields => CarbonFields}/OptionFields.php (100%) rename app/{CustomFields => CarbonFields}/PostFields.php (78%) delete mode 100644 app/Controllers/ProductController.php delete mode 100644 app/CustomFields/Fields/product.php delete mode 100644 app/CustomFields/Fields/product_variants.php delete mode 100644 app/Handlers/AjaxHandlers/addToCart.php delete mode 100644 app/Handlers/AjaxHandlers/applyCoupon.php delete mode 100644 app/Handlers/AjaxHandlers/removeFromCart.php delete mode 100644 jsconfig.json delete mode 100644 resources/assets/src/scripts/cart/add.js delete mode 100644 resources/assets/src/scripts/cart/cart.js delete mode 100644 resources/assets/src/scripts/cart/quantity.js delete mode 100644 resources/assets/src/scripts/cart/remove.js delete mode 100644 resources/assets/src/scripts/cart/variations.js delete mode 100644 resources/assets/src/scripts/rangeSlider.js delete mode 100644 resources/views/woocommerce/account.twig delete mode 100644 resources/views/woocommerce/cart.twig delete mode 100644 resources/views/woocommerce/checkout.twig delete mode 100644 resources/views/woocommerce/components/cartSmall.twig delete mode 100644 resources/views/woocommerce/product.twig delete mode 100644 resources/views/woocommerce/shop.twig delete mode 100644 todo.md delete mode 100644 woocommerce/archive-product.php delete mode 100644 woocommerce/auth/footer.php delete mode 100644 woocommerce/auth/form-grant-access.php delete mode 100644 woocommerce/auth/form-login.php delete mode 100644 woocommerce/auth/header.php delete mode 100644 woocommerce/block-notices/error.php delete mode 100644 woocommerce/block-notices/notice.php delete mode 100644 woocommerce/block-notices/success.php delete mode 100644 woocommerce/cart/cart-empty.php delete mode 100644 woocommerce/cart/cart-item-data.php delete mode 100644 woocommerce/cart/cart-shipping.php delete mode 100644 woocommerce/cart/cart-totals.php delete mode 100644 woocommerce/cart/cart.php delete mode 100644 woocommerce/cart/cross-sells.php delete mode 100644 woocommerce/cart/mini-cart.php delete mode 100644 woocommerce/cart/proceed-to-checkout-button.php delete mode 100644 woocommerce/cart/shipping-calculator.php delete mode 100644 woocommerce/checkout/cart-errors.php delete mode 100644 woocommerce/checkout/form-billing.php delete mode 100644 woocommerce/checkout/form-checkout.php delete mode 100644 woocommerce/checkout/form-coupon.php delete mode 100644 woocommerce/checkout/form-login.php delete mode 100644 woocommerce/checkout/form-pay.php delete mode 100644 woocommerce/checkout/form-shipping.php delete mode 100644 woocommerce/checkout/form-verify-email.php delete mode 100644 woocommerce/checkout/order-receipt.php delete mode 100644 woocommerce/checkout/order-received.php delete mode 100644 woocommerce/checkout/payment-method.php delete mode 100644 woocommerce/checkout/payment.php delete mode 100644 woocommerce/checkout/review-order.php delete mode 100644 woocommerce/checkout/terms.php delete mode 100644 woocommerce/checkout/thankyou.php delete mode 100644 woocommerce/emails/admin-cancelled-order.php delete mode 100644 woocommerce/emails/admin-failed-order.php delete mode 100644 woocommerce/emails/admin-new-order.php delete mode 100644 woocommerce/emails/customer-completed-order.php delete mode 100644 woocommerce/emails/customer-invoice.php delete mode 100644 woocommerce/emails/customer-new-account-blocks.php delete mode 100644 woocommerce/emails/customer-new-account.php delete mode 100644 woocommerce/emails/customer-note.php delete mode 100644 woocommerce/emails/customer-on-hold-order.php delete mode 100644 woocommerce/emails/customer-processing-order.php delete mode 100644 woocommerce/emails/customer-refunded-order.php delete mode 100644 woocommerce/emails/customer-reset-password.php delete mode 100644 woocommerce/emails/email-addresses.php delete mode 100644 woocommerce/emails/email-customer-details.php delete mode 100644 woocommerce/emails/email-downloads.php delete mode 100644 woocommerce/emails/email-footer.php delete mode 100644 woocommerce/emails/email-header.php delete mode 100644 woocommerce/emails/email-mobile-messaging.php delete mode 100644 woocommerce/emails/email-order-details.php delete mode 100644 woocommerce/emails/email-order-items.php delete mode 100644 woocommerce/emails/email-styles.php delete mode 100644 woocommerce/emails/plain/admin-cancelled-order.php delete mode 100644 woocommerce/emails/plain/admin-failed-order.php delete mode 100644 woocommerce/emails/plain/admin-new-order.php delete mode 100644 woocommerce/emails/plain/customer-completed-order.php delete mode 100644 woocommerce/emails/plain/customer-invoice.php delete mode 100644 woocommerce/emails/plain/customer-new-account-blocks.php delete mode 100644 woocommerce/emails/plain/customer-new-account.php delete mode 100644 woocommerce/emails/plain/customer-note.php delete mode 100644 woocommerce/emails/plain/customer-on-hold-order.php delete mode 100644 woocommerce/emails/plain/customer-processing-order.php delete mode 100644 woocommerce/emails/plain/customer-refunded-order.php delete mode 100644 woocommerce/emails/plain/customer-reset-password.php delete mode 100644 woocommerce/emails/plain/email-addresses.php delete mode 100644 woocommerce/emails/plain/email-customer-details.php delete mode 100644 woocommerce/emails/plain/email-downloads.php delete mode 100644 woocommerce/emails/plain/email-order-details.php delete mode 100644 woocommerce/emails/plain/email-order-items.php delete mode 100644 woocommerce/global/breadcrumb.php delete mode 100644 woocommerce/global/form-login.php delete mode 100644 woocommerce/global/quantity-input.php delete mode 100644 woocommerce/global/sidebar.php delete mode 100644 woocommerce/global/wrapper-end.php delete mode 100644 woocommerce/global/wrapper-start.php delete mode 100644 woocommerce/loop/add-to-cart.php delete mode 100644 woocommerce/loop/loop-end.php delete mode 100644 woocommerce/loop/loop-start.php delete mode 100644 woocommerce/loop/no-products-found.php delete mode 100644 woocommerce/loop/orderby.php delete mode 100644 woocommerce/loop/pagination.php delete mode 100644 woocommerce/loop/price.php delete mode 100644 woocommerce/loop/rating.php delete mode 100644 woocommerce/loop/result-count.php delete mode 100644 woocommerce/loop/sale-flash.php delete mode 100644 woocommerce/myaccount/dashboard.php delete mode 100644 woocommerce/myaccount/downloads.php delete mode 100644 woocommerce/myaccount/form-add-payment-method.php delete mode 100644 woocommerce/myaccount/form-edit-account.php delete mode 100644 woocommerce/myaccount/form-edit-address.php delete mode 100644 woocommerce/myaccount/form-login.php delete mode 100644 woocommerce/myaccount/form-lost-password.php delete mode 100644 woocommerce/myaccount/form-reset-password.php delete mode 100644 woocommerce/myaccount/lost-password-confirmation.php delete mode 100644 woocommerce/myaccount/my-account.php delete mode 100644 woocommerce/myaccount/my-address.php delete mode 100644 woocommerce/myaccount/my-downloads.php delete mode 100644 woocommerce/myaccount/my-orders.php delete mode 100644 woocommerce/myaccount/navigation.php delete mode 100644 woocommerce/myaccount/orders.php delete mode 100644 woocommerce/myaccount/payment-methods.php delete mode 100644 woocommerce/myaccount/view-order.php delete mode 100644 woocommerce/notices/error.php delete mode 100644 woocommerce/notices/notice.php delete mode 100644 woocommerce/notices/success.php delete mode 100644 woocommerce/order/attribution-details.php delete mode 100644 woocommerce/order/customer-history.php delete mode 100644 woocommerce/order/form-tracking.php delete mode 100644 woocommerce/order/order-again.php delete mode 100644 woocommerce/order/order-details-customer.php delete mode 100644 woocommerce/order/order-details-item.php delete mode 100644 woocommerce/order/order-details.php delete mode 100644 woocommerce/order/order-downloads.php delete mode 100644 woocommerce/order/tracking.php delete mode 100644 woocommerce/single-product.php diff --git a/app/Admin/AdminOptions.php b/app/Admin/AdminOptions.php index 9e00a43..591d379 100644 --- a/app/Admin/AdminOptions.php +++ b/app/Admin/AdminOptions.php @@ -26,7 +26,6 @@ public function index(): void 'script', 'style' ]); - remove_theme_support('block-templates'); remove_theme_support('core-block-patterns'); @@ -34,8 +33,6 @@ public function index(): void add_theme_support('post-thumbnails'); add_theme_support('custom-logo'); add_theme_support('responsive-embeds'); - - add_theme_support('woocommerce'); } public function manageAdminAccess(): void diff --git a/app/CustomFields/Blocks.php b/app/CarbonFields/Blocks.php similarity index 100% rename from app/CustomFields/Blocks.php rename to app/CarbonFields/Blocks.php diff --git a/app/CustomFields/Blocks/example.css b/app/CarbonFields/Blocks/example.css similarity index 100% rename from app/CustomFields/Blocks/example.css rename to app/CarbonFields/Blocks/example.css diff --git a/app/CustomFields/Blocks/example.php b/app/CarbonFields/Blocks/example.php similarity index 90% rename from app/CustomFields/Blocks/example.php rename to app/CarbonFields/Blocks/example.php index 13fbfb8..02715bd 100644 --- a/app/CustomFields/Blocks/example.php +++ b/app/CarbonFields/Blocks/example.php @@ -5,7 +5,7 @@ wp_register_style( 'crb-my-shiny-gutenberg-block-stylesheet', - get_stylesheet_directory_uri() . '../app/CustomFields/Blocks/example.css' + get_stylesheet_directory_uri() . '../app/CarbonFields/Blocks/example.css' ); diff --git a/app/CustomFields/Blocks/example.view.php b/app/CarbonFields/Blocks/example.view.php similarity index 100% rename from app/CustomFields/Blocks/example.view.php rename to app/CarbonFields/Blocks/example.view.php diff --git a/app/CustomFields/Fields/about.php b/app/CarbonFields/Fields/about.php similarity index 100% rename from app/CustomFields/Fields/about.php rename to app/CarbonFields/Fields/about.php diff --git a/app/CustomFields/Fields/home.php b/app/CarbonFields/Fields/home.php similarity index 100% rename from app/CustomFields/Fields/home.php rename to app/CarbonFields/Fields/home.php diff --git a/app/CustomFields/OptionFields.php b/app/CarbonFields/OptionFields.php similarity index 100% rename from app/CustomFields/OptionFields.php rename to app/CarbonFields/OptionFields.php diff --git a/app/CustomFields/PostFields.php b/app/CarbonFields/PostFields.php similarity index 78% rename from app/CustomFields/PostFields.php rename to app/CarbonFields/PostFields.php index f9bd86c..4c06485 100644 --- a/app/CustomFields/PostFields.php +++ b/app/CarbonFields/PostFields.php @@ -6,11 +6,8 @@ add_action('carbon_fields_register_fields', function () { include __DIR__ . '/Fields/home.php'; include __DIR__ . '/Fields/about.php'; - include __DIR__ . '/Fields/product.php'; // Container::make( 'comment_meta', 'Comment fields' ) // ->add_fields( array( // Field::make( 'text', 'comment_rating', 'Rating' ), // ) ); }); - -include __DIR__ . '/Fields/product_variants.php'; diff --git a/app/Controllers/CategoryController.php b/app/Controllers/CategoryController.php index e7dd242..14ef841 100644 --- a/app/Controllers/CategoryController.php +++ b/app/Controllers/CategoryController.php @@ -19,7 +19,7 @@ public function __construct() public function index(): array { $this->data['term'] = Timber::get_term(); - // $this->data['posts'] = Timber::get_posts(); + $this->data['posts'] = Timber::get_posts(); return $this->data; } diff --git a/app/Controllers/Controller.php b/app/Controllers/Controller.php index 932e002..3749dcc 100644 --- a/app/Controllers/Controller.php +++ b/app/Controllers/Controller.php @@ -6,13 +6,5 @@ class Controller { public function __construct() { - add_filter('timber/context', function ($context) { - $context['cart'] = WC()->cart; - $context['checkout_link'] = wc_get_checkout_url(); - $context['cart_link'] = wc_get_cart_url(); - $context['currency_symbol'] = get_woocommerce_currency_symbol(); - - return $context; - }); } } diff --git a/app/Controllers/ProductController.php b/app/Controllers/ProductController.php deleted file mode 100644 index 58ea61f..0000000 --- a/app/Controllers/ProductController.php +++ /dev/null @@ -1,62 +0,0 @@ -data = Timber::context(); - } - - public function index(): array - { - $this->data['product'] = wc_get_product(get_the_ID()); - $this->data['post'] = Timber::get_post(); - $this->data['categories'] = get_the_terms(get_the_ID(), 'product_cat'); - - $related_limit = wc_get_loop_prop('columns'); - $related_ids = wc_get_related_products(get_the_ID(), $related_limit); - $this->data['related_products'] = Timber::get_posts($related_ids); - - return $this->data; - } - - public function category(): array - { - $queried_object = get_queried_object(); - $term_id = $queried_object->term_id; - $this->data['category'] = get_term($term_id, 'product_cat'); - $this->data['title'] = single_term_title('', false); - - return $this->data; - } - - public function archive(): array - { - $this->data['attributes'] = array_map(fn ($taxonomy) => [ - 'label' => $taxonomy->attribute_label, - 'name' => $taxonomy->attribute_name, - 'terms' => get_terms([ - 'taxonomy' => 'pa_' . $taxonomy->attribute_name, - 'hide_empty' => false, - ]) ?? [], - ], wc_get_attribute_taxonomies()); - - return $this->data; - } - - public function cart(): array - { - $this->data['coupons_enabled'] = wc_coupons_enabled(); - - return $this->data; - } -} diff --git a/app/CustomFields/Fields/product.php b/app/CustomFields/Fields/product.php deleted file mode 100644 index c633a5f..0000000 --- a/app/CustomFields/Fields/product.php +++ /dev/null @@ -1,11 +0,0 @@ -where('post_type', '=', 'product') - ->add_fields([ - Field::make('text', 'sub_title', 'Sub-title'), - ]); diff --git a/app/CustomFields/Fields/product_variants.php b/app/CustomFields/Fields/product_variants.php deleted file mode 100644 index 343a187..0000000 --- a/app/CustomFields/Fields/product_variants.php +++ /dev/null @@ -1,5 +0,0 @@ - 'error', 'message' => 'nonce_error']); -} - -$product_id = absint($_POST['product_id']); -$variation_id = $_POST['variation'] ? absint($_POST['variation']) : 0; - -try { - $result = WC()->cart->add_to_cart($product_id, absint($_POST['quantity']), $variation_id); - if (!$result) { - wp_send_json(['type' => 'error', 'message' => 'Error adding to cart']); - } -} catch (Exception $e) { - wp_send_json(['type' => 'error', 'message' => $e->getMessage()]); -} - -$cart = WC()->cart->get_cart(); -$cart_data = []; - -foreach ($cart as $cart_item_key => $cart_item) { - $_product = $cart_item['data']; - $sale_price = null; - - if (!empty($_product->get_sale_price())) { - $sale_price = wc_price($_product->get_sale_price()); - } - - $item_data = [ - 'id' => $cart_item['product_id'], - 'name' => $_product->get_name(), - 'link' => get_permalink($cart_item['product_id']), - 'thumbnail' => $_product->get_image(), - 'quantity' => $cart_item['quantity'], - 'cart_item_key' => $result, - 'regular_price' => wc_price($_product->get_regular_price()), - 'sale_price' => $sale_price, - ]; - - $cart_data[] = $item_data; -} - -wp_send_json([ - 'type' => 'success', - 'message' => 'Product added to the cart.', - 'cart' => $cart_data, - 'total' => number_format(WC()->cart->get_cart_contents_total(), 2, '.', ''), - 'subTotal' => WC()->cart->get_subtotal(), - 'count' => WC()->cart->get_cart_contents_count(), -]); diff --git a/app/Handlers/AjaxHandlers/applyCoupon.php b/app/Handlers/AjaxHandlers/applyCoupon.php deleted file mode 100644 index 677b8b0..0000000 --- a/app/Handlers/AjaxHandlers/applyCoupon.php +++ /dev/null @@ -1,5 +0,0 @@ - 'error', 'message' => 'nonce_error']); -} diff --git a/app/Handlers/AjaxHandlers/removeFromCart.php b/app/Handlers/AjaxHandlers/removeFromCart.php deleted file mode 100644 index bccc586..0000000 --- a/app/Handlers/AjaxHandlers/removeFromCart.php +++ /dev/null @@ -1,25 +0,0 @@ - 'error', 'message' => 'nonce_error']); -} - -$key = sanitize_text_field($_POST['key']); - -$response = WC()->cart->remove_cart_item($key); - -$total = WC()->cart->get_cart_contents_total(); -$subTotal = WC()->cart->get_subtotal(); -$cartItemCount = WC()->cart->get_cart_contents_count(); - -if ($response) { - wp_send_json([ - 'type' => 'success', - 'message' => 'Product removed from the cart.', - 'total' => number_format($total, 2, '.', ''), - 'subTotal' => $subTotal, - 'count' => $cartItemCount - ]); -} else { - wp_send_json(['type' => 'error', 'response' => $response]); -} diff --git a/app/Handlers/ajax.php b/app/Handlers/ajax.php index 31e8c05..a10a9ee 100644 --- a/app/Handlers/ajax.php +++ b/app/Handlers/ajax.php @@ -2,7 +2,3 @@ add_ajax_action('login'); add_ajax_action('contact'); - -add_ajax_action('removeFromCart'); -add_ajax_action('addToCart'); -add_ajax_action('applyCoupon'); diff --git a/composer.json b/composer.json index 154faf1..8bd4451 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "htmlburger/carbon-fields": "^3.6", "timber/timber": "^2.0.0", "twig/twig": "^v3.8.0", - "wp-theme/core": "^1.1.4", + "wp-theme/core": "^1.0.4", "wpackagist-plugin/all-in-one-wp-migration": "*", "wpackagist-plugin/wordpress-seo": "*" }, @@ -42,9 +42,9 @@ "bootstrap/app.php", "app/helpers.php", "app/Handlers/ajax.php", - "app/CustomFields/OptionFields.php", - "app/CustomFields/PostFields.php", - "app/CustomFields/Blocks.php", + "app/CarbonFields/OptionFields.php", + "app/CarbonFields/PostFields.php", + "app/CarbonFields/Blocks.php", "routes/api.php" ] }, diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index 8cd106a..0000000 --- a/jsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@/*": ["resources/assets/src/scripts/*"] - } - } -} \ No newline at end of file diff --git a/package.json b/package.json index 9f60f4f..93fd421 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "devDependencies": { "git-commit-msg-linter": "^5.0.0", "laravel-mix": "^6.0.6", - "path": "^0.12.7", "prettier": "^3.2.5", "prettier-plugin-twig-melody": "^0.4.6", "sass": "^1.70.0", @@ -17,7 +16,6 @@ }, "dependencies": { "axios": "^1.6.7", - "nouislider": "^15.7.1", "sweetalert2": "^11.6.15" } } diff --git a/resources/assets/dist/css/bundle.min.css b/resources/assets/dist/css/bundle.min.css index 02b3e8f..fe7a73c 100644 --- a/resources/assets/dist/css/bundle.min.css +++ b/resources/assets/dist/css/bundle.min.css @@ -1,1431 +1 @@ -.swal2-popup.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 hsla(0, 0%, 0%, 0.075), 0 1px 2px hsla(0, 0%, 0%, 0.075), 1px 2px 4px hsla(0, 0%, 0%, 0.075), 1px 3px 8px hsla(0, 0%, 0%, 0.075), 2px 4px 16px hsla(0, 0%, 0%, 0.075); - pointer-events: all; -} -.swal2-popup.swal2-toast > * { - grid-column: 2; -} -.swal2-popup.swal2-toast .swal2-title { - margin: 0.5em 1em; - padding: 0; - font-size: 1em; - text-align: initial; -} -.swal2-popup.swal2-toast .swal2-loading { - justify-content: center; -} -.swal2-popup.swal2-toast .swal2-input { - height: 2em; - margin: 0.5em; - font-size: 1em; -} -.swal2-popup.swal2-toast .swal2-validation-message { - font-size: 1em; -} -.swal2-popup.swal2-toast .swal2-footer { - margin: 0.5em 0 0; - padding: 0.5em 0 0; - font-size: 0.8em; -} -.swal2-popup.swal2-toast .swal2-close { - grid-column: 3/3; - grid-row: 1/99; - align-self: center; - width: 0.8em; - height: 0.8em; - margin: 0; - font-size: 2em; -} -.swal2-popup.swal2-toast .swal2-html-container { - margin: 0.5em 1em; - padding: 0; - overflow: initial; - font-size: 1em; - text-align: initial; -} -.swal2-popup.swal2-toast .swal2-html-container:empty { - padding: 0; -} -.swal2-popup.swal2-toast .swal2-loader { - grid-column: 1; - grid-row: 1/99; - align-self: center; - width: 2em; - height: 2em; - margin: 0.25em; -} -.swal2-popup.swal2-toast .swal2-icon { - grid-column: 1; - grid-row: 1/99; - align-self: center; - width: 2em; - min-width: 2em; - height: 2em; - margin: 0 0.5em 0 0; -} -.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content { - display: flex; - align-items: center; - font-size: 1.8em; - font-weight: bold; -} -.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring { - width: 2em; - height: 2em; -} -.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line] { - top: 0.875em; - width: 1.375em; -} -.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left] { - left: 0.3125em; -} -.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right] { - right: 0.3125em; -} -.swal2-popup.swal2-toast .swal2-actions { - justify-content: flex-start; - height: auto; - margin: 0; - margin-top: 0.5em; - padding: 0 0.5em; -} -.swal2-popup.swal2-toast .swal2-styled { - margin: 0.25em 0.5em; - padding: 0.4em 0.6em; - font-size: 1em; -} -.swal2-popup.swal2-toast .swal2-success { - border-color: #a5dc86; -} -.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line] { - position: absolute; - width: 1.6em; - height: 3em; - border-radius: 50%; -} -.swal2-popup.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-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right] { - top: -0.25em; - left: 0.9375em; - transform-origin: 0 1.5em; - border-radius: 0 4em 4em 0; -} -.swal2-popup.swal2-toast .swal2-success .swal2-success-ring { - width: 2em; - height: 2em; -} -.swal2-popup.swal2-toast .swal2-success .swal2-success-fix { - top: 0; - left: 0.4375em; - width: 0.4375em; - height: 2.6875em; -} -.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line] { - height: 0.3125em; -} -.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip] { - top: 1.125em; - left: 0.1875em; - width: 0.75em; -} -.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long] { - top: 0.9375em; - right: 0.1875em; - width: 1.375em; -} -.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip { - animation: swal2-toast-animate-success-line-tip 0.75s; -} -.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long { - animation: swal2-toast-animate-success-line-long 0.75s; -} -.swal2-popup.swal2-toast.swal2-show { - animation: swal2-toast-show 0.5s; -} -.swal2-popup.swal2-toast.swal2-hide { - animation: swal2-toast-hide 0.1s forwards; -} - -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: 0.625em; - overflow-x: hidden; - transition: background-color 0.1s; - -webkit-overflow-scrolling: touch; -} -div:where(.swal2-container).swal2-backdrop-show, div:where(.swal2-container).swal2-noanimation { - background: rgba(0, 0, 0, 0.4); -} -div:where(.swal2-container).swal2-backdrop-hide { - background: transparent !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) h2:where(.swal2-title) { - position: relative; - max-width: 100%; - margin: 0; - padding: 0.8em 1em 0; - color: inherit; - font-size: 1.875em; - font-weight: 600; - text-align: center; - text-transform: none; - word-wrap: break-word; -} -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: 0.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: 0.25em; - border-style: solid; - border-radius: 100%; - border-color: #2778c4 transparent #2778c4 transparent; -} -div:where(.swal2-container) button:where(.swal2-styled) { - margin: 0.3125em; - padding: 0.625em 1.1em; - transition: box-shadow 0.1s; - box-shadow: 0 0 0 3px transparent; - font-weight: 500; -} -div:where(.swal2-container) button:where(.swal2-styled):not([disabled]) { - cursor: pointer; -} -div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm { - border: 0; - border-radius: 0.25em; - background: initial; - background-color: #7066e0; - color: #fff; - font-size: 1em; -} -div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus { - box-shadow: 0 0 0 3px rgba(112, 102, 224, 0.5); -} -div:where(.swal2-container) button:where(.swal2-styled).swal2-deny { - border: 0; - border-radius: 0.25em; - background: initial; - background-color: #dc3741; - color: #fff; - font-size: 1em; -} -div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus { - box-shadow: 0 0 0 3px rgba(220, 55, 65, 0.5); -} -div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel { - border: 0; - border-radius: 0.25em; - background: initial; - background-color: #6e7881; - color: #fff; - font-size: 1em; -} -div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus { - box-shadow: 0 0 0 3px rgba(110, 120, 129, 0.5); -} -div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus { - box-shadow: 0 0 0 3px rgba(100, 150, 200, 0.5); -} -div:where(.swal2-container) button:where(.swal2-styled):focus { - 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; -} -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: 0.25em; - background: rgba(0, 0, 0, 0.2); -} -div:where(.swal2-container) img:where(.swal2-image) { - max-width: 100%; - margin: 2em auto 1em; -} -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 0.1s, box-shadow 0.1s; - border: none; - border-radius: 5px; - background: transparent; - 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: transparent; - color: #f27474; -} -div:where(.swal2-container) button:where(.swal2-close):focus { - outline: none; - box-shadow: inset 0 0 0 3px rgba(100, 150, 200, 0.5); -} -div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner { - border: 0; -} -div:where(.swal2-container) .swal2-html-container { - z-index: 1; - justify-content: center; - margin: 1em 1.6em 0.3em; - padding: 0; - 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; -} -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 0.1s, box-shadow 0.1s; - border: 1px solid #d9d9d9; - border-radius: 0.1875em; - background: transparent; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent; - 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, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5); -} -div:where(.swal2-container) input:where(.swal2-input)::-moz-placeholder, div:where(.swal2-container) input:where(.swal2-file)::-moz-placeholder, div:where(.swal2-container) textarea:where(.swal2-textarea)::-moz-placeholder { - color: #ccc; -} -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 0.75em; -} -div:where(.swal2-container) .swal2-file { - width: 75%; - margin-right: auto; - margin-left: auto; - background: transparent; - font-size: 1.125em; -} -div:where(.swal2-container) .swal2-textarea { - height: 6.75em; - padding: 0.75em; -} -div:where(.swal2-container) .swal2-select { - min-width: 50%; - max-width: 100%; - padding: 0.375em 0.625em; - background: transparent; - 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 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 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: 0.625em; - overflow: hidden; - background: #f0f0f0; - color: #666666; - 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 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: transparent; - 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: 0.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 0.6em; - border: 0.25em solid transparent; - border-radius: 50%; - border-color: #000; - font-family: inherit; - line-height: 5em; - cursor: default; - -webkit-user-select: none; - -moz-user-select: none; - 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: 0.3125em; - border-radius: 0.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 0.5s; -} -div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark { - animation: swal2-animate-error-x-mark 0.5s; -} -div:where(.swal2-icon).swal2-warning { - border-color: #facea8; - color: #f8bb86; -} -div:where(.swal2-icon).swal2-warning.swal2-icon-show { - animation: swal2-animate-error-icon 0.5s; -} -div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content { - animation: swal2-animate-i-mark 0.5s; -} -div:where(.swal2-icon).swal2-info { - border-color: #9de0f6; - color: #3fc3ee; -} -div:where(.swal2-icon).swal2-info.swal2-icon-show { - animation: swal2-animate-error-icon 0.5s; -} -div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content { - animation: swal2-animate-i-mark 0.8s; -} -div:where(.swal2-icon).swal2-question { - border-color: #c9dae1; - color: #87adbd; -} -div:where(.swal2-icon).swal2-question.swal2-icon-show { - animation: swal2-animate-error-icon 0.5s; -} -div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content { - animation: swal2-animate-question-mark 0.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: 0.25em solid rgba(165, 220, 134, 0.3); - border-radius: 50%; -} -div:where(.swal2-icon).swal2-success .swal2-success-fix { - position: absolute; - z-index: 1; - top: 0.5em; - left: 1.625em; - width: 0.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: 0.3125em; - border-radius: 0.125em; - background-color: #a5dc86; -} -div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip] { - top: 2.875em; - left: 0.8125em; - width: 1.5625em; - transform: rotate(45deg); -} -div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long] { - top: 2.375em; - right: 0.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 0.75s; -} -div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long { - animation: swal2-animate-success-line-long 0.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: transparent; -} - -.swal2-show { - animation: swal2-show 0.3s; -} - -.swal2-hide { - animation: swal2-hide 0.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; -} - -@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: 0.5625em; - left: 0.0625em; - width: 0; - } - 54% { - top: 0.125em; - left: 0.125em; - width: 0; - } - 70% { - top: 0.625em; - left: -0.25em; - width: 1.625em; - } - 84% { - top: 1.0625em; - left: 0.75em; - width: 0.5em; - } - 100% { - top: 1.125em; - left: 0.1875em; - width: 0.75em; - } -} -@keyframes swal2-toast-animate-success-line-long { - 0% { - top: 1.625em; - right: 1.375em; - width: 0; - } - 65% { - top: 1.25em; - right: 0.9375em; - width: 0; - } - 84% { - top: 0.9375em; - right: 0; - width: 1.125em; - } - 100% { - top: 0.9375em; - right: 0.1875em; - width: 1.375em; - } -} -@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: 0.0625em; - width: 0; - } - 54% { - top: 1.0625em; - left: 0.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: 0.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: 0.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: 0.4; - } - 50% { - transform: rotateZ(15deg); - opacity: 0.8; - } - 75% { - transform: rotateZ(-5deg); - opacity: 1; - } - 100% { - transform: rotateX(0); - opacity: 1; - } -} -body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) { - overflow: hidden; -} -body.swal2-height-auto { - height: auto !important; -} -body.swal2-no-backdrop .swal2-container { - background-color: transparent !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, 0.4); -} -@media print { - body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) { - overflow-y: scroll !important; - } - body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) > [aria-hidden=true] { - display: none; - } - body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container { - position: static !important; - } -} -body.swal2-toast-shown .swal2-container { - box-sizing: border-box; - width: 360px; - max-width: 100%; - background-color: transparent; - 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; -} - -.noUi-target, .noUi-target * { - -webkit-touch-callout: none; - -webkit-tap-highlight-color: transparent; - -webkit-user-select: none; - touch-action: none; - -moz-user-select: none; - user-select: none; - box-sizing: border-box; -} - -.noUi-target { - position: relative; -} - -.noUi-base, .noUi-connects { - width: 100%; - height: 100%; - position: relative; - z-index: 1; -} - -.noUi-connects { - overflow: hidden; - z-index: 0; -} - -.noUi-connect, .noUi-origin { - will-change: transform; - position: absolute; - z-index: 1; - top: 0; - right: 0; - height: 100%; - width: 100%; - -ms-transform-origin: 0 0; - -webkit-transform-origin: 0 0; - -webkit-transform-style: preserve-3d; - transform-origin: 0 0; - transform-style: flat; -} - -.noUi-txt-dir-rtl.noUi-horizontal .noUi-origin { - left: 0; - right: auto; -} - -.noUi-vertical .noUi-origin { - top: -100%; - width: 0; -} - -.noUi-horizontal .noUi-origin { - height: 0; -} - -.noUi-handle { - backface-visibility: hidden; - position: absolute; -} - -.noUi-touch-area { - height: 100%; - width: 100%; -} - -.noUi-state-tap .noUi-connect, .noUi-state-tap .noUi-origin { - transition: transform 0.3s; -} - -.noUi-state-drag * { - cursor: inherit !important; -} - -.noUi-horizontal { - height: 18px; -} - -.noUi-horizontal .noUi-handle { - width: 34px; - height: 28px; - right: -17px; - top: -6px; -} - -.noUi-vertical { - width: 18px; -} - -.noUi-vertical .noUi-handle { - width: 28px; - height: 34px; - right: -6px; - bottom: -17px; -} - -.noUi-txt-dir-rtl.noUi-horizontal .noUi-handle { - left: -17px; - right: auto; -} - -.noUi-target { - background: #FAFAFA; - border-radius: 4px; - border: 1px solid #D3D3D3; - box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; -} - -.noUi-connects { - border-radius: 3px; -} - -.noUi-connect { - background: #3FB8AF; -} - -.noUi-draggable { - cursor: ew-resize; -} - -.noUi-vertical .noUi-draggable { - cursor: ns-resize; -} - -.noUi-handle { - border: 1px solid #D9D9D9; - border-radius: 3px; - background: #FFF; - cursor: default; - box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #EBEBEB, 0 3px 6px -3px #BBB; -} - -.noUi-active { - box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB; -} - -.noUi-handle:after, .noUi-handle:before { - content: ""; - display: block; - position: absolute; - height: 14px; - width: 1px; - background: #E8E7E6; - left: 14px; - top: 6px; -} - -.noUi-handle:after { - left: 17px; -} - -.noUi-vertical .noUi-handle:after, .noUi-vertical .noUi-handle:before { - width: 14px; - height: 1px; - left: 6px; - top: 14px; -} - -.noUi-vertical .noUi-handle:after { - top: 17px; -} - -[disabled] .noUi-connect { - background: #B8B8B8; -} - -[disabled] .noUi-handle, [disabled].noUi-handle, [disabled].noUi-target { - cursor: not-allowed; -} - -.noUi-pips, .noUi-pips * { - box-sizing: border-box; -} - -.noUi-pips { - position: absolute; - color: #999; -} - -.noUi-value { - position: absolute; - white-space: nowrap; - text-align: center; -} - -.noUi-value-sub { - color: #ccc; - font-size: 10px; -} - -.noUi-marker { - position: absolute; - background: #CCC; -} - -.noUi-marker-sub { - background: #AAA; -} - -.noUi-marker-large { - background: #AAA; -} - -.noUi-pips-horizontal { - padding: 10px 0; - height: 80px; - top: 100%; - left: 0; - width: 100%; -} - -.noUi-value-horizontal { - transform: translate(-50%, 50%); -} - -.noUi-rtl .noUi-value-horizontal { - transform: translate(50%, 50%); -} - -.noUi-marker-horizontal.noUi-marker { - margin-left: -1px; - width: 2px; - height: 5px; -} - -.noUi-marker-horizontal.noUi-marker-sub { - height: 10px; -} - -.noUi-marker-horizontal.noUi-marker-large { - height: 15px; -} - -.noUi-pips-vertical { - padding: 0 10px; - height: 100%; - top: 0; - left: 100%; -} - -.noUi-value-vertical { - transform: translate(0, -50%); - padding-left: 25px; -} - -.noUi-rtl .noUi-value-vertical { - transform: translate(0, 50%); -} - -.noUi-marker-vertical.noUi-marker { - width: 5px; - height: 2px; - margin-top: -1px; -} - -.noUi-marker-vertical.noUi-marker-sub { - width: 10px; -} - -.noUi-marker-vertical.noUi-marker-large { - width: 15px; -} - -.noUi-tooltip { - display: block; - position: absolute; - border: 1px solid #D9D9D9; - border-radius: 3px; - background: #fff; - color: #000; - padding: 5px; - text-align: center; - white-space: nowrap; -} - -.noUi-horizontal .noUi-tooltip { - transform: translate(-50%, 0); - left: 50%; - bottom: 120%; -} - -.noUi-vertical .noUi-tooltip { - transform: translate(0, -50%); - top: 50%; - right: 120%; -} - -.noUi-horizontal .noUi-origin > .noUi-tooltip { - transform: translate(50%, 0); - left: auto; - bottom: 10px; -} - -.noUi-vertical .noUi-origin > .noUi-tooltip { - transform: translate(0, -18px); - top: auto; - right: 28px; -} - -.preloader-main { - position: absolute; - inset: 0; - width: 100%; - height: 100%; - pointer-events: none; - transition: opacity 0.2s ease-in-out; - z-index: -1; - opacity: 0; -} - -.js-preloading.js-preloader-main { - background: rgba(255, 255, 255, 0.78) url(../images/preloader.svg) no-repeat 50% 50%; - position: fixed; - z-index: 300; - pointer-events: all; - opacity: 1; -} - -@media screen and (min-width: 1024px) { - .js-preloading.js-preloader-main { - background: rgba(255, 255, 255, 0.78) url(../images/preloader.svg) 50%/7% no-repeat; - } -} -img { - display: block; - max-width: 100%; - height: auto; -} - -.dropdown:hover .dropdown-menu { - display: block; -} - -.thumb-sm img { - width: 100px; - max-width: unset; -} - -.js-remove-from-cart i { - pointer-events: none; -} +.swal2-popup.swal2-toast{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);box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:min-content auto min-content;overflow-y:hidden;padding:1em;pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{font-size:1em;margin:.5em 1em;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{font-size:1em;height:2em;margin:.5em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{font-size:.8em;margin:.5em 0 0;padding:.5em 0 0}.swal2-popup.swal2-toast .swal2-close{align-self:center;font-size:2em;grid-column:3/3;grid-row:1/99;height:.8em;margin:0;width:.8em}.swal2-popup.swal2-toast .swal2-html-container{font-size:1em;margin:.5em 1em;overflow:initial;padding:0;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:.25em;width:2em}.swal2-popup.swal2-toast .swal2-icon{align-self:center;grid-column:1;grid-row:1/99;height:2em;margin:0 .5em 0 0;min-width:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{align-items:center;display:flex;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;justify-content:flex-start;margin:.5em 0 0;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{font-size:1em;margin:.25em .5em;padding:.4em .6em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{border-radius:50%;height:3em;position:absolute;width:1.6em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:4em 0 0 4em;left:-.5em;top:-.8em;transform:rotate(-45deg);transform-origin:2em 2em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 4em 4em 0;left:.9375em;top:-.25em;transform-origin:0 1.5em}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{height:2em;width:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{height:2.6875em;left:.4375em;top:0;width:.4375em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{left:.1875em;top:1.125em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{right:.1875em;top:.9375em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){-webkit-overflow-scrolling:touch;box-sizing:border-box;display:grid;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%;inset:0;overflow-x:hidden;padding:.625em;position:fixed;transition:background-color .1s;z-index:1060}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:transparent!important}div:where(.swal2-container).swal2-bottom-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}div:where(.swal2-container).swal2-bottom,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-top{grid-template-columns:auto minmax(0,1fr) auto}div:where(.swal2-container).swal2-bottom-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-top-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-left>.swal2-popup,div:where(.swal2-container).swal2-center-start>.swal2-popup{align-self:center;grid-row:2}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-left>.swal2-popup,div:where(.swal2-container).swal2-bottom-start>.swal2-popup{align-self:end;grid-column:1;grid-row:3}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-fullscreen>.swal2-popup,div:where(.swal2-container).swal2-grow-row>.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{align-self:stretch;grid-row:1/4}div:where(.swal2-container).swal2-no-transition{transition:none!important}div:where(.swal2-container) div:where(.swal2-popup){background:#fff;border:none;border-radius:5px;box-sizing:border-box;color:#545454;display:none;font-family:inherit;font-size:1rem;grid-template-columns:minmax(0,100%);max-width:100%;padding:0 0 1.25em;position:relative;width:32em}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) h2:where(.swal2-title){word-wrap:break-word;color:inherit;font-size:1.875em;font-weight:600;margin:0;max-width:100%;padding:.8em 1em 0;position:relative;text-align:center;text-transform:none}div:where(.swal2-container) div:where(.swal2-actions){align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:1.25em auto 0;padding:0;width:auto;z-index:1}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,.1),rgba(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,.2),rgba(0,0,0,.2))}div:where(.swal2-container) div:where(.swal2-loader){align-items:center;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-color:#2778c4 transparent;border-radius:100%;border-style:solid;border-width:.25em;display:none;height:2.2em;justify-content:center;margin:0 1.875em;width:2.2em}div:where(.swal2-container) button:where(.swal2-styled){box-shadow:0 0 0 3px transparent;font-weight:500;margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{background:initial;background-color:#7066e0;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{background:initial;background-color:#dc3741;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{background:initial;background-color:#6e7881;border:0;border-radius:.25em;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px hsla(208,8%,47%,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){border-top:1px solid #eee;color:inherit;font-size:1em;margin:1em 0 0;padding:1em 1em 0;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{border-bottom-left-radius:5px;border-bottom-right-radius:5px;bottom:0;grid-column:auto!important;left:0;overflow:hidden;position:absolute;right:0}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){background:rgba(0,0,0,.2);height:.25em;width:100%}div:where(.swal2-container) img:where(.swal2-image){margin:2em auto 1em;max-width:100%}div:where(.swal2-container) button:where(.swal2-close){align-items:center;background:transparent;border:none;border-radius:5px;color:#ccc;cursor:pointer;font-family:monospace;font-size:2.5em;height:1.2em;justify-content:center;justify-self:end;margin-bottom:-1.2em;margin-right:0;margin-top:0;overflow:hidden;padding:0;transition:color .1s,box-shadow .1s;width:1.2em;z-index:2}div:where(.swal2-container) button:where(.swal2-close):hover{background:transparent;color:#f27474;transform:none}div:where(.swal2-container) button:where(.swal2-close):focus{box-shadow:inset 0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{word-wrap:break-word;color:inherit;font-size:1.125em;font-weight:normal;justify-content:center;line-height:normal;margin:1em 1.6em .3em;overflow:auto;padding:0;text-align:center;word-break:break-word;z-index:1}div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) label:where(.swal2-checkbox),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) textarea:where(.swal2-textarea){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) textarea:where(.swal2-textarea){background:transparent;border:1px solid #d9d9d9;border-radius:.1875em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;box-sizing:border-box;color:inherit;font-size:1.125em;transition:border-color .1s,box-shadow .1s;width:auto}div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-input).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-file):focus,div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5);outline:none}div:where(.swal2-container) input:where(.swal2-file)::-moz-placeholder,div:where(.swal2-container) input:where(.swal2-input)::-moz-placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::-moz-placeholder{color:#ccc}div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{background:#fff;margin:1em 2em 3px}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{color:inherit;font-weight:600;text-align:center;width:20%}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{font-size:1.125em;height:2.625em;line-height:2.625em;padding:0}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{background:transparent;font-size:1.125em;margin-left:auto;margin-right:auto;width:75%}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{background:transparent;color:inherit;font-size:1.125em;max-width:100%;min-width:50%;padding:.375em .625em}div:where(.swal2-container) .swal2-checkbox,div:where(.swal2-container) .swal2-radio{align-items:center;background:#fff;color:inherit;justify-content:center}div:where(.swal2-container) .swal2-checkbox label,div:where(.swal2-container) .swal2-radio label{font-size:1.125em;margin:0 .6em}div:where(.swal2-container) .swal2-checkbox input,div:where(.swal2-container) .swal2-radio 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;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;justify-content:center;margin:1em 0 0;overflow:hidden;padding:.625em}div:where(.swal2-container) div:where(.swal2-validation-message):before{background-color:#f27474;border-radius:50%;color:#fff;content:"!";display:inline-block;font-weight:600;height:1.5em;line-height:1.5em;margin:0 .625em;min-width:1.5em;text-align:center;width:1.5em}div:where(.swal2-container) .swal2-progress-steps{align-items:center;background:transparent;flex-wrap:wrap;font-weight:600;margin:1.25em auto;max-width:100%;padding:0}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{background:#2778c4;border-radius:2em;color:#fff;flex-shrink:0;height:2em;line-height:2em;text-align:center;width:2em;z-index:20}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{background:#2778c4;flex-shrink:0;height:.4em;margin:0 -1px;width:2.5em;z-index:10}div:where(.swal2-icon){border:.25em solid #000;border-radius:50%;box-sizing:content-box;cursor:default;font-family:inherit;height:5em;justify-content:center;line-height:5em;margin:2.5em auto .6em;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5em}div:where(.swal2-icon) .swal2-icon-content{align-items:center;display:flex;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{flex-grow:1;position:relative}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{background-color:#f27474;border-radius:.125em;display:block;height:.3125em;position:absolute;top:2.3125em;width:2.9375em}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:#facea8;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:#9de0f6;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:#c9dae1;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]{border-radius:50%;height:7.5em;position:absolute;width:3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:7.5em 0 0 7.5em;left:-2.0635em;top:-.4375em;transform:rotate(-45deg);transform-origin:3.75em 3.75em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 7.5em 7.5em 0;left:1.875em;top:-.6875em;transform:rotate(-45deg);transform-origin:0 3.75em}div:where(.swal2-icon).swal2-success .swal2-success-ring{border:.25em solid hsla(98,55%,69%,.3);border-radius:50%;box-sizing:content-box;height:100%;left:-.25em;position:absolute;top:-.25em;width:100%;z-index:2}div:where(.swal2-icon).swal2-success .swal2-success-fix{height:5.625em;left:1.625em;position:absolute;top:.5em;transform:rotate(-45deg);width:.4375em;z-index:1}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{background-color:#a5dc86;border-radius:.125em;display:block;height:.3125em;position:absolute;z-index:2}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{left:.8125em;top:2.875em;transform:rotate(45deg);width:1.5625em}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{right:.5em;top:2.375em;transform:rotate(-45deg);width:2.9375em}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:transparent}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{height:50px;overflow:scroll;position:absolute;top:-9999px;width:50px}.swal2-rtl .swal2-close{margin-left:0;margin-right:0}.swal2-rtl .swal2-timer-progress-bar{left:auto;right:0}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotate(2deg)}33%{transform:translateY(0) rotate(-2deg)}66%{transform:translateY(.3125em) rotate(2deg)}to{transform:translateY(0) rotate(0deg)}}@keyframes swal2-toast-hide{to{opacity:0;transform:rotate(1deg)}}@keyframes swal2-toast-animate-success-line-tip{0%{left:.0625em;top:.5625em;width:0}54%{left:.125em;top:.125em;width:0}70%{left:-.25em;top:.625em;width:1.625em}84%{left:.75em;top:1.0625em;width:.5em}to{left:.1875em;top:1.125em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{right:1.375em;top:1.625em;width:0}65%{right:.9375em;top:1.25em;width:0}84%{right:0;top:.9375em;width:1.125em}to{right:.1875em;top:.9375em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}to{transform:scale(1)}}@keyframes swal2-hide{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.5)}}@keyframes swal2-animate-success-line-tip{0%{left:.0625em;top:1.1875em;width:0}54%{left:.125em;top:1.0625em;width:0}70%{left:-.375em;top:2.1875em;width:3.125em}84%{left:1.3125em;top:3em;width:1.0625em}to{left:.8125em;top:2.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{right:2.875em;top:3.375em;width:0}65%{right:2.875em;top:3.375em;width:0}84%{right:0;top:2.1875em;width:3.4375em}to{right:.5em;top:2.375em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}to{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;opacity:0;transform:scale(.4)}50%{margin-top:1.625em;opacity:0;transform:scale(.4)}80%{margin-top:-.375em;transform:scale(1.15)}to{margin-top:0;opacity:1;transform:scale(1)}}@keyframes swal2-animate-error-icon{0%{opacity:0;transform:rotateX(100deg)}to{opacity:1;transform:rotateX(0deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-1turn)}to{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{opacity:0;transform:rotate(45deg)}25%{opacity:.4;transform:rotate(-25deg)}50%{opacity:.8;transform:rotate(15deg)}75%{opacity:1;transform:rotate(-5deg)}to{opacity:1;transform:rotateX(0)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!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)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent;box-sizing:border-box;max-width:100%;pointer-events:none;width:360px}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-left,body.swal2-toast-shown .swal2-container.swal2-top-start{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{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-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{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}.preloader-main{height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .2s ease-in-out;width:100%;z-index:-1}.js-preloading.js-preloader-main{background:hsla(0,0%,100%,.78) url(../images/preloader.svg) no-repeat 50% 50%;opacity:1;pointer-events:all;position:fixed;z-index:300}@media screen and (min-width:1024px){.js-preloading.js-preloader-main{background:hsla(0,0%,100%,.78) url(../images/preloader.svg) 50%/7% no-repeat}} diff --git a/resources/assets/dist/js/app.min.js b/resources/assets/dist/js/app.min.js index 481e309..bd15cc7 100644 --- a/resources/assets/dist/js/app.min.js +++ b/resources/assets/dist/js/app.min.js @@ -1,13881 +1,2 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./resources/assets/src/scripts/app.js": -/*!*********************************************!*\ - !*** ./resources/assets/src/scripts/app.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); -/* harmony import */ var _contact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/contact */ "./resources/assets/src/scripts/contact.js"); -/* harmony import */ var _login__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/login */ "./resources/assets/src/scripts/login.js"); -/* harmony import */ var _cart_cart__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/cart/cart */ "./resources/assets/src/scripts/cart/cart.js"); -/* harmony import */ var _rangeSlider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/rangeSlider */ "./resources/assets/src/scripts/rangeSlider.js"); - -window.axios = axios__WEBPACK_IMPORTED_MODULE_0__["default"]; - - - - -document.addEventListener('DOMContentLoaded', function () { - (0,_contact__WEBPACK_IMPORTED_MODULE_1__.initContactForm)(); - (0,_login__WEBPACK_IMPORTED_MODULE_2__.initLoginForm)(); - (0,_cart_cart__WEBPACK_IMPORTED_MODULE_3__.initCart)(); - (0,_rangeSlider__WEBPACK_IMPORTED_MODULE_4__.initRangeSlider)(); -}); - -/***/ }), - -/***/ "./resources/assets/src/scripts/cart/add.js": -/*!**************************************************!*\ - !*** ./resources/assets/src/scripts/cart/add.js ***! - \**************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ addToCart: () => (/* binding */ addToCart) -/* harmony export */ }); -/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); -/* harmony import */ var _libs_Toast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/libs/Toast */ "./resources/assets/src/scripts/libs/Toast.js"); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - - -function addToCart() { - var preloader = document.querySelector('.js-preloader-main'); - var addButtons = document.querySelectorAll('.js-add-to-cart'); - var totals = document.querySelectorAll('.js-total'); - var subTotals = document.querySelectorAll('.js-sub-total'); - var cartCount = document.querySelector('.js-cart-total'); - var cartList = document.querySelector('.js-cart-list'); - var addedProduct = function addedProduct(product) { - return "\n \n \n \n ").concat(product.thumbnail, "\n \n \n \n ").concat(product.name, "\n \n \n x").concat(product.quantity, "\n \n ").concat(product.sale_price ? "".concat(product.sale_price) : "".concat(product.regular_price), "\n \n \n \n \n \n "); - }; - addButtons.forEach(function (addButton) { - addButton.addEventListener('click', /*#__PURE__*/function () { - var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) { - var formData, _yield$axios$post, response; - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - preloader.classList.add('js-preloading'); - formData = new FormData(); - formData.append('action', 'addToCart'); - formData.append('nonce', data.nonce); - formData.append('product_id', addButton.dataset.product_id); - formData.append('quantity', addButton.dataset.quantity); - if (addButton.dataset.variation) { - formData.append('variation', addButton.dataset.variation); - } - _context.prev = 7; - _context.next = 10; - return axios__WEBPACK_IMPORTED_MODULE_1__["default"].post(data.ajax_url, formData, { - params: { - action: 'addToCart' - } - }); - case 10: - _yield$axios$post = _context.sent; - response = _yield$axios$post.data; - if (response.type === 'success') { - // totals - totals.forEach(function (totalElement) { - totalElement.innerHTML = response.total; - }); - - // sub-totals - subTotals.forEach(function (subTotalElement) { - subTotalElement.innerHTML = response.subTotal; - }); - cartCount.innerHTML = response.count; - - // cart items - if (response.cart) { - cartList.innerHTML = ''; - response.cart.forEach(function (product) { - var newProduct = addedProduct(product); // Pass each product data to your addedProduct function - cartList.innerHTML += newProduct; - }); - } - _libs_Toast__WEBPACK_IMPORTED_MODULE_0__["default"].fire({ - icon: 'success', - iconColor: '#007cba', - title: response.message - }); - } - if (response.type === 'error') { - _libs_Toast__WEBPACK_IMPORTED_MODULE_0__["default"].fire({ - icon: 'error', - iconColor: 'red', - title: response.message - }); - } - preloader.classList.remove('js-preloading'); - _context.next = 21; - break; - case 17: - _context.prev = 17; - _context.t0 = _context["catch"](7); - preloader.classList.remove('js-preloading'); - console.error(_context.t0); - case 21: - case "end": - return _context.stop(); - } - }, _callee, null, [[7, 17]]); - })); - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); - }); -} - -/***/ }), - -/***/ "./resources/assets/src/scripts/cart/cart.js": -/*!***************************************************!*\ - !*** ./resources/assets/src/scripts/cart/cart.js ***! - \***************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ initCart: () => (/* binding */ initCart) -/* harmony export */ }); -/* harmony import */ var _cart_remove__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/cart/remove */ "./resources/assets/src/scripts/cart/remove.js"); -/* harmony import */ var _cart_add__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/cart/add */ "./resources/assets/src/scripts/cart/add.js"); -/* harmony import */ var _cart_variations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/cart/variations */ "./resources/assets/src/scripts/cart/variations.js"); -/* harmony import */ var _cart_quantity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/cart/quantity */ "./resources/assets/src/scripts/cart/quantity.js"); - - - - -function initCart() { - (0,_cart_remove__WEBPACK_IMPORTED_MODULE_0__.removeFromCart)(); - (0,_cart_add__WEBPACK_IMPORTED_MODULE_1__.addToCart)(); - (0,_cart_variations__WEBPACK_IMPORTED_MODULE_2__.changeVariations)(); - (0,_cart_quantity__WEBPACK_IMPORTED_MODULE_3__.initQuantity)(); -} - -/***/ }), - -/***/ "./resources/assets/src/scripts/cart/quantity.js": -/*!*******************************************************!*\ - !*** ./resources/assets/src/scripts/cart/quantity.js ***! - \*******************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ initQuantity: () => (/* binding */ initQuantity) -/* harmony export */ }); -function initQuantity() { - var qtyButton = document.querySelector('.js-product-qty'); - var cartButton = document.querySelector('.js-add-to-cart'); - if (qtyButton && cartButton) { - qtyButton.addEventListener('change', function (event) { - cartButton.dataset.quantity = event.target.value; - }); - } -} - -/***/ }), - -/***/ "./resources/assets/src/scripts/cart/remove.js": -/*!*****************************************************!*\ - !*** ./resources/assets/src/scripts/cart/remove.js ***! - \*****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ removeFromCart: () => (/* binding */ removeFromCart) -/* harmony export */ }); -/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - -function removeFromCart() { - var preloader = document.querySelector('.js-preloader-main'); - var cartContainer = document.querySelector('body'); - var totals = document.querySelectorAll('.js-total'); - var subTotals = document.querySelectorAll('.js-sub-total'); - var cartCount = document.querySelector('.js-cart-total'); - cartContainer.addEventListener('click', /*#__PURE__*/function () { - var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) { - var target, formData, _yield$axios$post, response, cartItems; - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - target = event.target; - if (!target.classList.contains('js-remove-from-cart')) { - _context.next = 20; - break; - } - preloader.classList.add('js-preloading'); - formData = new FormData(); - formData.append('action', 'removeFromCart'); - formData.append('nonce', data.nonce); - formData.append('key', target.dataset.key); - _context.prev = 7; - _context.next = 10; - return axios__WEBPACK_IMPORTED_MODULE_0__["default"].post(data.ajax_url, formData, { - params: { - action: 'removeFromCart' - } - }); - case 10: - _yield$axios$post = _context.sent; - response = _yield$axios$post.data; - if (response.type === 'success') { - cartItems = cartContainer.querySelectorAll("[data-key=\"".concat(target.dataset.key, "\"]")); - cartItems.forEach(function (cartItem) { - cartItem.remove(); - }); - totals.forEach(function (totalElement) { - totalElement.innerHTML = response.total; - }); - subTotals.forEach(function (subTotalElement) { - subTotalElement.innerHTML = response.subTotal; - }); - cartCount.innerHTML = response.count; - } - preloader.classList.remove('js-preloading'); - _context.next = 20; - break; - case 16: - _context.prev = 16; - _context.t0 = _context["catch"](7); - console.error(_context.t0); - preloader.classList.remove('js-preloading'); - case 20: - case "end": - return _context.stop(); - } - }, _callee, null, [[7, 16]]); - })); - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); -} - -/***/ }), - -/***/ "./resources/assets/src/scripts/cart/variations.js": -/*!*********************************************************!*\ - !*** ./resources/assets/src/scripts/cart/variations.js ***! - \*********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ changeVariations: () => (/* binding */ changeVariations) -/* harmony export */ }); -function changeVariations() { - var select = document.querySelector('.js-variant'); - if (select) { - var addButton = document.querySelector('.js-add-to-cart'); - select.addEventListener('change', function (event) { - addButton.dataset.variation = event.target.value; - addButton.removeAttribute('disabled'); - }); - } -} - -/***/ }), - -/***/ "./resources/assets/src/scripts/contact.js": -/*!*************************************************!*\ - !*** ./resources/assets/src/scripts/contact.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ initContactForm: () => (/* binding */ initContactForm) -/* harmony export */ }); -/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); -/* harmony import */ var _libs_Toast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./libs/Toast */ "./resources/assets/src/scripts/libs/Toast.js"); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - - -function initContactForm() { - var contactForm = document.querySelector('.js-contact-form'); - if (!contactForm) return; - contactForm.addEventListener('submit', /*#__PURE__*/function () { - var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) { - var formData, preloader, _yield$axios$post, response, toastConfig; - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - event.preventDefault(); - formData = new FormData(contactForm); - formData.append('action', 'contact'); - formData.append('nonce', data.nonce); - preloader = document.querySelector('.js-preloader-main'); - preloader.classList.add('js-preloading'); - _context.prev = 6; - _context.next = 9; - return axios__WEBPACK_IMPORTED_MODULE_1__["default"].post(data.ajax_url, formData, { - params: { - action: 'contact' - } - }); - case 9: - _yield$axios$post = _context.sent; - response = _yield$axios$post.data; - toastConfig = { - icon: response.type, - iconColor: response.type === 'success' ? '#007cba' : 'red', - title: response.message - }; - _libs_Toast__WEBPACK_IMPORTED_MODULE_0__["default"].fire(toastConfig); - _context.next = 18; - break; - case 15: - _context.prev = 15; - _context.t0 = _context["catch"](6); - console.error(_context.t0); - case 18: - preloader.classList.remove('js-preloading'); - contactForm.reset(); - case 20: - case "end": - return _context.stop(); - } - }, _callee, null, [[6, 15]]); - })); - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); -} - -/***/ }), - -/***/ "./resources/assets/src/scripts/libs/Toast.js": -/*!****************************************************!*\ - !*** ./resources/assets/src/scripts/libs/Toast.js ***! - \****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var sweetalert2_dist_sweetalert2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sweetalert2/dist/sweetalert2.js */ "./node_modules/sweetalert2/dist/sweetalert2.js"); -/* harmony import */ var sweetalert2_dist_sweetalert2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sweetalert2_dist_sweetalert2_js__WEBPACK_IMPORTED_MODULE_0__); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sweetalert2_dist_sweetalert2_js__WEBPACK_IMPORTED_MODULE_0___default().mixin({ - toast: true, - position: "top-right", - showClass: { - backdrop: "swal2-noanimation", - popup: "", - icon: "" - }, - showConfirmButton: false, - timer: 2000, - timerProgressBar: true -})); - -/***/ }), - -/***/ "./resources/assets/src/scripts/login.js": -/*!***********************************************!*\ - !*** ./resources/assets/src/scripts/login.js ***! - \***********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ initLoginForm: () => (/* binding */ initLoginForm) -/* harmony export */ }); -/* harmony import */ var _libs_Toast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./libs/Toast */ "./resources/assets/src/scripts/libs/Toast.js"); -/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js"); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - - -function initLoginForm() { - var loginForm = document.querySelector('.js-login-form'); - if (!loginForm) return; - loginForm.addEventListener('submit', /*#__PURE__*/function () { - var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) { - var formData, preloader, _yield$axios$post, response; - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - event.preventDefault(); - formData = new FormData(loginForm); - formData.append('action', 'login'); - formData.append('nonce', data.nonce); - preloader = document.querySelector('.js-preloader-main'); - preloader.classList.add('js-preloading'); - _context.prev = 6; - _context.next = 9; - return axios__WEBPACK_IMPORTED_MODULE_1__["default"].post(data.ajax_url, formData, { - params: { - action: 'login' - } - }); - case 9: - _yield$axios$post = _context.sent; - response = _yield$axios$post.data; - if (response.type === 'success') { - location.reload(); - } else { - _libs_Toast__WEBPACK_IMPORTED_MODULE_0__["default"].fire({ - icon: 'error', - iconColor: 'red', - title: 'Error login' - }); - } - _context.next = 17; - break; - case 14: - _context.prev = 14; - _context.t0 = _context["catch"](6); - console.error(_context.t0); - case 17: - preloader.classList.remove('js-preloading'); - loginForm.reset(); - case 19: - case "end": - return _context.stop(); - } - }, _callee, null, [[6, 14]]); - })); - return function (_x) { - return _ref.apply(this, arguments); - }; - }()); -} - -/***/ }), - -/***/ "./resources/assets/src/scripts/rangeSlider.js": -/*!*****************************************************!*\ - !*** ./resources/assets/src/scripts/rangeSlider.js ***! - \*****************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ initRangeSlider: () => (/* binding */ initRangeSlider) -/* harmony export */ }); -/* harmony import */ var nouislider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! nouislider */ "./node_modules/nouislider/dist/nouislider.mjs"); - -function initRangeSlider() { - var nonLinearStepSlider = document.getElementById('rangeSlider'); - if (nonLinearStepSlider) { - var nonLinearStepSliderValueElement = document.getElementById('slider-non-linear-step-value'); - var slider = nouislider__WEBPACK_IMPORTED_MODULE_0__["default"].create(nonLinearStepSlider, { - start: [0, 100], - connect: true, - range: { - min: 0, - max: 100 - } - }); - nonLinearStepSlider.noUiSlider.on('update', function (values) { - nonLinearStepSliderValueElement.innerHTML = values.join(' - '); - }); - var valueElement = document.getElementById('slider-non-linear-step-value'); - var urlParams = new URLSearchParams(window.location.search); - var setSliderValues = function setSliderValues(values) { - slider.set(values); - valueElement.innerHTML = values.join(' - '); - }; - var minPrice = parseFloat(urlParams.get('min_price')) || 0; - var maxPrice = parseFloat(urlParams.get('max_price')) || 100; - setSliderValues([minPrice, maxPrice]); - slider.on('set', function (values) { - var newUrlParams = new URLSearchParams(urlParams); - newUrlParams.set('min_price', values[0]); - newUrlParams.set('max_price', values[1]); - var newUrl = window.location.pathname + '?' + newUrlParams.toString(); - history.pushState({}, '', newUrl); - location.reload(); - }); - } -} - -/***/ }), - -/***/ "./node_modules/base64-js/index.js": -/*!*****************************************!*\ - !*** ./node_modules/base64-js/index.js ***! - \*****************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) - - return [validLen, placeHoldersLen] -} - -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} - -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - - var curByte = 0 - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen - - var i - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) - } - - return parts.join('') -} - - -/***/ }), - -/***/ "./node_modules/buffer/index.js": -/*!**************************************!*\ - !*** ./node_modules/buffer/index.js ***! - \**************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ - - - -var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js") -var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js") -var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js") - -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = __webpack_require__.g.TYPED_ARRAY_SUPPORT !== undefined - ? __webpack_require__.g.TYPED_ARRAY_SUPPORT - : typedArraySupport() - -/* - * Export kMaxLength after typed array support is determined. - */ -exports.kMaxLength = kMaxLength() - -function typedArraySupport () { - try { - var arr = new Uint8Array(1) - arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} - return arr.foo() === 42 && // typed array instances can be augmented - typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` - arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` - } catch (e) { - return false - } -} - -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff -} - -function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length) - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length) - } - that.length = length - } - - return that -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) -} - -Buffer.poolSize = 8192 // not used by this implementation - -// TODO: Legacy, not needed anymore. Remove in next major version. -Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype - return arr -} - -function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) -} - -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype - Buffer.__proto__ = Uint8Array - if (typeof Symbol !== 'undefined' && Symbol.species && - Buffer[Symbol.species] === Buffer) { - // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true - }) - } -} - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } -} - -function alloc (that, size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) -} - -function allocUnsafe (that, size) { - assertSize(size) - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0 - } - } - return that -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) -} - -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0 - that = createBuffer(that, length) - - var actual = that.write(string, encoding) - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual) - } - - return that -} - -function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - that = createBuffer(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array) - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset) - } else { - array = new Uint8Array(array, byteOffset, length) - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array) - } - return that -} - -function fromObject (that, obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - that = createBuffer(that, len) - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len) - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') -} - -function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 -} - -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} - -Buffer.isBuffer = function isBuffer (b) { - return !!(b != null && b._isBuffer) -} - -Buffer.compare = function compare (a, b) { - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length - var y = b.length - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -} - -Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length - } - } - - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer -} - -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string - } - - var len = string.length - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength - -function slowToString (encoding, start, end) { - var loweredCase = false - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8' - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} - -// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect -// Buffer instances. -Buffer.prototype._isBuffer = true - -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) - } - return this -} - -Buffer.prototype.toString = function toString () { - var length = this.length | 0 - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} - -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} - -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } - return '' -} - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 - - if (this === target) return 0 - - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) - - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } - - // must be an even number of digits - var strLen = string.length - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0 - if (isFinite(length)) { - length = length | 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8' - - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] - - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } - - res.push(codePoint) - i += bytesPerSequence - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length - - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len - - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end - - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } - - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } - - if (end < start) end = start - - var newBuf - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end) - newBuf.__proto__ = Buffer.prototype - } else { - var sliceLen = end - start - newBuf = new Buffer(sliceLen, undefined) - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start] - } - } - - return newBuf -} - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - - return val -} - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } - - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } - - return val -} - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} - -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - this[offset] = (value & 0xff) - return offset + 1 -} - -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8 - } -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff - } -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } - - var len = end - start - var i - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start] - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ) - } - - return len -} - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if (code < 256) { - val = code - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255 - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 - - if (!val) val = 0 - - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()) - var len = bytes.length - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } - - return this -} - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g - -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} - -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } - - // valid lead - leadSurrogate = codePoint - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } - - leadSurrogate = null - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } - - return byteArray -} - -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} - -function isnan (val) { - return val !== val // eslint-disable-line no-self-compare -} - - -/***/ }), - -/***/ "./node_modules/ieee754/index.js": -/*!***************************************!*\ - !*** ./node_modules/ieee754/index.js ***! - \***************************************/ -/***/ ((__unused_webpack_module, exports) => { - -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - - -/***/ }), - -/***/ "./node_modules/isarray/index.js": -/*!***************************************!*\ - !*** ./node_modules/isarray/index.js ***! - \***************************************/ -/***/ ((module) => { - -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - - -/***/ }), - -/***/ "./resources/assets/src/styles/bundle.scss": -/*!*************************************************!*\ - !*** ./resources/assets/src/styles/bundle.scss ***! - \*************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }), - -/***/ "./node_modules/sweetalert2/dist/sweetalert2.js": -/*!******************************************************!*\ - !*** ./node_modules/sweetalert2/dist/sweetalert2.js ***! - \******************************************************/ -/***/ (function(module) { - -/*! -* sweetalert2 v11.10.5 -* Released under the MIT License. -*/ -(function (global, factory) { - true ? module.exports = factory() : - 0; -})(this, (function () { 'use strict'; - - function _callSuper(t, o, e) { - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); - } - function _construct(t, e, r) { - if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); - var o = [null]; - o.push.apply(o, e); - var p = new (t.bind.apply(t, o))(); - return r && _setPrototypeOf(p, r.prototype), p; - } - function _isNativeReflectConstruct() { - try { - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); - } catch (t) {} - return (_isNativeReflectConstruct = function () { - return !!t; - })(); - } - function _iterableToArrayLimit(r, l) { - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (null != t) { - var e, - n, - i, - u, - a = [], - f = !0, - o = !1; - try { - if (i = (t = t.call(r)).next, 0 === l) { - if (Object(t) !== t) return; - f = !1; - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); - } catch (r) { - o = !0, n = r; - } finally { - try { - if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; - } finally { - if (o) throw n; - } - } - return a; - } - } - function _toPrimitive(t, r) { - if ("object" != typeof t || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != typeof i) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); - } - function _toPropertyKey(t) { - var i = _toPrimitive(t, "string"); - return "symbol" == typeof i ? i : String(i); - } - function _typeof(o) { - "@babel/helpers - typeof"; - - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { - return typeof o; - } : function (o) { - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; - }, _typeof(o); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { - writable: false - }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - Object.defineProperty(subClass, "prototype", { - writable: false - }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; - } - function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } else if (call !== void 0) { - throw new TypeError("Derived constructors may only return object or undefined"); - } - return _assertThisInitialized(self); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _get() { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get.bind(); - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(arguments.length < 3 ? target : receiver); - } - return desc.value; - }; - } - return _get.apply(this, arguments); - } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); - } - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return _arrayLikeToArray(arr); - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; - } - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; - return arr2; - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); - return _classApplyDescriptorGet(receiver, descriptor); - } - function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); - _classApplyDescriptorSet(receiver, descriptor, value); - return value; - } - function _classExtractFieldDescriptor(receiver, privateMap, action) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to " + action + " private field on non-instance"); - } - return privateMap.get(receiver); - } - function _classApplyDescriptorGet(receiver, descriptor) { - if (descriptor.get) { - return descriptor.get.call(receiver); - } - return descriptor.value; - } - function _classApplyDescriptorSet(receiver, descriptor, value) { - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - descriptor.value = value; - } - } - function _checkPrivateRedeclaration(obj, privateCollection) { - if (privateCollection.has(obj)) { - throw new TypeError("Cannot initialize the same private elements twice on an object"); - } - } - function _classPrivateFieldInitSpec(obj, privateMap, value) { - _checkPrivateRedeclaration(obj, privateMap); - privateMap.set(obj, value); - } - - var RESTORE_FOCUS_TIMEOUT = 100; - - /** @type {GlobalState} */ - var globalState = {}; - var focusPreviousActiveElement = function focusPreviousActiveElement() { - if (globalState.previousActiveElement instanceof HTMLElement) { - globalState.previousActiveElement.focus(); - globalState.previousActiveElement = null; - } else if (document.body) { - document.body.focus(); - } - }; - - /** - * Restore previous active (focused) element - * - * @param {boolean} returnFocus - * @returns {Promise} - */ - var restoreActiveElement = function restoreActiveElement(returnFocus) { - return new Promise(function (resolve) { - if (!returnFocus) { - return resolve(); - } - var x = window.scrollX; - var y = window.scrollY; - globalState.restoreFocusTimeout = setTimeout(function () { - focusPreviousActiveElement(); - resolve(); - }, RESTORE_FOCUS_TIMEOUT); // issues/900 - - window.scrollTo(x, y); - }); - }; - - var swalPrefix = 'swal2-'; - - /** - * @typedef - * { | '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' - * } SwalClass - * @typedef {Record} SwalClasses - */ - - /** - * @typedef {'success' | 'warning' | 'info' | 'question' | 'error'} SwalIcon - * @typedef {Record} SwalIcons - */ - - /** @type {SwalClass[]} */ - var classNames = ['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']; - var swalClasses = classNames.reduce(function (acc, className) { - acc[className] = swalPrefix + className; - return acc; - }, /** @type {SwalClasses} */{}); - - /** @type {SwalIcon[]} */ - var icons = ['success', 'warning', 'info', 'question', 'error']; - var iconTypes = icons.reduce(function (acc, icon) { - acc[icon] = swalPrefix + icon; - return acc; - }, /** @type {SwalIcons} */{}); - - var consolePrefix = 'SweetAlert2:'; - - /** - * Capitalize the first letter of a string - * - * @param {string} str - * @returns {string} - */ - var capitalizeFirstLetter = function capitalizeFirstLetter(str) { - return str.charAt(0).toUpperCase() + str.slice(1); - }; - - /** - * Standardize console warnings - * - * @param {string | string[]} message - */ - var warn = function warn(message) { - console.warn("".concat(consolePrefix, " ").concat(_typeof(message) === 'object' ? message.join(' ') : message)); - }; - - /** - * Standardize console errors - * - * @param {string} message - */ - var error = function error(message) { - console.error("".concat(consolePrefix, " ").concat(message)); - }; - - /** - * Private global state for `warnOnce` - * - * @type {string[]} - * @private - */ - var previousWarnOnceMessages = []; - - /** - * Show a console warning, but only if it hasn't already been shown - * - * @param {string} message - */ - var warnOnce = function warnOnce(message) { - if (!previousWarnOnceMessages.includes(message)) { - previousWarnOnceMessages.push(message); - warn(message); - } - }; - - /** - * Show a one-time console warning about deprecated params/methods - * - * @param {string} deprecatedParam - * @param {string} useInstead - */ - var warnAboutDeprecation = function warnAboutDeprecation(deprecatedParam, useInstead) { - warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" 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} - */ - var callIfFunction = function callIfFunction(arg) { - return typeof arg === 'function' ? arg() : arg; - }; - - /** - * @param {any} arg - * @returns {boolean} - */ - var hasToPromiseFn = function hasToPromiseFn(arg) { - return arg && typeof arg.toPromise === 'function'; - }; - - /** - * @param {any} arg - * @returns {Promise} - */ - var asPromise = function asPromise(arg) { - return hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg); - }; - - /** - * @param {any} arg - * @returns {boolean} - */ - var isPromise = function isPromise(arg) { - return arg && Promise.resolve(arg) === arg; - }; - - /** - * Gets the popup container which contains the backdrop and the popup itself. - * - * @returns {HTMLElement | null} - */ - var getContainer = function getContainer() { - return document.body.querySelector(".".concat(swalClasses.container)); - }; - - /** - * @param {string} selectorString - * @returns {HTMLElement | null} - */ - var elementBySelector = function elementBySelector(selectorString) { - var container = getContainer(); - return container ? container.querySelector(selectorString) : null; - }; - - /** - * @param {string} className - * @returns {HTMLElement | null} - */ - var elementByClass = function elementByClass(className) { - return elementBySelector(".".concat(className)); - }; - - /** - * @returns {HTMLElement | null} - */ - var getPopup = function getPopup() { - return elementByClass(swalClasses.popup); - }; - - /** - * @returns {HTMLElement | null} - */ - var getIcon = function getIcon() { - return elementByClass(swalClasses.icon); - }; - - /** - * @returns {HTMLElement | null} - */ - var getIconContent = function getIconContent() { - return elementByClass(swalClasses['icon-content']); - }; - - /** - * @returns {HTMLElement | null} - */ - var getTitle = function getTitle() { - return elementByClass(swalClasses.title); - }; - - /** - * @returns {HTMLElement | null} - */ - var getHtmlContainer = function getHtmlContainer() { - return elementByClass(swalClasses['html-container']); - }; - - /** - * @returns {HTMLElement | null} - */ - var getImage = function getImage() { - return elementByClass(swalClasses.image); - }; - - /** - * @returns {HTMLElement | null} - */ - var getProgressSteps = function getProgressSteps() { - return elementByClass(swalClasses['progress-steps']); - }; - - /** - * @returns {HTMLElement | null} - */ - var getValidationMessage = function getValidationMessage() { - return elementByClass(swalClasses['validation-message']); - }; - - /** - * @returns {HTMLButtonElement | null} - */ - var getConfirmButton = function getConfirmButton() { - return /** @type {HTMLButtonElement} */elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.confirm)); - }; - - /** - * @returns {HTMLButtonElement | null} - */ - var getCancelButton = function getCancelButton() { - return /** @type {HTMLButtonElement} */elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.cancel)); - }; - - /** - * @returns {HTMLButtonElement | null} - */ - var getDenyButton = function getDenyButton() { - return /** @type {HTMLButtonElement} */elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.deny)); - }; - - /** - * @returns {HTMLElement | null} - */ - var getInputLabel = function getInputLabel() { - return elementByClass(swalClasses['input-label']); - }; - - /** - * @returns {HTMLElement | null} - */ - var getLoader = function getLoader() { - return elementBySelector(".".concat(swalClasses.loader)); - }; - - /** - * @returns {HTMLElement | null} - */ - var getActions = function getActions() { - return elementByClass(swalClasses.actions); - }; - - /** - * @returns {HTMLElement | null} - */ - var getFooter = function getFooter() { - return elementByClass(swalClasses.footer); - }; - - /** - * @returns {HTMLElement | null} - */ - var getTimerProgressBar = function getTimerProgressBar() { - return elementByClass(swalClasses['timer-progress-bar']); - }; - - /** - * @returns {HTMLElement | null} - */ - var getCloseButton = function getCloseButton() { - return elementByClass(swalClasses.close); - }; - - // https://github.com/jkup/focusable/blob/master/index.js - var focusable = "\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[]} - */ - var getFocusableElements = function getFocusableElements() { - var popup = getPopup(); - if (!popup) { - return []; - } - /** @type {NodeListOf} */ - var focusableElementsWithTabindex = popup.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'); - var focusableElementsWithTabindexSorted = Array.from(focusableElementsWithTabindex) - // sort according to tabindex - .sort(function (a, b) { - var tabindexA = parseInt(a.getAttribute('tabindex') || '0'); - var tabindexB = parseInt(b.getAttribute('tabindex') || '0'); - if (tabindexA > tabindexB) { - return 1; - } else if (tabindexA < tabindexB) { - return -1; - } - return 0; - }); - - /** @type {NodeListOf} */ - var otherFocusableElements = popup.querySelectorAll(focusable); - var otherFocusableElementsFiltered = Array.from(otherFocusableElements).filter(function (el) { - return el.getAttribute('tabindex') !== '-1'; - }); - return _toConsumableArray(new Set(focusableElementsWithTabindexSorted.concat(otherFocusableElementsFiltered))).filter(function (el) { - return isVisible$1(el); - }); - }; - - /** - * @returns {boolean} - */ - var isModal = function isModal() { - return hasClass(document.body, swalClasses.shown) && !hasClass(document.body, swalClasses['toast-shown']) && !hasClass(document.body, swalClasses['no-backdrop']); - }; - - /** - * @returns {boolean} - */ - var isToast = function isToast() { - var popup = getPopup(); - if (!popup) { - return false; - } - return hasClass(popup, swalClasses.toast); - }; - - /** - * @returns {boolean} - */ - var isLoading = function isLoading() { - var popup = getPopup(); - if (!popup) { - return false; - } - return popup.hasAttribute('data-loading'); - }; - - /** - * Securely set innerHTML of an element - * https://github.com/sweetalert2/sweetalert2/issues/1926 - * - * @param {HTMLElement} elem - * @param {string} html - */ - var setInnerHtml = function setInnerHtml(elem, html) { - elem.textContent = ''; - if (html) { - var parser = new DOMParser(); - var parsed = parser.parseFromString(html, "text/html"); - var head = parsed.querySelector('head'); - head && Array.from(head.childNodes).forEach(function (child) { - elem.appendChild(child); - }); - var body = parsed.querySelector('body'); - body && Array.from(body.childNodes).forEach(function (child) { - if (child instanceof HTMLVideoElement || child instanceof HTMLAudioElement) { - elem.appendChild(child.cloneNode(true)); // https://github.com/sweetalert2/sweetalert2/issues/2507 - } else { - elem.appendChild(child); - } - }); - } - }; - - /** - * @param {HTMLElement} elem - * @param {string} className - * @returns {boolean} - */ - var hasClass = function hasClass(elem, className) { - if (!className) { - return false; - } - var classList = className.split(/\s+/); - for (var i = 0; i < classList.length; i++) { - if (!elem.classList.contains(classList[i])) { - return false; - } - } - return true; - }; - - /** - * @param {HTMLElement} elem - * @param {SweetAlertOptions} params - */ - var removeCustomClasses = function removeCustomClasses(elem, params) { - Array.from(elem.classList).forEach(function (className) { - if (!Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && !Object.values(params.showClass || {}).includes(className)) { - elem.classList.remove(className); - } - }); - }; - - /** - * @param {HTMLElement} elem - * @param {SweetAlertOptions} params - * @param {string} className - */ - var applyCustomClass = function applyCustomClass(elem, params, className) { - removeCustomClasses(elem, params); - if (params.customClass && params.customClass[className]) { - if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { - warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(_typeof(params.customClass[className]), "\"")); - return; - } - addClass(elem, params.customClass[className]); - } - }; - - /** - * @param {HTMLElement} popup - * @param {import('./renderers/renderInput').InputClass | SweetAlertInput} inputClass - * @returns {HTMLInputElement | null} - */ - var getInput$1 = function getInput(popup, inputClass) { - if (!inputClass) { - return null; - } - switch (inputClass) { - case 'select': - case 'textarea': - case 'file': - return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses[inputClass])); - case 'checkbox': - return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.checkbox, " input")); - case 'radio': - return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.radio, " input:checked")) || popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.radio, " input:first-child")); - case 'range': - return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.range, " input")); - default: - return popup.querySelector(".".concat(swalClasses.popup, " > .").concat(swalClasses.input)); - } - }; - - /** - * @param {HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement} input - */ - var focusInput = function focusInput(input) { - input.focus(); - - // place cursor at end of text in text input - if (input.type !== 'file') { - // http://stackoverflow.com/a/2345915 - var val = input.value; - input.value = ''; - input.value = val; - } - }; - - /** - * @param {HTMLElement | HTMLElement[] | null} target - * @param {string | string[] | readonly string[] | undefined} classList - * @param {boolean} condition - */ - var toggleClass = function toggleClass(target, classList, condition) { - if (!target || !classList) { - return; - } - if (typeof classList === 'string') { - classList = classList.split(/\s+/).filter(Boolean); - } - classList.forEach(function (className) { - if (Array.isArray(target)) { - target.forEach(function (elem) { - condition ? elem.classList.add(className) : elem.classList.remove(className); - }); - } else { - condition ? target.classList.add(className) : target.classList.remove(className); - } - }); - }; - - /** - * @param {HTMLElement | HTMLElement[] | null} target - * @param {string | string[] | readonly string[] | undefined} classList - */ - var addClass = function addClass(target, classList) { - toggleClass(target, classList, true); - }; - - /** - * @param {HTMLElement | HTMLElement[] | null} target - * @param {string | string[] | readonly string[] | undefined} classList - */ - var removeClass = function removeClass(target, classList) { - toggleClass(target, classList, false); - }; - - /** - * Get direct child of an element by class name - * - * @param {HTMLElement} elem - * @param {string} className - * @returns {HTMLElement | undefined} - */ - var getDirectChildByClass = function getDirectChildByClass(elem, className) { - var children = Array.from(elem.children); - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (child instanceof HTMLElement && hasClass(child, className)) { - return child; - } - } - }; - - /** - * @param {HTMLElement} elem - * @param {string} property - * @param {*} value - */ - var applyNumericalStyle = function applyNumericalStyle(elem, property, value) { - if (value === "".concat(parseInt(value))) { - value = parseInt(value); - } - if (value || parseInt(value) === 0) { - elem.style.setProperty(property, typeof value === 'number' ? "".concat(value, "px") : value); - } else { - elem.style.removeProperty(property); - } - }; - - /** - * @param {HTMLElement | null} elem - * @param {string} display - */ - var show = function show(elem) { - var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex'; - elem && (elem.style.display = display); - }; - - /** - * @param {HTMLElement | null} elem - */ - var hide = function hide(elem) { - elem && (elem.style.display = 'none'); - }; - - /** - * @param {HTMLElement | null} elem - * @param {string} display - */ - var showWhenInnerHtmlPresent = function showWhenInnerHtmlPresent(elem) { - var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'block'; - if (!elem) { - return; - } - new MutationObserver(function () { - toggle(elem, elem.innerHTML, display); - }).observe(elem, { - childList: true, - subtree: true - }); - }; - - /** - * @param {HTMLElement} parent - * @param {string} selector - * @param {string} property - * @param {string} value - */ - var setStyle = function setStyle(parent, selector, property, value) { - /** @type {HTMLElement | null} */ - var el = parent.querySelector(selector); - if (el) { - el.style.setProperty(property, value); - } - }; - - /** - * @param {HTMLElement} elem - * @param {any} condition - * @param {string} display - */ - var toggle = function toggle(elem, condition) { - var display = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'flex'; - condition ? show(elem, display) : hide(elem); - }; - - /** - * borrowed from jquery $(elem).is(':visible') implementation - * - * @param {HTMLElement | null} elem - * @returns {boolean} - */ - var isVisible$1 = function isVisible(elem) { - return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); - }; - - /** - * @returns {boolean} - */ - var allButtonsAreHidden = function allButtonsAreHidden() { - return !isVisible$1(getConfirmButton()) && !isVisible$1(getDenyButton()) && !isVisible$1(getCancelButton()); - }; - - /** - * @param {HTMLElement} elem - * @returns {boolean} - */ - var isScrollable = function isScrollable(elem) { - return !!(elem.scrollHeight > elem.clientHeight); - }; - - /** - * borrowed from https://stackoverflow.com/a/46352119 - * - * @param {HTMLElement} elem - * @returns {boolean} - */ - var hasCssAnimation = function hasCssAnimation(elem) { - var style = window.getComputedStyle(elem); - var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); - var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); - return animDuration > 0 || transDuration > 0; - }; - - /** - * @param {number} timer - * @param {boolean} reset - */ - var animateTimerProgressBar = function animateTimerProgressBar(timer) { - var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var timerProgressBar = getTimerProgressBar(); - if (!timerProgressBar) { - return; - } - if (isVisible$1(timerProgressBar)) { - if (reset) { - timerProgressBar.style.transition = 'none'; - timerProgressBar.style.width = '100%'; - } - setTimeout(function () { - timerProgressBar.style.transition = "width ".concat(timer / 1000, "s linear"); - timerProgressBar.style.width = '0%'; - }, 10); - } - }; - var stopTimerProgressBar = function stopTimerProgressBar() { - var timerProgressBar = getTimerProgressBar(); - if (!timerProgressBar) { - return; - } - var timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); - timerProgressBar.style.removeProperty('transition'); - timerProgressBar.style.width = '100%'; - var timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); - var timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100; - timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%"); - }; - - /** - * Detect Node env - * - * @returns {boolean} - */ - var isNodeEnv = function isNodeEnv() { - return typeof window === 'undefined' || typeof document === 'undefined'; - }; - - var sweetHTML = "\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} - */ - var resetOldContainer = function resetOldContainer() { - var oldContainer = getContainer(); - if (!oldContainer) { - return false; - } - oldContainer.remove(); - removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); - return true; - }; - var resetValidationMessage$1 = function resetValidationMessage() { - globalState.currentInstance.resetValidationMessage(); - }; - var addInputChangeListeners = function addInputChangeListeners() { - var popup = getPopup(); - var input = getDirectChildByClass(popup, swalClasses.input); - var file = getDirectChildByClass(popup, swalClasses.file); - /** @type {HTMLInputElement} */ - var range = popup.querySelector(".".concat(swalClasses.range, " input")); - /** @type {HTMLOutputElement} */ - var rangeOutput = popup.querySelector(".".concat(swalClasses.range, " output")); - var select = getDirectChildByClass(popup, swalClasses.select); - /** @type {HTMLInputElement} */ - var checkbox = popup.querySelector(".".concat(swalClasses.checkbox, " input")); - var textarea = getDirectChildByClass(popup, swalClasses.textarea); - input.oninput = resetValidationMessage$1; - file.onchange = resetValidationMessage$1; - select.onchange = resetValidationMessage$1; - checkbox.onchange = resetValidationMessage$1; - textarea.oninput = resetValidationMessage$1; - range.oninput = function () { - resetValidationMessage$1(); - rangeOutput.value = range.value; - }; - range.onchange = function () { - resetValidationMessage$1(); - rangeOutput.value = range.value; - }; - }; - - /** - * @param {string | HTMLElement} target - * @returns {HTMLElement} - */ - var getTarget = function getTarget(target) { - return typeof target === 'string' ? document.querySelector(target) : target; - }; - - /** - * @param {SweetAlertOptions} params - */ - var setupAccessibility = function setupAccessibility(params) { - var popup = getPopup(); - popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); - popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); - if (!params.toast) { - popup.setAttribute('aria-modal', 'true'); - } - }; - - /** - * @param {HTMLElement} targetElement - */ - var setupRTL = function setupRTL(targetElement) { - if (window.getComputedStyle(targetElement).direction === 'rtl') { - addClass(getContainer(), swalClasses.rtl); - } - }; - - /** - * Add modal + backdrop + no-war message for Russians to DOM - * - * @param {SweetAlertOptions} params - */ - var init = function init(params) { - // Clean up the old popup container if it exists - var oldContainerExisted = resetOldContainer(); - if (isNodeEnv()) { - error('SweetAlert2 requires document to initialize'); - return; - } - var container = document.createElement('div'); - container.className = swalClasses.container; - if (oldContainerExisted) { - addClass(container, swalClasses['no-transition']); - } - setInnerHtml(container, sweetHTML); - var targetElement = getTarget(params.target); - targetElement.appendChild(container); - setupAccessibility(params); - setupRTL(targetElement); - addInputChangeListeners(); - }; - - /** - * @param {HTMLElement | object | string} param - * @param {HTMLElement} target - */ - var parseHtmlToContainer = function parseHtmlToContainer(param, target) { - // DOM element - if (param instanceof HTMLElement) { - target.appendChild(param); - } - - // Object - else if (_typeof(param) === 'object') { - handleObject(param, target); - } - - // Plain string - else if (param) { - setInnerHtml(target, param); - } - }; - - /** - * @param {any} param - * @param {HTMLElement} target - */ - var handleObject = function handleObject(param, target) { - // JQuery element(s) - if (param.jquery) { - handleJqueryElem(target, param); - } - - // For other objects use their string representation - else { - setInnerHtml(target, param.toString()); - } - }; - - /** - * @param {HTMLElement} target - * @param {any} elem - */ - var handleJqueryElem = function handleJqueryElem(target, elem) { - target.textContent = ''; - if (0 in elem) { - for (var i = 0; (i in elem); i++) { - target.appendChild(elem[i].cloneNode(true)); - } - } else { - target.appendChild(elem.cloneNode(true)); - } - }; - - /** - * @returns {'webkitAnimationEnd' | 'animationend' | false} - */ - var animationEndEvent = function () { - // Prevent run in Node env - if (isNodeEnv()) { - return false; - } - var testEl = document.createElement('div'); - - // Chrome, Safari and Opera - if (typeof testEl.style.webkitAnimation !== 'undefined') { - return 'webkitAnimationEnd'; - } - - // Standard syntax - if (typeof testEl.style.animation !== 'undefined') { - return 'animationend'; - } - return false; - }(); - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderActions = function renderActions(instance, params) { - var actions = getActions(); - var loader = getLoader(); - if (!actions || !loader) { - return; - } - - // Actions (buttons) wrapper - if (!params.showConfirmButton && !params.showDenyButton && !params.showCancelButton) { - hide(actions); - } else { - show(actions); - } - - // Custom class - applyCustomClass(actions, params, 'actions'); - - // Render all the buttons - renderButtons(actions, loader, params); - - // Loader - setInnerHtml(loader, params.loaderHtml || ''); - applyCustomClass(loader, params, 'loader'); - }; - - /** - * @param {HTMLElement} actions - * @param {HTMLElement} loader - * @param {SweetAlertOptions} params - */ - function renderButtons(actions, loader, params) { - var confirmButton = getConfirmButton(); - var denyButton = getDenyButton(); - var cancelButton = getCancelButton(); - if (!confirmButton || !denyButton || !cancelButton) { - return; - } - - // Render buttons - renderButton(confirmButton, 'confirm', params); - renderButton(denyButton, 'deny', params); - renderButton(cancelButton, 'cancel', params); - handleButtonsStyling(confirmButton, denyButton, cancelButton, params); - if (params.reverseButtons) { - if (params.toast) { - actions.insertBefore(cancelButton, confirmButton); - actions.insertBefore(denyButton, confirmButton); - } else { - actions.insertBefore(cancelButton, loader); - actions.insertBefore(denyButton, loader); - actions.insertBefore(confirmButton, loader); - } - } - } - - /** - * @param {HTMLElement} confirmButton - * @param {HTMLElement} denyButton - * @param {HTMLElement} cancelButton - * @param {SweetAlertOptions} params - */ - function handleButtonsStyling(confirmButton, denyButton, cancelButton, params) { - if (!params.buttonsStyling) { - removeClass([confirmButton, denyButton, cancelButton], swalClasses.styled); - return; - } - addClass([confirmButton, denyButton, cancelButton], swalClasses.styled); - - // Buttons background colors - if (params.confirmButtonColor) { - confirmButton.style.backgroundColor = params.confirmButtonColor; - addClass(confirmButton, swalClasses['default-outline']); - } - if (params.denyButtonColor) { - denyButton.style.backgroundColor = params.denyButtonColor; - addClass(denyButton, swalClasses['default-outline']); - } - if (params.cancelButtonColor) { - cancelButton.style.backgroundColor = params.cancelButtonColor; - addClass(cancelButton, swalClasses['default-outline']); - } - } - - /** - * @param {HTMLElement} button - * @param {'confirm' | 'deny' | 'cancel'} buttonType - * @param {SweetAlertOptions} params - */ - function renderButton(button, buttonType, params) { - var buttonName = /** @type {'Confirm' | 'Deny' | 'Cancel'} */capitalizeFirstLetter(buttonType); - toggle(button, params["show".concat(buttonName, "Button")], 'inline-block'); - setInnerHtml(button, params["".concat(buttonType, "ButtonText")] || ''); // Set caption text - button.setAttribute('aria-label', params["".concat(buttonType, "ButtonAriaLabel")] || ''); // ARIA label - - // Add buttons custom classes - button.className = swalClasses[buttonType]; - applyCustomClass(button, params, "".concat(buttonType, "Button")); - } - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderCloseButton = function renderCloseButton(instance, params) { - var closeButton = getCloseButton(); - if (!closeButton) { - return; - } - setInnerHtml(closeButton, params.closeButtonHtml || ''); - - // Custom class - applyCustomClass(closeButton, params, 'closeButton'); - toggle(closeButton, params.showCloseButton); - closeButton.setAttribute('aria-label', params.closeButtonAriaLabel || ''); - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderContainer = function renderContainer(instance, params) { - var container = getContainer(); - if (!container) { - return; - } - handleBackdropParam(container, params.backdrop); - handlePositionParam(container, params.position); - handleGrowParam(container, params.grow); - - // Custom class - applyCustomClass(container, params, 'container'); - }; - - /** - * @param {HTMLElement} container - * @param {SweetAlertOptions['backdrop']} backdrop - */ - function handleBackdropParam(container, backdrop) { - if (typeof backdrop === 'string') { - container.style.background = backdrop; - } else if (!backdrop) { - addClass([document.documentElement, document.body], swalClasses['no-backdrop']); - } - } - - /** - * @param {HTMLElement} container - * @param {SweetAlertOptions['position']} position - */ - function handlePositionParam(container, position) { - if (!position) { - return; - } - if (position in swalClasses) { - addClass(container, swalClasses[position]); - } else { - warn('The "position" parameter is not valid, defaulting to "center"'); - addClass(container, swalClasses.center); - } - } - - /** - * @param {HTMLElement} container - * @param {SweetAlertOptions['grow']} grow - */ - function handleGrowParam(container, grow) { - if (!grow) { - return; - } - addClass(container, swalClasses["grow-".concat(grow)]); - } - - /** - * This module contains `WeakMap`s for each effectively-"private property" that a `Swal` has. - * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` - * This is the approach that Babel will probably take to implement private methods/fields - * https://github.com/tc39/proposal-private-methods - * https://github.com/babel/babel/pull/7555 - * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* - * then we can use that language feature. - */ - - var privateProps = { - innerParams: new WeakMap(), - domCache: new WeakMap() - }; - - /** @type {InputClass[]} */ - var inputClasses = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderInput = function renderInput(instance, params) { - var popup = getPopup(); - if (!popup) { - return; - } - var innerParams = privateProps.innerParams.get(instance); - var rerender = !innerParams || params.input !== innerParams.input; - inputClasses.forEach(function (inputClass) { - var inputContainer = getDirectChildByClass(popup, swalClasses[inputClass]); - if (!inputContainer) { - return; - } - - // set attributes - setAttributes(inputClass, params.inputAttributes); - - // set class - inputContainer.className = swalClasses[inputClass]; - if (rerender) { - hide(inputContainer); - } - }); - if (params.input) { - if (rerender) { - showInput(params); - } - // set custom class - setCustomClass(params); - } - }; - - /** - * @param {SweetAlertOptions} params - */ - var showInput = function showInput(params) { - if (!params.input) { - return; - } - if (!renderInputType[params.input]) { - error("Unexpected type of input! Expected ".concat(Object.keys(renderInputType).join(' | '), ", got \"").concat(params.input, "\"")); - return; - } - var inputContainer = getInputContainer(params.input); - var input = renderInputType[params.input](inputContainer, params); - show(inputContainer); - - // input autofocus - if (params.inputAutoFocus) { - setTimeout(function () { - focusInput(input); - }); - } - }; - - /** - * @param {HTMLInputElement} input - */ - var removeAttributes = function removeAttributes(input) { - for (var i = 0; i < input.attributes.length; i++) { - var attrName = input.attributes[i].name; - if (!['id', 'type', 'value', 'style'].includes(attrName)) { - input.removeAttribute(attrName); - } - } - }; - - /** - * @param {InputClass} inputClass - * @param {SweetAlertOptions['inputAttributes']} inputAttributes - */ - var setAttributes = function setAttributes(inputClass, inputAttributes) { - var input = getInput$1(getPopup(), inputClass); - if (!input) { - return; - } - removeAttributes(input); - for (var attr in inputAttributes) { - input.setAttribute(attr, inputAttributes[attr]); - } - }; - - /** - * @param {SweetAlertOptions} params - */ - var setCustomClass = function setCustomClass(params) { - var inputContainer = getInputContainer(params.input); - if (_typeof(params.customClass) === 'object') { - addClass(inputContainer, params.customClass.input); - } - }; - - /** - * @param {HTMLInputElement | HTMLTextAreaElement} input - * @param {SweetAlertOptions} params - */ - var setInputPlaceholder = function setInputPlaceholder(input, params) { - if (!input.placeholder || params.inputPlaceholder) { - input.placeholder = params.inputPlaceholder; - } - }; - - /** - * @param {Input} input - * @param {Input} prependTo - * @param {SweetAlertOptions} params - */ - var setInputLabel = function setInputLabel(input, prependTo, params) { - if (params.inputLabel) { - var label = document.createElement('label'); - var labelClass = swalClasses['input-label']; - label.setAttribute('for', input.id); - label.className = labelClass; - if (_typeof(params.customClass) === 'object') { - addClass(label, params.customClass.inputLabel); - } - label.innerText = params.inputLabel; - prependTo.insertAdjacentElement('beforebegin', label); - } - }; - - /** - * @param {SweetAlertOptions['input']} inputType - * @returns {HTMLElement} - */ - var getInputContainer = function getInputContainer(inputType) { - return getDirectChildByClass(getPopup(), swalClasses[inputType] || swalClasses.input); - }; - - /** - * @param {HTMLInputElement | HTMLOutputElement | HTMLTextAreaElement} input - * @param {SweetAlertOptions['inputValue']} inputValue - */ - var checkAndSetInputValue = function checkAndSetInputValue(input, inputValue) { - if (['string', 'number'].includes(_typeof(inputValue))) { - input.value = "".concat(inputValue); - } else if (!isPromise(inputValue)) { - warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(inputValue), "\"")); - } - }; - - /** @type {Record Input>} */ - var renderInputType = {}; - - /** - * @param {HTMLInputElement} input - * @param {SweetAlertOptions} params - * @returns {HTMLInputElement} - */ - renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = renderInputType.search = renderInputType.date = renderInputType['datetime-local'] = renderInputType.time = renderInputType.week = renderInputType.month = function (input, params) { - checkAndSetInputValue(input, params.inputValue); - setInputLabel(input, input, params); - setInputPlaceholder(input, params); - input.type = params.input; - return input; - }; - - /** - * @param {HTMLInputElement} input - * @param {SweetAlertOptions} params - * @returns {HTMLInputElement} - */ - renderInputType.file = function (input, params) { - setInputLabel(input, input, params); - setInputPlaceholder(input, params); - return input; - }; - - /** - * @param {HTMLInputElement} range - * @param {SweetAlertOptions} params - * @returns {HTMLInputElement} - */ - renderInputType.range = function (range, params) { - var rangeInput = range.querySelector('input'); - var rangeOutput = range.querySelector('output'); - checkAndSetInputValue(rangeInput, params.inputValue); - rangeInput.type = params.input; - checkAndSetInputValue(rangeOutput, params.inputValue); - setInputLabel(rangeInput, range, params); - return range; - }; - - /** - * @param {HTMLSelectElement} select - * @param {SweetAlertOptions} params - * @returns {HTMLSelectElement} - */ - renderInputType.select = function (select, params) { - select.textContent = ''; - if (params.inputPlaceholder) { - var placeholder = document.createElement('option'); - setInnerHtml(placeholder, params.inputPlaceholder); - placeholder.value = ''; - placeholder.disabled = true; - placeholder.selected = true; - select.appendChild(placeholder); - } - setInputLabel(select, select, params); - return select; - }; - - /** - * @param {HTMLInputElement} radio - * @returns {HTMLInputElement} - */ - renderInputType.radio = function (radio) { - radio.textContent = ''; - return radio; - }; - - /** - * @param {HTMLLabelElement} checkboxContainer - * @param {SweetAlertOptions} params - * @returns {HTMLInputElement} - */ - renderInputType.checkbox = function (checkboxContainer, params) { - var checkbox = getInput$1(getPopup(), 'checkbox'); - checkbox.value = '1'; - checkbox.checked = Boolean(params.inputValue); - var label = checkboxContainer.querySelector('span'); - setInnerHtml(label, params.inputPlaceholder); - return checkbox; - }; - - /** - * @param {HTMLTextAreaElement} textarea - * @param {SweetAlertOptions} params - * @returns {HTMLTextAreaElement} - */ - renderInputType.textarea = function (textarea, params) { - checkAndSetInputValue(textarea, params.inputValue); - setInputPlaceholder(textarea, params); - setInputLabel(textarea, textarea, params); - - /** - * @param {HTMLElement} el - * @returns {number} - */ - var getMargin = function getMargin(el) { - return parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight); - }; - - // https://github.com/sweetalert2/sweetalert2/issues/2291 - setTimeout(function () { - // https://github.com/sweetalert2/sweetalert2/issues/1699 - if ('MutationObserver' in window) { - var initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); - var textareaResizeHandler = function textareaResizeHandler() { - // check if texarea is still in document (i.e. popup wasn't closed in the meantime) - if (!document.body.contains(textarea)) { - return; - } - var textareaWidth = textarea.offsetWidth + getMargin(textarea); - if (textareaWidth > initialPopupWidth) { - getPopup().style.width = "".concat(textareaWidth, "px"); - } else { - applyNumericalStyle(getPopup(), 'width', params.width); - } - }; - new MutationObserver(textareaResizeHandler).observe(textarea, { - attributes: true, - attributeFilter: ['style'] - }); - } - }); - return textarea; - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderContent = function renderContent(instance, params) { - var htmlContainer = getHtmlContainer(); - if (!htmlContainer) { - return; - } - showWhenInnerHtmlPresent(htmlContainer); - applyCustomClass(htmlContainer, params, 'htmlContainer'); - - // Content as HTML - if (params.html) { - parseHtmlToContainer(params.html, htmlContainer); - show(htmlContainer, 'block'); - } - - // Content as plain text - else if (params.text) { - htmlContainer.textContent = params.text; - show(htmlContainer, 'block'); - } - - // No content - else { - hide(htmlContainer); - } - renderInput(instance, params); - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderFooter = function renderFooter(instance, params) { - var footer = getFooter(); - if (!footer) { - return; - } - showWhenInnerHtmlPresent(footer); - toggle(footer, params.footer, 'block'); - if (params.footer) { - parseHtmlToContainer(params.footer, footer); - } - - // Custom class - applyCustomClass(footer, params, 'footer'); - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderIcon = function renderIcon(instance, params) { - var innerParams = privateProps.innerParams.get(instance); - var icon = getIcon(); - if (!icon) { - return; - } - - // if the given icon already rendered, apply the styling without re-rendering the icon - if (innerParams && params.icon === innerParams.icon) { - // Custom or default content - setContent(icon, params); - applyStyles(icon, params); - return; - } - if (!params.icon && !params.iconHtml) { - hide(icon); - return; - } - if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) { - error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\"")); - hide(icon); - return; - } - show(icon); - - // Custom or default content - setContent(icon, params); - applyStyles(icon, params); - - // Animate icon - addClass(icon, params.showClass && params.showClass.icon); - }; - - /** - * @param {HTMLElement} icon - * @param {SweetAlertOptions} params - */ - var applyStyles = function applyStyles(icon, params) { - for (var _i = 0, _Object$entries = Object.entries(iconTypes); _i < _Object$entries.length; _i++) { - var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), - iconType = _Object$entries$_i[0], - iconClassName = _Object$entries$_i[1]; - if (params.icon !== iconType) { - removeClass(icon, iconClassName); - } - } - addClass(icon, params.icon && iconTypes[params.icon]); - - // Icon color - setColor(icon, params); - - // Success icon background color - adjustSuccessIconBackgroundColor(); - - // Custom class - applyCustomClass(icon, params, 'icon'); - }; - - // Adjust success icon background color to match the popup background color - var adjustSuccessIconBackgroundColor = function adjustSuccessIconBackgroundColor() { - var popup = getPopup(); - if (!popup) { - return; - } - var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); - /** @type {NodeListOf} */ - var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); - for (var i = 0; i < successIconParts.length; i++) { - successIconParts[i].style.backgroundColor = popupBackgroundColor; - } - }; - var successIconHtml = "\n
    \n \n
    \n
    \n"; - var errorIconHtml = "\n \n \n \n \n"; - - /** - * @param {HTMLElement} icon - * @param {SweetAlertOptions} params - */ - var setContent = function setContent(icon, params) { - if (!params.icon && !params.iconHtml) { - return; - } - var oldContent = icon.innerHTML; - var newContent = ''; - if (params.iconHtml) { - newContent = iconContent(params.iconHtml); - } else if (params.icon === 'success') { - newContent = successIconHtml; - oldContent = oldContent.replace(/ style=".*?"/g, ''); // undo adjustSuccessIconBackgroundColor() - } else if (params.icon === 'error') { - newContent = errorIconHtml; - } else if (params.icon) { - var defaultIconHtml = { - question: '?', - warning: '!', - info: 'i' - }; - newContent = iconContent(defaultIconHtml[params.icon]); - } - if (oldContent.trim() !== newContent.trim()) { - setInnerHtml(icon, newContent); - } - }; - - /** - * @param {HTMLElement} icon - * @param {SweetAlertOptions} params - */ - var setColor = function setColor(icon, params) { - if (!params.iconColor) { - return; - } - icon.style.color = params.iconColor; - icon.style.borderColor = params.iconColor; - for (var _i2 = 0, _arr = ['.swal2-success-line-tip', '.swal2-success-line-long', '.swal2-x-mark-line-left', '.swal2-x-mark-line-right']; _i2 < _arr.length; _i2++) { - var sel = _arr[_i2]; - setStyle(icon, sel, 'background-color', params.iconColor); - } - setStyle(icon, '.swal2-success-ring', 'border-color', params.iconColor); - }; - - /** - * @param {string} content - * @returns {string} - */ - var iconContent = function iconContent(content) { - return "
    ").concat(content, "
    "); - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderImage = function renderImage(instance, params) { - var image = getImage(); - if (!image) { - return; - } - if (!params.imageUrl) { - hide(image); - return; - } - show(image, ''); - - // Src, alt - image.setAttribute('src', params.imageUrl); - image.setAttribute('alt', params.imageAlt || ''); - - // Width, height - applyNumericalStyle(image, 'width', params.imageWidth); - applyNumericalStyle(image, 'height', params.imageHeight); - - // Class - image.className = swalClasses.image; - applyCustomClass(image, params, 'image'); - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderPopup = function renderPopup(instance, params) { - var container = getContainer(); - var popup = getPopup(); - if (!container || !popup) { - return; - } - - // Width - // https://github.com/sweetalert2/sweetalert2/issues/2170 - if (params.toast) { - applyNumericalStyle(container, 'width', params.width); - popup.style.width = '100%'; - var loader = getLoader(); - loader && popup.insertBefore(loader, getIcon()); - } else { - applyNumericalStyle(popup, 'width', params.width); - } - - // Padding - applyNumericalStyle(popup, 'padding', params.padding); - - // Color - if (params.color) { - popup.style.color = params.color; - } - - // Background - if (params.background) { - popup.style.background = params.background; - } - hide(getValidationMessage()); - - // Classes - addClasses$1(popup, params); - }; - - /** - * @param {HTMLElement} popup - * @param {SweetAlertOptions} params - */ - var addClasses$1 = function addClasses(popup, params) { - var showClass = params.showClass || {}; - // Default Class + showClass when updating Swal.update({}) - popup.className = "".concat(swalClasses.popup, " ").concat(isVisible$1(popup) ? showClass.popup : ''); - if (params.toast) { - addClass([document.documentElement, document.body], swalClasses['toast-shown']); - addClass(popup, swalClasses.toast); - } else { - addClass(popup, swalClasses.modal); - } - - // Custom class - applyCustomClass(popup, params, 'popup'); - if (typeof params.customClass === 'string') { - addClass(popup, params.customClass); - } - - // Icon class (#1842) - if (params.icon) { - addClass(popup, swalClasses["icon-".concat(params.icon)]); - } - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderProgressSteps = function renderProgressSteps(instance, params) { - var progressStepsContainer = getProgressSteps(); - if (!progressStepsContainer) { - return; - } - var progressSteps = params.progressSteps, - currentProgressStep = params.currentProgressStep; - if (!progressSteps || progressSteps.length === 0 || currentProgressStep === undefined) { - hide(progressStepsContainer); - return; - } - show(progressStepsContainer); - progressStepsContainer.textContent = ''; - if (currentProgressStep >= progressSteps.length) { - warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); - } - progressSteps.forEach(function (step, index) { - var stepEl = createStepElement(step); - progressStepsContainer.appendChild(stepEl); - if (index === currentProgressStep) { - addClass(stepEl, swalClasses['active-progress-step']); - } - if (index !== progressSteps.length - 1) { - var lineEl = createLineElement(params); - progressStepsContainer.appendChild(lineEl); - } - }); - }; - - /** - * @param {string} step - * @returns {HTMLLIElement} - */ - var createStepElement = function createStepElement(step) { - var stepEl = document.createElement('li'); - addClass(stepEl, swalClasses['progress-step']); - setInnerHtml(stepEl, step); - return stepEl; - }; - - /** - * @param {SweetAlertOptions} params - * @returns {HTMLLIElement} - */ - var createLineElement = function createLineElement(params) { - var lineEl = document.createElement('li'); - addClass(lineEl, swalClasses['progress-step-line']); - if (params.progressStepsDistance) { - applyNumericalStyle(lineEl, 'width', params.progressStepsDistance); - } - return lineEl; - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var renderTitle = function renderTitle(instance, params) { - var title = getTitle(); - if (!title) { - return; - } - showWhenInnerHtmlPresent(title); - toggle(title, params.title || params.titleText, 'block'); - if (params.title) { - parseHtmlToContainer(params.title, title); - } - if (params.titleText) { - title.innerText = params.titleText; - } - - // Custom class - applyCustomClass(title, params, 'title'); - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var render = function render(instance, params) { - renderPopup(instance, params); - renderContainer(instance, params); - renderProgressSteps(instance, params); - renderIcon(instance, params); - renderImage(instance, params); - renderTitle(instance, params); - renderCloseButton(instance, params); - renderContent(instance, params); - renderActions(instance, params); - renderFooter(instance, params); - var popup = getPopup(); - if (typeof params.didRender === 'function' && popup) { - params.didRender(popup); - } - }; - - /* - * Global function to determine if SweetAlert2 popup is shown - */ - var isVisible = function isVisible() { - return isVisible$1(getPopup()); - }; - - /* - * Global function to click 'Confirm' button - */ - var clickConfirm = function clickConfirm() { - var _dom$getConfirmButton; - return (_dom$getConfirmButton = getConfirmButton()) === null || _dom$getConfirmButton === void 0 ? void 0 : _dom$getConfirmButton.click(); - }; - - /* - * Global function to click 'Deny' button - */ - var clickDeny = function clickDeny() { - var _dom$getDenyButton; - return (_dom$getDenyButton = getDenyButton()) === null || _dom$getDenyButton === void 0 ? void 0 : _dom$getDenyButton.click(); - }; - - /* - * Global function to click 'Cancel' button - */ - var clickCancel = function clickCancel() { - var _dom$getCancelButton; - return (_dom$getCancelButton = getCancelButton()) === null || _dom$getCancelButton === void 0 ? void 0 : _dom$getCancelButton.click(); - }; - - /** @typedef {'cancel' | 'backdrop' | 'close' | 'esc' | 'timer'} DismissReason */ - - /** @type {Record} */ - var DismissReason = Object.freeze({ - cancel: 'cancel', - backdrop: 'backdrop', - close: 'close', - esc: 'esc', - timer: 'timer' - }); - - /** - * @param {GlobalState} globalState - */ - var removeKeydownHandler = function removeKeydownHandler(globalState) { - if (globalState.keydownTarget && globalState.keydownHandlerAdded) { - globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { - capture: globalState.keydownListenerCapture - }); - globalState.keydownHandlerAdded = false; - } - }; - - /** - * @param {GlobalState} globalState - * @param {SweetAlertOptions} innerParams - * @param {*} dismissWith - */ - var addKeydownHandler = function addKeydownHandler(globalState, innerParams, dismissWith) { - removeKeydownHandler(globalState); - if (!innerParams.toast) { - globalState.keydownHandler = function (e) { - return keydownHandler(innerParams, e, dismissWith); - }; - globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); - globalState.keydownListenerCapture = innerParams.keydownListenerCapture; - globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { - capture: globalState.keydownListenerCapture - }); - globalState.keydownHandlerAdded = true; - } - }; - - /** - * @param {number} index - * @param {number} increment - */ - var setFocus = function setFocus(index, increment) { - var _dom$getPopup; - var focusableElements = getFocusableElements(); - // search for visible elements and select the next possible match - if (focusableElements.length) { - index = index + increment; - - // rollover to first item - if (index === focusableElements.length) { - index = 0; - - // go to last item - } else if (index === -1) { - index = focusableElements.length - 1; - } - focusableElements[index].focus(); - return; - } - // no visible focusable elements, focus the popup - (_dom$getPopup = getPopup()) === null || _dom$getPopup === void 0 || _dom$getPopup.focus(); - }; - var arrowKeysNextButton = ['ArrowRight', 'ArrowDown']; - var arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp']; - - /** - * @param {SweetAlertOptions} innerParams - * @param {KeyboardEvent} event - * @param {Function} dismissWith - */ - var keydownHandler = function keydownHandler(innerParams, event, dismissWith) { - if (!innerParams) { - return; // This instance has already been destroyed - } - - // Ignore keydown during IME composition - // https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event#ignoring_keydown_during_ime_composition - // https://github.com/sweetalert2/sweetalert2/issues/720 - // https://github.com/sweetalert2/sweetalert2/issues/2406 - if (event.isComposing || event.keyCode === 229) { - return; - } - if (innerParams.stopKeydownPropagation) { - event.stopPropagation(); - } - - // ENTER - if (event.key === 'Enter') { - handleEnter(event, innerParams); - } - - // TAB - else if (event.key === 'Tab') { - handleTab(event); - } - - // ARROWS - switch focus between buttons - else if ([].concat(arrowKeysNextButton, arrowKeysPreviousButton).includes(event.key)) { - handleArrows(event.key); - } - - // ESC - else if (event.key === 'Escape') { - handleEsc(event, innerParams, dismissWith); - } - }; - - /** - * @param {KeyboardEvent} event - * @param {SweetAlertOptions} innerParams - */ - var handleEnter = function handleEnter(event, innerParams) { - // https://github.com/sweetalert2/sweetalert2/issues/2386 - if (!callIfFunction(innerParams.allowEnterKey)) { - return; - } - var input = getInput$1(getPopup(), innerParams.input); - if (event.target && input && event.target instanceof HTMLElement && event.target.outerHTML === input.outerHTML) { - if (['textarea', 'file'].includes(innerParams.input)) { - return; // do not submit - } - clickConfirm(); - event.preventDefault(); - } - }; - - /** - * @param {KeyboardEvent} event - */ - var handleTab = function handleTab(event) { - var targetElement = event.target; - var focusableElements = getFocusableElements(); - var btnIndex = -1; - for (var i = 0; i < focusableElements.length; i++) { - if (targetElement === focusableElements[i]) { - btnIndex = i; - break; - } - } - - // Cycle to the next button - if (!event.shiftKey) { - setFocus(btnIndex, 1); - } - - // Cycle to the prev button - else { - setFocus(btnIndex, -1); - } - event.stopPropagation(); - event.preventDefault(); - }; - - /** - * @param {string} key - */ - var handleArrows = function handleArrows(key) { - var actions = getActions(); - var confirmButton = getConfirmButton(); - var denyButton = getDenyButton(); - var cancelButton = getCancelButton(); - if (!actions || !confirmButton || !denyButton || !cancelButton) { - return; - } - /** @type HTMLElement[] */ - var buttons = [confirmButton, denyButton, cancelButton]; - if (document.activeElement instanceof HTMLElement && !buttons.includes(document.activeElement)) { - return; - } - var sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling'; - var buttonToFocus = document.activeElement; - if (!buttonToFocus) { - return; - } - for (var i = 0; i < actions.children.length; i++) { - buttonToFocus = buttonToFocus[sibling]; - if (!buttonToFocus) { - return; - } - if (buttonToFocus instanceof HTMLButtonElement && isVisible$1(buttonToFocus)) { - break; - } - } - if (buttonToFocus instanceof HTMLButtonElement) { - buttonToFocus.focus(); - } - }; - - /** - * @param {KeyboardEvent} event - * @param {SweetAlertOptions} innerParams - * @param {Function} dismissWith - */ - var handleEsc = function handleEsc(event, innerParams, dismissWith) { - if (callIfFunction(innerParams.allowEscapeKey)) { - event.preventDefault(); - dismissWith(DismissReason.esc); - } - }; - - /** - * This module contains `WeakMap`s for each effectively-"private property" that a `Swal` has. - * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` - * This is the approach that Babel will probably take to implement private methods/fields - * https://github.com/tc39/proposal-private-methods - * https://github.com/babel/babel/pull/7555 - * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* - * then we can use that language feature. - */ - - var privateMethods = { - swalPromiseResolve: new WeakMap(), - swalPromiseReject: new WeakMap() - }; - - // From https://developer.paciellogroup.com/blog/2018/06/the-current-state-of-modal-dialog-accessibility/ - // Adding aria-hidden="true" to elements outside of the active modal dialog ensures that - // elements not within the active modal dialog will not be surfaced if a user opens a screen - // reader’s list of elements (headings, form controls, landmarks, etc.) in the document. - - var setAriaHidden = function setAriaHidden() { - var bodyChildren = Array.from(document.body.children); - bodyChildren.forEach(function (el) { - if (el === getContainer() || el.contains(getContainer())) { - return; - } - if (el.hasAttribute('aria-hidden')) { - el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden') || ''); - } - el.setAttribute('aria-hidden', 'true'); - }); - }; - var unsetAriaHidden = function unsetAriaHidden() { - var bodyChildren = Array.from(document.body.children); - bodyChildren.forEach(function (el) { - if (el.hasAttribute('data-previous-aria-hidden')) { - el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden') || ''); - el.removeAttribute('data-previous-aria-hidden'); - } else { - el.removeAttribute('aria-hidden'); - } - }); - }; - - // @ts-ignore - var isSafariOrIOS = typeof window !== 'undefined' && !!window.GestureEvent; // true for Safari desktop + all iOS browsers https://stackoverflow.com/a/70585394 - - /** - * Fix iOS scrolling - * http://stackoverflow.com/q/39626302 - */ - var iOSfix = function iOSfix() { - if (isSafariOrIOS && !hasClass(document.body, swalClasses.iosfix)) { - var offset = document.body.scrollTop; - document.body.style.top = "".concat(offset * -1, "px"); - addClass(document.body, swalClasses.iosfix); - lockBodyScroll(); - } - }; - - /** - * https://github.com/sweetalert2/sweetalert2/issues/1246 - */ - var lockBodyScroll = function lockBodyScroll() { - var container = getContainer(); - if (!container) { - return; - } - /** @type {boolean} */ - var preventTouchMove; - /** - * @param {TouchEvent} event - */ - container.ontouchstart = function (event) { - preventTouchMove = shouldPreventTouchMove(event); - }; - /** - * @param {TouchEvent} event - */ - container.ontouchmove = function (event) { - if (preventTouchMove) { - event.preventDefault(); - event.stopPropagation(); - } - }; - }; - - /** - * @param {TouchEvent} event - * @returns {boolean} - */ - var shouldPreventTouchMove = function shouldPreventTouchMove(event) { - var target = event.target; - var container = getContainer(); - var htmlContainer = getHtmlContainer(); - if (!container || !htmlContainer) { - return false; - } - if (isStylus(event) || isZoom(event)) { - return false; - } - if (target === container) { - return true; - } - if (!isScrollable(container) && target instanceof HTMLElement && target.tagName !== 'INPUT' && - // #1603 - target.tagName !== 'TEXTAREA' && - // #2266 - !(isScrollable(htmlContainer) && - // #1944 - htmlContainer.contains(target))) { - return true; - } - return false; - }; - - /** - * https://github.com/sweetalert2/sweetalert2/issues/1786 - * - * @param {*} event - * @returns {boolean} - */ - var isStylus = function isStylus(event) { - return event.touches && event.touches.length && event.touches[0].touchType === 'stylus'; - }; - - /** - * https://github.com/sweetalert2/sweetalert2/issues/1891 - * - * @param {TouchEvent} event - * @returns {boolean} - */ - var isZoom = function isZoom(event) { - return event.touches && event.touches.length > 1; - }; - var undoIOSfix = function undoIOSfix() { - if (hasClass(document.body, swalClasses.iosfix)) { - var offset = parseInt(document.body.style.top, 10); - removeClass(document.body, swalClasses.iosfix); - document.body.style.top = ''; - document.body.scrollTop = offset * -1; - } - }; - - /** - * Measure scrollbar width for padding body during modal show/hide - * https://github.com/twbs/bootstrap/blob/master/js/src/modal.js - * - * @returns {number} - */ - var measureScrollbar = function measureScrollbar() { - var scrollDiv = document.createElement('div'); - scrollDiv.className = swalClasses['scrollbar-measure']; - document.body.appendChild(scrollDiv); - var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; - document.body.removeChild(scrollDiv); - return scrollbarWidth; - }; - - /** - * Remember state in cases where opening and handling a modal will fiddle with it. - * @type {number | null} - */ - var previousBodyPadding = null; - - /** - * @param {string} initialBodyOverflow - */ - var replaceScrollbarWithPadding = function replaceScrollbarWithPadding(initialBodyOverflow) { - // for queues, do not do this more than once - if (previousBodyPadding !== null) { - return; - } - // if the body has overflow - if (document.body.scrollHeight > window.innerHeight || initialBodyOverflow === 'scroll' // https://github.com/sweetalert2/sweetalert2/issues/2663 - ) { - // add padding so the content doesn't shift after removal of scrollbar - previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); - document.body.style.paddingRight = "".concat(previousBodyPadding + measureScrollbar(), "px"); - } - }; - var undoReplaceScrollbarWithPadding = function undoReplaceScrollbarWithPadding() { - if (previousBodyPadding !== null) { - document.body.style.paddingRight = "".concat(previousBodyPadding, "px"); - previousBodyPadding = null; - } - }; - - /** - * @param {SweetAlert} instance - * @param {HTMLElement} container - * @param {boolean} returnFocus - * @param {Function} didClose - */ - function removePopupAndResetState(instance, container, returnFocus, didClose) { - if (isToast()) { - triggerDidCloseAndDispose(instance, didClose); - } else { - restoreActiveElement(returnFocus).then(function () { - return triggerDidCloseAndDispose(instance, didClose); - }); - removeKeydownHandler(globalState); - } - - // workaround for https://github.com/sweetalert2/sweetalert2/issues/2088 - // for some reason removing the container in Safari will scroll the document to bottom - if (isSafariOrIOS) { - container.setAttribute('style', 'display:none !important'); - container.removeAttribute('class'); - container.innerHTML = ''; - } else { - container.remove(); - } - if (isModal()) { - undoReplaceScrollbarWithPadding(); - undoIOSfix(); - unsetAriaHidden(); - } - removeBodyClasses(); - } - - /** - * Remove SweetAlert2 classes from body - */ - function removeBodyClasses() { - removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown']]); - } - - /** - * Instance method to close sweetAlert - * - * @param {any} resolveValue - */ - function close(resolveValue) { - resolveValue = prepareResolveValue(resolveValue); - var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); - var didClose = triggerClosePopup(this); - if (this.isAwaitingPromise) { - // A swal awaiting for a promise (after a click on Confirm or Deny) cannot be dismissed anymore #2335 - if (!resolveValue.isDismissed) { - handleAwaitingPromise(this); - swalPromiseResolve(resolveValue); - } - } else if (didClose) { - // Resolve Swal promise - swalPromiseResolve(resolveValue); - } - } - var triggerClosePopup = function triggerClosePopup(instance) { - var popup = getPopup(); - if (!popup) { - return false; - } - var innerParams = privateProps.innerParams.get(instance); - if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { - return false; - } - removeClass(popup, innerParams.showClass.popup); - addClass(popup, innerParams.hideClass.popup); - var backdrop = getContainer(); - removeClass(backdrop, innerParams.showClass.backdrop); - addClass(backdrop, innerParams.hideClass.backdrop); - handlePopupAnimation(instance, popup, innerParams); - return true; - }; - - /** - * @param {any} error - */ - function rejectPromise(error) { - var rejectPromise = privateMethods.swalPromiseReject.get(this); - handleAwaitingPromise(this); - if (rejectPromise) { - // Reject Swal promise - rejectPromise(error); - } - } - - /** - * @param {SweetAlert} instance - */ - var handleAwaitingPromise = function handleAwaitingPromise(instance) { - if (instance.isAwaitingPromise) { - delete instance.isAwaitingPromise; - // The instance might have been previously partly destroyed, we must resume the destroy process in this case #2335 - if (!privateProps.innerParams.get(instance)) { - instance._destroy(); - } - } - }; - - /** - * @param {any} resolveValue - * @returns {SweetAlertResult} - */ - var prepareResolveValue = function prepareResolveValue(resolveValue) { - // When user calls Swal.close() - if (typeof resolveValue === 'undefined') { - return { - isConfirmed: false, - isDenied: false, - isDismissed: true - }; - } - return Object.assign({ - isConfirmed: false, - isDenied: false, - isDismissed: false - }, resolveValue); - }; - - /** - * @param {SweetAlert} instance - * @param {HTMLElement} popup - * @param {SweetAlertOptions} innerParams - */ - var handlePopupAnimation = function handlePopupAnimation(instance, popup, innerParams) { - var container = getContainer(); - // If animation is supported, animate - var animationIsSupported = animationEndEvent && hasCssAnimation(popup); - if (typeof innerParams.willClose === 'function') { - innerParams.willClose(popup); - } - if (animationIsSupported) { - animatePopup(instance, popup, container, innerParams.returnFocus, innerParams.didClose); - } else { - // Otherwise, remove immediately - removePopupAndResetState(instance, container, innerParams.returnFocus, innerParams.didClose); - } - }; - - /** - * @param {SweetAlert} instance - * @param {HTMLElement} popup - * @param {HTMLElement} container - * @param {boolean} returnFocus - * @param {Function} didClose - */ - var animatePopup = function animatePopup(instance, popup, container, returnFocus, didClose) { - if (!animationEndEvent) { - return; - } - globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, returnFocus, didClose); - popup.addEventListener(animationEndEvent, function (e) { - if (e.target === popup) { - globalState.swalCloseEventFinishedCallback(); - delete globalState.swalCloseEventFinishedCallback; - } - }); - }; - - /** - * @param {SweetAlert} instance - * @param {Function} didClose - */ - var triggerDidCloseAndDispose = function triggerDidCloseAndDispose(instance, didClose) { - setTimeout(function () { - if (typeof didClose === 'function') { - didClose.bind(instance.params)(); - } - // instance might have been destroyed already - if (instance._destroy) { - instance._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] - */ - var showLoading = function showLoading(buttonToReplace) { - var popup = getPopup(); - if (!popup) { - new Swal(); // eslint-disable-line no-new - } - popup = getPopup(); - if (!popup) { - return; - } - var loader = getLoader(); - if (isToast()) { - hide(getIcon()); - } else { - replaceButton(popup, buttonToReplace); - } - show(loader); - popup.setAttribute('data-loading', 'true'); - popup.setAttribute('aria-busy', 'true'); - popup.focus(); - }; - - /** - * @param {HTMLElement} popup - * @param {HTMLButtonElement | null} [buttonToReplace] - */ - var replaceButton = function replaceButton(popup, buttonToReplace) { - var actions = getActions(); - var loader = getLoader(); - if (!actions || !loader) { - return; - } - if (!buttonToReplace && isVisible$1(getConfirmButton())) { - buttonToReplace = getConfirmButton(); - } - show(actions); - if (buttonToReplace) { - hide(buttonToReplace); - loader.setAttribute('data-button-to-replace', buttonToReplace.className); - actions.insertBefore(loader, buttonToReplace); - } - addClass([popup, actions], swalClasses.loading); - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var handleInputOptionsAndValue = function handleInputOptionsAndValue(instance, params) { - if (params.input === 'select' || params.input === 'radio') { - handleInputOptions(instance, params); - } else if (['text', 'email', 'number', 'tel', 'textarea'].some(function (i) { - return i === params.input; - }) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) { - showLoading(getConfirmButton()); - handleInputValue(instance, params); - } - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} innerParams - * @returns {SweetAlertInputValue} - */ - var getInputValue = function getInputValue(instance, innerParams) { - var input = instance.getInput(); - if (!input) { - return null; - } - switch (innerParams.input) { - case 'checkbox': - return getCheckboxValue(input); - case 'radio': - return getRadioValue(input); - case 'file': - return getFileValue(input); - default: - return innerParams.inputAutoTrim ? input.value.trim() : input.value; - } - }; - - /** - * @param {HTMLInputElement} input - * @returns {number} - */ - var getCheckboxValue = function getCheckboxValue(input) { - return input.checked ? 1 : 0; - }; - - /** - * @param {HTMLInputElement} input - * @returns {string | null} - */ - var getRadioValue = function getRadioValue(input) { - return input.checked ? input.value : null; - }; - - /** - * @param {HTMLInputElement} input - * @returns {FileList | File | null} - */ - var getFileValue = function getFileValue(input) { - return input.files && input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null; - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var handleInputOptions = function handleInputOptions(instance, params) { - var popup = getPopup(); - if (!popup) { - return; - } - /** - * @param {Record} inputOptions - */ - var processInputOptions = function processInputOptions(inputOptions) { - if (params.input === 'select') { - populateSelectOptions(popup, formatInputOptions(inputOptions), params); - } else if (params.input === 'radio') { - populateRadioOptions(popup, formatInputOptions(inputOptions), params); - } - }; - if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) { - showLoading(getConfirmButton()); - asPromise(params.inputOptions).then(function (inputOptions) { - instance.hideLoading(); - processInputOptions(inputOptions); - }); - } else if (_typeof(params.inputOptions) === 'object') { - processInputOptions(params.inputOptions); - } else { - error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions))); - } - }; - - /** - * @param {SweetAlert} instance - * @param {SweetAlertOptions} params - */ - var handleInputValue = function handleInputValue(instance, params) { - var input = instance.getInput(); - if (!input) { - return; - } - hide(input); - asPromise(params.inputValue).then(function (inputValue) { - input.value = params.input === 'number' ? "".concat(parseFloat(inputValue) || 0) : "".concat(inputValue); - show(input); - input.focus(); - instance.hideLoading(); - })["catch"](function (err) { - error("Error in inputValue promise: ".concat(err)); - input.value = ''; - show(input); - input.focus(); - instance.hideLoading(); - }); - }; - - /** - * @param {HTMLElement} popup - * @param {InputOptionFlattened[]} inputOptions - * @param {SweetAlertOptions} params - */ - function populateSelectOptions(popup, inputOptions, params) { - var select = getDirectChildByClass(popup, swalClasses.select); - if (!select) { - return; - } - /** - * @param {HTMLElement} parent - * @param {string} optionLabel - * @param {string} optionValue - */ - var renderOption = function renderOption(parent, optionLabel, optionValue) { - var option = document.createElement('option'); - option.value = optionValue; - setInnerHtml(option, optionLabel); - option.selected = isSelected(optionValue, params.inputValue); - parent.appendChild(option); - }; - inputOptions.forEach(function (inputOption) { - var optionValue = inputOption[0]; - var optionLabel = inputOption[1]; - // spec: - // https://www.w3.org/TR/html401/interact/forms.html#h-17.6 - // "...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)..." - // check whether this is a - if (Array.isArray(optionLabel)) { - // if it is an array, then it is an - var optgroup = document.createElement('optgroup'); - optgroup.label = optionValue; - optgroup.disabled = false; // not configurable for now - select.appendChild(optgroup); - optionLabel.forEach(function (o) { - return renderOption(optgroup, o[1], o[0]); - }); - } else { - // case of
    \n \n
    \n
    \n',ke='\n \n \n \n \n',Be=function(t,e){if(e.icon||e.iconHtml){var n=t.innerHTML,r="";e.iconHtml?r=_e(e.iconHtml):"success"===e.icon?(r=Le,n=n.replace(/ style=".*?"/g,"")):"error"===e.icon?r=ke:e.icon&&(r=_e({question:"?",warning:"!",info:"i"}[e.icon])),n.trim()!==r.trim()&&At(t,r)}},Re=function(t,e){if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(var n=0,r=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n').concat(t,"")},je=function(t,e){var n=it();n&&(e.imageUrl?(_t(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt||""),Rt(n,"width",e.imageWidth),Rt(n,"height",e.imageHeight),n.className=I.image,St(n,e,"image")):jt(n))},Ue=function(t,e){var n=Z(),r=tt();if(n&&r){if(e.toast){Rt(n,"width",e.width),r.style.width="100%";var o=pt();o&&r.insertBefore(o,et())}else Rt(r,"width",e.width);Rt(r,"padding",e.padding),e.color&&(r.style.color=e.color),e.background&&(r.style.background=e.background),jt(st()),Ne(r,e)}},Ne=function(t,e){var n=e.showClass||{};t.className="".concat(I.popup," ").concat(It(t)?n.popup:""),e.toast?(Lt([document.documentElement,document.body],I["toast-shown"]),Lt(t,I.toast)):Lt(t,I.modal),St(t,e,"popup"),"string"==typeof e.customClass&&Lt(t,e.customClass),e.icon&&Lt(t,I["icon-".concat(e.icon)])},De=function(t,e){var n=at();if(n){var r=e.progressSteps,o=e.currentProgressStep;r&&0!==r.length&&void 0!==o?(_t(n),n.textContent="",o>=r.length&&H("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),r.forEach((function(t,i){var a=Ie(t);if(n.appendChild(a),i===o&&Lt(a,I["active-progress-step"]),i!==r.length-1){var s=Me(e);n.appendChild(s)}}))):jt(n)}},Ie=function(t){var e=document.createElement("li");return Lt(e,I["progress-step"]),At(e,t),e},Me=function(t){var e=document.createElement("li");return Lt(e,I["progress-step-line"]),t.progressStepsDistance&&Rt(e,"width",t.progressStepsDistance),e},Fe=function(t,e){var n=rt();n&&(Ut(n),Dt(n,e.title||e.titleText,"block"),e.title&&Qt(e.title,n),e.titleText&&(n.innerText=e.titleText),St(n,e,"title"))},qe=function(t,e){Ue(t,e),ce(t,e),De(t,e),Te(t,e),je(t,e),Fe(t,e),se(t,e),Oe(t,e),re(t,e),Se(t,e);var n=tt();"function"==typeof e.didRender&&n&&e.didRender(n)},He=function(){return It(tt())},Ve=function(){var t;return null===(t=ct())||void 0===t?void 0:t.click()},Ye=function(){var t;return null===(t=lt())||void 0===t?void 0:t.click()},ze=function(){var t;return null===(t=ut())||void 0===t?void 0:t.click()},We=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Ke=function(t){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},Ge=function(t,e,n){Ke(t),e.toast||(t.keydownHandler=function(t){return Xe(e,t,n)},t.keydownTarget=e.keydownListenerCapture?window:tt(),t.keydownListenerCapture=e.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},Je=function(t,e){var n,r=vt();if(r.length)return(t+=e)===r.length?t=0:-1===t&&(t=r.length-1),void r[t].focus();null===(n=tt())||void 0===n||n.focus()},$e=["ArrowRight","ArrowDown"],Ze=["ArrowLeft","ArrowUp"],Xe=function(t,e,n){t&&(e.isComposing||229===e.keyCode||(t.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?Qe(e,t):"Tab"===e.key?tn(e):[].concat($e,Ze).includes(e.key)?en(e.key):"Escape"===e.key&&nn(e,t,n)))},Qe=function(t,e){if(K(e.allowEnterKey)){var n=Tt(tt(),e.input);if(t.target&&n&&t.target instanceof HTMLElement&&t.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(e.input))return;Ve(),t.preventDefault()}}},tn=function(t){for(var e=t.target,n=vt(),r=-1,o=0;o1},dn=function(){if(Ct(document.body,I.iosfix)){var t=parseInt(document.body.style.top,10);kt(document.body,I.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}},hn=function(){var t=document.createElement("div");t.className=I["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},mn=null,gn=function(t){null===mn&&(document.body.scrollHeight>window.innerHeight||"scroll"===t)&&(mn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(mn+hn(),"px"))},yn=function(){null!==mn&&(document.body.style.paddingRight="".concat(mn,"px"),mn=null)};function vn(t,e,n,r){wt()?Pn(t,r):(N(n).then((function(){return Pn(t,r)})),Ke(j)),sn?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),bt()&&(yn(),dn(),an()),bn()}function bn(){kt([document.documentElement,document.body],[I.shown,I["height-auto"],I["no-backdrop"],I["toast-shown"]])}function wn(t){t=On(t);var e=rn.swalPromiseResolve.get(this),n=En(this);this.isAwaitingPromise?t.isDismissed||(Cn(this),e(t)):n&&e(t)}var En=function(t){var e=tt();if(!e)return!1;var n=pe.innerParams.get(t);if(!n||Ct(e,n.hideClass.popup))return!1;kt(e,n.showClass.popup),Lt(e,n.hideClass.popup);var r=Z();return kt(r,n.showClass.backdrop),Lt(r,n.hideClass.backdrop),Sn(t,e,n),!0};function An(t){var e=rn.swalPromiseReject.get(this);Cn(this),e&&e(t)}var Cn=function(t){t.isAwaitingPromise&&(delete t.isAwaitingPromise,pe.innerParams.get(t)||t._destroy())},On=function(t){return void 0===t?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t)},Sn=function(t,e,n){var r=Z(),o=ne&&qt(e);"function"==typeof n.willClose&&n.willClose(e),o?Tn(t,e,r,n.returnFocus,n.didClose):vn(t,r,n.returnFocus,n.didClose)},Tn=function(t,e,n,r,o){ne&&(j.swalCloseEventFinishedCallback=vn.bind(null,t,n,r,o),e.addEventListener(ne,(function(t){t.target===e&&(j.swalCloseEventFinishedCallback(),delete j.swalCloseEventFinishedCallback)})))},Pn=function(t,e){setTimeout((function(){"function"==typeof e&&e.bind(t.params)(),t._destroy&&t._destroy()}))},xn=function(t){var e=tt();if(e||new ko,e=tt()){var n=pt();wt()?jt(et()):Ln(e,t),_t(n),e.setAttribute("data-loading","true"),e.setAttribute("aria-busy","true"),e.focus()}},Ln=function(t,e){var n=dt(),r=pt();n&&r&&(!e&&It(ct())&&(e=ct()),_t(n),e&&(jt(e),r.setAttribute("data-button-to-replace",e.className),n.insertBefore(r,e)),Lt([t,n],I.loading))},kn=function(t,e){"select"===e.input||"radio"===e.input?Un(t,e):["text","email","number","tel","textarea"].some((function(t){return t===e.input}))&&(G(e.inputValue)||$(e.inputValue))&&(xn(ct()),Nn(t,e))},Bn=function(t,e){var n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return Rn(n);case"radio":return _n(n);case"file":return jn(n);default:return e.inputAutoTrim?n.value.trim():n.value}},Rn=function(t){return t.checked?1:0},_n=function(t){return t.checked?t.value:null},jn=function(t){return t.files&&t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null},Un=function(t,e){var n=tt();if(n){var r=function(t){"select"===e.input?Dn(n,Mn(t),e):"radio"===e.input&&In(n,Mn(t),e)};G(e.inputOptions)||$(e.inputOptions)?(xn(ct()),J(e.inputOptions).then((function(e){t.hideLoading(),r(e)}))):"object"===a(e.inputOptions)?r(e.inputOptions):V("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(a(e.inputOptions)))}},Nn=function(t,e){var n=t.getInput();n&&(jt(n),J(e.inputValue).then((function(r){n.value="number"===e.input?"".concat(parseFloat(r)||0):"".concat(r),_t(n),n.focus(),t.hideLoading()})).catch((function(e){V("Error in inputValue promise: ".concat(e)),n.value="",_t(n),n.focus(),t.hideLoading()})))};function Dn(t,e,n){var r=Bt(t,I.select);if(r){var o=function(t,e,r){var o=document.createElement("option");o.value=r,At(o,e),o.selected=Fn(r,n.inputValue),t.appendChild(o)};e.forEach((function(t){var e=t[0],n=t[1];if(Array.isArray(n)){var i=document.createElement("optgroup");i.label=e,i.disabled=!1,r.appendChild(i),n.forEach((function(t){return o(i,t[1],t[0])}))}else o(r,n,e)})),r.focus()}}function In(t,e,n){var r=Bt(t,I.radio);if(r){e.forEach((function(t){var e=t[0],o=t[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=I.radio,i.value=e,Fn(e,n.inputValue)&&(i.checked=!0);var s=document.createElement("span");At(s,o),s.className=I.label,a.appendChild(i),a.appendChild(s),r.appendChild(a)}));var o=r.querySelectorAll("input");o.length&&o[0].focus()}}var Mn=function t(e){var n=[];return e instanceof Map?e.forEach((function(e,r){var o=e;"object"===a(o)&&(o=t(o)),n.push([r,o])})):Object.keys(e).forEach((function(r){var o=e[r];"object"===a(o)&&(o=t(o)),n.push([r,o])})),n},Fn=function(t,e){return!!e&&e.toString()===t.toString()},qn=void 0,Hn=function(t){var e=pe.innerParams.get(t);t.disableButtons(),e.input?zn(t,"confirm"):$n(t,!0)},Vn=function(t){var e=pe.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?zn(t,"deny"):Kn(t,!1)},Yn=function(t,e){t.disableButtons(),e(We.cancel)},zn=function(t,e){var n=pe.innerParams.get(t);if(n.input){var r=t.getInput(),o=Bn(t,n);n.inputValidator?Wn(t,o,e):r&&!r.checkValidity()?(t.enableButtons(),t.showValidationMessage(n.validationMessage||r.validationMessage)):"deny"===e?Kn(t,o):$n(t,o)}else V('The "input" parameter is needed to be set when using returnInputValueOn'.concat(q(e)))},Wn=function(t,e,n){var r=pe.innerParams.get(t);t.disableInput(),Promise.resolve().then((function(){return J(r.inputValidator(e,r.validationMessage))})).then((function(r){t.enableButtons(),t.enableInput(),r?t.showValidationMessage(r):"deny"===n?Kn(t,e):$n(t,e)}))},Kn=function(t,e){var n=pe.innerParams.get(t||qn);n.showLoaderOnDeny&&xn(lt()),n.preDeny?(t.isAwaitingPromise=!0,Promise.resolve().then((function(){return J(n.preDeny(e,n.validationMessage))})).then((function(n){!1===n?(t.hideLoading(),Cn(t)):t.close({isDenied:!0,value:void 0===n?e:n})})).catch((function(e){return Jn(t||qn,e)}))):t.close({isDenied:!0,value:e})},Gn=function(t,e){t.close({isConfirmed:!0,value:e})},Jn=function(t,e){t.rejectPromise(e)},$n=function(t,e){var n=pe.innerParams.get(t||qn);n.showLoaderOnConfirm&&xn(),n.preConfirm?(t.resetValidationMessage(),t.isAwaitingPromise=!0,Promise.resolve().then((function(){return J(n.preConfirm(e,n.validationMessage))})).then((function(n){It(st())||!1===n?(t.hideLoading(),Cn(t)):Gn(t,void 0===n?e:n)})).catch((function(e){return Jn(t||qn,e)}))):Gn(t,e)};function Zn(){var t=pe.innerParams.get(this);if(t){var e=pe.domCache.get(this);jt(e.loader),wt()?t.icon&&_t(et()):Xn(e),kt([e.popup,e.actions],I.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}}var Xn=function(t){var e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?_t(e[0],"inline-block"):Mt()&&jt(t.actions)};function Qn(){var t=pe.innerParams.get(this),e=pe.domCache.get(this);return e?Tt(e.popup,t.input):null}function tr(t,e,n){var r=pe.domCache.get(t);e.forEach((function(t){r[t].disabled=n}))}function er(t,e){var n=tt();if(n&&t)if("radio"===t.type)for(var r=n.querySelectorAll('[name="'.concat(I.radio,'"]')),o=0;o0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Yr||(document.body.addEventListener("click",Gr),Yr=!0)}var Kr,Gr=function(t){for(var e=t.target;e&&e!==document;e=e.parentNode)for(var n in zr){var r=e.getAttribute(n);if(r)return void zr[n].fire({template:r})}},Jr=Object.freeze({__proto__:null,argsToParams:Ur,bindClickHandler:Wr,clickCancel:ze,clickConfirm:Ve,clickDeny:Ye,enableLoading:xn,fire:Nr,getActions:dt,getCancelButton:ut,getCloseButton:gt,getConfirmButton:ct,getContainer:Z,getDenyButton:lt,getFocusableElements:vt,getFooter:ht,getHtmlContainer:ot,getIcon:et,getIconContent:nt,getImage:it,getInputLabel:ft,getLoader:pt,getPopup:tt,getProgressSteps:at,getTimerLeft:Ir,getTimerProgressBar:mt,getTitle:rt,getValidationMessage:st,increaseTimer:Hr,isDeprecatedParameter:hr,isLoading:Et,isTimerRunning:Vr,isUpdatableParameter:dr,isValidParameter:pr,isVisible:He,mixin:Dr,resumeTimer:Fr,showLoading:xn,stopTimer:Mr,toggleTimer:qr}),$r=function(){function t(e,n){s(this,t),this.callback=e,this.remaining=n,this.running=!1,this.start()}return u(t,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}},{key:"increase",value:function(t){var e=this.running;return e&&this.stop(),this.remaining+=t,e&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}]),t}(),Zr=["swal-title","swal-html","swal-footer"],Xr=function(t){var e="string"==typeof t.template?document.querySelector(t.template):t.template;if(!e)return{};var n=e.content;return ao(n),Object.assign(Qr(n),to(n),eo(n),no(n),ro(n),oo(n),io(n,Zr))},Qr=function(t){var e={};return Array.from(t.querySelectorAll("swal-param")).forEach((function(t){so(t,["name","value"]);var n=t.getAttribute("name"),r=t.getAttribute("value");"boolean"==typeof cr[n]?e[n]="false"!==r:"object"===a(cr[n])?e[n]=JSON.parse(r):e[n]=r})),e},to=function(t){var e={};return Array.from(t.querySelectorAll("swal-function-param")).forEach((function(t){var n=t.getAttribute("name"),r=t.getAttribute("value");e[n]=new Function("return ".concat(r))()})),e},eo=function(t){var e={};return Array.from(t.querySelectorAll("swal-button")).forEach((function(t){so(t,["type","color","aria-label"]);var n=t.getAttribute("type");e["".concat(n,"ButtonText")]=t.innerHTML,e["show".concat(q(n),"Button")]=!0,t.hasAttribute("color")&&(e["".concat(n,"ButtonColor")]=t.getAttribute("color")),t.hasAttribute("aria-label")&&(e["".concat(n,"ButtonAriaLabel")]=t.getAttribute("aria-label"))})),e},no=function(t){var e={},n=t.querySelector("swal-image");return n&&(so(n,["src","width","height","alt"]),n.hasAttribute("src")&&(e.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(e.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(e.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(e.imageAlt=n.getAttribute("alt"))),e},ro=function(t){var e={},n=t.querySelector("swal-icon");return n&&(so(n,["type","color"]),n.hasAttribute("type")&&(e.icon=n.getAttribute("type")),n.hasAttribute("color")&&(e.iconColor=n.getAttribute("color")),e.iconHtml=n.innerHTML),e},oo=function(t){var e={},n=t.querySelector("swal-input");n&&(so(n,["type","label","placeholder","value"]),e.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(e.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(e.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(e.inputValue=n.getAttribute("value")));var r=Array.from(t.querySelectorAll("swal-input-option"));return r.length&&(e.inputOptions={},r.forEach((function(t){so(t,["value"]);var n=t.getAttribute("value"),r=t.innerHTML;e.inputOptions[n]=r}))),e},io=function(t,e){var n={};for(var r in e){var o=e[r],i=t.querySelector(o);i&&(so(i,[]),n[o.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},ao=function(t){var e=Zr.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(t.children).forEach((function(t){var n=t.tagName.toLowerCase();e.includes(n)||H("Unrecognized element <".concat(n,">"))}))},so=function(t,e){Array.from(t.attributes).forEach((function(n){-1===e.indexOf(n.name)&&H(['Unrecognized attribute "'.concat(n.name,'" on <').concat(t.tagName.toLowerCase(),">."),"".concat(e.length?"Allowed attributes are: ".concat(e.join(", ")):"To set the value, use HTML within the element.")])}))},co=10,uo=function(t){var e=Z(),n=tt();"function"==typeof t.willOpen&&t.willOpen(n);var r=window.getComputedStyle(document.body).overflowY;ho(e,n,t),setTimeout((function(){fo(e,n)}),co),bt()&&(po(e,t.scrollbarPadding,r),on()),wt()||j.previousActiveElement||(j.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout((function(){return t.didOpen(n)})),kt(e,I["no-transition"])},lo=function t(e){var n=tt();if(e.target===n&&ne){var r=Z();n.removeEventListener(ne,t),r.style.overflowY="auto"}},fo=function(t,e){ne&&qt(e)?(t.style.overflowY="hidden",e.addEventListener(ne,lo)):t.style.overflowY="auto"},po=function(t,e,n){cn(),e&&"hidden"!==n&&gn(n),setTimeout((function(){t.scrollTop=0}))},ho=function(t,e,n){Lt(t,n.showClass.backdrop),n.animation?(e.style.setProperty("opacity","0","important"),_t(e,"grid"),setTimeout((function(){Lt(e,n.showClass.popup),e.style.removeProperty("opacity")}),co)):_t(e,"grid"),Lt([document.documentElement,document.body],I.shown),n.heightAuto&&n.backdrop&&!n.toast&&Lt([document.documentElement,document.body],I["height-auto"])},mo={email:function(t,e){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address")},url:function(t,e){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")}};function go(t){t.inputValidator||("email"===t.input&&(t.inputValidator=mo.email),"url"===t.input&&(t.inputValidator=mo.url))}function yo(t){(!t.target||"string"==typeof t.target&&!document.querySelector(t.target)||"string"!=typeof t.target&&!t.target.appendChild)&&(H('Target parameter is not valid, defaulting to "body"'),t.target="body")}function vo(t){go(t),t.showLoaderOnConfirm&&!t.preConfirm&&H("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"),yo(t),"string"==typeof t.title&&(t.title=t.title.split("\n").join("
    ")),Xt(t)}var bo=new WeakMap,wo=function(){function t(){if(s(this,t),R(this,bo,{writable:!0,value:void 0}),"undefined"!=typeof window){Kr=this;for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(vr(Object.assign({},e,t)),j.currentInstance){var n=rn.swalPromiseResolve.get(j.currentInstance),r=j.currentInstance.isAwaitingPromise;j.currentInstance._destroy(),r||n({isDismissed:!0}),bt()&&an()}j.currentInstance=Kr;var o=Ao(t,e);vo(o),Object.freeze(o),j.timeout&&(j.timeout.stop(),delete j.timeout),clearTimeout(j.restoreFocusTimeout);var i=Co(Kr);return qe(Kr,o),pe.innerParams.set(Kr,o),Eo(Kr,i,o)}},{key:"then",value:function(t){return T(this,bo).then(t)}},{key:"finally",value:function(t){return T(this,bo).finally(t)}}]),t}(),Eo=function(t,e,n){return new Promise((function(r,o){var i=function(e){t.close({isDismissed:!0,dismiss:e})};rn.swalPromiseResolve.set(t,r),rn.swalPromiseReject.set(t,o),e.confirmButton.onclick=function(){Hn(t)},e.denyButton.onclick=function(){Vn(t)},e.cancelButton.onclick=function(){Yn(t,i)},e.closeButton.onclick=function(){i(We.close)},Tr(n,e,i),Ge(j,n,i),kn(t,n),uo(n),Oo(j,n,i),So(e,n),setTimeout((function(){e.container.scrollTop=0}))}))},Ao=function(t,e){var n=Xr(t),r=Object.assign({},cr,e,n,t);return r.showClass=Object.assign({},cr.showClass,r.showClass),r.hideClass=Object.assign({},cr.hideClass,r.hideClass),!1===r.animation&&(r.showClass={backdrop:"swal2-noanimation"},r.hideClass={}),r},Co=function(t){var e={popup:tt(),container:Z(),actions:dt(),confirmButton:ct(),denyButton:lt(),cancelButton:ut(),loader:pt(),closeButton:gt(),validationMessage:st(),progressSteps:at()};return pe.domCache.set(t,e),e},Oo=function(t,e,n){var r=mt();jt(r),e.timer&&(t.timeout=new $r((function(){n("timer"),delete t.timeout}),e.timer),e.timerProgressBar&&(_t(r),St(r,e,"timerProgressBar"),setTimeout((function(){t.timeout&&t.timeout.running&&Ht(e.timer)}))))},So=function(t,e){e.toast||(K(e.allowEnterKey)?To(t,e)||Je(-1,1):Po())},To=function(t,e){return e.focusDeny&&It(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&It(t.cancelButton)?(t.cancelButton.focus(),!0):!(!e.focusConfirm||!It(t.confirmButton)||(t.confirmButton.focus(),0))},Po=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var xo=new Date,Lo=localStorage.getItem("swal-initiation");Lo?(xo.getTime()-Date.parse(Lo))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var t=document.createElement("audio");t.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",t.loop=!0,document.body.appendChild(t),setTimeout((function(){t.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(xo))}wo.prototype.disableButtons=rr,wo.prototype.enableButtons=nr,wo.prototype.getInput=Qn,wo.prototype.disableInput=ir,wo.prototype.enableInput=or,wo.prototype.hideLoading=Zn,wo.prototype.disableLoading=Zn,wo.prototype.showValidationMessage=ar,wo.prototype.resetValidationMessage=sr,wo.prototype.close=wn,wo.prototype.closePopup=wn,wo.prototype.closeModal=wn,wo.prototype.closeToast=wn,wo.prototype.rejectPromise=An,wo.prototype.update=br,wo.prototype._destroy=Er,Object.assign(wo,Jr),Object.keys(Sr).forEach((function(t){wo[t]=function(){var e;return Kr&&Kr[t]?(e=Kr)[t].apply(e,arguments):null}})),wo.DismissReason=We,wo.version="11.10.5";var ko=wo;return ko.default=ko,ko}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2)}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t].call(i.exports,i,i.exports,r),i.exports}r.m=e,t=[],r.O=(e,n,o,i)=>{if(!n){var a=1/0;for(l=0;l=i)&&Object.keys(r.O).every((t=>r.O[t](n[c])))?n.splice(c--,1):(s=!1,i0&&t[l-1][2]>i;l--)t[l]=t[l-1];t[l]=[n,o,i]},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={560:0,496:0};r.O.j=e=>0===t[e];var e=(e,n)=>{var o,i,[a,s,c]=n,u=0;if(a.some((e=>0!==t[e]))){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(c)var l=c(r)}for(e&&e(n);ur(596)));var o=r.O(void 0,[496],(()=>r(108)));o=r.O(o)})(); \ No newline at end of file diff --git a/resources/assets/src/scripts/app.js b/resources/assets/src/scripts/app.js index 10b7a8d..fdd23ed 100644 --- a/resources/assets/src/scripts/app.js +++ b/resources/assets/src/scripts/app.js @@ -2,14 +2,10 @@ import axios from 'axios' window.axios = axios -import { initContactForm } from '@/contact' -import { initLoginForm } from '@/login' -import { initCart } from '@/cart/cart' -import { initRangeSlider } from '@/rangeSlider' +import { initContactForm } from './contact' +import { initLoginForm } from './login' document.addEventListener('DOMContentLoaded', () => { initContactForm() initLoginForm() - initCart() - initRangeSlider() }) diff --git a/resources/assets/src/scripts/cart/add.js b/resources/assets/src/scripts/cart/add.js deleted file mode 100644 index c261fb1..0000000 --- a/resources/assets/src/scripts/cart/add.js +++ /dev/null @@ -1,91 +0,0 @@ -import axios from 'axios' -import Toast from '@/libs/Toast' - -export function addToCart() { - const preloader = document.querySelector('.js-preloader-main') - const addButtons = document.querySelectorAll('.js-add-to-cart') - - const totals = document.querySelectorAll('.js-total') - const subTotals = document.querySelectorAll('.js-sub-total') - const cartCount = document.querySelector('.js-cart-total') - - const cartList = document.querySelector('.js-cart-list') - const addedProduct = product => { - return ` - - - - ${product.thumbnail} - - - - ${product.name} - - - x${product.quantity} - - ${product.sale_price ? `${product.sale_price}` : `${product.regular_price}`} - - - - - - ` - } - addButtons.forEach(addButton => { - addButton.addEventListener('click', async event => { - preloader.classList.add('js-preloading') - - const formData = new FormData() - formData.append('action', 'addToCart') - formData.append('nonce', data.nonce) - formData.append('product_id', addButton.dataset.product_id) - formData.append('quantity', addButton.dataset.quantity) - if (addButton.dataset.variation) { - formData.append('variation', addButton.dataset.variation) - } - - try { - const { data: response } = await axios.post(data.ajax_url, formData, { - params: { action: 'addToCart' } - }) - - if (response.type === 'success') { - // totals - totals.forEach(totalElement => { - totalElement.innerHTML = response.total - }) - - // sub-totals - subTotals.forEach(subTotalElement => { - subTotalElement.innerHTML = response.subTotal - }) - - cartCount.innerHTML = response.count - - // cart items - if (response.cart) { - cartList.innerHTML = '' - response.cart.forEach(product => { - const newProduct = addedProduct(product) // Pass each product data to your addedProduct function - cartList.innerHTML += newProduct - }) - } - - Toast.fire({ icon: 'success', iconColor: '#007cba', title: response.message }) - } - - if (response.type === 'error') { - Toast.fire({ icon: 'error', iconColor: 'red', title: response.message }) - } - - preloader.classList.remove('js-preloading') - } catch (error) { - preloader.classList.remove('js-preloading') - console.error(error) - } - }) - }) -} diff --git a/resources/assets/src/scripts/cart/cart.js b/resources/assets/src/scripts/cart/cart.js deleted file mode 100644 index ea90e16..0000000 --- a/resources/assets/src/scripts/cart/cart.js +++ /dev/null @@ -1,11 +0,0 @@ -import { removeFromCart } from '@/cart/remove' -import { addToCart } from '@/cart/add' -import { changeVariations } from '@/cart/variations' -import { initQuantity } from '@/cart/quantity' - -export function initCart() { - removeFromCart() - addToCart() - changeVariations() - initQuantity() -} diff --git a/resources/assets/src/scripts/cart/quantity.js b/resources/assets/src/scripts/cart/quantity.js deleted file mode 100644 index bc18a66..0000000 --- a/resources/assets/src/scripts/cart/quantity.js +++ /dev/null @@ -1,10 +0,0 @@ -export function initQuantity() { - const qtyButton = document.querySelector('.js-product-qty') - const cartButton = document.querySelector('.js-add-to-cart') - - if (qtyButton && cartButton) { - qtyButton.addEventListener('change', event => { - cartButton.dataset.quantity = event.target.value - }) - } -} diff --git a/resources/assets/src/scripts/cart/remove.js b/resources/assets/src/scripts/cart/remove.js deleted file mode 100644 index 3399480..0000000 --- a/resources/assets/src/scripts/cart/remove.js +++ /dev/null @@ -1,51 +0,0 @@ -import axios from 'axios' - -export function removeFromCart() { - const preloader = document.querySelector('.js-preloader-main') - const cartContainer = document.querySelector('body') - - const totals = document.querySelectorAll('.js-total') - const subTotals = document.querySelectorAll('.js-sub-total') - const cartCount = document.querySelector('.js-cart-total') - - cartContainer.addEventListener('click', async event => { - const target = event.target - - if (target.classList.contains('js-remove-from-cart')) { - preloader.classList.add('js-preloading') - - const formData = new FormData() - formData.append('action', 'removeFromCart') - formData.append('nonce', data.nonce) - formData.append('key', target.dataset.key) - - try { - const { data: response } = await axios.post(data.ajax_url, formData, { - params: { action: 'removeFromCart' } - }) - - if (response.type === 'success') { - const cartItems = cartContainer.querySelectorAll(`[data-key="${target.dataset.key}"]`) - - cartItems.forEach(cartItem => { - cartItem.remove() - }) - - totals.forEach(totalElement => { - totalElement.innerHTML = response.total - }) - - subTotals.forEach(subTotalElement => { - subTotalElement.innerHTML = response.subTotal - }) - - cartCount.innerHTML = response.count - } - preloader.classList.remove('js-preloading') - } catch (error) { - console.error(error) - preloader.classList.remove('js-preloading') - } - } - }) -} diff --git a/resources/assets/src/scripts/cart/variations.js b/resources/assets/src/scripts/cart/variations.js deleted file mode 100644 index 4ee389a..0000000 --- a/resources/assets/src/scripts/cart/variations.js +++ /dev/null @@ -1,11 +0,0 @@ -export function changeVariations() { - const select = document.querySelector('.js-variant') - - if (select) { - const addButton = document.querySelector('.js-add-to-cart') - select.addEventListener('change', event => { - addButton.dataset.variation = event.target.value - addButton.removeAttribute('disabled') - }) - } -} diff --git a/resources/assets/src/scripts/rangeSlider.js b/resources/assets/src/scripts/rangeSlider.js deleted file mode 100644 index 7097c50..0000000 --- a/resources/assets/src/scripts/rangeSlider.js +++ /dev/null @@ -1,44 +0,0 @@ -import noUiSlider from 'nouislider' - -export function initRangeSlider() { - const nonLinearStepSlider = document.getElementById('rangeSlider') - - if (nonLinearStepSlider) { - const nonLinearStepSliderValueElement = document.getElementById('slider-non-linear-step-value') - - const slider = noUiSlider.create(nonLinearStepSlider, { - start: [0, 100], - connect: true, - range: { - min: 0, - max: 100 - } - }) - - nonLinearStepSlider.noUiSlider.on('update', function (values) { - nonLinearStepSliderValueElement.innerHTML = values.join(' - ') - }) - - const valueElement = document.getElementById('slider-non-linear-step-value') - const urlParams = new URLSearchParams(window.location.search) - - const setSliderValues = values => { - slider.set(values) - valueElement.innerHTML = values.join(' - ') - } - - const minPrice = parseFloat(urlParams.get('min_price')) || 0 - const maxPrice = parseFloat(urlParams.get('max_price')) || 100 - setSliderValues([minPrice, maxPrice]) - - slider.on('set', values => { - const newUrlParams = new URLSearchParams(urlParams) - newUrlParams.set('min_price', values[0]) - newUrlParams.set('max_price', values[1]) - - const newUrl = window.location.pathname + '?' + newUrlParams.toString() - history.pushState({}, '', newUrl) - location.reload() - }) - } -} diff --git a/resources/assets/src/styles/_plugins.scss b/resources/assets/src/styles/_plugins.scss index 7e26f1d..f3f0c72 100644 --- a/resources/assets/src/styles/_plugins.scss +++ b/resources/assets/src/styles/_plugins.scss @@ -1,5 +1,4 @@ @import "sweetalert2/src/sweetalert2.scss"; -@import "nouislider"; .preloader-main { position: absolute; diff --git a/resources/assets/src/styles/bundle.scss b/resources/assets/src/styles/bundle.scss index 78a0e96..3cc21bc 100644 --- a/resources/assets/src/styles/bundle.scss +++ b/resources/assets/src/styles/bundle.scss @@ -1,20 +1 @@ @import "_plugins"; - -img { - display: block; - max-width: 100%; - height: auto; -} - -.dropdown:hover .dropdown-menu { - display: block; -} - -.thumb-sm img { - width: 100px; - max-width: unset; -} - -.js-remove-from-cart i { - pointer-events: none; -} diff --git a/resources/views/categories/category.twig b/resources/views/categories/category.twig index cb81760..fbfe329 100644 --- a/resources/views/categories/category.twig +++ b/resources/views/categories/category.twig @@ -32,5 +32,5 @@ {% endfor %} {% include 'components/pagination.twig' %} - -{% endblock %} \ No newline at end of file + +{% endblock %} diff --git a/resources/views/components/footer.twig b/resources/views/components/footer.twig index 13a6057..1b62a13 100644 --- a/resources/views/components/footer.twig +++ b/resources/views/components/footer.twig @@ -1,9 +1,5 @@
    -
    -
    - -
    -
    +
    diff --git a/resources/views/components/head.twig b/resources/views/components/head.twig index 814157e..ab6cd58 100644 --- a/resources/views/components/head.twig +++ b/resources/views/components/head.twig @@ -3,10 +3,7 @@ {{ fn('wp_head') }} - - - - + diff --git a/resources/views/components/header.twig b/resources/views/components/header.twig index 9a69ebd..5dda964 100644 --- a/resources/views/components/header.twig +++ b/resources/views/components/header.twig @@ -1,38 +1,30 @@
    -
    +
    -
    +
    -
    - {% include 'woocommerce/components/cartSmall.twig' %} -
    -
    \ No newline at end of file + diff --git a/resources/views/woocommerce/account.twig b/resources/views/woocommerce/account.twig deleted file mode 100644 index 98239c1..0000000 --- a/resources/views/woocommerce/account.twig +++ /dev/null @@ -1,24 +0,0 @@ -{% extends 'layouts/base.twig' %} - -{% block content %} -
    -
    -
    -

    - {{ post.title }} -

    -

    - {{ fn('yoast_breadcrumb', '

    ', false ) }} -

    -
    - -
    - {{ post.content }} -
    - -
    - - -
    - -{% endblock %} diff --git a/resources/views/woocommerce/cart.twig b/resources/views/woocommerce/cart.twig deleted file mode 100644 index ec3ec73..0000000 --- a/resources/views/woocommerce/cart.twig +++ /dev/null @@ -1,130 +0,0 @@ -{% extends 'layouts/base.twig' %} - -{% block content %} - {% if cart.get_cart() is not empty %} -
    -
    -
    -
    -
    - - - - - - - - - - - - {% for cart_item_key, cart_item in cart.get_cart() %} - {% set _product = cart_item['data'] %} - {% set product_id = cart_item['product_id'] %} - {% set product_name = _product.get_name() %} - - {% if _product and _product.exists() and cart_item['quantity'] > 0 and (cart_item|apply_filters('woocommerce_cart_item_visible', true, cart_item, cart_item_key)) %} - - - - - - - - {% endif %} - {% endfor %} - - - - - - - - - - - -
    ImageProductQuantityTotal
    - {% set thumbnail = _product.get_image() %} - - {{ thumbnail|raw }} - - - {{ product_name }} - {# - Date & Time: 2011-02-08 22:25 #} - {#
    #} - {# - Reward Points: 200 #} -
    - {% if _product.is_sold_individually() %} - {% set min_quantity = 1 %} - {% set max_quantity = 1 %} - {% else %} - {% set min_quantity = 0 %} - {% set max_quantity = _product.get_max_purchase_quantity() %} - {% endif %} - -
    -
    - - - {{ function('woocommerce_quantity_input', { - 'input_name': "cart[#{cart_item_key}][qty]", - 'input_value': cart_item.quantity, - 'max_value': max_quantity, - 'min_value': min_quantity, - 'product_name': product_name - }, _product, false) }} - - -
    -
    - - {% if _product.backorders_require_notification() and _product.is_on_backorder(cart_item['quantity']) %} -

    - Available on backorder -

    - {% endif %} -
    - Unit - Price: {{ fn('apply_filters', 'woocommerce_cart_item_price', cart.get_product_price(_product), cart_item, cart_item_key) }} -
    - {% set sub_total = cart.get_product_subtotal(_product, cart_item.quantity) %} - Total: {{ fn('apply_filters', 'woocommerce_cart_item_subtotal', sub_total, cart_item, cart_item_key) }} -
    - -
    Sub-Total - {{ cart.subtotal }} - {{ currency_symbol }} -
    Total - {{ cart.total }} - {{ currency_symbol }} -
    - -
    - Continue -
    -
    -
    - -
    -
    -
    - {% else %} -
    -
    -

    Cart is empty

    -
    -
    - {% endif %} -{% endblock %} \ No newline at end of file diff --git a/resources/views/woocommerce/checkout.twig b/resources/views/woocommerce/checkout.twig deleted file mode 100644 index 98239c1..0000000 --- a/resources/views/woocommerce/checkout.twig +++ /dev/null @@ -1,24 +0,0 @@ -{% extends 'layouts/base.twig' %} - -{% block content %} -
    -
    -
    -

    - {{ post.title }} -

    -

    - {{ fn('yoast_breadcrumb', '

    ', false ) }} -

    -
    - -
    - {{ post.content }} -
    - -
    - - -
    - -{% endblock %} diff --git a/resources/views/woocommerce/components/cartSmall.twig b/resources/views/woocommerce/components/cartSmall.twig deleted file mode 100644 index ec5c4b7..0000000 --- a/resources/views/woocommerce/components/cartSmall.twig +++ /dev/null @@ -1,90 +0,0 @@ - \ No newline at end of file diff --git a/resources/views/woocommerce/product.twig b/resources/views/woocommerce/product.twig deleted file mode 100644 index e442a9c..0000000 --- a/resources/views/woocommerce/product.twig +++ /dev/null @@ -1,156 +0,0 @@ -{% extends 'layouts/base.twig' %} - -{% block content %} - {% do action('woocommerce_before_single_product') %} -
    -
    -
    -
    - {{ fn('yoast_breadcrumb', '', false ) }} -
    -
    -
    -
    -
    - {% do action('woocommerce_before_single_product_summary') %} -
    -
    - -
    - -
    -

    {{ product._name }}

    - -
    - {% if product._sale_price is not empty %} - {{ fn('wc_price', product._regular_price) }} - {{ fn('wc_price', product._sale_price) }} - {% else %} - {{ fn('wc_price', product._regular_price) }} - {% endif %} -
    - -
    - sku: {{ product._sku }} -
    - - {% if categories %} -
    - categories: - -
    - {% endif %} - - {% if product.is_type('variable') %} - {% set product_variations = product.get_available_variations %} - {% if product_variations %} - - - - - - - - - {% for variation in product_variations %} - - {% if variation.name %} - - {% else %} - - {% endif %} - - - {% endfor %} - -
    NamePrice
    {{ variation.name }}N/A{{ variation.price_html }}
    - - - {% else %} -

    No variants found for this product.

    - {% endif %} - {% endif %} - -
    - -
    - -
    - -
    - -
    - {{ fn( - 'edit_post_link', - 'Edit', - '', - '', - post.ID - ) }} -
    - -
    -
    - -
    -
    - {% if related_products %} - - {% endif %} -
    -
    - -
    -
    -{% endblock %} diff --git a/resources/views/woocommerce/shop.twig b/resources/views/woocommerce/shop.twig deleted file mode 100644 index 43553a6..0000000 --- a/resources/views/woocommerce/shop.twig +++ /dev/null @@ -1,92 +0,0 @@ -{% extends 'layouts/base.twig' %} - -{% block content %} -
    -
    -
    -

    -

    -

    - {{ fn('yoast_breadcrumb', '

    ', false ) }} -

    -
    -
    - -
    -
    - {% if attributes %} - {% for attribute in attributes %} -
    -

    {{ attribute.label }}

    - -
    - {% endfor %} - {% endif %} - -
    -
    - -
    - -
    -
    -
    - {{ fn('woocommerce_catalog_ordering') }} -
    -
    -
    - {% if posts %} - {% for post in posts %} -
    -

    - {{ post.title }} -

    - -
    - {% if post.thumbnail %} - {{ post.title }} - {% else %} - - {% endif %} - - {% if post.is_type('variable') %} -

    This is a variable product.

    - {% else %} -

    This is not a variable product.

    - {% endif %} - -
    - -
    -
    -
    - {% endfor %} - {% else %} -

    Nothing found

    - {% endif %} -
    -
    -
    - -
    -
    - {% include 'components/pagination.twig' %} -
    -
    -
    - -{% endblock %} diff --git a/routes/base.php b/routes/base.php index 2aa9307..e1ba340 100644 --- a/routes/base.php +++ b/routes/base.php @@ -3,7 +3,6 @@ use App\Controllers\CategoryController; use App\Controllers\PageController; use App\Controllers\PostController; -use App\Controllers\ProductController; use Core\Route; if (is_category() || is_tag() || is_search()) { @@ -14,30 +13,14 @@ Route::load(PageController::class, 'index', 'index'); } -if (is_cart()) { - Route::load(ProductController::class, 'cart', 'woocommerce/cart'); -} - if (is_single()) { Route::load(PostController::class, 'index', 'posts/post'); } -if (is_account_page()) { - Route::load(PageController::class, 'index', 'woocommerce/account'); -} - -if (is_checkout()) { - Route::load(PageController::class, 'index', 'woocommerce/checkout'); -} - if (is_page()) { Route::load(PageController::class, 'index', 'pages/page'); } -if (is_shop()) { - Route::load(ProductController::class, 'archive', 'woocommerce/archive'); -} - if (is_404()) { Route::view('pages/404'); } diff --git a/todo.md b/todo.md deleted file mode 100644 index 001887a..0000000 --- a/todo.md +++ /dev/null @@ -1,34 +0,0 @@ -## Basics todo - -- [x] dropdown cart - - [x] products list - - [x] remove item - - [x] sale - - [x] cart link + checkout link - - [x] combine same products - -- [ ] product - - [x] sku - - [x] category - - [x] sale price - - [x] variants - - [ ] partner product - - [ ] html for tabs - - [ ] attributes - - [ ] size + weight - - [x] quantity - - [ ] reviews + check admin for reviews enabled - -- [ ] shop - - [ ] filters - - [ ] sale banner - -- [ ] cart - - [ ] apply coupon - - [ ] quantity change - -- [ ] checkout - - [ ] delivery - - [ ] shipping + shipping change - -- [ ] account \ No newline at end of file diff --git a/webpack.mix.js b/webpack.mix.js index 47b4b75..ab348c7 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -1,21 +1,12 @@ -const mix = require('laravel-mix') -const path = require('path') +const mix = require("laravel-mix"); -mix.setPublicPath('resources/assets/dist') -mix.disableNotifications() - -mix.webpackConfig({ - resolve: { - alias: { - '@': path.resolve(__dirname, 'resources/assets/src/scripts') - } - } -}) +mix.setPublicPath("resources/assets/dist"); +mix.disableNotifications(); mix - .sass('resources/assets/src/styles/bundle.scss', 'resources/assets/dist/css/bundle.min.css') - .options({ - processCssUrls: false, - cssNano: { minifyFontValues: false } - }) - .js('resources/assets/src/scripts/app.js', 'resources/assets/dist/js/app.min.js') + .sass("resources/assets/src/styles/bundle.scss", "resources/assets/dist/css/bundle.min.css") + .options({ + processCssUrls: false, + cssNano: {minifyFontValues: false}, + }) + .js("resources/assets/src/scripts/app.js", "resources/assets/dist/js/app.min.js"); diff --git a/woocommerce/archive-product.php b/woocommerce/archive-product.php deleted file mode 100644 index a745c16..0000000 --- a/woocommerce/archive-product.php +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/woocommerce/auth/form-grant-access.php b/woocommerce/auth/form-grant-access.php deleted file mode 100644 index bee0a1f..0000000 --- a/woocommerce/auth/form-grant-access.php +++ /dev/null @@ -1,61 +0,0 @@ - - - - -

    - -

    - - - -

    - ' . esc_html($app_name) . '', '' . esc_html($scope) . ''); -?> -

    - -
      - -
    • - -
    - -
    - ID, 70); ?> -

    - display_name)); -?> - -

    -
    - -

    - - -

    - - diff --git a/woocommerce/auth/form-login.php b/woocommerce/auth/form-login.php deleted file mode 100644 index da0995e..0000000 --- a/woocommerce/auth/form-login.php +++ /dev/null @@ -1,54 +0,0 @@ - - -

    - -

    - - - -

    - cancel and return to %1$s', 'woocommerce'), esc_html(wc_clean($app_name)), esc_url($return_url))); -?> -

    - - - - diff --git a/woocommerce/auth/header.php b/woocommerce/auth/header.php deleted file mode 100644 index 2780427..0000000 --- a/woocommerce/auth/header.php +++ /dev/null @@ -1,33 +0,0 @@ - -> - - - - - <?php esc_html_e('Application authentication request', 'woocommerce'); ?> - - - - -

    <?php esc_attr_e('WooCommerce', 'woocommerce'); ?>

    -
    diff --git a/woocommerce/block-notices/error.php b/woocommerce/block-notices/error.php deleted file mode 100644 index 752da46..0000000 --- a/woocommerce/block-notices/error.php +++ /dev/null @@ -1,50 +0,0 @@ - 1; - -?> - - - - -
    role="alert"> - -
    - -
    -
    - diff --git a/woocommerce/block-notices/success.php b/woocommerce/block-notices/success.php deleted file mode 100644 index 3fafbd6..0000000 --- a/woocommerce/block-notices/success.php +++ /dev/null @@ -1,37 +0,0 @@ - - - -
    role="alert"> - -
    - -
    -
    - diff --git a/woocommerce/cart/cart-empty.php b/woocommerce/cart/cart-empty.php deleted file mode 100644 index 077d8c0..0000000 --- a/woocommerce/cart/cart-empty.php +++ /dev/null @@ -1,39 +0,0 @@ - 0) : ?> -

    - - - -

    - diff --git a/woocommerce/cart/cart-item-data.php b/woocommerce/cart/cart-item-data.php deleted file mode 100644 index 6e66604..0000000 --- a/woocommerce/cart/cart-item-data.php +++ /dev/null @@ -1,26 +0,0 @@ - -
    - -
    :
    -
    - -
    diff --git a/woocommerce/cart/cart-shipping.php b/woocommerce/cart/cart-shipping.php deleted file mode 100644 index 02ccebf..0000000 --- a/woocommerce/cart/cart-shipping.php +++ /dev/null @@ -1,96 +0,0 @@ -countries->get_formatted_address($package['destination'], ', '); -$has_calculated_shipping = ! empty($has_calculated_shipping); -$show_shipping_calculator = ! empty($show_shipping_calculator); -$calculator_text = ''; -?> - - - - -
      - -
    • - ', $index, esc_attr(sanitize_title($method->id)), esc_attr($method->id), checked($method->id, $chosen_method, false)); // WPCS: XSS ok. - } else { - printf('', $index, esc_attr(sanitize_title($method->id)), esc_attr($method->id)); // WPCS: XSS ok. - } - printf('', $index, esc_attr(sanitize_title($method->id)), wc_cart_totals_shipping_method_label($method)); // WPCS: XSS ok. - do_action('woocommerce_after_shipping_rate', $method, $index); - ?> -
    • - -
    - -

    - ' . esc_html($formatted_destination) . ''); - $calculator_text = esc_html__('Change address', 'woocommerce'); - } else { - echo wp_kses_post(apply_filters('woocommerce_shipping_estimate_html', __('Shipping options will be updated during checkout.', 'woocommerce'))); - } -?> -

    - - ' . esc_html($formatted_destination) . ''), - $formatted_destination - ) - ); - $calculator_text = esc_html__('Enter a different address', 'woocommerce'); - endif; -?> - - - ' . esc_html($package_details) . '

    '; ?> - - - - - - - diff --git a/woocommerce/cart/cart-totals.php b/woocommerce/cart/cart-totals.php deleted file mode 100644 index 06a5ac0..0000000 --- a/woocommerce/cart/cart-totals.php +++ /dev/null @@ -1,112 +0,0 @@ - -
    - - - -

    - - - - - - - - - cart->get_coupons() as $code => $coupon) : ?> - - - - - - - cart->needs_shipping() && WC()->cart->show_shipping()) : ?> - - - - - - - - cart->needs_shipping() && 'yes' === get_option('woocommerce_enable_shipping_calc')) : ?> - - - - - - - - - cart->get_fees() as $fee) : ?> - - - - - - - cart->display_prices_including_tax()) { - $taxable_address = WC()->customer->get_taxable_address(); - $estimated_text = ''; - - if (WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping()) { - /* translators: %s location. */ - $estimated_text = sprintf(' ' . esc_html__('(estimated for %s)', 'woocommerce') . '', WC()->countries->estimated_for_prefix($taxable_address[0]) . WC()->countries->countries[ $taxable_address[0] ]); - } - - if ('itemized' === get_option('woocommerce_tax_total_display')) { - foreach (WC()->cart->get_tax_totals() as $code => $tax) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited - ?> - - - - - - - - - - - - - - - - - - - - -
    name); ?>
    label) . $estimated_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>formatted_amount); ?>
    countries->tax_or_vat()) . $estimated_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>
    - -
    - -
    - - - -
    diff --git a/woocommerce/cart/cart.php b/woocommerce/cart/cart.php deleted file mode 100644 index afff69c..0000000 --- a/woocommerce/cart/cart.php +++ /dev/null @@ -1,209 +0,0 @@ - - - -
    - - - - - - - - - - - - - - - - - cart->get_cart() as $cart_item_key => $cart_item) { - $_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key); - $product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key); - /** - * Filter the product name. - * - * @param string $product_name Name of the product in the cart. - * @param array $cart_item The product in the cart. - * @param string $cart_item_key Key for the product in the cart. - * @since 2.1.0 - */ - $product_name = apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key); - - if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_cart_item_visible', true, $cart_item, $cart_item_key)) { - $product_permalink = apply_filters('woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink($cart_item) : '', $cart_item, $cart_item_key); - ?> - - - - - - - - - - - - - - - - - - - - - - - - -
    - ×', - esc_url(wc_get_cart_remove_url($cart_item_key)), - /* translators: %s is the product name */ - esc_attr(sprintf(__('Remove %s from cart', 'woocommerce'), wp_strip_all_tags($product_name))), - esc_attr($product_id), - esc_attr($_product->get_sku()) - ), - $cart_item_key - ); - ?> - - get_image(), $cart_item, $cart_item_key); - - if (!$product_permalink) { - echo $thumbnail; // PHPCS: XSS ok. - } else { - printf('%s', esc_url($product_permalink), $thumbnail); // PHPCS: XSS ok. - } - ?> - - %s', esc_url($product_permalink), $_product->get_name()), $cart_item, $cart_item_key)); - } - - do_action('woocommerce_after_cart_item_name', $cart_item, $cart_item_key); - - // Meta data. - echo wc_get_formatted_cart_item_data($cart_item); // PHPCS: XSS ok. - - // Backorder notification. - if ($_product->backorders_require_notification() && $_product->is_on_backorder($cart_item['quantity'])) { - echo wp_kses_post(apply_filters('woocommerce_cart_item_backorder_notification', '

    ' . esc_html__('Available on backorder', 'woocommerce') . '

    ', $product_id)); - } - ?> -
    - cart->get_product_price($_product), $cart_item, $cart_item_key); // PHPCS: XSS ok. - ?> - - is_sold_individually()) { - $min_quantity = 1; - $max_quantity = 1; - } else { - $min_quantity = 0; - $max_quantity = $_product->get_max_purchase_quantity(); - } - - $product_quantity = woocommerce_quantity_input( - array( - 'input_name' => "cart[{$cart_item_key}][qty]", - 'input_value' => $cart_item['quantity'], - 'max_value' => $max_quantity, - 'min_value' => $min_quantity, - 'product_name' => $product_name, - ), - $_product, - false - ); - - echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item); // PHPCS: XSS ok. - ?> - - cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key); // PHPCS: XSS ok. - ?> -
    - - -
    - - - - -
    - - - - - - - - -
    - -
    - - - -
    - -
    - - diff --git a/woocommerce/cart/cross-sells.php b/woocommerce/cart/cross-sells.php deleted file mode 100644 index 983f471..0000000 --- a/woocommerce/cart/cross-sells.php +++ /dev/null @@ -1,51 +0,0 @@ - - -
    - -

    - - - - - - - get_id()); - - setup_postdata($GLOBALS['post'] = & $post_object); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, Squiz.PHP.DisallowMultipleAssignments.Found - - wc_get_template_part('content', 'product'); - ?> - - - - - -
    - - -cart->is_empty()) : ?> - -
      - cart->get_cart() as $cart_item_key => $cart_item) { - $_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key); - $product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key); - - if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key)) { - /** - * This filter is documented in woocommerce/templates/cart/cart.php. - * - * @since 2.1.0 - */ - $product_name = apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key); - $thumbnail = apply_filters('woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key); - $product_price = apply_filters('woocommerce_cart_item_price', WC()->cart->get_product_price($_product), $cart_item, $cart_item_key); - $product_permalink = apply_filters('woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink($cart_item) : '', $cart_item, $cart_item_key); - ?> -
    • - ×', - esc_url(wc_get_cart_remove_url($cart_item_key)), - /* translators: %s is the product name */ - esc_attr(sprintf(__('Remove %s from cart', 'woocommerce'), wp_strip_all_tags($product_name))), - esc_attr($product_id), - esc_attr($cart_item_key), - esc_attr($_product->get_sku()) - ), - $cart_item_key - ); - ?> - - - - - - - - - ' . sprintf('%s × %s', $cart_item['quantity'], $product_price) . '', $cart_item, $cart_item_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
    • - -
    - -

    - -

    - - - -

    - - - - - -

    - - - - diff --git a/woocommerce/cart/proceed-to-checkout-button.php b/woocommerce/cart/proceed-to-checkout-button.php deleted file mode 100644 index dc5965f..0000000 --- a/woocommerce/cart/proceed-to-checkout-button.php +++ /dev/null @@ -1,27 +0,0 @@ - - - - - diff --git a/woocommerce/cart/shipping-calculator.php b/woocommerce/cart/shipping-calculator.php deleted file mode 100644 index 09c8f15..0000000 --- a/woocommerce/cart/shipping-calculator.php +++ /dev/null @@ -1,96 +0,0 @@ - - -
    - - %s', esc_html(! empty($button_text) ? $button_text : __('Calculate shipping', 'woocommerce'))); ?> - - -
    - - diff --git a/woocommerce/checkout/cart-errors.php b/woocommerce/checkout/cart-errors.php deleted file mode 100644 index 17fb064..0000000 --- a/woocommerce/checkout/cart-errors.php +++ /dev/null @@ -1,25 +0,0 @@ - - -

    - - - -

    diff --git a/woocommerce/checkout/form-billing.php b/woocommerce/checkout/form-billing.php deleted file mode 100644 index f9acd97..0000000 --- a/woocommerce/checkout/form-billing.php +++ /dev/null @@ -1,74 +0,0 @@ - -
    - cart->needs_shipping()) : ?> - -

    - - - -

    - - - - - -
    - get_checkout_fields('billing'); - -foreach ($fields as $key => $field) { - woocommerce_form_field($key, $field, $checkout->get_value($key)); -} -?> -
    - - -
    - -is_registration_enabled()) : ?> - - diff --git a/woocommerce/checkout/form-checkout.php b/woocommerce/checkout/form-checkout.php deleted file mode 100644 index 16754bd..0000000 --- a/woocommerce/checkout/form-checkout.php +++ /dev/null @@ -1,66 +0,0 @@ -is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in()) { - echo esc_html(apply_filters('woocommerce_checkout_must_be_logged_in_message', __('You must be logged in to checkout.', 'woocommerce'))); - return; -} - -?> - -
    - - get_checkout_fields()) : ?> - - - -
    -
    - -
    - -
    - -
    -
    - - - - - - - -

    - - - -
    - -
    - - - -
    - - diff --git a/woocommerce/checkout/form-coupon.php b/woocommerce/checkout/form-coupon.php deleted file mode 100644 index 86eeede..0000000 --- a/woocommerce/checkout/form-coupon.php +++ /dev/null @@ -1,43 +0,0 @@ - -
    - ' . esc_html__('Click here to enter your code', 'woocommerce') . ''), 'notice'); ?> -
    - - diff --git a/woocommerce/checkout/form-login.php b/woocommerce/checkout/form-login.php deleted file mode 100644 index 1597a8f..0000000 --- a/woocommerce/checkout/form-login.php +++ /dev/null @@ -1,36 +0,0 @@ - - - esc_html__('If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing section.', 'woocommerce'), - 'redirect' => wc_get_checkout_url(), - 'hidden' => true, - ) -); diff --git a/woocommerce/checkout/form-pay.php b/woocommerce/checkout/form-pay.php deleted file mode 100644 index b7803d4..0000000 --- a/woocommerce/checkout/form-pay.php +++ /dev/null @@ -1,109 +0,0 @@ -get_order_item_totals(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -?> -
    - - - - - - - - - - - get_items()) > 0) : ?> - get_items() as $item_id => $item) : ?> - - - - - - - - - - - - - - - - - - - -
    - get_name(), $item, false)); - - do_action('woocommerce_order_item_meta_start', $item_id, $item, $order, false); - - wc_display_item_meta($item); - - do_action('woocommerce_order_item_meta_end', $item_id, $item, $order, false); - ?> - ' . sprintf('× %s', esc_html($item->get_quantity())) . '', $item); ?>get_formatted_line_subtotal($item); ?>
    - - - -
    - needs_payment()) : ?> -
      - $gateway )); - } - } else { - echo '
    • '; - wc_print_notice(apply_filters('woocommerce_no_available_payment_methods_message', esc_html__('Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce')), 'notice'); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment - echo '
    • '; - } -?> -
    - -
    - - - - - - - ' . esc_html($order_button_text) . ''); // @codingStandardsIgnoreLine?> - - - - -
    -
    -
    diff --git a/woocommerce/checkout/form-shipping.php b/woocommerce/checkout/form-shipping.php deleted file mode 100644 index acbcd4a..0000000 --- a/woocommerce/checkout/form-shipping.php +++ /dev/null @@ -1,70 +0,0 @@ - -
    - cart->needs_shipping_address()) : ?> - -

    - -

    - -
    - - - -
    - get_checkout_fields('shipping'); - - foreach ($fields as $key => $field) { - woocommerce_form_field($key, $field, $checkout->get_value($key)); - } - ?> -
    - - - -
    - - -
    -
    - - - - - cart->needs_shipping() || wc_ship_to_billing_address_only()) : ?> - -

    - - - -
    - get_checkout_fields('order') as $key => $field) : ?> - get_value($key)); ?> - -
    - - - - -
    diff --git a/woocommerce/checkout/form-verify-email.php b/woocommerce/checkout/form-verify-email.php deleted file mode 100644 index 9af126e..0000000 --- a/woocommerce/checkout/form-verify-email.php +++ /dev/null @@ -1,53 +0,0 @@ - -
    - - -

    - ', - '' - ); -?> -

    - -

    - - -

    - -

    - -

    -
    diff --git a/woocommerce/checkout/order-receipt.php b/woocommerce/checkout/order-receipt.php deleted file mode 100644 index 55176b9..0000000 --- a/woocommerce/checkout/order-receipt.php +++ /dev/null @@ -1,46 +0,0 @@ - - -
      -
    • - - get_order_number()); ?> -
    • -
    • - - get_date_created())); ?> -
    • -
    • - - get_formatted_order_total()); ?> -
    • - get_payment_method_title()) : ?> -
    • - - get_payment_method_title()); ?> -
    • - -
    - -get_payment_method(), $order->get_id()); ?> - -
    diff --git a/woocommerce/checkout/order-received.php b/woocommerce/checkout/order-received.php deleted file mode 100644 index 4b13d63..0000000 --- a/woocommerce/checkout/order-received.php +++ /dev/null @@ -1,42 +0,0 @@ - - -

    - -

    diff --git a/woocommerce/checkout/payment-method.php b/woocommerce/checkout/payment-method.php deleted file mode 100644 index 6c8d438..0000000 --- a/woocommerce/checkout/payment-method.php +++ /dev/null @@ -1,33 +0,0 @@ - -
  • - chosen, true); ?> data-order_button_text="order_button_text); ?>" /> - - - has_fields() || $gateway->get_description()) : ?> -
    chosen) : /* phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace */ ?>style="display:none;"> - payment_fields(); ?> -
    - -
  • diff --git a/woocommerce/checkout/payment.php b/woocommerce/checkout/payment.php deleted file mode 100644 index 8b08b13..0000000 --- a/woocommerce/checkout/payment.php +++ /dev/null @@ -1,63 +0,0 @@ - -
    - cart->needs_payment()) : ?> -
      - $gateway )); - } - } else { - echo '
    • '; - wc_print_notice(apply_filters('woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? esc_html__('Sorry, it seems that there are no available payment methods. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce') : esc_html__('Please fill in your details above to see available payment methods.', 'woocommerce')), 'notice'); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment - echo '
    • '; - } -?> -
    - -
    - - - - - - - ' . esc_html($order_button_text) . ''); // @codingStandardsIgnoreLine?> - - - - -
    -
    - - - - - - - - - - cart->get_cart() as $cart_item_key => $cart_item) { - $_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key); - - if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key)) { - ?> - - - - - - - - - - - - - - cart->get_coupons() as $code => $coupon) : ?> - - - - - - - cart->needs_shipping() && WC()->cart->show_shipping()) : ?> - - - - - - - - - - cart->get_fees() as $fee) : ?> - - - - - - - cart->display_prices_including_tax()) : ?> - - cart->get_tax_totals() as $code => $tax) : // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited?> - - - - - - - - - - - - - - - - - - - - - - - -
    - get_name(), $cart_item, $cart_item_key)) . ' '; ?> - ' . sprintf('× %s', $cart_item['quantity']) . '', $cart_item, $cart_item_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> - - - cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
    name); ?>
    label); ?>formatted_amount); ?>
    countries->tax_or_vat()); ?>
    diff --git a/woocommerce/checkout/terms.php b/woocommerce/checkout/terms.php deleted file mode 100644 index baaed15..0000000 --- a/woocommerce/checkout/terms.php +++ /dev/null @@ -1,40 +0,0 @@ - -
    - - - -

    - - -

    - -
    - - -
    - - get_id()); - ?> - - has_status('failed')) : ?> - -

    - -

    - - - - -

    - - - - $order )); ?> - -
      - -
    • - - get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
    • - -
    • - - get_date_created()); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
    • - - get_user_id() === get_current_user_id() && $order->get_billing_email()) : ?> - - - -
    • - - get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
    • - - get_payment_method_title()) : ?> -
    • - - get_payment_method_title()); ?> -
    • - - -
    - - - - get_payment_method(), $order->get_id()); ?> - get_id()); ?> - - - - false )); ?> - - - -
    diff --git a/woocommerce/emails/admin-cancelled-order.php b/woocommerce/emails/admin-cancelled-order.php deleted file mode 100644 index 224aa02..0000000 --- a/woocommerce/emails/admin-cancelled-order.php +++ /dev/null @@ -1,60 +0,0 @@ - - - -

    get_order_number()), esc_html($order->get_formatted_billing_full_name())); ?>

    - - - - -

    get_order_number()), esc_html($order->get_formatted_billing_full_name())); ?>

    - - - - -

    get_formatted_billing_full_name()); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>

    - - - -

    get_billing_first_name())); ?>

    -

    - - - -

    get_billing_first_name())); ?>

    - -needs_payment()) { ?> -

    - array( - 'href' => array(), - ), - ) - ), - esc_html(get_bloginfo('name', 'display')), - '' . esc_html__('Pay for this order', 'woocommerce') . '' - ); - ?> -

    - - -

    - get_date_created()))); - ?> -

    - - - -

    - -

    ' . esc_html($user_login) . '', make_clickable(esc_url(wc_get_page_permalink('myaccount')))); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>

    - -

    - - - - - -

    - -

    ' . esc_html($user_login) . '', make_clickable(esc_url(wc_get_page_permalink('myaccount')))); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>

    - - -

    - - - - - -

    get_billing_first_name())); ?>

    -

    - -
    - -

    - - - - -

    get_billing_first_name())); ?>

    -

    - - - - -

    get_billing_first_name())); ?>

    - -

    get_order_number())); ?>

    - - - - -

    get_billing_first_name())); ?>

    - -

    - -

    - - - - - -

    - -

    - -

    -

    -

    - - - -

    - -get_formatted_billing_address(); -$shipping = $order->get_formatted_shipping_address(); - -?> - - - needs_shipping_address() && $shipping) : ?> - - - -
    -

    - -
    - - get_billing_phone()) : ?> -
    get_billing_phone()); ?> - - get_billing_email()) : ?> -
    get_billing_email()); ?> - - -
    -
    -

    - -
    - - get_shipping_phone()) : ?> -
    get_shipping_phone()); ?> - - -
    -
    diff --git a/woocommerce/emails/email-customer-details.php b/woocommerce/emails/email-customer-details.php deleted file mode 100644 index e2fedcc..0000000 --- a/woocommerce/emails/email-customer-details.php +++ /dev/null @@ -1,31 +0,0 @@ - - -
    -

    -
      - -
    • :
    • - -
    -
    - diff --git a/woocommerce/emails/email-downloads.php b/woocommerce/emails/email-downloads.php deleted file mode 100644 index d586877..0000000 --- a/woocommerce/emails/email-downloads.php +++ /dev/null @@ -1,68 +0,0 @@ -

    - - - - - $column_name) : ?> - - - - - - - - $column_name) : ?> - - - - -
    - - - - - - - -
    diff --git a/woocommerce/emails/email-footer.php b/woocommerce/emails/email-footer.php deleted file mode 100644 index d7e47e8..0000000 --- a/woocommerce/emails/email-footer.php +++ /dev/null @@ -1,75 +0,0 @@ - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/woocommerce/emails/email-header.php b/woocommerce/emails/email-header.php deleted file mode 100644 index 0a7d4dd..0000000 --- a/woocommerce/emails/email-header.php +++ /dev/null @@ -1,72 +0,0 @@ - - -> - - - - <?php echo get_bloginfo('name', 'display'); ?> - - ="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> - - - -
    -
    - - -
    -
    - ' . esc_attr(get_bloginfo('name', 'display')) . '

    '; -} -?> -
    - - - - - -
    - - - - - -
    -

    -
    - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/woocommerce/order/order-details.php b/woocommerce/order/order-details.php deleted file mode 100644 index 3b05926..0000000 --- a/woocommerce/order/order-details.php +++ /dev/null @@ -1,115 +0,0 @@ -get_items(apply_filters('woocommerce_purchase_order_item_types', 'line_item')); -$show_purchase_note = $order->has_status(apply_filters('woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ))); -$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id(); -$downloads = $order->get_downloadable_items(); - -if ($show_downloads) { - wc_get_template( - 'order/order-downloads.php', - array( - 'downloads' => $downloads, - 'show_title' => true, - ) - ); -} -?> -
    - - -

    - -
    - - - - - - - - - - - - - - - diff --git a/woocommerce/emails/email-styles.php b/woocommerce/emails/email-styles.php deleted file mode 100644 index aa68da6..0000000 --- a/woocommerce/emails/email-styles.php +++ /dev/null @@ -1,264 +0,0 @@ - -body { - background-color: ; - padding: 0; - text-align: center; -} - -#outer_wrapper { - background-color: ; -} - -#wrapper { - margin: 0 auto; - padding: 70px 0; - -webkit-text-size-adjust: none !important; - width: 100%; - max-width: 600px; -} - -#template_container { - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important; - background-color: ; - border: 1px solid ; - border-radius: 3px !important; -} - -#template_header { - background-color: ; - border-radius: 3px 3px 0 0 !important; - color: ; - border-bottom: 0; - font-weight: bold; - line-height: 100%; - vertical-align: middle; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; -} - -#template_header h1, -#template_header h1 a { - color: ; - background-color: inherit; -} - -#template_header_image img { - margin-left: 0; - margin-right: 0; -} - -#template_footer td { - padding: 0; - border-radius: 6px; -} - -#template_footer #credit { - border: 0; - color: ; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-size: 12px; - line-height: 150%; - text-align: center; - padding: 24px 0; -} - -#template_footer #credit p { - margin: 0 0 16px; -} - -#body_content { - background-color: ; -} - -#body_content table td { - padding: 48px 48px 32px; -} - -#body_content table td td { - padding: 12px; -} - -#body_content table td th { - padding: 12px; -} - -#body_content td ul.wc-item-meta { - font-size: small; - margin: 1em 0 0; - padding: 0; - list-style: none; -} - -#body_content td ul.wc-item-meta li { - margin: 0.5em 0 0; - padding: 0; -} - -#body_content td ul.wc-item-meta li p { - margin: 0; -} - -#body_content p { - margin: 0 0 16px; -} - -#body_content_inner { - color: ; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-size: 14px; - line-height: 150%; - text-align: ; -} - -.td { - color: ; - border: 1px solid ; - vertical-align: middle; -} - -.address { - padding: 12px; - color: ; - border: 1px solid ; -} - -.additional-fields { - padding: 12px 12px 0; - color: ; - border: 1px solid ; - list-style: none outside; -} - -.additional-fields li { - margin: 0 0 12px 0; -} - -.text { - color: ; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; -} - -.link { - color: ; -} - -#header_wrapper { - padding: 36px 48px; - display: block; -} - -h1 { - color: ; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-size: 30px; - font-weight: 300; - line-height: 150%; - margin: 0; - text-align: ; - text-shadow: 0 1px 0 ; -} - -h2 { - color: ; - display: block; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-size: 18px; - font-weight: bold; - line-height: 130%; - margin: 0 0 18px; - text-align: ; -} - -h3 { - color: ; - display: block; - font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-size: 16px; - font-weight: bold; - line-height: 130%; - margin: 16px 0 8px; - text-align: ; -} - -a { - color: ; - font-weight: normal; - text-decoration: underline; -} - -img { - border: none; - display: inline-block; - font-size: 14px; - font-weight: bold; - height: auto; - outline: none; - text-decoration: none; - text-transform: capitalize; - vertical-align: middle; - margin-: 10px; - max-width: 100%; -} - -/** - * Media queries are not supported by all email clients, however they do work on modern mobile - * Gmail clients and can help us achieve better consistency there. - */ -@media screen and (max-width: 600px) { - #header_wrapper { - padding: 27px 36px !important; - font-size: 24px; - } - - #body_content table > tbody > tr > td { - padding: 10px !important; - } - - #body_content_inner { - font-size: 10px !important; - } -} -get_order_number()), esc_html($order->get_formatted_billing_full_name())) . "\n\n"; - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/admin-failed-order.php b/woocommerce/emails/plain/admin-failed-order.php deleted file mode 100644 index fa23505..0000000 --- a/woocommerce/emails/plain/admin-failed-order.php +++ /dev/null @@ -1,58 +0,0 @@ -get_order_number()), esc_html($order->get_formatted_billing_full_name())) . "\n\n"; - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/admin-new-order.php b/woocommerce/emails/plain/admin-new-order.php deleted file mode 100644 index 889ecc0..0000000 --- a/woocommerce/emails/plain/admin-new-order.php +++ /dev/null @@ -1,58 +0,0 @@ -get_formatted_billing_full_name())) . "\n\n"; - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/customer-completed-order.php b/woocommerce/emails/plain/customer-completed-order.php deleted file mode 100644 index f66538e..0000000 --- a/woocommerce/emails/plain/customer-completed-order.php +++ /dev/null @@ -1,60 +0,0 @@ -get_billing_first_name())) . "\n\n"; -/* translators: %s: Site title */ -echo esc_html__('We have finished processing your order.', 'woocommerce') . "\n\n"; - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/customer-invoice.php b/woocommerce/emails/plain/customer-invoice.php deleted file mode 100644 index aea1bea..0000000 --- a/woocommerce/emails/plain/customer-invoice.php +++ /dev/null @@ -1,78 +0,0 @@ -get_billing_first_name())) . "\n\n"; - -if ($order->has_status('pending')) { - echo wp_kses_post( - sprintf( - /* translators: %1$s: Site title, %2$s: Order pay link */ - __('An order has been created for you on %1$s. Your invoice is below, with a link to make payment when you’re ready: %2$s', 'woocommerce'), - esc_html(get_bloginfo('name', 'display')), - esc_url($order->get_checkout_payment_url()) - ) - ) . "\n\n"; -} else { - /* translators: %s: Order date */ - echo sprintf(esc_html__('Here are the details of your order placed on %s:', 'woocommerce'), esc_html(wc_format_datetime($order->get_date_created()))) . "\n\n"; -} - -/** - * Hook for the woocommerce_email_order_details. - * - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/** - * Hook for the woocommerce_email_order_meta. - * - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/** - * Hook for woocommerce_email_customer_details - * - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/customer-new-account-blocks.php b/woocommerce/emails/plain/customer-new-account-blocks.php deleted file mode 100644 index 2f70b37..0000000 --- a/woocommerce/emails/plain/customer-new-account-blocks.php +++ /dev/null @@ -1,45 +0,0 @@ -get_billing_first_name())) . "\n\n"; -echo esc_html__('The following note has been added to your order:', 'woocommerce') . "\n\n"; - -echo "----------\n\n"; - -echo wptexturize($customer_note) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped - -echo "----------\n\n"; - -echo esc_html__('As a reminder, here are your order details:', 'woocommerce') . "\n\n"; - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/customer-on-hold-order.php b/woocommerce/emails/plain/customer-on-hold-order.php deleted file mode 100644 index 80a0269..0000000 --- a/woocommerce/emails/plain/customer-on-hold-order.php +++ /dev/null @@ -1,59 +0,0 @@ -get_billing_first_name())) . "\n\n"; -echo esc_html__('Thanks for your order. It’s on-hold until we confirm that payment has been received.', 'woocommerce') . "\n\n"; - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/customer-processing-order.php b/woocommerce/emails/plain/customer-processing-order.php deleted file mode 100644 index b730720..0000000 --- a/woocommerce/emails/plain/customer-processing-order.php +++ /dev/null @@ -1,60 +0,0 @@ -get_billing_first_name())) . "\n\n"; -/* translators: %s: Order number */ -echo sprintf(esc_html__('Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'woocommerce'), esc_html($order->get_order_number())) . "\n\n"; - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/customer-refunded-order.php b/woocommerce/emails/plain/customer-refunded-order.php deleted file mode 100644 index 20459d5..0000000 --- a/woocommerce/emails/plain/customer-refunded-order.php +++ /dev/null @@ -1,65 +0,0 @@ -get_billing_first_name())) . "\n\n"; -if ($partial_refund) { - /* translators: %s: Site title */ - echo sprintf(esc_html__('Your order on %s has been partially refunded. There are more details below for your reference:', 'woocommerce'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES)) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -} else { - /* translators: %s: Site title */ - echo sprintf(esc_html__('Your order on %s has been refunded. There are more details below for your reference:', 'woocommerce'), wp_specialchars_decode(get_option('blogname'), ENT_QUOTES)) . "\n\n"; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -} - -/* - * @hooked WC_Emails::order_details() Shows the order details table. - * @hooked WC_Structured_Data::generate_order_data() Generates structured data. - * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. - * @since 2.5.0 - */ -do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n----------------------------------------\n\n"; - -/* - * @hooked WC_Emails::order_meta() Shows order meta data. - */ -do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email); - -/* - * @hooked WC_Emails::customer_details() Shows customer details - * @hooked WC_Emails::email_address() Shows email address - */ -do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email); - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/customer-reset-password.php b/woocommerce/emails/plain/customer-reset-password.php deleted file mode 100644 index 7f5a314..0000000 --- a/woocommerce/emails/plain/customer-reset-password.php +++ /dev/null @@ -1,43 +0,0 @@ - $reset_key, 'id' => $user_id ), wc_get_endpoint_url('lost-password', '', wc_get_page_permalink('myaccount')))) . "\n\n"; // phpcs:ignore - -echo "\n\n----------------------------------------\n\n"; - -/** - * Show user-defined additional content - this is set in each email's settings. - */ -if ($additional_content) { - echo esc_html(wp_strip_all_tags(wptexturize($additional_content))); - echo "\n\n----------------------------------------\n\n"; -} - -echo wp_kses_post(apply_filters('woocommerce_email_footer_text', get_option('woocommerce_email_footer_text'))); diff --git a/woocommerce/emails/plain/email-addresses.php b/woocommerce/emails/plain/email-addresses.php deleted file mode 100644 index 41dae59..0000000 --- a/woocommerce/emails/plain/email-addresses.php +++ /dev/null @@ -1,66 +0,0 @@ -#i', "\n", $order->get_formatted_billing_address()) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - -if ($order->get_billing_phone()) { - echo $order->get_billing_phone() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -} - -if ($order->get_billing_email()) { - echo $order->get_billing_email() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -} - -/** - * Fires after the core address fields in emails. - * - * @since 8.6.0 - * - * @param string $type Address type. Either 'billing' or 'shipping'. - * @param WC_Order $order Order instance. - * @param bool $sent_to_admin If this email is being sent to the admin or not. - * @param bool $plain_text If this email is plain text or not. - */ -do_action('woocommerce_email_customer_address_section', 'billing', $order, $sent_to_admin, true); - -if (!wc_ship_to_billing_address_only() && $order->needs_shipping_address()) { - $shipping = $order->get_formatted_shipping_address(); - - if ($shipping) { - echo "\n" . esc_html(wc_strtoupper(esc_html__('Shipping address', 'woocommerce'))) . "\n\n"; - echo preg_replace('##i', "\n", $shipping) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - - if ($order->get_shipping_phone()) { - echo $order->get_shipping_phone() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - /** - * Fires after the core address fields in emails. - * - * @since 8.6.0 - * - * @param string $type Address type. Either 'billing' or 'shipping'. - * @param WC_Order $order Order instance. - * @param bool $sent_to_admin If this email is being sent to the admin or not. - * @param bool $plain_text If this email is plain text or not. - */ - do_action('woocommerce_email_customer_address_section', 'shipping', $order, $sent_to_admin, true); - } -} diff --git a/woocommerce/emails/plain/email-customer-details.php b/woocommerce/emails/plain/email-customer-details.php deleted file mode 100644 index 080cb9a..0000000 --- a/woocommerce/emails/plain/email-customer-details.php +++ /dev/null @@ -1,26 +0,0 @@ - $column_name) { - echo wp_kses_post($column_name) . ': '; - - if (has_action('woocommerce_email_downloads_column_' . $column_id)) { - do_action('woocommerce_email_downloads_column_' . $column_id, $download, $plain_text); - } else { - switch ($column_id) { - case 'download-product': - echo esc_html($download['product_name']); - break; - case 'download-file': - echo esc_html($download['download_name']) . ' - ' . esc_url($download['download_url']); - break; - case 'download-expires': - if (!empty($download['access_expires'])) { - echo esc_html(date_i18n(get_option('date_format'), strtotime($download['access_expires']))); - } else { - esc_html_e('Never', 'woocommerce'); - } - break; - } - } - echo "\n"; - } - echo "\n"; -} -echo '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='; -echo "\n\n"; diff --git a/woocommerce/emails/plain/email-order-details.php b/woocommerce/emails/plain/email-order-details.php deleted file mode 100644 index 22fc6ed..0000000 --- a/woocommerce/emails/plain/email-order-details.php +++ /dev/null @@ -1,54 +0,0 @@ -get_order_number(), wc_format_datetime($order->get_date_created())))) . "\n"; -echo "\n" . wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - $order, - array( - 'show_sku' => $sent_to_admin, - 'show_image' => false, - 'image_size' => array( 32, 32 ), - 'plain_text' => true, - 'sent_to_admin' => $sent_to_admin, - ) -); - -echo "==========\n\n"; - -$item_totals = $order->get_order_item_totals(); - -if ($item_totals) { - foreach ($item_totals as $total) { - echo wp_kses_post($total['label'] . "\t " . $total['value']) . "\n"; - } -} - -if ($order->get_customer_note()) { - echo esc_html__('Note:', 'woocommerce') . "\t " . wp_kses_post(wptexturize($order->get_customer_note())) . "\n"; -} - -if ($sent_to_admin) { - /* translators: %s: Order link. */ - echo "\n" . sprintf(esc_html__('View order: %s', 'woocommerce'), esc_url($order->get_edit_order_url())) . "\n"; -} - -do_action('woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email); diff --git a/woocommerce/emails/plain/email-order-items.php b/woocommerce/emails/plain/email-order-items.php deleted file mode 100644 index af0b1f3..0000000 --- a/woocommerce/emails/plain/email-order-items.php +++ /dev/null @@ -1,66 +0,0 @@ - $item) : - if (apply_filters('woocommerce_order_item_visible', true, $item)) { - $product = $item->get_product(); - $sku = ''; - $purchase_note = ''; - - if (is_object($product)) { - $sku = $product->get_sku(); - $purchase_note = $product->get_purchase_note(); - } - - // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped - echo wp_kses_post(apply_filters('woocommerce_order_item_name', $item->get_name(), $item, false)); - if ($show_sku && $sku) { - echo ' (#' . $sku . ')'; - } - echo ' X ' . apply_filters('woocommerce_email_order_item_quantity', $item->get_quantity(), $item); - echo ' = ' . $order->get_formatted_line_subtotal($item) . "\n"; - // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped - - // allow other plugins to add additional product information here. - do_action('woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text); - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo strip_tags( - wc_display_item_meta( - $item, - array( - 'before' => "\n- ", - 'separator' => "\n- ", - 'after' => '', - 'echo' => false, - 'autop' => false, - ) - ) - ); - - // allow other plugins to add additional product information here. - do_action('woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text); - } - // Note. - if ($show_purchase_note && $purchase_note) { - echo "\n" . do_shortcode(wp_kses_post($purchase_note)); - } - echo "\n\n"; -endforeach; diff --git a/woocommerce/global/breadcrumb.php b/woocommerce/global/breadcrumb.php deleted file mode 100644 index 3386f31..0000000 --- a/woocommerce/global/breadcrumb.php +++ /dev/null @@ -1,43 +0,0 @@ - $crumb) { - echo $before; - - if (!empty($crumb[1]) && sizeof($breadcrumb) !== $key + 1) { - echo '' . esc_html($crumb[0]) . ''; - } else { - echo esc_html($crumb[0]); - } - - echo $after; - - if (sizeof($breadcrumb) !== $key + 1) { - echo $delimiter; - } - } - - echo $wrap_after; -} diff --git a/woocommerce/global/form-login.php b/woocommerce/global/form-login.php deleted file mode 100644 index a1f0b2b..0000000 --- a/woocommerce/global/form-login.php +++ /dev/null @@ -1,61 +0,0 @@ - -> - - - - - -

    - - -

    -

    - - -

    -
    - - - -

    - - - - -

    -

    - -

    - -
    - - - - diff --git a/woocommerce/global/quantity-input.php b/woocommerce/global/quantity-input.php deleted file mode 100644 index c1c2ac7..0000000 --- a/woocommerce/global/quantity-input.php +++ /dev/null @@ -1,64 +0,0 @@ - -
    - - - - id="" - class="" - name="" - value="" - aria-label="" - size="4" - min="" - max="" - - step="" - placeholder="" - inputmode="" - autocomplete="" - - /> - -
    -'; - break; - case 'twentyeleven': - echo ''; - get_sidebar('shop'); - echo ''; - break; - case 'twentytwelve': - echo ''; - break; - case 'twentythirteen': - echo ''; - break; - case 'twentyfourteen': - echo ''; - get_sidebar('content'); - break; - case 'twentyfifteen': - echo ''; - break; - case 'twentysixteen': - echo ''; - break; - default: - echo ''; - break; -} diff --git a/woocommerce/global/wrapper-start.php b/woocommerce/global/wrapper-start.php deleted file mode 100644 index 794535e..0000000 --- a/woocommerce/global/wrapper-start.php +++ /dev/null @@ -1,49 +0,0 @@ -
    '; - break; - case 'twentyeleven': - echo '
    '; - break; - case 'twentytwelve': - echo '
    '; - break; - case 'twentythirteen': - echo '
    '; - break; - case 'twentyfourteen': - echo '
    '; - break; - case 'twentyfifteen': - echo '
    '; - break; - case 'twentysixteen': - echo '
    '; - break; - default: - echo '
    '; - break; -} diff --git a/woocommerce/loop/add-to-cart.php b/woocommerce/loop/add-to-cart.php deleted file mode 100644 index 12d3009..0000000 --- a/woocommerce/loop/add-to-cart.php +++ /dev/null @@ -1,36 +0,0 @@ -%s', - esc_url($product->add_to_cart_url()), - esc_attr(isset($args['quantity']) ? $args['quantity'] : 1), - esc_attr(isset($args['class']) ? $args['class'] : 'button'), - isset($args['attributes']) ? wc_implode_html_attributes($args['attributes']) : '', - esc_html($product->add_to_cart_text()) - ), - $product, - $args -); diff --git a/woocommerce/loop/loop-end.php b/woocommerce/loop/loop-end.php deleted file mode 100644 index 90b7947..0000000 --- a/woocommerce/loop/loop-end.php +++ /dev/null @@ -1,22 +0,0 @@ - - diff --git a/woocommerce/loop/loop-start.php b/woocommerce/loop/loop-start.php deleted file mode 100644 index 567b0cb..0000000 --- a/woocommerce/loop/loop-start.php +++ /dev/null @@ -1,22 +0,0 @@ - -
      diff --git a/woocommerce/loop/no-products-found.php b/woocommerce/loop/no-products-found.php deleted file mode 100644 index f0168f7..0000000 --- a/woocommerce/loop/no-products-found.php +++ /dev/null @@ -1,23 +0,0 @@ - -
      - -
      diff --git a/woocommerce/loop/orderby.php b/woocommerce/loop/orderby.php deleted file mode 100644 index 4381a23..0000000 --- a/woocommerce/loop/orderby.php +++ /dev/null @@ -1,31 +0,0 @@ - -
      - - - - diff --git a/woocommerce/loop/pagination.php b/woocommerce/loop/pagination.php deleted file mode 100644 index 6886ba2..0000000 --- a/woocommerce/loop/pagination.php +++ /dev/null @@ -1,51 +0,0 @@ - - diff --git a/woocommerce/loop/price.php b/woocommerce/loop/price.php deleted file mode 100644 index c576eff..0000000 --- a/woocommerce/loop/price.php +++ /dev/null @@ -1,27 +0,0 @@ - - -get_price_html()) : ?> - - diff --git a/woocommerce/loop/rating.php b/woocommerce/loop/rating.php deleted file mode 100644 index af34192..0000000 --- a/woocommerce/loop/rating.php +++ /dev/null @@ -1,28 +0,0 @@ -get_average_rating()); // WordPress.XSS.EscapeOutput.OutputNotEscaped. diff --git a/woocommerce/loop/result-count.php b/woocommerce/loop/result-count.php deleted file mode 100644 index c28ea65..0000000 --- a/woocommerce/loop/result-count.php +++ /dev/null @@ -1,40 +0,0 @@ - -

      - -

      diff --git a/woocommerce/loop/sale-flash.php b/woocommerce/loop/sale-flash.php deleted file mode 100644 index acac061..0000000 --- a/woocommerce/loop/sale-flash.php +++ /dev/null @@ -1,32 +0,0 @@ - -is_on_sale()) : ?> - - ' . esc_html__('Sale!', 'woocommerce') . '', $post, $product); ?> - - array( - 'href' => array(), - ), -); -?> - -

      - Log out)', 'woocommerce'), $allowed_html), - '' . esc_html($current_user->display_name) . '', - esc_url(wc_logout_url()) - ); -?> -

      - -

      - recent orders, manage your billing address, and edit your password and account details.', 'woocommerce'); -if (wc_shipping_enabled()) { - /* translators: 1: Orders URL 2: Addresses URL 3: Account URL. */ - $dashboard_desc = __('From your account dashboard you can view your recent orders, manage your shipping and billing addresses, and edit your password and account details.', 'woocommerce'); -} -printf( - wp_kses($dashboard_desc, $allowed_html), - esc_url(wc_get_endpoint_url('orders')), - esc_url(wc_get_endpoint_url('edit-address')), - esc_url(wc_get_endpoint_url('edit-account')) -); -?> -

      - -customer->get_downloadable_products(); -$has_downloads = (bool) $downloads; - -do_action('woocommerce_before_account_downloads', $has_downloads); ?> - - - - - - - - - - - - ' . esc_html__('Browse products', 'woocommerce') . '', 'notice'); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment - ?> - - - - diff --git a/woocommerce/myaccount/form-add-payment-method.php b/woocommerce/myaccount/form-add-payment-method.php deleted file mode 100644 index 3786c7a..0000000 --- a/woocommerce/myaccount/form-add-payment-method.php +++ /dev/null @@ -1,61 +0,0 @@ -payment_gateways->get_available_payment_gateways(); - -if ($available_gateways) : ?> -
      -
      -
        - set_current(); - } - - foreach ($available_gateways as $gateway) { - ?> -
      • - chosen, true); ?> /> - - has_fields() || $gateway->get_description()) { - echo ''; - } - ?> -
      • - -
      - - - -
      - - - -
      -
      - - - - diff --git a/woocommerce/myaccount/form-edit-account.php b/woocommerce/myaccount/form-edit-account.php deleted file mode 100644 index d69a976..0000000 --- a/woocommerce/myaccount/form-edit-account.php +++ /dev/null @@ -1,76 +0,0 @@ - - - > - - - -

      - - -

      -

      - - -

      -
      - -

      - - -

      -
      - -

      - - -

      - -
      - - -

      - - -

      -

      - - -

      -

      - - -

      -
      -
      - - - -

      - - - -

      - - - - - diff --git a/woocommerce/myaccount/form-edit-address.php b/woocommerce/myaccount/form-edit-address.php deleted file mode 100644 index 2a28f9f..0000000 --- a/woocommerce/myaccount/form-edit-address.php +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - -
      - -

      - -
      - - -
      - $field) { - woocommerce_form_field($key, $field, wc_get_post_data_by_key($key, $field['value'])); - } - ?> -
      - - - -

      - - - -

      -
      - - - - - - diff --git a/woocommerce/myaccount/form-login.php b/woocommerce/myaccount/form-login.php deleted file mode 100644 index 73f2cd1..0000000 --- a/woocommerce/myaccount/form-login.php +++ /dev/null @@ -1,119 +0,0 @@ - - - - -
      - -
      - - - -

      - - - - - -

      - - -

      -

      - - -

      - - - -

      - - - -

      -

      - -

      - - - - - - - -
      - -
      - -

      - -
      > - - - - - -

      - - -

      - - - -

      - - -

      - - - -

      - - -

      - - - -

      - - - - - -

      - - -

      - - - - - -
      - -
      - - - diff --git a/woocommerce/myaccount/form-lost-password.php b/woocommerce/myaccount/form-lost-password.php deleted file mode 100644 index 64bc8f7..0000000 --- a/woocommerce/myaccount/form-lost-password.php +++ /dev/null @@ -1,45 +0,0 @@ - - -
      - -

      - -

      - - -

      - -
      - - - -

      - - -

      - - - - - - -
      - -

      - -

      - - -

      -

      - - -

      - - - - -
      - - - -

      - - -

      - - - - - - - - -

      - - diff --git a/woocommerce/myaccount/my-account.php b/woocommerce/myaccount/my-account.php deleted file mode 100644 index 63d60fe..0000000 --- a/woocommerce/myaccount/my-account.php +++ /dev/null @@ -1,36 +0,0 @@ - - -
      - -
      diff --git a/woocommerce/myaccount/my-address.php b/woocommerce/myaccount/my-address.php deleted file mode 100644 index 21c7832..0000000 --- a/woocommerce/myaccount/my-address.php +++ /dev/null @@ -1,77 +0,0 @@ - __('Billing address', 'woocommerce'), - 'shipping' => __('Shipping address', 'woocommerce'), - ), - $customer_id - ); -} else { - $get_addresses = apply_filters( - 'woocommerce_my_account_get_addresses', - array( - 'billing' => __('Billing address', 'woocommerce'), - ), - $customer_id - ); -} - -$oldcol = 1; -$col = 1; -?> - -

      - -

      - - -
      - - - $address_title) : ?> - - -
      -
      -

      - -
      -
      - -
      -
      - - - - -
      - customer->get_downloadable_products(); - -if ($downloads) : ?> - - - -

      - -
        - -
      • - ' . sprintf(_n('%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce'), $download['downloads_remaining']) . ' ', $download); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - echo apply_filters('woocommerce_available_download_link', '' . $download['download_name'] . '', $download); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - - do_action('woocommerce_available_download_end', $download); - ?> -
      • - -
      - - - - diff --git a/woocommerce/myaccount/my-orders.php b/woocommerce/myaccount/my-orders.php deleted file mode 100644 index b7e1f6d..0000000 --- a/woocommerce/myaccount/my-orders.php +++ /dev/null @@ -1,95 +0,0 @@ - esc_html__('Order', 'woocommerce'), - 'order-date' => esc_html__('Date', 'woocommerce'), - 'order-status' => esc_html__('Status', 'woocommerce'), - 'order-total' => esc_html__('Total', 'woocommerce'), - 'order-actions' => ' ', - ) -); - -$customer_orders = get_posts( - apply_filters( - 'woocommerce_my_account_my_orders_query', - array( - 'numberposts' => $order_count, - 'meta_key' => '_customer_user', - 'meta_value' => get_current_user_id(), - 'post_type' => wc_get_order_types('view-orders'), - 'post_status' => array_keys(wc_get_order_statuses()), - ) - ) -); - -if ($customer_orders) : ?> - -

      - -
    -
    diff --git a/woocommerce/emails/email-mobile-messaging.php b/woocommerce/emails/email-mobile-messaging.php deleted file mode 100644 index ffac8fc..0000000 --- a/woocommerce/emails/email-mobile-messaging.php +++ /dev/null @@ -1,20 +0,0 @@ - - -

    - get_edit_order_url()) . '">'; - $after = ''; - } else { - $before = ''; - $after = ''; - } -/* translators: %s: Order ID. */ -echo wp_kses_post($before . sprintf(__('[Order #%s]', 'woocommerce') . $after . ' ()', $order->get_order_number(), $order->get_date_created()->format('c'), wc_format_datetime($order->get_date_created()))); -?> -

    - -
    - - - - - - - - - - $sent_to_admin, - 'show_image' => false, - 'image_size' => array( 32, 32 ), - 'plain_text' => $plain_text, - 'sent_to_admin' => $sent_to_admin, - ) - ); -?> - - - get_order_item_totals(); - -if ($item_totals) { - $i = 0; - foreach ($item_totals as $total) { - $i++; - ?> - - - - - get_customer_note()) { - ?> - - - - - - -
    get_customer_note()))); ?>
    -
    - - diff --git a/woocommerce/emails/email-order-items.php b/woocommerce/emails/email-order-items.php deleted file mode 100644 index 7dad823..0000000 --- a/woocommerce/emails/email-order-items.php +++ /dev/null @@ -1,104 +0,0 @@ - $item) : - $product = $item->get_product(); - $sku = ''; - $purchase_note = ''; - $image = ''; - - if (! apply_filters('woocommerce_order_item_visible', true, $item)) { - continue; - } - - if (is_object($product)) { - $sku = $product->get_sku(); - $purchase_note = $product->get_purchase_note(); - $image = $product->get_image($image_size); - } - - ?> -
    - get_name(), $item, false)); - - // SKU. - if ($show_sku && $sku) { - echo wp_kses_post(' (#' . $sku . ')'); - } - - // allow other plugins to add additional product information here. - do_action('woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text); - - wc_display_item_meta( - $item, - array( - 'label_before' => '', - ) - ); - - // allow other plugins to add additional product information here. - do_action('woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text); - - ?> - - get_quantity(); - $refunded_qty = $order->get_qty_refunded_for_item($item_id); - - if ($refunded_qty) { - $qty_display = '' . esc_html($qty) . ' ' . esc_html($qty - ($refunded_qty * -1)) . ''; - } else { - $qty_display = esc_html($qty); - } - echo wp_kses_post(apply_filters('woocommerce_email_order_item_quantity', $qty_display, $item)); - ?> - - get_formatted_line_subtotal($item)); ?> -
    - -
    - - - - $column_name) : ?> - - - - - - - get_item_count(); - ?> - - $column_name) : ?> - - - - - - - diff --git a/woocommerce/myaccount/navigation.php b/woocommerce/myaccount/navigation.php deleted file mode 100644 index 4a6e65b..0000000 --- a/woocommerce/myaccount/navigation.php +++ /dev/null @@ -1,35 +0,0 @@ - - - - - diff --git a/woocommerce/myaccount/orders.php b/woocommerce/myaccount/orders.php deleted file mode 100644 index 4d02e58..0000000 --- a/woocommerce/myaccount/orders.php +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - $column_name) : ?> - - - - - - - orders as $customer_order) { - $order = wc_get_order($customer_order); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited - $item_count = $order->get_item_count() - $order->get_item_count_refunded(); - ?> - - $column_name) : ?> - - - - - - - - - - max_num_pages) : ?> -
    - - - - - max_num_pages) !== $current_page) : ?> - - -
    - - - - - ' . esc_html__('Browse products', 'woocommerce') . '', 'notice'); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment?> - - - - diff --git a/woocommerce/myaccount/payment-methods.php b/woocommerce/myaccount/payment-methods.php deleted file mode 100644 index 4d4bfcd..0000000 --- a/woocommerce/myaccount/payment-methods.php +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - $column_name) : ?> - - - - - $methods) : // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited?> - - - $column_name) : ?> - - - - - - - - - - - - - - - -payment_gateways->get_available_payment_gateways()) : ?> - - diff --git a/woocommerce/myaccount/view-order.php b/woocommerce/myaccount/view-order.php deleted file mode 100644 index 0d5366b..0000000 --- a/woocommerce/myaccount/view-order.php +++ /dev/null @@ -1,56 +0,0 @@ -get_customer_order_notes(); -?> -

    -' . $order->get_order_number() . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - '' . wc_format_datetime($order->get_date_created()) . '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - '' . wc_get_order_status_name($order->get_status()) . '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -); -?> -

    - - -

    -
      - -
    1. -
      -
      -

      comment_date)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>

      -
      - comment_content)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
      -
      -
      -
      -
      -
    2. - -
    - - - diff --git a/woocommerce/notices/error.php b/woocommerce/notices/error.php deleted file mode 100644 index 519524e..0000000 --- a/woocommerce/notices/error.php +++ /dev/null @@ -1,33 +0,0 @@ - - diff --git a/woocommerce/notices/notice.php b/woocommerce/notices/notice.php deleted file mode 100644 index 248b307..0000000 --- a/woocommerce/notices/notice.php +++ /dev/null @@ -1,32 +0,0 @@ - - - -
    > - -
    - diff --git a/woocommerce/notices/success.php b/woocommerce/notices/success.php deleted file mode 100644 index fd94d57..0000000 --- a/woocommerce/notices/success.php +++ /dev/null @@ -1,30 +0,0 @@ - - - -
    role="alert"> - -
    - diff --git a/woocommerce/order/attribution-details.php b/woocommerce/order/attribution-details.php deleted file mode 100644 index 0ec0687..0000000 --- a/woocommerce/order/attribution-details.php +++ /dev/null @@ -1,112 +0,0 @@ - - -
    - - -

    - - -
    - - - - - - - - - - - - -
    - -
    - -

    - - - - - - -

    - -

    - - - - - - -

    - - -

    - - - - - - -

    - -

    - - - - - -
    - - -

    - - - - - - -

    - -

    - - - - -
    diff --git a/woocommerce/order/customer-history.php b/woocommerce/order/customer-history.php deleted file mode 100644 index be13db2..0000000 --- a/woocommerce/order/customer-history.php +++ /dev/null @@ -1,59 +0,0 @@ - - -
    -

    - -

    - - - - - -

    - -

    - - - - -

    - - - -
    diff --git a/woocommerce/order/form-tracking.php b/woocommerce/order/form-tracking.php deleted file mode 100644 index 6c2012f..0000000 --- a/woocommerce/order/form-tracking.php +++ /dev/null @@ -1,61 +0,0 @@ - - -
    - - - -

    - -

    -

    -
    - - - -

    - - - - -
    diff --git a/woocommerce/order/order-again.php b/woocommerce/order/order-again.php deleted file mode 100644 index 10ebd79..0000000 --- a/woocommerce/order/order-again.php +++ /dev/null @@ -1,23 +0,0 @@ - - -

    - -

    diff --git a/woocommerce/order/order-details-customer.php b/woocommerce/order/order-details-customer.php deleted file mode 100644 index 7bffeea..0000000 --- a/woocommerce/order/order-details-customer.php +++ /dev/null @@ -1,66 +0,0 @@ -needs_shipping_address(); -?> -
    - - - -
    -
    - - - -

    - -
    - get_formatted_billing_address(esc_html__('N/A', 'woocommerce'))); ?> - - get_billing_phone()) : ?> -

    get_billing_phone()); ?>

    - - - get_billing_email()) : ?> - - -
    - - - -
    - -
    -

    -
    - get_formatted_shipping_address(esc_html__('N/A', 'woocommerce'))); ?> - - get_shipping_phone()) : ?> -

    get_shipping_phone()); ?>

    - -
    -
    - -
    - - - - - -
    diff --git a/woocommerce/order/order-details-item.php b/woocommerce/order/order-details-item.php deleted file mode 100644 index da3e8b5..0000000 --- a/woocommerce/order/order-details-item.php +++ /dev/null @@ -1,68 +0,0 @@ - -
    - is_visible(); -$product_permalink = apply_filters('woocommerce_order_item_permalink', $is_visible ? $product->get_permalink($item) : '', $item, $order); - -echo wp_kses_post(apply_filters('woocommerce_order_item_name', $product_permalink ? sprintf('%s', $product_permalink, $item->get_name()) : $item->get_name(), $item, $is_visible)); - -$qty = $item->get_quantity(); -$refunded_qty = $order->get_qty_refunded_for_item($item_id); - -if ($refunded_qty) { - $qty_display = '' . esc_html($qty) . ' ' . esc_html($qty - ($refunded_qty * -1)) . ''; -} else { - $qty_display = esc_html($qty); -} - -echo apply_filters('woocommerce_order_item_quantity_html', ' ' . sprintf('× %s', $qty_display) . '', $item); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - -do_action('woocommerce_order_item_meta_start', $item_id, $item, $order, false); - -wc_display_item_meta($item); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - -do_action('woocommerce_order_item_meta_end', $item_id, $item, $order, false); -?> - - get_formatted_line_subtotal($item); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
    - - - - - - - - - - $item) { - $product = $item->get_product(); - - wc_get_template( - 'order/order-details-item.php', - array( - 'order' => $order, - 'item_id' => $item_id, - 'item' => $item, - 'show_purchase_note' => $show_purchase_note, - 'purchase_note' => $product ? $product->get_purchase_note() : '', - 'product' => $product, - ) - ); -} - -do_action('woocommerce_order_details_after_order_table_items', $order); -?> - - - - get_order_item_totals() as $key => $total) { - ?> - - - - - - get_customer_note()) : ?> - - - - - - -
    get_customer_note()))); ?>
    - - - - - $order )); -} diff --git a/woocommerce/order/order-downloads.php b/woocommerce/order/order-downloads.php deleted file mode 100644 index 7cea742..0000000 --- a/woocommerce/order/order-downloads.php +++ /dev/null @@ -1,73 +0,0 @@ - -
    - -

    - - - - - - $column_name) : ?> - - - - - - - - $column_name) : ?> - - - - -
    - ' . esc_html($download['product_name']) . ''; - } else { - echo esc_html($download['product_name']); - } - break; - case 'download-file': - echo '' . esc_html($download['download_name']) . ''; - break; - case 'download-remaining': - echo is_numeric($download['downloads_remaining']) ? esc_html($download['downloads_remaining']) : esc_html__('∞', 'woocommerce'); - break; - case 'download-expires': - if (! empty($download['access_expires'])) { - echo ''; - } else { - esc_html_e('Never', 'woocommerce'); - } - break; - } - } - ?> -
    -
    diff --git a/woocommerce/order/tracking.php b/woocommerce/order/tracking.php deleted file mode 100644 index a781cce..0000000 --- a/woocommerce/order/tracking.php +++ /dev/null @@ -1,60 +0,0 @@ -get_customer_order_notes(); -?> - -

    - ' . $order->get_order_number() . '', - '' . wc_format_datetime($order->get_date_created()) . '', - '' . wc_get_order_status_name($order->get_status()) . '' - ) - ) - ); -?> -

    - - -

    -
      - -
    1. -
      -
      -

      comment_date)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>

      -
      - comment_content)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?> -
      -
      -
      -
      -
      -
    2. - -
    - - -get_id()); ?> diff --git a/woocommerce/single-product.php b/woocommerce/single-product.php deleted file mode 100644 index ac1b0fc..0000000 --- a/woocommerce/single-product.php +++ /dev/null @@ -1,6 +0,0 @@ - Date: Sat, 16 Mar 2024 23:35:48 +0200 Subject: [PATCH 16/16] fix: cf folder name --- app/{CarbonFields => CustomFields}/Blocks.php | 0 app/{CarbonFields => CustomFields}/Blocks/example.css | 0 app/{CarbonFields => CustomFields}/Blocks/example.php | 0 .../Blocks/example.view.php | 0 app/{CarbonFields => CustomFields}/Fields/about.php | 0 app/{CarbonFields => CustomFields}/Fields/home.php | 0 app/{CarbonFields => CustomFields}/OptionFields.php | 0 app/{CarbonFields => CustomFields}/PostFields.php | 0 composer.json | 8 ++++---- style.css | 2 +- 10 files changed, 5 insertions(+), 5 deletions(-) rename app/{CarbonFields => CustomFields}/Blocks.php (100%) rename app/{CarbonFields => CustomFields}/Blocks/example.css (100%) rename app/{CarbonFields => CustomFields}/Blocks/example.php (100%) rename app/{CarbonFields => CustomFields}/Blocks/example.view.php (100%) rename app/{CarbonFields => CustomFields}/Fields/about.php (100%) rename app/{CarbonFields => CustomFields}/Fields/home.php (100%) rename app/{CarbonFields => CustomFields}/OptionFields.php (100%) rename app/{CarbonFields => CustomFields}/PostFields.php (100%) diff --git a/app/CarbonFields/Blocks.php b/app/CustomFields/Blocks.php similarity index 100% rename from app/CarbonFields/Blocks.php rename to app/CustomFields/Blocks.php diff --git a/app/CarbonFields/Blocks/example.css b/app/CustomFields/Blocks/example.css similarity index 100% rename from app/CarbonFields/Blocks/example.css rename to app/CustomFields/Blocks/example.css diff --git a/app/CarbonFields/Blocks/example.php b/app/CustomFields/Blocks/example.php similarity index 100% rename from app/CarbonFields/Blocks/example.php rename to app/CustomFields/Blocks/example.php diff --git a/app/CarbonFields/Blocks/example.view.php b/app/CustomFields/Blocks/example.view.php similarity index 100% rename from app/CarbonFields/Blocks/example.view.php rename to app/CustomFields/Blocks/example.view.php diff --git a/app/CarbonFields/Fields/about.php b/app/CustomFields/Fields/about.php similarity index 100% rename from app/CarbonFields/Fields/about.php rename to app/CustomFields/Fields/about.php diff --git a/app/CarbonFields/Fields/home.php b/app/CustomFields/Fields/home.php similarity index 100% rename from app/CarbonFields/Fields/home.php rename to app/CustomFields/Fields/home.php diff --git a/app/CarbonFields/OptionFields.php b/app/CustomFields/OptionFields.php similarity index 100% rename from app/CarbonFields/OptionFields.php rename to app/CustomFields/OptionFields.php diff --git a/app/CarbonFields/PostFields.php b/app/CustomFields/PostFields.php similarity index 100% rename from app/CarbonFields/PostFields.php rename to app/CustomFields/PostFields.php diff --git a/composer.json b/composer.json index 8bd4451..92a62eb 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "theme/blank", "type": "wp-theme", - "version": "2.0.20", + "version": "2.0.21", "description": "Wordpress starter theme with Timber/Twig", "license": "GPL-3.0-or-later", "authors": [ @@ -42,9 +42,9 @@ "bootstrap/app.php", "app/helpers.php", "app/Handlers/ajax.php", - "app/CarbonFields/OptionFields.php", - "app/CarbonFields/PostFields.php", - "app/CarbonFields/Blocks.php", + "app/CustomFields/OptionFields.php", + "app/CustomFields/PostFields.php", + "app/CustomFields/Blocks.php", "routes/api.php" ] }, diff --git a/style.css b/style.css index 2a096ff..1605846 100644 --- a/style.css +++ b/style.css @@ -1,7 +1,7 @@ /* Theme Name: wp-theme Theme URI:https://github.com/lastofpudge/wp-theme -Version: 2.0.20 +Version: 2.0.21 License: GNU General Public License v3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html Requires PHP: 8.0