From 3311f17bbb712a03fe3101776f4e32717d12289c Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Thu, 13 Jun 2019 18:38:49 +0200 Subject: [PATCH] users weekly stats as bar-chart in dashboard (#847) --- README.md | 12 +- UPGRADING.md | 1 + assets/js/plugins/KimaiAlert.js | 3 +- composer.lock | 30 +- config/packages/jms_serializer.yaml | 7 + config/packages/kimai.yaml | 31 +- config/services.yaml | 4 + .../{app.26c26669.js => app.0ac6f178.js} | 2 +- public/build/entrypoints.json | 4 +- public/build/manifest.json | 2 +- src/Controller/DashboardController.php | 42 +- .../Compiler/WidgetCompilerPass.php | 41 ++ src/DependencyInjection/Configuration.php | 27 +- src/Entity/BudgetTrait.php | 1 + src/Event/DashboardEvent.php | 24 +- src/EventSubscriber/DashboardSubscriber.php | 105 +++-- src/Kernel.php | 11 +- src/Model/DashboardSection.php | 106 ----- src/Model/Statistic/Day.php | 64 +++ src/Model/Statistic/Month.php | 34 +- src/Model/Statistic/Year.php | 15 +- src/Model/Widget.php | 219 ---------- src/Repository/TimesheetRepository.php | 81 +++- src/Repository/WidgetRepository.php | 399 ++++++++++++++++-- src/Twig/WidgetExtension.php | 65 +++ src/Widget/Renderer/AbstractTwigRenderer.php | 42 ++ src/Widget/Renderer/CompoundChartRenderer.php | 29 ++ src/Widget/Renderer/CompoundRowRenderer.php | 29 ++ src/Widget/Renderer/SimpleWidgetRenderer.php | 33 ++ src/Widget/Type/AbstractContainer.php | 95 +++++ src/Widget/Type/AbstractWidgetType.php | 109 +++++ src/Widget/Type/CompoundChart.php | 14 + src/Widget/Type/CompoundRow.php | 14 + src/Widget/Type/Counter.php | 18 + src/Widget/Type/DailyWorkingTimeChart.php | 65 +++ src/Widget/Type/More.php | 18 + src/Widget/Type/SimpleWidget.php | 14 + src/Widget/Type/YearChart.php | 14 + src/Widget/WidgetContainerInterface.php | 24 ++ src/Widget/WidgetException.php | 14 + src/Widget/WidgetInterface.php | 65 +++ src/Widget/WidgetRendererInterface.php | 35 ++ src/Widget/WidgetService.php | 81 ++++ templates/activity/budget.html.twig | 9 +- templates/customer/budget.html.twig | 9 +- templates/dashboard/index.html.twig | 8 +- templates/dashboard/section-simple.html.twig | 34 -- templates/embeds/widget-counter.html.twig | 10 - templates/embeds/widget-more.html.twig | 14 - templates/macros/progressbar.html.twig | 7 +- templates/macros/widgets.html.twig | 34 +- templates/project/budget.html.twig | 9 +- templates/user/stats.html.twig | 26 +- .../section-chart.html.twig | 92 +--- templates/widget/section-simple.html.twig | 20 + templates/widget/widget-counter.html.twig | 28 ++ .../widget-dailyworkingtimechart.html.twig | 95 +++++ templates/widget/widget-more.html.twig | 33 ++ templates/widget/widget-yearchart.html.twig | 98 +++++ .../DependencyInjection/AppExtensionTest.php | 6 + tests/Event/DashboardEventTest.php | 4 +- tests/Export/Renderer/CsvRendererTest.php | 1 + tests/Export/Renderer/HtmlRendererTest.php | 1 + tests/Export/Renderer/OdsRendererTest.php | 1 + tests/Export/Renderer/PdfRendererTest.php | 1 + tests/Export/Renderer/XlsxRendererTest.php | 1 + tests/Model/DashboardSectionTest.php | 42 -- tests/Model/Statistic/DayTest.php | 42 ++ tests/Model/Statistic/MonthTest.php | 10 +- tests/Repository/WidgetRepositoryTest.php | 61 ++- tests/Twig/WidgetExtensionTest.php | 107 +++++ .../Renderer/CompoundChartRendererTest.php | 54 +++ .../Renderer/CompoundRowRendererTest.php | 54 +++ .../Renderer/SimpleWidgetRendererTest.php | 67 +++ tests/Widget/Type/AbstractContainerTest.php | 67 +++ tests/Widget/Type/AbstractWidgetTypeTest.php | 69 +++ tests/Widget/Type/CompoundChartTest.php | 25 ++ tests/Widget/Type/CompoundRowTest.php | 25 ++ tests/Widget/Type/CounterTest.php | 36 ++ .../Widget/Type/DailyWorkingTimeChartTest.php | 117 +++++ tests/Widget/Type/MoreTest.php | 36 ++ tests/Widget/Type/SimpleWidgetTest.php | 29 ++ tests/Widget/Type/YearChartTest.php | 29 ++ tests/Widget/WidgetExceptionTest.php | 25 ++ tests/Widget/WidgetServiceTest.php | 77 ++++ translations/messages.ar.xliff | 4 - translations/messages.de.xliff | 4 - translations/messages.en.xliff | 4 - translations/messages.es.xliff | 4 - translations/messages.fr.xliff | 4 - translations/messages.hu.xliff | 4 - translations/messages.it.xliff | 4 - translations/messages.ja.xliff | 4 - translations/messages.pt_BR.xliff | 4 - translations/messages.ru.xliff | 4 - translations/messages.sv.xliff | 4 - 96 files changed, 2754 insertions(+), 846 deletions(-) rename public/build/{app.26c26669.js => app.0ac6f178.js} (75%) create mode 100644 src/DependencyInjection/Compiler/WidgetCompilerPass.php delete mode 100644 src/Model/DashboardSection.php create mode 100644 src/Model/Statistic/Day.php delete mode 100644 src/Model/Widget.php create mode 100644 src/Twig/WidgetExtension.php create mode 100644 src/Widget/Renderer/AbstractTwigRenderer.php create mode 100644 src/Widget/Renderer/CompoundChartRenderer.php create mode 100644 src/Widget/Renderer/CompoundRowRenderer.php create mode 100644 src/Widget/Renderer/SimpleWidgetRenderer.php create mode 100644 src/Widget/Type/AbstractContainer.php create mode 100644 src/Widget/Type/AbstractWidgetType.php create mode 100644 src/Widget/Type/CompoundChart.php create mode 100644 src/Widget/Type/CompoundRow.php create mode 100644 src/Widget/Type/Counter.php create mode 100644 src/Widget/Type/DailyWorkingTimeChart.php create mode 100644 src/Widget/Type/More.php create mode 100644 src/Widget/Type/SimpleWidget.php create mode 100644 src/Widget/Type/YearChart.php create mode 100644 src/Widget/WidgetContainerInterface.php create mode 100644 src/Widget/WidgetException.php create mode 100644 src/Widget/WidgetInterface.php create mode 100644 src/Widget/WidgetRendererInterface.php create mode 100644 src/Widget/WidgetService.php delete mode 100644 templates/dashboard/section-simple.html.twig delete mode 100644 templates/embeds/widget-counter.html.twig delete mode 100644 templates/embeds/widget-more.html.twig rename templates/{dashboard => widget}/section-chart.html.twig (55%) create mode 100644 templates/widget/section-simple.html.twig create mode 100644 templates/widget/widget-counter.html.twig create mode 100644 templates/widget/widget-dailyworkingtimechart.html.twig create mode 100644 templates/widget/widget-more.html.twig create mode 100644 templates/widget/widget-yearchart.html.twig delete mode 100644 tests/Model/DashboardSectionTest.php create mode 100644 tests/Model/Statistic/DayTest.php create mode 100644 tests/Twig/WidgetExtensionTest.php create mode 100644 tests/Widget/Renderer/CompoundChartRendererTest.php create mode 100644 tests/Widget/Renderer/CompoundRowRendererTest.php create mode 100644 tests/Widget/Renderer/SimpleWidgetRendererTest.php create mode 100644 tests/Widget/Type/AbstractContainerTest.php create mode 100644 tests/Widget/Type/AbstractWidgetTypeTest.php create mode 100644 tests/Widget/Type/CompoundChartTest.php create mode 100644 tests/Widget/Type/CompoundRowTest.php create mode 100644 tests/Widget/Type/CounterTest.php create mode 100644 tests/Widget/Type/DailyWorkingTimeChartTest.php create mode 100644 tests/Widget/Type/MoreTest.php create mode 100644 tests/Widget/Type/SimpleWidgetTest.php create mode 100644 tests/Widget/Type/YearChartTest.php create mode 100644 tests/Widget/WidgetExceptionTest.php create mode 100644 tests/Widget/WidgetServiceTest.php diff --git a/README.md b/README.md index 0d9f7a43..493ad02d 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ It is built with modern technologies such as Symfony, Bootstrap, RESTful API, re ### About -This new version of the open source timetracker Kimai. It is in a stable development phase, usable in production and -with most advanced features from Kimai 1 and many new ones: +This is new version of the open source timetracker Kimai. It is in a stable development phase, usable in production and +with most advanced features from Kimai 1 and many new ones, including but not limited to: JSON API, invoicing, data exports, multi-timer and punch-in punch-out mode, tagging, multi-user and multi-timezones, -LDAP and built-in authentication, customizable role permissions, responsive and usable on your mobile device, -hourly and fixed rates, advanced filtering, support for plugins and many more. +LDAP and built-in authentication, customizable role permissions, responsive and ready for your mobile device, +hourly and fixed rates, advanced filtering, money and time budgets and report, support for plugins and many more. ## Installation @@ -40,7 +40,7 @@ hourly and fixed rates, advanced filtering, support for plugins and many more. - [Docker](https://www.kimai.org/documentation/docker.html) - containerized - [Development](https://www.kimai.org/documentation/installation.html#development-installation) - on your local machine - [1-click installer](https://www.kimai.org/documentation/installation.html#hosting-and-1-click-installations) - hosted environments -- [FTP](https://www.kimai.org/documentation/installation.html#ftp-installation) - unfortunately still widely used +- [FTP](https://www.kimai.org/documentation/installation.html#ftp-installation) - unfortunately still widely used ;-) ### Updating Kimai @@ -49,7 +49,7 @@ hourly and fixed rates, advanced filtering, support for plugins and many more. ### Plugins -- [Plugin marketplace](https://www.kimai.org/store/) - users find existing plugins here +- [Plugin marketplace](https://www.kimai.org/store/) - find existing plugins here - [Developer documentation](https://www.kimai.org/documentation/developers.html) - how to create a plugin ## Roadmap and releases diff --git a/UPGRADING.md b/UPGRADING.md index 8ad9909d..9eb2ea3e 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -35,6 +35,7 @@ Removed permission: - API: Format for queries including a datetime object fixed to use HTML5 format (previously `2019-03-02 14:23` - now `2019-03-02T14:23:00`) - **Permission config**: the `permissions` definition in your `local.yaml` needs to be verified/changed, as the internal structure was highly optimized to simplify the definition. Thanks to the new structure, you should be able to remove almost everything from your `local.yaml` (tip: start over from scratch!). Please read [the updated permission docu](https://www.kimai.org/documentation/permissions.html). +- default widgets were removed from `kimai.yaml`, that shouldn't cause any issues ... but if something is odd, now you know [where to look for help](https://www.kimai.org/documentation/dashboard.html) ## [0.9](https://github.com/kevinpapst/kimai2/releases/tag/0.9) diff --git a/assets/js/plugins/KimaiAlert.js b/assets/js/plugins/KimaiAlert.js index 6b2527f8..2e773b56 100644 --- a/assets/js/plugins/KimaiAlert.js +++ b/assets/js/plugins/KimaiAlert.js @@ -41,7 +41,8 @@ export default class KimaiAlert extends KimaiPlugin { } Swal.fire({ - timer: 1500, + timer: 2000, + toast: true, position: 'top-end', showConfirmButton: false, type: 'success', diff --git a/composer.lock b/composer.lock index 53fa4cfd..fc4f83dc 100644 --- a/composer.lock +++ b/composer.lock @@ -2971,33 +2971,37 @@ }, { "name": "kevinpapst/adminlte-bundle", - "version": "2.7.3", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/kevinpapst/AdminLTEBundle.git", - "reference": "bbe650bda5319ac55637457e23d60bcafb734da1" + "reference": "62df10d0565f2ed5971b1a28ef30195ad1893807" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kevinpapst/AdminLTEBundle/zipball/bbe650bda5319ac55637457e23d60bcafb734da1", - "reference": "bbe650bda5319ac55637457e23d60bcafb734da1", + "url": "https://api.github.com/repos/kevinpapst/AdminLTEBundle/zipball/62df10d0565f2ed5971b1a28ef30195ad1893807", + "reference": "62df10d0565f2ed5971b1a28ef30195ad1893807", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/config": ">3.4", - "symfony/dependency-injection": ">3.4", - "symfony/event-dispatcher": ">3.4", - "symfony/http-foundation": ">3.4", - "symfony/http-kernel": ">3.4", - "symfony/options-resolver": ">3.4", - "symfony/security-core": ">3.4", + "symfony/config": ">4.0", + "symfony/dependency-injection": ">4.0", + "symfony/event-dispatcher": ">4.0", + "symfony/http-foundation": ">4.0", + "symfony/http-kernel": ">4.0", + "symfony/options-resolver": ">4.0", + "symfony/security-core": ">4.0", "twig/twig": ">2.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.10", + "knplabs/knp-menu-bundle": "^2.2", "phpspec/prophecy": "^1.6", - "phpunit/phpunit": "^7.3" + "phpstan/phpstan": "^0.11.8", + "phpstan/phpstan-phpunit": "^0.11.2", + "phpunit/phpunit": "^7.3", + "symfony/framework-bundle": ">4.0" }, "suggest": { "friendsofsymfony/user-bundle": "Allows easy user management and security support", @@ -3028,7 +3032,7 @@ } ], "description": "Admin theme bundle for Symfony 4 based on AdminLTE 2.4.8 with FOSUserBundle support", - "time": "2019-05-13T16:17:08+00:00" + "time": "2019-06-13T11:25:39+00:00" }, { "name": "kimai/kimai2-composer", diff --git a/config/packages/jms_serializer.yaml b/config/packages/jms_serializer.yaml index fe0f7f3e..74bdc08e 100644 --- a/config/packages/jms_serializer.yaml +++ b/config/packages/jms_serializer.yaml @@ -13,5 +13,12 @@ jms_serializer: App: namespace_prefix: "App" path: "%kernel.root_dir%/../config/serializer/App" + warmup: + paths: + included: + - "%kernel.root_dir%/Entity/" + - "%kernel.root_dir%/API/Model/" + - "%kernel.root_dir%/../vendor/friendsofsymfony/user-bundle/Model" + excluded: [] property_naming: id: 'jms_serializer.identical_property_naming_strategy' diff --git a/config/packages/kimai.yaml b/config/packages/kimai.yaml index 3d4dbd36..8d436c3a 100644 --- a/config/packages/kimai.yaml +++ b/config/packages/kimai.yaml @@ -169,7 +169,8 @@ kimai: title: dashboard.you order: 10 permission: ROLE_USER - widgets: [userDurationToday, userDurationWeek, userDurationMonth, userDurationYear] + type: 'compoundChart' + widgets: [DailyWorkingTimeChart, userDurationToday, userDurationWeek, userDurationMonth, userDurationYear] user_rates: title: ~ order: 20 @@ -190,34 +191,6 @@ kimai: order: 50 permission: view_rate_other_timesheet widgets: [amountToday, amountWeek, amountMonth, amountYear] - - widgets: - userDurationToday: { title: stats.durationToday, query: duration, user: true, begin: '00:00:00', end: '23:59:59', icon: duration, color: green } - userDurationWeek: { title: stats.durationWeek, query: duration, user: true, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: duration, color: blue } - userDurationMonth: { title: stats.durationMonth, query: duration, user: true, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: duration, color: purple } - userDurationYear: { title: stats.durationYear, query: duration, user: true, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: duration, color: yellow } - userDurationTotal: { title: stats.durationTotal, query: duration, user: true, icon: duration, color: red } - userAmountToday: { title: stats.amountToday, query: rate, user: true, begin: '00:00:00', end: '23:59:59', icon: money, color: green } - userAmountWeek: { title: stats.amountWeek, query: rate, user: true, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: money, color: blue } - userAmountMonth: { title: stats.amountMonth, query: rate, user: true, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: money, color: purple } - userAmountYear: { title: stats.amountYear, query: rate, user: true, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: money, color: yellow } - userAmountTotal: { title: stats.amountTotal, query: rate, user: true, icon: money, color: red } - durationToday: { title: stats.durationToday, query: duration, begin: '00:00:00', end: '23:59:59', icon: duration, color: green } - durationWeek: { title: stats.durationWeek, query: duration, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: duration, color: blue } - durationMonth: { title: stats.durationMonth, query: duration, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: duration, color: purple } - durationYear: { title: stats.durationYear, query: duration, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: duration, color: yellow } - durationTotal: { title: stats.durationTotal, query: duration, icon: duration, color: red } - amountToday: { title: stats.amountToday, query: rate, begin: '00:00:00', end: '23:59:59', icon: money, color: green } - amountWeek: { title: stats.amountWeek, query: rate, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: money, color: blue } - amountMonth: { title: stats.amountMonth, query: rate, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: money, color: purple } - amountYear: { title: stats.amountYear, query: rate, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: money, color: yellow } - amountTotal: { title: stats.amountTotal, query: rate, icon: money, color: red } - activeUsersToday: { title: stats.userActiveToday, query: users, begin: '00:00:00', end: '23:59:59', icon: user, color: green } - activeUsersWeek: { title: stats.userActiveWeek, query: users, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: user, color: blue } - activeUsersMonth: { title: stats.userActiveMonth, query: users, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: user, color: purple } - activeUsersYear: { title: stats.userActiveYear, query: users, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: user, color: yellow } - activeUsersTotal: { title: stats.userActiveTotal, query: users, icon: user, color: red } - activeRecordings: { title: stats.activeRecordings, query: active, icon: duration, color: red } # -------------------------------------------------------------------------------- diff --git a/config/services.yaml b/config/services.yaml index 4d79a39d..e7ef3a45 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -77,6 +77,10 @@ services: App\Export\ServiceExport: arguments: [!tagged export.renderer] + App\Widget\WidgetService: + arguments: + $renderer: !tagged widget.renderer + # ================================================================================ # DATABASE # ================================================================================ diff --git a/public/build/app.26c26669.js b/public/build/app.0ac6f178.js similarity index 75% rename from public/build/app.26c26669.js rename to public/build/app.0ac6f178.js index ae056544..d5d2b798 100644 --- a/public/build/app.26c26669.js +++ b/public/build/app.0ac6f178.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["app"],{"+2oP":function(t,e,n){"use strict";var i=n("I+eb"),o=n("hh1v"),s=n("6LWA"),r=n("I8vh"),a=n("UMSQ"),l=n("/GqU"),c=n("hBjN"),u=n("Hd5f"),d=n("tiKp")("species"),h=[].slice,f=Math.max;i({target:"Array",proto:!0,forced:!u("slice")},{slice:function(t,e){var n,i,u,p=l(this),m=a(p.length),g=r(t,m),v=r(void 0===e?m:e,m);if(s(p)&&("function"!=typeof(n=p.constructor)||n!==Array&&!s(n.prototype)?o(n)&&null===(n=n[d])&&(n=void 0):n=void 0,n===Array||void 0===n))return h.call(p,g,v);for(i=new(void 0===n?Array:n)(f(v-g,0)),u=0;g")}),u=!s(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});t.exports=function(t,e,n,d){var h=r(t),f=!s(function(){var e={};return e[h]=function(){return 7},7!=""[t](e)}),p=f&&!s(function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[l]=function(){return n}),n[h](""),!e});if(!f||!p||"replace"===t&&!c||"split"===t&&!u){var m=/./[h],g=n(h,""[t],function(t,e,n,i,o){return e.exec===a?f&&!o?{done:!0,value:m.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}}),v=g[0],b=g[1];o(String.prototype,t,v),o(RegExp.prototype,h,2==e?function(t,e){return b.call(t,this,e)}:function(t){return b.call(t,this)}),d&&i(RegExp.prototype[h],"sham",!0)}}},"1E5z":function(t,e,n){var i=n("m/L8").f,o=n("UTVS"),s=n("tiKp")("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,s)&&i(t,s,{configurable:!0,value:e})}},"1Wo5":function(t,e,n){(function(t){var e=n("EVdn");t.$=t.jQuery=e,n("VSY+"),n("Onkx"),n("DPhY");var i=n("wd/R");t.moment=i,n("tGlX"),n("bpih"),n("nyYc"),n("iYuL"),n("lXzo"),n("jnO4"),n("WxRl"),n("0tRk"),n("X709"),n("B55N"),n("eHjp"),n("+jAj"),n("Qiut"),n("vh7O"),n("WySY"),t.$.AdminLTE={},t.$.AdminLTE.options={},n("qG+3"),n("NlKh"),n("zcCC"),n("9/yf")}).call(this,n("yLpj"))},"2B1R":function(t,e,n){"use strict";var i=n("I+eb"),o=n("P0SU"),s=n("Hd5f"),r=o(1);i({target:"Array",proto:!0,forced:!s("map")},{map:function(t){return r(this,t,arguments[1])}})},"2oRo":function(t,e,n){(function(e){var n="object",i=function(t){return t&&t.Math==Math&&t};t.exports=i(typeof globalThis==n&&globalThis)||i(typeof window==n&&window)||i(typeof self==n&&self)||i(typeof e==n&&e)||Function("return this")()}).call(this,n("yLpj"))},"33Wh":function(t,e,n){var i=n("yoRg"),o=n("eDl+");t.exports=Object.keys||function(t){return i(t,o)}},"3UD+":function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},"3bBZ":function(t,e,n){var i=n("2oRo"),o=n("/byt"),s=n("4mDm"),r=n("X2U+"),a=n("tiKp"),l=a("iterator"),c=a("toStringTag"),u=s.values;for(var d in o){var h=i[d],f=h&&h.prototype;if(f){if(f[l]!==u)try{r(f,l,u)}catch(t){f[l]=u}if(f[c]||r(f,c,d),o[d])for(var p in s)if(f[p]!==s[p])try{r(f,p,s[p])}catch(t){f[p]=s[p]}}}},"4Brf":function(t,e,n){"use strict";var i=n("I+eb"),o=n("g6v/"),s=n("2oRo"),r=n("UTVS"),a=n("hh1v"),l=n("m/L8").f,c=n("6JNq"),u=s.Symbol;if(o&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var d={},h=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof h?new u(t):void 0===t?u():u(t);return""===t&&(d[e]=!0),e};c(h,u);var f=h.prototype=u.prototype;f.constructor=h;var p=f.toString,m="Symbol(test)"==String(u("test")),g=/^Symbol\((.*)\)[^)]+$/;l(f,"description",{configurable:!0,get:function(){var t=a(this)?this.valueOf():this,e=p.call(t);if(r(d,t))return"";var n=m?e.slice(7,-1):e.replace(g,"$1");return""===n?void 0:n}}),i({global:!0,forced:!0},{Symbol:h})}},"4WOD":function(t,e,n){var i=n("UTVS"),o=n("ewvW"),s=n("93I0"),r=n("4Xet"),a=s("IE_PROTO"),l=Object.prototype;t.exports=r?Object.getPrototypeOf:function(t){return t=o(t),i(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?l:null}},"4Xet":function(t,e,n){var i=n("0Dky");t.exports=!i(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},"4l63":function(t,e,n){var i=n("I+eb"),o=n("5YOQ");i({global:!0,forced:parseInt!=o},{parseInt:o})},"4mDm":function(t,e,n){"use strict";var i=n("/GqU"),o=n("RNIs"),s=n("P4y1"),r=n("afO8"),a=n("fdAy"),l=r.set,c=r.getterFor("Array Iterator");t.exports=a(Array,"Array",function(t,e){l(this,{type:"Array Iterator",target:i(t),index:0,kind:e})},function(){var t=c(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}},"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},"5YOQ":function(t,e,n){var i=n("2oRo"),o=n("WKiH"),s=n("WJkJ"),r=i.parseInt,a=/^[+-]?0[Xx]/,l=8!==r(s+"08")||22!==r(s+"0x16");t.exports=l?function(t,e){var n=o(String(t),3);return r(n,e>>>0||(a.test(n)?16:10))}:r},"5dW1":function(t,e,n){var i=n("ppGB"),o=n("HYAF");t.exports=function(t,e,n){var s,r,a=String(o(t)),l=i(e),c=a.length;return l<0||l>=c?n?"":void 0:(s=a.charCodeAt(l))<55296||s>56319||l+1===c||(r=a.charCodeAt(l+1))<56320||r>57343?n?a.charAt(l):s:n?a.slice(l,l+2):r-56320+(s-55296<<10)+65536}},"6JNq":function(t,e,n){var i=n("UTVS"),o=n("Vu81"),s=n("Bs8V"),r=n("m/L8");t.exports=function(t,e){for(var n=o(e),a=r.f,l=s.f,c=0;c",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,n,i,o=this.element[0].nodeName.toLowerCase(),s="textarea"===o,r="input"===o;this.isMultiLine=s||!r&&this._isContentEditable(this.element),this.valueMethod=this.element[s||r?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(o){if(this.element.prop("readOnly"))return e=!0,i=!0,void(n=!0);e=!1,i=!1,n=!1;var s=t.ui.keyCode;switch(o.keyCode){case s.PAGE_UP:e=!0,this._move("previousPage",o);break;case s.PAGE_DOWN:e=!0,this._move("nextPage",o);break;case s.UP:e=!0,this._keyEvent("previous",o);break;case s.DOWN:e=!0,this._keyEvent("next",o);break;case s.ENTER:this.menu.active&&(e=!0,o.preventDefault(),this.menu.select(o));break;case s.TAB:this.menu.active&&this.menu.select(o);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(o),o.preventDefault());break;default:n=!0,this._searchTimeout(o)}},keypress:function(i){if(e)return e=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||i.preventDefault());if(!n){var o=t.ui.keyCode;switch(i.keyCode){case o.PAGE_UP:this._move("previousPage",i);break;case o.PAGE_DOWN:this._move("nextPage",i);break;case o.UP:this._keyEvent("previous",i);break;case o.DOWN:this._keyEvent("next",i)}}},input:function(t){if(i)return i=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=t("
    ").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,n){var i,o;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});o=n.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:o})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(o.value),(i=n.item.attr("aria-label")||o.value)&&t.trim(i).length&&(this.liveRegion.children().hide(),t("
    ").text(i).appendTo(this.liveRegion))},menuselect:function(e,n){var i=n.item.data("ui-autocomplete-item"),o=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=o,this._delay(function(){this.previous=o,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=t("
    ",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var n=this.menu.element[0];return e.target===this.element[0]||e.target===n||t.contains(n,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,n,i=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(n,i){i(t.ui.autocomplete.filter(e,n.term))}):"string"==typeof this.options.source?(n=this.options.source,this.source=function(e,o){i.xhr&&i.xhr.abort(),i.xhr=t.ajax({url:n,data:e,dataType:"json",success:function(t){o(t)},error:function(){o([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),n=this.menu.element.is(":visible"),i=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;e&&(!e||n||i)||(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length").append(t("
    ").text(n.label)).appendTo(e)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,n){var i=new RegExp(t.ui.autocomplete.escapeRegex(n),"i");return t.grep(e,function(t){return i.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var n;this._superApply(arguments),this.options.disabled||this.cancelSearch||(n=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("
    ").text(n).appendTo(this.liveRegion))}}),t.ui.autocomplete})?i.apply(e,o):i)||(t.exports=s)},"93I0":function(t,e,n){var i=n("VpIT"),o=n("kOOl"),s=i("keys");t.exports=function(t){return s[t]||(s[t]=o(t))}},"9d/t":function(t,e,n){var i=n("xrYK"),o=n("tiKp")("toStringTag"),s="Arguments"==i(function(){return arguments}());t.exports=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:s?i(e):"Object"==(r=i(e))&&"function"==typeof e.callee?"Arguments":r}},Anvj:function(t,e,n){var i=n("33Wh"),o=n("dBg+"),s=n("0eef");t.exports=function(t){var e=i(t),n=o.f;if(n)for(var r,a=n(t),l=s.f,c=0;a.length>c;)l.call(t,r=a[c++])&&e.push(r);return e}},B55N:function(t,e,n){!function(t){"use strict";t.defineLocale("ja",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,n){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(t){return t.week()1?arguments[1]:void 0,r=s?Number(s):0;r!=r&&(r=0);var a=Math.min(Math.max(r,0),n);if(o+a>n)return!1;for(var l=-1;++l]+>/g,"")),i&&(l=S(l)),l=l.toUpperCase(),s="contains"===n?l.indexOf(e)>=0:l.startsWith(e)))break}return s}function w(t){return parseInt(t,10)||0}t.fn.triggerNative=function(t){var e,n=this[0];n.dispatchEvent?(b?e=new Event(t,{bubbles:!0}):(e=document.createEvent("Event")).initEvent(t,!0,!1),n.dispatchEvent(e)):n.fireEvent?((e=document.createEventObject()).eventType=t,n.fireEvent("on"+t,e)):this.trigger(t)};var k={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},x=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function C(t){return k[t]}function S(t){return(t=t.toString())&&t.replace(x,C).replace(_,"")}var D,O,T,E,L,P=(D={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},O=function(t){return D[t]},T="(?:"+Object.keys(D).join("|")+")",E=RegExp(T),L=RegExp(T,"g"),function(t){return t=null==t?"":""+t,E.test(t)?t.replace(L,O):t}),I={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},M={ESCAPE:27,ENTER:13,SPACE:32,TAB:9,ARROW_UP:38,ARROW_DOWN:40},A={success:!1,major:"3"};try{A.full=(t.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),A.major=A.full[0],A.success=!0}catch(t){}var j=0,$=".bs.select",Y={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},R={MENU:"."+Y.MENU},N={span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};N.a.setAttribute("role","option"),N.subtext.className="text-muted",N.text=N.span.cloneNode(!1),N.text.className="text",N.checkMark=N.span.cloneNode(!1);var H=new RegExp(M.ARROW_UP+"|"+M.ARROW_DOWN),B=new RegExp("^"+M.TAB+"$|"+M.ESCAPE),z={li:function(t,e,n){var i=N.li.cloneNode(!1);return t&&(1===t.nodeType||11===t.nodeType?i.appendChild(t):i.innerHTML=t),void 0!==e&&""!==e&&(i.className=e),null!=n&&i.classList.add("optgroup-"+n),i},a:function(t,e,n){var i=N.a.cloneNode(!0);return t&&(11===t.nodeType?i.appendChild(t):i.insertAdjacentHTML("beforeend",t)),void 0!==e&&""!==e&&(i.className=e),"4"===A.major&&i.classList.add("dropdown-item"),n&&i.setAttribute("style",n),i},text:function(t,e){var n,i,o=N.text.cloneNode(!1);if(t.content)o.innerHTML=t.content;else{if(o.textContent=t.text,t.icon){var s=N.whitespace.cloneNode(!1);(i=(!0===e?N.i:N.span).cloneNode(!1)).className=t.iconBase+" "+t.icon,N.fragment.appendChild(i),N.fragment.appendChild(s)}t.subtext&&((n=N.subtext.cloneNode(!1)).textContent=t.subtext,o.appendChild(n))}if(!0===e)for(;o.childNodes.length>0;)N.fragment.appendChild(o.childNodes[0]);else N.fragment.appendChild(o);return N.fragment},label:function(t){var e,n,i=N.text.cloneNode(!1);if(i.innerHTML=t.label,t.icon){var o=N.whitespace.cloneNode(!1);(n=N.span.cloneNode(!1)).className=t.iconBase+" "+t.icon,N.fragment.appendChild(n),N.fragment.appendChild(o)}return t.subtext&&((e=N.subtext.cloneNode(!1)).textContent=t.subtext,i.appendChild(e)),N.fragment.appendChild(i),N.fragment}},W=function(e,n){var i=this;g.useDefault||(t.valHooks.select.set=g._set,g.useDefault=!0),this.$element=t(e),this.$newElement=null,this.$button=null,this.$menu=null,this.options=n,this.selectpicker={main:{},search:{},current:{},view:{},keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout(function(){i.selectpicker.keydown.keyHistory=""},800)}}}},null===this.options.title&&(this.options.title=this.$element.attr("title"));var o=this.options.windowPadding;"number"==typeof o&&(this.options.windowPadding=[o,o,o,o]),this.val=W.prototype.val,this.render=W.prototype.render,this.refresh=W.prototype.refresh,this.setStyle=W.prototype.setStyle,this.selectAll=W.prototype.selectAll,this.deselectAll=W.prototype.deselectAll,this.destroy=W.prototype.destroy,this.remove=W.prototype.remove,this.show=W.prototype.show,this.hide=W.prototype.hide,this.init()};function U(n){var i,o=arguments,s=n;if([].shift.apply(o),!A.success){try{A.full=(t.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(t){W.BootstrapVersion?A.full=W.BootstrapVersion.split(" ")[0].split("."):(A.full=[A.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",t))}A.major=A.full[0],A.success=!0}if("4"===A.major){var r=[];W.DEFAULTS.style===Y.BUTTONCLASS&&r.push({name:"style",className:"BUTTONCLASS"}),W.DEFAULTS.iconBase===Y.ICONBASE&&r.push({name:"iconBase",className:"ICONBASE"}),W.DEFAULTS.tickIcon===Y.TICKICON&&r.push({name:"tickIcon",className:"TICKICON"}),Y.DIVIDER="dropdown-divider",Y.SHOW="show",Y.BUTTONCLASS="btn-light",Y.POPOVERHEADER="popover-header",Y.ICONBASE="",Y.TICKICON="bs-ok-default";for(var a=0;a'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:i},W.prototype={constructor:W,init:function(){var t=this,e=this.$element.attr("id");j++,this.selectId="bs-select-"+j,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$element[0].classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(R.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(Y.MENURIGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide.bs.select",function(){if(t.isVirtual()){var e=t.$menuInner[0],n=e.firstChild.cloneNode(!1);e.replaceChild(n,e.firstChild),e.scrollTop=0}}),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){t.$element.trigger("hide.bs.select",e)},"hidden.bs.dropdown":function(e){t.$element.trigger("hidden.bs.select",e)},"show.bs.dropdown":function(e){t.$element.trigger("show.bs.select",e)},"shown.bs.dropdown":function(e){t.$element.trigger("shown.bs.select",e)}}),t.$element[0].hasAttribute("required")&&this.$element.on("invalid.bs.select",function(){t.$button[0].classList.add("bs-invalid"),t.$element.on("shown.bs.select.invalid",function(){t.$element.val(t.$element.val()).off("shown.bs.select.invalid")}).on("rendered.bs.select",function(){this.validity.valid&&t.$button[0].classList.remove("bs-invalid"),t.$element.off("rendered.bs.select")}),t.$button.on("blur.bs.select",function(){t.$element.trigger("focus").trigger("blur"),t.$button.off("blur.bs.select")})}),setTimeout(function(){t.createLi(),t.$element.trigger("loaded.bs.select")})},createDropdown:function(){var e=this.multiple||this.options.showTick?" show-tick":"",n=this.multiple?' aria-multiselectable="true"':"",i="",o=this.autofocus?" autofocus":"";A.major<4&&this.$element.parent().hasClass("input-group")&&(i=" input-group-btn");var s,r="",a="",l="",c="";return this.options.header&&(r='
    '+this.options.header+"
    "),this.options.liveSearch&&(a=''),this.multiple&&this.options.actionsBox&&(l='
    "),this.multiple&&this.options.doneButton&&(c='
    "),s='",t(s)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0;for(var t=0;t=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(e,n,i){var o,s,r=this,l=0,c=[];if(this.selectpicker.current=e?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),n)if(i)l=this.$menuInner[0].scrollTop;else if(!r.multiple){var u=r.$element[0],d=(u.options[u.selectedIndex]||{}).liIndex;if("number"==typeof d&&!1!==r.options.size){var h=r.selectpicker.main.data[d],f=h&&h.position;f&&(l=f-(r.sizeInfo.menuInnerHeight+r.sizeInfo.liHeight)/2)}}function p(t,n){var i,l,u,d,h,f,p,m,g,v,b=r.selectpicker.current.elements.length,y=[],w=!0,k=r.isVirtual();r.selectpicker.view.scrollTop=t,!0===k&&r.sizeInfo.hasScrollBar&&r.$menu[0].offsetWidth>r.sizeInfo.totalMenuWidth&&(r.sizeInfo.menuWidth=r.$menu[0].offsetWidth,r.sizeInfo.totalMenuWidth=r.sizeInfo.menuWidth+r.sizeInfo.scrollBarWidth,r.$menu.css("min-width",r.sizeInfo.menuWidth)),i=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),l=Math.round(b/i)||1;for(var x=0;xb-1?0:r.selectpicker.current.data[b-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,D.firstChild.style.marginTop=C+"px",D.firstChild.style.marginBottom=S+"px"):(D.firstChild.style.marginTop=0,D.firstChild.style.marginBottom=0),D.firstChild.appendChild(O)}if(r.prevActiveIndex=r.activeIndex,r.options.liveSearch){if(e&&n){var j,$=0;r.selectpicker.view.canHighlight[$]||($=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),j=r.selectpicker.view.visibleElements[$],r.defocusItem(r.selectpicker.view.currentActive),r.activeIndex=(r.selectpicker.current.data[$]||{}).index,r.focusItem(j)}}else r.$menuInner.trigger("focus")}p(l,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",function(t,e){r.noScroll||p(this.scrollTop,e),r.noScroll=!1}),t(window).off("resize.bs.select."+this.selectId+".createView").on("resize.bs.select."+this.selectId+".createView",function(){var t=r.$newElement.hasClass(Y.SHOW);t&&p(r.$menuInner[0].scrollTop)})},focusItem:function(t,e,n){if(t){e=e||this.selectpicker.main.data[this.activeIndex];var i=t.firstChild;i&&(i.setAttribute("aria-setsize",this.selectpicker.view.size),i.setAttribute("aria-posinset",e.posinset),!0!==n&&(this.focusedParent.setAttribute("aria-activedescendant",i.id),t.classList.add("active"),i.classList.add("active")))}},defocusItem:function(t){t&&(t.classList.remove("active"),t.firstChild&&t.firstChild.classList.remove("active"))},setPlaceholder:function(){var e=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),e=!0;var n=this.$element[0],i=!1,o=!this.selectpicker.view.titleOption.parentNode;if(o){this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="";var s=t(n.options[n.selectedIndex]);i=void 0===s.attr("selected")&&void 0===this.$element.data("selected")}(o||0!==this.selectpicker.view.titleOption.index)&&n.insertBefore(this.selectpicker.view.titleOption,n.firstChild),i&&(n.selectedIndex=0)}return e},createLi:function(){var t=this,e=this.options.iconBase,n=':not([hidden]):not([data-hidden="true"])',i=[],o=[],s=0,r=0,a=this.setPlaceholder()?1:0;this.options.hideDisabled&&(n+=":not(:disabled)"),!t.options.showTick&&!t.multiple||N.checkMark.parentNode||(N.checkMark.className=e+" "+t.options.tickIcon+" check-mark",N.a.appendChild(N.checkMark));var l=this.$element[0].querySelectorAll("select > *"+n);function c(t){var e=o[o.length-1];e&&"divider"===e.type&&(e.optID||t.optID)||((t=t||{}).type="divider",i.push(z.li(!1,Y.DIVIDER,t.optID?t.optID+"div":void 0)),o.push(t))}function u(n,r){if((r=r||{}).divider="true"===n.getAttribute("data-divider"),r.divider)c({optID:r.optID});else{var a=o.length,l=n.style.cssText,u=l?P(l):"",d=(n.className||"")+(r.optgroupClass||"");r.optID&&(d="opt "+d),r.text=n.textContent,r.content=n.getAttribute("data-content"),r.tokens=n.getAttribute("data-tokens"),r.subtext=n.getAttribute("data-subtext"),r.icon=n.getAttribute("data-icon"),r.iconBase=e;var h=z.text(r),f=z.li(z.a(h,d,u),"",r.optID);f.firstChild&&(f.firstChild.id=t.selectId+"-"+a),i.push(f),n.liIndex=a,r.display=r.content||r.text,r.type="option",r.index=a,r.option=n,r.disabled=r.disabled||n.disabled,o.push(r);var p=0;r.display&&(p+=r.display.length),r.subtext&&(p+=r.subtext.length),r.icon&&(p+=1),p>s&&(s=p,t.selectpicker.view.widestOption=i[i.length-1])}}function d(t,s){var a=s[t],l=s[t-1],d=s[t+1],h=a.querySelectorAll("option"+n);if(h.length){var f,p,m={label:P(a.label),subtext:a.getAttribute("data-subtext"),icon:a.getAttribute("data-icon"),iconBase:e},g=" "+(a.className||"");r++,l&&c({optID:r});var v=z.label(m);i.push(z.li(v,"dropdown-header"+g,r)),o.push({display:m.label,subtext:m.subtext,type:"optgroup-label",optID:r});for(var b=0,y=h.length;b li")},render:function(){this.setPlaceholder();var t,e,n=this.$element[0],i=function(t,e){var n,i=t.selectedOptions,o=[];if(e){for(var s=0,r=i.length;s1)&&(e=this.options.selectedTextFormat.split(">"),t=e.length>1&&o>e[1]||1===e.length&&o>=2),!1===t){for(var d=0;d0&&c.appendChild(l.cloneNode(!1)),h.title?f.text=h.title:p.content&&this.options.showContent?(f.content=p.content.toString(),u=!0):(this.options.showIcon&&(f.icon=p.icon,f.iconBase=this.options.iconBase),this.options.showSubtext&&!this.multiple&&p.subtext&&(f.subtext=" "+p.subtext),f.text=h.textContent.trim()),c.appendChild(z.text(f,!0))}o>49&&c.appendChild(document.createTextNode("..."))}else{var g=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(g+=":not(:disabled)");var v=this.$element[0].querySelectorAll("select > option"+g+", optgroup"+g+" option"+g).length,b="function"==typeof this.options.countSelectedText?this.options.countSelectedText(o,v):this.options.countSelectedText;c=z.text({text:b.replace("{0}",o.toString()).replace("{1}",v.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),c.childNodes.length||(c=z.text({text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),s.title=c.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&u&&a([c],this.options.whiteList,this.options.sanitizeFn),r.innerHTML="",r.appendChild(c),A.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var y=s.querySelector(".filter-expand"),w=r.cloneNode(!0);w.className="filter-expand",y?s.replaceChild(w,y):s.appendChild(w)}this.$element.trigger("rendered.bs.select")},setStyle:function(t,e){var n,i=this.$button[0],o=this.$newElement[0],s=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),A.major<4&&(o.classList.add("bs3"),o.parentNode.classList.contains("input-group")&&(o.previousElementSibling||o.nextElementSibling)&&(o.previousElementSibling||o.nextElementSibling).classList.contains("input-group-addon")&&o.classList.add("bs3-has-addon")),n=t?t.trim():s,"add"==e?n&&i.classList.add.apply(i.classList,n.split(" ")):"remove"==e?n&&i.classList.remove.apply(i.classList,n.split(" ")):(s&&i.classList.remove.apply(i.classList,s.split(" ")),n&&i.classList.add.apply(i.classList,n.split(" ")))},liHeight:function(e){if(e||!1!==this.options.size&&!this.sizeInfo){this.sizeInfo||(this.sizeInfo={});var n=document.createElement("div"),i=document.createElement("div"),o=document.createElement("div"),s=document.createElement("ul"),r=document.createElement("li"),a=document.createElement("li"),l=document.createElement("li"),c=document.createElement("a"),u=document.createElement("span"),d=this.options.header&&this.$menu.find("."+Y.POPOVERHEADER).length>0?this.$menu.find("."+Y.POPOVERHEADER)[0].cloneNode(!0):null,h=this.options.liveSearch?document.createElement("div"):null,f=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,p=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,u.className="text",c.className="dropdown-item "+(m?m.className:""),n.className=this.$menu[0].parentNode.className+" "+Y.SHOW,n.style.width=this.sizeInfo.selectWidth+"px","auto"===this.options.width&&(i.style.minWidth=0),i.className=Y.MENU+" "+Y.SHOW,o.className="inner "+Y.SHOW,s.className=Y.MENU+" inner "+("4"===A.major?Y.SHOW:""),r.className=Y.DIVIDER,a.className="dropdown-header",u.appendChild(document.createTextNode("​")),c.appendChild(u),l.appendChild(c),a.appendChild(u.cloneNode(!0)),this.selectpicker.view.widestOption&&s.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),s.appendChild(l),s.appendChild(r),s.appendChild(a),d&&i.appendChild(d),h){var g=document.createElement("input");h.className="bs-searchbox",g.className="form-control",h.appendChild(g),i.appendChild(h)}f&&i.appendChild(f),o.appendChild(s),i.appendChild(o),p&&i.appendChild(p),n.appendChild(i),document.body.appendChild(n);var v,b=l.offsetHeight,y=a?a.offsetHeight:0,k=d?d.offsetHeight:0,x=h?h.offsetHeight:0,_=f?f.offsetHeight:0,C=p?p.offsetHeight:0,S=t(r).outerHeight(!0),D=!!window.getComputedStyle&&window.getComputedStyle(i),O=i.offsetWidth,T=D?null:t(i),E={vert:w(D?D.paddingTop:T.css("paddingTop"))+w(D?D.paddingBottom:T.css("paddingBottom"))+w(D?D.borderTopWidth:T.css("borderTopWidth"))+w(D?D.borderBottomWidth:T.css("borderBottomWidth")),horiz:w(D?D.paddingLeft:T.css("paddingLeft"))+w(D?D.paddingRight:T.css("paddingRight"))+w(D?D.borderLeftWidth:T.css("borderLeftWidth"))+w(D?D.borderRightWidth:T.css("borderRightWidth"))},L={vert:E.vert+w(D?D.marginTop:T.css("marginTop"))+w(D?D.marginBottom:T.css("marginBottom"))+2,horiz:E.horiz+w(D?D.marginLeft:T.css("marginLeft"))+w(D?D.marginRight:T.css("marginRight"))+2};o.style.overflowY="scroll",v=i.offsetWidth-O,document.body.removeChild(n),this.sizeInfo.liHeight=b,this.sizeInfo.dropdownHeaderHeight=y,this.sizeInfo.headerHeight=k,this.sizeInfo.searchHeight=x,this.sizeInfo.actionsHeight=_,this.sizeInfo.doneButtonHeight=C,this.sizeInfo.dividerHeight=S,this.sizeInfo.menuPadding=E,this.sizeInfo.menuExtras=L,this.sizeInfo.menuWidth=O,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth,this.sizeInfo.scrollBarWidth=v,this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight,this.setPositionData()}},getSelectPosition:function(){var e,n=t(window),i=this.$newElement.offset(),o=t(this.options.container);this.options.container&&o.length&&!o.is("body")?((e=o.offset()).top+=parseInt(o.css("borderTopWidth")),e.left+=parseInt(o.css("borderLeftWidth"))):e={top:0,left:0};var s=this.options.windowPadding;this.sizeInfo.selectOffsetTop=i.top-e.top-n.scrollTop(),this.sizeInfo.selectOffsetBot=n.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-e.top-s[2],this.sizeInfo.selectOffsetLeft=i.left-e.left-n.scrollLeft(),this.sizeInfo.selectOffsetRight=n.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-e.left-s[1],this.sizeInfo.selectOffsetTop-=s[0],this.sizeInfo.selectOffsetLeft-=s[3]},setMenuSize:function(t){this.getSelectPosition();var e,n,i,o,s,r,a,l=this.sizeInfo.selectWidth,c=this.sizeInfo.liHeight,u=this.sizeInfo.headerHeight,d=this.sizeInfo.searchHeight,h=this.sizeInfo.actionsHeight,f=this.sizeInfo.doneButtonHeight,p=this.sizeInfo.dividerHeight,m=this.sizeInfo.menuPadding,g=0;if(this.options.dropupAuto&&(a=c*this.selectpicker.current.elements.length+m.vert,this.$newElement.toggleClass(Y.DROPUP,this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&a+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),"auto"===this.options.size)o=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,n=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,i=o+u+d+h+f,r=Math.max(o-m.vert,0),this.$newElement.hasClass(Y.DROPUP)&&(n=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),s=n,e=n-u-d-h-f-m.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var v=0;vthis.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth,this.$menu.css("min-width",this.sizeInfo.totalMenuWidth)),this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(e){if(this.liHeight(e),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var n=this,i=t(window);this.setMenuSize(),this.options.liveSearch&&this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",function(){return n.setMenuSize()}),"auto"===this.options.size?i.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+$+"."+this.selectId+".setMenuSize").on("resize.bs.select."+this.selectId+".setMenuSize scroll"+$+"."+this.selectId+".setMenuSize",function(){return n.setMenuSize()}):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&i.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+$+"."+this.selectId+".setMenuSize"),n.createView(!1,!0,e)}},setWidth:function(){var t=this;"auto"===this.options.width?requestAnimationFrame(function(){t.$menu.css("min-width","0"),t.$element.on("loaded.bs.select",function(){t.liHeight(),t.setMenuSize();var e=t.$newElement.clone().appendTo("body"),n=e.css("width","auto").children("button").outerWidth();e.remove(),t.sizeInfo.selectWidth=Math.max(t.sizeInfo.totalMenuWidth,n),t.$newElement.css("width",t.sizeInfo.selectWidth+"px")})}):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=t('
    ');var e,n,i,o=this,s=t(this.options.container),r=function(r){var a={},l=o.options.display||!!t.fn.dropdown.Constructor.Default&&t.fn.dropdown.Constructor.Default.display;o.$bsContainer.addClass(r.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(Y.DROPUP,r.hasClass(Y.DROPUP)),e=r.offset(),s.is("body")?n={top:0,left:0}:((n=s.offset()).top+=parseInt(s.css("borderTopWidth"))-s.scrollTop(),n.left+=parseInt(s.css("borderLeftWidth"))-s.scrollLeft()),i=r.hasClass(Y.DROPUP)?0:r[0].offsetHeight,(A.major<4||"static"===l)&&(a.top=e.top-n.top+i,a.left=e.left-n.left),a.width=r[0].offsetWidth,o.$bsContainer.css(a)};this.$button.on("click.bs.dropdown.data-api",function(){o.isDisabled()||(r(o.$newElement),o.$bsContainer.appendTo(o.options.container).toggleClass(Y.SHOW,!o.$button.hasClass(Y.SHOW)).append(o.$menu))}),t(window).off("resize.bs.select."+this.selectId+" scroll"+$+"."+this.selectId).on("resize.bs.select."+this.selectId+" scroll"+$+"."+this.selectId,function(){var t=o.$newElement.hasClass(Y.SHOW);t&&r(o.$newElement)}),this.$element.on("hide.bs.select",function(){o.$menu.data("height",o.$menu.height()),o.$bsContainer.detach()})},setOptionStatus:function(t){if(this.noScroll=!1,this.selectpicker.view.visibleElements&&this.selectpicker.view.visibleElements.length)for(var e=0;e3&&!e.dropdown&&(e.dropdown=e.$button.data("bs.dropdown"),e.dropdown._menu=e.$menu[0])}),this.$button.on("click.bs.dropdown.data-api",function(){e.$newElement.hasClass(Y.SHOW)||e.setSize()}),this.$element.on("shown.bs.select",function(){e.$menuInner[0].scrollTop!==e.selectpicker.view.scrollTop&&(e.$menuInner[0].scrollTop=e.selectpicker.view.scrollTop),A.major>3?requestAnimationFrame(o):i()}),this.$menuInner.on("mouseenter","li a",function(t){var n=this.parentElement,i=e.isVirtual()?e.selectpicker.view.position0:0,o=Array.prototype.indexOf.call(n.parentElement.children,n),s=e.selectpicker.current.data[o+i];e.focusItem(n,s,!0)}),this.$menuInner.on("click","li a",function(n,i){var o=t(this),s=e.$element[0],r=e.isVirtual()?e.selectpicker.view.position0:0,a=e.selectpicker.current.data[o.parent().index()+r],l=a.index,c=m(s),u=s.selectedIndex,d=s.options[u],h=!0;if(e.multiple&&1!==e.options.maxOptions&&n.stopPropagation(),n.preventDefault(),!e.isDisabled()&&!o.parent().hasClass(Y.DISABLED)){var f=e.$element.find("option"),p=a.option,g=t(p),b=p.selected,y=g.parent("optgroup"),w=y.find("option"),k=e.options.maxOptions,x=y.data("maxOptions")||!1;if(l===e.activeIndex&&(i=!0),i||(e.prevActiveIndex=e.activeIndex,e.activeIndex=void 0),e.multiple){if(p.selected=!b,e.setSelected(l,!b),o.trigger("blur"),!1!==k||!1!==x){var _=k
    ');O[2]&&(T=T.replace("{var}",O[2][k>1?0:1]),E=E.replace("{var}",O[2][x>1?0:1])),g.prop("selected",!1),e.$menu.append(L),k&&_&&(L.append(t("
    "+T+"
    ")),h=!1,e.$element.trigger("maxReached.bs.select")),x&&C&&(L.append(t("
    "+E+"
    ")),h=!1,e.$element.trigger("maxReachedGrp.bs.select")),setTimeout(function(){e.setSelected(l,!1)},10),L.delay(750).fadeOut(300,function(){t(this).remove()})}}}else d.selected=!1,p.selected=!0,e.setSelected(l,!0);!e.multiple||e.multiple&&1===e.options.maxOptions?e.$button.trigger("focus"):e.options.liveSearch&&e.$searchbox.trigger("focus"),h&&(e.multiple||u!==s.selectedIndex)&&(v=[p.index,g.prop("selected"),c],e.$element.triggerNative("change"))}}),this.$menu.on("click","li."+Y.DISABLED+" a, ."+Y.POPOVERHEADER+", ."+Y.POPOVERHEADER+" :not(.close)",function(n){n.currentTarget==this&&(n.preventDefault(),n.stopPropagation(),e.options.liveSearch&&!t(n.target).hasClass("close")?e.$searchbox.trigger("focus"):e.$button.trigger("focus"))}),this.$menuInner.on("click",".divider, .dropdown-header",function(t){t.preventDefault(),t.stopPropagation(),e.options.liveSearch?e.$searchbox.trigger("focus"):e.$button.trigger("focus")}),this.$menu.on("click","."+Y.POPOVERHEADER+" .close",function(){e.$button.trigger("click")}),this.$searchbox.on("click",function(t){t.stopPropagation()}),this.$menu.on("click",".actions-btn",function(n){e.options.liveSearch?e.$searchbox.trigger("focus"):e.$button.trigger("focus"),n.preventDefault(),n.stopPropagation(),t(this).hasClass("bs-select-all")?e.selectAll():e.deselectAll()}),this.$element.on("change.bs.select",function(){e.render(),e.$element.trigger("changed.bs.select",v),v=null}).on("focus.bs.select",function(){e.options.mobile||e.$button.trigger("focus")})},liveSearchListener:function(){var t=this,e=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){t.$searchbox.val()&&t.$searchbox.val("")}),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",function(t){t.stopPropagation()}),this.$searchbox.on("input propertychange",function(){var n=t.$searchbox.val();if(t.selectpicker.search.elements=[],t.selectpicker.search.data=[],n){var i=[],o=n.toUpperCase(),s={},r=[],a=t._searchStyle(),l=t.options.liveSearchNormalize;l&&(o=S(o)),t._$lisSelected=t.$menuInner.find(".selected");for(var c=0;c0&&(s[u.headerIndex-1]=!0,r.push(u.headerIndex-1)),s[u.headerIndex]=!0,r.push(u.headerIndex),s[u.lastIndex+1]=!0),s[c]&&"optgroup-label"!==u.type&&r.push(c)}for(var c=0,d=r.length;c=48&&e.which<=57||e.which>=96&&e.which<=105||e.which>=65&&e.which<=90)&&(u.$button.trigger("click.bs.dropdown.data-api"),u.options.liveSearch))u.$searchbox.trigger("focus");else{if(e.which===M.ESCAPE&&i&&(e.preventDefault(),u.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),p){if(!d.length)return;o=u.selectpicker.main.elements[u.activeIndex],-1!==(n=o?Array.prototype.indexOf.call(o.parentElement.children,o):-1)&&u.defocusItem(o),e.which===M.ARROW_UP?(-1!==n&&n--,n+v<0&&(n+=d.length),u.selectpicker.view.canHighlight[n+v]||-1==(n=u.selectpicker.view.canHighlight.slice(0,n+v).lastIndexOf(!0)-v)&&(n=d.length-1)):(e.which===M.ARROW_DOWN||f)&&(++n+v>=u.selectpicker.view.canHighlight.length&&(n=0),u.selectpicker.view.canHighlight[n+v]||(n=n+1+u.selectpicker.view.canHighlight.slice(n+v+1).indexOf(!0))),e.preventDefault();var b=v+n;e.which===M.ARROW_UP?0===v&&n===d.length-1?(u.$menuInner[0].scrollTop=u.$menuInner[0].scrollHeight,b=u.selectpicker.current.elements.length-1):(s=u.selectpicker.current.data[b],r=s.position-s.height,h=rm)),o=u.selectpicker.current.elements[b],u.activeIndex=u.selectpicker.current.data[b].index,u.focusItem(o),u.selectpicker.view.currentActive=o,h&&(u.$menuInner[0].scrollTop=r),u.options.liveSearch?u.$searchbox.trigger("focus"):a.trigger("focus")}else if(!a.is("input")&&!B.test(e.which)||e.which===M.SPACE&&u.selectpicker.keydown.keyHistory){var w,k,x=[];e.preventDefault(),u.selectpicker.keydown.keyHistory+=I[e.which],u.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(u.selectpicker.keydown.resetKeyHistory.cancel),u.selectpicker.keydown.resetKeyHistory.cancel=u.selectpicker.keydown.resetKeyHistory.start(),k=u.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(k)&&(k=k.charAt(0));for(var _=0;_0?(r=s.position-s.height,h=!0):(r=s.position-u.sizeInfo.menuInnerHeight,h=s.position>m+u.sizeInfo.menuInnerHeight),o=u.selectpicker.main.elements[w],u.activeIndex=x[S],u.focusItem(o),o&&o.firstChild.focus(),h&&(u.$menuInner[0].scrollTop=r),a.trigger("focus")}}i&&(e.which===M.SPACE&&!u.selectpicker.keydown.keyHistory||e.which===M.ENTER||e.which===M.TAB&&u.options.selectOnTab)&&(e.which!==M.SPACE&&e.preventDefault(),u.options.liveSearch&&e.which===M.SPACE||(u.$menuInner.find(".active a").trigger("click",!0),a.trigger("focus"),u.options.liveSearch||(e.preventDefault(),t(document).data("spaceSelect",!0))))}},mobile:function(){this.$element[0].classList.add("mobile-device")},refresh:function(){var e=t.extend({},this.options,this.$element.data());this.options=e,this.checkDisabled(),this.setStyle(),this.render(),this.createLi(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off($).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),t(window).off(".bs.select."+this.selectId)}};var V=t.fn.selectpicker;t.fn.selectpicker=U,t.fn.selectpicker.Constructor=W,t.fn.selectpicker.noConflict=function(){return t.fn.selectpicker=V,this},t(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',W.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',function(t){t.stopPropagation()}),t(window).on("load.bs.select.data-api",function(){t(".selectpicker").each(function(){var e=t(this);U.call(e,e.data())})})}(t)}.apply(e,i))||(t.exports=o)},DPsx:function(t,e,n){var i=n("g6v/"),o=n("0Dky"),s=n("zBJ4");t.exports=!i&&!o(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},DQNa:function(t,e,n){var i=n("busE"),o=Date.prototype,s=o.toString,r=o.getTime;new Date(NaN)+""!="Invalid Date"&&i(o,"toString",function(){var t=r.call(this);return t==t?s.call(this):"Invalid Date"})},EnZy:function(t,e,n){"use strict";var i=n("14Sl"),o=n("ROdP"),s=n("glrk"),r=n("HYAF"),a=n("SEBh"),l=n("iqWW"),c=n("UMSQ"),u=n("FMNM"),d=n("kmMV"),h=n("0Dky"),f=[].push,p=Math.min,m=!h(function(){return!RegExp(4294967295,"y")});i("split",2,function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=String(r(this)),s=void 0===n?4294967295:n>>>0;if(0===s)return[];if(void 0===t)return[i];if(!o(t))return e.call(i,t,s);for(var a,l,c,u=[],h=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,m=new RegExp(t.source,h+"g");(a=d.call(m,i))&&!((l=m.lastIndex)>p&&(u.push(i.slice(p,a.index)),a.length>1&&a.index=s));)m.lastIndex===a.index&&m.lastIndex++;return p===i.length?!c&&m.test("")||u.push(""):u.push(i.slice(p)),u.length>s?u.slice(0,s):u}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var o=r(this),s=null==e?void 0:e[t];return void 0!==s?s.call(e,o,n):i.call(String(o),e,n)},function(t,o){var r=n(i,t,this,o,i!==e);if(r.done)return r.value;var d=s(t),h=String(this),f=a(d,RegExp),g=d.unicode,v=(d.ignoreCase?"i":"")+(d.multiline?"m":"")+(d.unicode?"u":"")+(m?"y":"g"),b=new f(m?d:"^(?:"+d.source+")",v),y=void 0===o?4294967295:o>>>0;if(0===y)return[];if(0===h.length)return null===u(b,h)?[h]:[];for(var w=0,k=0,x=[];k1?arguments[1]:void 0)}})},Jchv:function(t,e,n){var i,o,s;o=[n("EVdn"),n("Qwlt")],void 0===(s="function"==typeof(i=function(t){return function(){var e,n=Math.max,i=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,c=t.fn.position;function u(t,e,n){return[parseFloat(t[0])*(l.test(t[0])?e/100:1),parseFloat(t[1])*(l.test(t[1])?n/100:1)]}function d(e,n){return parseInt(t.css(e,n),10)||0}t.position={scrollbarWidth:function(){if(void 0!==e)return e;var n,i,o=t("
    "),s=o.children()[0];return t("body").append(o),n=s.offsetWidth,o.css("overflow","scroll"),n===(i=s.offsetWidth)&&(i=o[0].clientWidth),o.remove(),e=n-i},getScrollInfo:function(e){var n=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),i=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),o="scroll"===n||"auto"===n&&e.width0?"right":"center",vertical:u<0?"top":l>0?"bottom":"middle"};hn(i(l),i(u))?d.important="horizontal":d.important="vertical",e.using.call(this,t,d)}),r.offset(t.extend(S,{using:s}))})},t.ui.position={fit:{left:function(t,e){var i,o=e.within,s=o.isWindow?o.scrollLeft:o.offset.left,r=o.width,a=t.left-e.collisionPosition.marginLeft,l=s-a,c=a+e.collisionWidth-r-s;e.collisionWidth>r?l>0&&c<=0?(i=t.left+l+e.collisionWidth-r-s,t.left+=l-i):t.left=c>0&&l<=0?s:l>c?s+r-e.collisionWidth:s:l>0?t.left+=l:c>0?t.left-=c:t.left=n(t.left-a,t.left)},top:function(t,e){var i,o=e.within,s=o.isWindow?o.scrollTop:o.offset.top,r=e.within.height,a=t.top-e.collisionPosition.marginTop,l=s-a,c=a+e.collisionHeight-r-s;e.collisionHeight>r?l>0&&c<=0?(i=t.top+l+e.collisionHeight-r-s,t.top+=l-i):t.top=c>0&&l<=0?s:l>c?s+r-e.collisionHeight:s:l>0?t.top+=l:c>0?t.top-=c:t.top=n(t.top-a,t.top)}},flip:{left:function(t,e){var n,o,s=e.within,r=s.offset.left+s.scrollLeft,a=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,c=t.left-e.collisionPosition.marginLeft,u=c-l,d=c+e.collisionWidth-a-l,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,f="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];u<0?((n=t.left+h+f+p+e.collisionWidth-a-r)<0||n0&&((o=t.left-e.collisionPosition.marginLeft+h+f+p-l)>0||i(o)0&&((n=t.top-e.collisionPosition.marginTop+h+f+p-l)>0||i(n)",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,n){e._removeClass(n,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var i,o,s,r=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(r={},i=e.split("."),e=i.shift(),i.length){for(o=r[e]=t.widget.extend({},this.options[e]),s=0;sl;)o.f(t,n=i[l++],e[n]);return t}},NA7A:function(t,e,n){var i=n("ROdP"),o=n("HYAF");t.exports=function(t,e,n){if(i(e))throw TypeError("String.prototype."+n+" doesn't accept regex");return String(o(t))}},NBAS:function(t,e,n){var i=n("I+eb"),o=n("0Dky"),s=n("ewvW"),r=n("4WOD"),a=n("4Xet");i({target:"Object",stat:!0,forced:o(function(){r(1)}),sham:!a},{getPrototypeOf:function(t){return r(s(t))}})},NlKh:function(t,e,n){},Onkx:function(e,n,i){(function(e){var n;(n=e).fn.extend({slimScroll:function(e){var i=n.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},e);return this.each(function(){var o,s,r,a,l,c,u,d,h="
    ",f=30,p=!1,m=n(this);if(m.parent().hasClass(i.wrapperClass)){var g=m.scrollTop();if(x=m.siblings("."+i.barClass),k=m.siblings("."+i.railClass),D(),n.isPlainObject(e)){if("height"in e&&"auto"==e.height){m.parent().css("height","auto"),m.css("height","auto");var v=m.parent().parent().height();m.parent().css("height",v),m.css("height",v)}else if("height"in e){var b=e.height;m.parent().css("height",b),m.css("height",b)}if("scrollTo"in e)g=parseInt(i.scrollTo);else if("scrollBy"in e)g+=parseInt(i.scrollBy);else if("destroy"in e)return x.remove(),k.remove(),void m.unwrap();S(g,!1,!0)}}else if(!(n.isPlainObject(e)&&"destroy"in e)){i.height="auto"==i.height?m.parent().height():i.height;var y=n(h).addClass(i.wrapperClass).css({position:"relative",overflow:"hidden",width:i.width,height:i.height});m.css({overflow:"hidden",width:i.width,height:i.height});var w,k=n(h).addClass(i.railClass).css({width:i.size,height:"100%",position:"absolute",top:0,display:i.alwaysVisible&&i.railVisible?"block":"none","border-radius":i.railBorderRadius,background:i.railColor,opacity:i.railOpacity,zIndex:90}),x=n(h).addClass(i.barClass).css({background:i.color,width:i.size,position:"absolute",top:0,opacity:i.opacity,display:i.alwaysVisible?"block":"none","border-radius":i.borderRadius,BorderRadius:i.borderRadius,MozBorderRadius:i.borderRadius,WebkitBorderRadius:i.borderRadius,zIndex:99}),_="right"==i.position?{right:i.distance}:{left:i.distance};k.css(_),x.css(_),m.wrap(y),m.parent().append(x),m.parent().append(k),i.railDraggable&&x.bind("mousedown",function(e){var i=n(document);return r=!0,t=parseFloat(x.css("top")),pageY=e.pageY,i.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,x.css("top",currTop),S(0,x.position().top,!1)}),i.bind("mouseup.slimscroll",function(t){r=!1,T(),i.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(t){return t.stopPropagation(),t.preventDefault(),!1}),k.hover(function(){O()},function(){T()}),x.hover(function(){s=!0},function(){s=!1}),m.hover(function(){o=!0,O(),T()},function(){o=!1,T()}),m.bind("touchstart",function(t,e){t.originalEvent.touches.length&&(l=t.originalEvent.touches[0].pageY)}),m.bind("touchmove",function(t){p||t.originalEvent.preventDefault(),t.originalEvent.touches.length&&(S((l-t.originalEvent.touches[0].pageY)/i.touchScrollStep,!0),l=t.originalEvent.touches[0].pageY)}),D(),"bottom"===i.start?(x.css({top:m.outerHeight()-x.outerHeight()}),S(0,!0)):"top"!==i.start&&(S(n(i.start).position().top,null,!0),i.alwaysVisible||x.hide()),w=this,window.addEventListener?(w.addEventListener("DOMMouseScroll",C,!1),w.addEventListener("mousewheel",C,!1)):document.attachEvent("onmousewheel",C)}function C(t){if(o){var e=0;(t=t||window.event).wheelDelta&&(e=-t.wheelDelta/120),t.detail&&(e=t.detail/3);var s=t.target||t.srcTarget||t.srcElement;n(s).closest("."+i.wrapperClass).is(m.parent())&&S(e,!0),t.preventDefault&&!p&&t.preventDefault(),p||(t.returnValue=!1)}}function S(t,e,n){p=!1;var o=t,s=m.outerHeight()-x.outerHeight();if(e&&(o=parseInt(x.css("top"))+t*parseInt(i.wheelStep)/100*x.outerHeight(),o=Math.min(Math.max(o,0),s),o=t>0?Math.ceil(o):Math.floor(o),x.css({top:o+"px"})),o=(u=parseInt(x.css("top"))/(m.outerHeight()-x.outerHeight()))*(m[0].scrollHeight-m.outerHeight()),n){var r=(o=t)/m[0].scrollHeight*m.outerHeight();r=Math.min(Math.max(r,0),s),x.css({top:r+"px"})}m.scrollTop(o),m.trigger("slimscrolling",~~o),O(),T()}function D(){c=Math.max(m.outerHeight()/m[0].scrollHeight*m.outerHeight(),f),x.css({height:c+"px"});var t=c==m.outerHeight()?"none":"block";x.css({display:t})}function O(){if(D(),clearTimeout(a),u==~~u){if(p=i.allowPageScroll,d!=u){var t=0==~~u?"top":"bottom";m.trigger("slimscroll",t)}}else p=!1;d=u,c>=m.outerHeight()?p=!0:(x.stop(!0,!0).fadeIn("fast"),i.railVisible&&k.stop(!0,!0).fadeIn("fast"))}function T(){i.alwaysVisible||(a=setTimeout(function(){i.disableFadeOut&&o||s||r||(x.fadeOut("slow"),k.fadeOut("slow"))},1e3))}}),this}}),n.fn.extend({slimscroll:n.fn.slimScroll})}).call(this,i("EVdn"))},P0SU:function(t,e,n){var i=n("+MLx"),o=n("RK3t"),s=n("ewvW"),r=n("UMSQ"),a=n("ZfDv");t.exports=function(t,e){var n=1==t,l=2==t,c=3==t,u=4==t,d=6==t,h=5==t||d,f=e||a;return function(e,a,p){for(var m,g,v=s(e),b=o(v),y=i(a,p,3),w=r(b.length),k=0,x=n?f(e,w):l?f(e,0):void 0;w>k;k++)if((h||k in b)&&(g=y(m=b[k],k,v),t))if(n)x[k]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return k;case 2:x.push(m)}else if(u)return!1;return d?-1:c||u?u:x}}},P4y1:function(t,e){t.exports={}},PDX0:function(t,e){(function(e){t.exports=e}).call(this,{})},PKPk:function(t,e,n){"use strict";var i=n("5dW1"),o=n("afO8"),s=n("fdAy"),r=o.set,a=o.getterFor("String Iterator");s(String,"String",function(t){r(this,{type:"String Iterator",string:String(t),index:0})},function(){var t,e=a(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=i(n,o,!0),e.index+=t.length,{value:t,done:!1})})},PSD3:function(t,e,n){t.exports=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"flex";t.style.opacity="",t.style.display=e},A=function(t){t.style.opacity="",t.style.display="none"},j=function(t,e,n){e?M(t,n):A(t)},$=function(t){return!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))},Y=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),i=parseFloat(e.getPropertyValue("transition-duration")||"0");return n>0||i>0},R=function(){return document.body.querySelector("."+w.container)},N=function(t){var e=R();return e?e.querySelector(t):null},H=function(t){return N("."+t)},B=function(){return H(w.popup)},z=function(){var t=B();return d(t.querySelectorAll("."+w.icon))},W=function(){var t=z().filter(function(t){return $(t)});return t.length?t[0]:null},U=function(){return H(w.title)},V=function(){return H(w.content)},F=function(){return H(w.image)},q=function(){return H(w["progress-steps"])},K=function(){return H(w["validation-message"])},G=function(){return N("."+w.actions+" ."+w.confirm)},X=function(){return N("."+w.actions+" ."+w.cancel)},J=function(){return H(w.actions)},Q=function(){return H(w.header)},Z=function(){return H(w.footer)},tt=function(){return H(w.close)},et=function(){var t=d(B().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(t,e){return t=parseInt(t.getAttribute("tabindex")),e=parseInt(e.getAttribute("tabindex")),t>e?1:t\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 \n
      \n
      \n
      \n \n \n
      \n
      \n
      \n
      \n').replace(/(^|\n)\s*/g,""),rt=function(t){pe.isVisible()&&D!==t.target.value&&pe.resetValidationMessage(),D=t.target.value},at=function(t){if((h=R())&&(h.parentNode.removeChild(h),L([document.documentElement,document.body],[w["no-backdrop"],w["toast-shown"],w["has-column"]])),ot())f("SweetAlert2 requires document to initialize");else{var e=document.createElement("div");e.className=w.container,e.innerHTML=st;var n,i,o,s,r,a,l,c,u,d="string"==typeof(n=t.target)?document.querySelector(n):n;d.appendChild(e),function(t){var e=B();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")}(t),function(t){"rtl"===window.getComputedStyle(t).direction&&E(R(),w.rtl)}(d),i=V(),o=P(i,w.input),s=P(i,w.file),r=i.querySelector(".".concat(w.range," input")),a=i.querySelector(".".concat(w.range," output")),l=P(i,w.select),c=i.querySelector(".".concat(w.checkbox," input")),u=P(i,w.textarea),o.oninput=rt,s.onchange=rt,l.onchange=rt,c.onchange=rt,u.oninput=rt,r.oninput=function(t){rt(t),a.value=r.value},r.onchange=function(t){rt(t),r.nextSibling.value=r.value}}var h},lt=function(e,n){e instanceof HTMLElement?n.appendChild(e):"object"===t(e)?ct(n,e):e&&(n.innerHTML=e)},ct=function(t,e){if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},ut=function(){if(ot())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(e.hasOwnProperty(n)&&void 0!==t.style[n])return e[n];return!1}();function dt(t,e,n){j(t,n["showC"+e.substring(1)+"Button"],"inline-block"),t.innerHTML=n[e+"ButtonText"],t.setAttribute("aria-label",n[e+"ButtonAriaLabel"]),t.className=w[e],C(t,n.customClass,e+"Button"),E(t,n[e+"ButtonClass"])}var ht=function(t,e){var n=J(),i=G(),o=X();e.showConfirmButton||e.showCancelButton?M(n):A(n),C(n,e.customClass,"actions"),dt(i,"confirm",e),dt(o,"cancel",e),e.buttonsStyling?function(t,e,n){E([t,e],w.styled),n.confirmButtonColor&&(t.style.backgroundColor=n.confirmButtonColor),n.cancelButtonColor&&(e.style.backgroundColor=n.cancelButtonColor);var i=window.getComputedStyle(t).getPropertyValue("background-color");t.style.borderLeftColor=i,t.style.borderRightColor=i}(i,o,e):(L([i,o],w.styled),i.style.backgroundColor=i.style.borderLeftColor=i.style.borderRightColor="",o.style.backgroundColor=o.style.borderLeftColor=o.style.borderRightColor="")},ft=function(t,e){var n=R();n&&(function(t,e){"string"==typeof e?t.style.background=e:e||E([document.documentElement,document.body],w["no-backdrop"])}(n,e.backdrop),!e.backdrop&&e.allowOutsideClick&&h('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),function(t,e){e in w?E(t,w[e]):(h('The "position" parameter is not valid, defaulting to "center"'),E(t,w.center))}(n,e.position),function(t,e){if(e&&"string"==typeof e){var n="grow-"+e;n in w&&E(t,w[n])}}(n,e.grow),C(n,e.customClass,"container"),e.customContainerClass&&E(n,e.customContainerClass))},pt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},mt=function(t,e){var n=S(V(),t);if(n)for(var i in function(t){for(var e=0;e=e.progressSteps.length&&h("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),e.progressSteps.forEach(function(t,o){var s=function(t){var e=document.createElement("li");return E(e,w["progress-step"]),e.innerHTML=t,e}(t);if(n.appendChild(s),o===i&&E(s,w["active-progress-step"]),o!==e.progressSteps.length-1){var r=function(t){var e=document.createElement("li");return E(e,w["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e}(t);n.appendChild(r)}})},_t=function(t,e){var n=Q();C(n,e.customClass,"header"),xt(t,e),function(t,e){var n=pt.innerParams.get(t);if(n&&e.type===n.type&&W())C(W(),e.customClass,"icon");else if(wt(),e.type)if(kt(),-1!==Object.keys(k).indexOf(e.type)){var i=N(".".concat(w.icon,".").concat(k[e.type]));M(i),C(i,e.customClass,"icon"),T(i,"swal2-animate-".concat(e.type,"-icon"),e.animation)}else f('Unknown type! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.type,'"'))}(t,e),function(t,e){var n=F();if(!e.imageUrl)return A(n);M(n),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt),I(n,"width",e.imageWidth),I(n,"height",e.imageHeight),n.className=w.image,C(n,e.customClass,"image"),e.imageClass&&E(n,e.imageClass)}(0,e),function(t,e){var n=U();j(n,e.title||e.titleText),e.title&<(e.title,n),e.titleText&&(n.innerText=e.titleText),C(n,e.customClass,"title")}(0,e),function(t,e){var n=tt();C(n,e.customClass,"closeButton"),j(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel)}(0,e)},Ct=function(t,e){!function(t,e){var n=B();I(n,"width",e.width),I(n,"padding",e.padding),e.background&&(n.style.background=e.background),n.className=w.popup,e.toast?(E([document.documentElement,document.body],w["toast-shown"]),E(n,w.toast)):E(n,w.modal),C(n,e.customClass,"popup"),"string"==typeof e.customClass&&E(n,e.customClass),T(n,w.noanimation,!e.animation)}(0,e),ft(0,e),_t(t,e),yt(t,e),ht(0,e),function(t,e){var n=Z();j(n,e.footer),e.footer&<(e.footer,n),C(n,e.customClass,"footer")}(0,e)},St=[],Dt=function(){var t=B();t||pe.fire(""),t=B();var e=J(),n=G(),i=X();M(e),M(n),E([t,e],w.loading),n.disabled=!0,i.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Ot={},Tt=function(){return new Promise(function(t){var e=window.scrollX,n=window.scrollY;Ot.restoreFocusTimeout=setTimeout(function(){Ot.previousActiveElement&&Ot.previousActiveElement.focus?(Ot.previousActiveElement.focus(),Ot.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)})},Et={title:"",titleText:"",text:"",html:"",footer:"",type:null,toast:!1,customClass:"",customContainerClass:"",target:"body",backdrop:!0,animation:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:null,confirmButtonClass:"",cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:null,cancelButtonClass:"",buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:"",timer:null,width:null,padding:null,background:null,input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:"",inputAttributes:{},inputValidator:null,validationMessage:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:null,onBeforeOpen:null,onAfterClose:null,onOpen:null,onClose:null,scrollbarPadding:!0},Lt=["title","titleText","text","html","type","customClass","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","confirmButtonClass","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","cancelButtonClass","buttonsStyling","reverseButtons","imageUrl","imageWidth","imageHeigth","imageAlt","imageClass","progressSteps","currentProgressStep"],Pt={customContainerClass:"customClass",confirmButtonClass:"customClass",cancelButtonClass:"customClass",imageClass:"customClass",inputClass:"customClass"},It=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],Mt=function(t){return Et.hasOwnProperty(t)},At=function(t){return Pt[t]},jt=function(t){Mt(t)||h('Unknown parameter "'.concat(t,'"'))},$t=function(t){-1!==It.indexOf(t)&&h('The parameter "'.concat(t,'" is incompatible with toasts'))},Yt=function(t){At(t)&&m(t,At(t))},Rt=function(t){for(var e in t)jt(e),t.toast&&$t(e),Yt()},Nt=Object.freeze({isValidParameter:Mt,isUpdatableParameter:function(t){return-1!==Lt.indexOf(t)},isDeprecatedParameter:At,argsToParams:function(e){var n={};switch(t(e[0])){case"object":o(n,e[0]);break;default:["title","html","type"].forEach(function(i,o){switch(t(e[o])){case"string":n[i]=e[o];break;case"undefined":break;default:f("Unexpected type of ".concat(i,'! Expected "string", got ').concat(t(e[o])))}})}return n},isVisible:function(){return $(B())},clickConfirm:function(){return G()&&G().click()},clickCancel:function(){return X()&&X().click()},getContainer:R,getPopup:B,getTitle:U,getContent:V,getImage:F,getIcon:W,getIcons:z,getCloseButton:tt,getActions:J,getConfirmButton:G,getCancelButton:X,getHeader:Q,getFooter:Z,getFocusableElements:et,getValidationMessage:K,isLoading:function(){return B().hasAttribute("data-loading")},fire:function(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.innerHeight&&(x.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=x.previousBodyPadding+function(){if("ontouchstart"in window||navigator.msMaxTouchPoints)return 0;var t=document.createElement("div");t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}()+"px")},zt=function(){null!==x.previousBodyPadding&&(document.body.style.paddingRight=x.previousBodyPadding+"px",x.previousBodyPadding=null)},Wt=function(){var t,e=R();e.ontouchstart=function(n){var i;t=n.target===e||!((i=e).scrollHeight>i.clientHeight)&&"INPUT"!==n.target.tagName},e.ontouchmove=function(e){t&&(e.preventDefault(),e.stopPropagation())}},Ut=function(){if(_(document.body,w.iosfix)){var t=parseInt(document.body.style.top,10);L(document.body,w.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}},Vt=function(){return!!window.MSInputMethodContext&&!!document.documentMode},Ft=function(){var t=R(),e=B();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")},qt=function(){"undefined"!=typeof window&&Vt()&&window.removeEventListener("resize",Ft)},Kt=function(){var t=d(document.body.children);t.forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},Gt={swalPromiseResolve:new WeakMap};function Xt(t,e,n){e?Zt(n):(Tt().then(function(){return Zt(n)}),Ot.keydownTarget.removeEventListener("keydown",Ot.keydownHandler,{capture:Ot.keydownListenerCapture}),Ot.keydownHandlerAdded=!1),delete Ot.keydownHandler,delete Ot.keydownTarget,t.parentNode&&t.parentNode.removeChild(t),L([document.documentElement,document.body],[w.shown,w["height-auto"],w["no-backdrop"],w["toast-shown"],w["toast-column"]]),nt()&&(zt(),Ut(),qt(),Kt())}function Jt(t){var e=R(),n=B();if(n&&!_(n,w.hide)){var i=pt.innerParams.get(this),o=Gt.swalPromiseResolve.get(this),s=i.onClose,r=i.onAfterClose;L(n,w.show),E(n,w.hide),ut&&Y(n)?n.addEventListener(ut,function(t){t.target===n&&function(t,e,n,i){_(t,w.hide)&&Xt(e,n,i),Qt(pt),Qt(Gt)}(n,e,it(),r)}):Xt(e,it(),r),null!==s&&"function"==typeof s&&s(n),o(t||{}),delete this.params}}var Qt=function(t){for(var e in t)t[e]=new WeakMap},Zt=function(t){null!==t&&"function"==typeof t&&setTimeout(function(){t()})};function te(t,e,n){var i=pt.domCache.get(t);e.forEach(function(t){i[t].disabled=n})}function ee(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode,i=n.querySelectorAll("input"),o=0;o"));var e=B(),n="string"==typeof t.target?document.querySelector(t.target):t.target;(!e||e&&n&&e.parentNode!==n.parentNode)&&at(t)})(n),Object.freeze(n),Ot.timeout&&(Ot.timeout.stop(),delete Ot.timeout),clearTimeout(Ot.restoreFocusTimeout);var i={popup:B(),container:R(),content:V(),actions:J(),confirmButton:G(),cancelButton:X(),closeButton:tt(),validationMessage:K(),progressSteps:q()};pt.domCache.set(this,i),Ct(this,n),pt.innerParams.set(this,n);var s=this.constructor;return new Promise(function(t){var o=function(t){e.closePopup({value:t})},r=function(t){e.closePopup({dismiss:t})};Gt.swalPromiseResolve.set(e,t),n.timer&&(Ot.timeout=new ne(function(){r("timer"),delete Ot.timeout},n.timer)),n.input&&setTimeout(function(){var t=e.getInput();t&&O(t)},0);for(var a=function(t){if(n.showLoaderOnConfirm&&s.showLoading(),n.preConfirm){e.resetValidationMessage();var r=Promise.resolve().then(function(){return n.preConfirm(t,n.validationMessage)});r.then(function(n){$(i.validationMessage)||!1===n?e.hideLoading():o(void 0===n?t:n)})}else o(t)},l=function(t){var o=t.target,l=i.confirmButton,c=i.cancelButton,u=l&&(l===o||l.contains(o)),d=c&&(c===o||c.contains(o));switch(t.type){case"click":if(u)if(e.disableButtons(),n.input){var h=function(){var t=e.getInput();if(!t)return null;switch(n.input){case"checkbox":return t.checked?1:0;case"radio":return t.checked?t.value:null;case"file":return t.files.length?t.files[0]:null;default:return n.inputAutoTrim?t.value.trim():t.value}}();if(n.inputValidator){e.disableInput();var f=Promise.resolve().then(function(){return n.inputValidator(h,n.validationMessage)});f.then(function(t){e.enableButtons(),e.enableInput(),t?e.showValidationMessage(t):a(h)})}else e.getInput().checkValidity()?a(h):(e.enableButtons(),e.showValidationMessage(n.validationMessage))}else a(!0);else d&&(e.disableButtons(),r(s.DismissReason.cancel))}},c=i.popup.querySelectorAll("button"),u=0;u.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-shown.swal2-top{top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-top-left,body.swal2-no-backdrop .swal2-shown.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-top-end,body.swal2-no-backdrop .swal2-shown.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-shown.swal2-center{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-left,body.swal2-no-backdrop .swal2-shown.swal2-center-start{top:50%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-end,body.swal2-no-backdrop .swal2-shown.swal2-center-right{top:50%;right:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom-left,body.swal2-no-backdrop .swal2-shown.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-bottom-end,body.swal2-no-backdrop .swal2-shown.swal2-bottom-right{right:0;bottom:0}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;background-color:transparent;-webkit-overflow-scrolling:touch}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-container.swal2-fade{transition:background-color .1s}.swal2-container.swal2-shown{background-color:rgba(0,0,0,.4)}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:"";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;top:0;right:0;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;outline:initial;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{-webkit-transform:none;transform:none;background:0 0;color:#f27474}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:300;line-height:normal;word-wrap:break-word}#swal2-content{text-align:center}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-webkit-input-placeholder,.swal2-input::-webkit-input-placeholder,.swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:inherit}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:inherit;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;zoom:normal;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;zoom:normal;border:.25em solid transparent;border-radius:50%;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon::before{display:flex;align-items:center;height:92%;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning::before{content:"!"}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info::before{content:"i"}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question::before{content:"?"}.swal2-icon.swal2-question.swal2-arabic-question-mark::before{content:"؟"}.swal2-icon.swal2-success{border-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:3.75em 3.75em;transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:0 3.75em;transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.875em;width:1.5625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-show.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-hide.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-animate-success-icon .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-animate-error-icon{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-animate-error-icon .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}@-webkit-keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@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}}')},Qiut:function(t,e,n){},Qo9l:function(t,e,n){t.exports=n("2oRo")},Qwlt:function(t,e,n){var i,o,s;o=[n("EVdn")],void 0===(s="function"==typeof(i=function(t){return t.ui=t.ui||{},t.ui.version="1.12.1"})?i.apply(e,o):i)||(t.exports=s)},R5XZ:function(t,e,n){var i=n("I+eb"),o=n("2oRo"),s=n("s5pE"),r=[].slice,a=function(t){return function(e,n){var i=arguments.length>2,o=!!i&&r.call(arguments,2);return t(i?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};i({global:!0,bind:!0,forced:/MSIE .\./.test(s)},{setTimeout:a(o.setTimeout),setInterval:a(o.setInterval)})},RK3t:function(t,e,n){var i=n("0Dky"),o=n("xrYK"),s="".split;t.exports=i(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==o(t)?s.call(t,""):Object(t)}:Object},RNIs:function(t,e,n){var i=n("tiKp"),o=n("fHMY"),s=n("X2U+"),r=i("unscopables"),a=Array.prototype;null==a[r]&&s(a,r,o(null)),t.exports=function(t){a[r][t]=!0}},ROdP:function(t,e,n){var i=n("hh1v"),o=n("xrYK"),s=n("tiKp")("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[s])?!!e:"RegExp"==o(t))}},SEBh:function(t,e,n){var i=n("glrk"),o=n("HAuM"),s=n("tiKp")("species");t.exports=function(t,e){var n,r=i(t).constructor;return void 0===r||null==(n=i(r)[s])?e:o(n)}},STAE:function(t,e,n){var i=n("0Dky");t.exports=!!Object.getOwnPropertySymbols&&!i(function(){return!String(Symbol())})},TWQb:function(t,e,n){var i=n("/GqU"),o=n("UMSQ"),s=n("I8vh");t.exports=function(t){return function(e,n,r){var a,l=i(e),c=o(l.length),u=s(r,c);if(t&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}}},TX00:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return d});n("pNMO"),n("4Brf"),n("0oug"),n("yq1k"),n("4mDm"),n("oVuX"),n("uL8W"),n("eoL8"),n("NBAS"),n("ExoC"),n("07d7"),n("rB9j"),n("JTJg"),n("PKPk"),n("EnZy"),n("3bBZ");var i=n("EVdn"),o=n.n(i),s=n("dQ1+");function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n0?o(i(t),9007199254740991):0}},UTVS:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},UxlC:function(t,e,n){"use strict";var i=n("14Sl"),o=n("glrk"),s=n("ewvW"),r=n("UMSQ"),a=n("ppGB"),l=n("HYAF"),c=n("iqWW"),u=n("FMNM"),d=Math.max,h=Math.min,f=Math.floor,p=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g;i("replace",2,function(t,e,n){return[function(n,i){var o=l(this),s=null==n?void 0:n[t];return void 0!==s?s.call(n,o,i):e.call(String(o),n,i)},function(t,s){var l=n(e,t,this,s);if(l.done)return l.value;var f=o(t),p=String(this),m="function"==typeof s;m||(s=String(s));var g=f.global;if(g){var v=f.unicode;f.lastIndex=0}for(var b=[];;){var y=u(f,p);if(null===y)break;if(b.push(y),!g)break;""===String(y[0])&&(f.lastIndex=c(p,r(f.lastIndex),v))}for(var w,k="",x=0,_=0;_=x&&(k+=p.slice(x,S)+L,x=S+C.length)}return k+p.slice(x)}];function i(t,n,i,o,r,a){var l=i+t.length,c=o.length,u=m;return void 0!==r&&(r=s(r),u=p),e.call(a,u,function(e,s){var a;switch(s.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,i);case"'":return n.slice(l);case"<":a=r[s.slice(1,-1)];break;default:var u=+s;if(0===u)return e;if(u>c){var d=f(u/10);return 0===d?e:d<=c?void 0===o[d-1]?s.charAt(1):o[d-1]+s.charAt(1):e}a=o[u-1]}return void 0===a?"":a})}})},"VSY+":function(t,e,n){(function(t){if(void 0===t)throw new Error("Bootstrap's JavaScript requires jQuery");!function(e){"use strict";var n=t.fn.jquery.split(" ")[0].split(".");if(n[0]<2&&n[1]<9||1==n[0]&&9==n[1]&&n[2]<1||n[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,i=this;t(this).one("bsTransitionEnd",function(){n=!0});return setTimeout(function(){n||t(i).trigger(t.support.transition.end)},e),this},t(function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(t),function(t){"use strict";var e='[data-dismiss="alert"]',n=function(n){t(n).on("click",e,this.close)};n.VERSION="3.4.1",n.TRANSITION_DURATION=150,n.prototype.close=function(e){var i=t(this),o=i.attr("data-target");o||(o=(o=i.attr("href"))&&o.replace(/.*(?=#[^\s]*$)/,"")),o="#"===o?[]:o;var s=t(document).find(o);function r(){s.detach().trigger("closed.bs.alert").remove()}e&&e.preventDefault(),s.length||(s=i.closest(".alert")),s.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",r).emulateTransitionEnd(n.TRANSITION_DURATION):r())};var i=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var i=t(this),o=i.data("bs.alert");o||i.data("bs.alert",o=new n(this)),"string"==typeof e&&o[e].call(i)})},t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=i,this},t(document).on("click.bs.alert.data-api",e,n.prototype.close)}(t),function(t){"use strict";var e=function(n,i){this.$element=t(n),this.options=t.extend({},e.DEFAULTS,i),this.isLoading=!1};function n(n){return this.each(function(){var i=t(this),o=i.data("bs.button"),s="object"==typeof n&&n;o||i.data("bs.button",o=new e(this,s)),"toggle"==n?o.toggle():n&&o.setState(n)})}e.VERSION="3.4.1",e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var n="disabled",i=this.$element,o=i.is("input")?"val":"html",s=i.data();e+="Text",null==s.resetText&&i.data("resetText",i[o]()),setTimeout(t.proxy(function(){i[o](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,i.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(n).removeAttr(n).prop(n,!1))},this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=n,t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(e){var i=t(e.target).closest(".btn");n.call(i,"toggle"),t(e.target).is('input[type="radio"], input[type="checkbox"]')||(e.preventDefault(),i.is("input,button")?i.trigger("focus"):i.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(t),function(t){"use strict";var e=function(e,n){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};function n(n){return this.each(function(){var i=t(this),o=i.data("bs.carousel"),s=t.extend({},e.DEFAULTS,i.data(),"object"==typeof n&&n),r="string"==typeof n?n:s.slide;o||i.data("bs.carousel",o=new e(this,s)),"number"==typeof n?o.to(n):r?o[r]():s.interval&&o.pause().cycle()})}e.VERSION="3.4.1",e.TRANSITION_DURATION=600,e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},e.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},e.prototype.getItemForDirection=function(t,e){var n=this.getItemIndex(e);if(("prev"==t&&0===n||"next"==t&&n==this.$items.length-1)&&!this.options.wrap)return e;var i=(n+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(i)},e.prototype.to=function(t){var e=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",this.$items.eq(t))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){if(!this.sliding)return this.slide("next")},e.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},e.prototype.slide=function(n,i){var o=this.$element.find(".item.active"),s=i||this.getItemForDirection(n,o),r=this.interval,a="next"==n?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],u=t.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(u),!u.isDefaultPrevented()){if(this.sliding=!0,r&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=t(this.$indicators.children()[this.getItemIndex(s)]);d&&d.addClass("active")}var h=t.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(n),"object"==typeof s&&s.length&&s[0].offsetWidth,o.addClass(a),s.addClass(a),o.one("bsTransitionEnd",function(){s.removeClass([n,a].join(" ")).addClass("active"),o.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(e.TRANSITION_DURATION)):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(h)),r&&this.cycle(),this}};var i=t.fn.carousel;t.fn.carousel=n,t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=i,this};var o=function(e){var i=t(this),o=i.attr("href");o&&(o=o.replace(/.*(?=#[^\s]+$)/,""));var s=i.attr("data-target")||o,r=t(document).find(s);if(r.hasClass("carousel")){var a=t.extend({},r.data(),i.data()),l=i.attr("data-slide-to");l&&(a.interval=!1),n.call(r,a),l&&r.data("bs.carousel").to(l),e.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",o).on("click.bs.carousel.data-api","[data-slide-to]",o),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);n.call(e,e.data())})})}(t),function(t){"use strict";var e=function(n,i){this.$element=t(n),this.options=t.extend({},e.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+n.id+'"],[data-toggle="collapse"][data-target="#'+n.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(e){var n,i=e.attr("data-target")||(n=e.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return t(document).find(i)}function i(n){return this.each(function(){var i=t(this),o=i.data("bs.collapse"),s=t.extend({},e.DEFAULTS,i.data(),"object"==typeof n&&n);!o&&s.toggle&&/show|hide/.test(n)&&(s.toggle=!1),o||i.data("bs.collapse",o=new e(this,s)),"string"==typeof n&&o[n]()})}e.VERSION="3.4.1",e.TRANSITION_DURATION=350,e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n,o=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(o&&o.length&&(n=o.data("bs.collapse"))&&n.transitioning)){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){o&&o.length&&(i.call(o,"hide"),n||o.data("bs.collapse",null));var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var l=t.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(e.TRANSITION_DURATION)[r](this.$element[0][l])}}}},e.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var n=t.Event("hide.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return o.call(this);this.$element[i](0).one("bsTransitionEnd",t.proxy(o,this)).emulateTransitionEnd(e.TRANSITION_DURATION)}}},e.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},e.prototype.getParent=function(){return t(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(e,i){var o=t(i);this.addAriaAndCollapsedClass(n(o),o)},this)).end()},e.prototype.addAriaAndCollapsedClass=function(t,e){var n=t.hasClass("in");t.attr("aria-expanded",n),e.toggleClass("collapsed",!n).attr("aria-expanded",n)};var o=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=e,t.fn.collapse.noConflict=function(){return t.fn.collapse=o,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(e){var o=t(this);o.attr("data-target")||e.preventDefault();var s=n(o),r=s.data("bs.collapse")?"toggle":o.data();i.call(s,r)})}(t),function(t){"use strict";var e=".dropdown-backdrop",n='[data-toggle="dropdown"]',i=function(e){t(e).on("click.bs.dropdown",this.toggle)};function o(e){var n=e.attr("data-target");n||(n=(n=e.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==n?t(document).find(n):null;return i&&i.length?i:e.parent()}function s(i){i&&3===i.which||(t(e).remove(),t(n).each(function(){var e=t(this),n=o(e),s={relatedTarget:this};n.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target)||(n.trigger(i=t.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(e.attr("aria-expanded","false"),n.removeClass("open").trigger(t.Event("hidden.bs.dropdown",s)))))}))}i.VERSION="3.4.1",i.prototype.toggle=function(e){var n=t(this);if(!n.is(".disabled, :disabled")){var i=o(n),r=i.hasClass("open");if(s(),!r){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s);var a={relatedTarget:this};if(i.trigger(e=t.Event("show.bs.dropdown",a)),e.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(t.Event("shown.bs.dropdown",a))}return!1}},i.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var i=t(this);if(e.preventDefault(),e.stopPropagation(),!i.is(".disabled, :disabled")){var s=o(i),r=s.hasClass("open");if(!r&&27!=e.which||r&&27==e.which)return 27==e.which&&s.find(n).trigger("focus"),i.trigger("click");var a=s.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var l=a.index(e.target);38==e.which&&l>0&&l--,40==e.which&&ldocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},e.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},e.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth
      ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:i},l.prototype.init=function(e,n,i){if(this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),s=o.length;s--;){var r=o[s];if("click"==r)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",l="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},l.prototype.getDefaults=function(){return l.DEFAULTS},l.prototype.getOptions=function(n){var i=this.$element.data();for(var o in i)i.hasOwnProperty(o)&&-1!==t.inArray(o,e)&&delete i[o];return(n=t.extend({},this.getDefaults(),i,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=a(n.template,n.whiteList,n.sanitizeFn)),n},l.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,function(t,i){n[t]!=i&&(e[t]=i)}),e},l.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusin"==e.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)}},l.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},l.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusout"==e.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)}},l.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var i=this,o=this.tip(),s=this.getUID(this.type);this.setContent(),o.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&o.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,c=a.test(r);c&&(r=r.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?o.appendTo(t(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=o[0].offsetWidth,h=o[0].offsetHeight;if(c){var f=r,p=this.getPosition(this.$viewport);r="bottom"==r&&u.bottom+h>p.bottom?"top":"top"==r&&u.top-hp.width?"left":"left"==r&&u.left-dr.top+r.height&&(o.top=r.top+r.height-l)}else{var c=e.left-s,u=e.left+s+n;cr.right&&(o.left=r.left+r.width-u)}return o},l.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},l.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},l.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},l.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},l.prototype.enable=function(){this.enabled=!0},l.prototype.disable=function(){this.enabled=!1},l.prototype.toggleEnabled=function(){this.enabled=!this.enabled},l.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),e?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},l.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},l.prototype.sanitizeHtml=function(t){return a(t,this.options.whiteList,this.options.sanitizeFn)};var c=t.fn.tooltip;t.fn.tooltip=function(e){return this.each(function(){var n=t(this),i=n.data("bs.tooltip"),o="object"==typeof e&&e;!i&&/destroy|hide/.test(e)||(i||n.data("bs.tooltip",i=new l(this,o)),"string"==typeof e&&i[e]())})},t.fn.tooltip.Constructor=l,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=c,this}}(t),function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.VERSION="3.4.1",e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),n=this.getContent();if(this.options.html){var i=typeof n;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===i&&(n=this.sanitizeHtml(n))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===i?"html":"append"](n)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(n);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var n=t.fn.popover;t.fn.popover=function(n){return this.each(function(){var i=t(this),o=i.data("bs.popover"),s="object"==typeof n&&n;!o&&/destroy|hide/.test(n)||(o||i.data("bs.popover",o=new e(this,s)),"string"==typeof n&&o[n]())})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=n,this}}(t),function(t){"use strict";function e(n,i){this.$body=t(document.body),this.$scrollElement=t(n).is(document.body)?t(window):t(n),this.options=t.extend({},e.DEFAULTS,i),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each(function(){var i=t(this),o=i.data("bs.scrollspy"),s="object"==typeof n&&n;o||i.data("bs.scrollspy",o=new e(this,s)),"string"==typeof n&&o[n]()})}e.VERSION="3.4.1",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,n="offset",i=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(n="position",i=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),o=e.data("target")||e.attr("href"),s=/^#./.test(o)&&t(o);return s&&s.length&&s.is(":visible")&&[[s[n]().top+i,o]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),o=this.offsets,s=this.targets,r=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),e>=i)return r!=(t=s[s.length-1])&&this.activate(t);if(r&&e=o[t]&&(void 0===o[t+1]||e .active"),r=o&&t.support.transition&&(s.length&&s.hasClass("fade")||!!i.find("> .fade").length);function a(){s.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),n.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(n[0].offsetWidth,n.addClass("in")):n.removeClass("fade"),n.parent(".dropdown-menu").length&&n.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),o&&o()}s.length&&r?s.one("bsTransitionEnd",a).emulateTransitionEnd(e.TRANSITION_DURATION):a(),s.removeClass("in")};var i=t.fn.tab;t.fn.tab=n,t.fn.tab.Constructor=e,t.fn.tab.noConflict=function(){return t.fn.tab=i,this};var o=function(e){e.preventDefault(),n.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',o).on("click.bs.tab.data-api",'[data-toggle="pill"]',o)}(t),function(t){"use strict";var e=function(n,i){this.options=t.extend({},e.DEFAULTS,i);var o=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=o.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each(function(){var i=t(this),o=i.data("bs.affix"),s="object"==typeof n&&n;o||i.data("bs.affix",o=new e(this,s)),"string"==typeof n&&o[n]()})}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,n,i){var o=this.$target.scrollTop(),s=this.$element.offset(),r=this.$target.height();if(null!=n&&"top"==this.affixed)return o=t-i&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),i=this.options.offset,o=i.top,s=i.bottom,r=Math.max(t(document).height(),t(document.body).height());"object"!=typeof i&&(s=o=i),"function"==typeof o&&(o=i.top(this.$element)),"function"==typeof s&&(s=i.bottom(this.$element));var a=this.getState(r,n,o,s);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:r-n-s})}};var i=t.fn.affix;t.fn.affix=n,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=i,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var e=t(this),i=e.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),n.call(e,i)})})}(t)}).call(this,n("EVdn"))},VpIT:function(t,e,n){var i=n("2oRo"),o=n("zk60"),s=n("xDBR"),r=i["__core-js_shared__"]||o("__core-js_shared__",{});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.1.3",mode:s?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},Vu81:function(t,e,n){var i=n("2oRo"),o=n("JBy8"),s=n("dBg+"),r=n("glrk"),a=i.Reflect;t.exports=a&&a.ownKeys||function(t){var e=o.f(r(t)),n=s.f;return n?e.concat(n(t)):e}},WJkJ:function(t,e){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},WKiH:function(t,e,n){var i=n("HYAF"),o="["+n("WJkJ")+"]",s=RegExp("^"+o+o+"*"),r=RegExp(o+o+"*$");t.exports=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(r,"")),t}},WxRl:function(t,e,n){!function(t){"use strict";var e="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(t,e,n,i){var o=t;switch(n){case"s":return i||e?"néhány másodperc":"néhány másodperce";case"ss":return o+(i||e)?" másodperc":" másodperce";case"m":return"egy"+(i||e?" perc":" perce");case"mm":return o+(i||e?" perc":" perce");case"h":return"egy"+(i||e?" óra":" órája");case"hh":return o+(i||e?" óra":" órája");case"d":return"egy"+(i||e?" nap":" napja");case"dd":return o+(i||e?" nap":" napja");case"M":return"egy"+(i||e?" hónap":" hónapja");case"MM":return o+(i||e?" hónap":" hónapja");case"y":return"egy"+(i||e?" év":" éve");case"yy":return o+(i||e?" év":" éve")}return""}function i(t){return(t?"":"[múlt] ")+"["+e[this.day()]+"] LT[-kor]"}t.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(t){return"u"===t.charAt(1).toLowerCase()},meridiem:function(t,e,n){return t<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return i.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return i.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},WySY:function(t,e,n){},"X2U+":function(t,e,n){var i=n("g6v/"),o=n("m/L8"),s=n("XGwC");t.exports=i?function(t,e,n){return o.f(t,e,s(1,n))}:function(t,e,n){return t[e]=n,t}},X709:function(t,e,n){!function(t){"use strict";t.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(e|a)/,ordinal:function(t){var e=t%10,n=1==~~(t%100/10)?"e":1===e?"a":2===e?"a":"e";return t+n},week:{dow:1,doy:4}})}(n("wd/R"))},XGwC:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},ZfDv:function(t,e,n){var i=n("hh1v"),o=n("6LWA"),s=n("tiKp")("species");t.exports=function(t,e){var n;return o(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!o(n.prototype)?i(n)&&null===(n=n[s])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},afO8:function(t,e,n){var i,o,s,r=n("f5p1"),a=n("2oRo"),l=n("hh1v"),c=n("X2U+"),u=n("UTVS"),d=n("93I0"),h=n("0BK2"),f=a.WeakMap;if(r){var p=new f,m=p.get,g=p.has,v=p.set;i=function(t,e){return v.call(p,t,e),e},o=function(t){return m.call(p,t)||{}},s=function(t){return g.call(p,t)}}else{var b=d("state");h[b]=!0,i=function(t,e){return c(t,b,e),e},o=function(t){return u(t,b)?t[b]:{}},s=function(t){return u(t,b)}}t.exports={set:i,get:o,has:s,enforce:function(t){return s(t)?o(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},bpih:function(t,e,n){!function(t){"use strict";t.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(t){return(/^[0-9].+$/.test(t)?"tra":"in")+" "+t},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("wd/R"))},busE:function(t,e,n){var i=n("2oRo"),o=n("VpIT"),s=n("X2U+"),r=n("UTVS"),a=n("zk60"),l=n("noGo"),c=n("afO8"),u=c.get,d=c.enforce,h=String(l).split("toString");o("inspectSource",function(t){return l.call(t)}),(t.exports=function(t,e,n,o){var l=!!o&&!!o.unsafe,c=!!o&&!!o.enumerable,u=!!o&&!!o.noTargetGet;"function"==typeof n&&("string"!=typeof e||r(n,"name")||s(n,"name",e),d(n).source=h.join("string"==typeof e?e:"")),t!==i?(l?!u&&t[e]&&(c=!0):delete t[e],c?t[e]=n:s(t,e,n)):c?t[e]=n:a(e,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&u(this).source||l.call(this)})},"dBg+":function(t,e){e.f=Object.getOwnPropertySymbols},"dG/n":function(t,e,n){var i=n("Qo9l"),o=n("UTVS"),s=n("wDLo"),r=n("m/L8").f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});o(e,t)||r(e,t,{value:s.f(t)})}},"dQ1+":function(t,e,n){"use strict";n.d(e,"a",function(){return s});n("eoL8");var i=n("C9gY");function o(t,e){for(var n=0;n
      ');var n=b()(".toolbar form :input").filter(function(t,e){return""!=b()(e).val()}).serialize();b.a.ajax({url:e.attr("action"),type:e.attr("method"),data:n,success:function(e){b()("section.content").replaceWith(b()(e).find("section.content")),t.updateRecords()},error:function(t,n){e.submit()}})}}])&&U(n.prototype,i),o&&U(n,o),e}();function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function X(t,e){for(var n=0;n0&&(n=!1);break;case"project":b()(".toolbar form select#activity").length>0&&(n=!1)}b()(".toolbar form input#page").val(1),n&&t.reloadDatatable()})}}])&&X(n.prototype,i),o&&X(n,o),e}();function et(t){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nt(t,e){for(var n=0;n'+i.text()+""),b.a.each(e,function(t,e){n.append('")}),n.trigger("change"),b()(".selectpicker").selectpicker("refresh")}}])&<(n.prototype,i),o&<(n,o),e}();function ft(t){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pt(t,e){for(var n=0;n0&&(o.on("hidden.bs.modal",function(){o.hasClass("modal-danger")&&o.removeClass("modal-danger")}),b()(t).find("#form_modal").hasClass("modal-danger")&&o.addClass("modal-danger"),b()("#remote_form_modal .modal-content").replaceWith(b()(t).find("#form_modal .modal-content")),e.getContainer().getPlugin("date-time-picker").activateDateTimePicker(n),e.getContainer().getPlugin("autocomplete").activateAutocomplete(n+" .js-autocomplete"),b()(".selectpicker").selectpicker("refresh"));var s=b()(t).find("div.alert");s.length>0&&b()("#remote_form_modal .modal-body").prepend(s);var r=b.a.fn.modal.Constructor.prototype.enforceFocus;b.a.fn.modal.Constructor.prototype.enforceFocus=function(){},o.on("hidden.bs.modal",function(){b.a.fn.modal.Constructor.prototype.enforceFocus=r}),o.on("shown.bs.modal",function(){b()(this).find("input[type=text],textarea,select").filter(':not("[data-datetimepicker=on]")').filter(":visible:first").focus().delay(1e3).focus()}),o.modal("show"),(i=b()(n)).on("submit",function(t){var s=b()(n+" button[type=submit]").button("loading"),r=i.attr("data-form-event"),a=e.getContainer().getPlugin("event"),l=e.getContainer().getPlugin("alert");t.preventDefault(),t.stopPropagation(),b.a.ajax({url:i.attr("action"),type:i.attr("method"),data:i.serialize(),success:function(t){s.button("reset");var n=b()(t).find("#form_modal .modal-content .has-error").length>0,c=b()(t).find("#form_modal .modal-content ul.list-unstyled li.text-danger").length>0,u=b()(t).find("div.alert-error").length>0;if(n||c||u)e._openFormInModal(t);else{a.trigger(r);var d=i.attr("data-msg-success");if(null==d){var h=b()(t).find("section.content div.row div.alert.alert-success");if(h.length>0){var f=h.contents();3===f.length&&(d=f[2].textContent)}}null==d&&(d="action.update.success"),o.modal("hide"),l.success(d)}return!1},error:function(t,e){var n=i.attr("data-msg-error");null==n&&(n="action.update.error"),t.responseJSON&&t.responseJSON.message?e=t.responseJSON.message:t.status&&t.statusText&&(e="["+t.status+"] "+t.statusText),l.error(n,e)}})})}}])&&It(n.prototype,i),o&&It(n,o),e}();n("ma9I");function Yt(t){return(Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rt(t,e){for(var n=0;n ul.menu"),this.label=t.querySelector("a > span.label");var n=this,i=function(){n.reloadActiveRecords()};document.addEventListener("kimai.timesheetUpdate",i),document.addEventListener("kimai.activityUpdate",i),document.addEventListener("kimai.projectUpdate",i),document.addEventListener("kimai.customerUpdate",i)}}},{key:"emptyList",value:function(){this.itemList.innerHTML=""}},{key:"_toggleMenu",value:function(t){var e=document.querySelector(this.selector),n=document.querySelector(this.selectorEmpty);e.style.display=t?"inline-block":"none",null!==n&&(n.style.display=t?"none":"inline-block")}},{key:"setEntries",value:function(t){if(this._toggleMenu(t.length>0),0===t.length)return this.label.innerText="",void this.emptyList();var e="",n=this.getContainer().getPlugin("timesheet-duration"),i=!0,o=!1,s=void 0;try{for(var r,a=t[Symbol.iterator]();!(i=(r=a.next()).done);i=!0){var l=r.value;e+="
    • "+'')+'
      '+'')+"

      "+"".concat(l.activity.name,"")+""+'').concat(n.formatDuration(l.duration,this.attributes.format),"")+"

      "+"

      ".concat(l.project.name," (").concat(l.project.customer.name,")

      ")+"
    • "}}catch(t){o=!0,s=t}finally{try{i||null==a.return||a.return()}finally{if(o)throw s}}this.label.dataset.warning ul.menu");var n=this,i=function(){n.reloadRecentActivities()};setTimeout(i,500),document.addEventListener("kimai.timesheetStop",i),document.addEventListener("kimai.activityUpdate",i),document.addEventListener("kimai.projectUpdate",i),document.addEventListener("kimai.customerUpdate",i)}}},{key:"emptyList",value:function(){this.itemList.innerHTML=""}},{key:"setEntries",value:function(t){if(0!==t.length){var e="",n=!0,i=!1,o=void 0;try{for(var s,r=t[Symbol.iterator]();!(n=(s=r.next()).done);n=!0){var a=s.value,l=this.attributes.template.replace("%customer%",a.project.customer.name).replace("%project%",a.project.name).replace("%activity%",a.activity.name);e+="
    • "+'')+' ').concat(l)+"
    • "}}catch(t){i=!0,o=t}finally{try{n||null==r.return||r.return()}finally{if(i)throw o}}this.itemList.innerHTML=e}else this.emptyList()}},{key:"reloadRecentActivities",value:function(){var t=this;this.getContainer().getPlugin("api").get(this.attributes.api,{},function(e){t.setEntries(e)})}}])&&Ut(n.prototype,i),o&&Ut(n,o),e}();function Gt(t){return(Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xt(t,e){for(var n=0;n0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),a--;var l,c,u;if(void 0===i.startDate&&void 0===i.endDate&&e(this.element).is(":text")){var d=e(this.element).val(),h=d.split(this.locale.separator);l=c=null,2==h.length?(l=t(h[0],this.locale.format),c=t(h[1],this.locale.format)):this.singleDatePicker&&""!==d&&(l=t(d,this.locale.format),c=t(d,this.locale.format)),null!==l&&null!==c&&(this.setStartDate(l),this.setEndDate(c))}if("object"==typeof i.ranges){for(u in i.ranges){l="string"==typeof i.ranges[u][0]?t(i.ranges[u][0],this.locale.format):t(i.ranges[u][0]),c="string"==typeof i.ranges[u][1]?t(i.ranges[u][1],this.locale.format):t(i.ranges[u][1]),this.minDate&&l.isBefore(this.minDate)&&(l=this.minDate.clone());var f=this.maxDate;if(this.maxSpan&&f&&l.clone().add(this.maxSpan).isAfter(f)&&(f=l.clone().add(this.maxSpan)),f&&c.isAfter(f)&&(c=f.clone()),!(this.minDate&&c.isBefore(this.minDate,this.timepicker?"minute":"day")||f&&l.isAfter(f,this.timepicker?"minute":"day"))){var s=document.createElement("textarea");s.innerHTML=u;var r=s.value;this.ranges[r]=[l,c]}}var p="
        ";for(u in this.ranges)p+='
      • '+u+"
      • ";this.showCustomRangeLabel&&(p+='
      • '+this.locale.customRangeLabel+"
      • "),p+="
      ",this.container.find(".ranges").prepend(p)}"function"==typeof o&&(this.callback=o),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide()),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&this.container.addClass("auto-apply"),"object"==typeof i.ranges&&this.container.addClass("show-ranges"),this.singleDatePicker&&(this.container.addClass("single"),this.container.find(".drp-calendar.left").addClass("single"),this.container.find(".drp-calendar.left").show(),this.container.find(".drp-calendar.right").hide(),this.timePicker||this.container.addClass("auto-apply")),(void 0===i.ranges&&!this.singleDatePicker||this.alwaysShowCalendars)&&this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyButtonClasses.length&&this.container.find(".applyBtn").addClass(this.applyButtonClasses),this.cancelButtonClasses.length&&this.container.find(".cancelBtn").addClass(this.cancelButtonClasses),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".drp-calendar").on("click.daterangepicker",".prev",e.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",e.proxy(this.clickNext,this)).on("mousedown.daterangepicker","td.available",e.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",e.proxy(this.hoverDate,this)).on("change.daterangepicker","select.yearselect",e.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",e.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",e.proxy(this.timeChanged,this)),this.container.find(".ranges").on("click.daterangepicker","li",e.proxy(this.clickRange,this)),this.container.find(".drp-buttons").on("click.daterangepicker","button.applyBtn",e.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",e.proxy(this.clickCancel,this)),this.element.is("input")||this.element.is("button")?this.element.on({"click.daterangepicker":e.proxy(this.show,this),"focus.daterangepicker":e.proxy(this.show,this),"keyup.daterangepicker":e.proxy(this.elementChanged,this),"keydown.daterangepicker":e.proxy(this.keydown,this)}):(this.element.on("click.daterangepicker",e.proxy(this.toggle,this)),this.element.on("keydown.daterangepicker",e.proxy(this.toggle,this))),this.updateElement()};return n.prototype={constructor:n,setStartDate:function(e){"string"==typeof e&&(this.startDate=t(e,this.locale.format)),"object"==typeof e&&(this.startDate=t(e)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.floor(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.isShowing||this.updateElement(),this.updateMonthsInView()},setEndDate:function(e){"string"==typeof e&&(this.endDate=t(e,this.locale.format)),"object"==typeof e&&(this.endDate=t(e)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),this.maxSpan&&this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.maxSpan)),this.previousRightTime=this.endDate.clone(),this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.isShowing||this.updateElement(),this.updateMonthsInView()},isInvalidDate:function(){return!1},isCustomDate:function(){return!1},updateView:function(){this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").removeAttr("disabled").removeClass("disabled"):this.container.find(".right .calendar-time select").attr("disabled","disabled").addClass("disabled")),this.endDate&&this.container.find(".drp-selected").html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.updateMonthsInView(),this.updateCalendars(),this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.startDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM"))&&(this.endDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.endDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM")))return;this.leftCalendar.month=this.startDate.clone().date(2),this.linkedCalendars||this.endDate.month()==this.startDate.month()&&this.endDate.year()==this.startDate.year()?this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"):this.rightCalendar.month=this.endDate.clone().date(2)}else this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"));this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&this.rightCalendar.month>this.maxDate&&(this.rightCalendar.month=this.maxDate.clone().date(2),this.leftCalendar.month=this.maxDate.clone().date(2).subtract(1,"month"))},updateCalendars:function(){var t,e,n,i;this.timePicker&&(this.endDate?(t=parseInt(this.container.find(".left .hourselect").val(),10),e=parseInt(this.container.find(".left .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".left .minuteselect option:last").val(),10)),n=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,this.timePicker24Hour||("PM"===(i=this.container.find(".left .ampmselect").val())&&t<12&&(t+=12),"AM"===i&&12===t&&(t=0))):(t=parseInt(this.container.find(".right .hourselect").val(),10),e=parseInt(this.container.find(".right .minuteselect").val(),10),isNaN(e)&&(e=parseInt(this.container.find(".right .minuteselect option:last").val(),10)),n=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,this.timePicker24Hour||("PM"===(i=this.container.find(".right .ampmselect").val())&&t<12&&(t+=12),"AM"===i&&12===t&&(t=0))),this.leftCalendar.month.hour(t).minute(e).second(n),this.rightCalendar.month.hour(t).minute(e).second(n)),this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),null!=this.endDate&&this.calculateChosenLabel()},renderCalendar:function(n){var i,o=(i="left"==n?this.leftCalendar:this.rightCalendar).month.month(),s=i.month.year(),r=i.month.hour(),a=i.month.minute(),l=i.month.second(),c=t([s,o]).daysInMonth(),u=t([s,o,1]),d=t([s,o,c]),h=t(u).subtract(1,"month").month(),f=t(u).subtract(1,"month").year(),p=t([f,h]).daysInMonth(),m=u.day();(i=[]).firstDay=u,i.lastDay=d;for(var g=0;g<6;g++)i[g]=[];var v=p-m+this.locale.firstDay+1;v>p&&(v-=7),m==this.locale.firstDay&&(v=p-6);for(var b=t([f,h,v,12,a,l]),y=(g=0,0),w=0;g<42;g++,y++,b=t(b).add(24,"hour"))g>0&&y%7==0&&(y=0,w++),i[w][y]=b.clone().hour(r).minute(a).second(l),b.hour(12),this.minDate&&i[w][y].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&i[w][y].isBefore(this.minDate)&&"left"==n&&(i[w][y]=this.minDate.clone()),this.maxDate&&i[w][y].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&i[w][y].isAfter(this.maxDate)&&"right"==n&&(i[w][y]=this.maxDate.clone());"left"==n?this.leftCalendar.calendar=i:this.rightCalendar.calendar=i;var k="left"==n?this.minDate:this.startDate,x=this.maxDate,_=("left"==n?this.startDate:this.endDate,this.locale.direction,'');_+="",_+="",(this.showWeekNumbers||this.showISOWeekNumbers)&&(_+=""),k&&!k.isBefore(i.firstDay)||this.linkedCalendars&&"left"!=n?_+="":_+='';var C=this.locale.monthNames[i[1][1].month()]+i[1][1].format(" YYYY");if(this.showDropdowns){for(var S=i[1][1].month(),D=i[1][1].year(),O=x&&x.year()||this.maxYear,T=k&&k.year()||this.minYear,E=D==T,L=D==O,P='";for(var M='")}if(_+='",x&&!x.isAfter(i.lastDay)||this.linkedCalendars&&"right"!=n&&!this.singleDatePicker?_+="":_+='',_+="",_+="",(this.showWeekNumbers||this.showISOWeekNumbers)&&(_+='"),e.each(this.locale.daysOfWeek,function(t,e){_+=""}),_+="",_+="",_+="",null==this.endDate&&this.maxSpan){var j=this.startDate.clone().add(this.maxSpan).endOf("day");x&&!j.isBefore(x)||(x=j)}for(w=0;w<6;w++){for(_+="",this.showWeekNumbers?_+='":this.showISOWeekNumbers&&(_+='"),y=0;y<7;y++){var $=[];i[w][y].isSame(new Date,"day")&&$.push("today"),i[w][y].isoWeekday()>5&&$.push("weekend"),i[w][y].month()!=i[1][1].month()&&$.push("off","ends"),this.minDate&&i[w][y].isBefore(this.minDate,"day")&&$.push("off","disabled"),x&&i[w][y].isAfter(x,"day")&&$.push("off","disabled"),this.isInvalidDate(i[w][y])&&$.push("off","disabled"),i[w][y].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&$.push("active","start-date"),null!=this.endDate&&i[w][y].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&$.push("active","end-date"),null!=this.endDate&&i[w][y]>this.startDate&&i[w][y]'+i[w][y].date()+""}_+=""}_+="",_+="
      '+C+"
      '+this.locale.weekLabel+""+e+"
      '+i[w][0].week()+"'+i[w][0].isoWeek()+"
      ",this.container.find(".drp-calendar."+n+" .calendar-table").html(_)},renderTimePicker:function(t){if("right"!=t||this.endDate){var e,n,i,o=this.maxDate;if(!this.maxSpan||this.maxDate&&!this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate)||(o=this.startDate.clone().add(this.maxSpan)),"left"==t)n=this.startDate.clone(),i=this.minDate;else if("right"==t){n=this.endDate.clone(),i=this.startDate;var s=this.container.find(".drp-calendar.right .calendar-time");if(""!=s.html()&&(n.hour(isNaN(n.hour())?s.find(".hourselect option:selected").val():n.hour()),n.minute(isNaN(n.minute())?s.find(".minuteselect option:selected").val():n.minute()),n.second(isNaN(n.second())?s.find(".secondselect option:selected").val():n.second()),!this.timePicker24Hour)){var r=s.find(".ampmselect option:selected").val();"PM"===r&&n.hour()<12&&n.hour(n.hour()+12),"AM"===r&&12===n.hour()&&n.hour(0)}n.isBefore(this.startDate)&&(n=this.startDate.clone()),o&&n.isAfter(o)&&(n=o.clone())}e=' ",e+=': ",this.timePickerSeconds){for(e+=': "}if(!this.timePicker24Hour){e+='"}this.container.find(".drp-calendar."+t+" .calendar-time").html(e)}},updateFormInputs:function(){this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").removeAttr("disabled"):this.container.find("button.applyBtn").attr("disabled","disabled")},move:function(){var t,n={top:0,left:0},i=e(window).width();this.parentEl.is("body")||(n={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},i=this.parentEl[0].clientWidth+this.parentEl.offset().left),t="up"==this.drops?this.element.offset().top-this.container.outerHeight()-n.top:this.element.offset().top+this.element.outerHeight()-n.top,this.container.css({top:0,left:0,right:"auto"});var o=this.container.outerWidth();if(this.container["up"==this.drops?"addClass":"removeClass"]("drop-up"),"left"==this.opens){var s=i-this.element.offset().left-this.element.outerWidth();o+s>e(window).width()?this.container.css({top:t,right:"auto",left:9}):this.container.css({top:t,right:s,left:"auto"})}else if("center"==this.opens)(r=this.element.offset().left-n.left+this.element.outerWidth()/2-o/2)<0?this.container.css({top:t,right:"auto",left:9}):r+o>e(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:r,right:"auto"});else{var r;(r=this.element.offset().left-n.left)+o>e(window).width()?this.container.css({top:t,left:"auto",right:0}):this.container.css({top:t,left:r,right:"auto"})}},show:function(t){this.isShowing||(this._outsideClickProxy=e.proxy(function(t){this.outsideClick(t)},this),e(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),e(window).on("resize.daterangepicker",e.proxy(function(t){this.move(t)},this)),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.previousRightTime=this.endDate.clone(),this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)},hide:function(t){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate.clone(),this.endDate.clone(),this.chosenLabel),this.updateElement(),e(document).off(".daterangepicker"),e(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1)},toggle:function(t){this.isShowing?this.hide():this.show()},outsideClick:function(t){var n=e(t.target);"focusin"==t.type||n.closest(this.element).length||n.closest(this.container).length||n.closest(".calendar-table").length||(this.hide(),this.element.trigger("outsideClick.daterangepicker",this))},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)},clickRange:function(t){var e=t.target.getAttribute("data-range-key");if(this.chosenLabel=e,e==this.locale.customRangeLabel)this.showCalendars();else{var n=this.ranges[e];this.startDate=n[0],this.endDate=n[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.alwaysShowCalendars||this.hideCalendars(),this.clickApply()}},clickPrev:function(t){e(t.target).parents(".drp-calendar").hasClass("left")?(this.leftCalendar.month.subtract(1,"month"),this.linkedCalendars&&this.rightCalendar.month.subtract(1,"month")):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(t){e(t.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.month.add(1,"month"):(this.rightCalendar.month.add(1,"month"),this.linkedCalendars&&this.leftCalendar.month.add(1,"month")),this.updateCalendars()},hoverDate:function(t){if(e(t.target).hasClass("available")){var n=e(t.target).attr("data-title"),i=n.substr(1,1),o=n.substr(3,1),s=e(t.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[i][o]:this.rightCalendar.calendar[i][o],r=this.leftCalendar,a=this.rightCalendar,l=this.startDate;this.endDate||this.container.find(".drp-calendar tbody td").each(function(t,n){if(!e(n).hasClass("week")){var i=e(n).attr("data-title"),o=i.substr(1,1),c=i.substr(3,1),u=e(n).parents(".drp-calendar").hasClass("left")?r.calendar[o][c]:a.calendar[o][c];u.isAfter(l)&&u.isBefore(s)||u.isSame(s,"day")?e(n).addClass("in-range"):e(n).removeClass("in-range")}})}},clickDate:function(t){if(e(t.target).hasClass("available")){var n=e(t.target).attr("data-title"),i=n.substr(1,1),o=n.substr(3,1),s=e(t.target).parents(".drp-calendar").hasClass("left")?this.leftCalendar.calendar[i][o]:this.rightCalendar.calendar[i][o];if(this.endDate||s.isBefore(this.startDate,"day")){if(this.timePicker){var r=parseInt(this.container.find(".left .hourselect").val(),10);this.timePicker24Hour||("PM"===(c=this.container.find(".left .ampmselect").val())&&r<12&&(r+=12),"AM"===c&&12===r&&(r=0));var a=parseInt(this.container.find(".left .minuteselect").val(),10);isNaN(a)&&(a=parseInt(this.container.find(".left .minuteselect option:last").val(),10));var l=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0;s=s.clone().hour(r).minute(a).second(l)}this.endDate=null,this.setStartDate(s.clone())}else if(!this.endDate&&s.isBefore(this.startDate))this.setEndDate(this.startDate.clone());else{var c;this.timePicker&&(r=parseInt(this.container.find(".right .hourselect").val(),10),this.timePicker24Hour||("PM"===(c=this.container.find(".right .ampmselect").val())&&r<12&&(r+=12),"AM"===c&&12===r&&(r=0)),a=parseInt(this.container.find(".right .minuteselect").val(),10),isNaN(a)&&(a=parseInt(this.container.find(".right .minuteselect option:last").val(),10)),l=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,s=s.clone().hour(r).minute(a).second(l)),this.setEndDate(s.clone()),this.autoApply&&(this.calculateChosenLabel(),this.clickApply())}this.singleDatePicker&&(this.setEndDate(this.startDate),this.timePicker||this.clickApply()),this.updateView(),t.stopPropagation()}},calculateChosenLabel:function(){var t=!0,e=0;for(var n in this.ranges){if(this.timePicker){var i=this.timePickerSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm";if(this.startDate.format(i)==this.ranges[n][0].format(i)&&this.endDate.format(i)==this.ranges[n][1].format(i)){t=!1,this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").attr("data-range-key");break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[n][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[n][1].format("YYYY-MM-DD")){t=!1,this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").attr("data-range-key");break}e++}t&&(this.showCustomRangeLabel?this.chosenLabel=this.container.find(".ranges li:last").addClass("active").attr("data-range-key"):this.chosenLabel=null,this.showCalendars())},clickApply:function(t){this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(t){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(t){var n=e(t.target).closest(".drp-calendar").hasClass("left"),i=n?"left":"right",o=this.container.find(".drp-calendar."+i),s=parseInt(o.find(".monthselect").val(),10),r=o.find(".yearselect").val();n||(rthis.maxDate.year()||r==this.maxDate.year()&&s>this.maxDate.month())&&(s=this.maxDate.month(),r=this.maxDate.year()),n?(this.leftCalendar.month.month(s).year(r),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.clone().add(1,"month"))):(this.rightCalendar.month.month(s).year(r),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,"month"))),this.updateCalendars()},timeChanged:function(t){var n=e(t.target).closest(".drp-calendar"),i=n.hasClass("left"),o=parseInt(n.find(".hourselect").val(),10),s=parseInt(n.find(".minuteselect").val(),10);isNaN(s)&&(s=parseInt(n.find(".minuteselect option:last").val(),10));var r=this.timePickerSeconds?parseInt(n.find(".secondselect").val(),10):0;if(!this.timePicker24Hour){var a=n.find(".ampmselect").val();"PM"===a&&o<12&&(o+=12),"AM"===a&&12===o&&(o=0)}if(i){var l=this.startDate.clone();l.hour(o),l.minute(s),l.second(r),this.setStartDate(l),this.singleDatePicker?this.endDate=this.startDate.clone():this.endDate&&this.endDate.format("YYYY-MM-DD")==l.format("YYYY-MM-DD")&&this.endDate.isBefore(l)&&this.setEndDate(l.clone())}else if(this.endDate){var c=this.endDate.clone();c.hour(o),c.minute(s),c.second(r),this.setEndDate(c)}this.updateCalendars(),this.updateFormInputs(),this.renderTimePicker("left"),this.renderTimePicker("right")},elementChanged:function(){if(this.element.is("input")&&this.element.val().length){var e=this.element.val().split(this.locale.separator),n=null,i=null;2===e.length&&(n=t(e[0],this.locale.format),i=t(e[1],this.locale.format)),(this.singleDatePicker||null===n||null===i)&&(i=n=t(this.element.val(),this.locale.format)),n.isValid()&&i.isValid()&&(this.setStartDate(n),this.setEndDate(i),this.updateView())}},keydown:function(t){9!==t.keyCode&&13!==t.keyCode||this.hide(),27===t.keyCode&&(t.preventDefault(),t.stopPropagation(),this.hide())},updateElement:function(){if(this.element.is("input")&&this.autoUpdateInput){var t=this.startDate.format(this.locale.format);this.singleDatePicker||(t+=this.locale.separator+this.endDate.format(this.locale.format)),t!==this.element.val()&&this.element.val(t).trigger("change")}},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}},e.fn.daterangepicker=function(t,i){var o=e.extend(!0,{},e.fn.daterangepicker.defaultOptions,t);return this.each(function(){var t=e(this);t.data("daterangepicker")&&t.data("daterangepicker").remove(),t.data("daterangepicker",new n(t,o,i))}),this},n}(t,e)}.apply(e,i))||(t.exports=o)},eoL8:function(t,e,n){var i=n("I+eb"),o=n("g6v/");i({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperty:n("m/L8").f})},ewvW:function(t,e,n){var i=n("HYAF");t.exports=function(t){return Object(i(t))}},f5p1:function(t,e,n){var i=n("2oRo"),o=n("noGo"),s=i.WeakMap;t.exports="function"==typeof s&&/native code/.test(o.call(s))},fHMY:function(t,e,n){var i=n("glrk"),o=n("N+g0"),s=n("eDl+"),r=n("0BK2"),a=n("G+Rx"),l=n("zBJ4"),c=n("93I0")("IE_PROTO"),u=function(){},d=function(){var t,e=l("iframe"),n=s.length;for(e.style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("
      diff --git a/templates/widget/section-simple.html.twig b/templates/widget/section-simple.html.twig new file mode 100644 index 00000000..342a969e --- /dev/null +++ b/templates/widget/section-simple.html.twig @@ -0,0 +1,20 @@ +{% import "macros/widgets.html.twig" as widgets %} + +{% if not title is empty %} + {{ widgets.page_header(title) }} +{% endif %} + +{% set width = widgets|length %} +{% set rawWidth = 12 / width %} +{% set columnWidth = rawWidth|round(0, 'floor') %} +
      + {% for widget in widgets %} + {% set columnSize = columnWidth %} + {% if width == 5 and (loop.first or loop.last) %} + {% set columnSize = columnWidth + 1 %} + {% endif %} +
      + {{ render_widget(widget) }} +
      + {% endfor %} +
      diff --git a/templates/widget/widget-counter.html.twig b/templates/widget/widget-counter.html.twig new file mode 100644 index 00000000..0443b4a3 --- /dev/null +++ b/templates/widget/widget-counter.html.twig @@ -0,0 +1,28 @@ +{% set url = null %} +{% if options.route is defined %} + {% set url = path(options.route, options.routeOptions|default([])) %} +{% endif %} + + diff --git a/templates/widget/widget-dailyworkingtimechart.html.twig b/templates/widget/widget-dailyworkingtimechart.html.twig new file mode 100644 index 00000000..bc306aed --- /dev/null +++ b/templates/widget/widget-dailyworkingtimechart.html.twig @@ -0,0 +1,95 @@ +{% set type = options.type|default('bar') %} +{% set chart_id = options.id %} +{% set backgroundColor = kimai_context.chart.background_color %} +{% set borderColor = kimai_context.chart.border_color %} +{% set gridColor = kimai_context.chart.grid_color %} +{% set colors = options.color|default('')|split(';') %} +{% if colors.0 is defined and not colors.0 is empty %} + {% set backgroundColor = colors.0 %} + {% set borderColor = colors.0 %} + {% if colors.1 is defined and not colors.1 is empty %} + {% set borderColor = colors.1 %} + {% endif %} +{% endif %} + +{{ encore_entry_link_tags('chart') }} +{{ encore_entry_script_tags('chart') }} + +{% if not title is empty %} +

      + + {{ title|trans }} + +

      +{% endif %} + +
      + +
      + + diff --git a/templates/widget/widget-more.html.twig b/templates/widget/widget-more.html.twig new file mode 100644 index 00000000..a69ca3be --- /dev/null +++ b/templates/widget/widget-more.html.twig @@ -0,0 +1,33 @@ +{% set url = null %} +{% if options.route is defined %} + {% set url = path(options.route, options.routeOptions|default([])) %} +{% endif %} + +
      +
      +

      + {% if data is iterable %} + {{ 'Invalid data' }} + {% else %} + {% block widget_data %} + {% if options.dataType == 'duration' %} + {% set data = data|duration %} + {% elseif options.dataType == 'money' %} + {% set data = data|money %} + {% endif %} + {{ data }} + {% endblock %} + {% endif %} + {{ unit|default('') }} +

      +

      {{ title|trans }}

      +
      +
      + +
      + {% if not url is empty %} + + {{ 'more.info.link'|trans }} + + {% endif %} +
      diff --git a/templates/widget/widget-yearchart.html.twig b/templates/widget/widget-yearchart.html.twig new file mode 100644 index 00000000..b43dcd1d --- /dev/null +++ b/templates/widget/widget-yearchart.html.twig @@ -0,0 +1,98 @@ +{% set backgroundColor = kimai_context.chart.background_color %} +{% set borderColor = kimai_context.chart.border_color %} +{% set gridColor = kimai_context.chart.grid_color %} +{% set colors = options.color|default('')|split(';') %} +{% set type = options.type|default('line') %} +{% if type not in ['line', 'bar'] %} + {% set type = 'line' %} +{% endif %} + +{% if not title is empty %} +

      + + {{ title|trans }} + +

      +{% endif %} + +
      + +
      + + diff --git a/tests/DependencyInjection/AppExtensionTest.php b/tests/DependencyInjection/AppExtensionTest.php index 6548a57c..cd212c63 100644 --- a/tests/DependencyInjection/AppExtensionTest.php +++ b/tests/DependencyInjection/AppExtensionTest.php @@ -97,6 +97,12 @@ class AppExtensionTest extends TestCase 'box_color' => 'green', 'select_type' => null, 'show_about' => true, + 'chart' => [ + 'background_color' => 'rgba(0,115,183,0.7)', + 'border_color' => '#3b8bba', + 'grid_color' => 'rgba(0,0,0,.05)', + 'height' => '200' + ] ], 'kimai.theme.select_type' => null, 'kimai.theme.show_about' => true, diff --git a/tests/Event/DashboardEventTest.php b/tests/Event/DashboardEventTest.php index 5f04f5e1..637a3f2e 100644 --- a/tests/Event/DashboardEventTest.php +++ b/tests/Event/DashboardEventTest.php @@ -11,7 +11,7 @@ namespace App\Tests\Event; use App\Entity\User; use App\Event\DashboardEvent; -use App\Model\DashboardSection; +use App\Widget\Type\CompoundRow; use PHPUnit\Framework\TestCase; /** @@ -29,7 +29,7 @@ class DashboardEventTest extends TestCase $this->assertEquals($user, $sut->getUser()); $this->assertEquals([], $sut->getSections()); - $section = new DashboardSection('foo'); + $section = new CompoundRow(); $sut->addSection($section); $this->assertEquals([$section], $sut->getSections()); diff --git a/tests/Export/Renderer/CsvRendererTest.php b/tests/Export/Renderer/CsvRendererTest.php index 14b13244..27c9a9c6 100644 --- a/tests/Export/Renderer/CsvRendererTest.php +++ b/tests/Export/Renderer/CsvRendererTest.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; * @covers \App\Export\Renderer\CsvRenderer * @covers \App\Export\Renderer\AbstractSpreadsheetRenderer * @covers \App\Export\Renderer\RendererTrait + * @group integration */ class CsvRendererTest extends AbstractRendererTest { diff --git a/tests/Export/Renderer/HtmlRendererTest.php b/tests/Export/Renderer/HtmlRendererTest.php index dce941ce..c78b6d94 100644 --- a/tests/Export/Renderer/HtmlRendererTest.php +++ b/tests/Export/Renderer/HtmlRendererTest.php @@ -16,6 +16,7 @@ use Twig\Environment; /** * @covers \App\Export\Renderer\HtmlRenderer * @covers \App\Export\Renderer\RendererTrait + * @group integration */ class HtmlRendererTest extends AbstractRendererTest { diff --git a/tests/Export/Renderer/OdsRendererTest.php b/tests/Export/Renderer/OdsRendererTest.php index 3051ce48..cd44d424 100644 --- a/tests/Export/Renderer/OdsRendererTest.php +++ b/tests/Export/Renderer/OdsRendererTest.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; * @covers \App\Export\Renderer\OdsRenderer * @covers \App\Export\Renderer\AbstractSpreadsheetRenderer * @covers \App\Export\Renderer\RendererTrait + * @group integration */ class OdsRendererTest extends AbstractRendererTest { diff --git a/tests/Export/Renderer/PdfRendererTest.php b/tests/Export/Renderer/PdfRendererTest.php index 7164cc14..05876667 100644 --- a/tests/Export/Renderer/PdfRendererTest.php +++ b/tests/Export/Renderer/PdfRendererTest.php @@ -19,6 +19,7 @@ use Twig\Environment; /** * @covers \App\Export\Renderer\PDFRenderer * @covers \App\Export\Renderer\RendererTrait + * @group integration */ class PdfRendererTest extends AbstractRendererTest { diff --git a/tests/Export/Renderer/XlsxRendererTest.php b/tests/Export/Renderer/XlsxRendererTest.php index 1564f237..dd1d0da3 100644 --- a/tests/Export/Renderer/XlsxRendererTest.php +++ b/tests/Export/Renderer/XlsxRendererTest.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; * @covers \App\Export\Renderer\XlsxRenderer * @covers \App\Export\Renderer\AbstractSpreadsheetRenderer * @covers \App\Export\Renderer\RendererTrait + * @group integration */ class XlsxRendererTest extends AbstractRendererTest { diff --git a/tests/Model/DashboardSectionTest.php b/tests/Model/DashboardSectionTest.php deleted file mode 100644 index e1390507..00000000 --- a/tests/Model/DashboardSectionTest.php +++ /dev/null @@ -1,42 +0,0 @@ -assertEquals('test', $sut->getTitle()); - $this->assertEquals(0, $sut->getOrder()); - $this->assertEquals([], $sut->getWidgets()); - $this->assertEquals(DashboardSection::TYPE_SIMPLE, $sut->getType()); - } - - public function testSetter() - { - $sut = new DashboardSection('hello-world'); - $sut->setType(DashboardSection::TYPE_CHART); - $sut->setOrder(13); - $sut->addWidget(new Widget('bar', [])); - - $this->assertCount(1, $sut->getWidgets()); - $this->assertEquals(DashboardSection::TYPE_CHART, $sut->getType()); - $this->assertEquals(13, $sut->getOrder()); - $this->assertEquals('bar', $sut->getWidgets()[0]->getTitle()); - } -} diff --git a/tests/Model/Statistic/DayTest.php b/tests/Model/Statistic/DayTest.php new file mode 100644 index 00000000..d4bb2d05 --- /dev/null +++ b/tests/Model/Statistic/DayTest.php @@ -0,0 +1,42 @@ +assertSame($date, $sut->getDay()); + $this->assertEquals(12340, $sut->getTotalDuration()); + $this->assertEquals(197.25956, $sut->getTotalRate()); + } + + public function testAllowedMonths() + { + $date = new DateTime('-8 hours'); + $sut = new Day($date, 12340, 197.25956); + + $sut->setTotalDuration(999.27); + $sut->setTotalRate(0.123456789); + + $this->assertEquals(999, $sut->getTotalDuration()); + $this->assertEquals(0.123456789, $sut->getTotalRate()); + } +} diff --git a/tests/Model/Statistic/MonthTest.php b/tests/Model/Statistic/MonthTest.php index 0bcb44f1..faeab837 100644 --- a/tests/Model/Statistic/MonthTest.php +++ b/tests/Model/Statistic/MonthTest.php @@ -10,6 +10,8 @@ namespace App\Tests\Model\Statistic; use App\Model\Statistic\Month; +use Exception; +use InvalidArgumentException; use PHPUnit\Framework\TestCase; /** @@ -42,12 +44,12 @@ class MonthTest extends TestCase $ex = null; try { new Month($month); - } catch (\Exception $e) { + } catch (Exception $e) { $ex = $e; } - $this->assertInstanceOf(\InvalidArgumentException::class, $ex); + $this->assertInstanceOf(InvalidArgumentException::class, $ex); $this->assertEquals( - 'Invalid month given, expected 01-12 but given: ' . ((int) $month), + 'Invalid month given. Expected 1-12, received "' . ((int) $month) . '".', $ex->getMessage() ); } @@ -59,7 +61,7 @@ class MonthTest extends TestCase $sut->setTotalDuration(999.27); $sut->setTotalRate(0.123456789); - $this->assertEquals(999.27, $sut->getTotalDuration()); + $this->assertEquals(999, $sut->getTotalDuration()); $this->assertEquals(0.123456789, $sut->getTotalRate()); } } diff --git a/tests/Repository/WidgetRepositoryTest.php b/tests/Repository/WidgetRepositoryTest.php index b9646a48..2e54d94a 100644 --- a/tests/Repository/WidgetRepositoryTest.php +++ b/tests/Repository/WidgetRepositoryTest.php @@ -9,9 +9,9 @@ namespace App\Tests\Repository; -use App\Model\Widget; use App\Repository\TimesheetRepository; use App\Repository\WidgetRepository; +use App\Security\CurrentUser; use PHPUnit\Framework\TestCase; /** @@ -22,8 +22,9 @@ class WidgetRepositoryTest extends TestCase public function testHasWidget() { $repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock(); + $userMock = $this->getMockBuilder(CurrentUser::class)->disableOriginalConstructor()->getMock(); - $sut = new WidgetRepository($repoMock, ['test' => []]); + $sut = new WidgetRepository($repoMock, $userMock, ['test' => []]); $this->assertFalse($sut->has('foo')); $this->assertTrue($sut->has('test')); @@ -31,14 +32,41 @@ class WidgetRepositoryTest extends TestCase /** * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Cannot find widget: foo + * @expectedExceptionMessage Cannot find widget "foo". */ public function testGetWidgetThrowsExceptionOnNonExistingWidget() { $repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock(); + $userMock = $this->getMockBuilder(CurrentUser::class)->disableOriginalConstructor()->getMock(); - $sut = new WidgetRepository($repoMock, ['test' => []]); - $sut->get('foo', null); + $sut = new WidgetRepository($repoMock, $userMock, ['test' => []]); + $sut->get('foo'); + } + + /** + * @expectedException \App\Widget\WidgetException + * @expectedExceptionMessage Unknown widget type "\App\Widget\Type\FooBar" + */ + public function testGetWidgetThrowsExceptionOnInvalidType() + { + $repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock(); + $userMock = $this->getMockBuilder(CurrentUser::class)->disableOriginalConstructor()->getMock(); + + $sut = new WidgetRepository($repoMock, $userMock, ['test' => ['type' => 'FooBar', 'user' => false]]); + $sut->get('test'); + } + + /** + * @expectedException \App\Widget\WidgetException + * @expectedExceptionMessage Invalid widget type "\App\Widget\Type\CompoundChart" does not extend AbstractWidgetType + */ + public function testGetWidgetTriggersExceptionOnWrongClass() + { + $repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock(); + $userMock = $this->getMockBuilder(CurrentUser::class)->disableOriginalConstructor()->getMock(); + + $sut = new WidgetRepository($repoMock, $userMock, ['test' => ['type' => 'CompoundChart', 'user' => false]]); + $sut->get('test'); } /** @@ -49,6 +77,8 @@ class WidgetRepositoryTest extends TestCase $repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock(); $repoMock->method('getStatistic')->willReturn($data); + $userMock = $this->getMockBuilder(CurrentUser::class)->disableOriginalConstructor()->getMock(); + $widget = [ 'color' => 'sunny', 'icon' => 'far fa-test', @@ -59,24 +89,25 @@ class WidgetRepositoryTest extends TestCase 'title' => 'Test widget', ]; - $sut = new WidgetRepository($repoMock, ['test' => $widget]); - $widget = $sut->get('test', null); + $sut = new WidgetRepository($repoMock, $userMock, ['test' => $widget]); + $widget = $sut->get('test'); + $options = $widget->getOptions(); $this->assertEquals('Test widget', $widget->getTitle()); $this->assertEquals($data, $widget->getData()); - $this->assertEquals('sunny', $widget->getColor()); - $this->assertEquals('far fa-test', $widget->getIcon()); - $this->assertEquals($dataType, $widget->getDataType()); + $this->assertEquals('sunny', $options['color']); + $this->assertEquals('far fa-test', $options['icon']); + $this->assertEquals($dataType, $options['dataType']); } public function getWidgetData() { return [ - [12, TimesheetRepository::STATS_QUERY_DURATION, Widget::DATA_TYPE_DURATION], - [112233, TimesheetRepository::STATS_QUERY_AMOUNT, Widget::DATA_TYPE_INT], - [37, TimesheetRepository::STATS_QUERY_ACTIVE, Widget::DATA_TYPE_INT], - [375, TimesheetRepository::STATS_QUERY_RATE, Widget::DATA_TYPE_MONEY], - [['test' => 'foo'], TimesheetRepository::STATS_QUERY_USER, Widget::DATA_TYPE_INT], + [12, TimesheetRepository::STATS_QUERY_DURATION, 'duration'], + [112233, TimesheetRepository::STATS_QUERY_AMOUNT, 'int'], + [37, TimesheetRepository::STATS_QUERY_ACTIVE, 'int'], + [375, TimesheetRepository::STATS_QUERY_RATE, 'money'], + [['test' => 'foo'], TimesheetRepository::STATS_QUERY_USER, 'int'], ]; } } diff --git a/tests/Twig/WidgetExtensionTest.php b/tests/Twig/WidgetExtensionTest.php new file mode 100644 index 00000000..6c42dfb5 --- /dev/null +++ b/tests/Twig/WidgetExtensionTest.php @@ -0,0 +1,107 @@ +getMockBuilder(WidgetService::class)->disableOriginalConstructor()->setMethods(['hasWidget', 'getWidget', 'findRenderer'])->getMock(); + if (null !== $hasWidget) { + $service->expects($this->once())->method('hasWidget')->willReturn($hasWidget); + } + if (null !== $getWidget) { + $service->expects($this->once())->method('getWidget')->willReturn($getWidget); + } + if (null !== $renderer) { + $service->expects($this->once())->method('findRenderer')->willReturn($renderer); + } + + return new WidgetExtension($service); + } + + public function testGetFunctions() + { + $functions = ['render_widget']; + $sut = $this->getSut(); + $twigFunctions = $sut->getFunctions(); + $this->assertCount(count($functions), $twigFunctions); + $i = 0; + /** @var TwigFunction $function */ + foreach ($twigFunctions as $function) { + $this->assertInstanceOf(TwigFunction::class, $function); + $this->assertEquals($functions[$i++], $function->getName()); + } + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Widget must either implement WidgetInterface or be a string + */ + public function testRenderWidgetForInvalidValue() + { + $sut = $this->getSut(); + $sut->renderWidget(true); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Unknown widget "test" requested + */ + public function testRenderWidgetForUnknownWidget() + { + $sut = $this->getSut(false); + $sut->renderWidget('test'); + } + + public function testRenderWidgetByString() + { + $widget = new Counter(); + $sut = $this->getSut(true, $widget, new TestRenderer()); + $options = ['foo' => 'bar', 'dataType' => 'blub']; + $result = $sut->renderWidget('test', $options); + $data = json_decode($result, true); + $this->assertEquals($options, $data); + } + + public function testRenderWidgetObject() + { + $widget = new Counter(); + $sut = $this->getSut(null, null, new TestRenderer()); + $options = ['foo' => 'bar', 'dataType' => 'blub']; + $result = $sut->renderWidget($widget, $options); + $data = json_decode($result, true); + $this->assertEquals($options, $data); + } +} + +class TestRenderer implements WidgetRendererInterface +{ + public function supports(WidgetInterface $widget): bool + { + return true; + } + + public function render(WidgetInterface $widget, array $options = []): string + { + return json_encode($widget->getOptions($options)); + } +} diff --git a/tests/Widget/Renderer/CompoundChartRendererTest.php b/tests/Widget/Renderer/CompoundChartRendererTest.php new file mode 100644 index 00000000..885d66c4 --- /dev/null +++ b/tests/Widget/Renderer/CompoundChartRendererTest.php @@ -0,0 +1,54 @@ +getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock(); + $sut = new CompoundChartRenderer($twig); + self::assertTrue($sut->supports(new CompoundChart())); + self::assertFalse($sut->supports(new CompoundRow())); + } + + public function testRenderWithCounter() + { + $twig = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->setMethods(['render'])->getMock(); + $twig->expects($this->once())->method('render')->willReturnCallback(function ($name, $options) { + return json_encode([$name, $options]); + }); + + $sut = new CompoundChartRenderer($twig); + $row = new CompoundChart(); + $row->setTitle('foo-bar'); + $row->addWidget(new Counter()); + + $result = $sut->render($row); + $result = json_decode($result, true); + self::assertEquals('widget/section-chart.html.twig', $result[0]); + self::assertArrayHasKey('title', $result[1]); + self::assertEquals('foo-bar', $result[1]['title']); + self::assertArrayHasKey('widgets', $result[1]); + self::assertIsArray($result[1]['widgets']); + self::assertCount(1, $result[1]['widgets']); + } +} diff --git a/tests/Widget/Renderer/CompoundRowRendererTest.php b/tests/Widget/Renderer/CompoundRowRendererTest.php new file mode 100644 index 00000000..d7258d83 --- /dev/null +++ b/tests/Widget/Renderer/CompoundRowRendererTest.php @@ -0,0 +1,54 @@ +getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock(); + $sut = new CompoundRowRenderer($twig); + self::assertTrue($sut->supports(new CompoundRow())); + self::assertFalse($sut->supports(new CompoundChart())); + } + + public function testRenderWithCounter() + { + $twig = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->setMethods(['render'])->getMock(); + $twig->expects($this->once())->method('render')->willReturnCallback(function ($name, $options) { + return json_encode([$name, $options]); + }); + + $sut = new CompoundRowRenderer($twig); + $row = new CompoundRow(); + $row->setTitle('foo-bar'); + $row->addWidget(new Counter()); + + $result = $sut->render($row); + $result = json_decode($result, true); + self::assertEquals('widget/section-simple.html.twig', $result[0]); + self::assertArrayHasKey('title', $result[1]); + self::assertEquals('foo-bar', $result[1]['title']); + self::assertArrayHasKey('widgets', $result[1]); + self::assertIsArray($result[1]['widgets']); + self::assertCount(1, $result[1]['widgets']); + } +} diff --git a/tests/Widget/Renderer/SimpleWidgetRendererTest.php b/tests/Widget/Renderer/SimpleWidgetRendererTest.php new file mode 100644 index 00000000..b886f86b --- /dev/null +++ b/tests/Widget/Renderer/SimpleWidgetRendererTest.php @@ -0,0 +1,67 @@ +getMockBuilder(Environment::class)->disableOriginalConstructor()->getMock(); + $sut = new SimpleWidgetRenderer($twig); + self::assertTrue($sut->supports(new SimpleWidget())); + } + + /** + * @dataProvider getSimpleWidgetsData + */ + public function testRenderWithCounter(SimpleWidget $widget, $template, $color) + { + $twig = $this->getMockBuilder(Environment::class)->disableOriginalConstructor()->setMethods(['render'])->getMock(); + $twig->expects($this->once())->method('render')->willReturnCallback(function ($name, $options) { + return json_encode([$name, $options]); + }); + + $sut = new SimpleWidgetRenderer($twig); + + $data = uniqid(get_class($widget)); + $widget->setData($data); + $result = $sut->render($widget, ['color' => $color]); + $result = json_decode($result, true); + + self::assertEquals($template, $result[0]); + self::assertArrayHasKey('data', $result[1]); + self::assertEquals($data, $result[1]['data']); + self::assertArrayHasKey('title', $result[1]); + self::assertArrayHasKey('options', $result[1]); + self::assertIsArray($result[1]['options']); + self::assertArrayHasKey('color', $result[1]['options']); + self::assertEquals($color, $result[1]['options']['color']); + } + + public function getSimpleWidgetsData() + { + return [ + [new SimpleWidget(), 'widget/widget-simplewidget.html.twig', 'yellow'], + [new Counter(), 'widget/widget-counter.html.twig', 'asdfgh'], + [new More(), 'widget/widget-more.html.twig', '#123456'], + ]; + } +} diff --git a/tests/Widget/Type/AbstractContainerTest.php b/tests/Widget/Type/AbstractContainerTest.php new file mode 100644 index 00000000..85e6fbf4 --- /dev/null +++ b/tests/Widget/Type/AbstractContainerTest.php @@ -0,0 +1,67 @@ +createSut(); + + self::assertInstanceOf(AbstractContainer::class, $sut); + + self::assertEquals('', $sut->getId()); + self::assertEquals('', $sut->getTitle()); + + self::assertEquals(0, $sut->getOrder()); + self::assertEquals([], $sut->getOptions()); + self::assertEquals([], $sut->getWidgets()); + self::assertEquals([], $sut->getData()); + } + + public function testSetter() + { + $widget = (new More())->setTitle('bar')->setId('foo'); + + $sut = $this->createSut(); + $sut->setTitle('hello-world'); + $sut->setOrder(13); + $sut->addWidget($widget); + + self::assertEquals('hello-world', $sut->getTitle()); + self::assertEquals('hello-world', $sut->getId()); + + self::assertCount(1, $sut->getWidgets()); + self::assertCount(1, $sut->getData()); + self::assertEquals([$widget], $sut->getWidgets()); + self::assertEquals([$widget], $sut->getData()); + + self::assertEquals(13, $sut->getOrder()); + self::assertEquals('bar', $sut->getWidgets()[0]->getTitle()); + } + + /** + * @expectedException \BadMethodCallException + */ + public function testSetOptionNotImplemented() + { + $sut = $this->createSut(); + $sut->setOption('dfsdf', []); + } +} diff --git a/tests/Widget/Type/AbstractWidgetTypeTest.php b/tests/Widget/Type/AbstractWidgetTypeTest.php new file mode 100644 index 00000000..cdeed4af --- /dev/null +++ b/tests/Widget/Type/AbstractWidgetTypeTest.php @@ -0,0 +1,69 @@ +createSut(); + self::assertInstanceOf(AbstractWidgetType::class, $sut); + self::assertEquals('', $sut->getId()); + self::assertEquals('', $sut->getTitle()); + self::assertEquals($this->getDefaultOptions(), $sut->getOptions()); + self::assertNull($sut->getData()); + self::assertEquals('bar', $sut->getOption('foo', 'bar')); + } + + public function testFluentInterface() + { + $sut = $this->createSut(); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setOptions([])); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setId('')); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setTitle('')); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setData('')); + } + + public function testSetter() + { + $sut = $this->createSut(); + + // options + $sut->setOption('föööö', 'trääääää'); + self::assertEquals('trääääää', $sut->getOption('föööö', 'tröööö')); + self::assertEquals('trääääää', $sut->getOption('föööö', 'tröööö')); + self::assertEquals(array_merge($this->getDefaultOptions(), ['föööö' => 'trääääää']), $sut->getOptions()); + + $sut->setOptions(['blub' => 'blab', 'dataType' => 'money']); + self::assertEquals(['blub' => 'blab', 'dataType' => 'money', 'föööö' => 'trääääää'], $sut->getOptions()); + + // id + $sut->setId('cvbnmyx'); + self::assertEquals('cvbnmyx', $sut->getId()); + + // data + $sut->setData('slkudfhalksjdhfkljsahdf'); + self::assertEquals('slkudfhalksjdhfkljsahdf', $sut->getData()); + + $data = new \stdClass(); + $sut->setData($data); + self::assertSame($data, $sut->getData()); + } +} diff --git a/tests/Widget/Type/CompoundChartTest.php b/tests/Widget/Type/CompoundChartTest.php new file mode 100644 index 00000000..e8e65ab8 --- /dev/null +++ b/tests/Widget/Type/CompoundChartTest.php @@ -0,0 +1,25 @@ + 'int']; + } + + public function testExtendsSimpleWidget() + { + $sut = $this->createSut(); + self::assertInstanceOf(SimpleWidget::class, $sut); + } +} diff --git a/tests/Widget/Type/DailyWorkingTimeChartTest.php b/tests/Widget/Type/DailyWorkingTimeChartTest.php new file mode 100644 index 00000000..67e8619f --- /dev/null +++ b/tests/Widget/Type/DailyWorkingTimeChartTest.php @@ -0,0 +1,117 @@ +getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock(); + $user = $this->getMockBuilder(CurrentUser::class)->disableOriginalConstructor()->setMethods(['getUser'])->getMock(); + $user->expects($this->once())->method('getUser')->willReturn(new User()); + + return new DailyWorkingTimeChart($repository, $user); + } + + public function testExtendsSimpleWidget() + { + $sut = $this->createSut(); + self::assertInstanceOf(SimpleWidget::class, $sut); + } + + public function testDefaultValues() + { + $sut = $this->createSut(); + self::assertInstanceOf(AbstractWidgetType::class, $sut); + self::assertEquals('DailyWorkingTimeChart', $sut->getId()); + self::assertEquals('stats.yourWorkingHours', $sut->getTitle()); + self::assertEquals('monday this week 00:00:00', $sut->getOption('begin', 'xxx')); + self::assertEquals('sunday this week 23:59:59', $sut->getOption('end', 'xxx')); + self::assertEquals('', $sut->getOption('color', 'xxx')); + self::assertInstanceOf(User::class, $sut->getOption('user', 'xxx')); + self::assertEquals('bar', $sut->getOption('type', 'xxx')); + } + + public function testFluentInterface() + { + $sut = $this->createSut(); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setOptions([])); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setId('')); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setTitle('')); + self::assertInstanceOf(AbstractWidgetType::class, $sut->setData('')); + } + + public function testSetter() + { + $sut = $this->createSut(); + + // options + $sut->setOption('föööö', 'trääääää'); + self::assertEquals('trääääää', $sut->getOption('föööö', 'tröööö')); + + // check default values + self::assertEquals('xxxxx', $sut->getOption('blub', 'xxxxx')); + self::assertEquals('xxxxx', $sut->getOption('dataType', 'xxxxx')); + + $sut->setOptions(['blub' => 'blab', 'dataType' => 'money']); + // check option still exists + self::assertEquals('trääääää', $sut->getOption('föööö', 'tröööö')); + // check options are now existing + self::assertEquals('blab', $sut->getOption('blub', 'xxxxx')); + self::assertEquals('money', $sut->getOption('dataType', 'xxxxx')); + + // id + $sut->setId('cvbnmyx'); + self::assertEquals('cvbnmyx', $sut->getId()); + } + + public function testGetOptions() + { + $sut = $this->createSut(); + + $options = $sut->getOptions(['type' => 'xxx']); + self::assertStringStartsWith('DailyWorkingTimeChart_', $options['id']); + self::assertEquals('bar', $options['type']); + } + + public function testGetData() + { + $repository = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->setMethods(['getDailyData'])->getMock(); + $repository->expects($this->once())->method('getDailyData')->willReturnCallback(function ($user, $begin, $end) { + return [ + ['year' => '2019', 'month' => '1', 'day' => 1, 'rate' => 13.75, 'duration' => 1234] + ]; + }); + $user = $this->getMockBuilder(CurrentUser::class)->disableOriginalConstructor()->setMethods(['getUser'])->getMock(); + $user->expects($this->once())->method('getUser')->willReturn((new User())->setUsername('tralalala')); + + $sut = new DailyWorkingTimeChart($repository, $user); + $data = $sut->getData([]); + self::assertCount(7, $data); + foreach ($data as $statObj) { + self::assertInstanceOf(Day::class, $statObj); + } + } +} diff --git a/tests/Widget/Type/MoreTest.php b/tests/Widget/Type/MoreTest.php new file mode 100644 index 00000000..78c225fc --- /dev/null +++ b/tests/Widget/Type/MoreTest.php @@ -0,0 +1,36 @@ + 'int']; + } + + public function testExtendsSimpleWidget() + { + $sut = $this->createSut(); + self::assertInstanceOf(SimpleWidget::class, $sut); + } +} diff --git a/tests/Widget/Type/SimpleWidgetTest.php b/tests/Widget/Type/SimpleWidgetTest.php new file mode 100644 index 00000000..99783b5f --- /dev/null +++ b/tests/Widget/Type/SimpleWidgetTest.php @@ -0,0 +1,29 @@ +getMockBuilder(WidgetRepository::class)->disableOriginalConstructor()->getMock(); + + $sut = new WidgetService($repository, []); + self::assertFalse($sut->hasWidget('sdfsdf')); + self::assertCount(0, $sut->getRenderer()); + + $sut = new WidgetService($repository, [ + new SimpleWidgetRenderer(new Environment(new FilesystemLoader())) + ]); + self::assertCount(1, $sut->getRenderer()); + } + + public function testFindRenderer() + { + $repository = $this->getMockBuilder(WidgetRepository::class)->disableOriginalConstructor()->getMock(); + + $renderer = new SimpleWidgetRenderer(new Environment(new FilesystemLoader())); + $sut = new WidgetService($repository, [$renderer]); + $sut->addRenderer(new SimpleWidgetRenderer(new Environment(new FilesystemLoader()))); + + self::assertCount(2, $sut->getRenderer()); + + $found = $sut->findRenderer(new More()); + self::assertSame($renderer, $found); + } + + /** + * @expectedException \App\Widget\WidgetException + * @expectedExceptionMessage No renderer available for widget "App\Widget\Type\More" + */ + public function testFindRendererThrowsException() + { + $repository = $this->getMockBuilder(WidgetRepository::class)->disableOriginalConstructor()->getMock(); + + $sut = new WidgetService($repository, []); + $sut->findRenderer(new More()); + } + + public function testHasAndGetWidget() + { + $widget = new More(); + + $repository = $this->getMockBuilder(WidgetRepository::class)->disableOriginalConstructor()->setMethods(['has', 'get'])->getMock(); + $repository->expects($this->once())->method('has')->willReturn(true); + $repository->expects($this->once())->method('get')->willReturn($widget); + + $sut = new WidgetService($repository, []); + self::assertTrue($sut->hasWidget('sdfsdf')); + self::assertSame($widget, $sut->getWidget('sdfsdf')); + } +} diff --git a/translations/messages.ar.xliff b/translations/messages.ar.xliff index 5ea095fe..063bcd74 100755 --- a/translations/messages.ar.xliff +++ b/translations/messages.ar.xliff @@ -257,10 +257,6 @@ dashboard.all جميع المستخدمين - - dashboard.admin - مدير -