From 188506e782843cca1ef07e19d7fd73a4017a8545 Mon Sep 17 00:00:00 2001
From: Saulo Vallory
Date: Wed, 20 Dec 2023 22:55:05 -0300
Subject: [PATCH] Fixes to component scripts
---
.vscode/settings.json | 14 +-
package.json | 3 +
pnpm-lock.yaml | 565 +-
public/js/main.js | 3670 --
public/js/vendors.js | 28762 ----------------
.../{ => _deprecated}/agenda_box.js | 0
.../{ => _deprecated}/appointments.js | 0
.../{ => _deprecated}/block_modal.js | 0
.../components/{ => _deprecated}/calendar.js | 0
src/app/components/{ => _deprecated}/cards.js | 0
.../components/{ => _deprecated}/clients.js | 0
.../components/{ => _deprecated}/comments.js | 0
.../{ => _deprecated}/customPopover.js | 0
src/app/components/{ => _deprecated}/docs.js | 0
src/app/components/{ => _deprecated}/form.js | 0
.../components/{ => _deprecated}/formMasks.js | 0
.../{ => _deprecated}/form_files.js | 0
.../{ => _deprecated}/form_summernote.js | 0
.../{ => _deprecated}/help-search.js | 0
src/app/components/{ => _deprecated}/index.js | 0
.../{ => _deprecated}/input_date.js | 0
src/app/components/{ => _deprecated}/login.js | 0
.../{ => _deprecated}/patient_modal.js | 0
.../components/{ => _deprecated}/payment.js | 0
.../components/{ => _deprecated}/pwd-view.js | 0
.../{ => _deprecated}/search_page.js | 0
.../{ => _deprecated}/select_share.js | 0
.../components/{ => _deprecated}/sidebar.js | 0
.../components/{ => _deprecated}/snackbar.js | 0
src/app/components/{ => _deprecated}/steps.js | 0
.../components/{ => _deprecated}/tables.js | 0
src/app/components/{ => _deprecated}/toast.js | 0
src/app/components/header/header.ts | 13 +-
.../video-modal.scss} | 0
src/app/components/video-modal/video-modal.ts | 24 +
src/app/main.js | 82 -
src/components/Modal.astro | 0
src/components/VideoModal.astro | 10 +
src/pages/index.astro | 11 +-
39 files changed, 587 insertions(+), 32567 deletions(-)
delete mode 100644 public/js/main.js
delete mode 100644 public/js/vendors.js
rename src/app/components/{ => _deprecated}/agenda_box.js (100%)
rename src/app/components/{ => _deprecated}/appointments.js (100%)
rename src/app/components/{ => _deprecated}/block_modal.js (100%)
rename src/app/components/{ => _deprecated}/calendar.js (100%)
rename src/app/components/{ => _deprecated}/cards.js (100%)
rename src/app/components/{ => _deprecated}/clients.js (100%)
rename src/app/components/{ => _deprecated}/comments.js (100%)
rename src/app/components/{ => _deprecated}/customPopover.js (100%)
rename src/app/components/{ => _deprecated}/docs.js (100%)
rename src/app/components/{ => _deprecated}/form.js (100%)
rename src/app/components/{ => _deprecated}/formMasks.js (100%)
rename src/app/components/{ => _deprecated}/form_files.js (100%)
rename src/app/components/{ => _deprecated}/form_summernote.js (100%)
rename src/app/components/{ => _deprecated}/help-search.js (100%)
rename src/app/components/{ => _deprecated}/index.js (100%)
rename src/app/components/{ => _deprecated}/input_date.js (100%)
rename src/app/components/{ => _deprecated}/login.js (100%)
rename src/app/components/{ => _deprecated}/patient_modal.js (100%)
rename src/app/components/{ => _deprecated}/payment.js (100%)
rename src/app/components/{ => _deprecated}/pwd-view.js (100%)
rename src/app/components/{ => _deprecated}/search_page.js (100%)
rename src/app/components/{ => _deprecated}/select_share.js (100%)
rename src/app/components/{ => _deprecated}/sidebar.js (100%)
rename src/app/components/{ => _deprecated}/snackbar.js (100%)
rename src/app/components/{ => _deprecated}/steps.js (100%)
rename src/app/components/{ => _deprecated}/tables.js (100%)
rename src/app/components/{ => _deprecated}/toast.js (100%)
rename src/app/components/{play_video_modal.js => video-modal/video-modal.scss} (100%)
create mode 100644 src/app/components/video-modal/video-modal.ts
delete mode 100644 src/app/main.js
create mode 100644 src/components/Modal.astro
create mode 100644 src/components/VideoModal.astro
diff --git a/.vscode/settings.json b/.vscode/settings.json
index f1775cf..3502861 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -26,15 +26,23 @@
"astro",
"marko"
],
- "prettier.documentSelectors": ["**/*.astro"],
+ "prettier.documentSelectors": [
+ "**/*.astro"
+ ],
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.bracketSameLine": true,
"explorer.fileNesting.patterns": {
".config*": ".git*, *config, *config.json, *config.js, *config.mjs, *config.cjs, *config.d.ts, *config.ts, *config.mts, *config.cts, *config.toml, *config.yaml, *config.yml, *rc, *rc.json, *rc.js, *rc.mjs, *rc.cjs, *rc.ts, *rc.toml, *rc.yaml, *rc.yml"
},
- "cSpell.words": ["astrojs", "cssnano", "imagetools", "spotlightjs"],
+ "cSpell.words": [
+ "astrojs",
+ "cssnano",
+ "imagetools",
+ "spotlightjs",
+ "tokilabs"
+ ],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
-}
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index 056c24c..793e175 100644
--- a/package.json
+++ b/package.json
@@ -14,12 +14,15 @@
"@astrojs/sitemap": "^3.0.3",
"@sentry/astro": "^7.86.0",
"@spotlightjs/astro": "^1.0.2",
+ "@tokilabs/lang": "^1.0.7",
"astro": "^4.0.1",
"astro-imagetools": "^0.9.0",
+ "bootstrap": "5.3.2",
"slick-carousel": "^1.8.1",
"typescript": "^5.3.2"
},
"devDependencies": {
+ "@types/jquery": "^3.5.29",
"autoprefixer": "^10.4.16",
"colorguard": "^1.2.1",
"cssnano": "^6.0.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 23f521b..83e8d47 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -17,12 +17,18 @@ dependencies:
'@spotlightjs/astro':
specifier: ^1.0.2
version: 1.0.2(@sentry/astro@7.86.0)(astro@4.0.1)
+ '@tokilabs/lang':
+ specifier: ^1.0.7
+ version: 1.0.7
astro:
specifier: ^4.0.1
version: 4.0.1(sass@1.69.5)(typescript@5.3.2)
astro-imagetools:
specifier: ^0.9.0
version: 0.9.0(astro@4.0.1)
+ bootstrap:
+ specifier: 5.3.2
+ version: 5.3.2(@popperjs/core@2.11.8)
slick-carousel:
specifier: ^1.8.1
version: 1.8.1(jquery@3.7.1)
@@ -31,6 +37,9 @@ dependencies:
version: 5.3.2
devDependencies:
+ '@types/jquery':
+ specifier: ^3.5.29
+ version: 3.5.29
autoprefixer:
specifier: ^10.4.16
version: 10.4.16(postcss@8.4.32)
@@ -109,6 +118,11 @@ devDependencies:
packages:
+ /@aashutoshrathi/word-wrap@1.2.6:
+ resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
/@ampproject/remapping@2.2.1:
resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==}
engines: {node: '>=6.0.0'}
@@ -703,6 +717,63 @@ packages:
requiresBuild: true
optional: true
+ /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0):
+ resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
+ dependencies:
+ eslint: 8.56.0
+ eslint-visitor-keys: 3.4.3
+ dev: false
+
+ /@eslint-community/regexpp@4.10.0:
+ resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==}
+ engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
+ dev: false
+
+ /@eslint/eslintrc@2.1.4:
+ resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ ajv: 6.12.6
+ debug: 4.3.4
+ espree: 9.6.1
+ globals: 13.24.0
+ ignore: 5.3.0
+ import-fresh: 3.3.0
+ js-yaml: 4.1.0
+ minimatch: 3.1.2
+ strip-json-comments: 3.1.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@eslint/js@8.56.0:
+ resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: false
+
+ /@humanwhocodes/config-array@0.11.13:
+ resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==}
+ engines: {node: '>=10.10.0'}
+ dependencies:
+ '@humanwhocodes/object-schema': 2.0.1
+ debug: 4.3.4
+ minimatch: 3.1.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@humanwhocodes/module-importer@1.0.1:
+ resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
+ engines: {node: '>=12.22'}
+ dev: false
+
+ /@humanwhocodes/object-schema@2.0.1:
+ resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==}
+ dev: false
+
/@img/sharp-darwin-arm64@0.33.0:
resolution: {integrity: sha512-070tEheekI1LJWTGPC9WlQEa5UoKTXzzlORBHMX4TbfUxMiL336YHR8vBEUNsjse0RJCX8dZ4ZXwT595aEF1ug==}
engines: {glibc: '>=2.26', node: ^18.17.0 || ^20.3.0 || >=21.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0', yarn: '>=3.2.0'}
@@ -1314,6 +1385,10 @@ packages:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.15.0
+ /@popperjs/core@2.11.8:
+ resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
+ dev: false
+
/@rollup/rollup-android-arm-eabi@4.6.1:
resolution: {integrity: sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==}
cpu: [arm]
@@ -1633,6 +1708,19 @@ packages:
resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==}
dev: false
+ /@tokilabs/lang@1.0.7:
+ resolution: {integrity: sha512-amxihCa7N2Uje1V5a9Fn0Y4QFYWjITOnP6HQKTSP7Q+vk/9eGBCFvQVHkxlAQhTvrs4KCYMJmtGJqo9AWjarDQ==}
+ engines: {node: '>=18'}
+ dependencies:
+ class-transformer: 0.5.1
+ nanoid: 3.0.1
+ prettier-eslint: 15.0.1
+ reflect-metadata: 0.1.14
+ uuid: 9.0.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
/@trysound/sax@0.2.0:
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
engines: {node: '>=10.13.0'}
@@ -1673,6 +1761,13 @@ packages:
'@types/ms': 0.7.34
dev: false
+ /@types/eslint@8.56.0:
+ resolution: {integrity: sha512-FlsN0p4FhuYRjIxpbdXovvHQhtlG05O1GG/RNWvdAxTboR438IOTwmrY/vLA+Xfgg06BTkP045M3vpFwTMv1dg==}
+ dependencies:
+ '@types/estree': 1.0.5
+ '@types/json-schema': 7.0.15
+ dev: false
+
/@types/estree@1.0.5:
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
dev: false
@@ -1683,6 +1778,16 @@ packages:
'@types/unist': 3.0.2
dev: false
+ /@types/jquery@3.5.29:
+ resolution: {integrity: sha512-oXQQC9X9MOPRrMhPHHOsXqeQDnWeCDT3PelUIg/Oy8FAbzSZtFHRjc7IpbfFVmpLtJ+UOoywpRsuO5Jxjybyeg==}
+ dependencies:
+ '@types/sizzle': 2.3.8
+ dev: true
+
+ /@types/json-schema@7.0.15:
+ resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
+ dev: false
+
/@types/mdast@3.0.15:
resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==}
dependencies:
@@ -1713,12 +1818,20 @@ packages:
resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==}
dev: false
+ /@types/prettier@2.7.3:
+ resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==}
+ dev: false
+
/@types/sax@1.2.7:
resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==}
dependencies:
'@types/node': 17.0.45
dev: false
+ /@types/sizzle@2.3.8:
+ resolution: {integrity: sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==}
+ dev: true
+
/@types/unist@2.0.10:
resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==}
@@ -1726,6 +1839,68 @@ packages:
resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==}
dev: false
+ /@typescript-eslint/parser@5.62.0(eslint@8.56.0)(typescript@4.9.5):
+ resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5)
+ debug: 4.3.4
+ eslint: 8.56.0
+ typescript: 4.9.5
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@typescript-eslint/scope-manager@5.62.0:
+ resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
+ dev: false
+
+ /@typescript-eslint/types@5.62.0:
+ resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: false
+
+ /@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.5):
+ resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
+ debug: 4.3.4
+ globby: 11.1.0
+ is-glob: 4.0.3
+ semver: 7.5.4
+ tsutils: 3.21.0(typescript@4.9.5)
+ typescript: 4.9.5
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@typescript-eslint/visitor-keys@5.62.0:
+ resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ eslint-visitor-keys: 3.4.3
+ dev: false
+
/@ungap/structured-clone@1.2.0:
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
dev: false
@@ -1800,6 +1975,14 @@ packages:
resolution: {integrity: sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==}
dev: false
+ /acorn-jsx@5.3.2(acorn@8.11.2):
+ resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
+ peerDependencies:
+ acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ acorn: 8.11.2
+ dev: false
+
/acorn@8.11.2:
resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==}
engines: {node: '>=0.4.0'}
@@ -1815,6 +1998,15 @@ packages:
- supports-color
dev: false
+ /ajv@6.12.6:
+ resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
+ dependencies:
+ fast-deep-equal: 3.1.3
+ fast-json-stable-stringify: 2.1.0
+ json-schema-traverse: 0.4.1
+ uri-js: 4.4.1
+ dev: false
+
/ajv@8.12.0:
resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==}
dependencies:
@@ -1838,7 +2030,11 @@ packages:
/ansi-regex@2.1.1:
resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==}
engines: {node: '>=0.10.0'}
- dev: true
+
+ /ansi-regex@3.0.1:
+ resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==}
+ engines: {node: '>=4'}
+ dev: false
/ansi-regex@5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
@@ -1851,7 +2047,6 @@ packages:
/ansi-styles@2.2.1:
resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==}
engines: {node: '>=0.10.0'}
- dev: true
/ansi-styles@3.2.1:
resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
@@ -1908,7 +2103,6 @@ packages:
/array-union@2.1.0:
resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
engines: {node: '>=8'}
- dev: true
/array-uniq@1.0.3:
resolution: {integrity: sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==}
@@ -2097,6 +2291,14 @@ packages:
postcss: 4.1.16
dev: true
+ /bootstrap@5.3.2(@popperjs/core@2.11.8):
+ resolution: {integrity: sha512-D32nmNWiQHo94BKHLmOrdjlL05q1c8oxbtBphQFb9Z5to6eGRDCm0QgeaZ4zFBHzfg2++rqa2JkqCcxDy0sH0g==}
+ peerDependencies:
+ '@popperjs/core': ^2.11.8
+ dependencies:
+ '@popperjs/core': 2.11.8
+ dev: false
+
/boxen@7.1.1:
resolution: {integrity: sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==}
engines: {node: '>=14.16'}
@@ -2116,7 +2318,6 @@ packages:
dependencies:
balanced-match: 1.0.2
concat-map: 0.0.1
- dev: true
/brace-expansion@2.0.1:
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
@@ -2169,7 +2370,6 @@ packages:
/callsites@3.1.0:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'}
- dev: true
/camelcase@3.0.0:
resolution: {integrity: sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==}
@@ -2206,7 +2406,6 @@ packages:
has-ansi: 2.0.0
strip-ansi: 3.0.1
supports-color: 2.0.0
- dev: true
/chalk@2.4.2:
resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
@@ -2216,6 +2415,14 @@ packages:
escape-string-regexp: 1.0.5
supports-color: 5.5.0
+ /chalk@4.1.2:
+ resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
+ engines: {node: '>=10'}
+ dependencies:
+ ansi-styles: 4.3.0
+ supports-color: 7.2.0
+ dev: false
+
/chalk@5.3.0:
resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==}
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
@@ -2275,6 +2482,10 @@ packages:
engines: {node: '>=8'}
dev: false
+ /class-transformer@0.5.1:
+ resolution: {integrity: sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==}
+ dev: false
+
/cli-boxes@3.0.0:
resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
engines: {node: '>=10'}
@@ -2389,13 +2600,17 @@ packages:
resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==}
dev: false
+ /common-tags@1.8.2:
+ resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==}
+ engines: {node: '>=4.0.0'}
+ dev: false
+
/commondir@1.0.1:
resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
dev: false
/concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
- dev: true
/convert-source-map@2.0.0:
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
@@ -2611,6 +2826,10 @@ packages:
dev: false
optional: true
+ /deep-is@0.1.4:
+ resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
+ dev: false
+
/dependency-graph@0.11.0:
resolution: {integrity: sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==}
engines: {node: '>= 0.6.0'}
@@ -2661,7 +2880,6 @@ packages:
engines: {node: '>=8'}
dependencies:
path-type: 4.0.0
- dev: true
/directory-fonts-complete@1.2.0:
resolution: {integrity: sha512-/d3kxZmVS+2v774mZ9SoU7H93TsAvQNpf4s/guQTva3pQSxtwUWN9dSF+Zls7sfA8ybReuR92SQMhxxUTSIGvA==}
@@ -2678,6 +2896,13 @@ packages:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
dev: false
+ /doctrine@3.0.0:
+ resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ esutils: 2.0.3
+ dev: false
+
/dom-serializer@2.0.0:
resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}
dependencies:
@@ -2827,23 +3052,121 @@ packages:
resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
engines: {node: '>=0.8.0'}
+ /escape-string-regexp@4.0.0:
+ resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
+ engines: {node: '>=10'}
+ dev: false
+
/escape-string-regexp@5.0.0:
resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
engines: {node: '>=12'}
dev: false
+ /eslint-scope@7.2.2:
+ resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ esrecurse: 4.3.0
+ estraverse: 5.3.0
+ dev: false
+
+ /eslint-visitor-keys@3.4.3:
+ resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dev: false
+
+ /eslint@8.56.0:
+ resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ hasBin: true
+ dependencies:
+ '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0)
+ '@eslint-community/regexpp': 4.10.0
+ '@eslint/eslintrc': 2.1.4
+ '@eslint/js': 8.56.0
+ '@humanwhocodes/config-array': 0.11.13
+ '@humanwhocodes/module-importer': 1.0.1
+ '@nodelib/fs.walk': 1.2.8
+ '@ungap/structured-clone': 1.2.0
+ ajv: 6.12.6
+ chalk: 4.1.2
+ cross-spawn: 7.0.3
+ debug: 4.3.4
+ doctrine: 3.0.0
+ escape-string-regexp: 4.0.0
+ eslint-scope: 7.2.2
+ eslint-visitor-keys: 3.4.3
+ espree: 9.6.1
+ esquery: 1.5.0
+ esutils: 2.0.3
+ fast-deep-equal: 3.1.3
+ file-entry-cache: 6.0.1
+ find-up: 5.0.0
+ glob-parent: 6.0.2
+ globals: 13.24.0
+ graphemer: 1.4.0
+ ignore: 5.3.0
+ imurmurhash: 0.1.4
+ is-glob: 4.0.3
+ is-path-inside: 3.0.3
+ js-yaml: 4.1.0
+ json-stable-stringify-without-jsonify: 1.0.1
+ levn: 0.4.1
+ lodash.merge: 4.6.2
+ minimatch: 3.1.2
+ natural-compare: 1.4.0
+ optionator: 0.9.3
+ strip-ansi: 6.0.1
+ text-table: 0.2.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /espree@9.6.1:
+ resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ dependencies:
+ acorn: 8.11.2
+ acorn-jsx: 5.3.2(acorn@8.11.2)
+ eslint-visitor-keys: 3.4.3
+ dev: false
+
/esprima@4.0.1:
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
engines: {node: '>=4'}
hasBin: true
dev: false
+ /esquery@1.5.0:
+ resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==}
+ engines: {node: '>=0.10'}
+ dependencies:
+ estraverse: 5.3.0
+ dev: false
+
+ /esrecurse@4.3.0:
+ resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
+ engines: {node: '>=4.0'}
+ dependencies:
+ estraverse: 5.3.0
+ dev: false
+
+ /estraverse@5.3.0:
+ resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
+ engines: {node: '>=4.0'}
+ dev: false
+
/estree-walker@3.0.3:
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
dependencies:
'@types/estree': 1.0.5
dev: false
+ /esutils@2.0.3:
+ resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
/eventemitter3@5.0.1:
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
dev: false
@@ -2886,7 +3209,6 @@ packages:
/fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
- dev: true
/fast-fifo@1.3.2:
resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==}
@@ -2904,6 +3226,14 @@ packages:
merge2: 1.4.1
micromatch: 4.0.5
+ /fast-json-stable-stringify@2.1.0:
+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
+ dev: false
+
+ /fast-levenshtein@2.0.6:
+ resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
+ dev: false
+
/fastest-levenshtein@1.0.16:
resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
engines: {node: '>= 4.9.1'}
@@ -2920,6 +3250,13 @@ packages:
format: 0.2.2
dev: true
+ /file-entry-cache@6.0.1:
+ resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
+ engines: {node: ^10.12.0 || >=12.0.0}
+ dependencies:
+ flat-cache: 3.2.0
+ dev: false
+
/file-entry-cache@7.0.2:
resolution: {integrity: sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g==}
engines: {node: '>=12.0.0'}
@@ -3002,11 +3339,9 @@ packages:
flatted: 3.2.9
keyv: 4.5.4
rimraf: 3.0.2
- dev: true
/flatted@3.2.9:
resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}
- dev: true
/flattie@1.1.0:
resolution: {integrity: sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw==}
@@ -3115,6 +3450,13 @@ packages:
dependencies:
is-glob: 4.0.3
+ /glob-parent@6.0.2:
+ resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
+ engines: {node: '>=10.13.0'}
+ dependencies:
+ is-glob: 4.0.3
+ dev: false
+
/glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
dependencies:
@@ -3124,7 +3466,6 @@ packages:
minimatch: 3.1.2
once: 1.4.0
path-is-absolute: 1.0.1
- dev: true
/glob@9.3.2:
resolution: {integrity: sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA==}
@@ -3164,6 +3505,13 @@ packages:
engines: {node: '>=4'}
dev: false
+ /globals@13.24.0:
+ resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ type-fest: 0.20.2
+ dev: false
+
/globby@11.1.0:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
@@ -3174,7 +3522,6 @@ packages:
ignore: 5.3.0
merge2: 1.4.1
slash: 3.0.0
- dev: true
/globby@14.0.0:
resolution: {integrity: sha512-/1WM/LNHRAOH9lZta77uGbq0dAEQM+XjNesWwhlERDVenqothRbnzTrL3/LrIoEPPjeUHC3vrS6TwoyxeHs7MQ==}
@@ -3222,6 +3569,10 @@ packages:
/graceful-fs@4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
+ /graphemer@1.4.0:
+ resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
+ dev: false
+
/gray-matter@4.0.3:
resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==}
engines: {node: '>=6.0'}
@@ -3237,7 +3588,6 @@ packages:
engines: {node: '>=0.10.0'}
dependencies:
ansi-regex: 2.1.1
- dev: true
/has-flag@1.0.0:
resolution: {integrity: sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==}
@@ -3251,7 +3601,6 @@ packages:
/has-flag@4.0.0:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'}
- dev: true
/hasown@2.0.0:
resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==}
@@ -3418,7 +3767,6 @@ packages:
/ignore@5.3.0:
resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==}
engines: {node: '>= 4'}
- dev: true
/image-q@4.0.0:
resolution: {integrity: sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw==}
@@ -3444,7 +3792,6 @@ packages:
dependencies:
parent-module: 1.0.1
resolve-from: 4.0.0
- dev: true
/import-meta-resolve@4.0.0:
resolution: {integrity: sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==}
@@ -3453,14 +3800,17 @@ packages:
/imurmurhash@0.1.4:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
engines: {node: '>=0.8.19'}
- dev: true
+
+ /indent-string@4.0.0:
+ resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}
+ engines: {node: '>=8'}
+ dev: false
/inflight@1.0.6:
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
dependencies:
once: 1.4.0
wrappy: 1.0.2
- dev: true
/inherits@2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
@@ -3586,6 +3936,11 @@ packages:
b3b: 0.0.1
dev: true
+ /is-path-inside@3.0.3:
+ resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
+ engines: {node: '>=8'}
+ dev: false
+
/is-plain-obj@4.1.0:
resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}
engines: {node: '>=12'}
@@ -3691,16 +4046,23 @@ packages:
/json-buffer@3.0.1:
resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
- dev: true
/json-parse-even-better-errors@2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: true
+ /json-schema-traverse@0.4.1:
+ resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
+ dev: false
+
/json-schema-traverse@1.0.0:
resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
dev: true
+ /json-stable-stringify-without-jsonify@1.0.1:
+ resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
+ dev: false
+
/json5@2.2.3:
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
engines: {node: '>=6'}
@@ -3723,7 +4085,6 @@ packages:
resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}
dependencies:
json-buffer: 3.0.1
- dev: true
/kind-of@6.0.3:
resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==}
@@ -3750,6 +4111,14 @@ packages:
invert-kv: 1.0.0
dev: true
+ /levn@0.4.1:
+ resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ prelude-ls: 1.2.1
+ type-check: 0.4.0
+ dev: false
+
/lilconfig@2.1.0:
resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
engines: {node: '>=10'}
@@ -3841,7 +4210,6 @@ packages:
/lodash@4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
- dev: true
/log-symbols@1.0.2:
resolution: {integrity: sha512-mmPrW0Fh2fxOzdBbFv4g1m6pR72haFLPJ2G5SJEELf1y+iaQrDG6cWCPjy54RHYbZAt7X+ls690Kw62AdWXBzQ==}
@@ -3858,6 +4226,18 @@ packages:
is-unicode-supported: 1.3.0
dev: false
+ /loglevel-colored-level-prefix@1.0.0:
+ resolution: {integrity: sha512-u45Wcxxc+SdAlh4yeF/uKlC1SPUPCy0gullSNKXod5I4bmifzk+Q4lSLExNEVn19tGaJipbZ4V4jbFn79/6mVA==}
+ dependencies:
+ chalk: 1.1.3
+ loglevel: 1.8.1
+ dev: false
+
+ /loglevel@1.8.1:
+ resolution: {integrity: sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==}
+ engines: {node: '>= 0.6.0'}
+ dev: false
+
/longest-streak@3.1.0:
resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==}
dev: false
@@ -4403,7 +4783,6 @@ packages:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
dependencies:
brace-expansion: 1.1.11
- dev: true
/minimatch@7.4.6:
resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==}
@@ -4454,6 +4833,10 @@ packages:
resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==}
dev: false
+ /nanoid@3.0.1:
+ resolution: {integrity: sha512-y5gyHbIZQUaim/PrgYLd27MPoDIbGk9Yv5WeWLzFcfDxdV0svMV6geY6G/z/gWrP+OiBrj4SJ+z3Tpyn6IaMOA==}
+ dev: false
+
/nanoid@3.3.7:
resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -4465,6 +4848,10 @@ packages:
dev: false
optional: true
+ /natural-compare@1.4.0:
+ resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
+ dev: false
+
/needle@2.9.1:
resolution: {integrity: sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==}
engines: {node: '>= 4.4.x'}
@@ -4594,6 +4981,18 @@ packages:
mimic-fn: 4.0.0
dev: false
+ /optionator@0.9.3:
+ resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ '@aashutoshrathi/word-wrap': 1.2.6
+ deep-is: 0.1.4
+ fast-levenshtein: 2.0.6
+ levn: 0.4.1
+ prelude-ls: 1.2.1
+ type-check: 0.4.0
+ dev: false
+
/ora@7.0.1:
resolution: {integrity: sha512-0TUxTiFJWv+JnjWm4o9yvuskpEJLXTcng8MJuKd+SzAzp2o+OP3HWqNhB4OdJRt1Vsd9/mR0oyaEYlOnL7XIRw==}
engines: {node: '>=16'}
@@ -4692,7 +5091,6 @@ packages:
engines: {node: '>=6'}
dependencies:
callsites: 3.1.0
- dev: true
/parse-bmfont-ascii@1.0.6:
resolution: {integrity: sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==}
@@ -4794,7 +5192,6 @@ packages:
/path-is-absolute@1.0.1:
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
- dev: true
/path-key@3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
@@ -4833,7 +5230,6 @@ packages:
/path-type@4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
- dev: true
/path-type@5.0.0:
resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==}
@@ -5506,6 +5902,33 @@ packages:
which-pm: 2.0.0
dev: false
+ /prelude-ls@1.2.1:
+ resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
+ engines: {node: '>= 0.8.0'}
+ dev: false
+
+ /prettier-eslint@15.0.1:
+ resolution: {integrity: sha512-mGOWVHixSvpZWARqSDXbdtTL54mMBxc5oQYQ6RAqy8jecuNJBgN3t9E5a81G66F8x8fsKNiR1HWaBV66MJDOpg==}
+ engines: {node: '>=10.0.0'}
+ dependencies:
+ '@types/eslint': 8.56.0
+ '@types/prettier': 2.7.3
+ '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@4.9.5)
+ common-tags: 1.8.2
+ dlv: 1.1.3
+ eslint: 8.56.0
+ indent-string: 4.0.0
+ lodash.merge: 4.6.2
+ loglevel-colored-level-prefix: 1.0.0
+ prettier: 2.8.8
+ pretty-format: 23.6.0
+ require-relative: 0.8.7
+ typescript: 4.9.5
+ vue-eslint-parser: 8.3.0(eslint@8.56.0)
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
/prettier-plugin-astro@0.12.2:
resolution: {integrity: sha512-1OXSEht27zrnX7rCa0bEpLdspeumFW4hnj4+JzPuG5bRlSOAhD0rbXBNZfRD9q0Qbr00EcCcnjd6k6M8q+GfTA==}
engines: {node: ^14.15.0 || >=16.0.0}
@@ -5514,11 +5937,24 @@ packages:
prettier: 3.1.1
sass-formatter: 0.7.8
+ /prettier@2.8.8:
+ resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
+ engines: {node: '>=10.13.0'}
+ hasBin: true
+ dev: false
+
/prettier@3.1.1:
resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==}
engines: {node: '>=14'}
hasBin: true
+ /pretty-format@23.6.0:
+ resolution: {integrity: sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==}
+ dependencies:
+ ansi-regex: 3.0.1
+ ansi-styles: 3.2.1
+ dev: false
+
/pretty-hrtime@1.0.3:
resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==}
engines: {node: '>= 0.8'}
@@ -5577,7 +6013,6 @@ packages:
/punycode@2.3.1:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
- dev: true
/queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
@@ -5645,6 +6080,10 @@ packages:
dependencies:
picomatch: 2.3.1
+ /reflect-metadata@0.1.14:
+ resolution: {integrity: sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==}
+ dev: false
+
/regenerator-runtime@0.13.11:
resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
dev: false
@@ -5754,10 +6193,13 @@ packages:
resolution: {integrity: sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==}
dev: true
+ /require-relative@0.8.7:
+ resolution: {integrity: sha512-AKGr4qvHiryxRb19m3PsLRGuKVAbJLUD7E6eOaHkfKhwc+vSgVOCY5xNvm9EkolBKTOf0GrQAZKLimOCz81Khg==}
+ dev: false
+
/resolve-from@4.0.0:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
- dev: true
/resolve-from@5.0.0:
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
@@ -5824,7 +6266,6 @@ packages:
hasBin: true
dependencies:
glob: 7.2.3
- dev: true
/rollup@4.6.1:
resolution: {integrity: sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==}
@@ -6041,7 +6482,6 @@ packages:
/slash@3.0.0:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
- dev: true
/slash@5.1.0:
resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==}
@@ -6208,7 +6648,6 @@ packages:
engines: {node: '>=0.10.0'}
dependencies:
ansi-regex: 2.1.1
- dev: true
/strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
@@ -6251,6 +6690,11 @@ packages:
dev: false
optional: true
+ /strip-json-comments@3.1.1:
+ resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
+ engines: {node: '>=8'}
+ dev: false
+
/strtok3@7.0.0:
resolution: {integrity: sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==}
engines: {node: '>=14.16'}
@@ -6326,7 +6770,6 @@ packages:
/supports-color@2.0.0:
resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==}
engines: {node: '>=0.8.0'}
- dev: true
/supports-color@3.2.3:
resolution: {integrity: sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==}
@@ -6346,7 +6789,6 @@ packages:
engines: {node: '>=8'}
dependencies:
has-flag: 4.0.0
- dev: true
/supports-hyperlinks@3.0.0:
resolution: {integrity: sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==}
@@ -6441,7 +6883,6 @@ packages:
/text-table@0.2.0:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
- dev: true
/thenby@1.3.4:
resolution: {integrity: sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ==}
@@ -6499,12 +6940,26 @@ packages:
typescript: 5.3.2
dev: false
+ /tslib@1.14.1:
+ resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
+ dev: false
+
/tslib@2.6.2:
resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
requiresBuild: true
dev: true
optional: true
+ /tsutils@3.21.0(typescript@4.9.5):
+ resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
+ engines: {node: '>= 6'}
+ peerDependencies:
+ typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
+ dependencies:
+ tslib: 1.14.1
+ typescript: 4.9.5
+ dev: false
+
/tunnel-agent@0.6.0:
resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
requiresBuild: true
@@ -6513,6 +6968,18 @@ packages:
dev: false
optional: true
+ /type-check@0.4.0:
+ resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
+ engines: {node: '>= 0.8.0'}
+ dependencies:
+ prelude-ls: 1.2.1
+ dev: false
+
+ /type-fest@0.20.2:
+ resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
+ engines: {node: '>=10'}
+ dev: false
+
/type-fest@2.19.0:
resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
engines: {node: '>=12.20'}
@@ -6539,6 +7006,12 @@ packages:
hasBin: true
dev: true
+ /typescript@4.9.5:
+ resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
+ engines: {node: '>=4.2.0'}
+ hasBin: true
+ dev: false
+
/typescript@5.3.2:
resolution: {integrity: sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==}
engines: {node: '>=14.17'}
@@ -6684,7 +7157,6 @@ packages:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
dependencies:
punycode: 2.3.1
- dev: true
/utif@2.0.1:
resolution: {integrity: sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg==}
@@ -6695,6 +7167,11 @@ packages:
/util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
+ /uuid@9.0.1:
+ resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==}
+ hasBin: true
+ dev: false
+
/validate-npm-package-license@3.0.4:
resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
dependencies:
@@ -6927,6 +7404,24 @@ packages:
resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==}
dev: false
+ /vue-eslint-parser@8.3.0(eslint@8.56.0):
+ resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: '>=6.0.0'
+ dependencies:
+ debug: 4.3.4
+ eslint: 8.56.0
+ eslint-scope: 7.2.2
+ eslint-visitor-keys: 3.4.3
+ espree: 9.6.1
+ esquery: 1.5.0
+ lodash: 4.17.21
+ semver: 7.5.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
/web-namespaces@2.0.1:
resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==}
dev: false
diff --git a/public/js/main.js b/public/js/main.js
deleted file mode 100644
index 74b86e2..0000000
--- a/public/js/main.js
+++ /dev/null
@@ -1,3670 +0,0 @@
-if (!console) console = { log: function() {} };
-var debug = true;
-
-if (window.location.hostname != "localhost") {
- debug = false;
-}
-
-var cl = function cl(msg) {
- if (debug) {
- console.log(msg);
- }
-};
-
-if (!debug) {
- console = { log: function() {} };
-}
-
-var app = (function($) {
-
- var init = function init($) {
- cl('Application initializing...');
- var errors = 0;
- // var scroll = new SmoothScroll('a[href*="#"]');
-
- setTimeout(function() {
- $(window).scroll();
- }, 100);
-
- $('.form-control, .form-select').on('blur', function(){
- if($(this).val().length > 0){
- $(this).addClass('active');
- } else {
- $(this).removeClass('active');
- }
- });
-
- $('.component').each(function() {
- var componentName = $(this).attr('cp-name');
- var check = typeof window[componentName];
- if (check != "undefined" && window[componentName].init) {
- window[componentName].init();
- } else {
- if (typeof componentName != "undefined") {
- cl('+++[ERROR]+++ Unable to load component [' + componentName + '], function was not found or missing init().');
- } else {
- cl('+++[ERROR]+++ Component missing "cp-name" parameter.');
- console.log($(this));
- }
- errors++;
- }
- });
-
- if (errors > 0) {
- cl('Application was initiaded but ' + errors + ' component(s) did not load.');
- } else {
- cl('All application components initiated.');
- }
-
- $(".loader").addClass('loaded');
- };
-
- //write new functions here
-
- return {
- init: init
- }
-})();
-
-jQuery(document).ready(function($) {
- app.init($);
-});
-var boxAgenda = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[boxAgenda] initializing...');
- snackbar.init();
-
- if($('#profile-page').length > 0) {
-
- var profileID = $('.agenda_box').attr('data-profile-id');
- var currentDate = new Date();
-
- function pad(n){
- return n<10 ? '0'+n : n
- }
-
- function getPreviousMonday() {
- var date = new Date();
- var day = date.getDay();
- var prevMonday = new Date();
- if(date.getDay() == 0){
- prevMonday.setDate(date.getDate() - 7);
- }
- else{
- prevMonday.setDate(date.getDate() - (day-1));
- }
-
- var mondayUnformatted = new Date(prevMonday);
- var mondayFormat = mondayUnformatted.getFullYear()+'-'+pad(mondayUnformatted.getMonth() + 1)+'-'+pad(mondayUnformatted.getDate());
-
- return mondayFormat;
- }
-
- function getNextMonday(date) {
- var day = date.getDay();
- var prevMonday = new Date();
-
- date.setDate(date.getDate() + (7-date.getDay())%7+1);
-
- var mondayUnformatted = new Date(date);
- var mondayFormat = mondayUnformatted.getFullYear()+'-'+pad(mondayUnformatted.getMonth() + 1)+'-'+pad(mondayUnformatted.getDate());
-
- currentDate = mondayUnformatted;
-
- return mondayFormat;
- }
-
-
- $.getJSON(_BASE_URL_+'users/get_schedule?profile_id='+profileID+'&initial_date='+getNextMonday(currentDate)+'', function(response){
- var htmlBase = '';
-
- $('.agenda_slider').append(htmlBase);
-
- $.each(response.abbrv, function(index, value){
- var dayDate = new Date(response.days[index].replace(/-/g, '\/'));
-
- $('.agenda_slider .step-agenda').last().children('.table_header').children('.row').append(''+
- ''+
- '
'+dayDate.getDate()+'
'+
- '
');
-
- $('.agenda_slider .step-agenda').last().children('.table_agenda-days').children('.row').append('');
- });
-
-
- $.each(response.schedule, function(index, value){
- var dayDate = new Date(response.days[index].replace(/-/g, '\/'));
- $.each(value, function(i, v){
- const agendaContent = getAgendaListContent(v, dayDate);
-
- $('.agenda_slider .step-agenda')
- .last()
- .children('.table_agenda-days')
- .children('.row')
- .children('.col[data-day="'+dayDate.getDate()+'"]')
- .children('ul').append(agendaContent);
- });
- });
-
- $('.agenda_slider').slick({
- dots: false,
- infinite: false,
- prevArrow: $('.previous_arrow'),
- nextArrow: $('.next_arrow')
- });
- });
-
-
-
- $('.next_arrow').on('click', function(){
- var slideIndex = $('.agenda_slider .slick-active').attr('data-slick-index');
- $('.agenda_loader').addClass('loading');
- $('.agenda_slider').css('visibility', 'hidden').slick('unslick');
-
- $.getJSON(_BASE_URL_+'users/get_schedule?profile_id='+profileID+'&initial_date='+getNextMonday(currentDate)+'', function(response){
- var htmlBase = '';
-
- $('.agenda_slider').append(htmlBase);
-
- $.each(response.abbrv, function(index, value){
- var dayDate = new Date(response.days[index].replace(/-/g, '\/'));
-
- $('.agenda_slider .step-agenda').last().children('.table_header').children('.row').append(''+
- ''+
- '
'+dayDate.getDate()+'
'+
- '
');
-
- $('.agenda_slider .step-agenda').last().children('.table_agenda-days').children('.row').append('');
- });
-
-
- $.each(response.schedule, function(index, value){
- var dayDate = new Date(response.days[index].replace(/-/g, '\/'));
- $.each(value, function(i, v){
- const agendaContent = getAgendaListContent(v, dayDate);
-
- $('.agenda_slider .step-agenda').last().children('.table_agenda-days').children('.row').children('.col[data-day="'+dayDate.getDate()+'"]').children('ul').append(agendaContent);
- });
- });
-
- $('.agenda_slider').slick({
- dots: false,
- infinite: false,
- prevArrow: $('.previous_arrow'),
- nextArrow: $('.next_arrow'),
- initialSlide: parseInt(slideIndex),
- });
-
- $('.agenda_slider').css('visibility', 'visible');
- $('.agenda_loader').removeClass('loading');
-
- $('.agenda_slider').slick('slickGoTo', parseInt(slideIndex) + 1);
- });
- });
-
- // MODAL PARA AGENDAR CONSULTA
-
- $(document).on('click', '.available-date', function(event){
- const dateHour = $(this).children('.agenda_input-hour').attr('data-hour');
- const arrDateHour = dateHour.split(':');
- const lastDateHour = `${arrDateHour[0]}:50`;
-
- $('.modal_agenda-date-hour').html(dateHour);
- $('.modal_agenda-last-date-hour').html(lastDateHour);
- $('.modal-agenda_month').html($('.step-agenda.slick-active').attr('data-month'));
- $('.modal-agenda_day').html($(this).children('.agenda_input-hour').attr('data-day'));
- $('.modal-agenda_year').html($('.step-agenda.slick-active').attr('data-year'));
- $('.modal-hidden_fullDate').val($(this).attr('info-date'));
- $('#appointmentModal').modal('show');
- });
-
- $('.agenda_slider').on('afterChange', function(slick, currentSlide){
- $('.agenda_month').html($('.step-agenda.slick-active').attr('data-month'));
- $('.agenda_year').html($('.step-agenda.slick-active').attr('data-year'));
- });
-
- $('.terapiaRadio').on('change', function(){
- if($(this).is(':checked')) {
- $('.agenda_price').html($(this).attr('data-price'));
- }
- });
-
-
- $('#solicitar_agendamento').on('click', function(){
- var therapistId = $('.therapist_id').val();
- var modalityId = $('.terapiaRadio:checked').val();
- var mode = $('.therapy_mode:checked').val();
- var day = $('.modal-hidden_fullDate').val();
- var hour = $('.modal_agenda-date-hour').html();
-
-
- if(modalityId != '' || mode != '') {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'users/schedule_appointment',
- data: {"therapist_id": therapistId, "modality_id": modalityId, "mode": mode, "day": day, "hour": hour},
- error: function(response) {
- snackbar.show(response.responseJSON.error, 'error');
- }
- }).done(function( msg ) {
- if(msg.next === 'waiting_therapist' || msg.next === 'payment') {
- $('#appointmentModal').modal('hide');
- // $('#agendar_consulta-sucesso').modal('show');
- window.location.href = window.location.origin + '/appointments/payment/' + msg.appoitment_id;
- }
- });
- }
-
- });
- }
-
- cl('[boxAgenda] initiated.');
- };
-
- var getAgendaListContent = function(schedule, dayDate) {
- const scheduleItemClass = schedule.selected ? '' : 'available-date';
- const wrapperClass = schedule.selected ? 'selected' : 'none';
- const formattedDate = `${dayDate.getFullYear()}-${dayDate.getMonth()}-${dayDate.getDate()}`;
-
- return `
-
-
-
- `;
- }
-
- return {
- init: init
- }
-})();
-var appointments = (function() {
- var appointmentsData = [];
- var blockedSchedules = [];
- var appointmentModalContainer = document.querySelector('#appointmentsModal');
- const userRole = $('#shcedulesPage').attr('data-role');
- const appointmentUser = (userRole == 1) ? 'therapist' : 'patient';
-
- var populateAppointments = function(month, year, type) {
- const daysInMonth = dayjs(`${year}-${month}-01`).daysInMonth();
-
- $.ajax({
- url: `${_BASE_URL_}api/get_blocked_schedules`,
- type: 'GET',
- data: {
- date_begin: `${year}-${month}-01 12:00`,
- date_end: `${year}-${month}-${daysInMonth} 14:00`
- }
- }).done(function(blockedData) {
- blockedSchedules = [...blockedSchedules, ...blockedData];
-
- $.getJSON(`/dashboard/schedules/getCalendar/${year}-${month}`, function(data) {
- appointmentsData = [...appointmentsData, ...data];
-
- appointmentsData = appointmentsData.filter(function(item, pos) {
- return appointmentsData.indexOf(item) == pos;
- });
-
- appointmentsForCalendarType(type, data, blockedData);
- });
- });
-
- };
-
- var appointmentsForCalendarType = function(type, appointments, blockedData) {
- switch(type) {
- case("month"):
- buildMontlyAppointments(appointments, blockedData);
- break;
- case("week"):
- buildWeeklyAppointments(appointments, blockedData);
- break;
- case("day"):
- buildDailyAppointments(appointments, blockedData);
- break;
- }
-
- appointmentsHandleEvents();
- };
-
- var buildMontlyAppointments = function(appointments, blockedData) {
- var checkEventsByDate = function(date) {
- return $('.day-item__events[data-date="' + date + '"]').find('.day-item__events-item:visible').length;
- }
-
- blockedData.forEach(function(block) {
- const formattedDate = dayjs(block.begin).format('YYYY-MM-DD');
- let blockContent = '';
- let blockClass = 'appointment--visible';
-
- if (checkEventsByDate(formattedDate) >= 3) {
- blockClass = 'appointment--hidden';
- appointmentSeeMore(formattedDate);
- }
-
- blockContent = `
-
- Horário bloqueado
-
- `;
-
- $('.day-item__events[data-date="' + formattedDate + '"]').append(blockContent);
- });
-
- appointments.forEach(function(appointment) {
- let appointmentPrefix = getAppointmentPrefix(appointment);
- let appointmentContent = '';
- let appointmentClass = 'appointment--visible';
-
- if (checkEventsByDate(appointment.day) >= 3) {
- appointmentClass = 'appointment--hidden';
- appointmentSeeMore(appointment.day);
- }
-
- appointmentContent = `
- ${appointment[appointmentUser].name}
-
`;
-
-
- $('.day-item__events[data-date="' + appointment.day + '"]').append(appointmentContent);
- });
-
- seeMoreEvents();
- };
-
- var appointmentSeeMore = function(date) {
- var totalHiddenAppointments = $('.day-item__events[data-date="' + date + '"]').find('.appointment--hidden').length;
- totalHiddenAppointments = parseInt(totalHiddenAppointments) + 1;
-
- if ($('.day-item__events[data-date="' + date + '"]').find('.appointment__see-more').length == 0)
- $('.day-item__events[data-date="' + date + '"]').append(
- `Ver mais `
- );
-
- $('.day-item__events[data-date="' + date + '"]').find('.total-hidden').html(totalHiddenAppointments);
- };
-
- var seeMoreEvents = function() {
- $('#appointmentsModal').on('shown.bs.modal', function() {
- appointmentsModalDayEvents();
- });
-
- $('.appointment__see-more').off().on({
- 'click' : function(ev) {
- var itemEventContainer = $(this).closest('.day-item__events');
- var items = itemEventContainer.find('.day-item__events-item').clone();
- var itemDate = itemEventContainer[0].dataset.date;
- var formattedDate = dayjs(itemDate);
- var weekDays = dayjs.weekdays();
- var weekDay = weekDays[formattedDate.$W];
-
- $(appointmentModalContainer).find('.appointment-modal__week').html(weekDay);
- $(appointmentModalContainer).find('.appointment-modal__day').html(formattedDate.$D)
- $(appointmentModalContainer).modal('show');
- $(appointmentModalContainer).find('.appointments__see-more__content').html(items);
- $(appointmentModalContainer).find('.appointment--hidden').removeClass('appointment--hidden');
- ev.preventDefault();
- }
- })
- };
-
- var appointmentsModalDayEvents = function() {
- $('.appointments__see-more__content .day-item__events-item').off().on({
- 'click' : function() {
- if ($(this).hasClass('day-item__events-item__blocked'))
- showBlockedModal($(this));
- else
- showAppointmentModal($(this));
- }
- });
- };
-
- var showBlockedModal = function(target) {
- console.log(target);
- };
-
- var showAppointmentModal = function(target) {
- const { appointment } = target.data();
- const appointmentItem = appointmentsData.filter(item => item.id === appointment)[0];
- const patientModalContainer = document.querySelector('#patientModal');
-
- $(patientModalContainer).off().on('show.bs.modal', function() {
- patientModal.populateModal(appointmentItem);
- });
-
- $(appointmentModalContainer).modal('hide');
- $(patientModalContainer).modal('show');
-
- };
-
- var buildWeeklyAppointments = function(appointments, blockedData) {
- var checkNumberPrefix = function(number) {
- return (number > 9) ? number : ('0' + number);
- }
-
- appointments.forEach(function(appointment) {
-
- const appointmentPrefix = getAppointmentPrefix(appointment);
- const hours = new Date(appointment.hour).getHours();
- const day = appointment.day;
- const timeRange = `${checkNumberPrefix(hours)}:00 às ${checkNumberPrefix(parseInt(hours) + 1)}:00`;
-
- $(`.day-item__events[data-date="${day}"][data-hour="${hours}"]`).append(
- `
- ${appointment[appointmentUser].name}
- ${timeRange}
-
`
- );
- });
- };
-
- var buildDailyAppointments = function(appointments, blockedData) {
- var checkNumberPrefix = function(number) {
- return (number > 9) ? number : ('0' + number);
- }
-
- appointments.forEach(function(appointment) {
- const appointmentPrefix = getAppointmentPrefix(appointment);
- const hours = new Date(appointment.hour).getHours();
- const day = appointment.day;
- const timeRange = `${checkNumberPrefix(hours)}:00 às ${checkNumberPrefix(parseInt(hours) + 1)}:00`;
-
- $(`.day-item__events[data-date="${day}"][data-hour="${hours}"]`).append(
- `
- ${appointment[appointmentUser].name}
- ${timeRange}
-
`
- );
- });
- };
-
- var getAppointmentPrefix = function(appointment) {
- let appointmentPrefix;
-
- switch(appointment.status_name) {
- case('Feriados'):
- appointmentPrefix = 'holiday';
- break;
- case('Agendada'):
- appointmentPrefix = 'scheduled';
- break;
- case('Em andamento'):
- appointmentPrefix = 'in-progress';
- break;
- case("Finalizada"):
- appointmentPrefix = 'done';
- break;
- case('Aguardando Psicólogo'):
- appointmentPrefix = 'in-progress';
- break;
- case('Não compareceu'):
- appointmentPrefix = 'absent';
- break;
- default:
- appointmentPrefix = 'canceled';
- break;
- }
-
- return appointmentPrefix;
- };
-
- var appointmentsHandleEvents = function() {
- var patientModalContainer = document.querySelector('#patientModal');
-
- $('.day-item__events-item').off().on({
- 'click' : function() {
- if ($(this).hasClass('day-item__events-item__blocked'))
- showMonthlyBlockModal($(this));
- else
- showMonthlyAppointmentModal($(this));
- }
- });
- };
-
- var showMonthlyBlockModal = function(target) {
- const { blocked } = target.data();
- const blockedItem = blockedSchedules.filter(item => item.id === blocked)[0];
- const unblockModalContainer = document.querySelector('#unBlockModal');
-
- $(unblockModalContainer).off().on('shown.bs.modal', function() {
- blockModal.populateUnblockModal(blockedItem);
- });
-
- $(unblockModalContainer).modal('show');
- };
-
- var showMonthlyAppointmentModal = function(target) {
- const { appointment } = target.data();
- const appointmentItem = appointmentsData.filter(item => item.id === appointment)[0];
- const patientModalContainer = document.querySelector('#patientModal');
-
- $(patientModalContainer).off().on('show.bs.modal', function() {
- patientModal.populateModal(appointmentItem);
- });
-
- $(patientModalContainer).modal('show');
- };
-
- var cancelAppointment = function(appointmentId) {
- $(`.day-item__events-item[data-appointment="${appointmentId}"]`).attr('data-status', 'canceled');
- $(`.day-item__events-item[data-appointment="${appointmentId}"]`).attr('title', 'Consulta cancelada');
-
- appointmentsData = appointmentsData.map(
- appointment => {
- if (appointment.id == appointmentId) {
- appointment.status_name = "Cancelada";
- appointment.status = 6;
- }
-
- return appointment;
- }
-
- );
- };
-
- var updateAppointment = function(appointment) {
- var prefix = getAppointmentPrefix(appointment);
-
- $(`.day-item__events-item[data-appointment="${appointment.id}"]`).attr('data-status', `${prefix}`);
- $(`.day-item__events-item[data-appointment="${appointment.id}"]`).attr('title', `${appointment.status_name}`);
-
- appointmentsData = appointmentsData.map(
- item => {
- if (item.id == appointment.id) {
- item.status_name = appointment.status_name;
- item.status = appointment.status;
- }
-
- return item;
- }
- );
- };
-
- var resetData = function() {
- blockedSchedules = [];
- appointmentsData = [];
- };
-
-
- var appointmentModalEvents = function() {
- $('#solicitar_agendamento').off().on('click', function(){
- var therapistId = $('.therapist_id').val();
- var modalityId = $('.terapiaRadio:checked').val();
- var mode = $('.therapy_mode:checked').val();
- var day = $('.modal-hidden_fullDate').val();
- var hour = $('.modal_agenda-date-hour').html();
- var day = $('#period-date').attr('data-date');
- var hour = $('#period-time').val();
-
-
- if(modalityId != '' || mode != '') {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'users/schedule_appointment',
- data: {"therapist_id": therapistId, "modality_id": modalityId, "mode": mode, "day": day, "hour": hour},
- error: function(response) {
- snackbar.show(response.responseJSON.error, 'error');
- }
- }).done(function( msg ) {
- if(msg.next === 'waiting_therapist' || msg.next === 'payment') {
- $('#appointmentModal').modal('hide');
- $('#agendar_consulta-sucesso').modal('show');
- }
- });
- }
-
- });
- };
-
- return {
- populateAppointments: function(month, year, type) {
- return populateAppointments(month, year, type)
- },
- appointmentsForCalendarType: function(type) {
- return appointmentsForCalendarType(type);
- },
- getAppointmentPrefix: function(appointment) {
- return getAppointmentPrefix(appointment);
- },
- resetData: resetData,
- cancelAppointment: function(appointmentId) {
- return cancelAppointment(appointmentId);
- },
- updateAppointment: function(appointment) {
- return updateAppointment(appointment);
- },
- appointmentModalEvents: appointmentModalEvents
- }
-}());
-
-var blockModal = (function () {
- var blockModalEl = document.getElementById('blockModal');
- var unblockModalEl = document.getElementById('unBlockModal');
-
- var init = function () {
- console.log('[block-modal] initializing');
- snackbar.init();
-
- blockModalEl.addEventListener('show.bs.modal', function () {
- $('input').val('');
- });
-
- $('#lock-time-form').off().on({
- 'submit': function (ev) {
- const startDate = $('#start-date').attr('data-date');
- const endDate = $('#end-date').attr('data-date');
- const startTime = $('#start-time').val();
- const endTime = $('#end-time').val();
-
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'dashboard/schedules/block_schedule',
- data: {
- 'begin': `${startDate} ${startTime}`,
- 'end': `${endDate} ${endTime}`
- },
- error: function(data, status, jqXHR) {
- var error = data.responseJSON.end.end;
- snackbar.show(error, 'error');
- }
- }).done(function(data, textStatus, jqXHR) {
-
- if (jqXHR.status === 204) {
- $(blockModalEl).modal('hide');
- snackbar.show('Horário bloqueado com successo!', 'success');
- window.location.reload();
- }
- });
-
- ev.preventDefault();
- }
- });
-
- console.log('[block-modal] initilialized');
- };
-
- var populateUnblockModal = function (data) {
- const formattedBegin = dayjs(data.begin).format('MMMM D, YYYY - HH:mm');
- const formattedEnd = dayjs(data.end).format('MMMM D, YYYY - HH:mm');
- $('#unblock-begin').html(formattedBegin);
- $('#unblock-end').html(formattedEnd);
-
- $('.cancel-block__button').off().on({
- 'click' : function() {
- $.ajax({
- type: 'POST',
- url: `${_BASE_URL_}api/delete_blocked_schedules`,
- data: {
- id: data.id
- },
- error: function(data, status, jqXHR) {
- var error = data.responseJSON.message;
- snackbar.show(error, 'error');
- }
- }).done(function(result, textStatus, jqXHR) {
- if (jqXHR.status === 204) {
- $(unblockModalEl).modal('hide');
- snackbar.show('Bloqueio removido com sucesso!', 'success');
- $(`.day-item__events-item__blocked[data-blocked="${data.id}"]`).remove();
- }
- });
- }
- })
- };
-
- return {
- init: init,
- populateUnblockModal: data => populateUnblockModal(data)
- }
-})();
-var calendar = (function () {
- const TODAY = dayjs().format("YYYY-MM-DD");
- const INITIAL_YEAR = dayjs().format("YYYY");
- const INITIAL_MONTH = dayjs().format("MM");
-
- let selectedMonth,
- currentWeek,
- oldCurrentDay,
- currentDay;
-
- var weekDays = [];
-
- var init = function init() {
- cl("[calendar] initializing...");
-
- dayjs.locale('pt-br');
- dayjs.extend(dayjs_plugin_localeData);
- dayjs.extend(dayjs_plugin_updateLocale);
- dayjs.extend(dayjs_plugin_weekday);
- dayjs.extend(dayjs_plugin_weekOfYear);
-
- dayjs.updateLocale('pt-br', {
- weekdays: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
- weekdaysMin: ["D", "S", "T", "Q", "Q", "S", "S"]
- });
-
- selectedMonth = dayjs(new Date(INITIAL_YEAR, INITIAL_MONTH - 1, 1));
- currentWeek = dayjs().week();
- currentDay = dayjs();
- oldCurrentDay = currentDay;
-
- weekDays = dayjs.weekdays();
-
- startSelectedCalendarFormat();
- activeCalendarEvents();
- };
-
- var activeCalendarEvents = function () {
- $('.calendar__header-button').off().on('click', function () {
- $('.calendar-content').html('');
- $('.calendar__header-button.active').removeClass('active');
- $(this).addClass("active");
- startSelectedCalendarFormat();
- });
- }
-
- var startSelectedCalendarFormat = function () {
- var activeFormat = getActiveCalendarFormat();
-
- if (activeFormat == "month") {
- selectedMonth = dayjs(new Date(currentDay.format("YYYY"), currentDay.format("MM") - 1, 1));
- buildMonthlyCalendar(currentDay.format("YYYY"), currentDay.format("MM"));
- }
-
- if (activeFormat == "week") {
- currentWeek = currentDay.week();
- buildWeeklyCalendar();
- }
-
- if (activeFormat == "day")
- buildDailyCalendar();
-
- calendarEvents();
- };
-
- var buildMonthlyCalendar = function buildMonthlyCalendar(year = INITIAL_YEAR, month = INITIAL_MONTH) {
- var monthlyCalendarHeader = '';
- var weekdayContainer = document.querySelector('.calendar__weekdays--monthly');
- var monthlyDays = document.querySelector('.calendar__monthly-days');
-
- document.getElementById("selected-month").innerText = dayjs(
- new Date(year, month - 1)
- ).format("MMMM");
-
- document.getElementById("selected-year").innerText = dayjs(
- new Date(year, month - 1)
- ).format("YYYY");
-
- weekDays.forEach((weekDay) => {
- monthlyCalendarHeader += `${weekDay}
`;
- });
-
- weekdayContainer.innerHTML = monthlyCalendarHeader;
-
- currentMonthDays = createDaysForCurrentMonth(
- year,
- month,
- dayjs(`${year}-${month}-01`).daysInMonth()
- );
-
- previousMonthDays = createDaysForPreviousMonth(year, month);
- nextMonthDays = createDaysForNextMonth(year, month);
-
- const days = [...previousMonthDays, ...currentMonthDays, ...nextMonthDays];
- const daysContent = getDaysContent(days);
-
- monthlyDays.innerHTML = daysContent.join('');
-
- appointments.populateAppointments(month, year, "month");
-
- if (previousMonthDays.length > 0) {
- const previousMonth = dayjs(`${year}-${month}-01`).subtract(1, "month");
- appointments.populateAppointments(previousMonth.format("MM"), previousMonth.format("YYYY"), "month");
- }
-
- if (nextMonthDays.length > 0) {
- const nextMonth = dayjs(`${year}-${month}-01`).add(1, "month");
- appointments.populateAppointments(nextMonth.format("MM"), nextMonth.format("YYYY"), "month");
- }
- };
-
- var getDaysContent = function getDaysContent(days) {
- let daysContent = [];
-
- daysContent.push(``);
-
- days.forEach((day, dayIndex) => {
- const dayContainerClass =
- (day.date === TODAY) ? 'is-current-day' : day.isCurrentMonth
- ? 'current-month' : 'previous-month';
-
- daysContent.push(`
-
- `);
-
- if ((parseInt(dayIndex) + 1) % 7 == 0 && days[parseInt(dayIndex) + 1])
- daysContent.push(`
`);
- });
-
- daysContent.push('
');
-
- return daysContent;
- };
-
- var buildWeeklyCalendar = function buildWeeklyCalendar() {
- var weeklyCalendarHeader = '';
- var weekdayContainer = document.querySelector('.calendar__weekdays--weekly');
- var weeklyDays = document.querySelector('.calendar__weekly-days');
- var daysContent = ['');
-
- var getContentForDates = function(hour) {
- const content = [];
-
- formatedDates.forEach(item => {
- content.push(``);
- });
-
- return content.join('');
- }
-
- for (let i = 0; i < 10; i ++) {
- let sum = parseInt(9) + i;
- sum = (sum < 10) ? ('0' + sum) : sum;
-
- const daytime = sum + ':00';
- const daytimeLine = (i < 9) ? `${daytime}` : '';
-
- daysContent.push(`
-
${daytimeLine}
`);
-
-
- daysContent.push(getContentForDates((sum - 1)));
- daysContent.push('
')
- }
-
- weekdayContainer.innerHTML = weeklyCalendarHeader;
- weeklyDays.innerHTML = daysContent.join('');
-
- appointments.populateAppointments(oldCurrentDay.format("MM"), oldCurrentDay.format("YYYY"), "week");
- };
-
- var buildDailyCalendar = function buildDailyCalendar() {
- var dailyCalendarHeader = '';
- var weekdayContainer = document.querySelector('.calendar__weekdays');
- var dailyDays = document.querySelector('.calendar__daily-days');
- var dailyDaysContent = [];
-
- document.getElementById("selected-month").innerText = `${currentDay.format("D")} de ${currentDay.format("MMMM")}`;
- document.getElementById("selected-year").innerText = currentDay.$y;
-
- dailyDaysContent.push(
- ``
- );
-
- dailyDaysContent.push(
- ``
- );
-
- for (let i = 0; i < 10; i ++) {
- let sum = parseInt(8) + i;
- sum = (sum < 10) ? ('0' + sum) : sum;
-
- const daytime = sum + ':00';
- const daytimeLine = (i < 9) ? `${daytime}` : '';
- const hour = sum - 1;
- const currentDate = currentDay.format("YYYY-MM-DD");
-
- dailyDaysContent.push(`
-
- `);
-
- }
-
- dailyDays.innerHTML = dailyDaysContent.join('');
- weekdayContainer.innerHTML = dailyCalendarHeader;
- appointments.populateAppointments(oldCurrentDay.format("MM"), oldCurrentDay.format("YYYY"), "day");
- };
-
- var getActiveCalendarFormat = function () {
- return "month";
-
- var calendarButtons = [...document.querySelectorAll('.calendar__header-button')];
- var activeFormat = calendarButtons.filter(button => button.classList.contains('active'));
- return activeFormat[0].dataset.calendarFormat;
- };
-
- var getNumberOfDaysInMonth = function getNumberOfDaysInMonth(year, month) {
- return dayjs(`${year}-${month}-01`).daysInMonth();
- }
-
- var createDaysForCurrentMonth = function createDaysForCurrentMonth(year, month) {
- return [...Array(getNumberOfDaysInMonth(year, month))].map((day, index) => {
- return {
- date: dayjs(`${year}-${month}-${index + 1}`).format("YYYY-MM-DD"),
- dayOfMonth: index + 1,
- isCurrentMonth: true
- };
- });
- }
-
- var createDaysForPreviousMonth = function createDaysForPreviousMonth(year, month) {
- const firstDayOfTheMonthWeekday = getWeekday(currentMonthDays[0].date);
-
- const previousMonth = dayjs(`${year}-${month}-01`).subtract(1, "month");
-
- const visibleNumberOfDaysFromPreviousMonth = firstDayOfTheMonthWeekday
- ? firstDayOfTheMonthWeekday
- : 0;
-
- const previousMonthLastMondayDayOfMonth = dayjs(currentMonthDays[0].date)
- .subtract(visibleNumberOfDaysFromPreviousMonth, "day")
- .date();
-
- return [...Array(visibleNumberOfDaysFromPreviousMonth)].map((day, index) => {
- return {
- date: dayjs(
- `${previousMonth.year()}-${previousMonth.month() + 1}-${previousMonthLastMondayDayOfMonth + index
- }`
- ).format("YYYY-MM-DD"),
- dayOfMonth: previousMonthLastMondayDayOfMonth + index,
- isCurrentMonth: false
- };
- });
- }
-
- var createDaysForNextMonth = function createDaysForNextMonth(year, month) {
- const lastDayOfTheMonthWeekday = getWeekday(
- `${year}-${month}-${currentMonthDays.length}`
- );
-
- const nextMonth = dayjs(`${year}-${month}-01`).add(1, "month");
-
- const visibleNumberOfDaysFromNextMonth = (lastDayOfTheMonthWeekday < 7)
- ? 6 - lastDayOfTheMonthWeekday
- : 0;
-
- return [...Array(visibleNumberOfDaysFromNextMonth)].map((day, index) => {
- return {
- date: dayjs(
- `${nextMonth.year()}-${nextMonth.month() + 1}-${index + 1}`
- ).format("YYYY-MM-DD"),
- dayOfMonth: index + 1,
- isCurrentMonth: false
- };
- });
- }
-
- var getWeekday = function getWeekday(date) {
- return dayjs(date).weekday();
- }
-
- var calendarEvents = function () {
- $('.link__previous-month').off().on({
- 'click': function () {
- appointments.resetData();
- previousEventToCalendarType();
- }
- });
-
- $('.link__next-month').off().on({
- 'click': function () {
- appointments.resetData();
- nextEventToCalendarType();
- }
- });
- }
-
- var previousEventToCalendarType = function () {
- var activeFormat = getActiveCalendarFormat();
-
- if (activeFormat == "month") {
- selectedMonth = dayjs(selectedMonth).subtract(1, "month");
- setCurrentDayOfMonth();
- buildMonthlyCalendar(selectedMonth.format("YYYY"), selectedMonth.format("MM"));
- }
-
- if (activeFormat == "week") {
- currentWeek = parseInt(currentWeek) - 1;
- setCurrentDayOfWeek(currentWeek);
- buildWeeklyCalendar();
- }
-
- if (activeFormat == "day") {
- currentDay = currentDay.subtract(1, "day");
- buildDailyCalendar();
- }
- }
-
- var nextEventToCalendarType = function () {
- var activeFormat = getActiveCalendarFormat();
-
- if (activeFormat == "month") {
- selectedMonth = dayjs(selectedMonth).add(1, "month");
- setCurrentDayOfMonth();
- buildMonthlyCalendar(selectedMonth.format("YYYY"), selectedMonth.format("MM"));
- }
-
- if (activeFormat == "week") {
- currentWeek = parseInt(currentWeek) + 1;
- setCurrentDayOfWeek(currentWeek);
- buildWeeklyCalendar();
- }
-
- if (activeFormat == "day") {
- currentDay = currentDay.add(1, "day");
- buildDailyCalendar();
- }
- }
-
- var setCurrentDayOfMonth = function() {
- currentDay = selectedMonth;
- }
-
- var setCurrentDayOfWeek = function(week) {
- currentDay = dayjs().week(week).weekday(0);
- }
-
- return {
- init: init
- }
-})();
-var cards = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[cards] initializing...');
-
- $('.add_card_page').on('click', function(){
- $('#add_card_page_modal').modal('show');
- });
-
- $('.btn_addCard').off('click').on('click', function(e){
- if($('#cardsIndex > form').length > 0) {
- $('#cardsIndex > form').submit(function(e) {
- e.preventDefault();
- let form = $(this);
- let actionUrl = form.attr('action');
- console.log(actionUrl);
-
- $.ajax({
- type: "POST",
- url: actionUrl,
- data: form.serialize(),
- success: function(data)
- {
- location.reload()
- }
- });
- });
- } else {
- $('#form_identifier > form').submit();
- }
- });
-
- cl('[cards] initiated.');
- };
-
-
- return {
- init: init
- }
-})();
-
-var clients = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[clients] initializing...');
-
- $(document).on('click','a.modal-start',function(e){
- e.preventDefault();
- var id = $(this).attr('href');
- $(id).modal('show');
- if ($(this).data('edit')>0) {
- $(id).addClass('edit');
- $(id).data('editId',$(this).data('edit'));
- if (id="#newRegisterModal") {
- $('[name="record_name"]').val($(this).data('name'));
- $('[name="record_description"]').val($(this).data('description'));
- $('[name="record_description"] + .note-editor').find('.note-editable').html($(this).data('description'));
- $('[name="record_description"] + .note-editor').find('.note-placeholder').hide();
- $('[name="record_private"]').val($(this).data('private')).change();
- $('[name="record_type_of_record_id"]').val($(this).data('type_of_record_id')).change();
- }
- }
- });
-
- $('.inputFilterSearch + a').on('click',function(e) {
- e.preventDefault();
- $('.inputFilterSearch').toggleClass('open');
- });
-
- $('form.filterSearch select').on('change',function(e) {
- $('form.filterSearch').submit();
- });
-
- $('.client .info .more').on('click',function() {
- $(this).toggleClass('d-none');
- $(this).parent().find('.info_oculta').toggleClass('d-none');
- });
- $('.client .info .less').on('click',function() {
- $(this).parent().toggleClass('d-none');
- $(this).parent().parent().find('.more').toggleClass('d-none');
- });
-
- $('#closeTherapyModal button[type="submit"]').on('click', function(e){
- e.preventDefault();
- $('#closeTherapyModal').modal('hide');
- confirmationModal('closeTherapy');
- });
- $('#reportPatientModal button[type="submit"]').on('click', function(e){
- e.preventDefault();
- $('#reportPatientModal').modal('hide');
- confirmationModal('reportPatient');
- });
- $('.documents.sidebar_client a.delete').on('click', function(e){
- e.preventDefault();
- confirmationModal('docs');
- $('#confirmationModal').data('deleteId',$(this).data('id'));
- });
-
- $('#confirm_delete:not(:disabled)').on('click', function(e){
- e.preventDefault();
- modalConfirmation($('#confirmationModal').data('confirmation'));
- });
- $('#confirm_cancel:not(:disabled)').on('click', function(e){
- e.preventDefault();
- const modal = $(this).attr('data-modal');
- $('#confirmationModal').modal('hide');
- $(`#${modal}`).modal('show');
- });
-
- function confirmationModal(c) {
- $('#confirmationModal').modal('show');
- $('#confirmationModal').data('confirmation',c);
- $('#confirmationModal [class^="confirm_"]').removeClass('d-inline');
- $('#confirmationModal .confirm_'+c).addClass('d-inline');
- $('#confirmationModal .confirm_name_'+c).text($('#'+c+'ModalName').text());
- $('#confirmationModal #confirm_cancel').attr('data-modal', c + 'Modal');
- $('#confirm_cancel,#confirm_delete').removeAttr('disabled');
- }
-
- function modalConfirmation(confirmation) {
- $('#confirm_delete').attr('disabled','');
- $('#confirm_cancel').attr('disabled','');
- switch (confirmation) {
- case 'closeTherapy':
- cl('form iniciado');
- var formUpload = new FormData($('#closeTherapyForm')[0]);
- var closing_description = $('[name="closing_description"]').val();
- var closing_id = $('#closing_id').val();
- var closing_profile = $('#closing_profile').val();
- var closing_patient_at_risk = 0;
- var endPointPath = closing_profile == 'patient' ? 'my' : 'clients';
- if($('#closing_patient_at_risk').is(':checked')) {
- closing_patient_at_risk = 1;
- }
- var closing_attachment = $('#closeTherapyForm [name="attachment"]').val();
- data = {
- 'closing_description': closing_description,
- 'closing_id': closing_id,
- 'closing_patient_at_risk': closing_patient_at_risk,
- 'closing_file_name' : '',
- 'closing_file_url' : '',
- 'closing_file_size' : ''
- }
-
- $('#closeTherapyForm .form_buttons').attr('disabled','');
-
- function requestCloseTherapy() {
- var url = `${_BASE_URL_}dashboard/${endPointPath}/set_end_therapy/${closing_id}`;
- $.ajax({
- method: "POST",
- url: url,
- data: data
- }).done(function( msg ) {
- cl(msg);
- if(msg === true) {
- if(msg === true) {
- cl('realizar ações');
- $('#confirmationModal').modal('hide');
- if($('#client').length) { // verifica se está no prontuário do cliente
- cl('realizar ação');
- location.reload();
- } else {
- $('[data-patient-id="'+closing_id+'"]').find('.next_therapy').html('Terapia encerrada
');
- $('[data-patient-id="'+closing_id+'"]').find('.contacts').html('');
- }
- }
- }
- });
- }
-
- var haveFile = false;
-
- if (closing_attachment!='') {
- haveFile = true;
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'uploads/send/doc',
- data: formUpload,
- processData: false,
- contentType: false
- }).done(function( msg ) {
- data['closing_file_name'] = msg.media_name;
- data['closing_file_url'] = msg.media_key;
- data['closing_file_size'] = msg.size;
- requestCloseTherapy();
- });
- }
-
- if (!haveFile) {
- requestCloseTherapy();
- }
- break;
- case 'reportPatient':
- cl('form iniciado');
- var report_description = $('[name="report_description"]').val();
- var report_id = $('#report_id').val();
- var report_profile = $('#report_profile').val();
- var endPointPath = report_profile == 'patient' ? 'my' : 'clients';
-
- var data = {
- 'description': report_description
- }
-
- var i = 0;
- var input;
- $('.reportCheckbox').each(function() {
- input = $(this).find('input');
- if(input.is(':checked')) {
- data['items['+i+']'] = input.val();
- i++;
- }
- });
-
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'dashboard/'+endPointPath+'/set_complaint/'+report_id,
- data: data
- }).done(function( msg ) {
- if(msg === true) {
- cl('realizar ações');
- $('#confirmationModal').modal('hide');
- if($('#client').length) { // verifica se está no prontuário do cliente
- cl('realizar ação');
- location.reload();
- } else {
- $('[data-patient-id="'+report_id+'"]').find('.next_therapy').html('Terapia reportada
');
- $('[data-patient-id="'+report_id+'"]').find('.contacts').html('');
- }
- }
- });
- break;
- case 'docs':
- cl('form iniciado');
- var doc_id = $('#confirmationModal').data('deleteId');
-
- $.getJSON(_BASE_URL_+'dashboard/docs/delete/'+doc_id, function(msg){
- if(msg === true) {
- $('#confirmationModal').modal('hide');
- $('.documents.sidebar_client a.delete[data-id='+doc_id+']').parent().hide();
- }
- cl(msg);
- });
- break;
- }
- }
-
-
- $('#newRegisterModal button[type="submit"]').on('click', function(e){
- e.preventDefault();
- cl('form iniciado');
- var formUpload = new FormData($('#newRegisterModal form')[0]);
- var record_name = $('[name="record_name"]').val();
- var record_description = $('[name="record_description"]').val();
- var record_private = $('[name="record_private"]').val();
- var record_type_of_record_id = $('[name="record_type_of_record_id"]').val();
- var record_patient_id = $('[name="record_patient_id"]').val();
- var record_attachment = $('#newRegisterModal [name="attachment"]').val();
- data = {
- 'name': record_name,
- 'description': record_description,
- 'private': record_private,
- 'type_of_record_id': record_type_of_record_id,
- 'patient_id': record_patient_id
- }
-
- $('#newRegisterModal .form_buttons').attr('disabled','');
-
- function requestNewRegister() {
- var url = _BASE_URL_+'dashboard/records/add';
-
- if ($('#newRegisterModal').hasClass('edit')) {
- url = _BASE_URL_+'dashboard/records/edit/'+$('#newRegisterModal').data('editId');
- }
- $.ajax({
- method: "POST",
- url: url,
- data: data
- }).done(function( msg ) {
- cl(msg);
- if(msg === true) {
- location.reload();
- }
- });
- }
-
- var haveFile = false;
-
- if (record_attachment!='') {
- haveFile = true;
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'uploads/send/doc',
- data: formUpload,
- processData: false,
- contentType: false
- }).done(function( msg ) {
- data['docs[0][name]'] = msg.media_name;
- data['docs[0][url]'] = msg.media_key;
- data['docs[0][size]'] = msg.size;
- requestNewRegister();
- });
- }
-
- if (!haveFile) {
- requestNewRegister();
- }
-
-
- });
-
- $('#newNoteModal button[type="submit"]').on('click', function(e){
- e.preventDefault();
- cl('form iniciado');
- var note_description = $('[name="note_description"]').val();
- var note_patient_id = $('[name="note_patient_id"]').val();
-
- $('#newNoteModal .form_buttons').attr('disabled','');
-
- var url = _BASE_URL_+'dashboard/notes/add';
-
- // if ($('#newNoteModal').hasClass('edit')) {
- // url = _BASE_URL_+'dashboard/notes/edit/'+$('#newNoteModal').data('editId');
- // }
- // $('#newNoteModal').removeClass('edit');
- $.ajax({
- method: "POST",
- url: url,
- data: {
- 'description': note_description,
- 'patient_id': note_patient_id
- }
- }).done(function( msg ) {
- if(msg === true) {
- location.reload();
- }
- });
- });
-
- function clearModal(modal) {
- var campos = modal.find('input,textarea');
- campos.val('');
- var selects = modal.find('select');
- var val_select;
- selects.each(function(e) {
- val_select = $(this).find('option').eq(0).val();
- $(this).val(val_select);
- });
- var summernote = modal.find('[name="record_description"] + .note-editor');
- summernote.find('.note-editable').html('');
- summernote.find('.note-placeholder').show();
- }
-
- $(document).on('click', '.clear_form[data-bs-target]', function() {
- var modal = $($(this).data('bsTarget'));
- if(modal.hasClass('edit')) {
- clearModal(modal);
- modal.removeClass('edit');
- }
- });
-
- scheduleEvents();
-
- cl('[clients] initiated.');
- };
-
- var openModal = function(params) {
- console.log('Open Modal Parameters => ', params);
- var idModal = params.openIdModal;
- $(idModal).modal('show');
- $(idModal+'Name').text(params.name);
- $(idModal+' form input[name="id"]').val(params.id);
- $(idModal+' form input[name="profile"]').val(params.profile);
- };
-
- var scheduleEvents = function() {
- $('.appointment-button').off().on({
- 'click' : function() {
- $('#appointmentModal').modal('show');
- appointments.appointmentModalEvents();
- }
- });
- };
-
- return {
- init: init,
- openModal: openModal
- }
-})();
-var comments = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[comments] initializing...');
-
- $('.comments-slider').slick({
- infinite: false,
- slidesToShow: 3,
- arrows: false,
- dots: true
- });
-
- cl('[comments] initiated.');
- };
-
- return {
- init: init
- }
-})();
-/**
- *
- *
-
- @param #rel
- With popover value to specify that it is a element with popover actions attached
- @param #data-text-align
- To define the text position
- @param #data-callback-function
- To define a callback triggered by elements with `popover__anchor` class
- @param #data-anchor-close
- To define if when clicked in a achor trigger a method to close the popover
- @param #data-target
- The id of element that contains the content that will be attached at popover body
-
- The element that contain the `popover__anchor` actions need to have a class named `content-[attribute from target] to allow attached the events at correct `popover__anchor` elements.
- */
-
-
-var customPopover = (function(){
- var init = function init(){
- cl('[customPopover] initializing...');
-
- $('[rel="popover"]').each(function() {
- var { target, textAlign, anchorClose, callbackFunction, position } = $(this).data();
- var callbackAction = eval(callbackFunction);
- var popoverBodyText = textAlign ? 'popover-body--' + textAlign : '';
- var placementPosition = position ? position : 'bottom-end';
- var popoverTemplate = '' +
- '';
-
- var targetHTML = $('#' + target).html();
- var popoverAnchors = document.getElementById(target).querySelectorAll('.popover__anchor');
- var htmlContent = '' + targetHTML + '
';
-
- $(this).popover({
- html: true,
- offset: [0,0],
- template: popoverTemplate,
- content: function(){
- return htmlContent
- },
- popperConfig: {
- placement: placementPosition
- }
- });
-
- if (anchorClose) {
- var self = $(this);
- $(this).on('shown.bs.popover', function() {
- var anchors = $('.popover__wrapper .content-' + target + ' .popover__anchor');
- anchors.each(function(index, item) {
- var popoverAnchor = popoverAnchors[index];
-
- $(item).on('click', function() {
- var data = popoverAnchor.dataset;
- callbackAction.apply(this, [data]);
- // self.popover('hide');
- });
- });
- $('body').on('click',function(){
- self.popover('hide');
- $('body').off('click');
- });
- });
- }
- });
-
- cl('[customPopover] initialized...');
- };
-
- return {
- init: init
- }
-})();
-
-var openModal = function(arguments) {
- var { id } = arguments;
-};
-var docs = (function () {
- var loaded = false;
-
- var init = function init() {
- cl('[docs] initializing...');
-
- $('#client-docs-search,#client-notes-search').on('keyup', function () {
- let search = this.value;
- if (search.length > 1) {
- docsTable.search(this.value).draw();
- } else {
- docsTable.search("").draw();
- }
- });
-
- $('.filter-table button').on('click', function () {
- $('.filter-table button.active').removeClass('active');
- $(this).addClass('active');
- if($('.filter-table button').length>1){
- let column = $(this).data('column');
- docsTable.column(column).search($(this).data('filter')).draw();
- }
- });
- // docsTable.column(3).visible(false);
-
- $('.table-records tbody tr').on('click', function () {
- $('.table-records tbody tr').removeClass('active');
- $(this).addClass('active');
-
- let tableActive = $('.table-records tbody tr.active');
- $('#actions-table').removeClass('d-none');
- $('#actions-table a.link').attr('href', tableActive.data('fileView'));
- $('#actions-table a.download').attr('href', tableActive.data('fileDownload'));
- $('#actions-table a.delete').data('delete_id', tableActive.data('id'));
- $('#actions-table a.modal-start').data('title', tableActive.data('title')).data('body', tableActive.data('body'));
- });
-
- $('#actions-table a.delete').on('click', function (e) {
- e.preventDefault();
-
- var action = $('#actions-table').data('action');
- cl(action);
-
- $('#confirmationModal').modal('show');
- $('#confirmationModal').data('confirmation',action);
- $('#confirmationModal [class^="confirm_"]').removeClass('d-inline');
- $('#confirmationModal .confirm_'+action).addClass('d-inline');
- $('#confirmationModal .confirm_name_'+action).text($('#'+action+'ModalName').text());
- $('#confirm_cancel,#confirm_delete').removeAttr('disabled');
-
- $('#confirm_cancel:not(:disabled)').on('click', function(e){
- e.preventDefault();
- $('#confirmationModal').modal('hide');
- });
-
- $('#confirm_delete:not(:disabled)').on('click', function(e){
- e.preventDefault();
- $('#confirm_delete').attr('disabled','');
- $('#confirm_cancel').attr('disabled','');
-
- let note_delete = $('#actions-table a.delete').data('delete_id');
- let url;
-
- switch (action) {
- case 'newNote':
- url = _BASE_URL_+'dashboard/notes/delete/'+note_delete;
- break;
- case 'docs':
- url = _BASE_URL_+'dashboard/docs/delete/'+note_delete;
- break;
- }
-
- cl('form iniciado');
- $.getJSON(url, function(msg){
- if(msg === true) {
- $('#confirmationModal').modal('hide');
- docsTable.row('.active').remove().draw();
- $('#actions-table').addClass('d-none');
- }
- cl(msg)
- });
- });
-
- });
-
- $('#actions-table a.modal-start').on('click', function (e) {
- e.preventDefault();
- let id = $(this).attr('href');
- let title = $(this).data('title');
- let body = $(this).data('body');
- $(id).find('.modal-title').text(title);
- $(id).find('.modal-body').html(body);
-
- $(id).modal('show');
- });
-
- cl('[docs] initiated.');
- };
-
- let docsTable = $('.table-records').DataTable({
- "paging": false,
- // "order": [[3, 'asc']],
- "columnDefs": [
- { "width": "20%", "targets": 0 }
- ],
- "language": {"decimal":"","emptyTable":"","info":"","infoEmpty":"","infoFiltered":"","infoPostFix":"","thousands":"","lengthMenu":"","loadingRecords":"","processing":"","search":"","zeroRecords":"","paginate":{"first":"","last":"","next":"","previous":""},"aria":{"sortAscending":"","sortDescending":""}},
- // "search": {
- // "search": "erry"
- // },
- // "searching": false
- });
- $('#docs_filter,#notes_filter').addClass('d-none');
-
- return {
- init: init,
- // docsTable: docsTable
- }
-})();
-var form = (function() {
- var init = function init() {
- cl('[form] initializing...');
-
- $('input, select').trigger('blur');
-
- $('.form-select.select2').select2({
- 'language': {
- 'noResults': function(){
- return "Nenhum resultado encontrado.";
- }
- },
- });
-
- if($(".img-upload-container").length > 0){
- $('#cropModal').on('shown.bs.modal', function(){
- $('#imgToCrop').croppie({
- enableExif: true,
- viewport: {
- width: 300,
- height: 300,
- type: 'circle'
- },
- boundary: {
- width: 300,
- height: 350
- }
- });
- });
-
- $('#cropModal').on('hidden.bs.modal', function(){
- $('#imgToCrop').croppie('destroy');
- });
-
-
- $('#selectCrop').on('click', function(){
- $('#imgToCrop').croppie('result', {
- type: 'base64',
- size: 'viewport'
- }).then(function (resp) {
- $('#imgbase64').val(resp);
- $('.imgPreview').attr('src', resp).css('opacity', 1);
- $('#cropModal').modal('hide');
- });
- });
-
- $('#cancelCrop').on('click', function(){
- // Em caso da gente precisar de algo especial para esse evento.
- });
-
- $(".img-upload-container .img-input").off().on('change', function(e){
- if(e.target.files.length > 0){
- var el = $('#imgToCrop')[0];
- var reader = new FileReader();
- reader.onload = function()
- {
- el.src = reader.result;
- $('#cropModal').modal('show');
- }
- reader.readAsDataURL(e.target.files[0]);
- }
- });
- };
-
-
- cl('[form] initiated');
- };
-
- // [POST] para /settings/change_notification o data recebe dois campos: field: 'email_update_terms', value: 0
-
- var toggleEdit = function toggleEdit(status){
- if(!status){
- $('.form-field').prop('disabled', true);
- $('.btn-save').toggleClass('d-none');
- $('.btn-edit').toggleClass('d-none');
- } else {
- $('.form-field').prop('disabled', false).trigger('blur');
- $('.btn-save').toggleClass('d-none');
- $('.btn-edit').toggleClass('d-none');
- }
- }
-
- return {
- init: init,
- toggleEdit: toggleEdit
- }
-}());
-
-var setNotifications = (function() {
- var init = function init() {
- cl('[setNotifications] initializing...');
-
- var cp = $('[cp-name="setNotifications"]').eq(0);
- var inputs = cp.find('input[type="checkbox"]');
-
- inputs.off('click').on('click', function(e){
- var formData = new FormData();
- formData.append('field', $(this).attr('name'));
- formData.append('value', ($(this).is(":checked") ? 1 : 0));
- fetch('/settings/notifications/change_notification', {
- method: 'POST',
- body: formData
- })
-
- });
-
- };
-
- // [POST] para /settings/change_notification o data recebe dois campos: field: 'email_update_terms', value: 0
-
- return {
- init: init
- }
-}());
-var formMasks = (function () {
- var loaded = false;
-
- var init = function init () {
- cl('[formMasks] initializing...');
-
- var SPMaskBehavior = function (val) {
- return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
- },
- spOptions = {
- onKeyPress: function (val, e, field, options) {
- field.mask(SPMaskBehavior.apply({}, arguments), options);
- }
- };
-
- $('.mask_phone').mask(SPMaskBehavior, spOptions);
- $('.mask_cnpj').mask('00.000.000/0000-00', {reverse: true});
- $('.mask_cep').mask('00000-000');
- $(".mask_cpf").mask('000.000.000-00');
- $(".mask_date").mask('00/00/0000');
- $('.mask_epsi').mask('00/000.000');
- $('.mask_cpf_cnpj').mask(
- (val) => {
- return val.replace(/\D/g, '').length === 11 ? '000.000.000.00' : '00.000.000/0000-00';
- },
- {
- onKeyPress: function (cpfcnpj, e, field, options) {
- var masks = ['000.000.000-000', '00.000.000/0000-00'];
- var mask = (cpfcnpj.length > 14) ? masks[1] : masks[0];
- $('.mask_cpf_cnpj').mask(mask, options);
- },
- });
- // $(".mask_date input").datepicker({language: 'pt-BR'});
-
- cl('[formMasks] initiated.');
- };
-
- return {
- init: init
- }
-})();
-
-formMasks.init();
-
-var form_files = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[form_files] initializing...');
-
- function addfile(name,size) {
- return ''+name+' ('+size+'kb) '
- }
-
- $("input.files_in_textarea").on('change',function() {
- var files = [];
- for (var i = 0; i < $(this)[0].files.length; ++i) {
- files.push({
- 'name':$(this)[0].files[i].name,
- 'size':Math.ceil($(this)[0].files[i].size/1024)
- });
- }
- //para somente 1 arquivo (NÃO funciona para MULTIFILE)
- $(this).parent().find('.files').html('').append(addfile(files[0].name,files[0].size));
- });
-
- // $("button.btn-delete-file").on('click',function() {
- $(document).on('click','button.btn-delete-file',function() {
- //para somente 1 arquivo (NÃO funciona para MULTIFILE)
- let form = $(this).closest('form');
- form.find('.files').html('');
- form.find('input.files_in_textarea').val('');
- cl('ae');
- });
-
- cl('[form_files] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var form_summernote = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[form_summernote] initializing...');
-
- $('[data-summernote]').each(function(){
- var buttons_summer = $(this);
- var id_summer = '#'+buttons_summer.data('summernote');
- $(id_summer).summernote({
- height: 200,
- toolbar: false,
- placeholder: $(id_summer).attr('placeholder'),
- });
- var lengSelect = 1;
- buttons_summer.find('span[data-button-summernote]').each(function(){
- var button_summer = $(this);
- button_summer.on('click',function(e) {
- e.preventDefault();
- var button = $(this).data('buttonSummernote');
- setTimeout(function() {
- $(id_summer).summernote('restoreRange');
- cl('restoreRange');
- setTimeout(function() {
- cl(button);
- if (lengSelect==0 && button=='removeFormat') {
- var text = ''+$(id_summer + ' + .note-editor').find('.note-editable').text()+'
';
- $(id_summer + ' + .note-editor').find('.note-editable').html(text);
- $(id_summer).val(text);
- }
- $(id_summer).summernote(button);
- },100);
- },100);
- });
- });
- buttons_summer.on('mouseenter',function(){
- $(id_summer).summernote('saveRange');
- lengSelect = Math.abs($(id_summer).summernote('createRange').eo-$(id_summer).summernote('createRange').so);
- })
- });
-
- cl('[form_summernote] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var header = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[header] initializing...');
-
- if($("#home").length){
- $(window).on("scroll", function(){
- if(window.scrollY > 100) {
- $('#navbar').addClass('bg-primary');
- $('#navbar .logo').removeClass('primary');
- $('#navbar .nav-link').removeClass('text-dark').addClass('text-white');
- $('#navbar .justify-content-end > .btn-outline-primary').removeClass('btn-outline-primary').addClass('btn-outline-light');
- $('#navbar .justify-content-end > .btn-primary').removeClass('btn-primary').addClass('btn-light');
- $('#navbar .header-icon').addClass('text-white');
- } else {
- $('#navbar').removeClass('bg-primary');
- $('#navbar .logo').addClass('primary');
- $('#navbar .nav-link').addClass('text-dark').removeClass('text-white');
- $('#navbar .justify-content-end > .btn-outline-light').removeClass('btn-outline-light').addClass('btn-outline-primary');
- $('#navbar .justify-content-end > .btn-light').removeClass('btn-light').addClass('btn-primary');
- $('#navbar .header-icon').removeClass('text-white');
- }
- });
- } else {
- $('#navbar').addClass('bg-primary');
- $('#navbar .logo').removeClass('primary');
- $('#navbar .nav-link').removeClass('text-dark').addClass('text-white');
- $('#navbar .justify-content-end > .btn-outline-primary').removeClass('btn-outline-primary').addClass('btn-outline-light');
- $('#navbar .justify-content-end > .btn-primary').removeClass('btn-primary').addClass('btn-light');
- $('#navbar .header-icon').addClass('text-white');
- }
-
- $('.flyoutMenu').on('click', function(e){
- e.stopPropagation();
- });
-
- $('.hasFlyoutMenu').on('click', function(e){
- e.stopPropagation();
- if($(this).hasClass('open')){
- $(this).toggleClass('open');
- } else {
- $('.hasFlyoutMenu').removeClass('open');
- $(this).addClass('open');
- }
- });
-
- $('#markAllAsRead').on('click', function(){
- cl("Marking all notifications as read...");
-
- $('.notification').removeClass('notRead');
-
- cl("Marked all notifications as read!");
- });
-
- $('body').on('click', function(){
- $('.hasFlyoutMenu').removeClass('open');
- });
-
- $('#btnResendEmail').on('click', function(){
- var mail = $(this).attr('data-email');
- $.getJSON(_BASE_URL_+'users/resendmail?email='+mail+'', function(response){
- console.log(response);
- });
- });
-
- $('#menu_mobile').on('click', function(){
- $('#menu_mobile_container').addClass('active');
- });
-
- $('.close-menu-button').on('click', function(){
- $('#menu_mobile_container').removeClass('active');
- });
-
-
- cl('[header] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var helpSearch = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[helpSearch] initializing...');
-
- if($('.desktop').css('display') === 'none') {
- var count = $('.accordion_categories').length;
- var size = count * 200;
- var sizeVW = size * 100 / 320;
-
- $('.row_mobile-width').css('width', ''+sizeVW+'vw')
- }
-
- $('.accordion_categories').on('click', function(){
- var thisCategory = $(this).attr('data-category');
- $('.accordion_categories.active').removeClass('active');
- $('.accordion_list').show();
- $(this).addClass('active');
-
- $('.help_accordion_category.active').removeClass('active');
- $('.help_accordion_category[data-category="'+thisCategory+'"]').addClass('active');
- });
-
- $('#help_search-input').keypress(function(event){
- if(event.keyCode == 13){
- $('#help_search-trggr').click();
- }
- });
-
- $('#help_search-trggr').on('click', function(){
- var searched = $('#help_search-input').val();
- $('.help_accordion_category').removeClass('active');
- $('.accordion_list').each(function(ind, val){
- var buttonText = $(this).find('.accordion-button').text();
- var contentText = $(this).find('.accordion-body').text();
-
- if(buttonText.toLowerCase().search(searched.toLowerCase()) != -1) {
- $(this).show();
- $(this).parent('.help_accordion_category').addClass('active');
- } else if(contentText.toLowerCase().search(searched.toLowerCase()) != -1) {
- $(this).show();
- $(this).parent('.help_accordion_category').addClass('active');
- } else {
- $(this).hide();
- }
- })
- });
-
- cl('[helpSearch] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var inputDate = (function() {
- var init = function init() {
- cl('[inputDate] initializing...');
-
- dayjs.locale('pt-br');
- dayjs.extend(dayjs_plugin_localeData);
- dayjs.extend(dayjs_plugin_updateLocale);
- dayjs.extend(dayjs_plugin_weekday);
- dayjs.extend(dayjs_plugin_weekOfYear);
-
- dayjs.updateLocale('pt-br', {
- weekdays: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
- weekdaysMin: ["D", "S", "T", "Q", "Q", "S", "S"]
- });
-
- var datepickerFields = document.querySelectorAll('.custom-datepicker');
-
- datepickerFields.forEach(field => {
- datepicker(field, {
- customDays: dayjs.weekdaysMin(),
- customMonths: dayjs.months(),
- formatter: (input, date, instance) => {
- const formattedDate = dayjs(date);
- const value = `${dayjs.months()[formattedDate.$M]} ${formattedDate.$D}, ${formattedDate.$y}`;
- input.dataset.date = formattedDate.format("YYYY-MM-DD");
- input.value = value
- }
- });
- });
-
-
- $('.timepicker').timepicker({
- timeFormat: 'HH:mm',
- interval: 60,
- minTime: '08',
- maxTime: '17:00',
- defaultTime: '08',
- startTime: '08:00',
- dynamic: false,
- dropdown: true,
- zindex: 1100,
- scrollbar: true
- });
-
- cl('[inputDate] initialized...');
- };
-
- return {
- init: init
- }
-})();
-var login = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[login] initializing...');
-
- $('.pwd-wrapper .material-icons-outlined').on('click', function(){
- $(this).parent('.pwd-wrapper').toggleClass('showpwd');
-
- if($(this).parent('.pwd-wrapper').hasClass('showpwd')){
- $(this).parent('.pwd-wrapper').find('input').attr('type','text');
- } else {
- $(this).parent('.pwd-wrapper').find('input').attr('type','password');
- }
- });
-
- $('.login-slider .slider').slick({
- arrows: false,
- dots: true,
- slidesToShow: 1,
- adaptativeHeight: false,
- infinite: true,
- autoplay: true,
- autoplaySpeed: 3000,
- fade: true
- });
-
- $('#btnForgot').on('click', function(){
- $('#resetPwdUsername').removeClass('error');
- $('#forgotPwd .error-message').hide();
- $('#loginForm').fadeOut('fast', function(){
- $('#forgotPwd').fadeIn();
- });
- });
-
- $('#btnResetPassword').on('click', function(e){
- e.preventDefault();
- $('#resetPwdUsername').removeClass('error');
- $('#forgotPwd .error-message').hide();
- var email = $('#resetPwdUsername').val();
- if(validateEmail(email)){
- $('#resendUsername').val(email);
- apiCall('start');
- $.ajax({
- method: 'GET',
- url:'/users/forgotpassword?email='+email,
- success: function (data) {
- console.log('success');
- console.log(data);
- $('#forgotPwd').fadeOut('fast', function(){
- $('#pwdSent').fadeIn();
- });
- apiCall('end');
- },
- error: function (data) {
- $('#resetPwdUsername').addClass('error');
- $('#forgotPwd .error-message').show().text('E-mail não encontrado.');
- apiCall('end');
- }
- });
- } else {
- $('#resetPwdUsername').addClass('error');
- $('#forgotPwd .error-message').show().text('E-mail inválido.');
- }
- });
-
- $('#btnResendPassword').on('click', function(e){
- e.preventDefault();
- var email = $('#resetPwdUsername');
- $('#resetPwdUsername').removeClass('error');
- $('#forgotPwd .error-message').hide();
- $('#resendUsername').val(email);
- $('#pwdSent').fadeOut('fast', function(){
- $('#pwdSent').fadeIn();
- });
- });
-
- $('#btnStart').on('click', function(e){
- e.preventDefault();
- $('#resetPwdUsername').removeClass('error');
- $('#forgotPwd .error-message').hide();
- $('#login input').val('');
- $('.pwd-wrapper input').attr('type','password');
- $('.pwd-wrapper').removeClass('showpwd');
- $('#pwdSent').fadeOut('fast', function(){
- $('#loginForm').fadeIn();
- });
- });
-
- formMasks.init();
-
- cl('[login] initiated.');
- };
-
-
- return {
- init: init
- }
-})();
-var patientModal = (function() {
- var selectedAppointmentId;
- var selectedAppointment;
- var patientModalContainer = document.querySelector('#patientModal');
- var confirmModalContainer = document.querySelector('#confirmationModal');
- const userRole = $('#shcedulesPage').attr('data-role');
- const appointmentUser = (userRole == 1) ? 'therapist' : 'patient';
-
- var init = function() {
- cl('[patient-modal] initializing');
- cl('[patient-modal] initialed');
- snackbar.init();
- };
-
- var populateModal = function(appointment) {
- var appointmentPrefix = appointments.getAppointmentPrefix(appointment);
- selectedAppointmentId = appointment.id;
- selectedAppointment = appointment;
-
- $('#patient-image').attr({
- 'src' : appointment[appointmentUser].profile.photo,
- 'alt' : appointment[appointmentUser].name
- });
- $('#patient-name').html(appointment[appointmentUser].name);
- $('#patient-status').attr('data-status', appointmentPrefix);
- $('#patient-therapy').html(appointment.modality.name);
-
- configureAppointmentDate(appointment);
- checkPatientStatus(appointment.status_name, appointmentPrefix)
- buildFooterToStatus(appointment.status_name, userRole);
- };
-
- var configureAppointmentDate = function(appointment) {
- var configuredTime = dayjs(appointment.day);
- var weekday = dayjs.weekdays()[configuredTime.$W];
- var day = configuredTime.date();
- var month = dayjs.months()[configuredTime.$M];
- var startTime = appointment.hour_complet;
- var endTime = appointment.hour_end;
-
- $('#appointment__weekday').html(weekday);
- $('#appointment__day').html(day);
- $('#appointment__month').html(month);
- $('#appointment__start-time').html(startTime);
- $('#appointment__end-time').html(endTime);
- };
-
- var checkPatientStatus = function(status, prefix) {
- if ((status == "Finalizada" || status == "Não compareceu") && userRole == 2) {
- $('.patient-modal__container-status').html(`
-
-
-
-
- ${status}
- expand_more
-
-
-
-
- `);
-
- customPopover.init();
- }
- else
- $('.patient-modal__container-status').html(
- `${status}`
- )
- };
-
- var buildFooterToStatus = function(status, userRole) {
- if (userRole == 2)
- buildFooterToStatusAtTherapist(status);
- else
- buildFooterToStatusAtPatient(status);
- };
-
- var buildFooterToStatusAtTherapist = function(status) {
- let content;
-
- switch(status) {
- case('Agendada'):
- content = `
-
-
-
- `;
- break;
- case('Em andamento'):
- content = `
-
- `;
- break;
- default:
- content = `
-
-
-
- `;
- break;
- }
-
- $('.patient-modal__footer').html(content);
- attachEventsToModal(status);
- };
-
- var buildFooterToStatusAtPatient = function(status) {
- let content;
-
- switch(status) {
- case('Agendada'):
- content = `
-
-
-
- `;
- break;
- case('Finalizada'):
- content = `
-
- `;
- break;
- case('Em andamento'):
- content = `
-
- `;
- break;
- // case('Aguardando Psicólogo'):
- // content = `
- //
- //
- //
- // `;
- // break;
- default:
- content = `
-
-
-
- `;
- break;
- }
-
- $('.patient-modal__footer').html(content);
- attachEventsToModal(status);
- };
-
- var attachEventsToModal = function(status) {
- if (status == "Agendada" || (status == "Aguardando Psicólogo" && userRole == 1))
- cancelEvents();
-
- if (status == "Em andamento")
- videoEvents();
-
- if (status == "Finalizada" && userRole == 1)
- updateStatusEvents();
- };
-
- var cancelEvents = function() {
- $('.cancel-button').off().on({
- 'click' : function() {
- modalConfirmation('cancelAppointment', function() {
- removeAppointment();
- });
- }
- });
- };
-
- var videoEvents = function() {
- $('.video-button').off().on({
- 'click' : function() {
- $(patientModalContainer).modal('hide');
- window.open('/videocall','Video Call', 'scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width='+ window.screen.width +',height='+ window.screen.height +',left=0,top=0');
- }
- });
- };
-
- var updateStatusEvents = function() {
- var appointmentCallback = function () {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'api/change_appointment_status_to_therapist',
- data: {
- 'appointment_id': selectedAppointmentId,
- 'therapist_id': selectedAppointment.therapist_id,
- 'status': 7
- },
- error: function(data, status, jqXHR) {
- var message = data['responseJSON']['appointment_id'];
- snackbar.show(message, 'error');
- }
- }).done(function(data, textStatus, jqXHR) {
- if (jqXHR.status === 200) {
- $(patientModalContainer).modal('hide');
- snackbar.show('Agendamento modificado com sucesso!', 'success');
- appointments.updateAppointment(data);
- }
- });
- };
-
- $('.appointment-cancel-button').off().on({
- 'click' : function() {
- modalConfirmation('changeAppointment', function () {
- appointmentCallback();
- });
- }
- });
- };
-
- var modalConfirmation = function(modalName, callback) {
- $(patientModalContainer).modal('hide');
- $(confirmModalContainer).modal('show');
-
- switch(modalName) {
- case ('cancelAppointment') :
- $('.confirm_title').html('Consulta Agendada');
- $('.confirm_text').html('Deseja realmente cancelar esse agendamento?');
- break;
- case ('changeAppointment') :
- $('.confirm_title').html('Consulta Finalizada');
- $('.confirm_text').html('O psicólogo realmente não compareceu?');
- break;
- }
-
- $('#confirm_cancel').off().on({
- 'click' : function () {
- $(confirmModalContainer).modal('hide');
- $(patientModalContainer).modal('show');
- }
- });
-
- $('#confirm_ok').off().on({
- 'click' : function () {
- $(confirmModalContainer).modal('hide');
- callback.call();
- }
- })
- };
-
- var removeAppointment = function() {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'api/cancel_appointment',
- data: {
- 'appointment_id': selectedAppointmentId,
- 'user_role': userRole
- },
- error: function(data, status, jqXHR) {
- const message = data.responseJSON.appointment_id;
- snackbar.show(message, 'error');
- }
- }).done(function(data, textStatus, jqXHR) {
- if (jqXHR.status === 200) {
- $(patientModalContainer).modal('hide');
- snackbar.show('Agendamento cancelado com sucesso!', 'success');
- appointments.updateAppointment(data);
- }
- });
- };
-
- var changeStatus = function(config) {
- var { id } = config;
-
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'api/change_appointment_status',
- data: {
- 'appointment_id': selectedAppointmentId,
- 'status': id
- },
- error: function(data, status, jqXHR) {
- var message = data['responseJSON']['appointment_id'];
- snackbar.show(message, 'error');
- }
- }).done(function(data, textStatus, jqXHR) {
- if (jqXHR.status === 200) {
- $(patientModalContainer).modal('hide');
- snackbar.show('Agendamento modificado com sucesso!', 'success');
- appointments.updateAppointment(data);
- }
- });
- };
-
- return {
- init: init,
- populateModal: (appointment) => populateModal(appointment),
- changeStatus: function(config) {
- changeStatus(config);
- }
- }
-})();
-
-function changeStatusPatient(config) {
- patientModal.changeStatus(config);
-}
-
-var payment = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[payment] initializing...');
-
- $('.btn_appointmentPay').on('click', function(e){
- e.preventDefault();
- var form = $('#form_identifier > form');
- var formData = new FormData();
- var card = $('.form-check-input[name=card]:checked').val();
-
- if(card != '') {
- $('#card_number').attr('disabled', true);
- $('#card_first-name').attr('disabled', true);
- $('#card_last-name').attr('disabled', true);
- $('#card_month-val').attr('disabled', true);
- $('#card_year-val').attr('disabled', true);
- $('#card_verify').attr('disabled', true);
-
- $('#address').attr('disabled', true);
- $('#address-number').attr('disabled', true);
- $('#neighborhood').attr('disabled', true);
- $('#complement').attr('disabled', true);
- $('#zip-code').attr('disabled', true);
- $('#state-id').attr('disabled', true);
- $('#city-id').attr('disabled', true);
- $('#phone').attr('disabled', true);
- $('#emergency-phone').attr('disabled', true);
-
- $(form).submit();
- }
- });
-
- cl('[payment] initiated.');
- };
-
-
- return {
- init: init
- }
-})();
-
-var play_video_modal = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[play_video_modal] initializing...');
-
- $('.play_video').on('click',function() {
- var id_modal = $(this).data().bsTarget;
- $(id_modal + ' video')[0].play();
- });
-
- $('video').closest('.modal').on('hidden.bs.modal', function () {
- $(this).find('video')[0].pause();
- });
-
- cl('[play_video_modal] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var pwdView = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[pwd-view] initializing...');
-
- $('.pwd-wrapper .material-icons-outlined').on('click', function(){
- $(this).parent('.pwd-wrapper').toggleClass('showpwd');
-
- if($(this).parent('.pwd-wrapper').hasClass('showpwd')){
- $(this).parent('.pwd-wrapper').find('input').attr('type','text');
- } else {
- $(this).parent('.pwd-wrapper').find('input').attr('type','password');
- }
- });
-
- cl('[pwd-view] initiated.');
- };
-
-
- return {
- init: init
- }
-})();
-var searchPage = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[searchPage] initializing...');
-
- $('.btn_filter').on('click', function(e){
- e.preventDefault();
- $('.filter_container').slideToggle();
- $('#homeSearch').toggleClass('filter_active');
- });
-
- $('.form-select').select2({
- 'language': {
- 'noResults': function(){
- return "Nenhum resultado encontrado.";
- }
- },
- });
-
-
- cl('[searchPage] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var select_share = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[select_share] initializing...');
-
- function change_icon() {
- var icon = $('.icon_select select option:selected').data().icon;
- $('.icon_select .icon').html(icon);
- }
-
- change_icon();
-
- $(document).on('change','.icon_select select',function(){
- change_icon();
- });
-
- cl('[select_share] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var sidebar = (function() {
- var init = function init() {
- cl('[sidebar] initializing...');
-
- // if($('.desktop').css('display') === 'inline-block' || $('.desktop').css('display') === 'flex') {
- // $('.sidebar_mod[sidebar-type="mobile"]').remove();
-
- // $('.sidebar__navigation .control').off().on('click', function(){
- // $('.sidebar__navigation').toggleClass('collapsed');
- // });
-
- // $('.sidebar__navigation .sidebar__menu a').on('click', function(){
- // $('.sidebar__navigation .sidebar__menu li').removeClass(`active`);
- // $(this).closest('li').addClass('active');
- // });
- // } else {
- // $('.sidebar_mod[sidebar-type="desktop"]').remove();
-
-
- // }
-
- $('.sidebar_mod-container .control').off().on('click', function() {
- $('.sidebar_mod').toggleClass('collapsed');
- });
-
- $('.sidebar__navigation .control').off().on('click', function(){
- $('.sidebar__navigation').toggleClass('collapsed');
- });
-
- $('.sidebar__navigation .sidebar__menu a').on('click', function(){
- $('.sidebar__navigation .sidebar__menu li').removeClass(`active`);
- $(this).closest('li').addClass('active');
- });
-
-
-
- cl('[sidebar] initiated');
- };
-
- return {
- init: init
- }
-}());
-var sliders = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[sliders] initializing...');
-
- $('.intro-slider').slick({
- dots: true,
- arrows: false,
- infinite: true,
- fade: true,
- cssEase: 'linear',
- autoplay: true,
- autoplaySpeed: 4000,
- pauseOnHover: false,
- adaptiveHeight: true
- });
-
- cl('[sliders] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var snackbar = (function(){
- var toastInstance;
-
- var init = function() {
- var toastElement = document.querySelector('.toast-element');
-
- if (!toastElement)
- initComponent();
- };
-
- var initComponent = function() {
- var content = `
-
- `;
-
- $('body').append(content);
-
- var toastEl = document.getElementById('toast-element');
- new bootstrap.Toast(toastEl, {autohide: true});
- toastInstance = bootstrap.Toast.getInstance(toastEl);
- };
-
- var show = function(message, type) {
- var toastContainer = document.getElementsByClassName('toast-container');
- var toastEl = document.getElementById('toast-element');
- $(toastContainer).show();
- $(toastEl).removeClass('bg-success bg-danger text-white');
- $(toastEl).find('.toast-header').removeClass('text-danger text-success');
-
- if (type == 'error') {
- $(toastEl).find('.toast-title').html('Erro!');
- $(toastEl).find('.toast-icon').html('error_outline');
- $(toastEl).find('.toast-header').addClass('text-danger');
- $(toastEl).addClass('bg-danger text-white');
- }
-
- if (type == 'success') {
- $(toastEl).find('.toast-title').html('Successo!');
- $(toastEl).find('.toast-icon').html('check_circle');
- $(toastEl).find('.toast-header').addClass('text-success');
- $(toastEl).addClass('bg-success text-white');
- }
-
- $(toastEl).find('.toast-body').html(message);
-
- toastInstance.show();
- }
-
- return {
- init: function() {
- return init();
- },
- show: function(message, type) {
- return show(message, type);
- }
- }
-})();
-var steps = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[steps] initializing...');
- snackbar.init();
-
- var reader = new FileReader();
- var isVideo = false;
-
- reader.onload = function (e) {
- if(isVideo) {
- $('#video-tag').attr('src', e.target.result);
- } else {
- $('.step-image_placeholder').attr('src', e.target.result);
- }
- }
-
- function readURL(input) {
- isVideo = false;
- if (input.files && input.files[0]) {
- reader.readAsDataURL(input.files[0]);
- }
- }
-
- function readVideo(input) {
- isVideo = true;
- if(input.files && input.files[0]) {
- reader.readAsDataURL(input.files[0]);
- }
- }
-
- if($('.step.completed').length > 0) {
- var height = $('.attc_description-container > p').height();
-
- if(height > 60) {
- $('.attc_description-container').height(height * 0.5);
- } else {
- $('.attc_description-container').height(height);
- $('.attc_description-read-more').hide();
- }
- }
-
-
- $('.agenda_hour').on('click', function(){
- if($(this).hasClass('active')) {
- $(this).removeClass('active');
- } else {
- $(this).addClass('active');
- }
- });
-
- $(".step-image_upload").change(function(){
- readURL(this);
- });
-
- // $('#video_field').change(function(){
- // if (typeof ($("#video_field")[0].files) != "undefined") {
- // var size = parseFloat($("#video_field")[0].files[0].size / 1024).toFixed(2);
-
- // if(size < 5000) {
- // $('.error-message').html('');
- // readVideo(this);
- // } else {
- // $('.error-message').html('Vídeo maior do que o limite de 5mb.');
- // }
- // }
- // });
-
- $('.add_form').on('click', function(){
- var form_add = $('.form_adder').first().clone();
- $('#form_step2').append(form_add);
-
- if($('.form_adder').length > 1) {
- $('.remove_form').show();
- } else {
- $('.remove_form').hide();
- }
- });
-
- $('.remove_form').on('click', function(){
- $('.form_adder').last().remove();
-
- if($('.form_adder').length > 1) {
- $('.remove_form').show();
- } else {
- $('.remove_form').hide();
- }
- });
-
- $('.input-modalities-value').mask("#,##0.00", {reverse: true});
-
- $('.multiple_select').select2({
- 'language': {
- 'noResults': function(){
- return "Nenhum resultado encontrado.";
- }
- },
- });
-
- var url = new URL(window.location.href);
- var editStep = url.searchParams.get('step');
-
- if(editStep != null) {
- var step = parseInt(editStep);
- $('.steps-control').show();
- goStep(step);
- } else {
- var step = 0;
- }
-
- function nextStep(steps) {
- $('.step[data-step='+step+']').hide();
-
- if(step < 10) {
- step++;
- }
-
- if(step == 10) {
- $('.steps_block').addClass('hidden');
- $('.steps-completed').fadeIn().removeClass('hidden');
- } else {
- if($('.steps_block').hasClass('hidden')) {
- $('.steps-completed').hide().addClass('hidden');
- $('.steps_block').fadeIn().removeClass('hidden');
- }
- }
-
- $('.step-label[data-step='+step+']').addClass('sent');
- $('.step[data-step='+step+']').fadeIn();
- }
-
- function goStep(step) {
- $('.step').hide();
- $('.step[data-step='+step+']').fadeIn();
- $('.steps-completed').hide().addClass('hidden');
-
- if(step == 10) {
- $('.steps_block').addClass('hidden');
- $('.steps-completed').fadeIn().removeClass('hidden');
-
- } else if(step == 5) {
- checkModalities();
- } else {
- if($('.steps_block').hasClass('hidden')) {
- $('.steps-completed').hide().addClass('hidden');
- $('.steps_block').fadeIn().removeClass('hidden');
- }
- }
-
- for(i = 1; i <= step; i++) {
- $('.step-label[data-step='+i+']').addClass('sent');
- }
-
- }
-
- $('.step_button-prev').on('click', function(e){
- e.preventDefault();
-
- $('.step-label[data-step='+step+']').removeClass('sent');
- $('.step[data-step='+step+']').hide();
-
- if(step > 0) {
- step--;
-
- if(step === 0) {
- $('.steps-control').hide();
- }
- }
-
- $('.step[data-step='+step+']').fadeIn();
- });
-
- // CONFIGURAÇÃO AGENDA
-
- $('.agenda_input-hour').mask('00:00');
-
- $('.configuracoes_agenda').on('click', function() {
- $('.configuracoes_agenda-container').toggle();
- });
-
- $('.configuracoes_agenda-container').on('click', function(e){
- e.stopPropagation();
- });
-
- $('.cancel_session_duration').on('click', function(){
- var sess_dur = '50';
- var sess_int = '10';
- $('#session_duration_edit').val(sess_dur);
- $('#session_interval_edit').val(sess_int);
- $('.configuracoes_agenda-container').toggle();
- });
-
- $('.save_session_duration').on('click', function(){
- var session_dur = $('#session_duration_edit').val();
- var session_int = $('#session_interval_edit').val();
-
- if(session_duration != '' && session_interval != '') {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step6',
- data: {
- 'session_duration': session_dur,
- 'session_break': session_int
- }
- }).done(function( msg ) {
- if(msg === true) {
- $('#session_duration_edit').val(session_dur);
- $('#session_interval_edit').val(session_int);
- $('.configuracoes_agenda-container').toggle();
- }
- });
- } else {
- if(session_dur === '') {
- $('#session_duration_edit').addClass('error');
- } else {
- $('#session_duration_edit').removeClass('error');
- }
-
- if(session_int === '') {
- $('#session_interval_edit').addClass('error');
- } else {
- $('#session_interval_edit').removeClass('error');
- }
- }
- });
-
- function validateHour(inputField) {
- var isValid = /^(|0?[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$/.test(inputField);
-
- return isValid;
- }
-
- function checkModalities() {
- $('.form-check-input').each(function () {
- if (!this.checked) {
- $('.modalities-container[data-type-service="'+$(this).attr('id')+'"]').addClass('disabled');
- $('.modalities-container[data-type-service="'+$(this).attr('id')+'"]').find('input').attr('disabled', true);
- } else {
- $('.modalities-container[data-type-service="'+$(this).attr('id')+'"]').removeClass('disabled');
- $('.modalities-container[data-type-service="'+$(this).attr('id')+'"]').find('input').attr('disabled', false);
- }
- });
- }
-
-
- $('.agenda_add-hour').each(function(ind, val){
- if($(this).prev().length > 0) {
- const {day} = $(this).data();
- $('remove').insertAfter(this);
- }
- });
-
- $(document).on('click', '.agenda_remove-hour', function(){
- if($(this).siblings('.agenda_add-hour').prev().length > 0) {
- $(this).siblings('.agenda_add-hour').prev().remove();
-
- if($(this).siblings('.agenda_add-hour').prevAll().length === 0) {
- $(this).remove();
- }
- }
- });
-
-
- $('.agenda_add-hour').on('click', function(){
- var day = $(this).attr('data-day');
- var inputToAdd = '';
-
- $(inputToAdd).insertBefore(this);
- $('.agenda_input-hour').mask('00:00');
-
- if($(this).prev().length <= 0) {
- $(this).siblings('.agenda_remove-hour').remove();
- } else {
- if($(this).siblings('.agenda_remove-hour').length === 0) {
- $('remove').insertAfter(this);
- }
-
- }
- });
-
- $(document).on('blur', '.agenda_input-hour', function(){
- var val = $(this).val();
-
- var duration = '50';
- var interval = '10';
- var durInt = parseInt(duration) + parseInt(interval);
-
- var m = durInt % 60;
- var h = (durInt-m)/60;
- var HHMM = (h<10?"0":"") + h.toString() + ":" + (m<10?"0":"") + m.toString();
-
- if(validateHour(val)) {
- $(this).removeClass('error');
- $(this).siblings('.alert').hide().removeClass('error');
-
- if($(this).parent('.agenda_input-list').prev('.agenda_input-list').length > 0) {
- var valBefore = $(this).parent('.agenda_input-list').prev('.agenda_input-list').children('.agenda_input-hour').val();
- var thisVal = val.split(':');
- var befVal = valBefore.split(':');
-
- var valH = parseInt(thisVal[0]);
- var valM = parseInt(thisVal[1]);
-
- var bvalH = parseInt(befVal[0]);
- var bvalM = parseInt(befVal[1]);
-
- var finalH = valH - bvalH;
- var finalM = valM - bvalM;
- var finalHHMM = (finalH<10?"0":"") + finalH.toString() + ":" + (finalM<10?"0":"") + finalM.toString();
-
- if(HHMM > finalHHMM) {
- $(this).siblings('.alert').show();
- } else {
- $(this).siblings('.alert').hide();
- }
- }
- } else {
- $(this).addClass('error');
- $(this).siblings('.alert').show().addClass('error');
- }
- });
-
-
- // FIM CONFIGURAÇÃO AGENDA
-
- var hasErrorAtAppointmentConfiguration = function () {
- let configurationError = false;
- const duration = '50';
- const interval = '10';
- const settedInterval = parseInt(duration) + parseInt(interval);
-
- var convertToMinutes = function (time) {
- var arrTime = time.toString().split(':');
- var convertedHours = arrTime[0] * 60;
- var totMinutes = parseInt(convertedHours) + parseInt(arrTime[1]);
- return totMinutes;
- };
-
- var checkTimeDifference = function (previous, current, item) {
- var timeDifference = parseInt(current) - parseInt(previous);
- var alertBadge = item.querySelector('.alert');
- alertBadge.style.display = 'none';
-
- if (timeDifference < settedInterval) {
- alertBadge.style.display = 'inline';
- configurationError = true;
- }
- };
-
- var checkHoursAtTarget = function (target) {
- var target = document.querySelector(`.td_column_days[data-target="${target}"]`);
- var agendaItems = Object.values(target.querySelectorAll('.agenda_input-list')).filter(
- item => item.previousElementSibling != null
- );
-
- agendaItems.forEach(item => {
- var previousTime = item.previousElementSibling.querySelector('.agenda_input-hour').value;
- var currentTime = item.querySelector('.agenda_input-hour').value;
- var convertedPreviousTime = convertToMinutes(previousTime);
- var convertedCurrentTime = convertToMinutes(currentTime);
-
- checkTimeDifference(convertedPreviousTime, convertedCurrentTime, item);
- });
- };
-
- for (var i = 1; i <= 7; i++) {
- checkHoursAtTarget(i);
- }
-
- if (configurationError)
- snackbar.show('Verifique os horários com erros!', 'error');
-
- return configurationError;
- };
-
- $('.step_button-next').on('click', function(e){
- e.preventDefault();
-
- if(step === 0) {
- $('.steps-control').show();
- nextStep(step);
- } else if(step === 1) {
- var userAbout = $('#user_about').val();
- var userSpeciality = $('#specialities_select').val();
-
- if(userAbout != '' && userSpeciality.length > 0 && userSpeciality != undefined) {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step1',
- data: {'description': userAbout, 'specialties[_ids]': userSpeciality}
- }).done(function( msg ) {
- if(msg === true) {
- nextStep(step);
- }
- });
- } else {
- if(userAbout === '') {
- $('#user_about').addClass('error');
- } else {
- $('#user_about').removeClass('error');
- }
-
- if(userSpeciality.length < 1 || userSpeciality === undefined) {
- $('#specialities_select').siblings('.select2').find('.select2-search__field').addClass('error');
- } else {
- $('#specialities_select').siblings('.select2').find('.select2-search__field').removeClass('error');
- }
- }
- } else if(step === 2) {
- $('.form_adder').each(function(key){
-
- $(this).find('.experience_ids').attr('name', 'academic_backgrounds['+key+'][id]');
- $(this).find('.academic_type').attr('name', 'academic_backgrounds['+key+'][type]');
- $(this).find('.user_course').attr('name', 'academic_backgrounds['+key+'][class_name]');
- $(this).find('.user_institution').attr('name', 'academic_backgrounds['+key+'][institution]');
- $(this).find('.user_academic_start').attr('name', 'academic_backgrounds['+key+'][period_start]');
- $(this).find('.user_academic_end').attr('name', 'academic_backgrounds['+key+'][period_end]');
- $(this).find('.user_academic_status').attr('name', 'academic_backgrounds['+key+'][status]');
-
- $(this).find('input').each(function(k, j){
- if($(this).val() === '') {
- $(this).addClass('error');
- } else {
- $(this).removeClass('error');
- }
- });
- });
-
- var form_step2 = new FormData(document.getElementById('form_step2'));
- if($('.form_adder').find('.error').length === 0) {
-
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step2',
- data: form_step2,
- processData: false,
- contentType: false
- }).done(function( msg ) {
- if(msg === true) {
- nextStep(step);
- }
- });
- }
- } else if(step === 3) {
- var problemVal = $('#problem_select').val();
- var approachVal = $('#approach_select').val();
- var methodVal = $('#method_select').val();
-
- if(problemVal.length > 0 && approachVal.length > 0) {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step3',
- data: {
- 'problems[_ids]': problemVal,
- 'therapies[_ids]': approachVal,
- 'characteristics[_ids]': methodVal
- }
- }).done(function( msg ) {
- if(msg === true) {
- nextStep(step);
- }
- });
- } else {
- if(problemVal.length < 1 || problemVal === undefined) {
- $('#problem_select').siblings('.select2').find('.select2-search__field').addClass('error');
- } else {
- $('#problem_select').siblings('.select2').find('.select2-search__field').removeClass('error');
- }
-
- if(approachVal.length < 1 || approachVal === undefined) {
- $('#approach_select').siblings('.select2').find('.select2-search__field').addClass('error');
- } else {
- $('#approach_select').siblings('.select2').find('.select2-search__field').removeClass('error');
- }
- }
-
- } else if(step === 4) {
- checkModalities();
- var attendedAges = $('#attended_ages').val();
- var attendedLanguages = $('#attended_languages').val();
- var video = 0;
- var audio = 0;
-
- if($('#type_of_service_video').is(':checked')) {
- video = 1;
- }
-
- if($('#type_of_service_audio').is(':checked')) {
- audio = 1;
- }
-
- if(attendedAges.length > 0 && attendedLanguages.length > 0) {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step4',
- data: {
- 'ages[_ids]': attendedAges,
- 'langs[_ids]': attendedLanguages,
- 'attendance_by_phone_call': audio,
- 'attendance_by_video_call': video
- }
- }).done(function( msg ) {
- if(msg === true) {
- nextStep(step);
- }
- });
- } else {
- if(attendedAges.length < 1 || attendedAges === undefined) {
- $('#attended_ages').siblings('.select2').find('.select2-search__field').addClass('error');
- } else {
- $('#attended_ages').siblings('.select2').find('.select2-search__field').removeClass('error');
- }
-
- if(attendedLanguages.length < 1 || attendedLanguages === undefined) {
- $('#attended_languages').siblings('.select2').find('.select2-search__field').addClass('error');
- } else {
- $('#attended_languages').siblings('.select2').find('.select2-search__field').removeClass('error');
- }
- }
-
- } else if(step === 5) {
- $('.modalities-container').not('.disabled').each(function(){
- $(this).find('input').each(function(k, j){
- if($(this).val() === '') {
- $(this).addClass('error');
- } else {
- $(this).removeClass('error');
- }
- });
- });
-
- var form = new FormData(document.getElementById('form_service'));
-
- if($('.modalities-container').find('.error').length === 0) {
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step5',
- data: form,
- processData: false,
- contentType: false
- }).done(function( msg ) {
- if(msg === true) {
- nextStep(step);
- }
- });
- }
- // } else if(step === 6) {
- // var session_duration = $('#session_duration').val();
- // var session_duration_type = $('#session_duration_type').val();
- // var session_interval = $('#session_interval').val();
- // var session_interval_type = $('#session_interval_type').val();
-
- // if(session_duration != '' && session_interval != '') {
- // $.ajax({
- // method: "POST",
- // url: _BASE_URL_+'settings/attendance/step6',
- // data: {
- // 'session_duration': session_duration,
- // 'session_break': session_interval
- // }
- // }).done(function( msg ) {
- // if(msg === true) {
- // nextStep(step);
- // }
- // });
- // } else {
- // if(session_duration === '') {
- // $('#session_duration').addClass('error');
- // } else {
- // $('#session_duration').removeClass('error');
- // }
-
- // if(session_interval === '') {
- // $('#session_interval').addClass('error');
- // } else {
- // $('#session_interval').removeClass('error');
- // }
- // }
- } else if(step === 6) {
- // var formImage = new FormData(document.getElementById('video_upload'));
- var videoUrl = $('#link_video').val();
- var isBlank = true;
-
- if(videoUrl != '') {
- isBlank = false;
- }
-
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step8',
- data: {'video_name': '', 'video_url': videoUrl},
- error: function (request, status, error) {
- $('.input_infoholder').addClass('error-message');
- },
- success: function(msg) {
- if(isBlank === false) {
- if($('#video_alert-checkbox').is(':checked')) {
- $('.video_alert-message').removeClass('error-label');
- nextStep(step);
- } else {
- $('.video_alert-message').addClass('error-label');
- }
- } else {
- nextStep(step);
- }
- }
- });
-
- } else if(step === 7) {
- var hours1 = [], hours2 = [], hours3 = [], hours4 = [], hours5 = [], hours6 = [], hours7 = [];
- var formData = new FormData();
- var count = 0;
-
- $('.get_agenda_input-hour').each(function(k, j){
- if($(this).attr('data-day') === '0') {
- hours1.push($(this).val());
- }
-
- if($(this).attr('data-day') === '1') {
- hours2.push($(this).val());
- }
-
- if($(this).attr('data-day') === '2') {
- hours3.push($(this).val());
- }
-
- if($(this).attr('data-day') === '3') {
- hours4.push($(this).val());
- }
-
- if($(this).attr('data-day') === '4') {
- hours5.push($(this).val());
- }
-
- if($(this).attr('data-day') === '5') {
- hours6.push($(this).val());
- }
-
- if($(this).attr('data-day') === '6') {
- hours7.push($(this).val());
- }
- });
-
- if(hours1.length > 0) {
- $.each(hours1, function(index, value){
- formData.append('schedule_settings['+count+'][day_index]', '0');
- formData.append('schedule_settings['+count+'][hour_start]', value);
- count++;
- });
- }
-
- if(hours2.length > 0) {
- $.each(hours2, function(index, value){
- formData.append('schedule_settings['+count+'][day_index]', '1');
- formData.append('schedule_settings['+count+'][hour_start]', value);
- count++;
- });
- }
-
- if(hours3.length > 0) {
- $.each(hours3, function(index, value){
- formData.append('schedule_settings['+count+'][day_index]', '2');
- formData.append('schedule_settings['+count+'][hour_start]', value);
- count++;
- });
- }
-
- if(hours4.length > 0) {
- $.each(hours4, function(index, value){
- formData.append('schedule_settings['+count+'][day_index]', '3');
- formData.append('schedule_settings['+count+'][hour_start]', value);
- count++;
- });
- }
-
- if(hours5.length > 0) {
- $.each(hours5, function(index, value){
- formData.append('schedule_settings['+count+'][day_index]', '4');
- formData.append('schedule_settings['+count+'][hour_start]', value);
- count++;
- });
- }
-
- if(hours6.length > 0) {
- $.each(hours6, function(index, value){
- formData.append('schedule_settings['+count+'][day_index]', '5');
- formData.append('schedule_settings['+count+'][hour_start]', value);
- count++;
- });
- }
-
- if(hours7.length > 0) {
- $.each(hours7, function(index, value){
- formData.append('schedule_settings['+count+'][day_index]', '6');
- formData.append('schedule_settings['+count+'][hour_start]', value);
- count++;
- });
- }
-
- if (hasErrorAtAppointmentConfiguration())
- return false;
-
- $.ajax({
- method: "POST",
- url: _BASE_URL_+'settings/attendance/step9',
- data: formData,
- processData: false,
- contentType: false
- }).done(function( msg ) {
- if(msg === true) {
- nextStep(step);
- }
- });
- } else if(step === 8) {
- window.location.href = window.location.origin + window.location.pathname;
- } else {
- nextStep(step);
- }
- });
-
- $('.attc_description-read-more').on('click', function(){
- $(this).siblings('.attc_description-container').toggleClass('active');
- $(this).toggleClass('active');
- });
-
- $('.th_tab_days').on('click', function(){
- var $this = $(this).attr('data-target');
- $('.th_tab_days.active').removeClass('active');
- $('.td_column_days.active').removeClass('active');
-
- $(this).addClass('active');
- $('.td_column_days[data-target="'+$this+'"]').addClass('active');
- });
-
- cl('[steps] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var tables = (function(){
- var loaded = false;
-
- var init = function init(){
- cl('[tables] initializing...');
-
-
- $('.customDataTable').each(function(){
- $(this).DataTable( {
- scrollX: true,
- scrollCollapse: false,
- paging: true,
- order: [[ 0, "desc" ]]
- } );
- });
-
-
- cl('[tables] initiated.');
- };
-
- return {
- init: init
- }
-})();
-var toast = (function(){
- var init = function() {
- $('.toast').toast('show');
- };
-
- return {
- init: init
- }
-})();
\ No newline at end of file
diff --git a/public/js/vendors.js b/public/js/vendors.js
deleted file mode 100644
index c85a83f..0000000
--- a/public/js/vendors.js
+++ /dev/null
@@ -1,28762 +0,0 @@
-/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
-!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t},e=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i="#"+i.split("#")[1]),e=i&&"#"!==i?i.trim():null}return e},i=t=>{const i=e(t);return i&&document.querySelector(i)?i:null},s=t=>{const i=e(t);return i?document.querySelector(i):null},n=t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const s=Number.parseFloat(e),n=Number.parseFloat(i);return s||n?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0},o=t=>{t.dispatchEvent(new Event("transitionend"))},r=t=>(t[0]||t).nodeType,a=(t,e)=>{let i=!1;const s=e+5;t.addEventListener("transitionend",(function e(){i=!0,t.removeEventListener("transitionend",e)})),setTimeout(()=>{i||o(t)},s)},l=(t,e,i)=>{Object.keys(i).forEach(s=>{const n=i[s],o=e[s],a=o&&r(o)?"element":null==(l=o)?""+l:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();var l;if(!new RegExp(n).test(a))throw new TypeError(t.toUpperCase()+": "+`Option "${s}" provided type "${a}" `+`but expected type "${n}".`)})},c=t=>{if(!t)return!1;if(t.style&&t.parentNode&&t.parentNode.style){const e=getComputedStyle(t),i=getComputedStyle(t.parentNode);return"none"!==e.display&&"none"!==i.display&&"hidden"!==e.visibility}return!1},d=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),h=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?h(t.parentNode):null},f=()=>function(){},u=t=>t.offsetHeight,p=()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute("data-bs-no-jquery")?t:null},g=()=>"rtl"===document.documentElement.dir,m=(t,e)=>{var i;i=()=>{const i=p();if(i){const s=i.fn[t];i.fn[t]=e.jQueryInterface,i.fn[t].Constructor=e,i.fn[t].noConflict=()=>(i.fn[t]=s,e.jQueryInterface)}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i()},_=new Map;var b={set(t,e,i){_.has(t)||_.set(t,new Map);const s=_.get(t);s.has(e)||0===s.size?s.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(t,e)=>_.has(t)&&_.get(t).get(e)||null,remove(t,e){if(!_.has(t))return;const i=_.get(t);i.delete(e),0===i.size&&_.delete(t)}};const v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,E={};let T=1;const A={mouseenter:"mouseover",mouseleave:"mouseout"},L=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${T++}`||t.uidEvent||T++}function k(t){const e=O(t);return t.uidEvent=e,E[e]=E[e]||{},E[e]}function D(t,e,i=null){const s=Object.keys(t);for(let n=0,o=s.length;n{!function(t,e,i,s){const n=e[i]||{};Object.keys(n).forEach(o=>{if(o.includes(s)){const s=n[o];S(t,e,i,s.originalHandler,s.delegationSelector)}})}(t,l,i,e.slice(1))});const d=l[r]||{};Object.keys(d).forEach(i=>{const s=i.replace(w,"");if(!a||e.includes(s)){const e=d[i];S(t,l,r,e.originalHandler,e.delegationSelector)}})},trigger(t,e,i){if("string"!=typeof e||!t)return null;const s=p(),n=e.replace(y,""),o=e!==n,r=L.has(n);let a,l=!0,c=!0,d=!1,h=null;return o&&s&&(a=s.Event(e,i),s(t).trigger(a),l=!a.isPropagationStopped(),c=!a.isImmediatePropagationStopped(),d=a.isDefaultPrevented()),r?(h=document.createEvent("HTMLEvents"),h.initEvent(n,l,!0)):h=new CustomEvent(e,{bubbles:l,cancelable:!0}),void 0!==i&&Object.keys(i).forEach(t=>{Object.defineProperty(h,t,{get:()=>i[t]})}),d&&h.preventDefault(),c&&t.dispatchEvent(h),h.defaultPrevented&&void 0!==a&&a.preventDefault(),h}};class j{constructor(t){(t="string"==typeof t?document.querySelector(t):t)&&(this._element=t,b.set(this._element,this.constructor.DATA_KEY,this))}dispose(){b.remove(this._element,this.constructor.DATA_KEY),this._element=null}static getInstance(t){return b.get(t,this.DATA_KEY)}static get VERSION(){return"5.0.0-beta3"}}class P extends j{static get DATA_KEY(){return"bs.alert"}close(t){const e=t?this._getRootElement(t):this._element,i=this._triggerCloseEvent(e);null===i||i.defaultPrevented||this._removeElement(e)}_getRootElement(t){return s(t)||t.closest(".alert")}_triggerCloseEvent(t){return N.trigger(t,"close.bs.alert")}_removeElement(t){if(t.classList.remove("show"),!t.classList.contains("fade"))return void this._destroyElement(t);const e=n(t);N.one(t,"transitionend",()=>this._destroyElement(t)),a(t,e)}_destroyElement(t){t.parentNode&&t.parentNode.removeChild(t),N.trigger(t,"closed.bs.alert")}static jQueryInterface(t){return this.each((function(){let e=b.get(this,"bs.alert");e||(e=new P(this)),"close"===t&&e[t](this)}))}static handleDismiss(t){return function(e){e&&e.preventDefault(),t.close(this)}}}N.on(document,"click.bs.alert.data-api",'[data-bs-dismiss="alert"]',P.handleDismiss(new P)),m("alert",P);class I extends j{static get DATA_KEY(){return"bs.button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){let e=b.get(this,"bs.button");e||(e=new I(this)),"toggle"===t&&e[t]()}))}}function M(t){return"true"===t||"false"!==t&&(t===Number(t).toString()?Number(t):""===t||"null"===t?null:t)}function R(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}N.on(document,"click.bs.button.data-api",'[data-bs-toggle="button"]',t=>{t.preventDefault();const e=t.target.closest('[data-bs-toggle="button"]');let i=b.get(e,"bs.button");i||(i=new I(e)),i.toggle()}),m("button",I);const B={setDataAttribute(t,e,i){t.setAttribute("data-bs-"+R(e),i)},removeDataAttribute(t,e){t.removeAttribute("data-bs-"+R(e))},getDataAttributes(t){if(!t)return{};const e={};return Object.keys(t.dataset).filter(t=>t.startsWith("bs")).forEach(i=>{let s=i.replace(/^bs/,"");s=s.charAt(0).toLowerCase()+s.slice(1,s.length),e[s]=M(t.dataset[i])}),e},getDataAttribute:(t,e)=>M(t.getAttribute("data-bs-"+R(e))),offset(t){const e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},position:t=>({top:t.offsetTop,left:t.offsetLeft})},H={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const i=[];let s=t.parentNode;for(;s&&s.nodeType===Node.ELEMENT_NODE&&3!==s.nodeType;)s.matches(e)&&i.push(s),s=s.parentNode;return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]}},W={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},U={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},$="next",F="prev",z="left",K="right";class Y extends j{constructor(t,e){super(t),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._indicatorsElement=H.findOne(".carousel-indicators",this._element),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return W}static get DATA_KEY(){return"bs.carousel"}next(){this._isSliding||this._slide($)}nextWhenVisible(){!document.hidden&&c(this._element)&&this.next()}prev(){this._isSliding||this._slide(F)}pause(t){t||(this._isPaused=!0),H.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&(o(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(t){this._activeElement=H.findOne(".active.carousel-item",this._element);const e=this._getItemIndex(this._activeElement);if(t>this._items.length-1||t<0)return;if(this._isSliding)return void N.one(this._element,"slid.bs.carousel",()=>this.to(t));if(e===t)return this.pause(),void this.cycle();const i=t>e?$:F;this._slide(i,this._items[t])}dispose(){N.off(this._element,".bs.carousel"),this._items=null,this._config=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null,super.dispose()}_getConfig(t){return t={...W,...t},l("carousel",t,U),t}_handleSwipe(){const t=Math.abs(this.touchDeltaX);if(t<=40)return;const e=t/this.touchDeltaX;this.touchDeltaX=0,e&&this._slide(e>0?K:z)}_addEventListeners(){this._config.keyboard&&N.on(this._element,"keydown.bs.carousel",t=>this._keydown(t)),"hover"===this._config.pause&&(N.on(this._element,"mouseenter.bs.carousel",t=>this.pause(t)),N.on(this._element,"mouseleave.bs.carousel",t=>this.cycle(t))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}_addTouchEventListeners(){const t=t=>{!this._pointerEvent||"pen"!==t.pointerType&&"touch"!==t.pointerType?this._pointerEvent||(this.touchStartX=t.touches[0].clientX):this.touchStartX=t.clientX},e=t=>{this.touchDeltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this.touchStartX},i=t=>{!this._pointerEvent||"pen"!==t.pointerType&&"touch"!==t.pointerType||(this.touchDeltaX=t.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(t=>this.cycle(t),500+this._config.interval))};H.find(".carousel-item img",this._element).forEach(t=>{N.on(t,"dragstart.bs.carousel",t=>t.preventDefault())}),this._pointerEvent?(N.on(this._element,"pointerdown.bs.carousel",e=>t(e)),N.on(this._element,"pointerup.bs.carousel",t=>i(t)),this._element.classList.add("pointer-event")):(N.on(this._element,"touchstart.bs.carousel",e=>t(e)),N.on(this._element,"touchmove.bs.carousel",t=>e(t)),N.on(this._element,"touchend.bs.carousel",t=>i(t)))}_keydown(t){/input|textarea/i.test(t.target.tagName)||("ArrowLeft"===t.key?(t.preventDefault(),this._slide(z)):"ArrowRight"===t.key&&(t.preventDefault(),this._slide(K)))}_getItemIndex(t){return this._items=t&&t.parentNode?H.find(".carousel-item",t.parentNode):[],this._items.indexOf(t)}_getItemByOrder(t,e){const i=t===$,s=t===F,n=this._getItemIndex(e),o=this._items.length-1;if((s&&0===n||i&&n===o)&&!this._config.wrap)return e;const r=(n+(s?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]}_triggerSlideEvent(t,e){const i=this._getItemIndex(t),s=this._getItemIndex(H.findOne(".active.carousel-item",this._element));return N.trigger(this._element,"slide.bs.carousel",{relatedTarget:t,direction:e,from:s,to:i})}_setActiveIndicatorElement(t){if(this._indicatorsElement){const e=H.findOne(".active",this._indicatorsElement);e.classList.remove("active"),e.removeAttribute("aria-current");const i=H.find("[data-bs-target]",this._indicatorsElement);for(let e=0;e{r.classList.remove(h,f),r.classList.add("active"),s.classList.remove("active",f,h),this._isSliding=!1,setTimeout(()=>{N.trigger(this._element,"slid.bs.carousel",{relatedTarget:r,direction:p,from:o,to:l})},0)}),a(s,t)}else s.classList.remove("active"),r.classList.add("active"),this._isSliding=!1,N.trigger(this._element,"slid.bs.carousel",{relatedTarget:r,direction:p,from:o,to:l});c&&this.cycle()}}_directionToOrder(t){return[K,z].includes(t)?g()?t===K?F:$:t===K?$:F:t}_orderToDirection(t){return[$,F].includes(t)?g()?t===$?z:K:t===$?K:z:t}static carouselInterface(t,e){let i=b.get(t,"bs.carousel"),s={...W,...B.getDataAttributes(t)};"object"==typeof e&&(s={...s,...e});const n="string"==typeof e?e:s.slide;if(i||(i=new Y(t,s)),"number"==typeof e)i.to(e);else if("string"==typeof n){if(void 0===i[n])throw new TypeError(`No method named "${n}"`);i[n]()}else s.interval&&s.ride&&(i.pause(),i.cycle())}static jQueryInterface(t){return this.each((function(){Y.carouselInterface(this,t)}))}static dataApiClickHandler(t){const e=s(this);if(!e||!e.classList.contains("carousel"))return;const i={...B.getDataAttributes(e),...B.getDataAttributes(this)},n=this.getAttribute("data-bs-slide-to");n&&(i.interval=!1),Y.carouselInterface(e,i),n&&b.get(e,"bs.carousel").to(n),t.preventDefault()}}N.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",Y.dataApiClickHandler),N.on(window,"load.bs.carousel.data-api",()=>{const t=H.find('[data-bs-ride="carousel"]');for(let e=0,i=t.length;et===this._element);null!==n&&o.length&&(this._selector=n,this._triggerArray.push(e))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}static get Default(){return q}static get DATA_KEY(){return"bs.collapse"}toggle(){this._element.classList.contains("show")?this.hide():this.show()}show(){if(this._isTransitioning||this._element.classList.contains("show"))return;let t,e;this._parent&&(t=H.find(".show, .collapsing",this._parent).filter(t=>"string"==typeof this._config.parent?t.getAttribute("data-bs-parent")===this._config.parent:t.classList.contains("collapse")),0===t.length&&(t=null));const i=H.findOne(this._selector);if(t){const s=t.find(t=>i!==t);if(e=s?b.get(s,"bs.collapse"):null,e&&e._isTransitioning)return}if(N.trigger(this._element,"show.bs.collapse").defaultPrevented)return;t&&t.forEach(t=>{i!==t&&X.collapseInterface(t,"hide"),e||b.set(t,"bs.collapse",null)});const s=this._getDimension();this._element.classList.remove("collapse"),this._element.classList.add("collapsing"),this._element.style[s]=0,this._triggerArray.length&&this._triggerArray.forEach(t=>{t.classList.remove("collapsed"),t.setAttribute("aria-expanded",!0)}),this.setTransitioning(!0);const o="scroll"+(s[0].toUpperCase()+s.slice(1)),r=n(this._element);N.one(this._element,"transitionend",()=>{this._element.classList.remove("collapsing"),this._element.classList.add("collapse","show"),this._element.style[s]="",this.setTransitioning(!1),N.trigger(this._element,"shown.bs.collapse")}),a(this._element,r),this._element.style[s]=this._element[o]+"px"}hide(){if(this._isTransitioning||!this._element.classList.contains("show"))return;if(N.trigger(this._element,"hide.bs.collapse").defaultPrevented)return;const t=this._getDimension();this._element.style[t]=this._element.getBoundingClientRect()[t]+"px",u(this._element),this._element.classList.add("collapsing"),this._element.classList.remove("collapse","show");const e=this._triggerArray.length;if(e>0)for(let t=0;t{this.setTransitioning(!1),this._element.classList.remove("collapsing"),this._element.classList.add("collapse"),N.trigger(this._element,"hidden.bs.collapse")}),a(this._element,i)}setTransitioning(t){this._isTransitioning=t}dispose(){super.dispose(),this._config=null,this._parent=null,this._triggerArray=null,this._isTransitioning=null}_getConfig(t){return(t={...q,...t}).toggle=Boolean(t.toggle),l("collapse",t,V),t}_getDimension(){return this._element.classList.contains("width")?"width":"height"}_getParent(){let{parent:t}=this._config;r(t)?void 0===t.jquery&&void 0===t[0]||(t=t[0]):t=H.findOne(t);const e=`[data-bs-toggle="collapse"][data-bs-parent="${t}"]`;return H.find(e,t).forEach(t=>{const e=s(t);this._addAriaAndCollapsedClass(e,[t])}),t}_addAriaAndCollapsedClass(t,e){if(!t||!e.length)return;const i=t.classList.contains("show");e.forEach(t=>{i?t.classList.remove("collapsed"):t.classList.add("collapsed"),t.setAttribute("aria-expanded",i)})}static collapseInterface(t,e){let i=b.get(t,"bs.collapse");const s={...q,...B.getDataAttributes(t),..."object"==typeof e&&e?e:{}};if(!i&&s.toggle&&"string"==typeof e&&/show|hide/.test(e)&&(s.toggle=!1),i||(i=new X(t,s)),"string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}}static jQueryInterface(t){return this.each((function(){X.collapseInterface(this,t)}))}}N.on(document,"click.bs.collapse.data-api",'[data-bs-toggle="collapse"]',(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();const e=B.getDataAttributes(this),s=i(this);H.find(s).forEach(t=>{const i=b.get(t,"bs.collapse");let s;i?(null===i._parent&&"string"==typeof e.parent&&(i._config.parent=e.parent,i._parent=i._getParent()),s="toggle"):s=e,X.collapseInterface(t,s)})})),m("collapse",X);var Q="top",G="bottom",Z="right",J="left",tt=[Q,G,Z,J],et=tt.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),it=[].concat(tt,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),st=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function nt(t){return t?(t.nodeName||"").toLowerCase():null}function ot(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function rt(t){return t instanceof ot(t).Element||t instanceof Element}function at(t){return t instanceof ot(t).HTMLElement||t instanceof HTMLElement}function lt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ot(t).ShadowRoot||t instanceof ShadowRoot)}var ct={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},s=e.attributes[t]||{},n=e.elements[t];at(n)&&nt(n)&&(Object.assign(n.style,i),Object.keys(s).forEach((function(t){var e=s[t];!1===e?n.removeAttribute(t):n.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var s=e.elements[t],n=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});at(s)&&nt(s)&&(Object.assign(s.style,o),Object.keys(n).forEach((function(t){s.removeAttribute(t)})))}))}},requires:["computeStyles"]};function dt(t){return t.split("-")[0]}function ht(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function ft(t){var e=ht(t),i=t.offsetWidth,s=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:s}}function ut(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&<(i)){var s=e;do{if(s&&t.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function pt(t){return ot(t).getComputedStyle(t)}function gt(t){return["table","td","th"].indexOf(nt(t))>=0}function mt(t){return((rt(t)?t.ownerDocument:t.document)||window.document).documentElement}function _t(t){return"html"===nt(t)?t:t.assignedSlot||t.parentNode||(lt(t)?t.host:null)||mt(t)}function bt(t){return at(t)&&"fixed"!==pt(t).position?t.offsetParent:null}function vt(t){for(var e=ot(t),i=bt(t);i&>(i)&&"static"===pt(i).position;)i=bt(i);return i&&("html"===nt(i)||"body"===nt(i)&&"static"===pt(i).position)?e:i||function(t){for(var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),i=_t(t);at(i)&&["html","body"].indexOf(nt(i))<0;){var s=pt(i);if("none"!==s.transform||"none"!==s.perspective||"paint"===s.contain||-1!==["transform","perspective"].indexOf(s.willChange)||e&&"filter"===s.willChange||e&&s.filter&&"none"!==s.filter)return i;i=i.parentNode}return null}(t)||e}function yt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var wt=Math.max,Et=Math.min,Tt=Math.round;function At(t,e,i){return wt(t,Et(e,i))}function Lt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Ot(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var kt={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,s=t.name,n=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=dt(i.placement),l=yt(a),c=[J,Z].indexOf(a)>=0?"height":"width";if(o&&r){var d=function(t,e){return Lt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Ot(t,tt))}(n.padding,i),h=ft(o),f="y"===l?Q:J,u="y"===l?G:Z,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],g=r[l]-i.rects.reference[l],m=vt(o),_=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=p/2-g/2,v=d[f],y=_-h[c]-d[u],w=_/2-h[c]/2+b,E=At(v,w,y),T=l;i.modifiersData[s]=((e={})[T]=E,e.centerOffset=E-w,e)}},effect:function(t){var e=t.state,i=t.options.element,s=void 0===i?"[data-popper-arrow]":i;null!=s&&("string"!=typeof s||(s=e.elements.popper.querySelector(s)))&&ut(e.elements.popper,s)&&(e.elements.arrow=s)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},Dt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xt(t){var e,i=t.popper,s=t.popperRect,n=t.placement,o=t.offsets,r=t.position,a=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,d=!0===c?function(t){var e=t.x,i=t.y,s=window.devicePixelRatio||1;return{x:Tt(Tt(e*s)/s)||0,y:Tt(Tt(i*s)/s)||0}}(o):"function"==typeof c?c(o):o,h=d.x,f=void 0===h?0:h,u=d.y,p=void 0===u?0:u,g=o.hasOwnProperty("x"),m=o.hasOwnProperty("y"),_=J,b=Q,v=window;if(l){var y=vt(i),w="clientHeight",E="clientWidth";y===ot(i)&&"static"!==pt(y=mt(i)).position&&(w="scrollHeight",E="scrollWidth"),y=y,n===Q&&(b=G,p-=y[w]-s.height,p*=a?1:-1),n===J&&(_=Z,f-=y[E]-s.width,f*=a?1:-1)}var T,A=Object.assign({position:r},l&&Dt);return a?Object.assign({},A,((T={})[b]=m?"0":"",T[_]=g?"0":"",T.transform=(v.devicePixelRatio||1)<2?"translate("+f+"px, "+p+"px)":"translate3d("+f+"px, "+p+"px, 0)",T)):Object.assign({},A,((e={})[b]=m?p+"px":"",e[_]=g?f+"px":"",e.transform="",e))}var Ct={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,s=i.gpuAcceleration,n=void 0===s||s,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:dt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,xt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,xt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},St={passive:!0},Nt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,s=t.options,n=s.scroll,o=void 0===n||n,r=s.resize,a=void 0===r||r,l=ot(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,St)})),a&&l.addEventListener("resize",i.update,St),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,St)})),a&&l.removeEventListener("resize",i.update,St)}},data:{}},jt={left:"right",right:"left",bottom:"top",top:"bottom"};function Pt(t){return t.replace(/left|right|bottom|top/g,(function(t){return jt[t]}))}var It={start:"end",end:"start"};function Mt(t){return t.replace(/start|end/g,(function(t){return It[t]}))}function Rt(t){var e=ot(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Bt(t){return ht(mt(t)).left+Rt(t).scrollLeft}function Ht(t){var e=pt(t),i=e.overflow,s=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+s)}function Wt(t,e){var i;void 0===e&&(e=[]);var s=function t(e){return["html","body","#document"].indexOf(nt(e))>=0?e.ownerDocument.body:at(e)&&Ht(e)?e:t(_t(e))}(t),n=s===(null==(i=t.ownerDocument)?void 0:i.body),o=ot(s),r=n?[o].concat(o.visualViewport||[],Ht(s)?s:[]):s,a=e.concat(r);return n?a:a.concat(Wt(_t(r)))}function Ut(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function $t(t,e){return"viewport"===e?Ut(function(t){var e=ot(t),i=mt(t),s=e.visualViewport,n=i.clientWidth,o=i.clientHeight,r=0,a=0;return s&&(n=s.width,o=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(r=s.offsetLeft,a=s.offsetTop)),{width:n,height:o,x:r+Bt(t),y:a}}(t)):at(e)?function(t){var e=ht(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Ut(function(t){var e,i=mt(t),s=Rt(t),n=null==(e=t.ownerDocument)?void 0:e.body,o=wt(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=wt(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-s.scrollLeft+Bt(t),l=-s.scrollTop;return"rtl"===pt(n||i).direction&&(a+=wt(i.clientWidth,n?n.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(mt(t)))}function Ft(t){return t.split("-")[1]}function zt(t){var e,i=t.reference,s=t.element,n=t.placement,o=n?dt(n):null,r=n?Ft(n):null,a=i.x+i.width/2-s.width/2,l=i.y+i.height/2-s.height/2;switch(o){case Q:e={x:a,y:i.y-s.height};break;case G:e={x:a,y:i.y+i.height};break;case Z:e={x:i.x+i.width,y:l};break;case J:e={x:i.x-s.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?yt(o):null;if(null!=c){var d="y"===c?"height":"width";switch(r){case"start":e[c]=e[c]-(i[d]/2-s[d]/2);break;case"end":e[c]=e[c]+(i[d]/2-s[d]/2)}}return e}function Kt(t,e){void 0===e&&(e={});var i=e,s=i.placement,n=void 0===s?t.placement:s,o=i.boundary,r=void 0===o?"clippingParents":o,a=i.rootBoundary,l=void 0===a?"viewport":a,c=i.elementContext,d=void 0===c?"popper":c,h=i.altBoundary,f=void 0!==h&&h,u=i.padding,p=void 0===u?0:u,g=Lt("number"!=typeof p?p:Ot(p,tt)),m="popper"===d?"reference":"popper",_=t.elements.reference,b=t.rects.popper,v=t.elements[f?m:d],y=function(t,e,i){var s="clippingParents"===e?function(t){var e=Wt(_t(t)),i=["absolute","fixed"].indexOf(pt(t).position)>=0&&at(t)?vt(t):t;return rt(i)?e.filter((function(t){return rt(t)&&ut(t,i)&&"body"!==nt(t)})):[]}(t):[].concat(e),n=[].concat(s,[i]),o=n[0],r=n.reduce((function(e,i){var s=$t(t,i);return e.top=wt(s.top,e.top),e.right=Et(s.right,e.right),e.bottom=Et(s.bottom,e.bottom),e.left=wt(s.left,e.left),e}),$t(t,o));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}(rt(v)?v:v.contextElement||mt(t.elements.popper),r,l),w=ht(_),E=zt({reference:w,element:b,strategy:"absolute",placement:n}),T=Ut(Object.assign({},b,E)),A="popper"===d?T:w,L={top:y.top-A.top+g.top,bottom:A.bottom-y.bottom+g.bottom,left:y.left-A.left+g.left,right:A.right-y.right+g.right},O=t.modifiersData.offset;if("popper"===d&&O){var k=O[n];Object.keys(L).forEach((function(t){var e=[Z,G].indexOf(t)>=0?1:-1,i=[Q,G].indexOf(t)>=0?"y":"x";L[t]+=k[i]*e}))}return L}function Yt(t,e){void 0===e&&(e={});var i=e,s=i.placement,n=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?it:l,d=Ft(s),h=d?a?et:et.filter((function(t){return Ft(t)===d})):tt,f=h.filter((function(t){return c.indexOf(t)>=0}));0===f.length&&(f=h);var u=f.reduce((function(e,i){return e[i]=Kt(t,{placement:i,boundary:n,rootBoundary:o,padding:r})[dt(i)],e}),{});return Object.keys(u).sort((function(t,e){return u[t]-u[e]}))}var qt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,s=t.name;if(!e.modifiersData[s]._skip){for(var n=i.mainAxis,o=void 0===n||n,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,d=i.boundary,h=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,p=void 0===u||u,g=i.allowedAutoPlacements,m=e.options.placement,_=dt(m),b=l||(_!==m&&p?function(t){if("auto"===dt(t))return[];var e=Pt(t);return[Mt(t),e,Mt(e)]}(m):[Pt(m)]),v=[m].concat(b).reduce((function(t,i){return t.concat("auto"===dt(i)?Yt(e,{placement:i,boundary:d,rootBoundary:h,padding:c,flipVariations:p,allowedAutoPlacements:g}):i)}),[]),y=e.rects.reference,w=e.rects.popper,E=new Map,T=!0,A=v[0],L=0;L=0,C=x?"width":"height",S=Kt(e,{placement:O,boundary:d,rootBoundary:h,altBoundary:f,padding:c}),N=x?D?Z:J:D?G:Q;y[C]>w[C]&&(N=Pt(N));var j=Pt(N),P=[];if(o&&P.push(S[k]<=0),a&&P.push(S[N]<=0,S[j]<=0),P.every((function(t){return t}))){A=O,T=!1;break}E.set(O,P)}if(T)for(var I=function(t){var e=v.find((function(e){var i=E.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return A=e,"break"},M=p?3:1;M>0&&"break"!==I(M);M--);e.placement!==A&&(e.modifiersData[s]._skip=!0,e.placement=A,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Vt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Xt(t){return[Q,Z,G,J].some((function(e){return t[e]>=0}))}var Qt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,s=e.rects.reference,n=e.rects.popper,o=e.modifiersData.preventOverflow,r=Kt(e,{elementContext:"reference"}),a=Kt(e,{altBoundary:!0}),l=Vt(r,s),c=Vt(a,n,o),d=Xt(l),h=Xt(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}},Gt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,s=t.name,n=i.offset,o=void 0===n?[0,0]:n,r=it.reduce((function(t,i){return t[i]=function(t,e,i){var s=dt(t),n=[J,Q].indexOf(s)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*n,[J,Z].indexOf(s)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[s]=r}},Zt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=zt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},Jt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,s=t.name,n=i.mainAxis,o=void 0===n||n,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,h=i.padding,f=i.tether,u=void 0===f||f,p=i.tetherOffset,g=void 0===p?0:p,m=Kt(e,{boundary:l,rootBoundary:c,padding:h,altBoundary:d}),_=dt(e.placement),b=Ft(e.placement),v=!b,y=yt(_),w="x"===y?"y":"x",E=e.modifiersData.popperOffsets,T=e.rects.reference,A=e.rects.popper,L="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,O={x:0,y:0};if(E){if(o||a){var k="y"===y?Q:J,D="y"===y?G:Z,x="y"===y?"height":"width",C=E[y],S=E[y]+m[k],N=E[y]-m[D],j=u?-A[x]/2:0,P="start"===b?T[x]:A[x],I="start"===b?-A[x]:-T[x],M=e.elements.arrow,R=u&&M?ft(M):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=B[k],W=B[D],U=At(0,T[x],R[x]),$=v?T[x]/2-j-U-H-L:P-U-H-L,F=v?-T[x]/2+j+U+W+L:I+U+W+L,z=e.elements.arrow&&vt(e.elements.arrow),K=z?"y"===y?z.clientTop||0:z.clientLeft||0:0,Y=e.modifiersData.offset?e.modifiersData.offset[e.placement][y]:0,q=E[y]+$-Y-K,V=E[y]+F-Y;if(o){var X=At(u?Et(S,q):S,C,u?wt(N,V):N);E[y]=X,O[y]=X-C}if(a){var tt="x"===y?Q:J,et="x"===y?G:Z,it=E[w],st=it+m[tt],nt=it-m[et],ot=At(u?Et(st,q):st,it,u?wt(nt,V):nt);E[w]=ot,O[w]=ot-it}}e.modifiersData[s]=O}},requiresIfExists:["offset"]};function te(t,e,i){void 0===i&&(i=!1);var s,n,o=mt(e),r=ht(t),a=at(e),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!i)&&(("body"!==nt(e)||Ht(o))&&(l=(s=e)!==ot(s)&&at(s)?{scrollLeft:(n=s).scrollLeft,scrollTop:n.scrollTop}:Rt(s)),at(e)?((c=ht(e)).x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=Bt(o))),{x:r.left+l.scrollLeft-c.x,y:r.top+l.scrollTop-c.y,width:r.width,height:r.height}}var ee={placement:"bottom",modifiers:[],strategy:"absolute"};function ie(){for(var t=arguments.length,e=new Array(t),i=0;i"applyStyles"===t.name&&!1===t.enabled);this._popper=re(e,this._menu,i),s&&B.setDataAttribute(this._menu,"popper","static")}"ontouchstart"in document.documentElement&&!t.closest(".navbar-nav")&&[].concat(...document.body.children).forEach(t=>N.on(t,"mouseover",null,(function(){}))),this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.toggle("show"),this._element.classList.toggle("show"),N.trigger(this._element,"shown.bs.dropdown",e)}}hide(){if(this._element.disabled||this._element.classList.contains("disabled")||!this._menu.classList.contains("show"))return;const t={relatedTarget:this._element};N.trigger(this._element,"hide.bs.dropdown",t).defaultPrevented||(this._popper&&this._popper.destroy(),this._menu.classList.toggle("show"),this._element.classList.toggle("show"),B.removeDataAttribute(this._menu,"popper"),N.trigger(this._element,"hidden.bs.dropdown",t))}dispose(){N.off(this._element,".bs.dropdown"),this._menu=null,this._popper&&(this._popper.destroy(),this._popper=null),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_addEventListeners(){N.on(this._element,"click.bs.dropdown",t=>{t.preventDefault(),this.toggle()})}_getConfig(t){if(t={...this.constructor.Default,...B.getDataAttributes(this._element),...t},l("dropdown",t,this.constructor.DefaultType),"object"==typeof t.reference&&!r(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError("dropdown".toUpperCase()+': Option "reference" provided type "object" without a required "getBoundingClientRect" method.');return t}_getMenuElement(){return H.next(this._element,".dropdown-menu")[0]}_getPlacement(){const t=this._element.parentNode;if(t.classList.contains("dropend"))return ue;if(t.classList.contains("dropstart"))return pe;const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?de:ce:e?fe:he}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return"static"===this._config.display&&(t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}static dropdownInterface(t,e){let i=b.get(t,"bs.dropdown");if(i||(i=new _e(t,"object"==typeof e?e:null)),"string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}}static jQueryInterface(t){return this.each((function(){_e.dropdownInterface(this,t)}))}static clearMenus(t){if(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;if(/input|select|textarea|form/i.test(t.target.tagName))return}const e=H.find('[data-bs-toggle="dropdown"]');for(let i=0,s=e.length;it.composedPath().includes(e)))continue;if("keyup"===t.type&&"Tab"===t.key&&o.contains(t.target))continue}N.trigger(e[i],"hide.bs.dropdown",n).defaultPrevented||("ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach(t=>N.off(t,"mouseover",null,(function(){}))),e[i].setAttribute("aria-expanded","false"),s._popper&&s._popper.destroy(),o.classList.remove("show"),e[i].classList.remove("show"),B.removeDataAttribute(o,"popper"),N.trigger(e[i],"hidden.bs.dropdown",n))}}}static getParentFromElement(t){return s(t)||t.parentNode}static dataApiKeydownHandler(t){if(/input|textarea/i.test(t.target.tagName)?"Space"===t.key||"Escape"!==t.key&&("ArrowDown"!==t.key&&"ArrowUp"!==t.key||t.target.closest(".dropdown-menu")):!le.test(t.key))return;if(t.preventDefault(),t.stopPropagation(),this.disabled||this.classList.contains("disabled"))return;const e=_e.getParentFromElement(this),i=this.classList.contains("show");if("Escape"===t.key)return(this.matches('[data-bs-toggle="dropdown"]')?this:H.prev(this,'[data-bs-toggle="dropdown"]')[0]).focus(),void _e.clearMenus();if(!i&&("ArrowUp"===t.key||"ArrowDown"===t.key))return void(this.matches('[data-bs-toggle="dropdown"]')?this:H.prev(this,'[data-bs-toggle="dropdown"]')[0]).click();if(!i||"Space"===t.key)return void _e.clearMenus();const s=H.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",e).filter(c);if(!s.length)return;let n=s.indexOf(t.target);"ArrowUp"===t.key&&n>0&&n--,"ArrowDown"===t.key&&nthis.hide(t)),N.on(this._dialog,"mousedown.dismiss.bs.modal",()=>{N.one(this._element,"mouseup.dismiss.bs.modal",t=>{t.target===this._element&&(this._ignoreBackdropClick=!0)})}),this._showBackdrop(()=>this._showElement(t)))}hide(t){if(t&&t.preventDefault(),!this._isShown||this._isTransitioning)return;if(N.trigger(this._element,"hide.bs.modal").defaultPrevented)return;this._isShown=!1;const e=this._isAnimated();if(e&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),N.off(document,"focusin.bs.modal"),this._element.classList.remove("show"),N.off(this._element,"click.dismiss.bs.modal"),N.off(this._dialog,"mousedown.dismiss.bs.modal"),e){const t=n(this._element);N.one(this._element,"transitionend",t=>this._hideModal(t)),a(this._element,t)}else this._hideModal()}dispose(){[window,this._element,this._dialog].forEach(t=>N.off(t,".bs.modal")),super.dispose(),N.off(document,"focusin.bs.modal"),this._config=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null}handleUpdate(){this._adjustDialog()}_getConfig(t){return t={...be,...t},l("modal",t,ve),t}_showElement(t){const e=this._isAnimated(),i=H.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,i&&(i.scrollTop=0),e&&u(this._element),this._element.classList.add("show"),this._config.focus&&this._enforceFocus();const s=()=>{this._config.focus&&this._element.focus(),this._isTransitioning=!1,N.trigger(this._element,"shown.bs.modal",{relatedTarget:t})};if(e){const t=n(this._dialog);N.one(this._dialog,"transitionend",s),a(this._dialog,t)}else s()}_enforceFocus(){N.off(document,"focusin.bs.modal"),N.on(document,"focusin.bs.modal",t=>{document===t.target||this._element===t.target||this._element.contains(t.target)||this._element.focus()})}_setEscapeEvent(){this._isShown?N.on(this._element,"keydown.dismiss.bs.modal",t=>{this._config.keyboard&&"Escape"===t.key?(t.preventDefault(),this.hide()):this._config.keyboard||"Escape"!==t.key||this._triggerBackdropTransition()}):N.off(this._element,"keydown.dismiss.bs.modal")}_setResizeEvent(){this._isShown?N.on(window,"resize.bs.modal",()=>this._adjustDialog()):N.off(window,"resize.bs.modal")}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop(()=>{document.body.classList.remove("modal-open"),this._resetAdjustments(),this._resetScrollbar(),N.trigger(this._element,"hidden.bs.modal")})}_removeBackdrop(){this._backdrop.parentNode.removeChild(this._backdrop),this._backdrop=null}_showBackdrop(t){const e=this._isAnimated();if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",e&&this._backdrop.classList.add("fade"),document.body.appendChild(this._backdrop),N.on(this._element,"click.dismiss.bs.modal",t=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===this._config.backdrop?this._triggerBackdropTransition():this.hide())}),e&&u(this._backdrop),this._backdrop.classList.add("show"),!e)return void t();const i=n(this._backdrop);N.one(this._backdrop,"transitionend",t),a(this._backdrop,i)}else if(!this._isShown&&this._backdrop){this._backdrop.classList.remove("show");const i=()=>{this._removeBackdrop(),t()};if(e){const t=n(this._backdrop);N.one(this._backdrop,"transitionend",i),a(this._backdrop,t)}else i()}else t()}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(N.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight;t||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");const e=n(this._dialog);N.off(this._element,"transitionend"),N.one(this._element,"transitionend",()=>{this._element.classList.remove("modal-static"),t||(N.one(this._element,"transitionend",()=>{this._element.style.overflowY=""}),a(this._element,e))}),a(this._element,e),this._element.focus()}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight;(!this._isBodyOverflowing&&t&&!g()||this._isBodyOverflowing&&!t&&g())&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),(this._isBodyOverflowing&&!t&&!g()||!this._isBodyOverflowing&&t&&g())&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}_checkScrollbar(){const t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)t+this._scrollbarWidth),this._setElementAttributes(".sticky-top","marginRight",t=>t-this._scrollbarWidth),this._setElementAttributes("body","paddingRight",t=>t+this._scrollbarWidth)),document.body.classList.add("modal-open")}_setElementAttributes(t,e,i){H.find(t).forEach(t=>{if(t!==document.body&&window.innerWidth>t.clientWidth+this._scrollbarWidth)return;const s=t.style[e],n=window.getComputedStyle(t)[e];B.setDataAttribute(t,e,s),t.style[e]=i(Number.parseFloat(n))+"px"})}_resetScrollbar(){this._resetElementAttributes(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top","paddingRight"),this._resetElementAttributes(".sticky-top","marginRight"),this._resetElementAttributes("body","paddingRight")}_resetElementAttributes(t,e){H.find(t).forEach(t=>{const i=B.getDataAttribute(t,e);void 0===i&&t===document.body?t.style[e]="":(B.removeDataAttribute(t,e),t.style[e]=i)})}_getScrollbarWidth(){const t=document.createElement("div");t.className="modal-scrollbar-measure",document.body.appendChild(t);const e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}static jQueryInterface(t,e){return this.each((function(){let i=b.get(this,"bs.modal");const s={...be,...B.getDataAttributes(this),..."object"==typeof t&&t?t:{}};if(i||(i=new ye(this,s)),"string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}N.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',(function(t){const e=s(this);"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault(),N.one(e,"show.bs.modal",t=>{t.defaultPrevented||N.one(e,"hidden.bs.modal",()=>{c(this)&&this.focus()})});let i=b.get(e,"bs.modal");if(!i){const t={...B.getDataAttributes(e),...B.getDataAttributes(this)};i=new ye(e,t)}i.toggle(this)})),m("modal",ye);const we=()=>{const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)},Ee=(t,e,i)=>{const s=we();H.find(t).forEach(t=>{if(t!==document.body&&window.innerWidth>t.clientWidth+s)return;const n=t.style[e],o=window.getComputedStyle(t)[e];B.setDataAttribute(t,e,n),t.style[e]=i(Number.parseFloat(o))+"px"})},Te=(t,e)=>{H.find(t).forEach(t=>{const i=B.getDataAttribute(t,e);void 0===i&&t===document.body?t.style.removeProperty(e):(B.removeDataAttribute(t,e),t.style[e]=i)})},Ae={backdrop:!0,keyboard:!0,scroll:!1},Le={backdrop:"boolean",keyboard:"boolean",scroll:"boolean"};class Oe extends j{constructor(t,e){super(t),this._config=this._getConfig(e),this._isShown=!1,this._addEventListeners()}static get Default(){return Ae}static get DATA_KEY(){return"bs.offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||N.trigger(this._element,"show.bs.offcanvas",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._element.style.visibility="visible",this._config.backdrop&&document.body.classList.add("offcanvas-backdrop"),this._config.scroll||((t=we())=>{document.body.style.overflow="hidden",Ee(".fixed-top, .fixed-bottom, .is-fixed","paddingRight",e=>e+t),Ee(".sticky-top","marginRight",e=>e-t),Ee("body","paddingRight",e=>e+t)})(),this._element.classList.add("offcanvas-toggling"),this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add("show"),setTimeout(()=>{this._element.classList.remove("offcanvas-toggling"),N.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:t}),this._enforceFocusOnElement(this._element)},n(this._element)))}hide(){this._isShown&&(N.trigger(this._element,"hide.bs.offcanvas").defaultPrevented||(this._element.classList.add("offcanvas-toggling"),N.off(document,"focusin.bs.offcanvas"),this._element.blur(),this._isShown=!1,this._element.classList.remove("show"),setTimeout(()=>{this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._element.style.visibility="hidden",this._config.backdrop&&document.body.classList.remove("offcanvas-backdrop"),this._config.scroll||(document.body.style.overflow="auto",Te(".fixed-top, .fixed-bottom, .is-fixed","paddingRight"),Te(".sticky-top","marginRight"),Te("body","paddingRight")),N.trigger(this._element,"hidden.bs.offcanvas"),this._element.classList.remove("offcanvas-toggling")},n(this._element))))}_getConfig(t){return t={...Ae,...B.getDataAttributes(this._element),..."object"==typeof t?t:{}},l("offcanvas",t,Le),t}_enforceFocusOnElement(t){N.off(document,"focusin.bs.offcanvas"),N.on(document,"focusin.bs.offcanvas",e=>{document===e.target||t===e.target||t.contains(e.target)||t.focus()}),t.focus()}_addEventListeners(){N.on(this._element,"click.dismiss.bs.offcanvas",'[data-bs-dismiss="offcanvas"]',()=>this.hide()),N.on(document,"keydown",t=>{this._config.keyboard&&"Escape"===t.key&&this.hide()}),N.on(document,"click.bs.offcanvas.data-api",t=>{const e=H.findOne(i(t.target));this._element.contains(t.target)||e===this._element||this.hide()})}static jQueryInterface(t){return this.each((function(){const e=b.get(this,"bs.offcanvas")||new Oe(this,"object"==typeof t?t:{});if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}N.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',(function(t){const e=s(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),d(this))return;N.one(e,"hidden.bs.offcanvas",()=>{c(this)&&this.focus()});const i=H.findOne(".offcanvas.show, .offcanvas-toggling");i&&i!==e||(b.get(e,"bs.offcanvas")||new Oe(e)).toggle(this)})),N.on(window,"load.bs.offcanvas.data-api",()=>{H.find(".offcanvas.show").forEach(t=>(b.get(t,"bs.offcanvas")||new Oe(t)).show())}),m("offcanvas",Oe);const ke=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),De=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i,xe=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,Ce=(t,e)=>{const i=t.nodeName.toLowerCase();if(e.includes(i))return!ke.has(i)||Boolean(De.test(t.nodeValue)||xe.test(t.nodeValue));const s=e.filter(t=>t instanceof RegExp);for(let t=0,e=s.length;t{Ce(t,a)||i.removeAttribute(t.nodeName)})}return s.body.innerHTML}const Ne=new RegExp("(^|\\s)bs-tooltip\\S+","g"),je=new Set(["sanitize","allowList","sanitizeFn"]),Pe={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(array|string|function)",container:"(string|element|boolean)",fallbackPlacements:"array",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",allowList:"object",popperConfig:"(null|object|function)"},Ie={AUTO:"auto",TOP:"top",RIGHT:g()?"left":"right",BOTTOM:"bottom",LEFT:g()?"right":"left"},Me={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:[0,0],container:!1,fallbackPlacements:["top","right","bottom","left"],boundary:"clippingParents",customClass:"",sanitize:!0,sanitizeFn:null,allowList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},Re={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"};class Be extends j{constructor(t,e){if(void 0===ae)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.config=this._getConfig(e),this.tip=null,this._setListeners()}static get Default(){return Me}static get NAME(){return"tooltip"}static get DATA_KEY(){return"bs.tooltip"}static get Event(){return Re}static get EVENT_KEY(){return".bs.tooltip"}static get DefaultType(){return Pe}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(t){if(this._isEnabled)if(t){const e=this._initializeOnDelegatedTarget(t);e._activeTrigger.click=!e._activeTrigger.click,e._isWithActiveTrigger()?e._enter(null,e):e._leave(null,e)}else{if(this.getTipElement().classList.contains("show"))return void this._leave(null,this);this._enter(null,this)}}dispose(){clearTimeout(this._timeout),N.off(this._element,this.constructor.EVENT_KEY),N.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.tip&&this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.config=null,this.tip=null,super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this.isWithContent()||!this._isEnabled)return;const e=N.trigger(this._element,this.constructor.Event.SHOW),i=h(this._element),s=null===i?this._element.ownerDocument.documentElement.contains(this._element):i.contains(this._element);if(e.defaultPrevented||!s)return;const o=this.getTipElement(),r=t(this.constructor.NAME);o.setAttribute("id",r),this._element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&o.classList.add("fade");const l="function"==typeof this.config.placement?this.config.placement.call(this,o,this._element):this.config.placement,c=this._getAttachment(l);this._addAttachmentClass(c);const d=this._getContainer();b.set(o,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||(d.appendChild(o),N.trigger(this._element,this.constructor.Event.INSERTED)),this._popper?this._popper.update():this._popper=re(this._element,o,this._getPopperConfig(c)),o.classList.add("show");const f="function"==typeof this.config.customClass?this.config.customClass():this.config.customClass;f&&o.classList.add(...f.split(" ")),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach(t=>{N.on(t,"mouseover",(function(){}))});const u=()=>{const t=this._hoverState;this._hoverState=null,N.trigger(this._element,this.constructor.Event.SHOWN),"out"===t&&this._leave(null,this)};if(this.tip.classList.contains("fade")){const t=n(this.tip);N.one(this.tip,"transitionend",u),a(this.tip,t)}else u()}hide(){if(!this._popper)return;const t=this.getTipElement(),e=()=>{this._isWithActiveTrigger()||("show"!==this._hoverState&&t.parentNode&&t.parentNode.removeChild(t),this._cleanTipClass(),this._element.removeAttribute("aria-describedby"),N.trigger(this._element,this.constructor.Event.HIDDEN),this._popper&&(this._popper.destroy(),this._popper=null))};if(!N.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented){if(t.classList.remove("show"),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach(t=>N.off(t,"mouseover",f)),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this.tip.classList.contains("fade")){const i=n(t);N.one(t,"transitionend",e),a(t,i)}else e();this._hoverState=""}}update(){null!==this._popper&&this._popper.update()}isWithContent(){return Boolean(this.getTitle())}getTipElement(){if(this.tip)return this.tip;const t=document.createElement("div");return t.innerHTML=this.config.template,this.tip=t.children[0],this.tip}setContent(){const t=this.getTipElement();this.setElementContent(H.findOne(".tooltip-inner",t),this.getTitle()),t.classList.remove("fade","show")}setElementContent(t,e){if(null!==t)return"object"==typeof e&&r(e)?(e.jquery&&(e=e[0]),void(this.config.html?e.parentNode!==t&&(t.innerHTML="",t.appendChild(e)):t.textContent=e.textContent)):void(this.config.html?(this.config.sanitize&&(e=Se(e,this.config.allowList,this.config.sanitizeFn)),t.innerHTML=e):t.textContent=e)}getTitle(){let t=this._element.getAttribute("data-bs-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this._element):this.config.title),t}updateAttachment(t){return"right"===t?"end":"left"===t?"start":t}_initializeOnDelegatedTarget(t,e){const i=this.constructor.DATA_KEY;return(e=e||b.get(t.delegateTarget,i))||(e=new this.constructor(t.delegateTarget,this._getDelegateConfig()),b.set(t.delegateTarget,i,e)),e}_getOffset(){const{offset:t}=this.config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{altBoundary:!0,fallbackPlacements:this.config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this.config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"onChange",enabled:!0,phase:"afterWrite",fn:t=>this._handlePopperPlacementChange(t)}],onFirstUpdate:t=>{t.options.placement!==t.placement&&this._handlePopperPlacementChange(t)}};return{...e,..."function"==typeof this.config.popperConfig?this.config.popperConfig(e):this.config.popperConfig}}_addAttachmentClass(t){this.getTipElement().classList.add("bs-tooltip-"+this.updateAttachment(t))}_getContainer(){return!1===this.config.container?document.body:r(this.config.container)?this.config.container:H.findOne(this.config.container)}_getAttachment(t){return Ie[t.toUpperCase()]}_setListeners(){this.config.trigger.split(" ").forEach(t=>{if("click"===t)N.on(this._element,this.constructor.Event.CLICK,this.config.selector,t=>this.toggle(t));else if("manual"!==t){const e="hover"===t?this.constructor.Event.MOUSEENTER:this.constructor.Event.FOCUSIN,i="hover"===t?this.constructor.Event.MOUSELEAVE:this.constructor.Event.FOCUSOUT;N.on(this._element,e,this.config.selector,t=>this._enter(t)),N.on(this._element,i,this.config.selector,t=>this._leave(t))}}),this._hideModalHandler=()=>{this._element&&this.hide()},N.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.config.selector?this.config={...this.config,trigger:"manual",selector:""}:this._fixTitle()}_fixTitle(){const t=this._element.getAttribute("title"),e=typeof this._element.getAttribute("data-bs-original-title");(t||"string"!==e)&&(this._element.setAttribute("data-bs-original-title",t||""),!t||this._element.getAttribute("aria-label")||this._element.textContent||this._element.setAttribute("aria-label",t),this._element.setAttribute("title",""))}_enter(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e.getTipElement().classList.contains("show")||"show"===e._hoverState?e._hoverState="show":(clearTimeout(e._timeout),e._hoverState="show",e.config.delay&&e.config.delay.show?e._timeout=setTimeout(()=>{"show"===e._hoverState&&e.show()},e.config.delay.show):e.show())}_leave(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger["focusout"===t.type?"focus":"hover"]=e._element.contains(t.relatedTarget)),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState="out",e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(()=>{"out"===e._hoverState&&e.hide()},e.config.delay.hide):e.hide())}_isWithActiveTrigger(){for(const t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1}_getConfig(t){const e=B.getDataAttributes(this._element);return Object.keys(e).forEach(t=>{je.has(t)&&delete e[t]}),t&&"object"==typeof t.container&&t.container.jquery&&(t.container=t.container[0]),"number"==typeof(t={...this.constructor.Default,...e,..."object"==typeof t&&t?t:{}}).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),l("tooltip",t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.allowList,t.sanitizeFn)),t}_getDelegateConfig(){const t={};if(this.config)for(const e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t}_cleanTipClass(){const t=this.getTipElement(),e=t.getAttribute("class").match(Ne);null!==e&&e.length>0&&e.map(t=>t.trim()).forEach(e=>t.classList.remove(e))}_handlePopperPlacementChange(t){const{state:e}=t;e&&(this.tip=e.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(e.placement)))}static jQueryInterface(t){return this.each((function(){let e=b.get(this,"bs.tooltip");const i="object"==typeof t&&t;if((e||!/dispose|hide/.test(t))&&(e||(e=new Be(this,i)),"string"==typeof t)){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m("tooltip",Be);const He=new RegExp("(^|\\s)bs-popover\\S+","g"),We={...Be.Default,placement:"right",offset:[0,8],trigger:"click",content:"",template:''},Ue={...Be.DefaultType,content:"(string|element|function)"},$e={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"};class Fe extends Be{static get Default(){return We}static get NAME(){return"popover"}static get DATA_KEY(){return"bs.popover"}static get Event(){return $e}static get EVENT_KEY(){return".bs.popover"}static get DefaultType(){return Ue}isWithContent(){return this.getTitle()||this._getContent()}setContent(){const t=this.getTipElement();this.setElementContent(H.findOne(".popover-header",t),this.getTitle());let e=this._getContent();"function"==typeof e&&(e=e.call(this._element)),this.setElementContent(H.findOne(".popover-body",t),e),t.classList.remove("fade","show")}_addAttachmentClass(t){this.getTipElement().classList.add("bs-popover-"+this.updateAttachment(t))}_getContent(){return this._element.getAttribute("data-bs-content")||this.config.content}_cleanTipClass(){const t=this.getTipElement(),e=t.getAttribute("class").match(He);null!==e&&e.length>0&&e.map(t=>t.trim()).forEach(e=>t.classList.remove(e))}static jQueryInterface(t){return this.each((function(){let e=b.get(this,"bs.popover");const i="object"==typeof t?t:null;if((e||!/dispose|hide/.test(t))&&(e||(e=new Fe(this,i),b.set(this,"bs.popover",e)),"string"==typeof t)){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m("popover",Fe);const ze={offset:10,method:"auto",target:""},Ke={offset:"number",method:"string",target:"(string|element)"};class Ye extends j{constructor(t,e){super(t),this._scrollElement="BODY"===this._element.tagName?window:this._element,this._config=this._getConfig(e),this._selector=`${this._config.target} .nav-link, ${this._config.target} .list-group-item, ${this._config.target} .dropdown-item`,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,N.on(this._scrollElement,"scroll.bs.scrollspy",()=>this._process()),this.refresh(),this._process()}static get Default(){return ze}static get DATA_KEY(){return"bs.scrollspy"}refresh(){const t=this._scrollElement===this._scrollElement.window?"offset":"position",e="auto"===this._config.method?t:this._config.method,s="position"===e?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),H.find(this._selector).map(t=>{const n=i(t),o=n?H.findOne(n):null;if(o){const t=o.getBoundingClientRect();if(t.width||t.height)return[B[e](o).top+s,n]}return null}).filter(t=>t).sort((t,e)=>t[0]-e[0]).forEach(t=>{this._offsets.push(t[0]),this._targets.push(t[1])})}dispose(){super.dispose(),N.off(this._scrollElement,".bs.scrollspy"),this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null}_getConfig(e){if("string"!=typeof(e={...ze,..."object"==typeof e&&e?e:{}}).target&&r(e.target)){let{id:i}=e.target;i||(i=t("scrollspy"),e.target.id=i),e.target="#"+i}return l("scrollspy",e,Ke),e}_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}_process(){const t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),i=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=i){const t=this._targets[this._targets.length-1];this._activeTarget!==t&&this._activate(t)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(let e=this._offsets.length;e--;)this._activeTarget!==this._targets[e]&&t>=this._offsets[e]&&(void 0===this._offsets[e+1]||t`${e}[data-bs-target="${t}"],${e}[href="${t}"]`),i=H.findOne(e.join(","));i.classList.contains("dropdown-item")?(H.findOne(".dropdown-toggle",i.closest(".dropdown")).classList.add("active"),i.classList.add("active")):(i.classList.add("active"),H.parents(i,".nav, .list-group").forEach(t=>{H.prev(t,".nav-link, .list-group-item").forEach(t=>t.classList.add("active")),H.prev(t,".nav-item").forEach(t=>{H.children(t,".nav-link").forEach(t=>t.classList.add("active"))})})),N.trigger(this._scrollElement,"activate.bs.scrollspy",{relatedTarget:t})}_clear(){H.find(this._selector).filter(t=>t.classList.contains("active")).forEach(t=>t.classList.remove("active"))}static jQueryInterface(t){return this.each((function(){let e=b.get(this,"bs.scrollspy");if(e||(e=new Ye(this,"object"==typeof t&&t)),"string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(window,"load.bs.scrollspy.data-api",()=>{H.find('[data-bs-spy="scroll"]').forEach(t=>new Ye(t,B.getDataAttributes(t)))}),m("scrollspy",Ye);class qe extends j{static get DATA_KEY(){return"bs.tab"}show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.classList.contains("active")||d(this._element))return;let t;const e=s(this._element),i=this._element.closest(".nav, .list-group");if(i){const e="UL"===i.nodeName||"OL"===i.nodeName?":scope > li > .active":".active";t=H.find(e,i),t=t[t.length-1]}const n=t?N.trigger(t,"hide.bs.tab",{relatedTarget:this._element}):null;if(N.trigger(this._element,"show.bs.tab",{relatedTarget:t}).defaultPrevented||null!==n&&n.defaultPrevented)return;this._activate(this._element,i);const o=()=>{N.trigger(t,"hidden.bs.tab",{relatedTarget:this._element}),N.trigger(this._element,"shown.bs.tab",{relatedTarget:t})};e?this._activate(e,e.parentNode,o):o()}_activate(t,e,i){const s=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?H.children(e,".active"):H.find(":scope > li > .active",e))[0],o=i&&s&&s.classList.contains("fade"),r=()=>this._transitionComplete(t,s,i);if(s&&o){const t=n(s);s.classList.remove("show"),N.one(s,"transitionend",r),a(s,t)}else r()}_transitionComplete(t,e,i){if(e){e.classList.remove("active");const t=H.findOne(":scope > .dropdown-menu .active",e.parentNode);t&&t.classList.remove("active"),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}t.classList.add("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),u(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&t.parentNode.classList.contains("dropdown-menu")&&(t.closest(".dropdown")&&H.find(".dropdown-toggle").forEach(t=>t.classList.add("active")),t.setAttribute("aria-expanded",!0)),i&&i()}static jQueryInterface(t){return this.each((function(){const e=b.get(this,"bs.tab")||new qe(this);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',(function(t){t.preventDefault(),(b.get(this,"bs.tab")||new qe(this)).show()})),m("tab",qe);const Ve={animation:"boolean",autohide:"boolean",delay:"number"},Xe={animation:!0,autohide:!0,delay:5e3};class Qe extends j{constructor(t,e){super(t),this._config=this._getConfig(e),this._timeout=null,this._setListeners()}static get DefaultType(){return Ve}static get Default(){return Xe}static get DATA_KEY(){return"bs.toast"}show(){if(N.trigger(this._element,"show.bs.toast").defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");const t=()=>{this._element.classList.remove("showing"),this._element.classList.add("show"),N.trigger(this._element,"shown.bs.toast"),this._config.autohide&&(this._timeout=setTimeout(()=>{this.hide()},this._config.delay))};if(this._element.classList.remove("hide"),u(this._element),this._element.classList.add("showing"),this._config.animation){const e=n(this._element);N.one(this._element,"transitionend",t),a(this._element,e)}else t()}hide(){if(!this._element.classList.contains("show"))return;if(N.trigger(this._element,"hide.bs.toast").defaultPrevented)return;const t=()=>{this._element.classList.add("hide"),N.trigger(this._element,"hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){const e=n(this._element);N.one(this._element,"transitionend",t),a(this._element,e)}else t()}dispose(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),N.off(this._element,"click.dismiss.bs.toast"),super.dispose(),this._config=null}_getConfig(t){return t={...Xe,...B.getDataAttributes(this._element),..."object"==typeof t&&t?t:{}},l("toast",t,this.constructor.DefaultType),t}_setListeners(){N.on(this._element,"click.dismiss.bs.toast",'[data-bs-dismiss="toast"]',()=>this.hide())}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){let e=b.get(this,"bs.toast");if(e||(e=new Qe(this,"object"==typeof t&&t)),"string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return m("toast",Qe),{Alert:P,Button:I,Carousel:Y,Collapse:X,Dropdown:_e,Modal:ye,Offcanvas:Oe,Popover:Fe,ScrollSpy:Ye,Tab:qe,Toast:Qe,Tooltip:Be}}));
-//# sourceMappingURL=bootstrap.bundle.min.js.map
-/*
- Copyright (C) Federico Zivolo 2019
- Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
- */(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.Popper=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return t?n[t]:n}function o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function n(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var i=t(e),r=i.overflow,p=i.overflowX,s=i.overflowY;return /(auto|scroll|overlay)/.test(r+s+p)?e:n(o(e))}function i(e){return e&&e.referenceNode?e.referenceNode:e}function r(e){return 11===e?re:10===e?pe:re||pe}function p(e){if(!e)return document.documentElement;for(var o=r(10)?document.body:null,n=e.offsetParent||null;n===o&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(n.nodeName)&&'static'===t(n,'position')?p(n):n:e?e.ownerDocument.documentElement:document.documentElement}function s(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||p(e.firstElementChild)===e)}function d(e){return null===e.parentNode?e:d(e.parentNode)}function a(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,n=o?e:t,i=o?t:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var l=r.commonAncestorContainer;if(e!==l&&t!==l||n.contains(i))return s(l)?l:p(l);var f=d(e);return f.host?a(f.host,t):a(e,d(t).host)}function l(e){var t=1=o.clientWidth&&n>=o.clientHeight}),l=0a[e]&&!t.escapeWithReference&&(n=Q(f[o],a[e]-('right'===e?f.width:f.height))),ae({},o,n)}};return l.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';f=le({},f,m[t](e))}),e.offsets.popper=f,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,n=t.reference,i=e.placement.split('-')[0],r=Z,p=-1!==['top','bottom'].indexOf(i),s=p?'right':'bottom',d=p?'left':'top',a=p?'width':'height';return o[s]r(n[s])&&(e.offsets.popper[d]=r(n[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,o){var n;if(!K(e.instance.modifiers,'arrow','keepTogether'))return e;var i=o.element;if('string'==typeof i){if(i=e.instance.popper.querySelector(i),!i)return e;}else if(!e.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var r=e.placement.split('-')[0],p=e.offsets,s=p.popper,d=p.reference,a=-1!==['left','right'].indexOf(r),l=a?'height':'width',f=a?'Top':'Left',m=f.toLowerCase(),h=a?'left':'top',c=a?'bottom':'right',u=S(i)[l];d[c]-us[c]&&(e.offsets.popper[m]+=d[m]+u-s[c]),e.offsets.popper=g(e.offsets.popper);var b=d[m]+d[l]/2-u/2,w=t(e.instance.popper),y=parseFloat(w['margin'+f],10),E=parseFloat(w['border'+f+'Width'],10),v=b-e.offsets.popper[m]-y-E;return v=ee(Q(s[l]-u,v),0),e.arrowElement=i,e.offsets.arrow=(n={},ae(n,m,$(v)),ae(n,h,''),n),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(W(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var o=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),n=e.placement.split('-')[0],i=T(n),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case ce.FLIP:p=[n,i];break;case ce.CLOCKWISE:p=G(n);break;case ce.COUNTERCLOCKWISE:p=G(n,!0);break;default:p=t.behavior;}return p.forEach(function(s,d){if(n!==s||p.length===d+1)return e;n=e.placement.split('-')[0],i=T(n);var a=e.offsets.popper,l=e.offsets.reference,f=Z,m='left'===n&&f(a.right)>f(l.left)||'right'===n&&f(a.left)f(l.top)||'bottom'===n&&f(a.top)f(o.right),g=f(a.top)f(o.bottom),b='left'===n&&h||'right'===n&&c||'top'===n&&g||'bottom'===n&&u,w=-1!==['top','bottom'].indexOf(n),y=!!t.flipVariations&&(w&&'start'===r&&h||w&&'end'===r&&c||!w&&'start'===r&&g||!w&&'end'===r&&u),E=!!t.flipVariationsByContent&&(w&&'start'===r&&c||w&&'end'===r&&h||!w&&'start'===r&&u||!w&&'end'===r&&g),v=y||E;(m||b||v)&&(e.flipped=!0,(m||b)&&(n=p[d+1]),v&&(r=z(r)),e.placement=n+(r?'-'+r:''),e.offsets.popper=le({},e.offsets.popper,C(e.instance.popper,e.offsets.reference,e.placement)),e=P(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport',flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split('-')[0],n=e.offsets,i=n.popper,r=n.reference,p=-1!==['left','right'].indexOf(o),s=-1===['top','left'].indexOf(o);return i[p?'left':'top']=r[o]-(s?i[p?'width':'height']:0),e.placement=T(t),e.offsets.popper=g(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!K(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,o=D(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.rightwindow.devicePixelRatio||!fe),c='bottom'===o?'top':'bottom',g='right'===n?'left':'right',b=B('transform');if(d='bottom'==c?'HTML'===l.nodeName?-l.clientHeight+h.bottom:-f.height+h.bottom:h.top,s='right'==g?'HTML'===l.nodeName?-l.clientWidth+h.right:-f.width+h.right:h.left,a&&b)m[b]='translate3d('+s+'px, '+d+'px, 0)',m[c]=0,m[g]=0,m.willChange='transform';else{var w='bottom'==c?-1:1,y='right'==g?-1:1;m[c]=d*w,m[g]=s*y,m.willChange=c+', '+g}var E={"x-placement":e.placement};return e.attributes=le({},E,e.attributes),e.styles=le({},m,e.styles),e.arrowStyles=le({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return V(e.instance.popper,e.styles),j(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&V(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,o,n,i){var r=L(i,t,e,o.positionFixed),p=O(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),V(t,{position:o.positionFixed?'fixed':'absolute'}),o},gpuAcceleration:void 0}}},ge});
-//# sourceMappingURL=popper.min.js.map
-
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)}}}));
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekday=t()}(this,(function(){"use strict";return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(ia;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"===typeof a?a:null,this.onRejected="function"===typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=setTimeout,k="function"===typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"===typeof g||"function"===typeof g)){var h=g.then;if("function"===typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a},"undefined"!==typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);
- }
-
- if (typeof window !== 'undefined' && typeof window.CustomEvent !== "function") {
- (function(){
- function CustomEvent ( event, params ) {
- params = params || { bubbles: false, cancelable: false, detail: undefined };
- var evt = document.createEvent( 'CustomEvent' );
- evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
- return evt;
- }
- CustomEvent.prototype = window.Event.prototype;
- window.CustomEvent = CustomEvent;
- }());
- }
-
- if (typeof HTMLCanvasElement !== 'undefined' && !HTMLCanvasElement.prototype.toBlob) {
- Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
- value: function (callback, type, quality) {
- var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),
- len = binStr.length,
- arr = new Uint8Array(len);
-
- for (var i=0; i -1 ? EXIF_NORM : EXIF_FLIP,
- index = arr.indexOf(ornt),
- offset = (rotate / 90) % arr.length;// 180 = 2%4 = 2 shift exif by 2 indexes
-
- return arr[(arr.length + index + (offset % arr.length)) % arr.length];
- }
-
- // Credits to : Andrew Dupont - http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/
- function deepExtend(destination, source) {
- destination = destination || {};
- for (var property in source) {
- if (source[property] && source[property].constructor && source[property].constructor === Object) {
- destination[property] = destination[property] || {};
- deepExtend(destination[property], source[property]);
- } else {
- destination[property] = source[property];
- }
- }
- return destination;
- }
-
- function clone(object) {
- return deepExtend({}, object);
- }
-
- function debounce(func, wait, immediate) {
- var timeout;
- return function () {
- var context = this, args = arguments;
- var later = function () {
- timeout = null;
- if (!immediate) func.apply(context, args);
- };
- var callNow = immediate && !timeout;
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- if (callNow) func.apply(context, args);
- };
- }
-
- function dispatchChange(element) {
- if ("createEvent" in document) {
- var evt = document.createEvent("HTMLEvents");
- evt.initEvent("change", false, true);
- element.dispatchEvent(evt);
- }
- else {
- element.fireEvent("onchange");
- }
- }
-
- //http://jsperf.com/vanilla-css
- function css(el, styles, val) {
- if (typeof (styles) === 'string') {
- var tmp = styles;
- styles = {};
- styles[tmp] = val;
- }
-
- for (var prop in styles) {
- el.style[prop] = styles[prop];
- }
- }
-
- function addClass(el, c) {
- if (el.classList) {
- el.classList.add(c);
- }
- else {
- el.className += ' ' + c;
- }
- }
-
- function removeClass(el, c) {
- if (el.classList) {
- el.classList.remove(c);
- }
- else {
- el.className = el.className.replace(c, '');
- }
- }
-
- function setAttributes(el, attrs) {
- for (var key in attrs) {
- el.setAttribute(key, attrs[key]);
- }
- }
-
- function num(v) {
- return parseInt(v, 10);
- }
-
- /* Utilities */
- function loadImage(src, doExif) {
- if (!src) { throw 'Source image missing'; }
-
- var img = new Image();
- img.style.opacity = '0';
- return new Promise(function (resolve, reject) {
- function _resolve() {
- img.style.opacity = '1';
- setTimeout(function () {
- resolve(img);
- }, 1);
- }
-
- img.removeAttribute('crossOrigin');
- if (src.match(/^https?:\/\/|^\/\//)) {
- img.setAttribute('crossOrigin', 'anonymous');
- }
-
- img.onload = function () {
- if (doExif) {
- EXIF.getData(img, function () {
- _resolve();
- });
- }
- else {
- _resolve();
- }
- };
- img.onerror = function (ev) {
- img.style.opacity = 1;
- setTimeout(function () {
- reject(ev);
- }, 1);
- };
- img.src = src;
- });
- }
-
- function naturalImageDimensions(img, ornt) {
- var w = img.naturalWidth;
- var h = img.naturalHeight;
- var orient = ornt || getExifOrientation(img);
- if (orient && orient >= 5) {
- var x= w;
- w = h;
- h = x;
- }
- return { width: w, height: h };
- }
-
- /* CSS Transform Prototype */
- var TRANSLATE_OPTS = {
- 'translate3d': {
- suffix: ', 0px'
- },
- 'translate': {
- suffix: ''
- }
- };
- var Transform = function (x, y, scale) {
- this.x = parseFloat(x);
- this.y = parseFloat(y);
- this.scale = parseFloat(scale);
- };
-
- Transform.parse = function (v) {
- if (v.style) {
- return Transform.parse(v.style[CSS_TRANSFORM]);
- }
- else if (v.indexOf('matrix') > -1 || v.indexOf('none') > -1) {
- return Transform.fromMatrix(v);
- }
- else {
- return Transform.fromString(v);
- }
- };
-
- Transform.fromMatrix = function (v) {
- var vals = v.substring(7).split(',');
- if (!vals.length || v === 'none') {
- vals = [1, 0, 0, 1, 0, 0];
- }
-
- return new Transform(num(vals[4]), num(vals[5]), parseFloat(vals[0]));
- };
-
- Transform.fromString = function (v) {
- var values = v.split(') '),
- translate = values[0].substring(Croppie.globals.translate.length + 1).split(','),
- scale = values.length > 1 ? values[1].substring(6) : 1,
- x = translate.length > 1 ? translate[0] : 0,
- y = translate.length > 1 ? translate[1] : 0;
-
- return new Transform(x, y, scale);
- };
-
- Transform.prototype.toString = function () {
- var suffix = TRANSLATE_OPTS[Croppie.globals.translate].suffix || '';
- return Croppie.globals.translate + '(' + this.x + 'px, ' + this.y + 'px' + suffix + ') scale(' + this.scale + ')';
- };
-
- var TransformOrigin = function (el) {
- if (!el || !el.style[CSS_TRANS_ORG]) {
- this.x = 0;
- this.y = 0;
- return;
- }
- var css = el.style[CSS_TRANS_ORG].split(' ');
- this.x = parseFloat(css[0]);
- this.y = parseFloat(css[1]);
- };
-
- TransformOrigin.prototype.toString = function () {
- return this.x + 'px ' + this.y + 'px';
- };
-
- function getExifOrientation (img) {
- return img.exifdata && img.exifdata.Orientation ? num(img.exifdata.Orientation) : 1;
- }
-
- function drawCanvas(canvas, img, orientation) {
- var width = img.width,
- height = img.height,
- ctx = canvas.getContext('2d');
-
- canvas.width = img.width;
- canvas.height = img.height;
-
- ctx.save();
- switch (orientation) {
- case 2:
- ctx.translate(width, 0);
- ctx.scale(-1, 1);
- break;
-
- case 3:
- ctx.translate(width, height);
- ctx.rotate(180*Math.PI/180);
- break;
-
- case 4:
- ctx.translate(0, height);
- ctx.scale(1, -1);
- break;
-
- case 5:
- canvas.width = height;
- canvas.height = width;
- ctx.rotate(90*Math.PI/180);
- ctx.scale(1, -1);
- break;
-
- case 6:
- canvas.width = height;
- canvas.height = width;
- ctx.rotate(90*Math.PI/180);
- ctx.translate(0, -height);
- break;
-
- case 7:
- canvas.width = height;
- canvas.height = width;
- ctx.rotate(-90*Math.PI/180);
- ctx.translate(-width, height);
- ctx.scale(1, -1);
- break;
-
- case 8:
- canvas.width = height;
- canvas.height = width;
- ctx.translate(0, width);
- ctx.rotate(-90*Math.PI/180);
- break;
- }
- ctx.drawImage(img, 0,0, width, height);
- ctx.restore();
- }
-
- /* Private Methods */
- function _create() {
- var self = this,
- contClass = 'croppie-container',
- customViewportClass = self.options.viewport.type ? 'cr-vp-' + self.options.viewport.type : null,
- boundary, img, viewport, overlay, bw, bh;
-
- self.options.useCanvas = self.options.enableOrientation || _hasExif.call(self);
- // Properties on class
- self.data = {};
- self.elements = {};
-
- boundary = self.elements.boundary = document.createElement('div');
- viewport = self.elements.viewport = document.createElement('div');
- img = self.elements.img = document.createElement('img');
- overlay = self.elements.overlay = document.createElement('div');
-
- if (self.options.useCanvas) {
- self.elements.canvas = document.createElement('canvas');
- self.elements.preview = self.elements.canvas;
- }
- else {
- self.elements.preview = img;
- }
-
- addClass(boundary, 'cr-boundary');
- boundary.setAttribute('aria-dropeffect', 'none');
- bw = self.options.boundary.width;
- bh = self.options.boundary.height;
- css(boundary, {
- width: (bw + (isNaN(bw) ? '' : 'px')),
- height: (bh + (isNaN(bh) ? '' : 'px'))
- });
-
- addClass(viewport, 'cr-viewport');
- if (customViewportClass) {
- addClass(viewport, customViewportClass);
- }
- css(viewport, {
- width: self.options.viewport.width + 'px',
- height: self.options.viewport.height + 'px'
- });
- viewport.setAttribute('tabindex', 0);
-
- addClass(self.elements.preview, 'cr-image');
- setAttributes(self.elements.preview, { 'alt': 'preview', 'aria-grabbed': 'false' });
- addClass(overlay, 'cr-overlay');
-
- self.element.appendChild(boundary);
- boundary.appendChild(self.elements.preview);
- boundary.appendChild(viewport);
- boundary.appendChild(overlay);
-
- addClass(self.element, contClass);
- if (self.options.customClass) {
- addClass(self.element, self.options.customClass);
- }
-
- _initDraggable.call(this);
-
- if (self.options.enableZoom) {
- _initializeZoom.call(self);
- }
-
- // if (self.options.enableOrientation) {
- // _initRotationControls.call(self);
- // }
-
- if (self.options.enableResize) {
- _initializeResize.call(self);
- }
- }
-
- // function _initRotationControls () {
- // var self = this,
- // wrap, btnLeft, btnRight, iLeft, iRight;
-
- // wrap = document.createElement('div');
- // self.elements.orientationBtnLeft = btnLeft = document.createElement('button');
- // self.elements.orientationBtnRight = btnRight = document.createElement('button');
-
- // wrap.appendChild(btnLeft);
- // wrap.appendChild(btnRight);
-
- // iLeft = document.createElement('i');
- // iRight = document.createElement('i');
- // btnLeft.appendChild(iLeft);
- // btnRight.appendChild(iRight);
-
- // addClass(wrap, 'cr-rotate-controls');
- // addClass(btnLeft, 'cr-rotate-l');
- // addClass(btnRight, 'cr-rotate-r');
-
- // self.elements.boundary.appendChild(wrap);
-
- // btnLeft.addEventListener('click', function () {
- // self.rotate(-90);
- // });
- // btnRight.addEventListener('click', function () {
- // self.rotate(90);
- // });
- // }
-
- function _hasExif() {
- return this.options.enableExif && window.EXIF;
- }
-
- function _initializeResize () {
- var self = this;
- var wrap = document.createElement('div');
- var isDragging = false;
- var direction;
- var originalX;
- var originalY;
- var minSize = 50;
- var maxWidth;
- var maxHeight;
- var vr;
- var hr;
-
- addClass(wrap, 'cr-resizer');
- css(wrap, {
- width: this.options.viewport.width + 'px',
- height: this.options.viewport.height + 'px'
- });
-
- if (this.options.resizeControls.height) {
- vr = document.createElement('div');
- addClass(vr, 'cr-resizer-vertical');
- wrap.appendChild(vr);
- }
-
- if (this.options.resizeControls.width) {
- hr = document.createElement('div');
- addClass(hr, 'cr-resizer-horisontal');
- wrap.appendChild(hr);
- }
-
- function mouseDown(ev) {
- if (ev.button !== undefined && ev.button !== 0) return;
-
- ev.preventDefault();
- if (isDragging) {
- return;
- }
-
- var overlayRect = self.elements.overlay.getBoundingClientRect();
-
- isDragging = true;
- originalX = ev.pageX;
- originalY = ev.pageY;
- direction = ev.currentTarget.className.indexOf('vertical') !== -1 ? 'v' : 'h';
- maxWidth = overlayRect.width;
- maxHeight = overlayRect.height;
-
- if (ev.touches) {
- var touches = ev.touches[0];
- originalX = touches.pageX;
- originalY = touches.pageY;
- }
-
- window.addEventListener('mousemove', mouseMove);
- window.addEventListener('touchmove', mouseMove);
- window.addEventListener('mouseup', mouseUp);
- window.addEventListener('touchend', mouseUp);
- document.body.style[CSS_USERSELECT] = 'none';
- }
-
- function mouseMove(ev) {
- var pageX = ev.pageX;
- var pageY = ev.pageY;
-
- ev.preventDefault();
-
- if (ev.touches) {
- var touches = ev.touches[0];
- pageX = touches.pageX;
- pageY = touches.pageY;
- }
-
- var deltaX = pageX - originalX;
- var deltaY = pageY - originalY;
- var newHeight = self.options.viewport.height + deltaY;
- var newWidth = self.options.viewport.width + deltaX;
-
- if (direction === 'v' && newHeight >= minSize && newHeight <= maxHeight) {
- css(wrap, {
- height: newHeight + 'px'
- });
-
- self.options.boundary.height += deltaY;
- css(self.elements.boundary, {
- height: self.options.boundary.height + 'px'
- });
-
- self.options.viewport.height += deltaY;
- css(self.elements.viewport, {
- height: self.options.viewport.height + 'px'
- });
- }
- else if (direction === 'h' && newWidth >= minSize && newWidth <= maxWidth) {
- css(wrap, {
- width: newWidth + 'px'
- });
-
- self.options.boundary.width += deltaX;
- css(self.elements.boundary, {
- width: self.options.boundary.width + 'px'
- });
-
- self.options.viewport.width += deltaX;
- css(self.elements.viewport, {
- width: self.options.viewport.width + 'px'
- });
- }
-
- _updateOverlay.call(self);
- _updateZoomLimits.call(self);
- _updateCenterPoint.call(self);
- _triggerUpdate.call(self);
- originalY = pageY;
- originalX = pageX;
- }
-
- function mouseUp() {
- isDragging = false;
- window.removeEventListener('mousemove', mouseMove);
- window.removeEventListener('touchmove', mouseMove);
- window.removeEventListener('mouseup', mouseUp);
- window.removeEventListener('touchend', mouseUp);
- document.body.style[CSS_USERSELECT] = '';
- }
-
- if (vr) {
- vr.addEventListener('mousedown', mouseDown);
- vr.addEventListener('touchstart', mouseDown);
- }
-
- if (hr) {
- hr.addEventListener('mousedown', mouseDown);
- hr.addEventListener('touchstart', mouseDown);
- }
-
- this.elements.boundary.appendChild(wrap);
- }
-
- function _setZoomerVal(v) {
- if (this.options.enableZoom) {
- var z = this.elements.zoomer,
- val = fix(v, 4);
-
- z.value = Math.max(parseFloat(z.min), Math.min(parseFloat(z.max), val)).toString();
- }
- }
-
- function _initializeZoom() {
- var self = this,
- wrap = self.elements.zoomerWrap = document.createElement('div'),
- zoomer = self.elements.zoomer = document.createElement('input');
-
- addClass(wrap, 'cr-slider-wrap');
- addClass(zoomer, 'cr-slider');
- zoomer.type = 'range';
- zoomer.step = '0.0001';
- zoomer.value = '1';
- zoomer.style.display = self.options.showZoomer ? '' : 'none';
- zoomer.setAttribute('aria-label', 'zoom');
-
- self.element.appendChild(wrap);
- wrap.appendChild(zoomer);
-
- self._currentZoom = 1;
-
- function change() {
- _onZoom.call(self, {
- value: parseFloat(zoomer.value),
- origin: new TransformOrigin(self.elements.preview),
- viewportRect: self.elements.viewport.getBoundingClientRect(),
- transform: Transform.parse(self.elements.preview)
- });
- }
-
- function scroll(ev) {
- var delta, targetZoom;
-
- if(self.options.mouseWheelZoom === 'ctrl' && ev.ctrlKey !== true){
- return 0;
- } else if (ev.wheelDelta) {
- delta = ev.wheelDelta / 1200; //wheelDelta min: -120 max: 120 // max x 10 x 2
- } else if (ev.deltaY) {
- delta = ev.deltaY / 1060; //deltaY min: -53 max: 53 // max x 10 x 2
- } else if (ev.detail) {
- delta = ev.detail / -60; //delta min: -3 max: 3 // max x 10 x 2
- } else {
- delta = 0;
- }
-
- targetZoom = self._currentZoom + (delta * self._currentZoom);
-
- ev.preventDefault();
- _setZoomerVal.call(self, targetZoom);
- change.call(self);
- }
-
- self.elements.zoomer.addEventListener('input', change);// this is being fired twice on keypress
- self.elements.zoomer.addEventListener('change', change);
-
- if (self.options.mouseWheelZoom) {
- self.elements.boundary.addEventListener('mousewheel', scroll);
- self.elements.boundary.addEventListener('DOMMouseScroll', scroll);
- }
- }
-
- function _onZoom(ui) {
- var self = this,
- transform = ui ? ui.transform : Transform.parse(self.elements.preview),
- vpRect = ui ? ui.viewportRect : self.elements.viewport.getBoundingClientRect(),
- origin = ui ? ui.origin : new TransformOrigin(self.elements.preview);
-
- function applyCss() {
- var transCss = {};
- transCss[CSS_TRANSFORM] = transform.toString();
- transCss[CSS_TRANS_ORG] = origin.toString();
- css(self.elements.preview, transCss);
- }
-
- self._currentZoom = ui ? ui.value : self._currentZoom;
- transform.scale = self._currentZoom;
- self.elements.zoomer.setAttribute('aria-valuenow', self._currentZoom);
- applyCss();
-
- if (self.options.enforceBoundary) {
- var boundaries = _getVirtualBoundaries.call(self, vpRect),
- transBoundaries = boundaries.translate,
- oBoundaries = boundaries.origin;
-
- if (transform.x >= transBoundaries.maxX) {
- origin.x = oBoundaries.minX;
- transform.x = transBoundaries.maxX;
- }
-
- if (transform.x <= transBoundaries.minX) {
- origin.x = oBoundaries.maxX;
- transform.x = transBoundaries.minX;
- }
-
- if (transform.y >= transBoundaries.maxY) {
- origin.y = oBoundaries.minY;
- transform.y = transBoundaries.maxY;
- }
-
- if (transform.y <= transBoundaries.minY) {
- origin.y = oBoundaries.maxY;
- transform.y = transBoundaries.minY;
- }
- }
- applyCss();
- _debouncedOverlay.call(self);
- _triggerUpdate.call(self);
- }
-
- function _getVirtualBoundaries(viewport) {
- var self = this,
- scale = self._currentZoom,
- vpWidth = viewport.width,
- vpHeight = viewport.height,
- centerFromBoundaryX = self.elements.boundary.clientWidth / 2,
- centerFromBoundaryY = self.elements.boundary.clientHeight / 2,
- imgRect = self.elements.preview.getBoundingClientRect(),
- curImgWidth = imgRect.width,
- curImgHeight = imgRect.height,
- halfWidth = vpWidth / 2,
- halfHeight = vpHeight / 2;
-
- var maxX = ((halfWidth / scale) - centerFromBoundaryX) * -1;
- var minX = maxX - ((curImgWidth * (1 / scale)) - (vpWidth * (1 / scale)));
-
- var maxY = ((halfHeight / scale) - centerFromBoundaryY) * -1;
- var minY = maxY - ((curImgHeight * (1 / scale)) - (vpHeight * (1 / scale)));
-
- var originMinX = (1 / scale) * halfWidth;
- var originMaxX = (curImgWidth * (1 / scale)) - originMinX;
-
- var originMinY = (1 / scale) * halfHeight;
- var originMaxY = (curImgHeight * (1 / scale)) - originMinY;
-
- return {
- translate: {
- maxX: maxX,
- minX: minX,
- maxY: maxY,
- minY: minY
- },
- origin: {
- maxX: originMaxX,
- minX: originMinX,
- maxY: originMaxY,
- minY: originMinY
- }
- };
- }
-
- function _updateCenterPoint(rotate) {
- var self = this,
- scale = self._currentZoom,
- data = self.elements.preview.getBoundingClientRect(),
- vpData = self.elements.viewport.getBoundingClientRect(),
- transform = Transform.parse(self.elements.preview.style[CSS_TRANSFORM]),
- pc = new TransformOrigin(self.elements.preview),
- top = (vpData.top - data.top) + (vpData.height / 2),
- left = (vpData.left - data.left) + (vpData.width / 2),
- center = {},
- adj = {};
-
- if (rotate) {
- var cx = pc.x;
- var cy = pc.y;
- var tx = transform.x;
- var ty = transform.y;
-
- center.y = cx;
- center.x = cy;
- transform.y = tx;
- transform.x = ty;
- }
- else {
- center.y = top / scale;
- center.x = left / scale;
-
- adj.y = (center.y - pc.y) * (1 - scale);
- adj.x = (center.x - pc.x) * (1 - scale);
-
- transform.x -= adj.x;
- transform.y -= adj.y;
- }
-
- var newCss = {};
- newCss[CSS_TRANS_ORG] = center.x + 'px ' + center.y + 'px';
- newCss[CSS_TRANSFORM] = transform.toString();
- css(self.elements.preview, newCss);
- }
-
- function _initDraggable() {
- var self = this,
- isDragging = false,
- originalX,
- originalY,
- originalDistance,
- vpRect,
- transform;
-
- function assignTransformCoordinates(deltaX, deltaY) {
- var imgRect = self.elements.preview.getBoundingClientRect(),
- top = transform.y + deltaY,
- left = transform.x + deltaX;
-
- if (self.options.enforceBoundary) {
- if (vpRect.top > imgRect.top + deltaY && vpRect.bottom < imgRect.bottom + deltaY) {
- transform.y = top;
- }
-
- if (vpRect.left > imgRect.left + deltaX && vpRect.right < imgRect.right + deltaX) {
- transform.x = left;
- }
- }
- else {
- transform.y = top;
- transform.x = left;
- }
- }
-
- function toggleGrabState(isDragging) {
- self.elements.preview.setAttribute('aria-grabbed', isDragging);
- self.elements.boundary.setAttribute('aria-dropeffect', isDragging? 'move': 'none');
- }
-
- function keyDown(ev) {
- var LEFT_ARROW = 37,
- UP_ARROW = 38,
- RIGHT_ARROW = 39,
- DOWN_ARROW = 40;
-
- if (ev.shiftKey && (ev.keyCode === UP_ARROW || ev.keyCode === DOWN_ARROW)) {
- var zoom;
- if (ev.keyCode === UP_ARROW) {
- zoom = parseFloat(self.elements.zoomer.value) + parseFloat(self.elements.zoomer.step)
- }
- else {
- zoom = parseFloat(self.elements.zoomer.value) - parseFloat(self.elements.zoomer.step)
- }
- self.setZoom(zoom);
- }
- else if (self.options.enableKeyMovement && (ev.keyCode >= 37 && ev.keyCode <= 40)) {
- ev.preventDefault();
- var movement = parseKeyDown(ev.keyCode);
-
- transform = Transform.parse(self.elements.preview);
- document.body.style[CSS_USERSELECT] = 'none';
- vpRect = self.elements.viewport.getBoundingClientRect();
- keyMove(movement);
- }
-
- function parseKeyDown(key) {
- switch (key) {
- case LEFT_ARROW:
- return [1, 0];
- case UP_ARROW:
- return [0, 1];
- case RIGHT_ARROW:
- return [-1, 0];
- case DOWN_ARROW:
- return [0, -1];
- }
- }
- }
-
- function keyMove(movement) {
- var deltaX = movement[0],
- deltaY = movement[1],
- newCss = {};
-
- assignTransformCoordinates(deltaX, deltaY);
-
- newCss[CSS_TRANSFORM] = transform.toString();
- css(self.elements.preview, newCss);
- _updateOverlay.call(self);
- document.body.style[CSS_USERSELECT] = '';
- _updateCenterPoint.call(self);
- _triggerUpdate.call(self);
- originalDistance = 0;
- }
-
- function mouseDown(ev) {
- if (ev.button !== undefined && ev.button !== 0) return;
-
- ev.preventDefault();
- if (isDragging) return;
- isDragging = true;
- originalX = ev.pageX;
- originalY = ev.pageY;
-
- if (ev.touches) {
- var touches = ev.touches[0];
- originalX = touches.pageX;
- originalY = touches.pageY;
- }
- toggleGrabState(isDragging);
- transform = Transform.parse(self.elements.preview);
- window.addEventListener('mousemove', mouseMove);
- window.addEventListener('touchmove', mouseMove);
- window.addEventListener('mouseup', mouseUp);
- window.addEventListener('touchend', mouseUp);
- document.body.style[CSS_USERSELECT] = 'none';
- vpRect = self.elements.viewport.getBoundingClientRect();
- }
-
- function mouseMove(ev) {
- ev.preventDefault();
- var pageX = ev.pageX,
- pageY = ev.pageY;
-
- if (ev.touches) {
- var touches = ev.touches[0];
- pageX = touches.pageX;
- pageY = touches.pageY;
- }
-
- var deltaX = pageX - originalX,
- deltaY = pageY - originalY,
- newCss = {};
-
- if (ev.type === 'touchmove') {
- if (ev.touches.length > 1) {
- var touch1 = ev.touches[0];
- var touch2 = ev.touches[1];
- var dist = Math.sqrt((touch1.pageX - touch2.pageX) * (touch1.pageX - touch2.pageX) + (touch1.pageY - touch2.pageY) * (touch1.pageY - touch2.pageY));
-
- if (!originalDistance) {
- originalDistance = dist / self._currentZoom;
- }
-
- var scale = dist / originalDistance;
-
- _setZoomerVal.call(self, scale);
- dispatchChange(self.elements.zoomer);
- return;
- }
- }
-
- assignTransformCoordinates(deltaX, deltaY);
-
- newCss[CSS_TRANSFORM] = transform.toString();
- css(self.elements.preview, newCss);
- _updateOverlay.call(self);
- originalY = pageY;
- originalX = pageX;
- }
-
- function mouseUp() {
- isDragging = false;
- toggleGrabState(isDragging);
- window.removeEventListener('mousemove', mouseMove);
- window.removeEventListener('touchmove', mouseMove);
- window.removeEventListener('mouseup', mouseUp);
- window.removeEventListener('touchend', mouseUp);
- document.body.style[CSS_USERSELECT] = '';
- _updateCenterPoint.call(self);
- _triggerUpdate.call(self);
- originalDistance = 0;
- }
-
- self.elements.overlay.addEventListener('mousedown', mouseDown);
- self.elements.viewport.addEventListener('keydown', keyDown);
- self.elements.overlay.addEventListener('touchstart', mouseDown);
- }
-
- function _updateOverlay() {
- if (!this.elements) return; // since this is debounced, it can be fired after destroy
- var self = this,
- boundRect = self.elements.boundary.getBoundingClientRect(),
- imgData = self.elements.preview.getBoundingClientRect();
-
- css(self.elements.overlay, {
- width: imgData.width + 'px',
- height: imgData.height + 'px',
- top: (imgData.top - boundRect.top) + 'px',
- left: (imgData.left - boundRect.left) + 'px'
- });
- }
- var _debouncedOverlay = debounce(_updateOverlay, 500);
-
- function _triggerUpdate() {
- var self = this,
- data = self.get();
-
- if (!_isVisible.call(self)) {
- return;
- }
-
- self.options.update.call(self, data);
- if (self.$ && typeof Prototype === 'undefined') {
- self.$(self.element).trigger('update.croppie', data);
- }
- else {
- var ev;
- if (window.CustomEvent) {
- ev = new CustomEvent('update', { detail: data });
- } else {
- ev = document.createEvent('CustomEvent');
- ev.initCustomEvent('update', true, true, data);
- }
-
- self.element.dispatchEvent(ev);
- }
- }
-
- function _isVisible() {
- return this.elements.preview.offsetHeight > 0 && this.elements.preview.offsetWidth > 0;
- }
-
- function _updatePropertiesFromImage() {
- var self = this,
- initialZoom = 1,
- cssReset = {},
- img = self.elements.preview,
- imgData,
- transformReset = new Transform(0, 0, initialZoom),
- originReset = new TransformOrigin(),
- isVisible = _isVisible.call(self);
-
- if (!isVisible || self.data.bound) {// if the croppie isn't visible or it doesn't need binding
- return;
- }
-
- self.data.bound = true;
- cssReset[CSS_TRANSFORM] = transformReset.toString();
- cssReset[CSS_TRANS_ORG] = originReset.toString();
- cssReset['opacity'] = 1;
- css(img, cssReset);
-
- imgData = self.elements.preview.getBoundingClientRect();
-
- self._originalImageWidth = imgData.width;
- self._originalImageHeight = imgData.height;
- self.data.orientation = _hasExif.call(self) ? getExifOrientation(self.elements.img) : self.data.orientation;
-
- if (self.options.enableZoom) {
- _updateZoomLimits.call(self, true);
- }
- else {
- self._currentZoom = initialZoom;
- }
-
- transformReset.scale = self._currentZoom;
- cssReset[CSS_TRANSFORM] = transformReset.toString();
- css(img, cssReset);
-
- if (self.data.points.length) {
- _bindPoints.call(self, self.data.points);
- }
- else {
- _centerImage.call(self);
- }
-
- _updateCenterPoint.call(self);
- _updateOverlay.call(self);
- }
-
- function _updateZoomLimits (initial) {
- var self = this,
- minZoom = Math.max(self.options.minZoom, 0) || 0,
- maxZoom = self.options.maxZoom || 1.5,
- initialZoom,
- defaultInitialZoom,
- zoomer = self.elements.zoomer,
- scale = parseFloat(zoomer.value),
- boundaryData = self.elements.boundary.getBoundingClientRect(),
- imgData = naturalImageDimensions(self.elements.img, self.data.orientation),
- vpData = self.elements.viewport.getBoundingClientRect(),
- minW,
- minH;
- if (self.options.enforceBoundary) {
- minW = vpData.width / imgData.width;
- minH = vpData.height / imgData.height;
- minZoom = Math.max(minW, minH);
- }
-
- if (minZoom >= maxZoom) {
- maxZoom = minZoom + 1;
- }
-
- zoomer.min = fix(minZoom, 4);
- zoomer.max = fix(maxZoom, 4);
-
- if (!initial && (scale < zoomer.min || scale > zoomer.max)) {
- _setZoomerVal.call(self, scale < zoomer.min ? zoomer.min : zoomer.max);
- }
- else if (initial) {
- defaultInitialZoom = Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height));
- initialZoom = self.data.boundZoom !== null ? self.data.boundZoom : defaultInitialZoom;
- _setZoomerVal.call(self, initialZoom);
- }
-
- dispatchChange(zoomer);
- }
-
- function _bindPoints(points) {
- if (points.length !== 4) {
- throw "Croppie - Invalid number of points supplied: " + points;
- }
- var self = this,
- pointsWidth = points[2] - points[0],
- // pointsHeight = points[3] - points[1],
- vpData = self.elements.viewport.getBoundingClientRect(),
- boundRect = self.elements.boundary.getBoundingClientRect(),
- vpOffset = {
- left: vpData.left - boundRect.left,
- top: vpData.top - boundRect.top
- },
- scale = vpData.width / pointsWidth,
- originTop = points[1],
- originLeft = points[0],
- transformTop = (-1 * points[1]) + vpOffset.top,
- transformLeft = (-1 * points[0]) + vpOffset.left,
- newCss = {};
-
- newCss[CSS_TRANS_ORG] = originLeft + 'px ' + originTop + 'px';
- newCss[CSS_TRANSFORM] = new Transform(transformLeft, transformTop, scale).toString();
- css(self.elements.preview, newCss);
-
- _setZoomerVal.call(self, scale);
- self._currentZoom = scale;
- }
-
- function _centerImage() {
- var self = this,
- imgDim = self.elements.preview.getBoundingClientRect(),
- vpDim = self.elements.viewport.getBoundingClientRect(),
- boundDim = self.elements.boundary.getBoundingClientRect(),
- vpLeft = vpDim.left - boundDim.left,
- vpTop = vpDim.top - boundDim.top,
- w = vpLeft - ((imgDim.width - vpDim.width) / 2),
- h = vpTop - ((imgDim.height - vpDim.height) / 2),
- transform = new Transform(w, h, self._currentZoom);
-
- css(self.elements.preview, CSS_TRANSFORM, transform.toString());
- }
-
- function _transferImageToCanvas(customOrientation) {
- var self = this,
- canvas = self.elements.canvas,
- img = self.elements.img,
- ctx = canvas.getContext('2d');
-
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- canvas.width = img.width;
- canvas.height = img.height;
-
- var orientation = self.options.enableOrientation && customOrientation || getExifOrientation(img);
- drawCanvas(canvas, img, orientation);
- }
-
- function _getCanvas(data) {
- var self = this,
- points = data.points,
- left = num(points[0]),
- top = num(points[1]),
- right = num(points[2]),
- bottom = num(points[3]),
- width = right-left,
- height = bottom-top,
- circle = data.circle,
- canvas = document.createElement('canvas'),
- ctx = canvas.getContext('2d'),
- startX = 0,
- startY = 0,
- canvasWidth = data.outputWidth || width,
- canvasHeight = data.outputHeight || height;
-
- canvas.width = canvasWidth;
- canvas.height = canvasHeight;
-
- if (data.backgroundColor) {
- ctx.fillStyle = data.backgroundColor;
- ctx.fillRect(0, 0, canvasWidth, canvasHeight);
- }
-
- // By default assume we're going to draw the entire
- // source image onto the destination canvas.
- var sx = left,
- sy = top,
- sWidth = width,
- sHeight = height,
- dx = 0,
- dy = 0,
- dWidth = canvasWidth,
- dHeight = canvasHeight;
-
- //
- // Do not go outside of the original image's bounds along the x-axis.
- // Handle translations when projecting onto the destination canvas.
- //
-
- // The smallest possible source x-position is 0.
- if (left < 0) {
- sx = 0;
- dx = (Math.abs(left) / width) * canvasWidth;
- }
-
- // The largest possible source width is the original image's width.
- if (sWidth + sx > self._originalImageWidth) {
- sWidth = self._originalImageWidth - sx;
- dWidth = (sWidth / width) * canvasWidth;
- }
-
- //
- // Do not go outside of the original image's bounds along the y-axis.
- //
-
- // The smallest possible source y-position is 0.
- if (top < 0) {
- sy = 0;
- dy = (Math.abs(top) / height) * canvasHeight;
- }
-
- // The largest possible source height is the original image's height.
- if (sHeight + sy > self._originalImageHeight) {
- sHeight = self._originalImageHeight - sy;
- dHeight = (sHeight / height) * canvasHeight;
- }
-
- // console.table({ left, right, top, bottom, canvasWidth, canvasHeight, width, height, startX, startY, circle, sx, sy, dx, dy, sWidth, sHeight, dWidth, dHeight });
-
- ctx.drawImage(this.elements.preview, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
- if (circle) {
- ctx.fillStyle = '#fff';
- ctx.globalCompositeOperation = 'destination-in';
- ctx.beginPath();
- ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2, true);
- ctx.closePath();
- ctx.fill();
- }
- return canvas;
- }
-
- function _getHtmlResult(data) {
- var points = data.points,
- div = document.createElement('div'),
- img = document.createElement('img'),
- width = points[2] - points[0],
- height = points[3] - points[1];
-
- addClass(div, 'croppie-result');
- div.appendChild(img);
- css(img, {
- left: (-1 * points[0]) + 'px',
- top: (-1 * points[1]) + 'px'
- });
- img.src = data.url;
- css(div, {
- width: width + 'px',
- height: height + 'px'
- });
-
- return div;
- }
-
- function _getBase64Result(data) {
- return _getCanvas.call(this, data).toDataURL(data.format, data.quality);
- }
-
- function _getBlobResult(data) {
- var self = this;
- return new Promise(function (resolve) {
- _getCanvas.call(self, data).toBlob(function (blob) {
- resolve(blob);
- }, data.format, data.quality);
- });
- }
-
- function _replaceImage(img) {
- if (this.elements.img.parentNode) {
- Array.prototype.forEach.call(this.elements.img.classList, function(c) { img.classList.add(c); });
- this.elements.img.parentNode.replaceChild(img, this.elements.img);
- this.elements.preview = img; // if the img is attached to the DOM, they're not using the canvas
- }
- this.elements.img = img;
- }
-
- function _bind(options, cb) {
- var self = this,
- url,
- points = [],
- zoom = null,
- hasExif = _hasExif.call(self);
-
- if (typeof (options) === 'string') {
- url = options;
- options = {};
- }
- else if (Array.isArray(options)) {
- points = options.slice();
- }
- else if (typeof (options) === 'undefined' && self.data.url) { //refreshing
- _updatePropertiesFromImage.call(self);
- _triggerUpdate.call(self);
- return null;
- }
- else {
- url = options.url;
- points = options.points || [];
- zoom = typeof(options.zoom) === 'undefined' ? null : options.zoom;
- }
-
- self.data.bound = false;
- self.data.url = url || self.data.url;
- self.data.boundZoom = zoom;
-
- return loadImage(url, hasExif).then(function (img) {
- _replaceImage.call(self, img);
- if (!points.length) {
- var natDim = naturalImageDimensions(img);
- var rect = self.elements.viewport.getBoundingClientRect();
- var aspectRatio = rect.width / rect.height;
- var imgAspectRatio = natDim.width / natDim.height;
- var width, height;
-
- if (imgAspectRatio > aspectRatio) {
- height = natDim.height;
- width = height * aspectRatio;
- }
- else {
- width = natDim.width;
- height = natDim.height / aspectRatio;
- }
-
- var x0 = (natDim.width - width) / 2;
- var y0 = (natDim.height - height) / 2;
- var x1 = x0 + width;
- var y1 = y0 + height;
- self.data.points = [x0, y0, x1, y1];
- }
- else if (self.options.relative) {
- points = [
- points[0] * img.naturalWidth / 100,
- points[1] * img.naturalHeight / 100,
- points[2] * img.naturalWidth / 100,
- points[3] * img.naturalHeight / 100
- ];
- }
-
- self.data.orientation = options.orientation || 1;
- self.data.points = points.map(function (p) {
- return parseFloat(p);
- });
- if (self.options.useCanvas) {
- _transferImageToCanvas.call(self, self.data.orientation);
- }
- _updatePropertiesFromImage.call(self);
- _triggerUpdate.call(self);
- cb && cb();
- });
- }
-
- function fix(v, decimalPoints) {
- return parseFloat(v).toFixed(decimalPoints || 0);
- }
-
- function _get() {
- var self = this,
- imgData = self.elements.preview.getBoundingClientRect(),
- vpData = self.elements.viewport.getBoundingClientRect(),
- x1 = vpData.left - imgData.left,
- y1 = vpData.top - imgData.top,
- widthDiff = (vpData.width - self.elements.viewport.offsetWidth) / 2, //border
- heightDiff = (vpData.height - self.elements.viewport.offsetHeight) / 2,
- x2 = x1 + self.elements.viewport.offsetWidth + widthDiff,
- y2 = y1 + self.elements.viewport.offsetHeight + heightDiff,
- scale = self._currentZoom;
-
- if (scale === Infinity || isNaN(scale)) {
- scale = 1;
- }
-
- var max = self.options.enforceBoundary ? 0 : Number.NEGATIVE_INFINITY;
- x1 = Math.max(max, x1 / scale);
- y1 = Math.max(max, y1 / scale);
- x2 = Math.max(max, x2 / scale);
- y2 = Math.max(max, y2 / scale);
-
- return {
- points: [fix(x1), fix(y1), fix(x2), fix(y2)],
- zoom: scale,
- orientation: self.data.orientation
- };
- }
-
- var RESULT_DEFAULTS = {
- type: 'canvas',
- format: 'png',
- quality: 1
- },
- RESULT_FORMATS = ['jpeg', 'webp', 'png'];
-
- function _result(options) {
- var self = this,
- data = _get.call(self),
- opts = deepExtend(clone(RESULT_DEFAULTS), clone(options)),
- resultType = (typeof (options) === 'string' ? options : (opts.type || 'base64')),
- size = opts.size || 'viewport',
- format = opts.format,
- quality = opts.quality,
- backgroundColor = opts.backgroundColor,
- circle = typeof opts.circle === 'boolean' ? opts.circle : (self.options.viewport.type === 'circle'),
- vpRect = self.elements.viewport.getBoundingClientRect(),
- ratio = vpRect.width / vpRect.height,
- prom;
-
- if (size === 'viewport') {
- data.outputWidth = vpRect.width;
- data.outputHeight = vpRect.height;
- } else if (typeof size === 'object') {
- if (size.width && size.height) {
- data.outputWidth = size.width;
- data.outputHeight = size.height;
- } else if (size.width) {
- data.outputWidth = size.width;
- data.outputHeight = size.width / ratio;
- } else if (size.height) {
- data.outputWidth = size.height * ratio;
- data.outputHeight = size.height;
- }
- }
-
- if (RESULT_FORMATS.indexOf(format) > -1) {
- data.format = 'image/' + format;
- data.quality = quality;
- }
-
- data.circle = circle;
- data.url = self.data.url;
- data.backgroundColor = backgroundColor;
-
- prom = new Promise(function (resolve) {
- switch(resultType.toLowerCase())
- {
- case 'rawcanvas':
- resolve(_getCanvas.call(self, data));
- break;
- case 'canvas':
- case 'base64':
- resolve(_getBase64Result.call(self, data));
- break;
- case 'blob':
- _getBlobResult.call(self, data).then(resolve);
- break;
- default:
- resolve(_getHtmlResult.call(self, data));
- break;
- }
- });
- return prom;
- }
-
- function _refresh() {
- _updatePropertiesFromImage.call(this);
- }
-
- function _rotate(deg) {
- if (!this.options.useCanvas || !this.options.enableOrientation) {
- throw 'Croppie: Cannot rotate without enableOrientation && EXIF.js included';
- }
-
- var self = this,
- canvas = self.elements.canvas;
-
- self.data.orientation = getExifOffset(self.data.orientation, deg);
- drawCanvas(canvas, self.elements.img, self.data.orientation);
- _updateCenterPoint.call(self, true);
- _updateZoomLimits.call(self);
-
- // Reverses image dimensions if the degrees of rotation is not divisible by 180.
- if ((Math.abs(deg) / 90) % 2 === 1) {
- var oldHeight = self._originalImageHeight;
- var oldWidth = self._originalImageWidth;
- self._originalImageWidth = oldHeight;
- self._originalImageHeight = oldWidth;
- }
- }
-
- function _destroy() {
- var self = this;
- self.element.removeChild(self.elements.boundary);
- removeClass(self.element, 'croppie-container');
- if (self.options.enableZoom) {
- self.element.removeChild(self.elements.zoomerWrap);
- }
- delete self.elements;
- }
-
- if (typeof window !== 'undefined' && window.jQuery) {
- var $ = window.jQuery;
- $.fn.croppie = function (opts) {
- var ot = typeof opts;
-
- if (ot === 'string') {
- var args = Array.prototype.slice.call(arguments, 1);
- var singleInst = $(this).data('croppie');
-
- if (opts === 'get') {
- return singleInst.get();
- }
- else if (opts === 'result') {
- return singleInst.result.apply(singleInst, args);
- }
- else if (opts === 'bind') {
- return singleInst.bind.apply(singleInst, args);
- }
-
- return this.each(function () {
- var i = $(this).data('croppie');
- if (!i) return;
-
- var method = i[opts];
- if ($.isFunction(method)) {
- method.apply(i, args);
- if (opts === 'destroy') {
- $(this).removeData('croppie');
- }
- }
- else {
- throw 'Croppie ' + opts + ' method not found';
- }
- });
- }
- else {
- return this.each(function () {
- var i = new Croppie(this, opts);
- i.$ = $;
- $(this).data('croppie', i);
- });
- }
- };
- }
-
- function Croppie(element, opts) {
- if (element.className.indexOf('croppie-container') > -1) {
- throw new Error("Croppie: Can't initialize croppie more than once");
- }
- this.element = element;
- this.options = deepExtend(clone(Croppie.defaults), opts);
-
- if (this.element.tagName.toLowerCase() === 'img') {
- var origImage = this.element;
- addClass(origImage, 'cr-original-image');
- setAttributes(origImage, {'aria-hidden' : 'true', 'alt' : '' });
- var replacementDiv = document.createElement('div');
- this.element.parentNode.appendChild(replacementDiv);
- replacementDiv.appendChild(origImage);
- this.element = replacementDiv;
- this.options.url = this.options.url || origImage.src;
- }
-
- _create.call(this);
- if (this.options.url) {
- var bindOpts = {
- url: this.options.url,
- points: this.options.points
- };
- delete this.options['url'];
- delete this.options['points'];
- _bind.call(this, bindOpts);
- }
- }
-
- Croppie.defaults = {
- viewport: {
- width: 100,
- height: 100,
- type: 'square'
- },
- boundary: { },
- orientationControls: {
- enabled: true,
- leftClass: '',
- rightClass: ''
- },
- resizeControls: {
- width: true,
- height: true
- },
- customClass: '',
- showZoomer: true,
- enableZoom: true,
- enableResize: false,
- mouseWheelZoom: true,
- enableExif: false,
- enforceBoundary: true,
- enableOrientation: false,
- enableKeyMovement: true,
- update: function () { }
- };
-
- Croppie.globals = {
- translate: 'translate3d'
- };
-
- deepExtend(Croppie.prototype, {
- bind: function (options, cb) {
- return _bind.call(this, options, cb);
- },
- get: function () {
- var data = _get.call(this);
- var points = data.points;
- if (this.options.relative) {
- points[0] /= this.elements.img.naturalWidth / 100;
- points[1] /= this.elements.img.naturalHeight / 100;
- points[2] /= this.elements.img.naturalWidth / 100;
- points[3] /= this.elements.img.naturalHeight / 100;
- }
- return data;
- },
- result: function (type) {
- return _result.call(this, type);
- },
- refresh: function () {
- return _refresh.call(this);
- },
- setZoom: function (v) {
- _setZoomerVal.call(this, v);
- dispatchChange(this.elements.zoomer);
- },
- rotate: function (deg) {
- _rotate.call(this, deg);
- },
- destroy: function () {
- return _destroy.call(this);
- }
- });
- return Croppie;
-}));
-
-/*
- * This combined file was created by the DataTables downloader builder:
- * https://datatables.net/download
- *
- * To rebuild or modify this file with the latest versions of the included
- * software please visit:
- * https://datatables.net/download/#dt/dt-1.11.0
- *
- * Included libraries:
- * DataTables 1.11.0
- */
-
-/*!
- Copyright 2008-2021 SpryMedia Ltd.
-
- This source file is free software, available under the following license:
- MIT license - http://datatables.net/license
-
- This source file is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
-
- For details please refer to: http://www.datatables.net
- DataTables 1.11.0
- ©2008-2021 SpryMedia Ltd - datatables.net/license
-*/
-var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(l,z,A){l instanceof String&&(l=String(l));for(var q=l.length,E=0;E").css({position:"fixed",top:0,left:-1*l(z).scrollLeft(),height:1,
-width:1,overflow:"hidden"}).append(l("").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(l("").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}l.extend(a.oBrowser,u.__browser);a.oScroll.iBarWidth=u.__browser.barWidth}
-function Bb(a,b,c,d,e,h){var g=!1;if(c!==q){var f=c;g=!0}for(;d!==e;)a.hasOwnProperty(d)&&(f=g?b(f,a[d],d,a):a[d],g=!0,d+=h);return f}function Xa(a,b){var c=u.defaults.column,d=a.aoColumns.length;c=l.extend({},u.models.oColumn,c,{nTh:b?b:A.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=l.extend({},u.models.oSearch,c[d]);Ga(a,d,l(b).data())}function Ga(a,b,c){b=a.aoColumns[b];
-var d=a.oClasses,e=l(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var h=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);h&&(b.sWidthOrig=h[1])}c!==q&&null!==c&&(zb(c),P(u.defaults.column,c,!0),c.mDataProp===q||c.mData||(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),l.extend(b,c),X(b,c,"sWidth","sWidthOrig"),c.iDataSort!==q&&(b.aDataSort=[c.iDataSort]),X(b,c,"aDataSort"));var g=b.mData,f=na(g),
-k=b.mRender?na(b.mRender):null;c=function(n){return"string"===typeof n&&-1!==n.indexOf("@")};b._bAttrSrc=l.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(n,m,p){var t=f(n,m,q,p);return k&&m?k(t,m,n,p):t};b.fnSetData=function(n,m,p){return ha(g)(n,m,p)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==l.inArray("asc",b.asSorting);c=-1!==l.inArray("desc",b.asSorting);b.bSortable&&(a||c)?a&&!c?
-(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI):(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI="")}function ta(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ya(a);for(var c=0,d=b.length;cn[m])d(f.length+n[m],k);else if("string"===typeof n[m]){var p=0;for(g=f.length;pb&&a[e]--;
- -1!=d&&c===q&&a.splice(d,1)}function wa(a,b,c,d){var e=a.aoData[b],h,g=function(k,n){for(;k.childNodes.length;)k.removeChild(k.firstChild);k.innerHTML=T(a,b,n,"display")};if("dom"!==c&&(c&&"auto"!==c||"dom"!==e.src)){var f=e.anCells;if(f)if(d!==q)g(f[d],d);else for(c=0,h=f.length;c").appendTo(d));var k=0;for(b=f.length;k=a.fnRecordsDisplay()?0:f,a.iInitDisplayStart=-1);f=a._iDisplayStart;var m=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,V(a,!1);else if(!k)a.iDraw++;else if(!a.bDestroying&&!b){Fb(a);return}if(0!==n.length)for(b=k?a.aoData.length:m,g=k?0:f;g",{"class":h?e[0]:""}).append(l(" | ",{valign:"top",colSpan:oa(a),"class":a.oClasses.sRowEmpty}).html(d))[0];F(a,"aoHeaderCallback","header",[l(a.nTHead).children("tr")[0],cb(a),f,m,n]);F(a,"aoFooterCallback","footer",[l(a.nTFoot).children("tr")[0],cb(a),f,m,n]);e=l(a.nTBody);e.children().detach();
-e.append(l(c));F(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function ka(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&Gb(a);d?za(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;ja(a);a._drawHold=!1}function Hb(a){var b=a.oClasses,c=l(a.nTable);c=l("").insertBefore(c);var d=a.oFeatures,e=l("",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];
-a.nTableReinsertBefore=a.nTable.nextSibling;for(var h=a.sDom.split(""),g,f,k,n,m,p,t=0;t")[0];n=h[t+1];if("'"==n||'"'==n){m="";for(p=2;h[t+p]!=n;)m+=h[t+p],p++;"H"==m?m=b.sJUIHeader:"F"==m&&(m=b.sJUIFooter);-1!=m.indexOf(".")?(n=m.split("."),k.id=n[0].substr(1,n[0].length-1),k.className=n[1]):"#"==m.charAt(0)?k.id=m.substr(1,m.length-1):k.className=m;t+=p}e.append(k);e=l(k)}else if(">"==f)e=e.parent();else if("l"==f&&d.bPaginate&&d.bLengthChange)g=
-Ib(a);else if("f"==f&&d.bFilter)g=Jb(a);else if("r"==f&&d.bProcessing)g=Kb(a);else if("t"==f)g=Lb(a);else if("i"==f&&d.bInfo)g=Mb(a);else if("p"==f&&d.bPaginate)g=Nb(a);else if(0!==u.ext.feature.length)for(k=u.ext.feature,p=0,n=k.length;p',f=d.sSearch;f=f.match(/_INPUT_/)?f.replace("_INPUT_",g):f+g;b=l("",{id:h.f?null:c+"_filter","class":b.sFilter}).append(l("").append(f));var k=function(m){var p=this.value?this.value:"";e.return&&"Enter"!==m.key||p==e.sSearch||(za(a,{sSearch:p,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive,"return":e.return}),a._iDisplayStart=0,ja(a))};h=null!==a.searchDelay?a.searchDelay:"ssp"===Q(a)?400:0;var n=l("input",b).val(e.sSearch).attr("placeholder",
-d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",h?gb(k,h):k).on("mouseup",function(m){setTimeout(function(){k.call(n[0],m)},10)}).on("keypress.DT",function(m){if(13==m.keyCode)return!1}).attr("aria-controls",c);l(a.nTable).on("search.dt.DT",function(m,p){if(a===p)try{n[0]!==A.activeElement&&n.val(e.sSearch)}catch(t){}});return b[0]}function za(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,h=function(f){d.sSearch=f.sSearch;d.bRegex=f.bRegex;d.bSmart=f.bSmart;d.bCaseInsensitive=
-f.bCaseInsensitive;d.return=f.return},g=function(f){return f.bEscapeRegex!==q?!f.bEscapeRegex:f.bRegex};Za(a);if("ssp"!=Q(a)){Qb(a,b.sSearch,c,g(b),b.bSmart,b.bCaseInsensitive,b.return);h(b);for(b=0;b=b.length)a.aiDisplay=f.slice();else{if(k||c||d||g.length>b.length||0!==b.indexOf(g)||a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=0;c",{"class":a.oClasses.sInfo,id:c?null:b+"_info"});c||(a.aoDrawCallback.push({fn:Wb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),l(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Wb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),h=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),f=g?c.sInfo:c.sInfoEmpty;g!==h&&(f+=" "+c.sInfoFiltered);f+=c.sInfoPostFix;
-f=Xb(a,f);c=c.fnInfoCallback;null!==c&&(f=c.call(a.oInstance,a,d,e,h,g,f));l(b).html(f)}}function Xb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,h=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,h)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(h/e)))}function Ba(a){var b=a.iInitDisplayStart,
-c=a.aoColumns;var d=a.oFeatures;var e=a.bDeferLoading;if(a.bInitialised){Hb(a);Eb(a);ya(a,a.aoHeader);ya(a,a.aoFooter);V(a,!0);d.bAutoWidth&&Ya(a);var h=0;for(d=c.length;h",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect});for(var g=0,f=h.length;g").addClass(b.sLength);
-a.aanFeatures.l||(k[0].id=c+"_length");k.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));l("select",k).val(a._iDisplayLength).on("change.DT",function(n){jb(a,l(this).val());ja(a)});l(a.nTable).on("length.dt.DT",function(n,m,p){a===m&&l("select",k).val(p)});return k[0]}function Nb(a){var b=a.sPaginationType,c=u.ext.pager[b],d="function"===typeof c,e=function(g){ja(g)};b=l("").addClass(a.oClasses.sPaging+b)[0];var h=a.aanFeatures;d||c.fnInit(a,b,e);h.p||(b.id=a.sTableId+
-"_paginate",a.aoDrawCallback.push({fn:function(g){if(d){var f=g._iDisplayStart,k=g._iDisplayLength,n=g.fnRecordsDisplay(),m=-1===k;f=m?0:Math.ceil(f/k);k=m?1:Math.ceil(n/k);n=c(f,k);var p;m=0;for(p=h.p.length;mh&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):
-"next"==b?d+e",{id:a.aanFeatures.r?null:a.sTableId+"_processing","class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function V(a,b){a.oFeatures.bProcessing&&l(a.aanFeatures.r).css("display",b?"block":"none");F(a,null,"processing",[a,b])}function Lb(a){var b=l(a.nTable),
-c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,h=a.oClasses,g=b.children("caption"),f=g.length?g[0]._captionSide:null,k=l(b[0].cloneNode(!1)),n=l(b[0].cloneNode(!1)),m=b.children("tfoot");m.length||(m=null);k=l("
",{"class":h.sScrollWrapper}).append(l("",{"class":h.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?d?K(d):null:"100%"}).append(l("",{"class":h.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(k.removeAttr("id").css("margin-left",
-0).append("top"===f?g:null).append(b.children("thead"))))).append(l("",{"class":h.sScrollBody}).css({position:"relative",overflow:"auto",width:d?K(d):null}).append(b));m&&k.append(l("",{"class":h.sScrollFoot}).css({overflow:"hidden",border:0,width:d?d?K(d):null:"100%"}).append(l("",{"class":h.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===f?g:null).append(b.children("tfoot")))));b=k.children();var p=b[0];h=b[1];var t=m?b[2]:null;if(d)l(h).on("scroll.DT",
-function(v){v=this.scrollLeft;p.scrollLeft=v;m&&(t.scrollLeft=v)});l(h).css("max-height",e);c.bCollapse||l(h).css("height",e);a.nScrollHead=p;a.nScrollBody=h;a.nScrollFoot=t;a.aoDrawCallback.push({fn:Ha,sName:"scrolling"});return k[0]}function Ha(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY;b=b.iBarWidth;var h=l(a.nScrollHead),g=h[0].style,f=h.children("div"),k=f[0].style,n=f.children("table");f=a.nScrollBody;var m=l(f),p=f.style,t=l(a.nScrollFoot).children("div"),v=t.children("table"),x=l(a.nTHead),
-w=l(a.nTable),r=w[0],C=r.style,G=a.nTFoot?l(a.nTFoot):null,aa=a.oBrowser,L=aa.bScrollOversize;U(a.aoColumns,"nTh");var O=[],I=[],H=[],ea=[],Y,Ca=function(D){D=D.style;D.paddingTop="0";D.paddingBottom="0";D.borderTopWidth="0";D.borderBottomWidth="0";D.height=0};var fa=f.scrollHeight>f.clientHeight;if(a.scrollBarVis!==fa&&a.scrollBarVis!==q)a.scrollBarVis=fa,ta(a);else{a.scrollBarVis=fa;w.children("thead, tfoot").remove();if(G){var ba=G.clone().prependTo(w);var la=G.find("tr");ba=ba.find("tr")}var mb=
-x.clone().prependTo(w);x=x.find("tr");fa=mb.find("tr");mb.find("th, td").removeAttr("tabindex");c||(p.width="100%",h[0].style.width="100%");l.each(Na(a,mb),function(D,W){Y=ua(a,D);W.style.width=a.aoColumns[Y].sWidth});G&&ca(function(D){D.style.width=""},ba);h=w.outerWidth();""===c?(C.width="100%",L&&(w.find("tbody").height()>f.offsetHeight||"scroll"==m.css("overflow-y"))&&(C.width=K(w.outerWidth()-b)),h=w.outerWidth()):""!==d&&(C.width=K(d),h=w.outerWidth());ca(Ca,fa);ca(function(D){var W=z.getComputedStyle?
-z.getComputedStyle(D).width:K(l(D).width());H.push(D.innerHTML);O.push(W)},fa);ca(function(D,W){D.style.width=O[W]},x);l(fa).height(0);G&&(ca(Ca,ba),ca(function(D){ea.push(D.innerHTML);I.push(K(l(D).css("width")))},ba),ca(function(D,W){D.style.width=I[W]},la),l(ba).height(0));ca(function(D,W){D.innerHTML=''+H[W]+"
";D.childNodes[0].style.height="0";D.childNodes[0].style.overflow="hidden";D.style.width=O[W]},fa);G&&ca(function(D,W){D.innerHTML=''+
-ea[W]+"
";D.childNodes[0].style.height="0";D.childNodes[0].style.overflow="hidden";D.style.width=I[W]},ba);w.outerWidth()f.offsetHeight||"scroll"==m.css("overflow-y")?h+b:h,L&&(f.scrollHeight>f.offsetHeight||"scroll"==m.css("overflow-y"))&&(C.width=K(la-b)),""!==c&&""===d||da(a,1,"Possible column misalignment",6)):la="100%";p.width=K(la);g.width=K(la);G&&(a.nScrollFoot.style.width=K(la));!e&&L&&(p.height=K(r.offsetHeight+b));c=w.outerWidth();n[0].style.width=K(c);k.width=
-K(c);d=w.height()>f.clientHeight||"scroll"==m.css("overflow-y");e="padding"+(aa.bScrollbarLeft?"Left":"Right");k[e]=d?b+"px":"0px";G&&(v[0].style.width=K(c),t[0].style.width=K(c),t[0].style[e]=d?b+"px":"0px");w.children("colgroup").insertBefore(w.children("thead"));m.trigger("scroll");!a.bSorted&&!a.bFiltered||a._drawHold||(f.scrollTop=0)}}function ca(a,b,c){for(var d=0,e=0,h=b.length,g,f;e").appendTo(f.find("tbody"));f.find("thead, tfoot").remove();f.append(l(a.nTHead).clone()).append(l(a.nTFoot).clone());f.find("tfoot th, tfoot td").css("width","");n=Na(a,f.find("thead")[0]);for(v=0;v").css({width:w.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(v=
-0;v").css(h||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(f).appendTo(p);h&&g?f.width(g):h?(f.css("width","auto"),f.removeAttr("width"),f.width()").css("width",K(a)).appendTo(b||A.body);b=a[0].offsetWidth;a.remove();return b}function Zb(a,b){var c=$b(a,b);if(0>c)return null;var d=a.aoData[c];return d.nTr?d.anCells[b]:l(" | ").html(T(a,c,b,"display"))[0]}function $b(a,b){for(var c,
-d=-1,e=-1,h=0,g=a.aoData.length;hd&&(d=c.length,e=h);return e}function K(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function pa(a){var b=[],c=a.aoColumns;var d=a.aaSortingFixed;var e=l.isPlainObject(d);var h=[];var g=function(m){m.length&&!Array.isArray(m[0])?h.push(m):l.merge(h,m)};Array.isArray(d)&&g(d);e&&d.pre&&g(d.pre);g(a.aaSorting);e&&d.post&&g(d.post);for(a=0;aG?1:0;if(0!==C)return"asc"===r.dir?C:-C}C=c[m];G=c[p];return CG?1:0}):g.sort(function(m,p){var t,v=f.length,x=e[m]._aSortData,w=e[p]._aSortData;for(t=0;tG?1:0})}a.bSorted=!0}function bc(a){var b=a.aoColumns,
-c=pa(a);a=a.oLanguage.oAria;for(var d=0,e=b.length;d/g,"");var k=h.nTh;k.removeAttribute("aria-sort");h.bSortable&&(0e?e+1:3))}e=0;for(h=d.length;ee?e+1:3))}a.aLastSort=d}function ac(a,b){var c=a.aoColumns[b],d=u.ext.order[c.sSortDataType],
-e;d&&(e=d.call(a.oInstance,a,b,va(a,b)));for(var h,g=u.ext.type.order[c.sType+"-pre"],f=0,k=a.aoData.length;f=h.length?[0,m[1]]:m)}));f.search!==q&&l.extend(a.oPreviousSearch,Vb(f.search));if(f.columns)for(d=0,e=f.columns.length;d=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function fb(a,b){a=a.renderer;var c=u.ext.renderer[b];return l.isPlainObject(a)&&a[b]?c[a[b]]||c._:"string"===typeof a?c[a]||c._:c._}function Q(a){return a.oFeatures.bServerSide?
-"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Da(a,b){var c=dc.numbers_length,d=Math.floor(c/2);b<=c?a=ra(0,b):a<=d?(a=ra(0,c-2),a.push("ellipsis"),a.push(b-1)):(a>=b-1-d?a=ra(b-(c-2),b):(a=ra(a-d+2,a+d-1),a.push("ellipsis"),a.push(b-1)),a.splice(0,0,"ellipsis"),a.splice(0,0,0));a.DT_el="span";return a}function Wa(a){l.each({num:function(b){return Ta(b,a)},"num-fmt":function(b){return Ta(b,a,qb)},"html-num":function(b){return Ta(b,a,Ua)},"html-num-fmt":function(b){return Ta(b,a,Ua,qb)}},function(b,
-c){M.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(M.type.search[b+a]=M.type.search.html)})}function ec(a){return function(){var b=[Sa(this[u.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return u.ext.internal[a].apply(this,b)}}var u=function(a,b){if(this instanceof u)return l(a).DataTable(b);b=a;this.$=function(g,f){return this.api(!0).$(g,f)};this._=function(g,f){return this.api(!0).rows(g,f).data()};this.api=function(g){return g?new B(Sa(this[M.iApiIndex])):new B(this)};this.fnAddData=
-function(g,f){var k=this.api(!0);g=Array.isArray(g)&&(Array.isArray(g[0])||l.isPlainObject(g[0]))?k.rows.add(g):k.row.add(g);(f===q||f)&&k.draw();return g.flatten().toArray()};this.fnAdjustColumnSizing=function(g){var f=this.api(!0).columns.adjust(),k=f.settings()[0],n=k.oScroll;g===q||g?f.draw(!1):(""!==n.sX||""!==n.sY)&&Ha(k)};this.fnClearTable=function(g){var f=this.api(!0).clear();(g===q||g)&&f.draw()};this.fnClose=function(g){this.api(!0).row(g).child.hide()};this.fnDeleteRow=function(g,f,k){var n=
-this.api(!0);g=n.rows(g);var m=g.settings()[0],p=m.aoData[g[0][0]];g.remove();f&&f.call(this,m,p);(k===q||k)&&n.draw();return p};this.fnDestroy=function(g){this.api(!0).destroy(g)};this.fnDraw=function(g){this.api(!0).draw(g)};this.fnFilter=function(g,f,k,n,m,p){m=this.api(!0);null===f||f===q?m.search(g,k,n,p):m.column(f).search(g,k,n,p);m.draw()};this.fnGetData=function(g,f){var k=this.api(!0);if(g!==q){var n=g.nodeName?g.nodeName.toLowerCase():"";return f!==q||"td"==n||"th"==n?k.cell(g,f).data():
-k.row(g).data()||null}return k.data().toArray()};this.fnGetNodes=function(g){var f=this.api(!0);return g!==q?f.row(g).node():f.rows().nodes().flatten().toArray()};this.fnGetPosition=function(g){var f=this.api(!0),k=g.nodeName.toUpperCase();return"TR"==k?f.row(g).index():"TD"==k||"TH"==k?(g=f.cell(g).index(),[g.row,g.columnVisible,g.column]):null};this.fnIsOpen=function(g){return this.api(!0).row(g).child.isShown()};this.fnOpen=function(g,f,k){return this.api(!0).row(g).child(f,k).show().child()[0]};
-this.fnPageChange=function(g,f){g=this.api(!0).page(g);(f===q||f)&&g.draw(!1)};this.fnSetColumnVis=function(g,f,k){g=this.api(!0).column(g).visible(f);(k===q||k)&&g.columns.adjust().draw()};this.fnSettings=function(){return Sa(this[M.iApiIndex])};this.fnSort=function(g){this.api(!0).order(g).draw()};this.fnSortListener=function(g,f,k){this.api(!0).order.listener(g,f,k)};this.fnUpdate=function(g,f,k,n,m){var p=this.api(!0);k===q||null===k?p.row(f).data(g):p.cell(f,k).data(g);(m===q||m)&&p.columns.adjust();
-(n===q||n)&&p.draw();return 0};this.fnVersionCheck=M.fnVersionCheck;var c=this,d=b===q,e=this.length;d&&(b={});this.oApi=this.internal=M.internal;for(var h in u.ext.internal)h&&(this[h]=ec(h));this.each(function(){var g={},f=1").appendTo(t));r.nTHead=H[0];var ea=t.children("tbody");0===ea.length&&(ea=l("").insertAfter(H));r.nTBody=ea[0];H=t.children("tfoot");0===H.length&&0").appendTo(t));0===H.length||0===H.children().length?t.addClass(C.sNoFooter):0/g,sc=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,tc=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^|\-)/g,qb=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,Z=function(a){return a&&!0!==a&&"-"!==a?!1:!0},gc=
-function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},hc=function(a,b){rb[b]||(rb[b]=new RegExp(ib(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(rb[b],"."):a},sb=function(a,b,c){var d="string"===typeof a;if(Z(a))return!0;b&&d&&(a=hc(a,b));c&&d&&(a=a.replace(qb,""));return!isNaN(parseFloat(a))&&isFinite(a)},ic=function(a,b,c){return Z(a)?!0:Z(a)||"string"===typeof a?sb(a.replace(Ua,""),b,c)?!0:null:null},U=function(a,b,c){var d=[],e=0,h=a.length;if(c!==q)for(;e<
-h;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;ea.length)){var b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<
-e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();b=[];e=a.length;var h,g=0;d=0;a:for(;d")[0],qc=Qa.textContent!==q,rc=/<.*?>/g,gb=u.util.throttle,lc=[],N=Array.prototype,uc=function(a){var b,c=u.settings,d=l.map(c,function(h,g){return h.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase()){var e=l.inArray(a,d);return-1!==e?[c[e]]:null}if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?b=l(a):a instanceof l&&(b=a)}else return[];if(b)return b.map(function(h){e=
-l.inArray(this,d);return-1!==e?c[e]:null}).toArray()};var B=function(a,b){if(!(this instanceof B))return new B(a,b);var c=[],d=function(g){(g=uc(g))&&c.push.apply(c,g)};if(Array.isArray(a))for(var e=0,h=a.length;ea?new B(b[a],this[a]):null},filter:function(a){var b=[];if(N.filter)b=N.filter.call(this,a,this);else for(var c=0,d=this.length;c | ").addClass(f),l("td",k).addClass(f).html(g)[0].colSpan=
-oa(a),e.push(k[0]))};h(c,d);b._details&&b._details.detach();b._details=l(e);b._detailsShow&&b._details.insertAfter(b.nTr)},wb=function(a,b){var c=a.context;c.length&&(a=c[0].aoData[b!==q?b:a[0]])&&a._details&&(a._details.remove(),a._detailsShow=q,a._details=q,l(a.nTr).removeClass("dt-hasChild"),qa(c[0]))},oc=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];d._details&&((d._detailsShow=b)?(d._details.insertAfter(d.nTr),l(d.nTr).addClass("dt-hasChild")):(d._details.detach(),
-l(d.nTr).removeClass("dt-hasChild")),F(c[0],null,"childRow",[b,a.row(a[0])]),xc(c[0]),qa(c[0]))}},xc=function(a){var b=new B(a),c=a.aoData;b.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0f){var m=l.map(d,function(p,t){return p.bVisible?t:null});return[m[m.length+f]]}return[ua(a,f)];case "name":return l.map(e,function(p,t){return p===n[1]?t:null});default:return[]}if(g.nodeName&&g._DT_CellIndex)return[g._DT_CellIndex.column];
-f=l(h).filter(g).map(function(){return l.inArray(this,h)}).toArray();if(f.length||!g.nodeName)return f;f=l(g).closest("*[data-dt-column]");return f.length?[f.data("dt-column")]:[]},a,c)};y("columns()",function(a,b){a===q?a="":l.isPlainObject(a)&&(b=a,a="");b=ub(b);var c=this.iterator("table",function(d){return zc(d,a,b)},1);c.selector.cols=a;c.selector.opts=b;return c});J("columns().header()","column().header()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTh},
-1)});J("columns().footer()","column().footer()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTf},1)});J("columns().data()","column().data()",function(){return this.iterator("column-rows",pc,1)});J("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});J("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,h){return Ea(b.aoData,h,"search"===
-a?"_aFilterData":"_aSortData",c)},1)});J("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return Ea(a.aoData,e,"anCells",b)},1)});J("columns().visible()","column().visible()",function(a,b){var c=this,d=this.iterator("column",function(e,h){if(a===q)return e.aoColumns[h].bVisible;var g=e.aoColumns,f=g[h],k=e.aoData,n;if(a!==q&&f.bVisible!==a){if(a){var m=l.inArray(!0,U(g,"bVisible"),h+1);g=0;for(n=k.length;gd;return!0};u.isDataTable=u.fnIsDataTable=function(a){var b=
-l(a).get(0),c=!1;if(a instanceof u.Api)return!0;l.each(u.settings,function(d,e){d=e.nScrollHead?l("table",e.nScrollHead)[0]:null;var h=e.nScrollFoot?l("table",e.nScrollFoot)[0]:null;if(e.nTable===b||d===b||h===b)c=!0});return c};u.tables=u.fnTables=function(a){var b=!1;l.isPlainObject(a)&&(b=a.api,a=a.visible);var c=l.map(u.settings,function(d){if(!a||a&&l(d.nTable).is(":visible"))return d.nTable});return b?new B(c):c};u.camelToHungarian=P;y("$()",function(a,b){b=this.rows(b).nodes();b=l(b);return l([].concat(b.filter(a).toArray(),
-b.find(a).toArray()))});l.each(["on","one","off"],function(a,b){y(b+"()",function(){var c=Array.prototype.slice.call(arguments);c[0]=l.map(c[0].split(/\s/),function(e){return e.match(/\.dt\b/)?e:e+".dt"}).join(" ");var d=l(this.tables().nodes());d[b].apply(d,c);return this})});y("clear()",function(){return this.iterator("table",function(a){Ka(a)})});y("settings()",function(){return new B(this.context,this.context)});y("init()",function(){var a=this.context;return a.length?a[0].oInit:null});y("data()",
-function(){return this.iterator("table",function(a){return U(a.aoData,"_aData")}).flatten()});y("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,h=b.nTBody,g=b.nTHead,f=b.nTFoot,k=l(e);h=l(h);var n=l(b.nTableWrapper),m=l.map(b.aoData,function(t){return t.nTr}),p;b.bDestroying=!0;F(b,"aoDestroyCallback","destroy",[b]);a||(new B(b)).columns().visible(!0);n.off(".DT").find(":not(tbody *)").off(".DT");l(z).off(".DT-"+b.sInstance);
-e!=g.parentNode&&(k.children("thead").detach(),k.append(g));f&&e!=f.parentNode&&(k.children("tfoot").detach(),k.append(f));b.aaSorting=[];b.aaSortingFixed=[];Ra(b);l(m).removeClass(b.asStripeClasses.join(" "));l("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);h.children().detach();h.append(m);g=a?"remove":"detach";k[g]();n[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),k.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&
-h.children().each(function(t){l(this).addClass(b.asDestroyStripes[t%p])}));c=l.inArray(b,u.settings);-1!==c&&u.settings.splice(c,1)})});l.each(["column","row","cell"],function(a,b){y(b+"s().every()",function(c){var d=this.selector.opts,e=this;return this.iterator(b,function(h,g,f,k,n){c.call(e[b](g,"cell"===b?f:d,"cell"===b?d:q),g,f,k,n)})})});y("i18n()",function(a,b,c){var d=this.context[0];a=na(a)(d.oLanguage);a===q&&(a=b);c!==q&&l.isPlainObject(a)&&(a=a[c]!==q?a[c]:a._);return a.replace("%d",c)});
-u.version="1.11.0";u.settings=[];u.models={};u.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0,"return":!1};u.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};u.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,
-sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};u.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,
-bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){return{}}},
-fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",
-sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:l.extend({},u.models.oSearch),sAjaxDataProp:"data",
-sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};E(u.defaults);u.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};E(u.defaults.column);u.models.oSettings=
-{oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},
-aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,
-aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,jqXHR:null,json:q,oAjaxData:q,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Q(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},
-fnRecordsDisplay:function(){return"ssp"==Q(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,h=e.bPaginate;return e.bServerSide?!1===h||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!h||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};u.ext=M={buttons:{},classes:{},builder:"dt/dt-1.11.0",
-errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:u.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:u.version};l.extend(M,{afnFiltering:M.search,aTypes:M.type.detect,ofnSearch:M.type.search,oSort:M.type.order,afnSortData:M.order,aoFeatures:M.feature,oApi:M.internal,oStdClasses:M.classes,oPagination:M.pager});l.extend(u.ext.classes,
-{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_desc_disabled",sSortableDesc:"sorting_asc_disabled",
-sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var dc=
-u.ext.pager;l.extend(dc,{simple:function(a,b){return["previous","next"]},full:function(a,b){return["first","previous","next","last"]},numbers:function(a,b){return[Da(a,b)]},simple_numbers:function(a,b){return["previous",Da(a,b),"next"]},full_numbers:function(a,b){return["first","previous",Da(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",Da(a,b),"last"]},_numbers:Da,numbers_length:7});l.extend(!0,u.ext.renderer,{pageButton:{_:function(a,b,c,d,e,h){var g=a.oClasses,f=a.oLanguage.oPaginate,
-k=a.oLanguage.oAria.paginate||{},n,m,p=0,t=function(x,w){var r,C=g.sPageButtonDisabled,G=function(I){lb(a,I.data.action,!0)};var aa=0;for(r=w.length;aa").appendTo(x);t(O,L)}else{n=null;m=L;O=a.iTabIndex;switch(L){case "ellipsis":x.append('…');break;case "first":n=f.sFirst;0===e&&(O=-1,m+=" "+C);break;case "previous":n=f.sPrevious;0===e&&(O=-1,m+=" "+C);break;case "next":n=f.sNext;if(0===
-h||e===h-1)O=-1,m+=" "+C;break;case "last":n=f.sLast;if(0===h||e===h-1)O=-1,m+=" "+C;break;default:n=a.fnFormatNumber(L+1),m=e===L?g.sPageButtonActive:""}null!==n&&(O=l("",{"class":g.sPageButton+" "+m,"aria-controls":a.sTableId,"aria-label":k[L],"data-dt-idx":p,tabindex:O,id:0===c&&"string"===typeof L?a.sTableId+"_"+L:null}).html(n).appendTo(x),ob(O,{action:L},G),p++)}}};try{var v=l(b).find(A.activeElement).data("dt-idx")}catch(x){}t(l(b).empty(),d);v!==q&&l(b).find("[data-dt-idx="+v+"]").trigger("focus")}}});
-l.extend(u.ext.type.detect,[function(a,b){b=b.oLanguage.sDecimal;return sb(a,b)?"num"+b:null},function(a,b){if(a&&!(a instanceof Date)&&!sc.test(a))return null;b=Date.parse(a);return null!==b&&!isNaN(b)||Z(a)?"date":null},function(a,b){b=b.oLanguage.sDecimal;return sb(a,b,!0)?"num-fmt"+b:null},function(a,b){b=b.oLanguage.sDecimal;return ic(a,b)?"html-num"+b:null},function(a,b){b=b.oLanguage.sDecimal;return ic(a,b,!0)?"html-num-fmt"+b:null},function(a,b){return Z(a)||"string"===typeof a&&-1!==a.indexOf("<")?
-"html":null}]);l.extend(u.ext.type.search,{html:function(a){return Z(a)?a:"string"===typeof a?a.replace(fc," ").replace(Ua,""):""},string:function(a){return Z(a)?a:"string"===typeof a?a.replace(fc," "):a}});var Ta=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=hc(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};l.extend(M.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return Z(a)?"":a.replace?a.replace(/<.*?>/g,
-"").toLowerCase():a+""},"string-pre":function(a){return Z(a)?"":"string"===typeof a?a.toLowerCase():a.toString?a.toString():""},"string-asc":function(a,b){return ab?1:0},"string-desc":function(a,b){return ab?-1:0}});Wa("");l.extend(!0,u.ext.renderer,{header:{_:function(a,b,c,d){l(a.nTable).on("order.dt.DT",function(e,h,g,f){a===h&&(e=c.idx,b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==f[e]?d.sSortAsc:"desc"==f[e]?d.sSortDesc:c.sSortingClass))})},jqueryui:function(a,b,c,
-d){l("").addClass(d.sSortJUIWrapper).append(b.contents()).append(l("").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);l(a.nTable).on("order.dt.DT",function(e,h,g,f){a===h&&(e=c.idx,b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==f[e]?d.sSortAsc:"desc"==f[e]?d.sSortDesc:c.sSortingClass),b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass("asc"==f[e]?d.sSortJUIAsc:"desc"==
-f[e]?d.sSortJUIDesc:c.sSortingClassJUI))})}}});var xb=function(a){return"string"===typeof a?a.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""):a};u.render={number:function(a,b,c,d,e){return{display:function(h){if("number"!==typeof h&&"string"!==typeof h)return h;var g=0>h?"-":"",f=parseFloat(h);if(isNaN(f))return xb(h);f=f.toFixed(c);h=Math.abs(f);f=parseInt(h,10);h=c?b+(h-f).toFixed(c).substring(2):"";0===f&&0===parseFloat(h)&&(g="");return g+(d||"")+f.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
-a)+h+(e||"")}}},text:function(){return{display:xb,filter:xb}}};l.extend(u.ext.internal,{_fnExternApiFunc:ec,_fnBuildAjax:Oa,_fnAjaxUpdate:Fb,_fnAjaxParameters:Ob,_fnAjaxUpdateDraw:Pb,_fnAjaxDataSrc:Aa,_fnAddColumn:Xa,_fnColumnOptions:Ga,_fnAdjustColumnSizing:ta,_fnVisibleToColumnIndex:ua,_fnColumnIndexToVisible:va,_fnVisbleColumns:oa,_fnGetColumns:Ia,_fnColumnTypes:Za,_fnApplyColumnDefs:Cb,_fnHungarianMap:E,_fnCamelToHungarian:P,_fnLanguageCompat:ma,_fnBrowserDetect:Ab,_fnAddData:ia,_fnAddTr:Ja,_fnNodeToDataIndex:function(a,
-b){return b._DT_RowIndex!==q?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return l.inArray(c,a.aoData[b].anCells)},_fnGetCellData:T,_fnSetCellData:Db,_fnSplitObjNotation:bb,_fnGetObjectDataFn:na,_fnSetObjectDataFn:ha,_fnGetDataMaster:cb,_fnClearTable:Ka,_fnDeleteIndex:La,_fnInvalidate:wa,_fnGetRowElements:ab,_fnCreateTr:$a,_fnBuildHead:Eb,_fnDrawHead:ya,_fnDraw:ja,_fnReDraw:ka,_fnAddOptionsHtml:Hb,_fnDetectHeader:xa,_fnGetUniqueThs:Na,_fnFeatureHtmlFilter:Jb,_fnFilterComplete:za,_fnFilterCustom:Sb,
-_fnFilterColumn:Rb,_fnFilter:Qb,_fnFilterCreateSearch:hb,_fnEscapeRegex:ib,_fnFilterData:Tb,_fnFeatureHtmlInfo:Mb,_fnUpdateInfo:Wb,_fnInfoMacros:Xb,_fnInitialise:Ba,_fnInitComplete:Pa,_fnLengthChange:jb,_fnFeatureHtmlLength:Ib,_fnFeatureHtmlPaginate:Nb,_fnPageChange:lb,_fnFeatureHtmlProcessing:Kb,_fnProcessingDisplay:V,_fnFeatureHtmlTable:Lb,_fnScrollDraw:Ha,_fnApplyToChildren:ca,_fnCalculateColumnWidths:Ya,_fnThrottle:gb,_fnConvertToWidth:Yb,_fnGetWidestNode:Zb,_fnGetMaxLenString:$b,_fnStringToCss:K,
-_fnSortFlatten:pa,_fnSort:Gb,_fnSortAria:bc,_fnSortListener:nb,_fnSortAttachListener:eb,_fnSortingClasses:Ra,_fnSortData:ac,_fnSaveState:qa,_fnLoadState:cc,_fnSettingsFromNode:Sa,_fnLog:da,_fnMap:X,_fnBindAction:ob,_fnCallbackReg:R,_fnCallbackFire:F,_fnLengthOverflow:kb,_fnRenderer:fb,_fnDataSource:Q,_fnRowAttributes:db,_fnExtend:pb,_fnCalculateEnd:function(){}});l.fn.dataTable=u;u.$=l;l.fn.dataTableSettings=u.settings;l.fn.dataTableExt=u.ext;l.fn.DataTable=function(a){return l(this).dataTable(a).api()};
-l.each(u,function(a,b){l.fn.DataTable[a]=b});return u});
-
-
-/*!
- DataTables styling integration
- ©2018 SpryMedia Ltd - datatables.net/license
-*/
-(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net")(a,b).$);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});
-
-
-
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.datepicker=t():e.datepicker=t()}(window,(function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var a=[],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=["January","February","March","April","May","June","July","August","September","October","November","December"],o={t:"top",r:"right",b:"bottom",l:"left",c:"centered"};function s(){}var l=["click","focusin","keydown","input"];function d(e){l.forEach((function(t){e.addEventListener(t,e===document?L:Y)}))}function c(e){return Array.isArray(e)?e.map(c):"[object Object]"===x(e)?Object.keys(e).reduce((function(t,n){return t[n]=c(e[n]),t}),{}):e}function u(e,t){var n=e.calendar.querySelector(".qs-overlay"),a=n&&!n.classList.contains("qs-hidden");t=t||new Date(e.currentYear,e.currentMonth),e.calendar.innerHTML=[h(t,e,a),f(t,e,a),v(e,a)].join(""),a&&window.requestAnimationFrame((function(){M(!0,e)}))}function h(e,t,n){return['','
','
',''+t.months[e.getMonth()]+"",''+e.getFullYear()+"","
",'
',"
"].join("")}function f(e,t,n){var a=t.currentMonth,r=t.currentYear,i=t.dateSelected,o=t.maxDate,s=t.minDate,l=t.showAllDates,d=t.days,c=t.disabledDates,u=t.startDay,h=t.weekendIndices,f=t.events,v=t.getRange?t.getRange():{},m=+v.start,y=+v.end,p=g(new Date(e).setDate(1)),w=p.getDay()-u,D=w<0?7:0;p.setMonth(p.getMonth()+1),p.setDate(0);var b=p.getDate(),q=[],S=D+7*((w+b)/7|0);S+=(w+b)%7?7:0;for(var M=1;M<=S;M++){var E=(M-1)%7,x=d[E],C=M-(w>=0?w:7+w),L=new Date(r,a,C),Y=f[+L],j=C<1||C>b,P=j?C<1?-1:1:0,k=j&&!l,O=k?"":L.getDate(),N=+L==+i,_=E===h[0]||E===h[1],I=m!==y,A="qs-square "+x;Y&&!k&&(A+=" qs-event"),j&&(A+=" qs-outside-current-month"),!l&&j||(A+=" qs-num"),N&&(A+=" qs-active"),(c[+L]||t.disabler(L)||_&&t.noWeekends||s&&+L<+s||o&&+L>+o)&&!k&&(A+=" qs-disabled"),+g(new Date)==+L&&(A+=" qs-current"),+L===m&&y&&I&&(A+=" qs-range-start"),+L>m&&+L'+O+"")}var R=d.map((function(e){return''+e+"
"})).concat(q);return R.unshift(''),R.push("
"),R.join("")}function v(e,t){var n=e.overlayPlaceholder,a=e.overlayButton;return['',"
",'
'+e.overlayMonths.map((function(e,t){return'
'+e+"
"})).join("")+"
",'
'+a+"
","
"].join("")}function m(e,t,n){var a=t.el,r=t.calendar.querySelector(".qs-active"),i=e.textContent,o=t.sibling;(a.disabled||a.readOnly)&&t.respectDisabledReadOnly||(t.dateSelected=n?void 0:new Date(t.currentYear,t.currentMonth,i),r&&r.classList.remove("qs-active"),n||e.classList.add("qs-active"),p(a,t,n),n||q(t),o&&(y({instance:t,deselect:n}),t.first&&!o.dateSelected&&(o.currentYear=t.currentYear,o.currentMonth=t.currentMonth,o.currentMonthName=t.currentMonthName),u(t),u(o)),t.onSelect(t,n?void 0:new Date(t.dateSelected)))}function y(e){var t=e.instance.first?e.instance:e.instance.sibling,n=t.sibling;t===e.instance?e.deselect?(t.minDate=t.originalMinDate,n.minDate=n.originalMinDate):n.minDate=t.dateSelected:e.deselect?(n.maxDate=n.originalMaxDate,t.maxDate=t.originalMaxDate):t.maxDate=n.dateSelected}function p(e,t,n){if(!t.nonInput)return n?e.value="":t.formatter!==s?t.formatter(e,t.dateSelected,t):void(e.value=t.dateSelected.toDateString())}function w(e,t,n,a){n||a?(n&&(t.currentYear=+n),a&&(t.currentMonth=+a)):(t.currentMonth+=e.contains("qs-right")?1:-1,12===t.currentMonth?(t.currentMonth=0,t.currentYear++):-1===t.currentMonth&&(t.currentMonth=11,t.currentYear--)),t.currentMonthName=t.months[t.currentMonth],u(t),t.onMonthChange(t)}function D(e){if(!e.noPosition){var t=e.position.top,n=e.position.right;if(e.position.centered)return e.calendarContainer.classList.add("qs-centered");var a=e.positionedEl.getBoundingClientRect(),r=e.el.getBoundingClientRect(),i=e.calendarContainer.getBoundingClientRect(),o=r.top-a.top+(t?-1*i.height:r.height)+"px",s=r.left-a.left+(n?r.width-i.width:0)+"px";e.calendarContainer.style.setProperty("top",o),e.calendarContainer.style.setProperty("left",s)}}function b(e){return"[object Date]"===x(e)&&"Invalid Date"!==e.toString()}function g(e){if(b(e)||"number"==typeof e&&!isNaN(e)){var t=new Date(+e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}}function q(e){e.disabled||!e.calendarContainer.classList.contains("qs-hidden")&&!e.alwaysShow&&("overlay"!==e.defaultView&&M(!0,e),e.calendarContainer.classList.add("qs-hidden"),e.onHide(e))}function S(e){e.disabled||(e.calendarContainer.classList.remove("qs-hidden"),"overlay"===e.defaultView&&M(!1,e),D(e),e.onShow(e))}function M(e,t){var n=t.calendar,a=n.querySelector(".qs-overlay"),r=a.querySelector(".qs-overlay-year"),i=n.querySelector(".qs-controls"),o=n.querySelector(".qs-squares");e?(a.classList.add("qs-hidden"),i.classList.remove("qs-blur"),o.classList.remove("qs-blur"),r.value=""):(a.classList.remove("qs-hidden"),i.classList.add("qs-blur"),o.classList.add("qs-blur"),r.focus())}function E(e,t,n,a){var r=isNaN(+(new Date).setFullYear(t.value||void 0)),i=r?null:t.value;if(13===e.which||13===e.keyCode||"click"===e.type)a?w(null,n,i,a):r||t.classList.contains("qs-disabled")||w(null,n,i);else if(n.calendar.contains(t)){n.calendar.querySelector(".qs-submit").classList[r?"add":"remove"]("qs-disabled")}}function x(e){return{}.toString.call(e)}function C(e){a.forEach((function(t){t!==e&&q(t)}))}function L(e){if(!e.__qs_shadow_dom){var t=e.which||e.keyCode,n=e.type,r=e.target,o=r.classList,s=a.filter((function(e){return e.calendar.contains(r)||e.el===r}))[0],l=s&&s.calendar.contains(r);if(!(s&&s.isMobile&&s.disableMobile))if("click"===n){if(!s)return a.forEach(q);if(s.disabled)return;var d=s.calendar,c=s.calendarContainer,h=s.disableYearOverlay,f=s.nonInput,v=d.querySelector(".qs-overlay-year"),y=!!d.querySelector(".qs-hidden"),p=d.querySelector(".qs-month-year").contains(r),D=r.dataset.monthNum;if(s.noPosition&&!l)(c.classList.contains("qs-hidden")?S:q)(s);else if(o.contains("qs-arrow"))w(o,s);else if(p||o.contains("qs-close"))h||M(!y,s);else if(D)E(e,v,s,D);else{if(o.contains("qs-disabled"))return;if(o.contains("qs-num")){var b=r.textContent,g=+r.dataset.direction,x=new Date(s.currentYear,s.currentMonth+g,b);if(g){s.currentYear=x.getFullYear(),s.currentMonth=x.getMonth(),s.currentMonthName=i[s.currentMonth],u(s);for(var L,Y=s.calendar.querySelectorAll('[data-direction="0"]'),j=0;!L;){var P=Y[j];P.textContent===b&&(L=P),j++}r=L}return void(+x==+s.dateSelected?m(r,s,!0):r.classList.contains("qs-disabled")||m(r,s))}o.contains("qs-submit")?E(e,v,s):f&&r===s.el&&(S(s),C(s))}}else if("focusin"===n&&s)S(s),C(s);else if("keydown"===n&&9===t&&s)q(s);else if("keydown"===n&&s&&!s.disabled){var k=!s.calendar.querySelector(".qs-overlay").classList.contains("qs-hidden");13===t&&k&&l?E(e,r,s):27===t&&k&&l&&M(!0,s)}else if("input"===n){if(!s||!s.calendar.contains(r))return;var O=s.calendar.querySelector(".qs-submit"),N=r.value.split("").reduce((function(e,t){return e||"0"!==t?e+(t.match(/[0-9]/)?t:""):""}),"").slice(0,4);r.value=N,O.classList[4===N.length?"remove":"add"]("qs-disabled")}}}function Y(e){L(e),e.__qs_shadow_dom=!0}function j(e,t){l.forEach((function(n){e.removeEventListener(n,t)}))}function P(){S(this)}function k(){q(this)}function O(e,t){var n=g(e),a=this.currentYear,r=this.currentMonth,i=this.sibling;if(null==e)return this.dateSelected=void 0,p(this.el,this,!0),i&&(y({instance:this,deselect:!0}),u(i)),u(this),this;if(!b(e))throw new Error("`setDate` needs a JavaScript Date object.");if(this.disabledDates[+n]||nthis.maxDate)throw new Error("You can't manually set a date that's disabled.");this.dateSelected=n,t&&(this.currentYear=n.getFullYear(),this.currentMonth=n.getMonth(),this.currentMonthName=this.months[n.getMonth()]),p(this.el,this),i&&(y({instance:this}),u(i));var o=a===n.getFullYear()&&r===n.getMonth();return o||t?u(this,n):o||u(this,new Date(a,r,1)),this}function N(e){return I(this,e,!0)}function _(e){return I(this,e)}function I(e,t,n){var a=e.dateSelected,r=e.first,i=e.sibling,o=e.minDate,s=e.maxDate,l=g(t),d=n?"Min":"Max";function c(){return"original"+d+"Date"}function h(){return d.toLowerCase()+"Date"}function f(){return"set"+d}function v(){throw new Error("Out-of-range date passed to "+f())}if(null==t)e[c()]=void 0,i?(i[c()]=void 0,n?(r&&!a||!r&&!i.dateSelected)&&(e.minDate=void 0,i.minDate=void 0):(r&&!i.dateSelected||!r&&!a)&&(e.maxDate=void 0,i.maxDate=void 0)):e[h()]=void 0;else{if(!b(t))throw new Error("Invalid date passed to "+f());i?((r&&n&&l>(a||s)||r&&!n&&l<(i.dateSelected||o)||!r&&n&&l>(i.dateSelected||s)||!r&&!n&&l<(a||o))&&v(),e[c()]=l,i[c()]=l,(n&&(r&&!a||!r&&!i.dateSelected)||!n&&(r&&!i.dateSelected||!r&&!a))&&(e[h()]=l,i[h()]=l)):((n&&l>(a||s)||!n&&l<(a||o))&&v(),e[h()]=l)}return i&&u(i),u(e),e}function A(){var e=this.first?this:this.sibling,t=e.sibling;return{start:e.dateSelected,end:t.dateSelected}}function R(){var e=this.shadowDom,t=this.positionedEl,n=this.calendarContainer,r=this.sibling,i=this;this.inlinePosition&&(a.some((function(e){return e!==i&&e.positionedEl===t}))||t.style.setProperty("position",null));n.remove(),a=a.filter((function(e){return e!==i})),r&&delete r.sibling,a.length||j(document,L);var o=a.some((function(t){return t.shadowDom===e}));for(var s in e&&!o&&j(e,Y),this)delete this[s];a.length||l.forEach((function(e){document.removeEventListener(e,L)}))}function F(e,t){var n=new Date(e);if(!b(n))throw new Error("Invalid date passed to `navigate`");this.currentYear=n.getFullYear(),this.currentMonth=n.getMonth(),u(this),t&&this.onMonthChange(this)}function B(){var e=!this.calendarContainer.classList.contains("qs-hidden"),t=!this.calendarContainer.querySelector(".qs-overlay").classList.contains("qs-hidden");e&&M(t,this)}t.default=function(e,t){var n=function(e,t){var n,l,d=function(e){var t=c(e);t.events&&(t.events=t.events.reduce((function(e,t){if(!b(t))throw new Error('"options.events" must only contain valid JavaScript Date objects.');return e[+g(t)]=!0,e}),{}));["startDate","dateSelected","minDate","maxDate"].forEach((function(e){var n=t[e];if(n&&!b(n))throw new Error('"options.'+e+'" needs to be a valid JavaScript Date object.');t[e]=g(n)}));var n=t.position,i=t.maxDate,l=t.minDate,d=t.dateSelected,u=t.overlayPlaceholder,h=t.overlayButton,f=t.startDay,v=t.id;if(t.startDate=g(t.startDate||d||new Date),t.disabledDates=(t.disabledDates||[]).reduce((function(e,t){var n=+g(t);if(!b(t))throw new Error('You supplied an invalid date to "options.disabledDates".');if(n===+g(d))throw new Error('"disabledDates" cannot contain the same date as "dateSelected".');return e[n]=1,e}),{}),t.hasOwnProperty("id")&&null==v)throw new Error("`id` cannot be `null` or `undefined`");if(null!=v){var m=a.filter((function(e){return e.id===v}));if(m.length>1)throw new Error("Only two datepickers can share an id.");m.length?(t.second=!0,t.sibling=m[0]):t.first=!0}var y=["tr","tl","br","bl","c"].some((function(e){return n===e}));if(n&&!y)throw new Error('"options.position" must be one of the following: tl, tr, bl, br, or c.');function p(e){throw new Error('"dateSelected" in options is '+(e?"less":"greater")+' than "'+(e||"max")+'Date".')}if(t.position=function(e){var t=e[0],n=e[1],a={};a[o[t]]=1,n&&(a[o[n]]=1);return a}(n||"bl"),id&&p("min"),i0&&f<7){var w=(t.customDays||r).slice(),D=w.splice(0,f);t.customDays=w.concat(D),t.startDay=+f,t.weekendIndices=[w.length-1,w.length]}else t.startDay=0,t.weekendIndices=[6,0];"string"!=typeof u&&delete t.overlayPlaceholder;"string"!=typeof h&&delete t.overlayButton;var q=t.defaultView;if(q&&"calendar"!==q&&"overlay"!==q)throw new Error('options.defaultView must either be "calendar" or "overlay".');return t.defaultView=q||"calendar",t}(t||{startDate:g(new Date),position:"bl",defaultView:"calendar"}),u=e;if("string"==typeof u)u="#"===u[0]?document.getElementById(u.slice(1)):document.querySelector(u);else{if("[object ShadowRoot]"===x(u))throw new Error("Using a shadow DOM as your selector is not supported.");for(var h,f=u.parentNode;!h;){var v=x(f);"[object HTMLDocument]"===v?h=!0:"[object ShadowRoot]"===v?(h=!0,n=f,l=f.host):f=f.parentNode}}if(!u)throw new Error("No selector / element found.");if(a.some((function(e){return e.el===u})))throw new Error("A datepicker already exists on that element.");var m=u===document.body,y=n?u.parentElement||n:m?document.body:u.parentElement,w=n?u.parentElement||l:y,D=document.createElement("div"),q=document.createElement("div");D.className="qs-datepicker-container qs-hidden",q.className="qs-datepicker";var M={shadowDom:n,customElement:l,positionedEl:w,el:u,parent:y,nonInput:"INPUT"!==u.nodeName,noPosition:m,position:!m&&d.position,startDate:d.startDate,dateSelected:d.dateSelected,disabledDates:d.disabledDates,minDate:d.minDate,maxDate:d.maxDate,noWeekends:!!d.noWeekends,weekendIndices:d.weekendIndices,calendarContainer:D,calendar:q,currentMonth:(d.startDate||d.dateSelected).getMonth(),currentMonthName:(d.months||i)[(d.startDate||d.dateSelected).getMonth()],currentYear:(d.startDate||d.dateSelected).getFullYear(),events:d.events||{},defaultView:d.defaultView,setDate:O,remove:R,setMin:N,setMax:_,show:P,hide:k,navigate:F,toggleOverlay:B,onSelect:d.onSelect,onShow:d.onShow,onHide:d.onHide,onMonthChange:d.onMonthChange,formatter:d.formatter,disabler:d.disabler,months:d.months||i,days:d.customDays||r,startDay:d.startDay,overlayMonths:d.overlayMonths||(d.months||i).map((function(e){return e.slice(0,3)})),overlayPlaceholder:d.overlayPlaceholder||"4-digit year",overlayButton:d.overlayButton||"Submit",disableYearOverlay:!!d.disableYearOverlay,disableMobile:!!d.disableMobile,isMobile:"ontouchstart"in window,alwaysShow:!!d.alwaysShow,id:d.id,showAllDates:!!d.showAllDates,respectDisabledReadOnly:!!d.respectDisabledReadOnly,first:d.first,second:d.second};if(d.sibling){var E=d.sibling,C=M,L=E.minDate||C.minDate,Y=E.maxDate||C.maxDate;C.sibling=E,E.sibling=C,E.minDate=L,E.maxDate=Y,C.minDate=L,C.maxDate=Y,E.originalMinDate=L,E.originalMaxDate=Y,C.originalMinDate=L,C.originalMaxDate=Y,E.getRange=A,C.getRange=A}d.dateSelected&&p(u,M);var j=getComputedStyle(w).position;m||j&&"static"!==j||(M.inlinePosition=!0,w.style.setProperty("position","relative"));var I=a.filter((function(e){return e.positionedEl===M.positionedEl}));I.some((function(e){return e.inlinePosition}))&&(M.inlinePosition=!0,I.forEach((function(e){e.inlinePosition=!0})));D.appendChild(q),y.appendChild(D),M.alwaysShow&&S(M);return M}(e,t);if(a.length||d(document),n.shadowDom&&(a.some((function(e){return e.shadowDom===n.shadowDom}))||d(n.shadowDom)),a.push(n),n.second){var l=n.sibling;y({instance:n,deselect:!n.dateSelected}),y({instance:l,deselect:!l.dateSelected}),u(l)}return u(n,n.startDate||n.dateSelected),n.alwaysShow&&D(n),n}}]).default}));
-/**
- * jquery.mask.js
- * @version: v1.14.15
- * @author: Igor Escobar
- *
- * Created by Igor Escobar on 2012-03-10. Please report any bug at github.com/igorescobar/jQuery-Mask-Plugin
- *
- * Copyright (c) 2012 Igor Escobar http://igorescobar.com
- *
- * The MIT License (http://www.opensource.org/licenses/mit-license.php)
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/* jshint laxbreak: true */
-/* jshint maxcomplexity:17 */
-/* global define */
-
-// UMD (Universal Module Definition) patterns for JavaScript modules that work everywhere.
-// https://github.com/umdjs/umd/blob/master/templates/jqueryPlugin.js
-(function (factory, jQuery, Zepto) {
-
- if (typeof define === 'function' && define.amd) {
- define(['jquery'], factory);
- } else if (typeof exports === 'object') {
- module.exports = factory(require('jquery'));
- } else {
- factory(jQuery || Zepto);
- }
-
-}(function ($) {
- 'use strict';
-
- var Mask = function (el, mask, options) {
-
- var p = {
- invalid: [],
- getCaret: function () {
- try {
- var sel,
- pos = 0,
- ctrl = el.get(0),
- dSel = document.selection,
- cSelStart = ctrl.selectionStart;
-
- // IE Support
- if (dSel && navigator.appVersion.indexOf('MSIE 10') === -1) {
- sel = dSel.createRange();
- sel.moveStart('character', -p.val().length);
- pos = sel.text.length;
- }
- // Firefox support
- else if (cSelStart || cSelStart === '0') {
- pos = cSelStart;
- }
-
- return pos;
- } catch (e) {}
- },
- setCaret: function(pos) {
- try {
- if (el.is(':focus')) {
- var range, ctrl = el.get(0);
-
- // Firefox, WebKit, etc..
- if (ctrl.setSelectionRange) {
- ctrl.setSelectionRange(pos, pos);
- } else { // IE
- range = ctrl.createTextRange();
- range.collapse(true);
- range.moveEnd('character', pos);
- range.moveStart('character', pos);
- range.select();
- }
- }
- } catch (e) {}
- },
- events: function() {
- el
- .on('keydown.mask', function(e) {
- el.data('mask-keycode', e.keyCode || e.which);
- el.data('mask-previus-value', el.val());
- el.data('mask-previus-caret-pos', p.getCaret());
- p.maskDigitPosMapOld = p.maskDigitPosMap;
- })
- .on($.jMaskGlobals.useInput ? 'input.mask' : 'keyup.mask', p.behaviour)
- .on('paste.mask drop.mask', function() {
- setTimeout(function() {
- el.keydown().keyup();
- }, 100);
- })
- .on('change.mask', function(){
- el.data('changed', true);
- })
- .on('blur.mask', function(){
- if (oldValue !== p.val() && !el.data('changed')) {
- el.trigger('change');
- }
- el.data('changed', false);
- })
- // it's very important that this callback remains in this position
- // otherwhise oldValue it's going to work buggy
- .on('blur.mask', function() {
- oldValue = p.val();
- })
- // select all text on focus
- .on('focus.mask', function (e) {
- if (options.selectOnFocus === true) {
- $(e.target).select();
- }
- })
- // clear the value if it not complete the mask
- .on('focusout.mask', function() {
- if (options.clearIfNotMatch && !regexMask.test(p.val())) {
- p.val('');
- }
- });
- },
- getRegexMask: function() {
- var maskChunks = [], translation, pattern, optional, recursive, oRecursive, r;
-
- for (var i = 0; i < mask.length; i++) {
- translation = jMask.translation[mask.charAt(i)];
-
- if (translation) {
-
- pattern = translation.pattern.toString().replace(/.{1}$|^.{1}/g, '');
- optional = translation.optional;
- recursive = translation.recursive;
-
- if (recursive) {
- maskChunks.push(mask.charAt(i));
- oRecursive = {digit: mask.charAt(i), pattern: pattern};
- } else {
- maskChunks.push(!optional && !recursive ? pattern : (pattern + '?'));
- }
-
- } else {
- maskChunks.push(mask.charAt(i).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
- }
- }
-
- r = maskChunks.join('');
-
- if (oRecursive) {
- r = r.replace(new RegExp('(' + oRecursive.digit + '(.*' + oRecursive.digit + ')?)'), '($1)?')
- .replace(new RegExp(oRecursive.digit, 'g'), oRecursive.pattern);
- }
-
- return new RegExp(r);
- },
- destroyEvents: function() {
- el.off(['input', 'keydown', 'keyup', 'paste', 'drop', 'blur', 'focusout', ''].join('.mask '));
- },
- val: function(v) {
- var isInput = el.is('input'),
- method = isInput ? 'val' : 'text',
- r;
-
- if (arguments.length > 0) {
- if (el[method]() !== v) {
- el[method](v);
- }
- r = el;
- } else {
- r = el[method]();
- }
-
- return r;
- },
- calculateCaretPosition: function() {
- var oldVal = el.data('mask-previus-value') || '',
- newVal = p.getMasked(),
- caretPosNew = p.getCaret();
- if (oldVal !== newVal) {
- var caretPosOld = el.data('mask-previus-caret-pos') || 0,
- newValL = newVal.length,
- oldValL = oldVal.length,
- maskDigitsBeforeCaret = 0,
- maskDigitsAfterCaret = 0,
- maskDigitsBeforeCaretAll = 0,
- maskDigitsBeforeCaretAllOld = 0,
- i = 0;
-
- for (i = caretPosNew; i < newValL; i++) {
- if (!p.maskDigitPosMap[i]) {
- break;
- }
- maskDigitsAfterCaret++;
- }
-
- for (i = caretPosNew - 1; i >= 0; i--) {
- if (!p.maskDigitPosMap[i]) {
- break;
- }
- maskDigitsBeforeCaret++;
- }
-
- for (i = caretPosNew - 1; i >= 0; i--) {
- if (p.maskDigitPosMap[i]) {
- maskDigitsBeforeCaretAll++;
- }
- }
-
- for (i = caretPosOld - 1; i >= 0; i--) {
- if (p.maskDigitPosMapOld[i]) {
- maskDigitsBeforeCaretAllOld++;
- }
- }
-
- // if the cursor is at the end keep it there
- if (caretPosNew > oldValL) {
- caretPosNew = newValL * 10;
- } else if (caretPosOld >= caretPosNew && caretPosOld !== oldValL) {
- if (!p.maskDigitPosMapOld[caretPosNew]) {
- var caretPos = caretPosNew;
- caretPosNew -= maskDigitsBeforeCaretAllOld - maskDigitsBeforeCaretAll;
- caretPosNew -= maskDigitsBeforeCaret;
- if (p.maskDigitPosMap[caretPosNew]) {
- caretPosNew = caretPos;
- }
- }
- }
- else if (caretPosNew > caretPosOld) {
- caretPosNew += maskDigitsBeforeCaretAll - maskDigitsBeforeCaretAllOld;
- caretPosNew += maskDigitsAfterCaret;
- }
- }
- return caretPosNew;
- },
- behaviour: function(e) {
- e = e || window.event;
- p.invalid = [];
-
- var keyCode = el.data('mask-keycode');
-
- if ($.inArray(keyCode, jMask.byPassKeys) === -1) {
- var newVal = p.getMasked(),
- caretPos = p.getCaret();
-
- // this is a compensation to devices/browsers that don't compensate
- // caret positioning the right way
- setTimeout(function() {
- p.setCaret(p.calculateCaretPosition());
- }, $.jMaskGlobals.keyStrokeCompensation);
-
- p.val(newVal);
- p.setCaret(caretPos);
- return p.callbacks(e);
- }
- },
- getMasked: function(skipMaskChars, val) {
- var buf = [],
- value = val === undefined ? p.val() : val + '',
- m = 0, maskLen = mask.length,
- v = 0, valLen = value.length,
- offset = 1, addMethod = 'push',
- resetPos = -1,
- maskDigitCount = 0,
- maskDigitPosArr = [],
- lastMaskChar,
- check;
-
- if (options.reverse) {
- addMethod = 'unshift';
- offset = -1;
- lastMaskChar = 0;
- m = maskLen - 1;
- v = valLen - 1;
- check = function () {
- return m > -1 && v > -1;
- };
- } else {
- lastMaskChar = maskLen - 1;
- check = function () {
- return m < maskLen && v < valLen;
- };
- }
-
- var lastUntranslatedMaskChar;
- while (check()) {
- var maskDigit = mask.charAt(m),
- valDigit = value.charAt(v),
- translation = jMask.translation[maskDigit];
-
- if (translation) {
- if (valDigit.match(translation.pattern)) {
- buf[addMethod](valDigit);
- if (translation.recursive) {
- if (resetPos === -1) {
- resetPos = m;
- } else if (m === lastMaskChar && m !== resetPos) {
- m = resetPos - offset;
- }
-
- if (lastMaskChar === resetPos) {
- m -= offset;
- }
- }
- m += offset;
- } else if (valDigit === lastUntranslatedMaskChar) {
- // matched the last untranslated (raw) mask character that we encountered
- // likely an insert offset the mask character from the last entry; fall
- // through and only increment v
- maskDigitCount--;
- lastUntranslatedMaskChar = undefined;
- } else if (translation.optional) {
- m += offset;
- v -= offset;
- } else if (translation.fallback) {
- buf[addMethod](translation.fallback);
- m += offset;
- v -= offset;
- } else {
- p.invalid.push({p: v, v: valDigit, e: translation.pattern});
- }
- v += offset;
- } else {
- if (!skipMaskChars) {
- buf[addMethod](maskDigit);
- }
-
- if (valDigit === maskDigit) {
- maskDigitPosArr.push(v);
- v += offset;
- } else {
- lastUntranslatedMaskChar = maskDigit;
- maskDigitPosArr.push(v + maskDigitCount);
- maskDigitCount++;
- }
-
- m += offset;
- }
- }
-
- var lastMaskCharDigit = mask.charAt(lastMaskChar);
- if (maskLen === valLen + 1 && !jMask.translation[lastMaskCharDigit]) {
- buf.push(lastMaskCharDigit);
- }
-
- var newVal = buf.join('');
- p.mapMaskdigitPositions(newVal, maskDigitPosArr, valLen);
- return newVal;
- },
- mapMaskdigitPositions: function(newVal, maskDigitPosArr, valLen) {
- var maskDiff = options.reverse ? newVal.length - valLen : 0;
- p.maskDigitPosMap = {};
- for (var i = 0; i < maskDigitPosArr.length; i++) {
- p.maskDigitPosMap[maskDigitPosArr[i] + maskDiff] = 1;
- }
- },
- callbacks: function (e) {
- var val = p.val(),
- changed = val !== oldValue,
- defaultArgs = [val, e, el, options],
- callback = function(name, criteria, args) {
- if (typeof options[name] === 'function' && criteria) {
- options[name].apply(this, args);
- }
- };
-
- callback('onChange', changed === true, defaultArgs);
- callback('onKeyPress', changed === true, defaultArgs);
- callback('onComplete', val.length === mask.length, defaultArgs);
- callback('onInvalid', p.invalid.length > 0, [val, e, el, p.invalid, options]);
- }
- };
-
- el = $(el);
- var jMask = this, oldValue = p.val(), regexMask;
-
- mask = typeof mask === 'function' ? mask(p.val(), undefined, el, options) : mask;
-
- // public methods
- jMask.mask = mask;
- jMask.options = options;
- jMask.remove = function() {
- var caret = p.getCaret();
- if (jMask.options.placeholder) {
- el.removeAttr('placeholder');
- }
- if (el.data('mask-maxlength')) {
- el.removeAttr('maxlength');
- }
- p.destroyEvents();
- p.val(jMask.getCleanVal());
- p.setCaret(caret);
- return el;
- };
-
- // get value without mask
- jMask.getCleanVal = function() {
- return p.getMasked(true);
- };
-
- // get masked value without the value being in the input or element
- jMask.getMaskedVal = function(val) {
- return p.getMasked(false, val);
- };
-
- jMask.init = function(onlyMask) {
- onlyMask = onlyMask || false;
- options = options || {};
-
- jMask.clearIfNotMatch = $.jMaskGlobals.clearIfNotMatch;
- jMask.byPassKeys = $.jMaskGlobals.byPassKeys;
- jMask.translation = $.extend({}, $.jMaskGlobals.translation, options.translation);
-
- jMask = $.extend(true, {}, jMask, options);
-
- regexMask = p.getRegexMask();
-
- if (onlyMask) {
- p.events();
- p.val(p.getMasked());
- } else {
- if (options.placeholder) {
- el.attr('placeholder' , options.placeholder);
- }
-
- // this is necessary, otherwise if the user submit the form
- // and then press the "back" button, the autocomplete will erase
- // the data. Works fine on IE9+, FF, Opera, Safari.
- if (el.data('mask')) {
- el.attr('autocomplete', 'off');
- }
-
- // detect if is necessary let the user type freely.
- // for is a lot faster than forEach.
- for (var i = 0, maxlength = true; i < mask.length; i++) {
- var translation = jMask.translation[mask.charAt(i)];
- if (translation && translation.recursive) {
- maxlength = false;
- break;
- }
- }
-
- if (maxlength) {
- el.attr('maxlength', mask.length).data('mask-maxlength', true);
- }
-
- p.destroyEvents();
- p.events();
-
- var caret = p.getCaret();
- p.val(p.getMasked());
- p.setCaret(caret);
- }
- };
-
- jMask.init(!el.is('input'));
- };
-
- $.maskWatchers = {};
- var HTMLAttributes = function () {
- var input = $(this),
- options = {},
- prefix = 'data-mask-',
- mask = input.attr('data-mask');
-
- if (input.attr(prefix + 'reverse')) {
- options.reverse = true;
- }
-
- if (input.attr(prefix + 'clearifnotmatch')) {
- options.clearIfNotMatch = true;
- }
-
- if (input.attr(prefix + 'selectonfocus') === 'true') {
- options.selectOnFocus = true;
- }
-
- if (notSameMaskObject(input, mask, options)) {
- return input.data('mask', new Mask(this, mask, options));
- }
- },
- notSameMaskObject = function(field, mask, options) {
- options = options || {};
- var maskObject = $(field).data('mask'),
- stringify = JSON.stringify,
- value = $(field).val() || $(field).text();
- try {
- if (typeof mask === 'function') {
- mask = mask(value);
- }
- return typeof maskObject !== 'object' || stringify(maskObject.options) !== stringify(options) || maskObject.mask !== mask;
- } catch (e) {}
- },
- eventSupported = function(eventName) {
- var el = document.createElement('div'), isSupported;
-
- eventName = 'on' + eventName;
- isSupported = (eventName in el);
-
- if ( !isSupported ) {
- el.setAttribute(eventName, 'return;');
- isSupported = typeof el[eventName] === 'function';
- }
- el = null;
-
- return isSupported;
- };
-
- $.fn.mask = function(mask, options) {
- options = options || {};
- var selector = this.selector,
- globals = $.jMaskGlobals,
- interval = globals.watchInterval,
- watchInputs = options.watchInputs || globals.watchInputs,
- maskFunction = function() {
- if (notSameMaskObject(this, mask, options)) {
- return $(this).data('mask', new Mask(this, mask, options));
- }
- };
-
- $(this).each(maskFunction);
-
- if (selector && selector !== '' && watchInputs) {
- clearInterval($.maskWatchers[selector]);
- $.maskWatchers[selector] = setInterval(function(){
- $(document).find(selector).each(maskFunction);
- }, interval);
- }
- return this;
- };
-
- $.fn.masked = function(val) {
- return this.data('mask').getMaskedVal(val);
- };
-
- $.fn.unmask = function() {
- clearInterval($.maskWatchers[this.selector]);
- delete $.maskWatchers[this.selector];
- return this.each(function() {
- var dataMask = $(this).data('mask');
- if (dataMask) {
- dataMask.remove().removeData('mask');
- }
- });
- };
-
- $.fn.cleanVal = function() {
- return this.data('mask').getCleanVal();
- };
-
- $.applyDataMask = function(selector) {
- selector = selector || $.jMaskGlobals.maskElements;
- var $selector = (selector instanceof $) ? selector : $(selector);
- $selector.filter($.jMaskGlobals.dataMaskAttr).each(HTMLAttributes);
- };
-
- var globals = {
- maskElements: 'input,td,span,div',
- dataMaskAttr: '*[data-mask]',
- dataMask: true,
- watchInterval: 300,
- watchInputs: true,
- keyStrokeCompensation: 10,
- // old versions of chrome dont work great with input event
- useInput: !/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent) && eventSupported('input'),
- watchDataMask: false,
- byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91],
- translation: {
- '0': {pattern: /\d/},
- '9': {pattern: /\d/, optional: true},
- '#': {pattern: /\d/, recursive: true},
- 'A': {pattern: /[a-zA-Z0-9]/},
- 'S': {pattern: /[a-zA-Z]/}
- }
- };
-
- $.jMaskGlobals = $.jMaskGlobals || {};
- globals = $.jMaskGlobals = $.extend(true, {}, globals, $.jMaskGlobals);
-
- // looking for inputs with data-mask attribute
- if (globals.dataMask) {
- $.applyDataMask();
- }
-
- setInterval(function() {
- if ($.jMaskGlobals.watchDataMask) {
- $.applyDataMask();
- }
- }, globals.watchInterval);
-}, window.jQuery, window.Zepto));
-
-/**
- * jQuery Timepicker
- * http://timepicker.co
- *
- * Enhances standard form input fields helping users to select (or type) times.
- *
- * Copyright (c) 2016 Willington Vega; Licensed MIT, GPL
- */
-
-(function (factory) {
- if ( typeof module === 'object' && typeof module.exports === 'object' ) {
- factory(require('jquery'), window, document);
- } else if (typeof jQuery !== 'undefined') {
- factory(jQuery, window, document);
- }
-}(function($, window, document, undefined) {
- (function() {
-
- function pad(str, ch, length) {
- return (new Array(length + 1 - str.length).join(ch)) + str;
- }
-
- function normalize() {
- if (arguments.length === 1) {
- var date = arguments[0];
- if (typeof date === 'string') {
- date = $.fn.timepicker.parseTime(date);
- }
- return new Date(0, 0, 0, date.getHours(), date.getMinutes(), date.getSeconds());
- } else if (arguments.length === 3) {
- return new Date(0, 0, 0, arguments[0], arguments[1], arguments[2]);
- } else if (arguments.length === 2) {
- return new Date(0, 0, 0, arguments[0], arguments[1], 0);
- } else {
- return new Date(0, 0, 0);
- }
- }
-
- $.TimePicker = function() {
- var widget = this;
-
- widget.container = $('.ui-timepicker-container');
- widget.ui = widget.container.find('.ui-timepicker');
-
- if (widget.container.length === 0) {
- widget.container = $('').addClass('ui-timepicker-container')
- .addClass('ui-timepicker-hidden ui-helper-hidden')
- .appendTo('body')
- .hide();
- widget.ui = $( '' ).addClass('ui-timepicker')
- .addClass('ui-widget ui-widget-content ui-menu')
- .addClass('ui-corner-all')
- .appendTo(widget.container);
- widget.viewport = $('').addClass( 'ui-timepicker-viewport' )
- .appendTo( widget.ui );
-
- if ($.fn.jquery >= '1.4.2') {
- widget.ui.delegate('a', 'mouseenter.timepicker', function() {
- // passing false instead of an instance object tells the function
- // to use the current instance
- widget.activate(false, $(this).parent());
- }).delegate('a', 'mouseleave.timepicker', function() {
- widget.deactivate(false);
- }).delegate('a', 'click.timepicker', function(event) {
- event.preventDefault();
- widget.select(false, $(this).parent());
- });
- }
- }
- };
-
- $.TimePicker.count = 0;
- $.TimePicker.instance = function() {
- if (!$.TimePicker._instance) {
- $.TimePicker._instance = new $.TimePicker();
- }
- return $.TimePicker._instance;
- };
-
- $.TimePicker.prototype = {
- // extracted from from jQuery UI Core
- // http://github,com/jquery/jquery-ui/blob/master/ui/jquery.ui.core.js
- keyCode: {
- ALT: 18,
- BLOQ_MAYUS: 20,
- CTRL: 17,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- HOME: 36,
- LEFT: 37,
- NUMPAD_ENTER: 108,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- RIGHT: 39,
- SHIFT: 16,
- TAB: 9,
- UP: 38
- },
-
- _items: function(i, startTime) {
- var widget = this, ul = $(''), item = null, time, end;
-
- // interval should be a multiple of 60 if timeFormat is not
- // showing minutes
- if (i.options.timeFormat.indexOf('m') === -1 && i.options.interval % 60 !== 0) {
- i.options.interval = Math.max(Math.round(i.options.interval / 60), 1) * 60;
- }
-
- if (startTime) {
- time = normalize(startTime);
- } else if (i.options.startTime) {
- time = normalize(i.options.startTime);
- } else {
- time = normalize(i.options.startHour, i.options.startMinutes);
- }
-
- end = new Date(time.getTime() + 24 * 60 * 60 * 1000);
-
- while(time < end) {
- if (widget._isValidTime(i, time)) {
- item = $('').addClass('ui-menu-item').appendTo(ul);
- $('').addClass('ui-corner-all').text($.fn.timepicker.formatTime(i.options.timeFormat, time)).appendTo(item);
- item.data('time-value', time);
- }
- time = new Date(time.getTime() + i.options.interval * 60 * 1000);
- }
-
- return ul.children();
- },
-
- _isValidTime: function(i, time) {
- var min = null, max = null;
-
- time = normalize(time);
-
- if (i.options.minTime !== null) {
- min = normalize(i.options.minTime);
- } else if (i.options.minHour !== null || i.options.minMinutes !== null) {
- min = normalize(i.options.minHour, i.options.minMinutes);
- }
-
- if (i.options.maxTime !== null) {
- max = normalize(i.options.maxTime);
- } else if (i.options.maxHour !== null || i.options.maxMinutes !== null) {
- max = normalize(i.options.maxHour, i.options.maxMinutes);
- }
-
- if (min !== null && max !== null) {
- return time >= min && time <= max;
- } else if (min !== null) {
- return time >= min;
- } else if (max !== null) {
- return time <= max;
- }
-
- return true;
- },
-
- _hasScroll: function() {
- // fix for jQuery 1.6 new prop method
- var m = typeof this.ui.prop !== 'undefined' ? 'prop' : 'attr';
- return this.ui.height() < this.ui[m]('scrollHeight');
- },
-
- /**
- * TODO: Write me!
- *
- * @param i
- * @param direction
- * @param edge
- * */
- _move: function(i, direction, edge) {
- var widget = this;
- if (widget.closed()) {
- widget.open(i);
- }
- if (!widget.active) {
- widget.activate( i, widget.viewport.children( edge ) );
- return;
- }
- var next = widget.active[direction + 'All']('.ui-menu-item').eq(0);
- if (next.length) {
- widget.activate(i, next);
- } else {
- widget.activate( i, widget.viewport.children( edge ) );
- }
- },
-
- //
- // protected methods
- //
-
- register: function(node, options) {
- var widget = this, i = {}; // timepicker instance object
-
- i.element = $(node);
-
- if (i.element.data('TimePicker')) {
- return;
- }
-
- i.options = $.metadata ? $.extend({}, options, i.element.metadata()) : $.extend({}, options);
- i.widget = widget;
-
- // proxy functions for the exposed api methods
- $.extend(i, {
- next: function() {return widget.next(i) ;},
- previous: function() {return widget.previous(i) ;},
- first: function() { return widget.first(i) ;},
- last: function() { return widget.last(i) ;},
- selected: function() { return widget.selected(i) ;},
- open: function() { return widget.open(i) ;},
- close: function() { return widget.close(i) ;},
- closed: function() { return widget.closed(i) ;},
- destroy: function() { return widget.destroy(i) ;},
-
- parse: function(str) { return widget.parse(i, str) ;},
- format: function(time, format) { return widget.format(i, time, format); },
- getTime: function() { return widget.getTime(i) ;},
- setTime: function(time, silent) { return widget.setTime(i, time, silent); },
- option: function(name, value) { return widget.option(i, name, value); }
- });
-
- widget._setDefaultTime(i);
- widget._addInputEventsHandlers(i);
-
- i.element.data('TimePicker', i);
- },
-
- _setDefaultTime: function(i) {
- if (i.options.defaultTime === 'now') {
- i.setTime(normalize(new Date()));
- } else if (i.options.defaultTime && i.options.defaultTime.getFullYear) {
- i.setTime(normalize(i.options.defaultTime));
- } else if (i.options.defaultTime) {
- i.setTime($.fn.timepicker.parseTime(i.options.defaultTime));
- }
- },
-
- _addInputEventsHandlers: function(i) {
- var widget = this;
-
- i.element.bind('keydown.timepicker', function(event) {
- switch (event.which || event.keyCode) {
- case widget.keyCode.ENTER:
- case widget.keyCode.NUMPAD_ENTER:
- event.preventDefault();
- if (widget.closed()) {
- i.element.trigger('change.timepicker');
- } else {
- widget.select(i, widget.active);
- }
- break;
- case widget.keyCode.UP:
- i.previous();
- break;
- case widget.keyCode.DOWN:
- i.next();
- break;
- default:
- if (!widget.closed()) {
- i.close(true);
- }
- break;
- }
- }).bind('focus.timepicker', function() {
- i.open();
- }).bind('blur.timepicker', function() {
- setTimeout(function() {
- if (i.element.data('timepicker-user-clicked-outside')) {
- i.close();
- }
- });
- }).bind('change.timepicker', function() {
- if (i.closed()) {
- i.setTime($.fn.timepicker.parseTime(i.element.val()));
- }
- });
- },
-
- select: function(i, item) {
- var widget = this, instance = i === false ? widget.instance : i;
- widget.setTime(instance, $.fn.timepicker.parseTime(item.children('a').text()));
- widget.close(instance, true);
- },
-
- activate: function(i, item) {
- var widget = this, instance = i === false ? widget.instance : i;
-
- if (instance !== widget.instance) {
- return;
- } else {
- widget.deactivate();
- }
-
- if (widget._hasScroll()) {
- var offset = item.offset().top - widget.ui.offset().top,
- scroll = widget.ui.scrollTop(),
- height = widget.ui.height();
- if (offset < 0) {
- widget.ui.scrollTop(scroll + offset);
- } else if (offset >= height) {
- widget.ui.scrollTop(scroll + offset - height + item.height());
- }
- }
-
- widget.active = item.eq(0).children('a').addClass('ui-state-hover')
- .attr('id', 'ui-active-item')
- .end();
- },
-
- deactivate: function() {
- var widget = this;
- if (!widget.active) { return; }
- widget.active.children('a').removeClass('ui-state-hover').removeAttr('id');
- widget.active = null;
- },
-
- /**
- * _activate, _deactivate, first, last, next, previous, _move and
- * _hasScroll were extracted from jQuery UI Menu
- * http://github,com/jquery/jquery-ui/blob/menu/ui/jquery.ui.menu.js
- */
-
- //
- // public methods
- //
-
- next: function(i) {
- if (this.closed() || this.instance === i) {
- this._move(i, 'next', '.ui-menu-item:first');
- }
- return i.element;
- },
-
- previous: function(i) {
- if (this.closed() || this.instance === i) {
- this._move(i, 'prev', '.ui-menu-item:last');
- }
- return i.element;
- },
-
- first: function(i) {
- if (this.instance === i) {
- return this.active && this.active.prevAll('.ui-menu-item').length === 0;
- }
- return false;
- },
-
- last: function(i) {
- if (this.instance === i) {
- return this.active && this.active.nextAll('.ui-menu-item').length === 0;
- }
- return false;
- },
-
- selected: function(i) {
- if (this.instance === i) {
- return this.active ? this.active : null;
- }
- return null;
- },
-
- open: function(i) {
- var widget = this,
- selectedTime = i.getTime(),
- arrange = i.options.dynamic && selectedTime;
-
- // return if dropdown is disabled
- if (!i.options.dropdown) { return i.element; }
-
- // fix for issue https://github.com/wvega/timepicker/issues/56
- // idea from https://prototype.lighthouseapp.com/projects/8887/tickets/248-results-popup-from-ajaxautocompleter-disappear-when-user-clicks-on-scrollbars-in-ie6ie7
- i.element.data('timepicker-event-namespace', Math.random());
-
- $(document).bind('click.timepicker-' + i.element.data('timepicker-event-namespace'), function(event) {
- if (i.element.get(0) === event.target) {
- i.element.data('timepicker-user-clicked-outside', false);
- } else {
- i.element.data('timepicker-user-clicked-outside', true).blur();
- }
- });
-
- // if a date is already selected and options.dynamic is true,
- // arrange the items in the list so the first item is
- // cronologically right after the selected date.
- // TODO: set selectedTime
- if (i.rebuild || !i.items || arrange) {
- i.items = widget._items(i, arrange ? selectedTime : null);
- }
-
- // remove old li elements keeping associated events, then append
- // the new li elements to the ul
- if (i.rebuild || widget.instance !== i || arrange) {
- // handle menu events when using jQuery versions previous to
- // 1.4.2 (thanks to Brian Link)
- // http://github.com/wvega/timepicker/issues#issue/4
- if ($.fn.jquery < '1.4.2') {
- widget.viewport.children().remove();
- widget.viewport.append(i.items);
- widget.viewport.find('a').bind('mouseover.timepicker', function() {
- widget.activate(i, $(this).parent());
- }).bind('mouseout.timepicker', function() {
- widget.deactivate(i);
- }).bind('click.timepicker', function(event) {
- event.preventDefault();
- widget.select(i, $(this).parent());
- });
- } else {
- widget.viewport.children().detach();
- widget.viewport.append(i.items);
- }
- }
-
- i.rebuild = false;
-
- // theme
- widget.container.removeClass('ui-helper-hidden ui-timepicker-hidden ui-timepicker-standard ui-timepicker-corners').show();
-
- switch (i.options.theme) {
- case 'standard':
- widget.container.addClass('ui-timepicker-standard');
- break;
- case 'standard-rounded-corners':
- widget.container.addClass('ui-timepicker-standard ui-timepicker-corners');
- break;
- default:
- break;
- }
-
- /* resize ui */
-
- // we are hiding the scrollbar in the dropdown menu adding a 40px
- // padding to the wrapper element making the scrollbar appear in the
- // part of the wrapper that's hidden by the container (a DIV).
- if ( ! widget.container.hasClass( 'ui-timepicker-no-scrollbar' ) && ! i.options.scrollbar ) {
- widget.container.addClass( 'ui-timepicker-no-scrollbar' );
- widget.viewport.css( { paddingRight: 40 } );
- }
-
- var containerDecorationHeight = widget.container.outerHeight() - widget.container.height(),
- zindex = i.options.zindex ? i.options.zindex : i.element.offsetParent().css( 'z-index' ),
- elementOffset = i.element.offset();
-
- // position the container right below the element, or as close to as possible.
- widget.container.css( {
- top: elementOffset.top + i.element.outerHeight(),
- left: elementOffset.left
- } );
-
- // then show the container so that the browser can consider the timepicker's
- // height to calculate the page's total height and decide if adding scrollbars
- // is necessary.
- widget.container.show();
-
- // now we need to calculate the element offset and position the container again.
- // If the browser added scrollbars, the container's original position is not aligned
- // with the element's final position. This step fixes that problem.
- widget.container.css( {
- left: i.element.offset().left,
- height: widget.ui.outerHeight() + containerDecorationHeight,
- width: i.element.outerWidth(),
- zIndex: zindex,
- cursor: 'default'
- } );
-
- var calculatedWidth = widget.container.width() - ( widget.ui.outerWidth() - widget.ui.width() );
-
- // hardcode ui, viewport and item's width. I couldn't get it to work using CSS only
- widget.ui.css( { width: calculatedWidth } );
- widget.viewport.css( { width: calculatedWidth } );
- i.items.css( { width: calculatedWidth } );
-
- // XXX: what's this line doing here?
- widget.instance = i;
-
- // try to match input field's current value with an item in the
- // dropdown
- if (selectedTime) {
- i.items.each(function() {
- var item = $(this), time;
-
- if ($.fn.jquery < '1.4.2') {
- time = $.fn.timepicker.parseTime(item.find('a').text());
- } else {
- time = item.data('time-value');
- }
-
- if (time.getTime() === selectedTime.getTime()) {
- widget.activate(i, item);
- return false;
- }
- return true;
- });
- } else {
- widget.deactivate(i);
- }
-
- // don't break the chain
- return i.element;
- },
-
- close: function(i) {
- var widget = this;
-
- if (widget.instance === i) {
- widget.container.addClass('ui-helper-hidden ui-timepicker-hidden').hide();
- widget.ui.scrollTop(0);
- widget.ui.children().removeClass('ui-state-hover');
- }
-
- $(document).unbind('click.timepicker-' + i.element.data('timepicker-event-namespace'));
-
- return i.element;
- },
-
- closed: function() {
- return this.ui.is(':hidden');
- },
-
- destroy: function(i) {
- var widget = this;
- widget.close(i, true);
- return i.element.unbind('.timepicker').data('TimePicker', null);
- },
-
- //
-
- parse: function(i, str) {
- return $.fn.timepicker.parseTime(str);
- },
-
- format: function(i, time, format) {
- format = format || i.options.timeFormat;
- return $.fn.timepicker.formatTime(format, time);
- },
-
- getTime: function(i) {
- var widget = this,
- current = $.fn.timepicker.parseTime(i.element.val());
-
- // if current value is not valid, we return null.
- // stored Date object is ignored, because the current value
- // (valid or invalid) always takes priority
- if (current instanceof Date && !widget._isValidTime(i, current)) {
- return null;
- } else if (current instanceof Date && i.selectedTime) {
- // if the textfield's value and the stored Date object
- // have the same representation using current format
- // we prefer the stored Date object to avoid unnecesary
- // lost of precision.
- if (i.format(current) === i.format(i.selectedTime)) {
- return i.selectedTime;
- } else {
- return current;
- }
- } else if (current instanceof Date) {
- return current;
- } else {
- return null;
- }
- },
-
- setTime: function(i, time, silent) {
- var widget = this, previous = i.selectedTime;
-
- if (typeof time === 'string') {
- time = i.parse(time);
- }
-
- if (time && time.getMinutes && widget._isValidTime(i, time)) {
- time = normalize(time);
- i.selectedTime = time;
- i.element.val(i.format(time, i.options.timeFormat));
-
- // TODO: add documentaion about setTime being chainable
- if (silent) { return i; }
- } else {
- i.selectedTime = null;
- }
-
- // custom change event and change callback
- // TODO: add documentation about this event
- if (previous !== null || i.selectedTime !== null) {
- i.element.trigger('time-change', [time]);
- if ($.isFunction(i.options.change)) {
- i.options.change.apply(i.element, [time]);
- }
- }
-
- return i.element;
- },
-
- option: function(i, name, value) {
- if (typeof value === 'undefined') {
- return i.options[name];
- }
-
- var time = i.getTime(),
- options, destructive;
-
- if (typeof name === 'string') {
- options = {};
- options[name] = value;
- } else {
- options = name;
- }
-
- // some options require rebuilding the dropdown items
- destructive = ['minHour', 'minMinutes', 'minTime',
- 'maxHour', 'maxMinutes', 'maxTime',
- 'startHour', 'startMinutes', 'startTime',
- 'timeFormat', 'interval', 'dropdown'];
-
-
- $.each(options, function(name) {
- i.options[name] = options[name];
- i.rebuild = i.rebuild || $.inArray(name, destructive) > -1;
- });
-
- if (i.rebuild) {
- i.setTime(time);
- }
- }
- };
-
- $.TimePicker.defaults = {
- timeFormat: 'hh:mm p',
- minHour: null,
- minMinutes: null,
- minTime: null,
- maxHour: null,
- maxMinutes: null,
- maxTime: null,
- startHour: null,
- startMinutes: null,
- startTime: null,
- interval: 30,
- dynamic: true,
- theme: 'standard',
- zindex: null,
- dropdown: true,
- scrollbar: false,
- // callbacks
- change: function(/*time*/) {}
- };
-
- $.TimePicker.methods = {
- chainable: [
- 'next',
- 'previous',
- 'open',
- 'close',
- 'destroy',
- 'setTime'
- ]
- };
-
- $.fn.timepicker = function(options) {
- // support calling API methods using the following syntax:
- // $(...).timepicker('parse', '11p');
- if (typeof options === 'string') {
- var args = Array.prototype.slice.call(arguments, 1),
- method, result;
-
- // chainable API methods
- if (options === 'option' && arguments.length > 2) {
- method = 'each';
- } else if ($.inArray(options, $.TimePicker.methods.chainable) !== -1) {
- method = 'each';
- // API methods that return a value
- } else {
- method = 'map';
- }
-
- result = this[method](function() {
- var element = $(this), i = element.data('TimePicker');
- if (typeof i === 'object') {
- return i[options].apply(i, args);
- }
- });
-
- if (method === 'map' && this.length === 1) {
- return $.makeArray(result).shift();
- } else if (method === 'map') {
- return $.makeArray(result);
- } else {
- return result;
- }
- }
-
- // calling the constructor again on a jQuery object with a single
- // element returns a reference to a TimePicker object.
- if (this.length === 1 && this.data('TimePicker')) {
- return this.data('TimePicker');
- }
-
- var globals = $.extend({}, $.TimePicker.defaults, options);
-
- return this.each(function() {
- $.TimePicker.instance().register(this, globals);
- });
- };
-
- /**
- * TODO: documentation
- */
- $.fn.timepicker.formatTime = function(format, time) {
- var hours = time.getHours(),
- hours12 = hours % 12,
- minutes = time.getMinutes(),
- seconds = time.getSeconds(),
- replacements = {
- hh: pad((hours12 === 0 ? 12 : hours12).toString(), '0', 2),
- HH: pad(hours.toString(), '0', 2),
- mm: pad(minutes.toString(), '0', 2),
- ss: pad(seconds.toString(), '0', 2),
- h: (hours12 === 0 ? 12 : hours12),
- H: hours,
- m: minutes,
- s: seconds,
- p: hours > 11 ? 'PM' : 'AM'
- },
- str = format, k = '';
- for (k in replacements) {
- if (replacements.hasOwnProperty(k)) {
- str = str.replace(new RegExp(k,'g'), replacements[k]);
- }
- }
- // replacements is not guaranteed to be order and the 'p' can cause problems
- str = str.replace(new RegExp('a','g'), hours > 11 ? 'pm' : 'am');
- return str;
- };
-
- /**
- * Convert a string representing a given time into a Date object.
- *
- * The Date object will have attributes others than hours, minutes and
- * seconds set to current local time values. The function will return
- * false if given string can't be converted.
- *
- * If there is an 'a' in the string we set am to true, if there is a 'p'
- * we set pm to true, if both are present only am is setted to true.
- *
- * All non-digit characters are removed from the string before trying to
- * parse the time.
- *
- * '' can't be converted and the function returns false.
- * '1' is converted to 01:00:00 am
- * '11' is converted to 11:00:00 am
- * '111' is converted to 01:11:00 am
- * '1111' is converted to 11:11:00 am
- * '11111' is converted to 01:11:11 am
- * '111111' is converted to 11:11:11 am
- *
- * Only the first six (or less) characters are considered.
- *
- * Special case:
- *
- * When hours is greater than 24 and the last digit is less or equal than 6, and minutes
- * and seconds are less or equal than 60, we append a trailing zero and
- * start parsing process again. Examples:
- *
- * '95' is treated as '950' and converted to 09:50:00 am
- * '46' is treated as '460' and converted to 05:00:00 am
- * '57' can't be converted and the function returns false.
- *
- * For a detailed list of supported formats check the unit tests at
- * http://github.com/wvega/timepicker/tree/master/tests/
- */
- $.fn.timepicker.parseTime = (function() {
- var patterns = [
- // 1, 12, 123, 1234, 12345, 123456
- [/^(\d+)$/, '$1'],
- // :1, :2, :3, :4 ... :9
- [/^:(\d)$/, '$10'],
- // :1, :12, :123, :1234 ...
- [/^:(\d+)/, '$1'],
- // 6:06, 5:59, 5:8
- [/^(\d):([7-9])$/, '0$10$2'],
- [/^(\d):(\d\d)$/, '$1$2'],
- [/^(\d):(\d{1,})$/, '0$1$20'],
- // 10:8, 10:10, 10:34
- [/^(\d\d):([7-9])$/, '$10$2'],
- [/^(\d\d):(\d)$/, '$1$20'],
- [/^(\d\d):(\d*)$/, '$1$2'],
- // 123:4, 1234:456
- [/^(\d{3,}):(\d)$/, '$10$2'],
- [/^(\d{3,}):(\d{2,})/, '$1$2'],
- //
- [/^(\d):(\d):(\d)$/, '0$10$20$3'],
- [/^(\d{1,2}):(\d):(\d\d)/, '$10$2$3']
- ],
- length = patterns.length;
-
- return function(str) {
- var time = normalize(new Date()),
- am = false, pm = false, h = false, m = false, s = false;
-
- if (typeof str === 'undefined' || !str.toLowerCase) { return null; }
-
- str = str.toLowerCase();
- am = /a/.test(str);
- pm = am ? false : /p/.test(str);
- str = str.replace(/[^0-9:]/g, '').replace(/:+/g, ':');
-
- for (var k = 0; k < length; k = k + 1) {
- if (patterns[k][0].test(str)) {
- str = str.replace(patterns[k][0], patterns[k][1]);
- break;
- }
- }
- str = str.replace(/:/g, '');
-
- if (str.length === 1) {
- h = str;
- } else if (str.length === 2) {
- h = str;
- } else if (str.length === 3 || str.length === 5) {
- h = str.substr(0, 1);
- m = str.substr(1, 2);
- s = str.substr(3, 2);
- } else if (str.length === 4 || str.length > 5) {
- h = str.substr(0, 2);
- m = str.substr(2, 2);
- s = str.substr(4, 2);
- }
-
- if (str.length > 0 && str.length < 5) {
- if (str.length < 3) {
- m = 0;
- }
- s = 0;
- }
-
- if (h === false || m === false || s === false) {
- return false;
- }
-
- h = parseInt(h, 10);
- m = parseInt(m, 10);
- s = parseInt(s, 10);
-
- if (am && h === 12) {
- h = 0;
- } else if (pm && h < 12) {
- h = h + 12;
- }
-
- if (h > 24) {
- if (str.length >= 6) {
- return $.fn.timepicker.parseTime(str.substr(0,5));
- } else {
- return $.fn.timepicker.parseTime(str + '0' + (am ? 'a' : '') + (pm ? 'p' : ''));
- }
- } else {
- time.setHours(h, m, s);
- return time;
- }
- };
- })();
- })();
-}));
-
-//! moment.js
-
-;(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- global.moment = factory()
-}(this, (function () { 'use strict';
-
- var hookCallback;
-
- function hooks () {
- return hookCallback.apply(null, arguments);
- }
-
- // This is done to register the method called with moment()
- // without creating circular dependencies.
- function setHookCallback (callback) {
- hookCallback = callback;
- }
-
- function isArray(input) {
- return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
- }
-
- function isObject(input) {
- // IE8 will treat undefined and null as object if it wasn't for
- // input != null
- return input != null && Object.prototype.toString.call(input) === '[object Object]';
- }
-
- function isObjectEmpty(obj) {
- if (Object.getOwnPropertyNames) {
- return (Object.getOwnPropertyNames(obj).length === 0);
- } else {
- var k;
- for (k in obj) {
- if (obj.hasOwnProperty(k)) {
- return false;
- }
- }
- return true;
- }
- }
-
- function isUndefined(input) {
- return input === void 0;
- }
-
- function isNumber(input) {
- return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
- }
-
- function isDate(input) {
- return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
- }
-
- function map(arr, fn) {
- var res = [], i;
- for (i = 0; i < arr.length; ++i) {
- res.push(fn(arr[i], i));
- }
- return res;
- }
-
- function hasOwnProp(a, b) {
- return Object.prototype.hasOwnProperty.call(a, b);
- }
-
- function extend(a, b) {
- for (var i in b) {
- if (hasOwnProp(b, i)) {
- a[i] = b[i];
- }
- }
-
- if (hasOwnProp(b, 'toString')) {
- a.toString = b.toString;
- }
-
- if (hasOwnProp(b, 'valueOf')) {
- a.valueOf = b.valueOf;
- }
-
- return a;
- }
-
- function createUTC (input, format, locale, strict) {
- return createLocalOrUTC(input, format, locale, strict, true).utc();
- }
-
- function defaultParsingFlags() {
- // We need to deep clone this object.
- return {
- empty : false,
- unusedTokens : [],
- unusedInput : [],
- overflow : -2,
- charsLeftOver : 0,
- nullInput : false,
- invalidMonth : null,
- invalidFormat : false,
- userInvalidated : false,
- iso : false,
- parsedDateParts : [],
- meridiem : null,
- rfc2822 : false,
- weekdayMismatch : false
- };
- }
-
- function getParsingFlags(m) {
- if (m._pf == null) {
- m._pf = defaultParsingFlags();
- }
- return m._pf;
- }
-
- var some;
- if (Array.prototype.some) {
- some = Array.prototype.some;
- } else {
- some = function (fun) {
- var t = Object(this);
- var len = t.length >>> 0;
-
- for (var i = 0; i < len; i++) {
- if (i in t && fun.call(this, t[i], i, t)) {
- return true;
- }
- }
-
- return false;
- };
- }
-
- function isValid(m) {
- if (m._isValid == null) {
- var flags = getParsingFlags(m);
- var parsedParts = some.call(flags.parsedDateParts, function (i) {
- return i != null;
- });
- var isNowValid = !isNaN(m._d.getTime()) &&
- flags.overflow < 0 &&
- !flags.empty &&
- !flags.invalidMonth &&
- !flags.invalidWeekday &&
- !flags.weekdayMismatch &&
- !flags.nullInput &&
- !flags.invalidFormat &&
- !flags.userInvalidated &&
- (!flags.meridiem || (flags.meridiem && parsedParts));
-
- if (m._strict) {
- isNowValid = isNowValid &&
- flags.charsLeftOver === 0 &&
- flags.unusedTokens.length === 0 &&
- flags.bigHour === undefined;
- }
-
- if (Object.isFrozen == null || !Object.isFrozen(m)) {
- m._isValid = isNowValid;
- }
- else {
- return isNowValid;
- }
- }
- return m._isValid;
- }
-
- function createInvalid (flags) {
- var m = createUTC(NaN);
- if (flags != null) {
- extend(getParsingFlags(m), flags);
- }
- else {
- getParsingFlags(m).userInvalidated = true;
- }
-
- return m;
- }
-
- // Plugins that add properties should also add the key here (null value),
- // so we can properly clone ourselves.
- var momentProperties = hooks.momentProperties = [];
-
- function copyConfig(to, from) {
- var i, prop, val;
-
- if (!isUndefined(from._isAMomentObject)) {
- to._isAMomentObject = from._isAMomentObject;
- }
- if (!isUndefined(from._i)) {
- to._i = from._i;
- }
- if (!isUndefined(from._f)) {
- to._f = from._f;
- }
- if (!isUndefined(from._l)) {
- to._l = from._l;
- }
- if (!isUndefined(from._strict)) {
- to._strict = from._strict;
- }
- if (!isUndefined(from._tzm)) {
- to._tzm = from._tzm;
- }
- if (!isUndefined(from._isUTC)) {
- to._isUTC = from._isUTC;
- }
- if (!isUndefined(from._offset)) {
- to._offset = from._offset;
- }
- if (!isUndefined(from._pf)) {
- to._pf = getParsingFlags(from);
- }
- if (!isUndefined(from._locale)) {
- to._locale = from._locale;
- }
-
- if (momentProperties.length > 0) {
- for (i = 0; i < momentProperties.length; i++) {
- prop = momentProperties[i];
- val = from[prop];
- if (!isUndefined(val)) {
- to[prop] = val;
- }
- }
- }
-
- return to;
- }
-
- var updateInProgress = false;
-
- // Moment prototype object
- function Moment(config) {
- copyConfig(this, config);
- this._d = new Date(config._d != null ? config._d.getTime() : NaN);
- if (!this.isValid()) {
- this._d = new Date(NaN);
- }
- // Prevent infinite loop in case updateOffset creates new moment
- // objects.
- if (updateInProgress === false) {
- updateInProgress = true;
- hooks.updateOffset(this);
- updateInProgress = false;
- }
- }
-
- function isMoment (obj) {
- return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
- }
-
- function absFloor (number) {
- if (number < 0) {
- // -0 -> 0
- return Math.ceil(number) || 0;
- } else {
- return Math.floor(number);
- }
- }
-
- function toInt(argumentForCoercion) {
- var coercedNumber = +argumentForCoercion,
- value = 0;
-
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
- value = absFloor(coercedNumber);
- }
-
- return value;
- }
-
- // compare two arrays, return the number of differences
- function compareArrays(array1, array2, dontConvert) {
- var len = Math.min(array1.length, array2.length),
- lengthDiff = Math.abs(array1.length - array2.length),
- diffs = 0,
- i;
- for (i = 0; i < len; i++) {
- if ((dontConvert && array1[i] !== array2[i]) ||
- (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
- diffs++;
- }
- }
- return diffs + lengthDiff;
- }
-
- function warn(msg) {
- if (hooks.suppressDeprecationWarnings === false &&
- (typeof console !== 'undefined') && console.warn) {
- console.warn('Deprecation warning: ' + msg);
- }
- }
-
- function deprecate(msg, fn) {
- var firstTime = true;
-
- return extend(function () {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(null, msg);
- }
- if (firstTime) {
- var args = [];
- var arg;
- for (var i = 0; i < arguments.length; i++) {
- arg = '';
- if (typeof arguments[i] === 'object') {
- arg += '\n[' + i + '] ';
- for (var key in arguments[0]) {
- arg += key + ': ' + arguments[0][key] + ', ';
- }
- arg = arg.slice(0, -2); // Remove trailing comma and space
- } else {
- arg = arguments[i];
- }
- args.push(arg);
- }
- warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
- firstTime = false;
- }
- return fn.apply(this, arguments);
- }, fn);
- }
-
- var deprecations = {};
-
- function deprecateSimple(name, msg) {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(name, msg);
- }
- if (!deprecations[name]) {
- warn(msg);
- deprecations[name] = true;
- }
- }
-
- hooks.suppressDeprecationWarnings = false;
- hooks.deprecationHandler = null;
-
- function isFunction(input) {
- return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
- }
-
- function set (config) {
- var prop, i;
- for (i in config) {
- prop = config[i];
- if (isFunction(prop)) {
- this[i] = prop;
- } else {
- this['_' + i] = prop;
- }
- }
- this._config = config;
- // Lenient ordinal parsing accepts just a number in addition to
- // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
- // TODO: Remove "ordinalParse" fallback in next major release.
- this._dayOfMonthOrdinalParseLenient = new RegExp(
- (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
- '|' + (/\d{1,2}/).source);
- }
-
- function mergeConfigs(parentConfig, childConfig) {
- var res = extend({}, parentConfig), prop;
- for (prop in childConfig) {
- if (hasOwnProp(childConfig, prop)) {
- if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
- res[prop] = {};
- extend(res[prop], parentConfig[prop]);
- extend(res[prop], childConfig[prop]);
- } else if (childConfig[prop] != null) {
- res[prop] = childConfig[prop];
- } else {
- delete res[prop];
- }
- }
- }
- for (prop in parentConfig) {
- if (hasOwnProp(parentConfig, prop) &&
- !hasOwnProp(childConfig, prop) &&
- isObject(parentConfig[prop])) {
- // make sure changes to properties don't modify parent config
- res[prop] = extend({}, res[prop]);
- }
- }
- return res;
- }
-
- function Locale(config) {
- if (config != null) {
- this.set(config);
- }
- }
-
- var keys;
-
- if (Object.keys) {
- keys = Object.keys;
- } else {
- keys = function (obj) {
- var i, res = [];
- for (i in obj) {
- if (hasOwnProp(obj, i)) {
- res.push(i);
- }
- }
- return res;
- };
- }
-
- var defaultCalendar = {
- sameDay : '[Today at] LT',
- nextDay : '[Tomorrow at] LT',
- nextWeek : 'dddd [at] LT',
- lastDay : '[Yesterday at] LT',
- lastWeek : '[Last] dddd [at] LT',
- sameElse : 'L'
- };
-
- function calendar (key, mom, now) {
- var output = this._calendar[key] || this._calendar['sameElse'];
- return isFunction(output) ? output.call(mom, now) : output;
- }
-
- var defaultLongDateFormat = {
- LTS : 'h:mm:ss A',
- LT : 'h:mm A',
- L : 'MM/DD/YYYY',
- LL : 'MMMM D, YYYY',
- LLL : 'MMMM D, YYYY h:mm A',
- LLLL : 'dddd, MMMM D, YYYY h:mm A'
- };
-
- function longDateFormat (key) {
- var format = this._longDateFormat[key],
- formatUpper = this._longDateFormat[key.toUpperCase()];
-
- if (format || !formatUpper) {
- return format;
- }
-
- this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
- return val.slice(1);
- });
-
- return this._longDateFormat[key];
- }
-
- var defaultInvalidDate = 'Invalid date';
-
- function invalidDate () {
- return this._invalidDate;
- }
-
- var defaultOrdinal = '%d';
- var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
-
- function ordinal (number) {
- return this._ordinal.replace('%d', number);
- }
-
- var defaultRelativeTime = {
- future : 'in %s',
- past : '%s ago',
- s : 'a few seconds',
- ss : '%d seconds',
- m : 'a minute',
- mm : '%d minutes',
- h : 'an hour',
- hh : '%d hours',
- d : 'a day',
- dd : '%d days',
- M : 'a month',
- MM : '%d months',
- y : 'a year',
- yy : '%d years'
- };
-
- function relativeTime (number, withoutSuffix, string, isFuture) {
- var output = this._relativeTime[string];
- return (isFunction(output)) ?
- output(number, withoutSuffix, string, isFuture) :
- output.replace(/%d/i, number);
- }
-
- function pastFuture (diff, output) {
- var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
- return isFunction(format) ? format(output) : format.replace(/%s/i, output);
- }
-
- var aliases = {};
-
- function addUnitAlias (unit, shorthand) {
- var lowerCase = unit.toLowerCase();
- aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
- }
-
- function normalizeUnits(units) {
- return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
- }
-
- function normalizeObjectUnits(inputObject) {
- var normalizedInput = {},
- normalizedProp,
- prop;
-
- for (prop in inputObject) {
- if (hasOwnProp(inputObject, prop)) {
- normalizedProp = normalizeUnits(prop);
- if (normalizedProp) {
- normalizedInput[normalizedProp] = inputObject[prop];
- }
- }
- }
-
- return normalizedInput;
- }
-
- var priorities = {};
-
- function addUnitPriority(unit, priority) {
- priorities[unit] = priority;
- }
-
- function getPrioritizedUnits(unitsObj) {
- var units = [];
- for (var u in unitsObj) {
- units.push({unit: u, priority: priorities[u]});
- }
- units.sort(function (a, b) {
- return a.priority - b.priority;
- });
- return units;
- }
-
- function zeroFill(number, targetLength, forceSign) {
- var absNumber = '' + Math.abs(number),
- zerosToFill = targetLength - absNumber.length,
- sign = number >= 0;
- return (sign ? (forceSign ? '+' : '') : '-') +
- Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
- }
-
- var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
-
- var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
-
- var formatFunctions = {};
-
- var formatTokenFunctions = {};
-
- // token: 'M'
- // padded: ['MM', 2]
- // ordinal: 'Mo'
- // callback: function () { this.month() + 1 }
- function addFormatToken (token, padded, ordinal, callback) {
- var func = callback;
- if (typeof callback === 'string') {
- func = function () {
- return this[callback]();
- };
- }
- if (token) {
- formatTokenFunctions[token] = func;
- }
- if (padded) {
- formatTokenFunctions[padded[0]] = function () {
- return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
- };
- }
- if (ordinal) {
- formatTokenFunctions[ordinal] = function () {
- return this.localeData().ordinal(func.apply(this, arguments), token);
- };
- }
- }
-
- function removeFormattingTokens(input) {
- if (input.match(/\[[\s\S]/)) {
- return input.replace(/^\[|\]$/g, '');
- }
- return input.replace(/\\/g, '');
- }
-
- function makeFormatFunction(format) {
- var array = format.match(formattingTokens), i, length;
-
- for (i = 0, length = array.length; i < length; i++) {
- if (formatTokenFunctions[array[i]]) {
- array[i] = formatTokenFunctions[array[i]];
- } else {
- array[i] = removeFormattingTokens(array[i]);
- }
- }
-
- return function (mom) {
- var output = '', i;
- for (i = 0; i < length; i++) {
- output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
- }
- return output;
- };
- }
-
- // format date using native date object
- function formatMoment(m, format) {
- if (!m.isValid()) {
- return m.localeData().invalidDate();
- }
-
- format = expandFormat(format, m.localeData());
- formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
-
- return formatFunctions[format](m);
- }
-
- function expandFormat(format, locale) {
- var i = 5;
-
- function replaceLongDateFormatTokens(input) {
- return locale.longDateFormat(input) || input;
- }
-
- localFormattingTokens.lastIndex = 0;
- while (i >= 0 && localFormattingTokens.test(format)) {
- format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
- localFormattingTokens.lastIndex = 0;
- i -= 1;
- }
-
- return format;
- }
-
- var match1 = /\d/; // 0 - 9
- var match2 = /\d\d/; // 00 - 99
- var match3 = /\d{3}/; // 000 - 999
- var match4 = /\d{4}/; // 0000 - 9999
- var match6 = /[+-]?\d{6}/; // -999999 - 999999
- var match1to2 = /\d\d?/; // 0 - 99
- var match3to4 = /\d\d\d\d?/; // 999 - 9999
- var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
- var match1to3 = /\d{1,3}/; // 0 - 999
- var match1to4 = /\d{1,4}/; // 0 - 9999
- var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
-
- var matchUnsigned = /\d+/; // 0 - inf
- var matchSigned = /[+-]?\d+/; // -inf - inf
-
- var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
- var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
-
- var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
-
- // any word (or two) characters or numbers including two/three word month in arabic.
- // includes scottish gaelic two word and hyphenated months
- var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
-
- var regexes = {};
-
- function addRegexToken (token, regex, strictRegex) {
- regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
- return (isStrict && strictRegex) ? strictRegex : regex;
- };
- }
-
- function getParseRegexForToken (token, config) {
- if (!hasOwnProp(regexes, token)) {
- return new RegExp(unescapeFormat(token));
- }
-
- return regexes[token](config._strict, config._locale);
- }
-
- // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
- function unescapeFormat(s) {
- return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
- return p1 || p2 || p3 || p4;
- }));
- }
-
- function regexEscape(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
- }
-
- var tokens = {};
-
- function addParseToken (token, callback) {
- var i, func = callback;
- if (typeof token === 'string') {
- token = [token];
- }
- if (isNumber(callback)) {
- func = function (input, array) {
- array[callback] = toInt(input);
- };
- }
- for (i = 0; i < token.length; i++) {
- tokens[token[i]] = func;
- }
- }
-
- function addWeekParseToken (token, callback) {
- addParseToken(token, function (input, array, config, token) {
- config._w = config._w || {};
- callback(input, config._w, config, token);
- });
- }
-
- function addTimeToArrayFromToken(token, input, config) {
- if (input != null && hasOwnProp(tokens, token)) {
- tokens[token](input, config._a, config, token);
- }
- }
-
- var YEAR = 0;
- var MONTH = 1;
- var DATE = 2;
- var HOUR = 3;
- var MINUTE = 4;
- var SECOND = 5;
- var MILLISECOND = 6;
- var WEEK = 7;
- var WEEKDAY = 8;
-
- // FORMATTING
-
- addFormatToken('Y', 0, 0, function () {
- var y = this.year();
- return y <= 9999 ? '' + y : '+' + y;
- });
-
- addFormatToken(0, ['YY', 2], 0, function () {
- return this.year() % 100;
- });
-
- addFormatToken(0, ['YYYY', 4], 0, 'year');
- addFormatToken(0, ['YYYYY', 5], 0, 'year');
- addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
-
- // ALIASES
-
- addUnitAlias('year', 'y');
-
- // PRIORITIES
-
- addUnitPriority('year', 1);
-
- // PARSING
-
- addRegexToken('Y', matchSigned);
- addRegexToken('YY', match1to2, match2);
- addRegexToken('YYYY', match1to4, match4);
- addRegexToken('YYYYY', match1to6, match6);
- addRegexToken('YYYYYY', match1to6, match6);
-
- addParseToken(['YYYYY', 'YYYYYY'], YEAR);
- addParseToken('YYYY', function (input, array) {
- array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
- });
- addParseToken('YY', function (input, array) {
- array[YEAR] = hooks.parseTwoDigitYear(input);
- });
- addParseToken('Y', function (input, array) {
- array[YEAR] = parseInt(input, 10);
- });
-
- // HELPERS
-
- function daysInYear(year) {
- return isLeapYear(year) ? 366 : 365;
- }
-
- function isLeapYear(year) {
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
- }
-
- // HOOKS
-
- hooks.parseTwoDigitYear = function (input) {
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
- };
-
- // MOMENTS
-
- var getSetYear = makeGetSet('FullYear', true);
-
- function getIsLeapYear () {
- return isLeapYear(this.year());
- }
-
- function makeGetSet (unit, keepTime) {
- return function (value) {
- if (value != null) {
- set$1(this, unit, value);
- hooks.updateOffset(this, keepTime);
- return this;
- } else {
- return get(this, unit);
- }
- };
- }
-
- function get (mom, unit) {
- return mom.isValid() ?
- mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
- }
-
- function set$1 (mom, unit, value) {
- if (mom.isValid() && !isNaN(value)) {
- if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
- }
- else {
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
- }
- }
- }
-
- // MOMENTS
-
- function stringGet (units) {
- units = normalizeUnits(units);
- if (isFunction(this[units])) {
- return this[units]();
- }
- return this;
- }
-
-
- function stringSet (units, value) {
- if (typeof units === 'object') {
- units = normalizeObjectUnits(units);
- var prioritized = getPrioritizedUnits(units);
- for (var i = 0; i < prioritized.length; i++) {
- this[prioritized[i].unit](units[prioritized[i].unit]);
- }
- } else {
- units = normalizeUnits(units);
- if (isFunction(this[units])) {
- return this[units](value);
- }
- }
- return this;
- }
-
- function mod(n, x) {
- return ((n % x) + x) % x;
- }
-
- var indexOf;
-
- if (Array.prototype.indexOf) {
- indexOf = Array.prototype.indexOf;
- } else {
- indexOf = function (o) {
- // I know
- var i;
- for (i = 0; i < this.length; ++i) {
- if (this[i] === o) {
- return i;
- }
- }
- return -1;
- };
- }
-
- function daysInMonth(year, month) {
- if (isNaN(year) || isNaN(month)) {
- return NaN;
- }
- var modMonth = mod(month, 12);
- year += (month - modMonth) / 12;
- return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);
- }
-
- // FORMATTING
-
- addFormatToken('M', ['MM', 2], 'Mo', function () {
- return this.month() + 1;
- });
-
- addFormatToken('MMM', 0, 0, function (format) {
- return this.localeData().monthsShort(this, format);
- });
-
- addFormatToken('MMMM', 0, 0, function (format) {
- return this.localeData().months(this, format);
- });
-
- // ALIASES
-
- addUnitAlias('month', 'M');
-
- // PRIORITY
-
- addUnitPriority('month', 8);
-
- // PARSING
-
- addRegexToken('M', match1to2);
- addRegexToken('MM', match1to2, match2);
- addRegexToken('MMM', function (isStrict, locale) {
- return locale.monthsShortRegex(isStrict);
- });
- addRegexToken('MMMM', function (isStrict, locale) {
- return locale.monthsRegex(isStrict);
- });
-
- addParseToken(['M', 'MM'], function (input, array) {
- array[MONTH] = toInt(input) - 1;
- });
-
- addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
- var month = config._locale.monthsParse(input, token, config._strict);
- // if we didn't find a month name, mark the date as invalid.
- if (month != null) {
- array[MONTH] = month;
- } else {
- getParsingFlags(config).invalidMonth = input;
- }
- });
-
- // LOCALES
-
- var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
- var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
- function localeMonths (m, format) {
- if (!m) {
- return isArray(this._months) ? this._months :
- this._months['standalone'];
- }
- return isArray(this._months) ? this._months[m.month()] :
- this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
- }
-
- var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
- function localeMonthsShort (m, format) {
- if (!m) {
- return isArray(this._monthsShort) ? this._monthsShort :
- this._monthsShort['standalone'];
- }
- return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
- this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
- }
-
- function handleStrictParse(monthName, format, strict) {
- var i, ii, mom, llc = monthName.toLocaleLowerCase();
- if (!this._monthsParse) {
- // this is not used
- this._monthsParse = [];
- this._longMonthsParse = [];
- this._shortMonthsParse = [];
- for (i = 0; i < 12; ++i) {
- mom = createUTC([2000, i]);
- this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
- this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
- }
- }
-
- if (strict) {
- if (format === 'MMM') {
- ii = indexOf.call(this._shortMonthsParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._longMonthsParse, llc);
- return ii !== -1 ? ii : null;
- }
- } else {
- if (format === 'MMM') {
- ii = indexOf.call(this._shortMonthsParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._longMonthsParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._longMonthsParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._shortMonthsParse, llc);
- return ii !== -1 ? ii : null;
- }
- }
- }
-
- function localeMonthsParse (monthName, format, strict) {
- var i, mom, regex;
-
- if (this._monthsParseExact) {
- return handleStrictParse.call(this, monthName, format, strict);
- }
-
- if (!this._monthsParse) {
- this._monthsParse = [];
- this._longMonthsParse = [];
- this._shortMonthsParse = [];
- }
-
- // TODO: add sorting
- // Sorting makes sure if one month (or abbr) is a prefix of another
- // see sorting in computeMonthsParse
- for (i = 0; i < 12; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, i]);
- if (strict && !this._longMonthsParse[i]) {
- this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
- this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
- }
- if (!strict && !this._monthsParse[i]) {
- regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
- this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
- }
- // test the regex
- if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
- return i;
- } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
- return i;
- } else if (!strict && this._monthsParse[i].test(monthName)) {
- return i;
- }
- }
- }
-
- // MOMENTS
-
- function setMonth (mom, value) {
- var dayOfMonth;
-
- if (!mom.isValid()) {
- // No op
- return mom;
- }
-
- if (typeof value === 'string') {
- if (/^\d+$/.test(value)) {
- value = toInt(value);
- } else {
- value = mom.localeData().monthsParse(value);
- // TODO: Another silent failure?
- if (!isNumber(value)) {
- return mom;
- }
- }
- }
-
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
- return mom;
- }
-
- function getSetMonth (value) {
- if (value != null) {
- setMonth(this, value);
- hooks.updateOffset(this, true);
- return this;
- } else {
- return get(this, 'Month');
- }
- }
-
- function getDaysInMonth () {
- return daysInMonth(this.year(), this.month());
- }
-
- var defaultMonthsShortRegex = matchWord;
- function monthsShortRegex (isStrict) {
- if (this._monthsParseExact) {
- if (!hasOwnProp(this, '_monthsRegex')) {
- computeMonthsParse.call(this);
- }
- if (isStrict) {
- return this._monthsShortStrictRegex;
- } else {
- return this._monthsShortRegex;
- }
- } else {
- if (!hasOwnProp(this, '_monthsShortRegex')) {
- this._monthsShortRegex = defaultMonthsShortRegex;
- }
- return this._monthsShortStrictRegex && isStrict ?
- this._monthsShortStrictRegex : this._monthsShortRegex;
- }
- }
-
- var defaultMonthsRegex = matchWord;
- function monthsRegex (isStrict) {
- if (this._monthsParseExact) {
- if (!hasOwnProp(this, '_monthsRegex')) {
- computeMonthsParse.call(this);
- }
- if (isStrict) {
- return this._monthsStrictRegex;
- } else {
- return this._monthsRegex;
- }
- } else {
- if (!hasOwnProp(this, '_monthsRegex')) {
- this._monthsRegex = defaultMonthsRegex;
- }
- return this._monthsStrictRegex && isStrict ?
- this._monthsStrictRegex : this._monthsRegex;
- }
- }
-
- function computeMonthsParse () {
- function cmpLenRev(a, b) {
- return b.length - a.length;
- }
-
- var shortPieces = [], longPieces = [], mixedPieces = [],
- i, mom;
- for (i = 0; i < 12; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, i]);
- shortPieces.push(this.monthsShort(mom, ''));
- longPieces.push(this.months(mom, ''));
- mixedPieces.push(this.months(mom, ''));
- mixedPieces.push(this.monthsShort(mom, ''));
- }
- // Sorting makes sure if one month (or abbr) is a prefix of another it
- // will match the longer piece.
- shortPieces.sort(cmpLenRev);
- longPieces.sort(cmpLenRev);
- mixedPieces.sort(cmpLenRev);
- for (i = 0; i < 12; i++) {
- shortPieces[i] = regexEscape(shortPieces[i]);
- longPieces[i] = regexEscape(longPieces[i]);
- }
- for (i = 0; i < 24; i++) {
- mixedPieces[i] = regexEscape(mixedPieces[i]);
- }
-
- this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
- this._monthsShortRegex = this._monthsRegex;
- this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
- this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
- }
-
- function createDate (y, m, d, h, M, s, ms) {
- // can't just apply() to create a date:
- // https://stackoverflow.com/q/181348
- var date;
- // the date constructor remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- // preserve leap years using a full 400 year cycle, then reset
- date = new Date(y + 400, m, d, h, M, s, ms);
- if (isFinite(date.getFullYear())) {
- date.setFullYear(y);
- }
- } else {
- date = new Date(y, m, d, h, M, s, ms);
- }
-
- return date;
- }
-
- function createUTCDate (y) {
- var date;
- // the Date.UTC function remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- var args = Array.prototype.slice.call(arguments);
- // preserve leap years using a full 400 year cycle, then reset
- args[0] = y + 400;
- date = new Date(Date.UTC.apply(null, args));
- if (isFinite(date.getUTCFullYear())) {
- date.setUTCFullYear(y);
- }
- } else {
- date = new Date(Date.UTC.apply(null, arguments));
- }
-
- return date;
- }
-
- // start-of-first-week - start-of-year
- function firstWeekOffset(year, dow, doy) {
- var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
- fwd = 7 + dow - doy,
- // first-week day local weekday -- which local weekday is fwd
- fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
-
- return -fwdlw + fwd - 1;
- }
-
- // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
- function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
- var localWeekday = (7 + weekday - dow) % 7,
- weekOffset = firstWeekOffset(year, dow, doy),
- dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
- resYear, resDayOfYear;
-
- if (dayOfYear <= 0) {
- resYear = year - 1;
- resDayOfYear = daysInYear(resYear) + dayOfYear;
- } else if (dayOfYear > daysInYear(year)) {
- resYear = year + 1;
- resDayOfYear = dayOfYear - daysInYear(year);
- } else {
- resYear = year;
- resDayOfYear = dayOfYear;
- }
-
- return {
- year: resYear,
- dayOfYear: resDayOfYear
- };
- }
-
- function weekOfYear(mom, dow, doy) {
- var weekOffset = firstWeekOffset(mom.year(), dow, doy),
- week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
- resWeek, resYear;
-
- if (week < 1) {
- resYear = mom.year() - 1;
- resWeek = week + weeksInYear(resYear, dow, doy);
- } else if (week > weeksInYear(mom.year(), dow, doy)) {
- resWeek = week - weeksInYear(mom.year(), dow, doy);
- resYear = mom.year() + 1;
- } else {
- resYear = mom.year();
- resWeek = week;
- }
-
- return {
- week: resWeek,
- year: resYear
- };
- }
-
- function weeksInYear(year, dow, doy) {
- var weekOffset = firstWeekOffset(year, dow, doy),
- weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
- return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
- }
-
- // FORMATTING
-
- addFormatToken('w', ['ww', 2], 'wo', 'week');
- addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
-
- // ALIASES
-
- addUnitAlias('week', 'w');
- addUnitAlias('isoWeek', 'W');
-
- // PRIORITIES
-
- addUnitPriority('week', 5);
- addUnitPriority('isoWeek', 5);
-
- // PARSING
-
- addRegexToken('w', match1to2);
- addRegexToken('ww', match1to2, match2);
- addRegexToken('W', match1to2);
- addRegexToken('WW', match1to2, match2);
-
- addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
- week[token.substr(0, 1)] = toInt(input);
- });
-
- // HELPERS
-
- // LOCALES
-
- function localeWeek (mom) {
- return weekOfYear(mom, this._week.dow, this._week.doy).week;
- }
-
- var defaultLocaleWeek = {
- dow : 0, // Sunday is the first day of the week.
- doy : 6 // The week that contains Jan 6th is the first week of the year.
- };
-
- function localeFirstDayOfWeek () {
- return this._week.dow;
- }
-
- function localeFirstDayOfYear () {
- return this._week.doy;
- }
-
- // MOMENTS
-
- function getSetWeek (input) {
- var week = this.localeData().week(this);
- return input == null ? week : this.add((input - week) * 7, 'd');
- }
-
- function getSetISOWeek (input) {
- var week = weekOfYear(this, 1, 4).week;
- return input == null ? week : this.add((input - week) * 7, 'd');
- }
-
- // FORMATTING
-
- addFormatToken('d', 0, 'do', 'day');
-
- addFormatToken('dd', 0, 0, function (format) {
- return this.localeData().weekdaysMin(this, format);
- });
-
- addFormatToken('ddd', 0, 0, function (format) {
- return this.localeData().weekdaysShort(this, format);
- });
-
- addFormatToken('dddd', 0, 0, function (format) {
- return this.localeData().weekdays(this, format);
- });
-
- addFormatToken('e', 0, 0, 'weekday');
- addFormatToken('E', 0, 0, 'isoWeekday');
-
- // ALIASES
-
- addUnitAlias('day', 'd');
- addUnitAlias('weekday', 'e');
- addUnitAlias('isoWeekday', 'E');
-
- // PRIORITY
- addUnitPriority('day', 11);
- addUnitPriority('weekday', 11);
- addUnitPriority('isoWeekday', 11);
-
- // PARSING
-
- addRegexToken('d', match1to2);
- addRegexToken('e', match1to2);
- addRegexToken('E', match1to2);
- addRegexToken('dd', function (isStrict, locale) {
- return locale.weekdaysMinRegex(isStrict);
- });
- addRegexToken('ddd', function (isStrict, locale) {
- return locale.weekdaysShortRegex(isStrict);
- });
- addRegexToken('dddd', function (isStrict, locale) {
- return locale.weekdaysRegex(isStrict);
- });
-
- addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
- var weekday = config._locale.weekdaysParse(input, token, config._strict);
- // if we didn't get a weekday name, mark the date as invalid
- if (weekday != null) {
- week.d = weekday;
- } else {
- getParsingFlags(config).invalidWeekday = input;
- }
- });
-
- addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
- week[token] = toInt(input);
- });
-
- // HELPERS
-
- function parseWeekday(input, locale) {
- if (typeof input !== 'string') {
- return input;
- }
-
- if (!isNaN(input)) {
- return parseInt(input, 10);
- }
-
- input = locale.weekdaysParse(input);
- if (typeof input === 'number') {
- return input;
- }
-
- return null;
- }
-
- function parseIsoWeekday(input, locale) {
- if (typeof input === 'string') {
- return locale.weekdaysParse(input) % 7 || 7;
- }
- return isNaN(input) ? null : input;
- }
-
- // LOCALES
- function shiftWeekdays (ws, n) {
- return ws.slice(n, 7).concat(ws.slice(0, n));
- }
-
- var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
- function localeWeekdays (m, format) {
- var weekdays = isArray(this._weekdays) ? this._weekdays :
- this._weekdays[(m && m !== true && this._weekdays.isFormat.test(format)) ? 'format' : 'standalone'];
- return (m === true) ? shiftWeekdays(weekdays, this._week.dow)
- : (m) ? weekdays[m.day()] : weekdays;
- }
-
- var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
- function localeWeekdaysShort (m) {
- return (m === true) ? shiftWeekdays(this._weekdaysShort, this._week.dow)
- : (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
- }
-
- var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
- function localeWeekdaysMin (m) {
- return (m === true) ? shiftWeekdays(this._weekdaysMin, this._week.dow)
- : (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
- }
-
- function handleStrictParse$1(weekdayName, format, strict) {
- var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
- if (!this._weekdaysParse) {
- this._weekdaysParse = [];
- this._shortWeekdaysParse = [];
- this._minWeekdaysParse = [];
-
- for (i = 0; i < 7; ++i) {
- mom = createUTC([2000, 1]).day(i);
- this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
- this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
- this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
- }
- }
-
- if (strict) {
- if (format === 'dddd') {
- ii = indexOf.call(this._weekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else if (format === 'ddd') {
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- }
- } else {
- if (format === 'dddd') {
- ii = indexOf.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else if (format === 'ddd') {
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._minWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- } else {
- ii = indexOf.call(this._minWeekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._weekdaysParse, llc);
- if (ii !== -1) {
- return ii;
- }
- ii = indexOf.call(this._shortWeekdaysParse, llc);
- return ii !== -1 ? ii : null;
- }
- }
- }
-
- function localeWeekdaysParse (weekdayName, format, strict) {
- var i, mom, regex;
-
- if (this._weekdaysParseExact) {
- return handleStrictParse$1.call(this, weekdayName, format, strict);
- }
-
- if (!this._weekdaysParse) {
- this._weekdaysParse = [];
- this._minWeekdaysParse = [];
- this._shortWeekdaysParse = [];
- this._fullWeekdaysParse = [];
- }
-
- for (i = 0; i < 7; i++) {
- // make the regex if we don't have it already
-
- mom = createUTC([2000, 1]).day(i);
- if (strict && !this._fullWeekdaysParse[i]) {
- this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
- this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
- this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
- }
- if (!this._weekdaysParse[i]) {
- regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
- this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
- }
- // test the regex
- if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
- return i;
- } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
- return i;
- } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
- return i;
- } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
- return i;
- }
- }
- }
-
- // MOMENTS
-
- function getSetDayOfWeek (input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
- if (input != null) {
- input = parseWeekday(input, this.localeData());
- return this.add(input - day, 'd');
- } else {
- return day;
- }
- }
-
- function getSetLocaleDayOfWeek (input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
- return input == null ? weekday : this.add(input - weekday, 'd');
- }
-
- function getSetISODayOfWeek (input) {
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
-
- // behaves the same as moment#day except
- // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
- // as a setter, sunday should belong to the previous week.
-
- if (input != null) {
- var weekday = parseIsoWeekday(input, this.localeData());
- return this.day(this.day() % 7 ? weekday : weekday - 7);
- } else {
- return this.day() || 7;
- }
- }
-
- var defaultWeekdaysRegex = matchWord;
- function weekdaysRegex (isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysStrictRegex;
- } else {
- return this._weekdaysRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- this._weekdaysRegex = defaultWeekdaysRegex;
- }
- return this._weekdaysStrictRegex && isStrict ?
- this._weekdaysStrictRegex : this._weekdaysRegex;
- }
- }
-
- var defaultWeekdaysShortRegex = matchWord;
- function weekdaysShortRegex (isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysShortStrictRegex;
- } else {
- return this._weekdaysShortRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysShortRegex')) {
- this._weekdaysShortRegex = defaultWeekdaysShortRegex;
- }
- return this._weekdaysShortStrictRegex && isStrict ?
- this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
- }
- }
-
- var defaultWeekdaysMinRegex = matchWord;
- function weekdaysMinRegex (isStrict) {
- if (this._weekdaysParseExact) {
- if (!hasOwnProp(this, '_weekdaysRegex')) {
- computeWeekdaysParse.call(this);
- }
- if (isStrict) {
- return this._weekdaysMinStrictRegex;
- } else {
- return this._weekdaysMinRegex;
- }
- } else {
- if (!hasOwnProp(this, '_weekdaysMinRegex')) {
- this._weekdaysMinRegex = defaultWeekdaysMinRegex;
- }
- return this._weekdaysMinStrictRegex && isStrict ?
- this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
- }
- }
-
-
- function computeWeekdaysParse () {
- function cmpLenRev(a, b) {
- return b.length - a.length;
- }
-
- var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
- i, mom, minp, shortp, longp;
- for (i = 0; i < 7; i++) {
- // make the regex if we don't have it already
- mom = createUTC([2000, 1]).day(i);
- minp = this.weekdaysMin(mom, '');
- shortp = this.weekdaysShort(mom, '');
- longp = this.weekdays(mom, '');
- minPieces.push(minp);
- shortPieces.push(shortp);
- longPieces.push(longp);
- mixedPieces.push(minp);
- mixedPieces.push(shortp);
- mixedPieces.push(longp);
- }
- // Sorting makes sure if one weekday (or abbr) is a prefix of another it
- // will match the longer piece.
- minPieces.sort(cmpLenRev);
- shortPieces.sort(cmpLenRev);
- longPieces.sort(cmpLenRev);
- mixedPieces.sort(cmpLenRev);
- for (i = 0; i < 7; i++) {
- shortPieces[i] = regexEscape(shortPieces[i]);
- longPieces[i] = regexEscape(longPieces[i]);
- mixedPieces[i] = regexEscape(mixedPieces[i]);
- }
-
- this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
- this._weekdaysShortRegex = this._weekdaysRegex;
- this._weekdaysMinRegex = this._weekdaysRegex;
-
- this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
- this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
- this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
- }
-
- // FORMATTING
-
- function hFormat() {
- return this.hours() % 12 || 12;
- }
-
- function kFormat() {
- return this.hours() || 24;
- }
-
- addFormatToken('H', ['HH', 2], 0, 'hour');
- addFormatToken('h', ['hh', 2], 0, hFormat);
- addFormatToken('k', ['kk', 2], 0, kFormat);
-
- addFormatToken('hmm', 0, 0, function () {
- return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
- });
-
- addFormatToken('hmmss', 0, 0, function () {
- return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
- zeroFill(this.seconds(), 2);
- });
-
- addFormatToken('Hmm', 0, 0, function () {
- return '' + this.hours() + zeroFill(this.minutes(), 2);
- });
-
- addFormatToken('Hmmss', 0, 0, function () {
- return '' + this.hours() + zeroFill(this.minutes(), 2) +
- zeroFill(this.seconds(), 2);
- });
-
- function meridiem (token, lowercase) {
- addFormatToken(token, 0, 0, function () {
- return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
- });
- }
-
- meridiem('a', true);
- meridiem('A', false);
-
- // ALIASES
-
- addUnitAlias('hour', 'h');
-
- // PRIORITY
- addUnitPriority('hour', 13);
-
- // PARSING
-
- function matchMeridiem (isStrict, locale) {
- return locale._meridiemParse;
- }
-
- addRegexToken('a', matchMeridiem);
- addRegexToken('A', matchMeridiem);
- addRegexToken('H', match1to2);
- addRegexToken('h', match1to2);
- addRegexToken('k', match1to2);
- addRegexToken('HH', match1to2, match2);
- addRegexToken('hh', match1to2, match2);
- addRegexToken('kk', match1to2, match2);
-
- addRegexToken('hmm', match3to4);
- addRegexToken('hmmss', match5to6);
- addRegexToken('Hmm', match3to4);
- addRegexToken('Hmmss', match5to6);
-
- addParseToken(['H', 'HH'], HOUR);
- addParseToken(['k', 'kk'], function (input, array, config) {
- var kInput = toInt(input);
- array[HOUR] = kInput === 24 ? 0 : kInput;
- });
- addParseToken(['a', 'A'], function (input, array, config) {
- config._isPm = config._locale.isPM(input);
- config._meridiem = input;
- });
- addParseToken(['h', 'hh'], function (input, array, config) {
- array[HOUR] = toInt(input);
- getParsingFlags(config).bigHour = true;
- });
- addParseToken('hmm', function (input, array, config) {
- var pos = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos));
- array[MINUTE] = toInt(input.substr(pos));
- getParsingFlags(config).bigHour = true;
- });
- addParseToken('hmmss', function (input, array, config) {
- var pos1 = input.length - 4;
- var pos2 = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos1));
- array[MINUTE] = toInt(input.substr(pos1, 2));
- array[SECOND] = toInt(input.substr(pos2));
- getParsingFlags(config).bigHour = true;
- });
- addParseToken('Hmm', function (input, array, config) {
- var pos = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos));
- array[MINUTE] = toInt(input.substr(pos));
- });
- addParseToken('Hmmss', function (input, array, config) {
- var pos1 = input.length - 4;
- var pos2 = input.length - 2;
- array[HOUR] = toInt(input.substr(0, pos1));
- array[MINUTE] = toInt(input.substr(pos1, 2));
- array[SECOND] = toInt(input.substr(pos2));
- });
-
- // LOCALES
-
- function localeIsPM (input) {
- // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
- // Using charAt should be more compatible.
- return ((input + '').toLowerCase().charAt(0) === 'p');
- }
-
- var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
- function localeMeridiem (hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? 'pm' : 'PM';
- } else {
- return isLower ? 'am' : 'AM';
- }
- }
-
-
- // MOMENTS
-
- // Setting the hour should keep the time, because the user explicitly
- // specified which hour they want. So trying to maintain the same hour (in
- // a new timezone) makes sense. Adding/subtracting hours does not follow
- // this rule.
- var getSetHour = makeGetSet('Hours', true);
-
- var baseConfig = {
- calendar: defaultCalendar,
- longDateFormat: defaultLongDateFormat,
- invalidDate: defaultInvalidDate,
- ordinal: defaultOrdinal,
- dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
- relativeTime: defaultRelativeTime,
-
- months: defaultLocaleMonths,
- monthsShort: defaultLocaleMonthsShort,
-
- week: defaultLocaleWeek,
-
- weekdays: defaultLocaleWeekdays,
- weekdaysMin: defaultLocaleWeekdaysMin,
- weekdaysShort: defaultLocaleWeekdaysShort,
-
- meridiemParse: defaultLocaleMeridiemParse
- };
-
- // internal storage for locale config files
- var locales = {};
- var localeFamilies = {};
- var globalLocale;
-
- function normalizeLocale(key) {
- return key ? key.toLowerCase().replace('_', '-') : key;
- }
-
- // pick the locale from the array
- // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
- // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
- function chooseLocale(names) {
- var i = 0, j, next, locale, split;
-
- while (i < names.length) {
- split = normalizeLocale(names[i]).split('-');
- j = split.length;
- next = normalizeLocale(names[i + 1]);
- next = next ? next.split('-') : null;
- while (j > 0) {
- locale = loadLocale(split.slice(0, j).join('-'));
- if (locale) {
- return locale;
- }
- if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
- //the next array item is better than a shallower substring of this one
- break;
- }
- j--;
- }
- i++;
- }
- return globalLocale;
- }
-
- function loadLocale(name) {
- var oldLocale = null;
- // TODO: Find a better way to register and load all the locales in Node
- if (!locales[name] && (typeof module !== 'undefined') &&
- module && module.exports) {
- try {
- oldLocale = globalLocale._abbr;
- var aliasedRequire = require;
- aliasedRequire('./locale/' + name);
- getSetGlobalLocale(oldLocale);
- } catch (e) {}
- }
- return locales[name];
- }
-
- // This function will load locale and then set the global locale. If
- // no arguments are passed in, it will simply return the current global
- // locale key.
- function getSetGlobalLocale (key, values) {
- var data;
- if (key) {
- if (isUndefined(values)) {
- data = getLocale(key);
- }
- else {
- data = defineLocale(key, values);
- }
-
- if (data) {
- // moment.duration._locale = moment._locale = data;
- globalLocale = data;
- }
- else {
- if ((typeof console !== 'undefined') && console.warn) {
- //warn user if arguments are passed but the locale could not be set
- console.warn('Locale ' + key + ' not found. Did you forget to load it?');
- }
- }
- }
-
- return globalLocale._abbr;
- }
-
- function defineLocale (name, config) {
- if (config !== null) {
- var locale, parentConfig = baseConfig;
- config.abbr = name;
- if (locales[name] != null) {
- deprecateSimple('defineLocaleOverride',
- 'use moment.updateLocale(localeName, config) to change ' +
- 'an existing locale. moment.defineLocale(localeName, ' +
- 'config) should only be used for creating a new locale ' +
- 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
- parentConfig = locales[name]._config;
- } else if (config.parentLocale != null) {
- if (locales[config.parentLocale] != null) {
- parentConfig = locales[config.parentLocale]._config;
- } else {
- locale = loadLocale(config.parentLocale);
- if (locale != null) {
- parentConfig = locale._config;
- } else {
- if (!localeFamilies[config.parentLocale]) {
- localeFamilies[config.parentLocale] = [];
- }
- localeFamilies[config.parentLocale].push({
- name: name,
- config: config
- });
- return null;
- }
- }
- }
- locales[name] = new Locale(mergeConfigs(parentConfig, config));
-
- if (localeFamilies[name]) {
- localeFamilies[name].forEach(function (x) {
- defineLocale(x.name, x.config);
- });
- }
-
- // backwards compat for now: also set the locale
- // make sure we set the locale AFTER all child locales have been
- // created, so we won't end up with the child locale set.
- getSetGlobalLocale(name);
-
-
- return locales[name];
- } else {
- // useful for testing
- delete locales[name];
- return null;
- }
- }
-
- function updateLocale(name, config) {
- if (config != null) {
- var locale, tmpLocale, parentConfig = baseConfig;
- // MERGE
- tmpLocale = loadLocale(name);
- if (tmpLocale != null) {
- parentConfig = tmpLocale._config;
- }
- config = mergeConfigs(parentConfig, config);
- locale = new Locale(config);
- locale.parentLocale = locales[name];
- locales[name] = locale;
-
- // backwards compat for now: also set the locale
- getSetGlobalLocale(name);
- } else {
- // pass null for config to unupdate, useful for tests
- if (locales[name] != null) {
- if (locales[name].parentLocale != null) {
- locales[name] = locales[name].parentLocale;
- } else if (locales[name] != null) {
- delete locales[name];
- }
- }
- }
- return locales[name];
- }
-
- // returns locale data
- function getLocale (key) {
- var locale;
-
- if (key && key._locale && key._locale._abbr) {
- key = key._locale._abbr;
- }
-
- if (!key) {
- return globalLocale;
- }
-
- if (!isArray(key)) {
- //short-circuit everything else
- locale = loadLocale(key);
- if (locale) {
- return locale;
- }
- key = [key];
- }
-
- return chooseLocale(key);
- }
-
- function listLocales() {
- return keys(locales);
- }
-
- function checkOverflow (m) {
- var overflow;
- var a = m._a;
-
- if (a && getParsingFlags(m).overflow === -2) {
- overflow =
- a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
- a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
- a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
- a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
- a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
- a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
- -1;
-
- if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
- overflow = DATE;
- }
- if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
- overflow = WEEK;
- }
- if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
- overflow = WEEKDAY;
- }
-
- getParsingFlags(m).overflow = overflow;
- }
-
- return m;
- }
-
- // Pick the first defined of two or three arguments.
- function defaults(a, b, c) {
- if (a != null) {
- return a;
- }
- if (b != null) {
- return b;
- }
- return c;
- }
-
- function currentDateArray(config) {
- // hooks is actually the exported moment object
- var nowValue = new Date(hooks.now());
- if (config._useUTC) {
- return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
- }
- return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
- }
-
- // convert an array to a date.
- // the array should mirror the parameters below
- // note: all values past the year are optional and will default to the lowest possible value.
- // [year, month, day , hour, minute, second, millisecond]
- function configFromArray (config) {
- var i, date, input = [], currentDate, expectedWeekday, yearToUse;
-
- if (config._d) {
- return;
- }
-
- currentDate = currentDateArray(config);
-
- //compute day of the year from weeks and weekdays
- if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
- dayOfYearFromWeekInfo(config);
- }
-
- //if the day of the year is set, figure out what it is
- if (config._dayOfYear != null) {
- yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
-
- if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
- getParsingFlags(config)._overflowDayOfYear = true;
- }
-
- date = createUTCDate(yearToUse, 0, config._dayOfYear);
- config._a[MONTH] = date.getUTCMonth();
- config._a[DATE] = date.getUTCDate();
- }
-
- // Default to current date.
- // * if no year, month, day of month are given, default to today
- // * if day of month is given, default month and year
- // * if month is given, default only year
- // * if year is given, don't default anything
- for (i = 0; i < 3 && config._a[i] == null; ++i) {
- config._a[i] = input[i] = currentDate[i];
- }
-
- // Zero out whatever was not defaulted, including time
- for (; i < 7; i++) {
- config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
- }
-
- // Check for 24:00:00.000
- if (config._a[HOUR] === 24 &&
- config._a[MINUTE] === 0 &&
- config._a[SECOND] === 0 &&
- config._a[MILLISECOND] === 0) {
- config._nextDay = true;
- config._a[HOUR] = 0;
- }
-
- config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
- expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
-
- // Apply timezone offset from input. The actual utcOffset can be changed
- // with parseZone.
- if (config._tzm != null) {
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
- }
-
- if (config._nextDay) {
- config._a[HOUR] = 24;
- }
-
- // check for mismatching day of week
- if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
- getParsingFlags(config).weekdayMismatch = true;
- }
- }
-
- function dayOfYearFromWeekInfo(config) {
- var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
-
- w = config._w;
- if (w.GG != null || w.W != null || w.E != null) {
- dow = 1;
- doy = 4;
-
- // TODO: We need to take the current isoWeekYear, but that depends on
- // how we interpret now (local, utc, fixed offset). So create
- // a now version of current config (take local/utc/offset flags, and
- // create now).
- weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
- week = defaults(w.W, 1);
- weekday = defaults(w.E, 1);
- if (weekday < 1 || weekday > 7) {
- weekdayOverflow = true;
- }
- } else {
- dow = config._locale._week.dow;
- doy = config._locale._week.doy;
-
- var curWeek = weekOfYear(createLocal(), dow, doy);
-
- weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
-
- // Default to current week.
- week = defaults(w.w, curWeek.week);
-
- if (w.d != null) {
- // weekday -- low day numbers are considered next week
- weekday = w.d;
- if (weekday < 0 || weekday > 6) {
- weekdayOverflow = true;
- }
- } else if (w.e != null) {
- // local weekday -- counting starts from beginning of week
- weekday = w.e + dow;
- if (w.e < 0 || w.e > 6) {
- weekdayOverflow = true;
- }
- } else {
- // default to beginning of week
- weekday = dow;
- }
- }
- if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
- getParsingFlags(config)._overflowWeeks = true;
- } else if (weekdayOverflow != null) {
- getParsingFlags(config)._overflowWeekday = true;
- } else {
- temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
- config._a[YEAR] = temp.year;
- config._dayOfYear = temp.dayOfYear;
- }
- }
-
- // iso 8601 regex
- // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
- var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
- var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
-
- var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
-
- var isoDates = [
- ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
- ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
- ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
- ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
- ['YYYY-DDD', /\d{4}-\d{3}/],
- ['YYYY-MM', /\d{4}-\d\d/, false],
- ['YYYYYYMMDD', /[+-]\d{10}/],
- ['YYYYMMDD', /\d{8}/],
- // YYYYMM is NOT allowed by the standard
- ['GGGG[W]WWE', /\d{4}W\d{3}/],
- ['GGGG[W]WW', /\d{4}W\d{2}/, false],
- ['YYYYDDD', /\d{7}/]
- ];
-
- // iso time formats and regexes
- var isoTimes = [
- ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
- ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
- ['HH:mm:ss', /\d\d:\d\d:\d\d/],
- ['HH:mm', /\d\d:\d\d/],
- ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
- ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
- ['HHmmss', /\d\d\d\d\d\d/],
- ['HHmm', /\d\d\d\d/],
- ['HH', /\d\d/]
- ];
-
- var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
-
- // date from iso format
- function configFromISO(config) {
- var i, l,
- string = config._i,
- match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
- allowTime, dateFormat, timeFormat, tzFormat;
-
- if (match) {
- getParsingFlags(config).iso = true;
-
- for (i = 0, l = isoDates.length; i < l; i++) {
- if (isoDates[i][1].exec(match[1])) {
- dateFormat = isoDates[i][0];
- allowTime = isoDates[i][2] !== false;
- break;
- }
- }
- if (dateFormat == null) {
- config._isValid = false;
- return;
- }
- if (match[3]) {
- for (i = 0, l = isoTimes.length; i < l; i++) {
- if (isoTimes[i][1].exec(match[3])) {
- // match[2] should be 'T' or space
- timeFormat = (match[2] || ' ') + isoTimes[i][0];
- break;
- }
- }
- if (timeFormat == null) {
- config._isValid = false;
- return;
- }
- }
- if (!allowTime && timeFormat != null) {
- config._isValid = false;
- return;
- }
- if (match[4]) {
- if (tzRegex.exec(match[4])) {
- tzFormat = 'Z';
- } else {
- config._isValid = false;
- return;
- }
- }
- config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
- configFromStringAndFormat(config);
- } else {
- config._isValid = false;
- }
- }
-
- // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
- var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
-
- function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
- var result = [
- untruncateYear(yearStr),
- defaultLocaleMonthsShort.indexOf(monthStr),
- parseInt(dayStr, 10),
- parseInt(hourStr, 10),
- parseInt(minuteStr, 10)
- ];
-
- if (secondStr) {
- result.push(parseInt(secondStr, 10));
- }
-
- return result;
- }
-
- function untruncateYear(yearStr) {
- var year = parseInt(yearStr, 10);
- if (year <= 49) {
- return 2000 + year;
- } else if (year <= 999) {
- return 1900 + year;
- }
- return year;
- }
-
- function preprocessRFC2822(s) {
- // Remove comments and folding whitespace and replace multiple-spaces with a single space
- return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- }
-
- function checkWeekday(weekdayStr, parsedInput, config) {
- if (weekdayStr) {
- // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
- var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
- weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
- if (weekdayProvided !== weekdayActual) {
- getParsingFlags(config).weekdayMismatch = true;
- config._isValid = false;
- return false;
- }
- }
- return true;
- }
-
- var obsOffsets = {
- UT: 0,
- GMT: 0,
- EDT: -4 * 60,
- EST: -5 * 60,
- CDT: -5 * 60,
- CST: -6 * 60,
- MDT: -6 * 60,
- MST: -7 * 60,
- PDT: -7 * 60,
- PST: -8 * 60
- };
-
- function calculateOffset(obsOffset, militaryOffset, numOffset) {
- if (obsOffset) {
- return obsOffsets[obsOffset];
- } else if (militaryOffset) {
- // the only allowed military tz is Z
- return 0;
- } else {
- var hm = parseInt(numOffset, 10);
- var m = hm % 100, h = (hm - m) / 100;
- return h * 60 + m;
- }
- }
-
- // date and time from ref 2822 format
- function configFromRFC2822(config) {
- var match = rfc2822.exec(preprocessRFC2822(config._i));
- if (match) {
- var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
- if (!checkWeekday(match[1], parsedArray, config)) {
- return;
- }
-
- config._a = parsedArray;
- config._tzm = calculateOffset(match[8], match[9], match[10]);
-
- config._d = createUTCDate.apply(null, config._a);
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
-
- getParsingFlags(config).rfc2822 = true;
- } else {
- config._isValid = false;
- }
- }
-
- // date from iso format or fallback
- function configFromString(config) {
- var matched = aspNetJsonRegex.exec(config._i);
-
- if (matched !== null) {
- config._d = new Date(+matched[1]);
- return;
- }
-
- configFromISO(config);
- if (config._isValid === false) {
- delete config._isValid;
- } else {
- return;
- }
-
- configFromRFC2822(config);
- if (config._isValid === false) {
- delete config._isValid;
- } else {
- return;
- }
-
- // Final attempt, use Input Fallback
- hooks.createFromInputFallback(config);
- }
-
- hooks.createFromInputFallback = deprecate(
- 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
- 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
- 'discouraged and will be removed in an upcoming major release. Please refer to ' +
- 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
- function (config) {
- config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
- }
- );
-
- // constant that refers to the ISO standard
- hooks.ISO_8601 = function () {};
-
- // constant that refers to the RFC 2822 form
- hooks.RFC_2822 = function () {};
-
- // date from string and format string
- function configFromStringAndFormat(config) {
- // TODO: Move this to another part of the creation flow to prevent circular deps
- if (config._f === hooks.ISO_8601) {
- configFromISO(config);
- return;
- }
- if (config._f === hooks.RFC_2822) {
- configFromRFC2822(config);
- return;
- }
- config._a = [];
- getParsingFlags(config).empty = true;
-
- // This array is used to make a Date, either with `new Date` or `Date.UTC`
- var string = '' + config._i,
- i, parsedInput, tokens, token, skipped,
- stringLength = string.length,
- totalParsedInputLength = 0;
-
- tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
-
- for (i = 0; i < tokens.length; i++) {
- token = tokens[i];
- parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
- // console.log('token', token, 'parsedInput', parsedInput,
- // 'regex', getParseRegexForToken(token, config));
- if (parsedInput) {
- skipped = string.substr(0, string.indexOf(parsedInput));
- if (skipped.length > 0) {
- getParsingFlags(config).unusedInput.push(skipped);
- }
- string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
- totalParsedInputLength += parsedInput.length;
- }
- // don't parse if it's not a known token
- if (formatTokenFunctions[token]) {
- if (parsedInput) {
- getParsingFlags(config).empty = false;
- }
- else {
- getParsingFlags(config).unusedTokens.push(token);
- }
- addTimeToArrayFromToken(token, parsedInput, config);
- }
- else if (config._strict && !parsedInput) {
- getParsingFlags(config).unusedTokens.push(token);
- }
- }
-
- // add remaining unparsed input length to the string
- getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
- if (string.length > 0) {
- getParsingFlags(config).unusedInput.push(string);
- }
-
- // clear _12h flag if hour is <= 12
- if (config._a[HOUR] <= 12 &&
- getParsingFlags(config).bigHour === true &&
- config._a[HOUR] > 0) {
- getParsingFlags(config).bigHour = undefined;
- }
-
- getParsingFlags(config).parsedDateParts = config._a.slice(0);
- getParsingFlags(config).meridiem = config._meridiem;
- // handle meridiem
- config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
-
- configFromArray(config);
- checkOverflow(config);
- }
-
-
- function meridiemFixWrap (locale, hour, meridiem) {
- var isPm;
-
- if (meridiem == null) {
- // nothing to do
- return hour;
- }
- if (locale.meridiemHour != null) {
- return locale.meridiemHour(hour, meridiem);
- } else if (locale.isPM != null) {
- // Fallback
- isPm = locale.isPM(meridiem);
- if (isPm && hour < 12) {
- hour += 12;
- }
- if (!isPm && hour === 12) {
- hour = 0;
- }
- return hour;
- } else {
- // this is not supposed to happen
- return hour;
- }
- }
-
- // date from string and array of format strings
- function configFromStringAndArray(config) {
- var tempConfig,
- bestMoment,
-
- scoreToBeat,
- i,
- currentScore;
-
- if (config._f.length === 0) {
- getParsingFlags(config).invalidFormat = true;
- config._d = new Date(NaN);
- return;
- }
-
- for (i = 0; i < config._f.length; i++) {
- currentScore = 0;
- tempConfig = copyConfig({}, config);
- if (config._useUTC != null) {
- tempConfig._useUTC = config._useUTC;
- }
- tempConfig._f = config._f[i];
- configFromStringAndFormat(tempConfig);
-
- if (!isValid(tempConfig)) {
- continue;
- }
-
- // if there is any input that was not parsed add a penalty for that format
- currentScore += getParsingFlags(tempConfig).charsLeftOver;
-
- //or tokens
- currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
-
- getParsingFlags(tempConfig).score = currentScore;
-
- if (scoreToBeat == null || currentScore < scoreToBeat) {
- scoreToBeat = currentScore;
- bestMoment = tempConfig;
- }
- }
-
- extend(config, bestMoment || tempConfig);
- }
-
- function configFromObject(config) {
- if (config._d) {
- return;
- }
-
- var i = normalizeObjectUnits(config._i);
- config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
- return obj && parseInt(obj, 10);
- });
-
- configFromArray(config);
- }
-
- function createFromConfig (config) {
- var res = new Moment(checkOverflow(prepareConfig(config)));
- if (res._nextDay) {
- // Adding is smart enough around DST
- res.add(1, 'd');
- res._nextDay = undefined;
- }
-
- return res;
- }
-
- function prepareConfig (config) {
- var input = config._i,
- format = config._f;
-
- config._locale = config._locale || getLocale(config._l);
-
- if (input === null || (format === undefined && input === '')) {
- return createInvalid({nullInput: true});
- }
-
- if (typeof input === 'string') {
- config._i = input = config._locale.preparse(input);
- }
-
- if (isMoment(input)) {
- return new Moment(checkOverflow(input));
- } else if (isDate(input)) {
- config._d = input;
- } else if (isArray(format)) {
- configFromStringAndArray(config);
- } else if (format) {
- configFromStringAndFormat(config);
- } else {
- configFromInput(config);
- }
-
- if (!isValid(config)) {
- config._d = null;
- }
-
- return config;
- }
-
- function configFromInput(config) {
- var input = config._i;
- if (isUndefined(input)) {
- config._d = new Date(hooks.now());
- } else if (isDate(input)) {
- config._d = new Date(input.valueOf());
- } else if (typeof input === 'string') {
- configFromString(config);
- } else if (isArray(input)) {
- config._a = map(input.slice(0), function (obj) {
- return parseInt(obj, 10);
- });
- configFromArray(config);
- } else if (isObject(input)) {
- configFromObject(config);
- } else if (isNumber(input)) {
- // from milliseconds
- config._d = new Date(input);
- } else {
- hooks.createFromInputFallback(config);
- }
- }
-
- function createLocalOrUTC (input, format, locale, strict, isUTC) {
- var c = {};
-
- if (locale === true || locale === false) {
- strict = locale;
- locale = undefined;
- }
-
- if ((isObject(input) && isObjectEmpty(input)) ||
- (isArray(input) && input.length === 0)) {
- input = undefined;
- }
- // object construction must be done this way.
- // https://github.com/moment/moment/issues/1423
- c._isAMomentObject = true;
- c._useUTC = c._isUTC = isUTC;
- c._l = locale;
- c._i = input;
- c._f = format;
- c._strict = strict;
-
- return createFromConfig(c);
- }
-
- function createLocal (input, format, locale, strict) {
- return createLocalOrUTC(input, format, locale, strict, false);
- }
-
- var prototypeMin = deprecate(
- 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
- function () {
- var other = createLocal.apply(null, arguments);
- if (this.isValid() && other.isValid()) {
- return other < this ? this : other;
- } else {
- return createInvalid();
- }
- }
- );
-
- var prototypeMax = deprecate(
- 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
- function () {
- var other = createLocal.apply(null, arguments);
- if (this.isValid() && other.isValid()) {
- return other > this ? this : other;
- } else {
- return createInvalid();
- }
- }
- );
-
- // Pick a moment m from moments so that m[fn](other) is true for all
- // other. This relies on the function fn to be transitive.
- //
- // moments should either be an array of moment objects or an array, whose
- // first element is an array of moment objects.
- function pickBy(fn, moments) {
- var res, i;
- if (moments.length === 1 && isArray(moments[0])) {
- moments = moments[0];
- }
- if (!moments.length) {
- return createLocal();
- }
- res = moments[0];
- for (i = 1; i < moments.length; ++i) {
- if (!moments[i].isValid() || moments[i][fn](res)) {
- res = moments[i];
- }
- }
- return res;
- }
-
- // TODO: Use [].sort instead?
- function min () {
- var args = [].slice.call(arguments, 0);
-
- return pickBy('isBefore', args);
- }
-
- function max () {
- var args = [].slice.call(arguments, 0);
-
- return pickBy('isAfter', args);
- }
-
- var now = function () {
- return Date.now ? Date.now() : +(new Date());
- };
-
- var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
-
- function isDurationValid(m) {
- for (var key in m) {
- if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
- return false;
- }
- }
-
- var unitHasDecimal = false;
- for (var i = 0; i < ordering.length; ++i) {
- if (m[ordering[i]]) {
- if (unitHasDecimal) {
- return false; // only allow non-integers for smallest unit
- }
- if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
- unitHasDecimal = true;
- }
- }
- }
-
- return true;
- }
-
- function isValid$1() {
- return this._isValid;
- }
-
- function createInvalid$1() {
- return createDuration(NaN);
- }
-
- function Duration (duration) {
- var normalizedInput = normalizeObjectUnits(duration),
- years = normalizedInput.year || 0,
- quarters = normalizedInput.quarter || 0,
- months = normalizedInput.month || 0,
- weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
- days = normalizedInput.day || 0,
- hours = normalizedInput.hour || 0,
- minutes = normalizedInput.minute || 0,
- seconds = normalizedInput.second || 0,
- milliseconds = normalizedInput.millisecond || 0;
-
- this._isValid = isDurationValid(normalizedInput);
-
- // representation for dateAddRemove
- this._milliseconds = +milliseconds +
- seconds * 1e3 + // 1000
- minutes * 6e4 + // 1000 * 60
- hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
- // Because of dateAddRemove treats 24 hours as different from a
- // day when working around DST, we need to store them separately
- this._days = +days +
- weeks * 7;
- // It is impossible to translate months into days without knowing
- // which months you are are talking about, so we have to store
- // it separately.
- this._months = +months +
- quarters * 3 +
- years * 12;
-
- this._data = {};
-
- this._locale = getLocale();
-
- this._bubble();
- }
-
- function isDuration (obj) {
- return obj instanceof Duration;
- }
-
- function absRound (number) {
- if (number < 0) {
- return Math.round(-1 * number) * -1;
- } else {
- return Math.round(number);
- }
- }
-
- // FORMATTING
-
- function offset (token, separator) {
- addFormatToken(token, 0, 0, function () {
- var offset = this.utcOffset();
- var sign = '+';
- if (offset < 0) {
- offset = -offset;
- sign = '-';
- }
- return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
- });
- }
-
- offset('Z', ':');
- offset('ZZ', '');
-
- // PARSING
-
- addRegexToken('Z', matchShortOffset);
- addRegexToken('ZZ', matchShortOffset);
- addParseToken(['Z', 'ZZ'], function (input, array, config) {
- config._useUTC = true;
- config._tzm = offsetFromString(matchShortOffset, input);
- });
-
- // HELPERS
-
- // timezone chunker
- // '+10:00' > ['10', '00']
- // '-1530' > ['-15', '30']
- var chunkOffset = /([\+\-]|\d\d)/gi;
-
- function offsetFromString(matcher, string) {
- var matches = (string || '').match(matcher);
-
- if (matches === null) {
- return null;
- }
-
- var chunk = matches[matches.length - 1] || [];
- var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
- var minutes = +(parts[1] * 60) + toInt(parts[2]);
-
- return minutes === 0 ?
- 0 :
- parts[0] === '+' ? minutes : -minutes;
- }
-
- // Return a moment from input, that is local/utc/zone equivalent to model.
- function cloneWithOffset(input, model) {
- var res, diff;
- if (model._isUTC) {
- res = model.clone();
- diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
- // Use low-level api, because this fn is low-level api.
- res._d.setTime(res._d.valueOf() + diff);
- hooks.updateOffset(res, false);
- return res;
- } else {
- return createLocal(input).local();
- }
- }
-
- function getDateOffset (m) {
- // On Firefox.24 Date#getTimezoneOffset returns a floating point.
- // https://github.com/moment/moment/pull/1871
- return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
- }
-
- // HOOKS
-
- // This function will be called whenever a moment is mutated.
- // It is intended to keep the offset in sync with the timezone.
- hooks.updateOffset = function () {};
-
- // MOMENTS
-
- // keepLocalTime = true means only change the timezone, without
- // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
- // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
- // +0200, so we adjust the time as needed, to be valid.
- //
- // Keeping the time actually adds/subtracts (one hour)
- // from the actual represented time. That is why we call updateOffset
- // a second time. In case it wants us to change the offset again
- // _changeInProgress == true case, then we have to adjust, because
- // there is no such time in the given timezone.
- function getSetOffset (input, keepLocalTime, keepMinutes) {
- var offset = this._offset || 0,
- localAdjust;
- if (!this.isValid()) {
- return input != null ? this : NaN;
- }
- if (input != null) {
- if (typeof input === 'string') {
- input = offsetFromString(matchShortOffset, input);
- if (input === null) {
- return this;
- }
- } else if (Math.abs(input) < 16 && !keepMinutes) {
- input = input * 60;
- }
- if (!this._isUTC && keepLocalTime) {
- localAdjust = getDateOffset(this);
- }
- this._offset = input;
- this._isUTC = true;
- if (localAdjust != null) {
- this.add(localAdjust, 'm');
- }
- if (offset !== input) {
- if (!keepLocalTime || this._changeInProgress) {
- addSubtract(this, createDuration(input - offset, 'm'), 1, false);
- } else if (!this._changeInProgress) {
- this._changeInProgress = true;
- hooks.updateOffset(this, true);
- this._changeInProgress = null;
- }
- }
- return this;
- } else {
- return this._isUTC ? offset : getDateOffset(this);
- }
- }
-
- function getSetZone (input, keepLocalTime) {
- if (input != null) {
- if (typeof input !== 'string') {
- input = -input;
- }
-
- this.utcOffset(input, keepLocalTime);
-
- return this;
- } else {
- return -this.utcOffset();
- }
- }
-
- function setOffsetToUTC (keepLocalTime) {
- return this.utcOffset(0, keepLocalTime);
- }
-
- function setOffsetToLocal (keepLocalTime) {
- if (this._isUTC) {
- this.utcOffset(0, keepLocalTime);
- this._isUTC = false;
-
- if (keepLocalTime) {
- this.subtract(getDateOffset(this), 'm');
- }
- }
- return this;
- }
-
- function setOffsetToParsedOffset () {
- if (this._tzm != null) {
- this.utcOffset(this._tzm, false, true);
- } else if (typeof this._i === 'string') {
- var tZone = offsetFromString(matchOffset, this._i);
- if (tZone != null) {
- this.utcOffset(tZone);
- }
- else {
- this.utcOffset(0, true);
- }
- }
- return this;
- }
-
- function hasAlignedHourOffset (input) {
- if (!this.isValid()) {
- return false;
- }
- input = input ? createLocal(input).utcOffset() : 0;
-
- return (this.utcOffset() - input) % 60 === 0;
- }
-
- function isDaylightSavingTime () {
- return (
- this.utcOffset() > this.clone().month(0).utcOffset() ||
- this.utcOffset() > this.clone().month(5).utcOffset()
- );
- }
-
- function isDaylightSavingTimeShifted () {
- if (!isUndefined(this._isDSTShifted)) {
- return this._isDSTShifted;
- }
-
- var c = {};
-
- copyConfig(c, this);
- c = prepareConfig(c);
-
- if (c._a) {
- var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
- this._isDSTShifted = this.isValid() &&
- compareArrays(c._a, other.toArray()) > 0;
- } else {
- this._isDSTShifted = false;
- }
-
- return this._isDSTShifted;
- }
-
- function isLocal () {
- return this.isValid() ? !this._isUTC : false;
- }
-
- function isUtcOffset () {
- return this.isValid() ? this._isUTC : false;
- }
-
- function isUtc () {
- return this.isValid() ? this._isUTC && this._offset === 0 : false;
- }
-
- // ASP.NET json date format regex
- var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
-
- // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
- // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
- // and further modified to allow for strings containing both week and day
- var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
-
- function createDuration (input, key) {
- var duration = input,
- // matching against regexp is expensive, do it on demand
- match = null,
- sign,
- ret,
- diffRes;
-
- if (isDuration(input)) {
- duration = {
- ms : input._milliseconds,
- d : input._days,
- M : input._months
- };
- } else if (isNumber(input)) {
- duration = {};
- if (key) {
- duration[key] = input;
- } else {
- duration.milliseconds = input;
- }
- } else if (!!(match = aspNetRegex.exec(input))) {
- sign = (match[1] === '-') ? -1 : 1;
- duration = {
- y : 0,
- d : toInt(match[DATE]) * sign,
- h : toInt(match[HOUR]) * sign,
- m : toInt(match[MINUTE]) * sign,
- s : toInt(match[SECOND]) * sign,
- ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
- };
- } else if (!!(match = isoRegex.exec(input))) {
- sign = (match[1] === '-') ? -1 : 1;
- duration = {
- y : parseIso(match[2], sign),
- M : parseIso(match[3], sign),
- w : parseIso(match[4], sign),
- d : parseIso(match[5], sign),
- h : parseIso(match[6], sign),
- m : parseIso(match[7], sign),
- s : parseIso(match[8], sign)
- };
- } else if (duration == null) {// checks for null or undefined
- duration = {};
- } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
- diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
-
- duration = {};
- duration.ms = diffRes.milliseconds;
- duration.M = diffRes.months;
- }
-
- ret = new Duration(duration);
-
- if (isDuration(input) && hasOwnProp(input, '_locale')) {
- ret._locale = input._locale;
- }
-
- return ret;
- }
-
- createDuration.fn = Duration.prototype;
- createDuration.invalid = createInvalid$1;
-
- function parseIso (inp, sign) {
- // We'd normally use ~~inp for this, but unfortunately it also
- // converts floats to ints.
- // inp may be undefined, so careful calling replace on it.
- var res = inp && parseFloat(inp.replace(',', '.'));
- // apply sign while we're at it
- return (isNaN(res) ? 0 : res) * sign;
- }
-
- function positiveMomentsDifference(base, other) {
- var res = {};
-
- res.months = other.month() - base.month() +
- (other.year() - base.year()) * 12;
- if (base.clone().add(res.months, 'M').isAfter(other)) {
- --res.months;
- }
-
- res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
-
- return res;
- }
-
- function momentsDifference(base, other) {
- var res;
- if (!(base.isValid() && other.isValid())) {
- return {milliseconds: 0, months: 0};
- }
-
- other = cloneWithOffset(other, base);
- if (base.isBefore(other)) {
- res = positiveMomentsDifference(base, other);
- } else {
- res = positiveMomentsDifference(other, base);
- res.milliseconds = -res.milliseconds;
- res.months = -res.months;
- }
-
- return res;
- }
-
- // TODO: remove 'name' arg after deprecation is removed
- function createAdder(direction, name) {
- return function (val, period) {
- var dur, tmp;
- //invert the arguments, but complain about it
- if (period !== null && !isNaN(+period)) {
- deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
- 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
- tmp = val; val = period; period = tmp;
- }
-
- val = typeof val === 'string' ? +val : val;
- dur = createDuration(val, period);
- addSubtract(this, dur, direction);
- return this;
- };
- }
-
- function addSubtract (mom, duration, isAdding, updateOffset) {
- var milliseconds = duration._milliseconds,
- days = absRound(duration._days),
- months = absRound(duration._months);
-
- if (!mom.isValid()) {
- // No op
- return;
- }
-
- updateOffset = updateOffset == null ? true : updateOffset;
-
- if (months) {
- setMonth(mom, get(mom, 'Month') + months * isAdding);
- }
- if (days) {
- set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
- }
- if (milliseconds) {
- mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
- }
- if (updateOffset) {
- hooks.updateOffset(mom, days || months);
- }
- }
-
- var add = createAdder(1, 'add');
- var subtract = createAdder(-1, 'subtract');
-
- function getCalendarFormat(myMoment, now) {
- var diff = myMoment.diff(now, 'days', true);
- return diff < -6 ? 'sameElse' :
- diff < -1 ? 'lastWeek' :
- diff < 0 ? 'lastDay' :
- diff < 1 ? 'sameDay' :
- diff < 2 ? 'nextDay' :
- diff < 7 ? 'nextWeek' : 'sameElse';
- }
-
- function calendar$1 (time, formats) {
- // We want to compare the start of today, vs this.
- // Getting start-of-today depends on whether we're local/utc/offset or not.
- var now = time || createLocal(),
- sod = cloneWithOffset(now, this).startOf('day'),
- format = hooks.calendarFormat(this, sod) || 'sameElse';
-
- var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
-
- return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
- }
-
- function clone () {
- return new Moment(this);
- }
-
- function isAfter (input, units) {
- var localInput = isMoment(input) ? input : createLocal(input);
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(units) || 'millisecond';
- if (units === 'millisecond') {
- return this.valueOf() > localInput.valueOf();
- } else {
- return localInput.valueOf() < this.clone().startOf(units).valueOf();
- }
- }
-
- function isBefore (input, units) {
- var localInput = isMoment(input) ? input : createLocal(input);
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(units) || 'millisecond';
- if (units === 'millisecond') {
- return this.valueOf() < localInput.valueOf();
- } else {
- return this.clone().endOf(units).valueOf() < localInput.valueOf();
- }
- }
-
- function isBetween (from, to, units, inclusivity) {
- var localFrom = isMoment(from) ? from : createLocal(from),
- localTo = isMoment(to) ? to : createLocal(to);
- if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
- return false;
- }
- inclusivity = inclusivity || '()';
- return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) &&
- (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
- }
-
- function isSame (input, units) {
- var localInput = isMoment(input) ? input : createLocal(input),
- inputMs;
- if (!(this.isValid() && localInput.isValid())) {
- return false;
- }
- units = normalizeUnits(units) || 'millisecond';
- if (units === 'millisecond') {
- return this.valueOf() === localInput.valueOf();
- } else {
- inputMs = localInput.valueOf();
- return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
- }
- }
-
- function isSameOrAfter (input, units) {
- return this.isSame(input, units) || this.isAfter(input, units);
- }
-
- function isSameOrBefore (input, units) {
- return this.isSame(input, units) || this.isBefore(input, units);
- }
-
- function diff (input, units, asFloat) {
- var that,
- zoneDelta,
- output;
-
- if (!this.isValid()) {
- return NaN;
- }
-
- that = cloneWithOffset(input, this);
-
- if (!that.isValid()) {
- return NaN;
- }
-
- zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
-
- units = normalizeUnits(units);
-
- switch (units) {
- case 'year': output = monthDiff(this, that) / 12; break;
- case 'month': output = monthDiff(this, that); break;
- case 'quarter': output = monthDiff(this, that) / 3; break;
- case 'second': output = (this - that) / 1e3; break; // 1000
- case 'minute': output = (this - that) / 6e4; break; // 1000 * 60
- case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60
- case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst
- case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst
- default: output = this - that;
- }
-
- return asFloat ? output : absFloor(output);
- }
-
- function monthDiff (a, b) {
- // difference in months
- var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
- // b is in (anchor - 1 month, anchor + 1 month)
- anchor = a.clone().add(wholeMonthDiff, 'months'),
- anchor2, adjust;
-
- if (b - anchor < 0) {
- anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
- // linear across the month
- adjust = (b - anchor) / (anchor - anchor2);
- } else {
- anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
- // linear across the month
- adjust = (b - anchor) / (anchor2 - anchor);
- }
-
- //check for negative zero, return zero if negative zero
- return -(wholeMonthDiff + adjust) || 0;
- }
-
- hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
- hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
-
- function toString () {
- return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
- }
-
- function toISOString(keepOffset) {
- if (!this.isValid()) {
- return null;
- }
- var utc = keepOffset !== true;
- var m = utc ? this.clone().utc() : this;
- if (m.year() < 0 || m.year() > 9999) {
- return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
- }
- if (isFunction(Date.prototype.toISOString)) {
- // native implementation is ~50x faster, use it when we can
- if (utc) {
- return this.toDate().toISOString();
- } else {
- return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
- }
- }
- return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
- }
-
- /**
- * Return a human readable representation of a moment that can
- * also be evaluated to get a new moment which is the same
- *
- * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
- */
- function inspect () {
- if (!this.isValid()) {
- return 'moment.invalid(/* ' + this._i + ' */)';
- }
- var func = 'moment';
- var zone = '';
- if (!this.isLocal()) {
- func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
- zone = 'Z';
- }
- var prefix = '[' + func + '("]';
- var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
- var datetime = '-MM-DD[T]HH:mm:ss.SSS';
- var suffix = zone + '[")]';
-
- return this.format(prefix + year + datetime + suffix);
- }
-
- function format (inputString) {
- if (!inputString) {
- inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
- }
- var output = formatMoment(this, inputString);
- return this.localeData().postformat(output);
- }
-
- function from (time, withoutSuffix) {
- if (this.isValid() &&
- ((isMoment(time) && time.isValid()) ||
- createLocal(time).isValid())) {
- return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
- } else {
- return this.localeData().invalidDate();
- }
- }
-
- function fromNow (withoutSuffix) {
- return this.from(createLocal(), withoutSuffix);
- }
-
- function to (time, withoutSuffix) {
- if (this.isValid() &&
- ((isMoment(time) && time.isValid()) ||
- createLocal(time).isValid())) {
- return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
- } else {
- return this.localeData().invalidDate();
- }
- }
-
- function toNow (withoutSuffix) {
- return this.to(createLocal(), withoutSuffix);
- }
-
- // If passed a locale key, it will set the locale for this
- // instance. Otherwise, it will return the locale configuration
- // variables for this instance.
- function locale (key) {
- var newLocaleData;
-
- if (key === undefined) {
- return this._locale._abbr;
- } else {
- newLocaleData = getLocale(key);
- if (newLocaleData != null) {
- this._locale = newLocaleData;
- }
- return this;
- }
- }
-
- var lang = deprecate(
- 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
- function (key) {
- if (key === undefined) {
- return this.localeData();
- } else {
- return this.locale(key);
- }
- }
- );
-
- function localeData () {
- return this._locale;
- }
-
- var MS_PER_SECOND = 1000;
- var MS_PER_MINUTE = 60 * MS_PER_SECOND;
- var MS_PER_HOUR = 60 * MS_PER_MINUTE;
- var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
-
- // actual modulo - handles negative numbers (for dates before 1970):
- function mod$1(dividend, divisor) {
- return (dividend % divisor + divisor) % divisor;
- }
-
- function localStartOfDate(y, m, d) {
- // the date constructor remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- // preserve leap years using a full 400 year cycle, then reset
- return new Date(y + 400, m, d) - MS_PER_400_YEARS;
- } else {
- return new Date(y, m, d).valueOf();
- }
- }
-
- function utcStartOfDate(y, m, d) {
- // Date.UTC remaps years 0-99 to 1900-1999
- if (y < 100 && y >= 0) {
- // preserve leap years using a full 400 year cycle, then reset
- return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
- } else {
- return Date.UTC(y, m, d);
- }
- }
-
- function startOf (units) {
- var time;
- units = normalizeUnits(units);
- if (units === undefined || units === 'millisecond' || !this.isValid()) {
- return this;
- }
-
- var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
-
- switch (units) {
- case 'year':
- time = startOfDate(this.year(), 0, 1);
- break;
- case 'quarter':
- time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
- break;
- case 'month':
- time = startOfDate(this.year(), this.month(), 1);
- break;
- case 'week':
- time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
- break;
- case 'isoWeek':
- time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
- break;
- case 'day':
- case 'date':
- time = startOfDate(this.year(), this.month(), this.date());
- break;
- case 'hour':
- time = this._d.valueOf();
- time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
- break;
- case 'minute':
- time = this._d.valueOf();
- time -= mod$1(time, MS_PER_MINUTE);
- break;
- case 'second':
- time = this._d.valueOf();
- time -= mod$1(time, MS_PER_SECOND);
- break;
- }
-
- this._d.setTime(time);
- hooks.updateOffset(this, true);
- return this;
- }
-
- function endOf (units) {
- var time;
- units = normalizeUnits(units);
- if (units === undefined || units === 'millisecond' || !this.isValid()) {
- return this;
- }
-
- var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
-
- switch (units) {
- case 'year':
- time = startOfDate(this.year() + 1, 0, 1) - 1;
- break;
- case 'quarter':
- time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
- break;
- case 'month':
- time = startOfDate(this.year(), this.month() + 1, 1) - 1;
- break;
- case 'week':
- time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
- break;
- case 'isoWeek':
- time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
- break;
- case 'day':
- case 'date':
- time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
- break;
- case 'hour':
- time = this._d.valueOf();
- time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
- break;
- case 'minute':
- time = this._d.valueOf();
- time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
- break;
- case 'second':
- time = this._d.valueOf();
- time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
- break;
- }
-
- this._d.setTime(time);
- hooks.updateOffset(this, true);
- return this;
- }
-
- function valueOf () {
- return this._d.valueOf() - ((this._offset || 0) * 60000);
- }
-
- function unix () {
- return Math.floor(this.valueOf() / 1000);
- }
-
- function toDate () {
- return new Date(this.valueOf());
- }
-
- function toArray () {
- var m = this;
- return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
- }
-
- function toObject () {
- var m = this;
- return {
- years: m.year(),
- months: m.month(),
- date: m.date(),
- hours: m.hours(),
- minutes: m.minutes(),
- seconds: m.seconds(),
- milliseconds: m.milliseconds()
- };
- }
-
- function toJSON () {
- // new Date(NaN).toJSON() === null
- return this.isValid() ? this.toISOString() : null;
- }
-
- function isValid$2 () {
- return isValid(this);
- }
-
- function parsingFlags () {
- return extend({}, getParsingFlags(this));
- }
-
- function invalidAt () {
- return getParsingFlags(this).overflow;
- }
-
- function creationData() {
- return {
- input: this._i,
- format: this._f,
- locale: this._locale,
- isUTC: this._isUTC,
- strict: this._strict
- };
- }
-
- // FORMATTING
-
- addFormatToken(0, ['gg', 2], 0, function () {
- return this.weekYear() % 100;
- });
-
- addFormatToken(0, ['GG', 2], 0, function () {
- return this.isoWeekYear() % 100;
- });
-
- function addWeekYearFormatToken (token, getter) {
- addFormatToken(0, [token, token.length], 0, getter);
- }
-
- addWeekYearFormatToken('gggg', 'weekYear');
- addWeekYearFormatToken('ggggg', 'weekYear');
- addWeekYearFormatToken('GGGG', 'isoWeekYear');
- addWeekYearFormatToken('GGGGG', 'isoWeekYear');
-
- // ALIASES
-
- addUnitAlias('weekYear', 'gg');
- addUnitAlias('isoWeekYear', 'GG');
-
- // PRIORITY
-
- addUnitPriority('weekYear', 1);
- addUnitPriority('isoWeekYear', 1);
-
-
- // PARSING
-
- addRegexToken('G', matchSigned);
- addRegexToken('g', matchSigned);
- addRegexToken('GG', match1to2, match2);
- addRegexToken('gg', match1to2, match2);
- addRegexToken('GGGG', match1to4, match4);
- addRegexToken('gggg', match1to4, match4);
- addRegexToken('GGGGG', match1to6, match6);
- addRegexToken('ggggg', match1to6, match6);
-
- addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
- week[token.substr(0, 2)] = toInt(input);
- });
-
- addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
- week[token] = hooks.parseTwoDigitYear(input);
- });
-
- // MOMENTS
-
- function getSetWeekYear (input) {
- return getSetWeekYearHelper.call(this,
- input,
- this.week(),
- this.weekday(),
- this.localeData()._week.dow,
- this.localeData()._week.doy);
- }
-
- function getSetISOWeekYear (input) {
- return getSetWeekYearHelper.call(this,
- input, this.isoWeek(), this.isoWeekday(), 1, 4);
- }
-
- function getISOWeeksInYear () {
- return weeksInYear(this.year(), 1, 4);
- }
-
- function getWeeksInYear () {
- var weekInfo = this.localeData()._week;
- return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
- }
-
- function getSetWeekYearHelper(input, week, weekday, dow, doy) {
- var weeksTarget;
- if (input == null) {
- return weekOfYear(this, dow, doy).year;
- } else {
- weeksTarget = weeksInYear(input, dow, doy);
- if (week > weeksTarget) {
- week = weeksTarget;
- }
- return setWeekAll.call(this, input, week, weekday, dow, doy);
- }
- }
-
- function setWeekAll(weekYear, week, weekday, dow, doy) {
- var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
- date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
-
- this.year(date.getUTCFullYear());
- this.month(date.getUTCMonth());
- this.date(date.getUTCDate());
- return this;
- }
-
- // FORMATTING
-
- addFormatToken('Q', 0, 'Qo', 'quarter');
-
- // ALIASES
-
- addUnitAlias('quarter', 'Q');
-
- // PRIORITY
-
- addUnitPriority('quarter', 7);
-
- // PARSING
-
- addRegexToken('Q', match1);
- addParseToken('Q', function (input, array) {
- array[MONTH] = (toInt(input) - 1) * 3;
- });
-
- // MOMENTS
-
- function getSetQuarter (input) {
- return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
- }
-
- // FORMATTING
-
- addFormatToken('D', ['DD', 2], 'Do', 'date');
-
- // ALIASES
-
- addUnitAlias('date', 'D');
-
- // PRIORITY
- addUnitPriority('date', 9);
-
- // PARSING
-
- addRegexToken('D', match1to2);
- addRegexToken('DD', match1to2, match2);
- addRegexToken('Do', function (isStrict, locale) {
- // TODO: Remove "ordinalParse" fallback in next major release.
- return isStrict ?
- (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
- locale._dayOfMonthOrdinalParseLenient;
- });
-
- addParseToken(['D', 'DD'], DATE);
- addParseToken('Do', function (input, array) {
- array[DATE] = toInt(input.match(match1to2)[0]);
- });
-
- // MOMENTS
-
- var getSetDayOfMonth = makeGetSet('Date', true);
-
- // FORMATTING
-
- addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
-
- // ALIASES
-
- addUnitAlias('dayOfYear', 'DDD');
-
- // PRIORITY
- addUnitPriority('dayOfYear', 4);
-
- // PARSING
-
- addRegexToken('DDD', match1to3);
- addRegexToken('DDDD', match3);
- addParseToken(['DDD', 'DDDD'], function (input, array, config) {
- config._dayOfYear = toInt(input);
- });
-
- // HELPERS
-
- // MOMENTS
-
- function getSetDayOfYear (input) {
- var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
- return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
- }
-
- // FORMATTING
-
- addFormatToken('m', ['mm', 2], 0, 'minute');
-
- // ALIASES
-
- addUnitAlias('minute', 'm');
-
- // PRIORITY
-
- addUnitPriority('minute', 14);
-
- // PARSING
-
- addRegexToken('m', match1to2);
- addRegexToken('mm', match1to2, match2);
- addParseToken(['m', 'mm'], MINUTE);
-
- // MOMENTS
-
- var getSetMinute = makeGetSet('Minutes', false);
-
- // FORMATTING
-
- addFormatToken('s', ['ss', 2], 0, 'second');
-
- // ALIASES
-
- addUnitAlias('second', 's');
-
- // PRIORITY
-
- addUnitPriority('second', 15);
-
- // PARSING
-
- addRegexToken('s', match1to2);
- addRegexToken('ss', match1to2, match2);
- addParseToken(['s', 'ss'], SECOND);
-
- // MOMENTS
-
- var getSetSecond = makeGetSet('Seconds', false);
-
- // FORMATTING
-
- addFormatToken('S', 0, 0, function () {
- return ~~(this.millisecond() / 100);
- });
-
- addFormatToken(0, ['SS', 2], 0, function () {
- return ~~(this.millisecond() / 10);
- });
-
- addFormatToken(0, ['SSS', 3], 0, 'millisecond');
- addFormatToken(0, ['SSSS', 4], 0, function () {
- return this.millisecond() * 10;
- });
- addFormatToken(0, ['SSSSS', 5], 0, function () {
- return this.millisecond() * 100;
- });
- addFormatToken(0, ['SSSSSS', 6], 0, function () {
- return this.millisecond() * 1000;
- });
- addFormatToken(0, ['SSSSSSS', 7], 0, function () {
- return this.millisecond() * 10000;
- });
- addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
- return this.millisecond() * 100000;
- });
- addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
- return this.millisecond() * 1000000;
- });
-
-
- // ALIASES
-
- addUnitAlias('millisecond', 'ms');
-
- // PRIORITY
-
- addUnitPriority('millisecond', 16);
-
- // PARSING
-
- addRegexToken('S', match1to3, match1);
- addRegexToken('SS', match1to3, match2);
- addRegexToken('SSS', match1to3, match3);
-
- var token;
- for (token = 'SSSS'; token.length <= 9; token += 'S') {
- addRegexToken(token, matchUnsigned);
- }
-
- function parseMs(input, array) {
- array[MILLISECOND] = toInt(('0.' + input) * 1000);
- }
-
- for (token = 'S'; token.length <= 9; token += 'S') {
- addParseToken(token, parseMs);
- }
- // MOMENTS
-
- var getSetMillisecond = makeGetSet('Milliseconds', false);
-
- // FORMATTING
-
- addFormatToken('z', 0, 0, 'zoneAbbr');
- addFormatToken('zz', 0, 0, 'zoneName');
-
- // MOMENTS
-
- function getZoneAbbr () {
- return this._isUTC ? 'UTC' : '';
- }
-
- function getZoneName () {
- return this._isUTC ? 'Coordinated Universal Time' : '';
- }
-
- var proto = Moment.prototype;
-
- proto.add = add;
- proto.calendar = calendar$1;
- proto.clone = clone;
- proto.diff = diff;
- proto.endOf = endOf;
- proto.format = format;
- proto.from = from;
- proto.fromNow = fromNow;
- proto.to = to;
- proto.toNow = toNow;
- proto.get = stringGet;
- proto.invalidAt = invalidAt;
- proto.isAfter = isAfter;
- proto.isBefore = isBefore;
- proto.isBetween = isBetween;
- proto.isSame = isSame;
- proto.isSameOrAfter = isSameOrAfter;
- proto.isSameOrBefore = isSameOrBefore;
- proto.isValid = isValid$2;
- proto.lang = lang;
- proto.locale = locale;
- proto.localeData = localeData;
- proto.max = prototypeMax;
- proto.min = prototypeMin;
- proto.parsingFlags = parsingFlags;
- proto.set = stringSet;
- proto.startOf = startOf;
- proto.subtract = subtract;
- proto.toArray = toArray;
- proto.toObject = toObject;
- proto.toDate = toDate;
- proto.toISOString = toISOString;
- proto.inspect = inspect;
- proto.toJSON = toJSON;
- proto.toString = toString;
- proto.unix = unix;
- proto.valueOf = valueOf;
- proto.creationData = creationData;
- proto.year = getSetYear;
- proto.isLeapYear = getIsLeapYear;
- proto.weekYear = getSetWeekYear;
- proto.isoWeekYear = getSetISOWeekYear;
- proto.quarter = proto.quarters = getSetQuarter;
- proto.month = getSetMonth;
- proto.daysInMonth = getDaysInMonth;
- proto.week = proto.weeks = getSetWeek;
- proto.isoWeek = proto.isoWeeks = getSetISOWeek;
- proto.weeksInYear = getWeeksInYear;
- proto.isoWeeksInYear = getISOWeeksInYear;
- proto.date = getSetDayOfMonth;
- proto.day = proto.days = getSetDayOfWeek;
- proto.weekday = getSetLocaleDayOfWeek;
- proto.isoWeekday = getSetISODayOfWeek;
- proto.dayOfYear = getSetDayOfYear;
- proto.hour = proto.hours = getSetHour;
- proto.minute = proto.minutes = getSetMinute;
- proto.second = proto.seconds = getSetSecond;
- proto.millisecond = proto.milliseconds = getSetMillisecond;
- proto.utcOffset = getSetOffset;
- proto.utc = setOffsetToUTC;
- proto.local = setOffsetToLocal;
- proto.parseZone = setOffsetToParsedOffset;
- proto.hasAlignedHourOffset = hasAlignedHourOffset;
- proto.isDST = isDaylightSavingTime;
- proto.isLocal = isLocal;
- proto.isUtcOffset = isUtcOffset;
- proto.isUtc = isUtc;
- proto.isUTC = isUtc;
- proto.zoneAbbr = getZoneAbbr;
- proto.zoneName = getZoneName;
- proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
- proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
- proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
- proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
- proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
-
- function createUnix (input) {
- return createLocal(input * 1000);
- }
-
- function createInZone () {
- return createLocal.apply(null, arguments).parseZone();
- }
-
- function preParsePostFormat (string) {
- return string;
- }
-
- var proto$1 = Locale.prototype;
-
- proto$1.calendar = calendar;
- proto$1.longDateFormat = longDateFormat;
- proto$1.invalidDate = invalidDate;
- proto$1.ordinal = ordinal;
- proto$1.preparse = preParsePostFormat;
- proto$1.postformat = preParsePostFormat;
- proto$1.relativeTime = relativeTime;
- proto$1.pastFuture = pastFuture;
- proto$1.set = set;
-
- proto$1.months = localeMonths;
- proto$1.monthsShort = localeMonthsShort;
- proto$1.monthsParse = localeMonthsParse;
- proto$1.monthsRegex = monthsRegex;
- proto$1.monthsShortRegex = monthsShortRegex;
- proto$1.week = localeWeek;
- proto$1.firstDayOfYear = localeFirstDayOfYear;
- proto$1.firstDayOfWeek = localeFirstDayOfWeek;
-
- proto$1.weekdays = localeWeekdays;
- proto$1.weekdaysMin = localeWeekdaysMin;
- proto$1.weekdaysShort = localeWeekdaysShort;
- proto$1.weekdaysParse = localeWeekdaysParse;
-
- proto$1.weekdaysRegex = weekdaysRegex;
- proto$1.weekdaysShortRegex = weekdaysShortRegex;
- proto$1.weekdaysMinRegex = weekdaysMinRegex;
-
- proto$1.isPM = localeIsPM;
- proto$1.meridiem = localeMeridiem;
-
- function get$1 (format, index, field, setter) {
- var locale = getLocale();
- var utc = createUTC().set(setter, index);
- return locale[field](utc, format);
- }
-
- function listMonthsImpl (format, index, field) {
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
-
- format = format || '';
-
- if (index != null) {
- return get$1(format, index, field, 'month');
- }
-
- var i;
- var out = [];
- for (i = 0; i < 12; i++) {
- out[i] = get$1(format, i, field, 'month');
- }
- return out;
- }
-
- // ()
- // (5)
- // (fmt, 5)
- // (fmt)
- // (true)
- // (true, 5)
- // (true, fmt, 5)
- // (true, fmt)
- function listWeekdaysImpl (localeSorted, format, index, field) {
- if (typeof localeSorted === 'boolean') {
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
-
- format = format || '';
- } else {
- format = localeSorted;
- index = format;
- localeSorted = false;
-
- if (isNumber(format)) {
- index = format;
- format = undefined;
- }
-
- format = format || '';
- }
-
- var locale = getLocale(),
- shift = localeSorted ? locale._week.dow : 0;
-
- if (index != null) {
- return get$1(format, (index + shift) % 7, field, 'day');
- }
-
- var i;
- var out = [];
- for (i = 0; i < 7; i++) {
- out[i] = get$1(format, (i + shift) % 7, field, 'day');
- }
- return out;
- }
-
- function listMonths (format, index) {
- return listMonthsImpl(format, index, 'months');
- }
-
- function listMonthsShort (format, index) {
- return listMonthsImpl(format, index, 'monthsShort');
- }
-
- function listWeekdays (localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
- }
-
- function listWeekdaysShort (localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
- }
-
- function listWeekdaysMin (localeSorted, format, index) {
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
- }
-
- getSetGlobalLocale('en', {
- dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
- ordinal : function (number) {
- var b = number % 10,
- output = (toInt(number % 100 / 10) === 1) ? 'th' :
- (b === 1) ? 'st' :
- (b === 2) ? 'nd' :
- (b === 3) ? 'rd' : 'th';
- return number + output;
- }
- });
-
- // Side effect imports
-
- hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
- hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
-
- var mathAbs = Math.abs;
-
- function abs () {
- var data = this._data;
-
- this._milliseconds = mathAbs(this._milliseconds);
- this._days = mathAbs(this._days);
- this._months = mathAbs(this._months);
-
- data.milliseconds = mathAbs(data.milliseconds);
- data.seconds = mathAbs(data.seconds);
- data.minutes = mathAbs(data.minutes);
- data.hours = mathAbs(data.hours);
- data.months = mathAbs(data.months);
- data.years = mathAbs(data.years);
-
- return this;
- }
-
- function addSubtract$1 (duration, input, value, direction) {
- var other = createDuration(input, value);
-
- duration._milliseconds += direction * other._milliseconds;
- duration._days += direction * other._days;
- duration._months += direction * other._months;
-
- return duration._bubble();
- }
-
- // supports only 2.0-style add(1, 's') or add(duration)
- function add$1 (input, value) {
- return addSubtract$1(this, input, value, 1);
- }
-
- // supports only 2.0-style subtract(1, 's') or subtract(duration)
- function subtract$1 (input, value) {
- return addSubtract$1(this, input, value, -1);
- }
-
- function absCeil (number) {
- if (number < 0) {
- return Math.floor(number);
- } else {
- return Math.ceil(number);
- }
- }
-
- function bubble () {
- var milliseconds = this._milliseconds;
- var days = this._days;
- var months = this._months;
- var data = this._data;
- var seconds, minutes, hours, years, monthsFromDays;
-
- // if we have a mix of positive and negative values, bubble down first
- // check: https://github.com/moment/moment/issues/2166
- if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
- (milliseconds <= 0 && days <= 0 && months <= 0))) {
- milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
- days = 0;
- months = 0;
- }
-
- // The following code bubbles up values, see the tests for
- // examples of what that means.
- data.milliseconds = milliseconds % 1000;
-
- seconds = absFloor(milliseconds / 1000);
- data.seconds = seconds % 60;
-
- minutes = absFloor(seconds / 60);
- data.minutes = minutes % 60;
-
- hours = absFloor(minutes / 60);
- data.hours = hours % 24;
-
- days += absFloor(hours / 24);
-
- // convert days to months
- monthsFromDays = absFloor(daysToMonths(days));
- months += monthsFromDays;
- days -= absCeil(monthsToDays(monthsFromDays));
-
- // 12 months -> 1 year
- years = absFloor(months / 12);
- months %= 12;
-
- data.days = days;
- data.months = months;
- data.years = years;
-
- return this;
- }
-
- function daysToMonths (days) {
- // 400 years have 146097 days (taking into account leap year rules)
- // 400 years have 12 months === 4800
- return days * 4800 / 146097;
- }
-
- function monthsToDays (months) {
- // the reverse of daysToMonths
- return months * 146097 / 4800;
- }
-
- function as (units) {
- if (!this.isValid()) {
- return NaN;
- }
- var days;
- var months;
- var milliseconds = this._milliseconds;
-
- units = normalizeUnits(units);
-
- if (units === 'month' || units === 'quarter' || units === 'year') {
- days = this._days + milliseconds / 864e5;
- months = this._months + daysToMonths(days);
- switch (units) {
- case 'month': return months;
- case 'quarter': return months / 3;
- case 'year': return months / 12;
- }
- } else {
- // handle milliseconds separately because of floating point math errors (issue #1867)
- days = this._days + Math.round(monthsToDays(this._months));
- switch (units) {
- case 'week' : return days / 7 + milliseconds / 6048e5;
- case 'day' : return days + milliseconds / 864e5;
- case 'hour' : return days * 24 + milliseconds / 36e5;
- case 'minute' : return days * 1440 + milliseconds / 6e4;
- case 'second' : return days * 86400 + milliseconds / 1000;
- // Math.floor prevents floating point math errors here
- case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
- default: throw new Error('Unknown unit ' + units);
- }
- }
- }
-
- // TODO: Use this.as('ms')?
- function valueOf$1 () {
- if (!this.isValid()) {
- return NaN;
- }
- return (
- this._milliseconds +
- this._days * 864e5 +
- (this._months % 12) * 2592e6 +
- toInt(this._months / 12) * 31536e6
- );
- }
-
- function makeAs (alias) {
- return function () {
- return this.as(alias);
- };
- }
-
- var asMilliseconds = makeAs('ms');
- var asSeconds = makeAs('s');
- var asMinutes = makeAs('m');
- var asHours = makeAs('h');
- var asDays = makeAs('d');
- var asWeeks = makeAs('w');
- var asMonths = makeAs('M');
- var asQuarters = makeAs('Q');
- var asYears = makeAs('y');
-
- function clone$1 () {
- return createDuration(this);
- }
-
- function get$2 (units) {
- units = normalizeUnits(units);
- return this.isValid() ? this[units + 's']() : NaN;
- }
-
- function makeGetter(name) {
- return function () {
- return this.isValid() ? this._data[name] : NaN;
- };
- }
-
- var milliseconds = makeGetter('milliseconds');
- var seconds = makeGetter('seconds');
- var minutes = makeGetter('minutes');
- var hours = makeGetter('hours');
- var days = makeGetter('days');
- var months = makeGetter('months');
- var years = makeGetter('years');
-
- function weeks () {
- return absFloor(this.days() / 7);
- }
-
- var round = Math.round;
- var thresholds = {
- ss: 44, // a few seconds to seconds
- s : 45, // seconds to minute
- m : 45, // minutes to hour
- h : 22, // hours to day
- d : 26, // days to month
- M : 11 // months to year
- };
-
- // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
- function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
- return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
- }
-
- function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
- var duration = createDuration(posNegDuration).abs();
- var seconds = round(duration.as('s'));
- var minutes = round(duration.as('m'));
- var hours = round(duration.as('h'));
- var days = round(duration.as('d'));
- var months = round(duration.as('M'));
- var years = round(duration.as('y'));
-
- var a = seconds <= thresholds.ss && ['s', seconds] ||
- seconds < thresholds.s && ['ss', seconds] ||
- minutes <= 1 && ['m'] ||
- minutes < thresholds.m && ['mm', minutes] ||
- hours <= 1 && ['h'] ||
- hours < thresholds.h && ['hh', hours] ||
- days <= 1 && ['d'] ||
- days < thresholds.d && ['dd', days] ||
- months <= 1 && ['M'] ||
- months < thresholds.M && ['MM', months] ||
- years <= 1 && ['y'] || ['yy', years];
-
- a[2] = withoutSuffix;
- a[3] = +posNegDuration > 0;
- a[4] = locale;
- return substituteTimeAgo.apply(null, a);
- }
-
- // This function allows you to set the rounding function for relative time strings
- function getSetRelativeTimeRounding (roundingFunction) {
- if (roundingFunction === undefined) {
- return round;
- }
- if (typeof(roundingFunction) === 'function') {
- round = roundingFunction;
- return true;
- }
- return false;
- }
-
- // This function allows you to set a threshold for relative time strings
- function getSetRelativeTimeThreshold (threshold, limit) {
- if (thresholds[threshold] === undefined) {
- return false;
- }
- if (limit === undefined) {
- return thresholds[threshold];
- }
- thresholds[threshold] = limit;
- if (threshold === 's') {
- thresholds.ss = limit - 1;
- }
- return true;
- }
-
- function humanize (withSuffix) {
- if (!this.isValid()) {
- return this.localeData().invalidDate();
- }
-
- var locale = this.localeData();
- var output = relativeTime$1(this, !withSuffix, locale);
-
- if (withSuffix) {
- output = locale.pastFuture(+this, output);
- }
-
- return locale.postformat(output);
- }
-
- var abs$1 = Math.abs;
-
- function sign(x) {
- return ((x > 0) - (x < 0)) || +x;
- }
-
- function toISOString$1() {
- // for ISO strings we do not use the normal bubbling rules:
- // * milliseconds bubble up until they become hours
- // * days do not bubble at all
- // * months bubble up until they become years
- // This is because there is no context-free conversion between hours and days
- // (think of clock changes)
- // and also not between days and months (28-31 days per month)
- if (!this.isValid()) {
- return this.localeData().invalidDate();
- }
-
- var seconds = abs$1(this._milliseconds) / 1000;
- var days = abs$1(this._days);
- var months = abs$1(this._months);
- var minutes, hours, years;
-
- // 3600 seconds -> 60 minutes -> 1 hour
- minutes = absFloor(seconds / 60);
- hours = absFloor(minutes / 60);
- seconds %= 60;
- minutes %= 60;
-
- // 12 months -> 1 year
- years = absFloor(months / 12);
- months %= 12;
-
-
- // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
- var Y = years;
- var M = months;
- var D = days;
- var h = hours;
- var m = minutes;
- var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
- var total = this.asSeconds();
-
- if (!total) {
- // this is the same as C#'s (Noda) and python (isodate)...
- // but not other JS (goog.date)
- return 'P0D';
- }
-
- var totalSign = total < 0 ? '-' : '';
- var ymSign = sign(this._months) !== sign(total) ? '-' : '';
- var daysSign = sign(this._days) !== sign(total) ? '-' : '';
- var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
-
- return totalSign + 'P' +
- (Y ? ymSign + Y + 'Y' : '') +
- (M ? ymSign + M + 'M' : '') +
- (D ? daysSign + D + 'D' : '') +
- ((h || m || s) ? 'T' : '') +
- (h ? hmsSign + h + 'H' : '') +
- (m ? hmsSign + m + 'M' : '') +
- (s ? hmsSign + s + 'S' : '');
- }
-
- var proto$2 = Duration.prototype;
-
- proto$2.isValid = isValid$1;
- proto$2.abs = abs;
- proto$2.add = add$1;
- proto$2.subtract = subtract$1;
- proto$2.as = as;
- proto$2.asMilliseconds = asMilliseconds;
- proto$2.asSeconds = asSeconds;
- proto$2.asMinutes = asMinutes;
- proto$2.asHours = asHours;
- proto$2.asDays = asDays;
- proto$2.asWeeks = asWeeks;
- proto$2.asMonths = asMonths;
- proto$2.asQuarters = asQuarters;
- proto$2.asYears = asYears;
- proto$2.valueOf = valueOf$1;
- proto$2._bubble = bubble;
- proto$2.clone = clone$1;
- proto$2.get = get$2;
- proto$2.milliseconds = milliseconds;
- proto$2.seconds = seconds;
- proto$2.minutes = minutes;
- proto$2.hours = hours;
- proto$2.days = days;
- proto$2.weeks = weeks;
- proto$2.months = months;
- proto$2.years = years;
- proto$2.humanize = humanize;
- proto$2.toISOString = toISOString$1;
- proto$2.toString = toISOString$1;
- proto$2.toJSON = toISOString$1;
- proto$2.locale = locale;
- proto$2.localeData = localeData;
-
- proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
- proto$2.lang = lang;
-
- // Side effect imports
-
- // FORMATTING
-
- addFormatToken('X', 0, 0, 'unix');
- addFormatToken('x', 0, 0, 'valueOf');
-
- // PARSING
-
- addRegexToken('x', matchSigned);
- addRegexToken('X', matchTimestamp);
- addParseToken('X', function (input, array, config) {
- config._d = new Date(parseFloat(input, 10) * 1000);
- });
- addParseToken('x', function (input, array, config) {
- config._d = new Date(toInt(input));
- });
-
- // Side effect imports
-
-
- hooks.version = '2.24.0';
-
- setHookCallback(createLocal);
-
- hooks.fn = proto;
- hooks.min = min;
- hooks.max = max;
- hooks.now = now;
- hooks.utc = createUTC;
- hooks.unix = createUnix;
- hooks.months = listMonths;
- hooks.isDate = isDate;
- hooks.locale = getSetGlobalLocale;
- hooks.invalid = createInvalid;
- hooks.duration = createDuration;
- hooks.isMoment = isMoment;
- hooks.weekdays = listWeekdays;
- hooks.parseZone = createInZone;
- hooks.localeData = getLocale;
- hooks.isDuration = isDuration;
- hooks.monthsShort = listMonthsShort;
- hooks.weekdaysMin = listWeekdaysMin;
- hooks.defineLocale = defineLocale;
- hooks.updateLocale = updateLocale;
- hooks.locales = listLocales;
- hooks.weekdaysShort = listWeekdaysShort;
- hooks.normalizeUnits = normalizeUnits;
- hooks.relativeTimeRounding = getSetRelativeTimeRounding;
- hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
- hooks.calendarFormat = getCalendarFormat;
- hooks.prototype = proto;
-
- // currently HTML5 input type only supports 24-hour formats
- hooks.HTML5_FMT = {
- DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', //
- DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', //
- DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', //
- DATE: 'YYYY-MM-DD', //
- TIME: 'HH:mm', //
- TIME_SECONDS: 'HH:mm:ss', //
- TIME_MS: 'HH:mm:ss.SSS', //
- WEEK: 'GGGG-[W]WW', //
- MONTH: 'YYYY-MM' //
- };
-
- return hooks;
-
-})));
-
-typeof navigator === "object" && (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define('Plyr', factory) :
- (global.Plyr = factory());
-}(this, (function () { 'use strict';
-
- // Polyfill for creating CustomEvents on IE9/10/11
-
- // code pulled from:
- // https://github.com/d4tocchini/customevent-polyfill
- // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill
-
- (function() {
- if (typeof window === 'undefined') {
- return;
- }
-
- try {
- var ce = new window.CustomEvent('test', { cancelable: true });
- ce.preventDefault();
- if (ce.defaultPrevented !== true) {
- // IE has problems with .preventDefault() on custom events
- // http://stackoverflow.com/questions/23349191
- throw new Error('Could not prevent default');
- }
- } catch (e) {
- var CustomEvent = function(event, params) {
- var evt, origPrevent;
- params = params || {
- bubbles: false,
- cancelable: false,
- detail: undefined
- };
-
- evt = document.createEvent('CustomEvent');
- evt.initCustomEvent(
- event,
- params.bubbles,
- params.cancelable,
- params.detail
- );
- origPrevent = evt.preventDefault;
- evt.preventDefault = function() {
- origPrevent.call(this);
- try {
- Object.defineProperty(this, 'defaultPrevented', {
- get: function() {
- return true;
- }
- });
- } catch (e) {
- this.defaultPrevented = true;
- }
- };
- return evt;
- };
-
- CustomEvent.prototype = window.Event.prototype;
- window.CustomEvent = CustomEvent; // expose definition to window
- }
- })();
-
- var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
-
- (function(global) {
- /**
- * Polyfill URLSearchParams
- *
- * Inspired from : https://github.com/WebReflection/url-search-params/blob/master/src/url-search-params.js
- */
-
- var checkIfIteratorIsSupported = function() {
- try {
- return !!Symbol.iterator;
- } catch (error) {
- return false;
- }
- };
-
-
- var iteratorSupported = checkIfIteratorIsSupported();
-
- var createIterator = function(items) {
- var iterator = {
- next: function() {
- var value = items.shift();
- return { done: value === void 0, value: value };
- }
- };
-
- if (iteratorSupported) {
- iterator[Symbol.iterator] = function() {
- return iterator;
- };
- }
-
- return iterator;
- };
-
- /**
- * Search param name and values should be encoded according to https://url.spec.whatwg.org/#urlencoded-serializing
- * encodeURIComponent() produces the same result except encoding spaces as `%20` instead of `+`.
- */
- var serializeParam = function(value) {
- return encodeURIComponent(value).replace(/%20/g, '+');
- };
-
- var deserializeParam = function(value) {
- return decodeURIComponent(value).replace(/\+/g, ' ');
- };
-
- var polyfillURLSearchParams = function() {
-
- var URLSearchParams = function(searchString) {
- Object.defineProperty(this, '_entries', { writable: true, value: {} });
-
- if (typeof searchString === 'string') {
- if (searchString !== '') {
- this._fromString(searchString);
- }
- } else if (searchString instanceof URLSearchParams) {
- var _this = this;
- searchString.forEach(function(value, name) {
- _this.append(name, value);
- });
- }
- };
-
- var proto = URLSearchParams.prototype;
-
- proto.append = function(name, value) {
- if (name in this._entries) {
- this._entries[name].push(value.toString());
- } else {
- this._entries[name] = [value.toString()];
- }
- };
-
- proto.delete = function(name) {
- delete this._entries[name];
- };
-
- proto.get = function(name) {
- return (name in this._entries) ? this._entries[name][0] : null;
- };
-
- proto.getAll = function(name) {
- return (name in this._entries) ? this._entries[name].slice(0) : [];
- };
-
- proto.has = function(name) {
- return (name in this._entries);
- };
-
- proto.set = function(name, value) {
- this._entries[name] = [value.toString()];
- };
-
- proto.forEach = function(callback, thisArg) {
- var entries;
- for (var name in this._entries) {
- if (this._entries.hasOwnProperty(name)) {
- entries = this._entries[name];
- for (var i = 0; i < entries.length; i++) {
- callback.call(thisArg, entries[i], name, this);
- }
- }
- }
- };
-
- proto.keys = function() {
- var items = [];
- this.forEach(function(value, name) {
- items.push(name);
- });
- return createIterator(items);
- };
-
- proto.values = function() {
- var items = [];
- this.forEach(function(value) {
- items.push(value);
- });
- return createIterator(items);
- };
-
- proto.entries = function() {
- var items = [];
- this.forEach(function(value, name) {
- items.push([name, value]);
- });
- return createIterator(items);
- };
-
- if (iteratorSupported) {
- proto[Symbol.iterator] = proto.entries;
- }
-
- proto.toString = function() {
- var searchArray = [];
- this.forEach(function(value, name) {
- searchArray.push(serializeParam(name) + '=' + serializeParam(value));
- });
- return searchArray.join('&');
- };
-
- Object.defineProperty(proto, '_fromString', {
- enumerable: false,
- configurable: false,
- writable: false,
- value: function(searchString) {
- this._entries = {};
- searchString = searchString.replace(/^\?/, '');
- var attributes = searchString.split('&');
- var attribute;
- for (var i = 0; i < attributes.length; i++) {
- attribute = attributes[i].split('=');
- this.append(
- deserializeParam(attribute[0]),
- (attribute.length > 1) ? deserializeParam(attribute[1]) : ''
- );
- }
- }
- });
-
- global.URLSearchParams = URLSearchParams;
- };
-
- if (!('URLSearchParams' in global) || (new URLSearchParams('?a=1').toString() !== 'a=1')) {
- polyfillURLSearchParams();
- }
-
- if (typeof URLSearchParams.prototype.sort !== 'function') {
- URLSearchParams.prototype.sort = function() {
- var _this = this;
- var items = [];
- this.forEach(function(value, name) {
- items.push([name, value]);
- if (!_this._entries) {
- _this.delete(name);
- }
- });
- items.sort(function(a, b) {
- if (a[0] < b[0]) {
- return -1;
- } else if (a[0] > b[0]) {
- return +1;
- } else {
- return 0;
- }
- });
- if (_this._entries) { // force reset because IE keeps keys index
- _this._entries = {};
- }
- for (var i = 0; i < items.length; i++) {
- this.append(items[i][0], items[i][1]);
- }
- };
- }
-
- // HTMLAnchorElement
-
- })(
- (typeof commonjsGlobal !== 'undefined') ? commonjsGlobal
- : ((typeof window !== 'undefined') ? window
- : ((typeof self !== 'undefined') ? self : commonjsGlobal))
- );
-
- (function(global) {
- /**
- * Polyfill URL
- *
- * Inspired from : https://github.com/arv/DOM-URL-Polyfill/blob/master/src/url.js
- */
-
- var checkIfURLIsSupported = function() {
- try {
- var u = new URL('b', 'http://a');
- u.pathname = 'c%20d';
- return (u.href === 'http://a/c%20d') && u.searchParams;
- } catch (e) {
- return false;
- }
- };
-
-
- var polyfillURL = function() {
- var _URL = global.URL;
-
- var URL = function(url, base) {
- if (typeof url !== 'string') url = String(url);
-
- // Only create another document if the base is different from current location.
- var doc = document, baseElement;
- if (base && (global.location === void 0 || base !== global.location.href)) {
- doc = document.implementation.createHTMLDocument('');
- baseElement = doc.createElement('base');
- baseElement.href = base;
- doc.head.appendChild(baseElement);
- try {
- if (baseElement.href.indexOf(base) !== 0) throw new Error(baseElement.href);
- } catch (err) {
- throw new Error('URL unable to set base ' + base + ' due to ' + err);
- }
- }
-
- var anchorElement = doc.createElement('a');
- anchorElement.href = url;
- if (baseElement) {
- doc.body.appendChild(anchorElement);
- anchorElement.href = anchorElement.href; // force href to refresh
- }
-
- if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href)) {
- throw new TypeError('Invalid URL');
- }
-
- Object.defineProperty(this, '_anchorElement', {
- value: anchorElement
- });
-
-
- // create a linked searchParams which reflect its changes on URL
- var searchParams = new URLSearchParams(this.search);
- var enableSearchUpdate = true;
- var enableSearchParamsUpdate = true;
- var _this = this;
- ['append', 'delete', 'set'].forEach(function(methodName) {
- var method = searchParams[methodName];
- searchParams[methodName] = function() {
- method.apply(searchParams, arguments);
- if (enableSearchUpdate) {
- enableSearchParamsUpdate = false;
- _this.search = searchParams.toString();
- enableSearchParamsUpdate = true;
- }
- };
- });
-
- Object.defineProperty(this, 'searchParams', {
- value: searchParams,
- enumerable: true
- });
-
- var search = void 0;
- Object.defineProperty(this, '_updateSearchParams', {
- enumerable: false,
- configurable: false,
- writable: false,
- value: function() {
- if (this.search !== search) {
- search = this.search;
- if (enableSearchParamsUpdate) {
- enableSearchUpdate = false;
- this.searchParams._fromString(this.search);
- enableSearchUpdate = true;
- }
- }
- }
- });
- };
-
- var proto = URL.prototype;
-
- var linkURLWithAnchorAttribute = function(attributeName) {
- Object.defineProperty(proto, attributeName, {
- get: function() {
- return this._anchorElement[attributeName];
- },
- set: function(value) {
- this._anchorElement[attributeName] = value;
- },
- enumerable: true
- });
- };
-
- ['hash', 'host', 'hostname', 'port', 'protocol']
- .forEach(function(attributeName) {
- linkURLWithAnchorAttribute(attributeName);
- });
-
- Object.defineProperty(proto, 'search', {
- get: function() {
- return this._anchorElement['search'];
- },
- set: function(value) {
- this._anchorElement['search'] = value;
- this._updateSearchParams();
- },
- enumerable: true
- });
-
- Object.defineProperties(proto, {
-
- 'toString': {
- get: function() {
- var _this = this;
- return function() {
- return _this.href;
- };
- }
- },
-
- 'href': {
- get: function() {
- return this._anchorElement.href.replace(/\?$/, '');
- },
- set: function(value) {
- this._anchorElement.href = value;
- this._updateSearchParams();
- },
- enumerable: true
- },
-
- 'pathname': {
- get: function() {
- return this._anchorElement.pathname.replace(/(^\/?)/, '/');
- },
- set: function(value) {
- this._anchorElement.pathname = value;
- },
- enumerable: true
- },
-
- 'origin': {
- get: function() {
- // get expected port from protocol
- var expectedPort = { 'http:': 80, 'https:': 443, 'ftp:': 21 }[this._anchorElement.protocol];
- // add port to origin if, expected port is different than actual port
- // and it is not empty f.e http://foo:8080
- // 8080 != 80 && 8080 != ''
- var addPortToOrigin = this._anchorElement.port != expectedPort &&
- this._anchorElement.port !== '';
-
- return this._anchorElement.protocol +
- '//' +
- this._anchorElement.hostname +
- (addPortToOrigin ? (':' + this._anchorElement.port) : '');
- },
- enumerable: true
- },
-
- 'password': { // TODO
- get: function() {
- return '';
- },
- set: function(value) {
- },
- enumerable: true
- },
-
- 'username': { // TODO
- get: function() {
- return '';
- },
- set: function(value) {
- },
- enumerable: true
- },
- });
-
- URL.createObjectURL = function(blob) {
- return _URL.createObjectURL.apply(_URL, arguments);
- };
-
- URL.revokeObjectURL = function(url) {
- return _URL.revokeObjectURL.apply(_URL, arguments);
- };
-
- global.URL = URL;
-
- };
-
- if (!checkIfURLIsSupported()) {
- polyfillURL();
- }
-
- if ((global.location !== void 0) && !('origin' in global.location)) {
- var getOrigin = function() {
- return global.location.protocol + '//' + global.location.hostname + (global.location.port ? (':' + global.location.port) : '');
- };
-
- try {
- Object.defineProperty(global.location, 'origin', {
- get: getOrigin,
- enumerable: true
- });
- } catch (e) {
- setInterval(function() {
- global.location.origin = getOrigin();
- }, 100);
- }
- }
-
- })(
- (typeof commonjsGlobal !== 'undefined') ? commonjsGlobal
- : ((typeof window !== 'undefined') ? window
- : ((typeof self !== 'undefined') ? self : commonjsGlobal))
- );
-
- var _aFunction = function (it) {
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
- return it;
- };
-
- // optional / simple context binding
-
- var _ctx = function (fn, that, length) {
- _aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- case 1: return function (a) {
- return fn.call(that, a);
- };
- case 2: return function (a, b) {
- return fn.call(that, a, b);
- };
- case 3: return function (a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
-
- var _global = createCommonjsModule(function (module) {
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
- if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
- });
-
- var _core = createCommonjsModule(function (module) {
- var core = module.exports = { version: '2.5.7' };
- if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
- });
- var _core_1 = _core.version;
-
- var _isObject = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
-
- var _anObject = function (it) {
- if (!_isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
- };
-
- var _fails = function (exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
- };
-
- // Thank's IE8 for his funny defineProperty
- var _descriptors = !_fails(function () {
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
- });
-
- var document$1 = _global.document;
- // typeof document.createElement is 'object' in old IE
- var is = _isObject(document$1) && _isObject(document$1.createElement);
- var _domCreate = function (it) {
- return is ? document$1.createElement(it) : {};
- };
-
- var _ie8DomDefine = !_descriptors && !_fails(function () {
- return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
- });
-
- // 7.1.1 ToPrimitive(input [, PreferredType])
-
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- var _toPrimitive = function (it, S) {
- if (!_isObject(it)) return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
-
- var dP = Object.defineProperty;
-
- var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- _anObject(O);
- P = _toPrimitive(P, true);
- _anObject(Attributes);
- if (_ie8DomDefine) try {
- return dP(O, P, Attributes);
- } catch (e) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
-
- var _objectDp = {
- f: f
- };
-
- var _propertyDesc = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
-
- var _hide = _descriptors ? function (object, key, value) {
- return _objectDp.f(object, key, _propertyDesc(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
-
- var hasOwnProperty = {}.hasOwnProperty;
- var _has = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
-
- var id = 0;
- var px = Math.random();
- var _uid = function (key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
-
- var _redefine = createCommonjsModule(function (module) {
- var SRC = _uid('src');
- var TO_STRING = 'toString';
- var $toString = Function[TO_STRING];
- var TPL = ('' + $toString).split(TO_STRING);
-
- _core.inspectSource = function (it) {
- return $toString.call(it);
- };
-
- (module.exports = function (O, key, val, safe) {
- var isFunction = typeof val == 'function';
- if (isFunction) _has(val, 'name') || _hide(val, 'name', key);
- if (O[key] === val) return;
- if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
- if (O === _global) {
- O[key] = val;
- } else if (!safe) {
- delete O[key];
- _hide(O, key, val);
- } else if (O[key]) {
- O[key] = val;
- } else {
- _hide(O, key, val);
- }
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, TO_STRING, function toString() {
- return typeof this == 'function' && this[SRC] || $toString.call(this);
- });
- });
-
- var PROTOTYPE = 'prototype';
-
- var $export = function (type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];
- var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
- var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
- var key, own, out, exp;
- if (IS_GLOBAL) source = name;
- for (key in source) {
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- // export native or passed
- out = (own ? target : source)[key];
- // bind timers to global for call from export context
- exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
- // extend global
- if (target) _redefine(target, key, out, type & $export.U);
- // export
- if (exports[key] != out) _hide(exports, key, exp);
- if (IS_PROTO && expProto[key] != out) expProto[key] = out;
- }
- };
- _global.core = _core;
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- var _export = $export;
-
- // 7.2.1 RequireObjectCoercible(argument)
- var _defined = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
-
- // 7.1.13 ToObject(argument)
-
- var _toObject = function (it) {
- return Object(_defined(it));
- };
-
- // call something on iterator step with safe closing on error
-
- var _iterCall = function (iterator, fn, value, entries) {
- try {
- return entries ? fn(_anObject(value)[0], value[1]) : fn(value);
- // 7.4.6 IteratorClose(iterator, completion)
- } catch (e) {
- var ret = iterator['return'];
- if (ret !== undefined) _anObject(ret.call(iterator));
- throw e;
- }
- };
-
- var _iterators = {};
-
- var _library = false;
-
- var _shared = createCommonjsModule(function (module) {
- var SHARED = '__core-js_shared__';
- var store = _global[SHARED] || (_global[SHARED] = {});
-
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: _core.version,
- mode: 'global',
- copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
- });
- });
-
- var _wks = createCommonjsModule(function (module) {
- var store = _shared('wks');
-
- var Symbol = _global.Symbol;
- var USE_SYMBOL = typeof Symbol == 'function';
-
- var $exports = module.exports = function (name) {
- return store[name] || (store[name] =
- USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name));
- };
-
- $exports.store = store;
- });
-
- // check on default Array iterator
-
- var ITERATOR = _wks('iterator');
- var ArrayProto = Array.prototype;
-
- var _isArrayIter = function (it) {
- return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR] === it);
- };
-
- // 7.1.4 ToInteger
- var ceil = Math.ceil;
- var floor = Math.floor;
- var _toInteger = function (it) {
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
-
- // 7.1.15 ToLength
-
- var min = Math.min;
- var _toLength = function (it) {
- return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
- };
-
- var _createProperty = function (object, index, value) {
- if (index in object) _objectDp.f(object, index, _propertyDesc(0, value));
- else object[index] = value;
- };
-
- var toString = {}.toString;
-
- var _cof = function (it) {
- return toString.call(it).slice(8, -1);
- };
-
- // getting tag from 19.1.3.6 Object.prototype.toString()
-
- var TAG = _wks('toStringTag');
- // ES3 wrong here
- var ARG = _cof(function () { return arguments; }()) == 'Arguments';
-
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (e) { /* empty */ }
- };
-
- var _classof = function (it) {
- var O, T, B;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
- // builtinTag case
- : ARG ? _cof(O)
- // ES3 arguments fallback
- : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
- };
-
- var ITERATOR$1 = _wks('iterator');
-
- var core_getIteratorMethod = _core.getIteratorMethod = function (it) {
- if (it != undefined) return it[ITERATOR$1]
- || it['@@iterator']
- || _iterators[_classof(it)];
- };
-
- var ITERATOR$2 = _wks('iterator');
- var SAFE_CLOSING = false;
-
- try {
- var riter = [7][ITERATOR$2]();
- riter['return'] = function () { SAFE_CLOSING = true; };
- } catch (e) { /* empty */ }
-
- var _iterDetect = function (exec, skipClosing) {
- if (!skipClosing && !SAFE_CLOSING) return false;
- var safe = false;
- try {
- var arr = [7];
- var iter = arr[ITERATOR$2]();
- iter.next = function () { return { done: safe = true }; };
- arr[ITERATOR$2] = function () { return iter; };
- exec(arr);
- } catch (e) { /* empty */ }
- return safe;
- };
-
- _export(_export.S + _export.F * !_iterDetect(function (iter) { }), 'Array', {
- // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
- from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = _toObject(arrayLike);
- var C = typeof this == 'function' ? this : Array;
- var aLen = arguments.length;
- var mapfn = aLen > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var index = 0;
- var iterFn = core_getIteratorMethod(O);
- var length, result, step, iterator;
- if (mapping) mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
- // if object isn't iterable or it's array with default iterator - use simple case
- if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) {
- for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
- _createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value);
- }
- } else {
- length = _toLength(O.length);
- for (result = new C(length); length > index; index++) {
- _createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
- }
- }
- result.length = index;
- return result;
- }
- });
-
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
-
- // eslint-disable-next-line no-prototype-builtins
- var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
- return _cof(it) == 'String' ? it.split('') : Object(it);
- };
-
- // 7.2.2 IsArray(argument)
-
- var _isArray = Array.isArray || function isArray(arg) {
- return _cof(arg) == 'Array';
- };
-
- var SPECIES = _wks('species');
-
- var _arraySpeciesConstructor = function (original) {
- var C;
- if (_isArray(original)) {
- C = original.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;
- if (_isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return C === undefined ? Array : C;
- };
-
- // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
-
-
- var _arraySpeciesCreate = function (original, length) {
- return new (_arraySpeciesConstructor(original))(length);
- };
-
- // 0 -> Array#forEach
- // 1 -> Array#map
- // 2 -> Array#filter
- // 3 -> Array#some
- // 4 -> Array#every
- // 5 -> Array#find
- // 6 -> Array#findIndex
-
-
-
-
-
- var _arrayMethods = function (TYPE, $create) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- var create = $create || _arraySpeciesCreate;
- return function ($this, callbackfn, that) {
- var O = _toObject($this);
- var self = _iobject(O);
- var f = _ctx(callbackfn, that, 3);
- var length = _toLength(self.length);
- var index = 0;
- var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
- var val, res;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- val = self[index];
- res = f(val, index, O);
- if (TYPE) {
- if (IS_MAP) result[index] = res; // map
- else if (res) switch (TYPE) {
- case 3: return true; // some
- case 5: return val; // find
- case 6: return index; // findIndex
- case 2: result.push(val); // filter
- } else if (IS_EVERY) return false; // every
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
- };
- };
-
- // 22.1.3.31 Array.prototype[@@unscopables]
- var UNSCOPABLES = _wks('unscopables');
- var ArrayProto$1 = Array.prototype;
- if (ArrayProto$1[UNSCOPABLES] == undefined) _hide(ArrayProto$1, UNSCOPABLES, {});
- var _addToUnscopables = function (key) {
- ArrayProto$1[UNSCOPABLES][key] = true;
- };
-
- // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
-
- var $find = _arrayMethods(5);
- var KEY = 'find';
- var forced = true;
- // Shouldn't skip holes
- if (KEY in []) Array(1)[KEY](function () { forced = false; });
- _export(_export.P + _export.F * forced, 'Array', {
- find: function find(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- _addToUnscopables(KEY);
-
- var f$1 = {}.propertyIsEnumerable;
-
- var _objectPie = {
- f: f$1
- };
-
- // to indexed object, toObject with fallback for non-array-like ES3 strings
-
-
- var _toIobject = function (it) {
- return _iobject(_defined(it));
- };
-
- var gOPD = Object.getOwnPropertyDescriptor;
-
- var f$2 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
- O = _toIobject(O);
- P = _toPrimitive(P, true);
- if (_ie8DomDefine) try {
- return gOPD(O, P);
- } catch (e) { /* empty */ }
- if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);
- };
-
- var _objectGopd = {
- f: f$2
- };
-
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- /* eslint-disable no-proto */
-
-
- var check = function (O, proto) {
- _anObject(O);
- if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
- };
- var _setProto = {
- set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
- function (test, buggy, set) {
- try {
- set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2);
- set(test, []);
- buggy = !(test instanceof Array);
- } catch (e) { buggy = true; }
- return function setPrototypeOf(O, proto) {
- check(O, proto);
- if (buggy) O.__proto__ = proto;
- else set(O, proto);
- return O;
- };
- }({}, false) : undefined),
- check: check
- };
-
- var setPrototypeOf = _setProto.set;
- var _inheritIfRequired = function (that, target, C) {
- var S = target.constructor;
- var P;
- if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && _isObject(P) && setPrototypeOf) {
- setPrototypeOf(that, P);
- } return that;
- };
-
- var max = Math.max;
- var min$1 = Math.min;
- var _toAbsoluteIndex = function (index, length) {
- index = _toInteger(index);
- return index < 0 ? max(index + length, 0) : min$1(index, length);
- };
-
- // false -> Array#indexOf
- // true -> Array#includes
-
-
-
- var _arrayIncludes = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = _toIobject($this);
- var length = _toLength(O.length);
- var index = _toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
- if (O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
-
- var shared = _shared('keys');
-
- var _sharedKey = function (key) {
- return shared[key] || (shared[key] = _uid(key));
- };
-
- var arrayIndexOf = _arrayIncludes(false);
- var IE_PROTO = _sharedKey('IE_PROTO');
-
- var _objectKeysInternal = function (object, names) {
- var O = _toIobject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (_has(O, key = names[i++])) {
- ~arrayIndexOf(result, key) || result.push(key);
- }
- return result;
- };
-
- // IE 8- don't enum bug keys
- var _enumBugKeys = (
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
- ).split(',');
-
- // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
-
- var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
-
- var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return _objectKeysInternal(O, hiddenKeys);
- };
-
- var _objectGopn = {
- f: f$3
- };
-
- var _stringWs = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
- '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
-
- var space = '[' + _stringWs + ']';
- var non = '\u200b\u0085';
- var ltrim = RegExp('^' + space + space + '*');
- var rtrim = RegExp(space + space + '*$');
-
- var exporter = function (KEY, exec, ALIAS) {
- var exp = {};
- var FORCE = _fails(function () {
- return !!_stringWs[KEY]() || non[KEY]() != non;
- });
- var fn = exp[KEY] = FORCE ? exec(trim) : _stringWs[KEY];
- if (ALIAS) exp[ALIAS] = fn;
- _export(_export.P + _export.F * FORCE, 'String', exp);
- };
-
- // 1 -> String#trimLeft
- // 2 -> String#trimRight
- // 3 -> String#trim
- var trim = exporter.trim = function (string, TYPE) {
- string = String(_defined(string));
- if (TYPE & 1) string = string.replace(ltrim, '');
- if (TYPE & 2) string = string.replace(rtrim, '');
- return string;
- };
-
- var _stringTrim = exporter;
-
- // 19.1.2.14 / 15.2.3.14 Object.keys(O)
-
-
-
- var _objectKeys = Object.keys || function keys(O) {
- return _objectKeysInternal(O, _enumBugKeys);
- };
-
- var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
- _anObject(O);
- var keys = _objectKeys(Properties);
- var length = keys.length;
- var i = 0;
- var P;
- while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]);
- return O;
- };
-
- var document$2 = _global.document;
- var _html = document$2 && document$2.documentElement;
-
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
-
-
-
- var IE_PROTO$1 = _sharedKey('IE_PROTO');
- var Empty = function () { /* empty */ };
- var PROTOTYPE$1 = 'prototype';
-
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var createDict = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = _domCreate('iframe');
- var i = _enumBugKeys.length;
- var lt = '<';
- var gt = '>';
- var iframeDocument;
- iframe.style.display = 'none';
- _html.appendChild(iframe);
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
- // createDict = iframe.contentWindow.Object;
- // html.removeChild(iframe);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
- iframeDocument.close();
- createDict = iframeDocument.F;
- while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]];
- return createDict();
- };
-
- var _objectCreate = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- Empty[PROTOTYPE$1] = _anObject(O);
- result = new Empty();
- Empty[PROTOTYPE$1] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO$1] = O;
- } else result = createDict();
- return Properties === undefined ? result : _objectDps(result, Properties);
- };
-
- var gOPN = _objectGopn.f;
- var gOPD$1 = _objectGopd.f;
- var dP$1 = _objectDp.f;
- var $trim = _stringTrim.trim;
- var NUMBER = 'Number';
- var $Number = _global[NUMBER];
- var Base = $Number;
- var proto = $Number.prototype;
- // Opera ~12 has broken Object#toString
- var BROKEN_COF = _cof(_objectCreate(proto)) == NUMBER;
- var TRIM = 'trim' in String.prototype;
-
- // 7.1.3 ToNumber(argument)
- var toNumber = function (argument) {
- var it = _toPrimitive(argument, false);
- if (typeof it == 'string' && it.length > 2) {
- it = TRIM ? it.trim() : $trim(it, 3);
- var first = it.charCodeAt(0);
- var third, radix, maxCode;
- if (first === 43 || first === 45) {
- third = it.charCodeAt(2);
- if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
- } else if (first === 48) {
- switch (it.charCodeAt(1)) {
- case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
- case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
- default: return +it;
- }
- for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
- code = digits.charCodeAt(i);
- // parseInt parses a string to a first unavailable symbol
- // but ToNumber should return NaN if a string contains unavailable symbols
- if (code < 48 || code > maxCode) return NaN;
- } return parseInt(digits, radix);
- }
- } return +it;
- };
-
- if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
- $Number = function Number(value) {
- var it = arguments.length < 1 ? 0 : value;
- var that = this;
- return that instanceof $Number
- // check on 1..constructor(foo) case
- && (BROKEN_COF ? _fails(function () { proto.valueOf.call(that); }) : _cof(that) != NUMBER)
- ? _inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
- };
- for (var keys = _descriptors ? gOPN(Base) : (
- // ES3:
- 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
- // ES6 (in case, if modules with ES6 Number statics required before):
- 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
- 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
- ).split(','), j = 0, key; keys.length > j; j++) {
- if (_has(Base, key = keys[j]) && !_has($Number, key)) {
- dP$1($Number, key, gOPD$1(Base, key));
- }
- }
- $Number.prototype = proto;
- proto.constructor = $Number;
- _redefine(_global, NUMBER, $Number);
- }
-
- // most Object methods by ES6 should accept primitives
-
-
-
- var _objectSap = function (KEY, exec) {
- var fn = (_core.Object || {})[KEY] || Object[KEY];
- var exp = {};
- exp[KEY] = exec(fn);
- _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
- };
-
- // 19.1.2.14 Object.keys(O)
-
-
-
- _objectSap('keys', function () {
- return function keys(it) {
- return _objectKeys(_toObject(it));
- };
- });
-
- // 7.2.8 IsRegExp(argument)
-
-
- var MATCH = _wks('match');
- var _isRegexp = function (it) {
- var isRegExp;
- return _isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof(it) == 'RegExp');
- };
-
- // helper for String#{startsWith, endsWith, includes}
-
-
-
- var _stringContext = function (that, searchString, NAME) {
- if (_isRegexp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
- return String(_defined(that));
- };
-
- var MATCH$1 = _wks('match');
- var _failsIsRegexp = function (KEY) {
- var re = /./;
- try {
- '/./'[KEY](re);
- } catch (e) {
- try {
- re[MATCH$1] = false;
- return !'/./'[KEY](re);
- } catch (f) { /* empty */ }
- } return true;
- };
-
- var INCLUDES = 'includes';
-
- _export(_export.P + _export.F * _failsIsRegexp(INCLUDES), 'String', {
- includes: function includes(searchString /* , position = 0 */) {
- return !!~_stringContext(this, searchString, INCLUDES)
- .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
-
- // https://github.com/tc39/Array.prototype.includes
-
- var $includes = _arrayIncludes(true);
-
- _export(_export.P, 'Array', {
- includes: function includes(el /* , fromIndex = 0 */) {
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
-
- _addToUnscopables('includes');
-
- var _fixReWks = function (KEY, length, exec) {
- var SYMBOL = _wks(KEY);
- var fns = exec(_defined, SYMBOL, ''[KEY]);
- var strfn = fns[0];
- var rxfn = fns[1];
- if (_fails(function () {
- var O = {};
- O[SYMBOL] = function () { return 7; };
- return ''[KEY](O) != 7;
- })) {
- _redefine(String.prototype, KEY, strfn);
- _hide(RegExp.prototype, SYMBOL, length == 2
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
- ? function (string, arg) { return rxfn.call(string, this, arg); }
- // 21.2.5.6 RegExp.prototype[@@match](string)
- // 21.2.5.9 RegExp.prototype[@@search](string)
- : function (string) { return rxfn.call(string, this); }
- );
- }
- };
-
- // @@search logic
- _fixReWks('search', 1, function (defined, SEARCH, $search) {
- // 21.1.3.15 String.prototype.search(regexp)
- return [function search(regexp) {
- var O = defined(this);
- var fn = regexp == undefined ? undefined : regexp[SEARCH];
- return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
- }, $search];
- });
-
- // 21.2.5.3 get RegExp.prototype.flags
-
- var _flags = function () {
- var that = _anObject(this);
- var result = '';
- if (that.global) result += 'g';
- if (that.ignoreCase) result += 'i';
- if (that.multiline) result += 'm';
- if (that.unicode) result += 'u';
- if (that.sticky) result += 'y';
- return result;
- };
-
- // 21.2.5.3 get RegExp.prototype.flags()
- if (_descriptors && /./g.flags != 'g') _objectDp.f(RegExp.prototype, 'flags', {
- configurable: true,
- get: _flags
- });
-
- var TO_STRING = 'toString';
- var $toString = /./[TO_STRING];
-
- var define = function (fn) {
- _redefine(RegExp.prototype, TO_STRING, fn, true);
- };
-
- // 21.2.5.14 RegExp.prototype.toString()
- if (_fails(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
- define(function toString() {
- var R = _anObject(this);
- return '/'.concat(R.source, '/',
- 'flags' in R ? R.flags : !_descriptors && R instanceof RegExp ? _flags.call(R) : undefined);
- });
- // FF44- RegExp#toString has a wrong name
- } else if ($toString.name != TO_STRING) {
- define(function toString() {
- return $toString.call(this);
- });
- }
-
- var _iterStep = function (done, value) {
- return { value: value, done: !!done };
- };
-
- var def = _objectDp.f;
-
- var TAG$1 = _wks('toStringTag');
-
- var _setToStringTag = function (it, tag, stat) {
- if (it && !_has(it = stat ? it : it.prototype, TAG$1)) def(it, TAG$1, { configurable: true, value: tag });
- };
-
- var IteratorPrototype = {};
-
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- _hide(IteratorPrototype, _wks('iterator'), function () { return this; });
-
- var _iterCreate = function (Constructor, NAME, next) {
- Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });
- _setToStringTag(Constructor, NAME + ' Iterator');
- };
-
- // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
-
-
- var IE_PROTO$2 = _sharedKey('IE_PROTO');
- var ObjectProto = Object.prototype;
-
- var _objectGpo = Object.getPrototypeOf || function (O) {
- O = _toObject(O);
- if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
- return O.constructor.prototype;
- } return O instanceof Object ? ObjectProto : null;
- };
-
- var ITERATOR$3 = _wks('iterator');
- var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
- var FF_ITERATOR = '@@iterator';
- var KEYS = 'keys';
- var VALUES = 'values';
-
- var returnThis = function () { return this; };
-
- var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
- _iterCreate(Constructor, NAME, next);
- var getMethod = function (kind) {
- if (!BUGGY && kind in proto) return proto[kind];
- switch (kind) {
- case KEYS: return function keys() { return new Constructor(this, kind); };
- case VALUES: return function values() { return new Constructor(this, kind); };
- } return function entries() { return new Constructor(this, kind); };
- };
- var TAG = NAME + ' Iterator';
- var DEF_VALUES = DEFAULT == VALUES;
- var VALUES_BUG = false;
- var proto = Base.prototype;
- var $native = proto[ITERATOR$3] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
- var $default = $native || getMethod(DEFAULT);
- var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
- var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
- var methods, key, IteratorPrototype;
- // Fix native
- if ($anyNative) {
- IteratorPrototype = _objectGpo($anyNative.call(new Base()));
- if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
- // Set @@toStringTag to native iterators
- _setToStringTag(IteratorPrototype, TAG, true);
- // fix for some old engines
- if (typeof IteratorPrototype[ITERATOR$3] != 'function') _hide(IteratorPrototype, ITERATOR$3, returnThis);
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEF_VALUES && $native && $native.name !== VALUES) {
- VALUES_BUG = true;
- $default = function values() { return $native.call(this); };
- }
- // Define iterator
- if (BUGGY || VALUES_BUG || !proto[ITERATOR$3]) {
- _hide(proto, ITERATOR$3, $default);
- }
- // Plug for library
- _iterators[NAME] = $default;
- _iterators[TAG] = returnThis;
- if (DEFAULT) {
- methods = {
- values: DEF_VALUES ? $default : getMethod(VALUES),
- keys: IS_SET ? $default : getMethod(KEYS),
- entries: $entries
- };
- if (FORCED) for (key in methods) {
- if (!(key in proto)) _redefine(proto, key, methods[key]);
- } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);
- }
- return methods;
- };
-
- // 22.1.3.4 Array.prototype.entries()
- // 22.1.3.13 Array.prototype.keys()
- // 22.1.3.29 Array.prototype.values()
- // 22.1.3.30 Array.prototype[@@iterator]()
- var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
- this._t = _toIobject(iterated); // target
- this._i = 0; // next index
- this._k = kind; // kind
- // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
- }, function () {
- var O = this._t;
- var kind = this._k;
- var index = this._i++;
- if (!O || index >= O.length) {
- this._t = undefined;
- return _iterStep(1);
- }
- if (kind == 'keys') return _iterStep(0, index);
- if (kind == 'values') return _iterStep(0, O[index]);
- return _iterStep(0, [index, O[index]]);
- }, 'values');
-
- // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
- _iterators.Arguments = _iterators.Array;
-
- _addToUnscopables('keys');
- _addToUnscopables('values');
- _addToUnscopables('entries');
-
- var ITERATOR$4 = _wks('iterator');
- var TO_STRING_TAG = _wks('toStringTag');
- var ArrayValues = _iterators.Array;
-
- var DOMIterables = {
- CSSRuleList: true, // TODO: Not spec compliant, should be false.
- CSSStyleDeclaration: false,
- CSSValueList: false,
- ClientRectList: false,
- DOMRectList: false,
- DOMStringList: false,
- DOMTokenList: true,
- DataTransferItemList: false,
- FileList: false,
- HTMLAllCollection: false,
- HTMLCollection: false,
- HTMLFormElement: false,
- HTMLSelectElement: false,
- MediaList: true, // TODO: Not spec compliant, should be false.
- MimeTypeArray: false,
- NamedNodeMap: false,
- NodeList: true,
- PaintRequestList: false,
- Plugin: false,
- PluginArray: false,
- SVGLengthList: false,
- SVGNumberList: false,
- SVGPathSegList: false,
- SVGPointList: false,
- SVGStringList: false,
- SVGTransformList: false,
- SourceBufferList: false,
- StyleSheetList: true, // TODO: Not spec compliant, should be false.
- TextTrackCueList: false,
- TextTrackList: false,
- TouchList: false
- };
-
- for (var collections = _objectKeys(DOMIterables), i = 0; i < collections.length; i++) {
- var NAME = collections[i];
- var explicit = DOMIterables[NAME];
- var Collection = _global[NAME];
- var proto$1 = Collection && Collection.prototype;
- var key$1;
- if (proto$1) {
- if (!proto$1[ITERATOR$4]) _hide(proto$1, ITERATOR$4, ArrayValues);
- if (!proto$1[TO_STRING_TAG]) _hide(proto$1, TO_STRING_TAG, NAME);
- _iterators[NAME] = ArrayValues;
- if (explicit) for (key$1 in es6_array_iterator) if (!proto$1[key$1]) _redefine(proto$1, key$1, es6_array_iterator[key$1], true);
- }
- }
-
- // true -> String#at
- // false -> String#codePointAt
- var _stringAt = function (TO_STRING) {
- return function (that, pos) {
- var s = String(_defined(that));
- var i = _toInteger(pos);
- var l = s.length;
- var a, b;
- if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
- ? TO_STRING ? s.charAt(i) : a
- : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
- };
-
- var $at = _stringAt(true);
-
- // 21.1.3.27 String.prototype[@@iterator]()
- _iterDefine(String, 'String', function (iterated) {
- this._t = String(iterated); // target
- this._i = 0; // next index
- // 21.1.5.2.1 %StringIteratorPrototype%.next()
- }, function () {
- var O = this._t;
- var index = this._i;
- var point;
- if (index >= O.length) return { value: undefined, done: true };
- point = $at(O, index);
- this._i += point.length;
- return { value: point, done: false };
- });
-
- var _meta = createCommonjsModule(function (module) {
- var META = _uid('meta');
-
-
- var setDesc = _objectDp.f;
- var id = 0;
- var isExtensible = Object.isExtensible || function () {
- return true;
- };
- var FREEZE = !_fails(function () {
- return isExtensible(Object.preventExtensions({}));
- });
- var setMeta = function (it) {
- setDesc(it, META, { value: {
- i: 'O' + ++id, // object ID
- w: {} // weak collections IDs
- } });
- };
- var fastKey = function (it, create) {
- // return primitive with prefix
- if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!_has(it, META)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return 'F';
- // not necessary to add metadata
- if (!create) return 'E';
- // add missing metadata
- setMeta(it);
- // return object ID
- } return it[META].i;
- };
- var getWeak = function (it, create) {
- if (!_has(it, META)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return true;
- // not necessary to add metadata
- if (!create) return false;
- // add missing metadata
- setMeta(it);
- // return hash weak collections IDs
- } return it[META].w;
- };
- // add metadata on freeze-family methods calling
- var onFreeze = function (it) {
- if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it);
- return it;
- };
- var meta = module.exports = {
- KEY: META,
- NEED: false,
- fastKey: fastKey,
- getWeak: getWeak,
- onFreeze: onFreeze
- };
- });
- var _meta_1 = _meta.KEY;
- var _meta_2 = _meta.NEED;
- var _meta_3 = _meta.fastKey;
- var _meta_4 = _meta.getWeak;
- var _meta_5 = _meta.onFreeze;
-
- var f$4 = Object.getOwnPropertySymbols;
-
- var _objectGops = {
- f: f$4
- };
-
- // 19.1.2.1 Object.assign(target, source, ...)
-
-
-
-
-
- var $assign = Object.assign;
-
- // should work with symbols and should have deterministic property order (V8 bug)
- var _objectAssign = !$assign || _fails(function () {
- var A = {};
- var B = {};
- // eslint-disable-next-line no-undef
- var S = Symbol();
- var K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function (k) { B[k] = k; });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
- var T = _toObject(target);
- var aLen = arguments.length;
- var index = 1;
- var getSymbols = _objectGops.f;
- var isEnum = _objectPie.f;
- while (aLen > index) {
- var S = _iobject(arguments[index++]);
- var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
- } return T;
- } : $assign;
-
- var _redefineAll = function (target, src, safe) {
- for (var key in src) _redefine(target, key, src[key], safe);
- return target;
- };
-
- var _anInstance = function (it, Constructor, name, forbiddenField) {
- if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
- throw TypeError(name + ': incorrect invocation!');
- } return it;
- };
-
- var _forOf = createCommonjsModule(function (module) {
- var BREAK = {};
- var RETURN = {};
- var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
- var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable);
- var f = _ctx(fn, that, entries ? 2 : 1);
- var index = 0;
- var length, step, iterator, result;
- if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
- // fast case for arrays with default iterator
- if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) {
- result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
- if (result === BREAK || result === RETURN) return result;
- } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
- result = _iterCall(iterator, f, step.value, entries);
- if (result === BREAK || result === RETURN) return result;
- }
- };
- exports.BREAK = BREAK;
- exports.RETURN = RETURN;
- });
-
- var _validateCollection = function (it, TYPE) {
- if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
- return it;
- };
-
- var getWeak = _meta.getWeak;
-
-
-
-
-
-
-
- var arrayFind = _arrayMethods(5);
- var arrayFindIndex = _arrayMethods(6);
- var id$1 = 0;
-
- // fallback for uncaught frozen keys
- var uncaughtFrozenStore = function (that) {
- return that._l || (that._l = new UncaughtFrozenStore());
- };
- var UncaughtFrozenStore = function () {
- this.a = [];
- };
- var findUncaughtFrozen = function (store, key) {
- return arrayFind(store.a, function (it) {
- return it[0] === key;
- });
- };
- UncaughtFrozenStore.prototype = {
- get: function (key) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) return entry[1];
- },
- has: function (key) {
- return !!findUncaughtFrozen(this, key);
- },
- set: function (key, value) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) entry[1] = value;
- else this.a.push([key, value]);
- },
- 'delete': function (key) {
- var index = arrayFindIndex(this.a, function (it) {
- return it[0] === key;
- });
- if (~index) this.a.splice(index, 1);
- return !!~index;
- }
- };
-
- var _collectionWeak = {
- getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- _anInstance(that, C, NAME, '_i');
- that._t = NAME; // collection type
- that._i = id$1++; // collection id
- that._l = undefined; // leak store for uncaught frozen objects
- if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
- });
- _redefineAll(C.prototype, {
- // 23.3.3.2 WeakMap.prototype.delete(key)
- // 23.4.3.3 WeakSet.prototype.delete(value)
- 'delete': function (key) {
- if (!_isObject(key)) return false;
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME))['delete'](key);
- return data && _has(data, this._i) && delete data[this._i];
- },
- // 23.3.3.4 WeakMap.prototype.has(key)
- // 23.4.3.4 WeakSet.prototype.has(value)
- has: function has(key) {
- if (!_isObject(key)) return false;
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(_validateCollection(this, NAME)).has(key);
- return data && _has(data, this._i);
- }
- });
- return C;
- },
- def: function (that, key, value) {
- var data = getWeak(_anObject(key), true);
- if (data === true) uncaughtFrozenStore(that).set(key, value);
- else data[that._i] = value;
- return that;
- },
- ufstore: uncaughtFrozenStore
- };
-
- var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
- var Base = _global[NAME];
- var C = Base;
- var ADDER = IS_MAP ? 'set' : 'add';
- var proto = C && C.prototype;
- var O = {};
- var fixMethod = function (KEY) {
- var fn = proto[KEY];
- _redefine(proto, KEY,
- KEY == 'delete' ? function (a) {
- return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'has' ? function has(a) {
- return IS_WEAK && !_isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'get' ? function get(a) {
- return IS_WEAK && !_isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
- : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
- );
- };
- if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () {
- new C().entries().next();
- }))) {
- // create collection constructor
- C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
- _redefineAll(C.prototype, methods);
- _meta.NEED = true;
- } else {
- var instance = new C();
- // early implementations not supports chaining
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
- var THROWS_ON_PRIMITIVES = _fails(function () { instance.has(1); });
- // most early implementations doesn't supports iterables, most modern - not close it correctly
- var ACCEPT_ITERABLES = _iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
- // for early implementations -0 and +0 not the same
- var BUGGY_ZERO = !IS_WEAK && _fails(function () {
- // V8 ~ Chromium 42- fails only with 5+ elements
- var $instance = new C();
- var index = 5;
- while (index--) $instance[ADDER](index, index);
- return !$instance.has(-0);
- });
- if (!ACCEPT_ITERABLES) {
- C = wrapper(function (target, iterable) {
- _anInstance(target, C, NAME);
- var that = _inheritIfRequired(new Base(), target, C);
- if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
- return that;
- });
- C.prototype = proto;
- proto.constructor = C;
- }
- if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
- fixMethod('delete');
- fixMethod('has');
- IS_MAP && fixMethod('get');
- }
- if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
- // weak collections should not contains .clear method
- if (IS_WEAK && proto.clear) delete proto.clear;
- }
-
- _setToStringTag(C, NAME);
-
- O[NAME] = C;
- _export(_export.G + _export.W + _export.F * (C != Base), O);
-
- if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
-
- return C;
- };
-
- var es6_weakMap = createCommonjsModule(function (module) {
- var each = _arrayMethods(0);
-
-
-
-
-
-
-
- var WEAK_MAP = 'WeakMap';
- var getWeak = _meta.getWeak;
- var isExtensible = Object.isExtensible;
- var uncaughtFrozenStore = _collectionWeak.ufstore;
- var tmp = {};
- var InternalMap;
-
- var wrapper = function (get) {
- return function WeakMap() {
- return get(this, arguments.length > 0 ? arguments[0] : undefined);
- };
- };
-
- var methods = {
- // 23.3.3.3 WeakMap.prototype.get(key)
- get: function get(key) {
- if (_isObject(key)) {
- var data = getWeak(key);
- if (data === true) return uncaughtFrozenStore(_validateCollection(this, WEAK_MAP)).get(key);
- return data ? data[this._i] : undefined;
- }
- },
- // 23.3.3.5 WeakMap.prototype.set(key, value)
- set: function set(key, value) {
- return _collectionWeak.def(_validateCollection(this, WEAK_MAP), key, value);
- }
- };
-
- // 23.3 WeakMap Objects
- var $WeakMap = module.exports = _collection(WEAK_MAP, wrapper, methods, _collectionWeak, true, true);
-
- // IE11 WeakMap frozen keys fix
- if (_fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {
- InternalMap = _collectionWeak.getConstructor(wrapper, WEAK_MAP);
- _objectAssign(InternalMap.prototype, methods);
- _meta.NEED = true;
- each(['delete', 'has', 'get', 'set'], function (key) {
- var proto = $WeakMap.prototype;
- var method = proto[key];
- _redefine(proto, key, function (a, b) {
- // store frozen objects on internal weakmap shim
- if (_isObject(a) && !isExtensible(a)) {
- if (!this._f) this._f = new InternalMap();
- var result = this._f[key](a, b);
- return key == 'set' ? this : result;
- // store all the rest on native weakmap
- } return method.call(this, a, b);
- });
- });
- }
- });
-
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
-
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
-
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- }
-
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
- }
-
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
- }
-
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
-
- return arr2;
- }
- }
-
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
- }
-
- function _iterableToArray(iter) {
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
- }
-
- function _iterableToArrayLimit(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
-
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
-
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
-
- return _arr;
- }
-
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance");
- }
-
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
-
- // 19.1.3.1 Object.assign(target, source)
-
-
- _export(_export.S + _export.F, 'Object', { assign: _objectAssign });
-
- // @@split logic
- _fixReWks('split', 2, function (defined, SPLIT, $split) {
- var isRegExp = _isRegexp;
- var _split = $split;
- var $push = [].push;
- var $SPLIT = 'split';
- var LENGTH = 'length';
- var LAST_INDEX = 'lastIndex';
- if (
- 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
- 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
- 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
- '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
- '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
- ''[$SPLIT](/.?/)[LENGTH]
- ) {
- var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
- // based on es5-shim implementation, need to rework it
- $split = function (separator, limit) {
- var string = String(this);
- if (separator === undefined && limit === 0) return [];
- // If `separator` is not a regex, use native split
- if (!isRegExp(separator)) return _split.call(string, separator, limit);
- var output = [];
- var flags = (separator.ignoreCase ? 'i' : '') +
- (separator.multiline ? 'm' : '') +
- (separator.unicode ? 'u' : '') +
- (separator.sticky ? 'y' : '');
- var lastLastIndex = 0;
- var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
- // Make `global` and avoid `lastIndex` issues by working with a copy
- var separatorCopy = new RegExp(separator.source, flags + 'g');
- var separator2, match, lastIndex, lastLength, i;
- // Doesn't need flags gy, but they don't hurt
- if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
- while (match = separatorCopy.exec(string)) {
- // `separatorCopy.lastIndex` is not reliable cross-browser
- lastIndex = match.index + match[0][LENGTH];
- if (lastIndex > lastLastIndex) {
- output.push(string.slice(lastLastIndex, match.index));
- // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
- // eslint-disable-next-line no-loop-func
- if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {
- for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;
- });
- if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
- lastLength = match[0][LENGTH];
- lastLastIndex = lastIndex;
- if (output[LENGTH] >= splitLimit) break;
- }
- if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
- }
- if (lastLastIndex === string[LENGTH]) {
- if (lastLength || !separatorCopy.test('')) output.push('');
- } else output.push(string.slice(lastLastIndex));
- return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
- };
- // Chakra, V8
- } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
- $split = function (separator, limit) {
- return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
- };
- }
- // 21.1.3.17 String.prototype.split(separator, limit)
- return [function split(separator, limit) {
- var O = defined(this);
- var fn = separator == undefined ? undefined : separator[SPLIT];
- return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
- }, $split];
- });
-
- var isEnum = _objectPie.f;
- var _objectToArray = function (isEntries) {
- return function (it) {
- var O = _toIobject(it);
- var keys = _objectKeys(O);
- var length = keys.length;
- var i = 0;
- var result = [];
- var key;
- while (length > i) if (isEnum.call(O, key = keys[i++])) {
- result.push(isEntries ? [key, O[key]] : O[key]);
- } return result;
- };
- };
-
- // https://github.com/tc39/proposal-object-values-entries
-
- var $entries = _objectToArray(true);
-
- _export(_export.S, 'Object', {
- entries: function entries(it) {
- return $entries(it);
- }
- });
-
- // https://github.com/tc39/proposal-object-values-entries
-
- var $values = _objectToArray(false);
-
- _export(_export.S, 'Object', {
- values: function values(it) {
- return $values(it);
- }
- });
-
- // @@replace logic
- _fixReWks('replace', 2, function (defined, REPLACE, $replace) {
- // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
- return [function replace(searchValue, replaceValue) {
- var O = defined(this);
- var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
- return fn !== undefined
- ? fn.call(searchValue, O, replaceValue)
- : $replace.call(String(O), searchValue, replaceValue);
- }, $replace];
- });
-
- // 7.3.20 SpeciesConstructor(O, defaultConstructor)
-
-
- var SPECIES$1 = _wks('species');
- var _speciesConstructor = function (O, D) {
- var C = _anObject(O).constructor;
- var S;
- return C === undefined || (S = _anObject(C)[SPECIES$1]) == undefined ? D : _aFunction(S);
- };
-
- // fast apply, http://jsperf.lnkit.com/fast-apply/5
- var _invoke = function (fn, args, that) {
- var un = that === undefined;
- switch (args.length) {
- case 0: return un ? fn()
- : fn.call(that);
- case 1: return un ? fn(args[0])
- : fn.call(that, args[0]);
- case 2: return un ? fn(args[0], args[1])
- : fn.call(that, args[0], args[1]);
- case 3: return un ? fn(args[0], args[1], args[2])
- : fn.call(that, args[0], args[1], args[2]);
- case 4: return un ? fn(args[0], args[1], args[2], args[3])
- : fn.call(that, args[0], args[1], args[2], args[3]);
- } return fn.apply(that, args);
- };
-
- var process = _global.process;
- var setTask = _global.setImmediate;
- var clearTask = _global.clearImmediate;
- var MessageChannel = _global.MessageChannel;
- var Dispatch = _global.Dispatch;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = 'onreadystatechange';
- var defer, channel, port;
- var run = function () {
- var id = +this;
- // eslint-disable-next-line no-prototype-builtins
- if (queue.hasOwnProperty(id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var listener = function (event) {
- run.call(event.data);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if (!setTask || !clearTask) {
- setTask = function setImmediate(fn) {
- var args = [];
- var i = 1;
- while (arguments.length > i) args.push(arguments[i++]);
- queue[++counter] = function () {
- // eslint-disable-next-line no-new-func
- _invoke(typeof fn == 'function' ? fn : Function(fn), args);
- };
- defer(counter);
- return counter;
- };
- clearTask = function clearImmediate(id) {
- delete queue[id];
- };
- // Node.js 0.8-
- if (_cof(process) == 'process') {
- defer = function (id) {
- process.nextTick(_ctx(run, id, 1));
- };
- // Sphere (JS game engine) Dispatch API
- } else if (Dispatch && Dispatch.now) {
- defer = function (id) {
- Dispatch.now(_ctx(run, id, 1));
- };
- // Browsers with MessageChannel, includes WebWorkers
- } else if (MessageChannel) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = _ctx(port.postMessage, port, 1);
- // Browsers with postMessage, skip WebWorkers
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
- } else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) {
- defer = function (id) {
- _global.postMessage(id + '', '*');
- };
- _global.addEventListener('message', listener, false);
- // IE8-
- } else if (ONREADYSTATECHANGE in _domCreate('script')) {
- defer = function (id) {
- _html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () {
- _html.removeChild(this);
- run.call(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function (id) {
- setTimeout(_ctx(run, id, 1), 0);
- };
- }
- }
- var _task = {
- set: setTask,
- clear: clearTask
- };
-
- var macrotask = _task.set;
- var Observer = _global.MutationObserver || _global.WebKitMutationObserver;
- var process$1 = _global.process;
- var Promise$1 = _global.Promise;
- var isNode = _cof(process$1) == 'process';
-
- var _microtask = function () {
- var head, last, notify;
-
- var flush = function () {
- var parent, fn;
- if (isNode && (parent = process$1.domain)) parent.exit();
- while (head) {
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch (e) {
- if (head) notify();
- else last = undefined;
- throw e;
- }
- } last = undefined;
- if (parent) parent.enter();
- };
-
- // Node.js
- if (isNode) {
- notify = function () {
- process$1.nextTick(flush);
- };
- // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
- } else if (Observer && !(_global.navigator && _global.navigator.standalone)) {
- var toggle = true;
- var node = document.createTextNode('');
- new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
- notify = function () {
- node.data = toggle = !toggle;
- };
- // environments with maybe non-completely correct, but existent Promise
- } else if (Promise$1 && Promise$1.resolve) {
- // Promise.resolve without an argument throws an error in LG WebOS 2
- var promise = Promise$1.resolve(undefined);
- notify = function () {
- promise.then(flush);
- };
- // for other environments - macrotask based on:
- // - setImmediate
- // - MessageChannel
- // - window.postMessag
- // - onreadystatechange
- // - setTimeout
- } else {
- notify = function () {
- // strange IE + webpack dev server bug - use .call(global)
- macrotask.call(_global, flush);
- };
- }
-
- return function (fn) {
- var task = { fn: fn, next: undefined };
- if (last) last.next = task;
- if (!head) {
- head = task;
- notify();
- } last = task;
- };
- };
-
- // 25.4.1.5 NewPromiseCapability(C)
-
-
- function PromiseCapability(C) {
- var resolve, reject;
- this.promise = new C(function ($$resolve, $$reject) {
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = _aFunction(resolve);
- this.reject = _aFunction(reject);
- }
-
- var f$5 = function (C) {
- return new PromiseCapability(C);
- };
-
- var _newPromiseCapability = {
- f: f$5
- };
-
- var _perform = function (exec) {
- try {
- return { e: false, v: exec() };
- } catch (e) {
- return { e: true, v: e };
- }
- };
-
- var navigator$1 = _global.navigator;
-
- var _userAgent = navigator$1 && navigator$1.userAgent || '';
-
- var _promiseResolve = function (C, x) {
- _anObject(C);
- if (_isObject(x) && x.constructor === C) return x;
- var promiseCapability = _newPromiseCapability.f(C);
- var resolve = promiseCapability.resolve;
- resolve(x);
- return promiseCapability.promise;
- };
-
- var SPECIES$2 = _wks('species');
-
- var _setSpecies = function (KEY) {
- var C = _global[KEY];
- if (_descriptors && C && !C[SPECIES$2]) _objectDp.f(C, SPECIES$2, {
- configurable: true,
- get: function () { return this; }
- });
- };
-
- var task = _task.set;
- var microtask = _microtask();
-
-
-
-
- var PROMISE = 'Promise';
- var TypeError$1 = _global.TypeError;
- var process$2 = _global.process;
- var versions = process$2 && process$2.versions;
- var v8 = versions && versions.v8 || '';
- var $Promise = _global[PROMISE];
- var isNode$1 = _classof(process$2) == 'process';
- var empty = function () { /* empty */ };
- var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
- var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f;
-
- var USE_NATIVE = !!function () {
- try {
- // correct subclassing with @@species support
- var promise = $Promise.resolve(1);
- var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) {
- exec(empty, empty);
- };
- // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- return (isNode$1 || typeof PromiseRejectionEvent == 'function')
- && promise.then(empty) instanceof FakePromise
- // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
- // we can't detect it synchronously, so just check versions
- && v8.indexOf('6.6') !== 0
- && _userAgent.indexOf('Chrome/66') === -1;
- } catch (e) { /* empty */ }
- }();
-
- // helpers
- var isThenable = function (it) {
- var then;
- return _isObject(it) && typeof (then = it.then) == 'function' ? then : false;
- };
- var notify = function (promise, isReject) {
- if (promise._n) return;
- promise._n = true;
- var chain = promise._c;
- microtask(function () {
- var value = promise._v;
- var ok = promise._s == 1;
- var i = 0;
- var run = function (reaction) {
- var handler = ok ? reaction.ok : reaction.fail;
- var resolve = reaction.resolve;
- var reject = reaction.reject;
- var domain = reaction.domain;
- var result, then, exited;
- try {
- if (handler) {
- if (!ok) {
- if (promise._h == 2) onHandleUnhandled(promise);
- promise._h = 1;
- }
- if (handler === true) result = value;
- else {
- if (domain) domain.enter();
- result = handler(value); // may throw
- if (domain) {
- domain.exit();
- exited = true;
- }
- }
- if (result === reaction.promise) {
- reject(TypeError$1('Promise-chain cycle'));
- } else if (then = isThenable(result)) {
- then.call(result, resolve, reject);
- } else resolve(result);
- } else reject(value);
- } catch (e) {
- if (domain && !exited) domain.exit();
- reject(e);
- }
- };
- while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
- promise._c = [];
- promise._n = false;
- if (isReject && !promise._h) onUnhandled(promise);
- });
- };
- var onUnhandled = function (promise) {
- task.call(_global, function () {
- var value = promise._v;
- var unhandled = isUnhandled(promise);
- var result, handler, console;
- if (unhandled) {
- result = _perform(function () {
- if (isNode$1) {
- process$2.emit('unhandledRejection', value, promise);
- } else if (handler = _global.onunhandledrejection) {
- handler({ promise: promise, reason: value });
- } else if ((console = _global.console) && console.error) {
- console.error('Unhandled promise rejection', value);
- }
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- promise._h = isNode$1 || isUnhandled(promise) ? 2 : 1;
- } promise._a = undefined;
- if (unhandled && result.e) throw result.v;
- });
- };
- var isUnhandled = function (promise) {
- return promise._h !== 1 && (promise._a || promise._c).length === 0;
- };
- var onHandleUnhandled = function (promise) {
- task.call(_global, function () {
- var handler;
- if (isNode$1) {
- process$2.emit('rejectionHandled', promise);
- } else if (handler = _global.onrejectionhandled) {
- handler({ promise: promise, reason: promise._v });
- }
- });
- };
- var $reject = function (value) {
- var promise = this;
- if (promise._d) return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- promise._v = value;
- promise._s = 2;
- if (!promise._a) promise._a = promise._c.slice();
- notify(promise, true);
- };
- var $resolve = function (value) {
- var promise = this;
- var then;
- if (promise._d) return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- try {
- if (promise === value) throw TypeError$1("Promise can't be resolved itself");
- if (then = isThenable(value)) {
- microtask(function () {
- var wrapper = { _w: promise, _d: false }; // wrap
- try {
- then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1));
- } catch (e) {
- $reject.call(wrapper, e);
- }
- });
- } else {
- promise._v = value;
- promise._s = 1;
- notify(promise, false);
- }
- } catch (e) {
- $reject.call({ _w: promise, _d: false }, e); // wrap
- }
- };
-
- // constructor polyfill
- if (!USE_NATIVE) {
- // 25.4.3.1 Promise(executor)
- $Promise = function Promise(executor) {
- _anInstance(this, $Promise, PROMISE, '_h');
- _aFunction(executor);
- Internal.call(this);
- try {
- executor(_ctx($resolve, this, 1), _ctx($reject, this, 1));
- } catch (err) {
- $reject.call(this, err);
- }
- };
- // eslint-disable-next-line no-unused-vars
- Internal = function Promise(executor) {
- this._c = []; // <- awaiting reactions
- this._a = undefined; // <- checked in isUnhandled reactions
- this._s = 0; // <- state
- this._d = false; // <- done
- this._v = undefined; // <- value
- this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
- this._n = false; // <- notify
- };
- Internal.prototype = _redefineAll($Promise.prototype, {
- // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
- then: function then(onFulfilled, onRejected) {
- var reaction = newPromiseCapability(_speciesConstructor(this, $Promise));
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
- reaction.fail = typeof onRejected == 'function' && onRejected;
- reaction.domain = isNode$1 ? process$2.domain : undefined;
- this._c.push(reaction);
- if (this._a) this._a.push(reaction);
- if (this._s) notify(this, false);
- return reaction.promise;
- },
- // 25.4.5.1 Promise.prototype.catch(onRejected)
- 'catch': function (onRejected) {
- return this.then(undefined, onRejected);
- }
- });
- OwnPromiseCapability = function () {
- var promise = new Internal();
- this.promise = promise;
- this.resolve = _ctx($resolve, promise, 1);
- this.reject = _ctx($reject, promise, 1);
- };
- _newPromiseCapability.f = newPromiseCapability = function (C) {
- return C === $Promise || C === Wrapper
- ? new OwnPromiseCapability(C)
- : newGenericPromiseCapability(C);
- };
- }
-
- _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Promise: $Promise });
- _setToStringTag($Promise, PROMISE);
- _setSpecies(PROMISE);
- Wrapper = _core[PROMISE];
-
- // statics
- _export(_export.S + _export.F * !USE_NATIVE, PROMISE, {
- // 25.4.4.5 Promise.reject(r)
- reject: function reject(r) {
- var capability = newPromiseCapability(this);
- var $$reject = capability.reject;
- $$reject(r);
- return capability.promise;
- }
- });
- _export(_export.S + _export.F * (!USE_NATIVE), PROMISE, {
- // 25.4.4.6 Promise.resolve(x)
- resolve: function resolve(x) {
- return _promiseResolve(_library && this === Wrapper ? $Promise : this, x);
- }
- });
- _export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) {
- $Promise.all(iter)['catch'](empty);
- })), PROMISE, {
- // 25.4.4.1 Promise.all(iterable)
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = _perform(function () {
- var values = [];
- var index = 0;
- var remaining = 1;
- _forOf(iterable, false, function (promise) {
- var $index = index++;
- var alreadyCalled = false;
- values.push(undefined);
- remaining++;
- C.resolve(promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[$index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.e) reject(result.v);
- return capability.promise;
- },
- // 25.4.4.4 Promise.race(iterable)
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var reject = capability.reject;
- var result = _perform(function () {
- _forOf(iterable, false, function (promise) {
- C.resolve(promise).then(capability.resolve, reject);
- });
- });
- if (result.e) reject(result.v);
- return capability.promise;
- }
- });
-
- var STARTS_WITH = 'startsWith';
- var $startsWith = ''[STARTS_WITH];
-
- _export(_export.P + _export.F * _failsIsRegexp(STARTS_WITH), 'String', {
- startsWith: function startsWith(searchString /* , position = 0 */) {
- var that = _stringContext(this, searchString, STARTS_WITH);
- var index = _toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
- var search = String(searchString);
- return $startsWith
- ? $startsWith.call(that, search, index)
- : that.slice(index, index + search.length) === search;
- }
- });
-
- // 20.1.2.4 Number.isNaN(number)
-
-
- _export(_export.S, 'Number', {
- isNaN: function isNaN(number) {
- // eslint-disable-next-line no-self-compare
- return number != number;
- }
- });
-
- // ==========================================================================
- // Type checking utils
- // ==========================================================================
- var getConstructor = function getConstructor(input) {
- return input !== null && typeof input !== 'undefined' ? input.constructor : null;
- };
-
- var instanceOf = function instanceOf(input, constructor) {
- return Boolean(input && constructor && input instanceof constructor);
- };
-
- var isNullOrUndefined = function isNullOrUndefined(input) {
- return input === null || typeof input === 'undefined';
- };
-
- var isObject = function isObject(input) {
- return getConstructor(input) === Object;
- };
-
- var isNumber = function isNumber(input) {
- return getConstructor(input) === Number && !Number.isNaN(input);
- };
-
- var isString = function isString(input) {
- return getConstructor(input) === String;
- };
-
- var isBoolean = function isBoolean(input) {
- return getConstructor(input) === Boolean;
- };
-
- var isFunction = function isFunction(input) {
- return getConstructor(input) === Function;
- };
-
- var isArray = function isArray(input) {
- return Array.isArray(input);
- };
-
- var isWeakMap = function isWeakMap(input) {
- return instanceOf(input, WeakMap);
- };
-
- var isNodeList = function isNodeList(input) {
- return instanceOf(input, NodeList);
- };
-
- var isElement = function isElement(input) {
- return instanceOf(input, Element);
- };
-
- var isTextNode = function isTextNode(input) {
- return getConstructor(input) === Text;
- };
-
- var isEvent = function isEvent(input) {
- return instanceOf(input, Event);
- };
-
- var isKeyboardEvent = function isKeyboardEvent(input) {
- return instanceOf(input, KeyboardEvent);
- };
-
- var isCue = function isCue(input) {
- return instanceOf(input, window.TextTrackCue) || instanceOf(input, window.VTTCue);
- };
-
- var isTrack = function isTrack(input) {
- return instanceOf(input, TextTrack) || !isNullOrUndefined(input) && isString(input.kind);
- };
-
- var isEmpty = function isEmpty(input) {
- return isNullOrUndefined(input) || (isString(input) || isArray(input) || isNodeList(input)) && !input.length || isObject(input) && !Object.keys(input).length;
- };
-
- var isUrl = function isUrl(input) {
- // Accept a URL object
- if (instanceOf(input, window.URL)) {
- return true;
- } // Must be string from here
-
-
- if (!isString(input)) {
- return false;
- } // Add the protocol if required
-
-
- var string = input;
-
- if (!input.startsWith('http://') || !input.startsWith('https://')) {
- string = "http://".concat(input);
- }
-
- try {
- return !isEmpty(new URL(string).hostname);
- } catch (e) {
- return false;
- }
- };
-
- var is$1 = {
- nullOrUndefined: isNullOrUndefined,
- object: isObject,
- number: isNumber,
- string: isString,
- boolean: isBoolean,
- function: isFunction,
- array: isArray,
- weakMap: isWeakMap,
- nodeList: isNodeList,
- element: isElement,
- textNode: isTextNode,
- event: isEvent,
- keyboardEvent: isKeyboardEvent,
- cue: isCue,
- track: isTrack,
- url: isUrl,
- empty: isEmpty
- };
-
- // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
- // https://www.youtube.com/watch?v=NPM6172J22g
-
- var supportsPassiveListeners = function () {
- // Test via a getter in the options object to see if the passive property is accessed
- var supported = false;
-
- try {
- var options = Object.defineProperty({}, 'passive', {
- get: function get() {
- supported = true;
- return null;
- }
- });
- window.addEventListener('test', null, options);
- window.removeEventListener('test', null, options);
- } catch (e) {// Do nothing
- }
-
- return supported;
- }(); // Toggle event listener
-
-
- function toggleListener(element, event, callback) {
- var _this = this;
-
- var toggle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- var passive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
- var capture = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
-
- // Bail if no element, event, or callback
- if (!element || !('addEventListener' in element) || is$1.empty(event) || !is$1.function(callback)) {
- return;
- } // Allow multiple events
-
-
- var events = event.split(' '); // Build options
- // Default to just the capture boolean for browsers with no passive listener support
-
- var options = capture; // If passive events listeners are supported
-
- if (supportsPassiveListeners) {
- options = {
- // Whether the listener can be passive (i.e. default never prevented)
- passive: passive,
- // Whether the listener is a capturing listener or not
- capture: capture
- };
- } // If a single node is passed, bind the event listener
-
-
- events.forEach(function (type) {
- if (_this && _this.eventListeners && toggle) {
- // Cache event listener
- _this.eventListeners.push({
- element: element,
- type: type,
- callback: callback,
- options: options
- });
- }
-
- element[toggle ? 'addEventListener' : 'removeEventListener'](type, callback, options);
- });
- } // Bind event handler
-
- function on(element) {
- var events = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- var callback = arguments.length > 2 ? arguments[2] : undefined;
- var passive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
- var capture = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- toggleListener.call(this, element, events, callback, true, passive, capture);
- } // Unbind event handler
-
- function off(element) {
- var events = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- var callback = arguments.length > 2 ? arguments[2] : undefined;
- var passive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
- var capture = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- toggleListener.call(this, element, events, callback, false, passive, capture);
- } // Bind once-only event handler
-
- function once(element) {
- var events = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- var callback = arguments.length > 2 ? arguments[2] : undefined;
- var passive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
- var capture = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
-
- function onceCallback() {
- off(element, events, onceCallback, passive, capture);
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- callback.apply(this, args);
- }
-
- toggleListener.call(this, element, events, onceCallback, true, passive, capture);
- } // Trigger event
-
- function triggerEvent(element) {
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- var bubbles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var detail = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
-
- // Bail if no element
- if (!is$1.element(element) || is$1.empty(type)) {
- return;
- } // Create and dispatch the event
-
-
- var event = new CustomEvent(type, {
- bubbles: bubbles,
- detail: Object.assign({}, detail, {
- plyr: this
- })
- }); // Dispatch the event
-
- element.dispatchEvent(event);
- } // Unbind all cached event listeners
-
- function unbindListeners() {
- if (this && this.eventListeners) {
- this.eventListeners.forEach(function (item) {
- var element = item.element,
- type = item.type,
- callback = item.callback,
- options = item.options;
- element.removeEventListener(type, callback, options);
- });
- this.eventListeners = [];
- }
- } // Run method when / if player is ready
-
- function ready() {
- var _this2 = this;
-
- return new Promise(function (resolve) {
- return _this2.ready ? setTimeout(resolve, 0) : on.call(_this2, _this2.elements.container, 'ready', resolve);
- }).then(function () {});
- }
-
- function wrap(elements, wrapper) {
- // Convert `elements` to an array, if necessary.
- var targets = elements.length ? elements : [elements]; // Loops backwards to prevent having to clone the wrapper on the
- // first element (see `child` below).
-
- Array.from(targets).reverse().forEach(function (element, index) {
- var child = index > 0 ? wrapper.cloneNode(true) : wrapper; // Cache the current parent and sibling.
-
- var parent = element.parentNode;
- var sibling = element.nextSibling; // Wrap the element (is automatically removed from its current
- // parent).
-
- child.appendChild(element); // If the element had a sibling, insert the wrapper before
- // the sibling to maintain the HTML structure; otherwise, just
- // append it to the parent.
-
- if (sibling) {
- parent.insertBefore(child, sibling);
- } else {
- parent.appendChild(child);
- }
- });
- } // Set attributes
-
- function setAttributes(element, attributes) {
- if (!is$1.element(element) || is$1.empty(attributes)) {
- return;
- } // Assume null and undefined attributes should be left out,
- // Setting them would otherwise convert them to "null" and "undefined"
-
-
- Object.entries(attributes).filter(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 2),
- value = _ref2[1];
-
- return !is$1.nullOrUndefined(value);
- }).forEach(function (_ref3) {
- var _ref4 = _slicedToArray(_ref3, 2),
- key = _ref4[0],
- value = _ref4[1];
-
- return element.setAttribute(key, value);
- });
- } // Create a DocumentFragment
-
- function createElement(type, attributes, text) {
- // Create a new
- var element = document.createElement(type); // Set all passed attributes
-
- if (is$1.object(attributes)) {
- setAttributes(element, attributes);
- } // Add text node
-
-
- if (is$1.string(text)) {
- element.innerText = text;
- } // Return built element
-
-
- return element;
- } // Inaert an element after another
-
- function insertAfter(element, target) {
- if (!is$1.element(element) || !is$1.element(target)) {
- return;
- }
-
- target.parentNode.insertBefore(element, target.nextSibling);
- } // Insert a DocumentFragment
-
- function insertElement(type, parent, attributes, text) {
- if (!is$1.element(parent)) {
- return;
- }
-
- parent.appendChild(createElement(type, attributes, text));
- } // Remove element(s)
-
- function removeElement(element) {
- if (is$1.nodeList(element) || is$1.array(element)) {
- Array.from(element).forEach(removeElement);
- return;
- }
-
- if (!is$1.element(element) || !is$1.element(element.parentNode)) {
- return;
- }
-
- element.parentNode.removeChild(element);
- } // Remove all child elements
-
- function emptyElement(element) {
- if (!is$1.element(element)) {
- return;
- }
-
- var length = element.childNodes.length;
-
- while (length > 0) {
- element.removeChild(element.lastChild);
- length -= 1;
- }
- } // Replace element
-
- function replaceElement(newChild, oldChild) {
- if (!is$1.element(oldChild) || !is$1.element(oldChild.parentNode) || !is$1.element(newChild)) {
- return null;
- }
-
- oldChild.parentNode.replaceChild(newChild, oldChild);
- return newChild;
- } // Get an attribute object from a string selector
-
- function getAttributesFromSelector(sel, existingAttributes) {
- // For example:
- // '.test' to { class: 'test' }
- // '#test' to { id: 'test' }
- // '[data-test="test"]' to { 'data-test': 'test' }
- if (!is$1.string(sel) || is$1.empty(sel)) {
- return {};
- }
-
- var attributes = {};
- var existing = existingAttributes;
- sel.split(',').forEach(function (s) {
- // Remove whitespace
- var selector = s.trim();
- var className = selector.replace('.', '');
- var stripped = selector.replace(/[[\]]/g, ''); // Get the parts and value
-
- var parts = stripped.split('=');
- var key = parts[0];
- var value = parts.length > 1 ? parts[1].replace(/["']/g, '') : ''; // Get the first character
-
- var start = selector.charAt(0);
-
- switch (start) {
- case '.':
- // Add to existing classname
- if (is$1.object(existing) && is$1.string(existing.class)) {
- existing.class += " ".concat(className);
- }
-
- attributes.class = className;
- break;
-
- case '#':
- // ID selector
- attributes.id = selector.replace('#', '');
- break;
-
- case '[':
- // Attribute selector
- attributes[key] = value;
- break;
-
- default:
- break;
- }
- });
- return attributes;
- } // Toggle hidden
-
- function toggleHidden(element, hidden) {
- if (!is$1.element(element)) {
- return;
- }
-
- var hide = hidden;
-
- if (!is$1.boolean(hide)) {
- hide = !element.hidden;
- }
-
- if (hide) {
- element.setAttribute('hidden', '');
- } else {
- element.removeAttribute('hidden');
- }
- } // Mirror Element.classList.toggle, with IE compatibility for "force" argument
-
- function toggleClass(element, className, force) {
- if (is$1.nodeList(element)) {
- return Array.from(element).map(function (e) {
- return toggleClass(e, className, force);
- });
- }
-
- if (is$1.element(element)) {
- var method = 'toggle';
-
- if (typeof force !== 'undefined') {
- method = force ? 'add' : 'remove';
- }
-
- element.classList[method](className);
- return element.classList.contains(className);
- }
-
- return false;
- } // Has class name
-
- function hasClass(element, className) {
- return is$1.element(element) && element.classList.contains(className);
- } // Element matches selector
-
- function matches(element, selector) {
- var prototype = {
- Element: Element
- };
-
- function match() {
- return Array.from(document.querySelectorAll(selector)).includes(this);
- }
-
- var matches = prototype.matches || prototype.webkitMatchesSelector || prototype.mozMatchesSelector || prototype.msMatchesSelector || match;
- return matches.call(element, selector);
- } // Find all elements
-
- function getElements(selector) {
- return this.elements.container.querySelectorAll(selector);
- } // Find a single element
-
- function getElement(selector) {
- return this.elements.container.querySelector(selector);
- } // Trap focus inside container
-
- function trapFocus() {
- var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- var toggle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (!is$1.element(element)) {
- return;
- }
-
- var focusable = getElements.call(this, 'button:not(:disabled), input:not(:disabled), [tabindex]');
- var first = focusable[0];
- var last = focusable[focusable.length - 1];
-
- var trap = function trap(event) {
- // Bail if not tab key or not fullscreen
- if (event.key !== 'Tab' || event.keyCode !== 9) {
- return;
- } // Get the current focused element
-
-
- var focused = document.activeElement;
-
- if (focused === last && !event.shiftKey) {
- // Move focus to first element that can be tabbed if Shift isn't used
- first.focus();
- event.preventDefault();
- } else if (focused === first && event.shiftKey) {
- // Move focus to last element that can be tabbed if Shift is used
- last.focus();
- event.preventDefault();
- }
- };
-
- toggleListener.call(this, this.elements.container, 'keydown', trap, toggle, false);
- } // Set focus and tab focus class
-
- function setFocus() {
- var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- var tabFocus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- if (!is$1.element(element)) {
- return;
- } // Set regular focus
-
-
- element.focus(); // If we want to mimic keyboard focus via tab
-
- if (tabFocus) {
- toggleClass(element, this.config.classNames.tabFocus);
- }
- }
-
- var transitionEndEvent = function () {
- var element = document.createElement('span');
- var events = {
- WebkitTransition: 'webkitTransitionEnd',
- MozTransition: 'transitionend',
- OTransition: 'oTransitionEnd otransitionend',
- transition: 'transitionend'
- };
- var type = Object.keys(events).find(function (event) {
- return element.style[event] !== undefined;
- });
- return is$1.string(type) ? events[type] : false;
- }(); // Force repaint of element
-
- function repaint(element) {
- setTimeout(function () {
- try {
- toggleHidden(element, true);
- element.offsetHeight; // eslint-disable-line
-
- toggleHidden(element, false);
- } catch (e) {// Do nothing
- }
- }, 0);
- }
-
- // ==========================================================================
- // Browser sniffing
- // Unfortunately, due to mixed support, UA sniffing is required
- // ==========================================================================
- var browser = {
- isIE:
- /* @cc_on!@ */
- !!document.documentMode,
- isWebkit: 'WebkitAppearance' in document.documentElement.style && !/Edge/.test(navigator.userAgent),
- isIPhone: /(iPhone|iPod)/gi.test(navigator.platform),
- isIos: /(iPad|iPhone|iPod)/gi.test(navigator.platform)
- };
-
- var defaultCodecs = {
- 'audio/ogg': 'vorbis',
- 'audio/wav': '1',
- 'video/webm': 'vp8, vorbis',
- 'video/mp4': 'avc1.42E01E, mp4a.40.2',
- 'video/ogg': 'theora'
- }; // Check for feature support
-
- var support = {
- // Basic support
- audio: 'canPlayType' in document.createElement('audio'),
- video: 'canPlayType' in document.createElement('video'),
- // Check for support
- // Basic functionality vs full UI
- check: function check(type, provider, playsinline) {
- var canPlayInline = browser.isIPhone && playsinline && support.playsinline;
- var api = support[type] || provider !== 'html5';
- var ui = api && support.rangeInput && (type !== 'video' || !browser.isIPhone || canPlayInline);
- return {
- api: api,
- ui: ui
- };
- },
- // Picture-in-picture support
- // Safari & Chrome only currently
- pip: function () {
- if (browser.isIPhone) {
- return false;
- } // Safari
- // https://developer.apple.com/documentation/webkitjs/adding_picture_in_picture_to_your_safari_media_controls
-
-
- if (is$1.function(createElement('video').webkitSetPresentationMode)) {
- return true;
- } // Chrome
- // https://developers.google.com/web/updates/2018/10/watch-video-using-picture-in-picture
-
-
- if (document.pictureInPictureEnabled && !createElement('video').disablePictureInPicture) {
- return true;
- }
-
- return false;
- }(),
- // Airplay support
- // Safari only currently
- airplay: is$1.function(window.WebKitPlaybackTargetAvailabilityEvent),
- // Inline playback support
- // https://webkit.org/blog/6784/new-video-policies-for-ios/
- playsinline: 'playsInline' in document.createElement('video'),
- // Check for mime type support against a player instance
- // Credits: http://diveintohtml5.info/everything.html
- // Related: http://www.leanbackplayer.com/test/h5mt.html
- mime: function mime(inputType) {
- var _inputType$split = inputType.split('/'),
- _inputType$split2 = _slicedToArray(_inputType$split, 1),
- mediaType = _inputType$split2[0];
-
- if (!this.isHTML5 || mediaType !== this.type) {
- return false;
- }
-
- var type;
-
- if (inputType && inputType.includes('codecs=')) {
- // Use input directly
- type = inputType;
- } else if (inputType === 'audio/mpeg') {
- // Skip codec
- type = 'audio/mpeg;';
- } else if (inputType in defaultCodecs) {
- // Use codec
- type = "".concat(inputType, "; codecs=\"").concat(defaultCodecs[inputType], "\"");
- }
-
- try {
- return Boolean(type && this.media.canPlayType(type).replace(/no/, ''));
- } catch (err) {
- return false;
- }
- },
- // Check for textTracks support
- textTracks: 'textTracks' in document.createElement('video'),
- // Sliders
- rangeInput: function () {
- var range = document.createElement('input');
- range.type = 'range';
- return range.type === 'range';
- }(),
- // Touch
- // NOTE: Remember a device can be mouse + touch enabled so we check on first touch event
- touch: 'ontouchstart' in document.documentElement,
- // Detect transitions support
- transitions: transitionEndEvent !== false,
- // Reduced motion iOS & MacOS setting
- // https://webkit.org/blog/7551/responsive-design-for-motion/
- reducedMotion: 'matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches
- };
-
- var html5 = {
- getSources: function getSources() {
- var _this = this;
-
- if (!this.isHTML5) {
- return [];
- }
-
- var sources = Array.from(this.media.querySelectorAll('source')); // Filter out unsupported sources
-
- return sources.filter(function (source) {
- return support.mime.call(_this, source.getAttribute('type'));
- });
- },
- // Get quality levels
- getQualityOptions: function getQualityOptions() {
- // Get sizes from elements
- return html5.getSources.call(this).map(function (source) {
- return Number(source.getAttribute('size'));
- }).filter(Boolean);
- },
- extend: function extend() {
- if (!this.isHTML5) {
- return;
- }
-
- var player = this; // Quality
-
- Object.defineProperty(player.media, 'quality', {
- get: function get() {
- // Get sources
- var sources = html5.getSources.call(player);
- var source = sources.find(function (source) {
- return source.getAttribute('src') === player.source;
- }); // Return size, if match is found
-
- return source && Number(source.getAttribute('size'));
- },
- set: function set(input) {
- // Get sources
- var sources = html5.getSources.call(player); // Get first match for requested size
-
- var source = sources.find(function (source) {
- return Number(source.getAttribute('size')) === input;
- }); // No matching source found
-
- if (!source) {
- return;
- } // Get current state
-
-
- var _player$media = player.media,
- currentTime = _player$media.currentTime,
- paused = _player$media.paused,
- preload = _player$media.preload,
- readyState = _player$media.readyState; // Set new source
-
- player.media.src = source.getAttribute('src'); // Prevent loading if preload="none" and the current source isn't loaded (#1044)
-
- if (preload !== 'none' || readyState) {
- // Restore time
- player.once('loadedmetadata', function () {
- player.currentTime = currentTime; // Resume playing
-
- if (!paused) {
- player.play();
- }
- }); // Load new source
-
- player.media.load();
- } // Trigger change event
-
-
- triggerEvent.call(player, player.media, 'qualitychange', false, {
- quality: input
- });
- }
- });
- },
- // Cancel current network requests
- // See https://github.com/sampotts/plyr/issues/174
- cancelRequests: function cancelRequests() {
- if (!this.isHTML5) {
- return;
- } // Remove child sources
-
-
- removeElement(html5.getSources.call(this)); // Set blank video src attribute
- // This is to prevent a MEDIA_ERR_SRC_NOT_SUPPORTED error
- // Info: http://stackoverflow.com/questions/32231579/how-to-properly-dispose-of-an-html5-video-and-close-socket-or-connection
-
- this.media.setAttribute('src', this.config.blankVideo); // Load the new empty source
- // This will cancel existing requests
- // See https://github.com/sampotts/plyr/issues/174
-
- this.media.load(); // Debugging
-
- this.debug.log('Cancelled network requests');
- }
- };
-
- // ==========================================================================
-
- function dedupe(array) {
- if (!is$1.array(array)) {
- return array;
- }
-
- return array.filter(function (item, index) {
- return array.indexOf(item) === index;
- });
- } // Get the closest value in an array
-
- function closest(array, value) {
- if (!is$1.array(array) || !array.length) {
- return null;
- }
-
- return array.reduce(function (prev, curr) {
- return Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev;
- });
- }
-
- function cloneDeep(object) {
- return JSON.parse(JSON.stringify(object));
- } // Get a nested value in an object
-
- function getDeep(object, path) {
- return path.split('.').reduce(function (obj, key) {
- return obj && obj[key];
- }, object);
- } // Deep extend destination object with N more objects
-
- function extend() {
- var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- sources[_key - 1] = arguments[_key];
- }
-
- if (!sources.length) {
- return target;
- }
-
- var source = sources.shift();
-
- if (!is$1.object(source)) {
- return target;
- }
-
- Object.keys(source).forEach(function (key) {
- if (is$1.object(source[key])) {
- if (!Object.keys(target).includes(key)) {
- Object.assign(target, _defineProperty({}, key, {}));
- }
-
- extend(target[key], source[key]);
- } else {
- Object.assign(target, _defineProperty({}, key, source[key]));
- }
- });
- return extend.apply(void 0, [target].concat(sources));
- }
-
- var dP$2 = _objectDp.f;
- var gOPN$1 = _objectGopn.f;
-
-
- var $RegExp = _global.RegExp;
- var Base$1 = $RegExp;
- var proto$2 = $RegExp.prototype;
- var re1 = /a/g;
- var re2 = /a/g;
- // "new" creates a new object, old webkit buggy here
- var CORRECT_NEW = new $RegExp(re1) !== re1;
-
- if (_descriptors && (!CORRECT_NEW || _fails(function () {
- re2[_wks('match')] = false;
- // RegExp constructor can alter flags and IsRegExp works correct with @@match
- return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
- }))) {
- $RegExp = function RegExp(p, f) {
- var tiRE = this instanceof $RegExp;
- var piRE = _isRegexp(p);
- var fiU = f === undefined;
- return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
- : _inheritIfRequired(CORRECT_NEW
- ? new Base$1(piRE && !fiU ? p.source : p, f)
- : Base$1((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? _flags.call(p) : f)
- , tiRE ? this : proto$2, $RegExp);
- };
- var proxy = function (key) {
- key in $RegExp || dP$2($RegExp, key, {
- configurable: true,
- get: function () { return Base$1[key]; },
- set: function (it) { Base$1[key] = it; }
- });
- };
- for (var keys$1 = gOPN$1(Base$1), i$1 = 0; keys$1.length > i$1;) proxy(keys$1[i$1++]);
- proto$2.constructor = $RegExp;
- $RegExp.prototype = proto$2;
- _redefine(_global, 'RegExp', $RegExp);
- }
-
- _setSpecies('RegExp');
-
- function generateId(prefix) {
- return "".concat(prefix, "-").concat(Math.floor(Math.random() * 10000));
- } // Format string
-
- function format(input) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- if (is$1.empty(input)) {
- return input;
- }
-
- return input.toString().replace(/{(\d+)}/g, function (match, i) {
- return args[i].toString();
- });
- } // Get percentage
-
- function getPercentage(current, max) {
- if (current === 0 || max === 0 || Number.isNaN(current) || Number.isNaN(max)) {
- return 0;
- }
-
- return (current / max * 100).toFixed(2);
- } // Replace all occurances of a string in a string
-
- function replaceAll() {
- var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var find = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- var replace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
- return input.replace(new RegExp(find.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'), 'g'), replace.toString());
- } // Convert to title case
-
- function toTitleCase() {
- var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- return input.toString().replace(/\w\S*/g, function (text) {
- return text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();
- });
- } // Convert string to pascalCase
-
- function toPascalCase() {
- var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var string = input.toString(); // Convert kebab case
-
- string = replaceAll(string, '-', ' '); // Convert snake case
-
- string = replaceAll(string, '_', ' '); // Convert to title case
-
- string = toTitleCase(string); // Convert to pascal case
-
- return replaceAll(string, ' ', '');
- } // Convert string to pascalCase
-
- function toCamelCase() {
- var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var string = input.toString(); // Convert to pascal case
-
- string = toPascalCase(string); // Convert first character to lowercase
-
- return string.charAt(0).toLowerCase() + string.slice(1);
- } // Remove HTML from a string
-
- function stripHTML(source) {
- var fragment = document.createDocumentFragment();
- var element = document.createElement('div');
- fragment.appendChild(element);
- element.innerHTML = source;
- return fragment.firstChild.innerText;
- } // Like outerHTML, but also works for DocumentFragment
-
- function getHTML(element) {
- var wrapper = document.createElement('div');
- wrapper.appendChild(element);
- return wrapper.innerHTML;
- }
-
- var resources = {
- pip: 'PIP',
- airplay: 'AirPlay',
- html5: 'HTML5',
- vimeo: 'Vimeo',
- youtube: 'YouTube'
- };
- var i18n = {
- get: function get() {
- var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- if (is$1.empty(key) || is$1.empty(config)) {
- return '';
- }
-
- var string = getDeep(config.i18n, key);
-
- if (is$1.empty(string)) {
- if (Object.keys(resources).includes(key)) {
- return resources[key];
- }
-
- return '';
- }
-
- var replace = {
- '{seektime}': config.seekTime,
- '{title}': config.title
- };
- Object.entries(replace).forEach(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 2),
- key = _ref2[0],
- value = _ref2[1];
-
- string = replaceAll(string, key, value);
- });
- return string;
- }
- };
-
- var Storage =
- /*#__PURE__*/
- function () {
- function Storage(player) {
- _classCallCheck(this, Storage);
-
- this.enabled = player.config.storage.enabled;
- this.key = player.config.storage.key;
- } // Check for actual support (see if we can use it)
-
-
- _createClass(Storage, [{
- key: "get",
- value: function get(key) {
- if (!Storage.supported || !this.enabled) {
- return null;
- }
-
- var store = window.localStorage.getItem(this.key);
-
- if (is$1.empty(store)) {
- return null;
- }
-
- var json = JSON.parse(store);
- return is$1.string(key) && key.length ? json[key] : json;
- }
- }, {
- key: "set",
- value: function set(object) {
- // Bail if we don't have localStorage support or it's disabled
- if (!Storage.supported || !this.enabled) {
- return;
- } // Can only store objectst
-
-
- if (!is$1.object(object)) {
- return;
- } // Get current storage
-
-
- var storage = this.get(); // Default to empty object
-
- if (is$1.empty(storage)) {
- storage = {};
- } // Update the working copy of the values
-
-
- extend(storage, object); // Update storage
-
- window.localStorage.setItem(this.key, JSON.stringify(storage));
- }
- }], [{
- key: "supported",
- get: function get() {
- try {
- if (!('localStorage' in window)) {
- return false;
- }
-
- var test = '___test'; // Try to use it (it might be disabled, e.g. user is in private mode)
- // see: https://github.com/sampotts/plyr/issues/131
-
- window.localStorage.setItem(test, test);
- window.localStorage.removeItem(test);
- return true;
- } catch (e) {
- return false;
- }
- }
- }]);
-
- return Storage;
- }();
-
- // ==========================================================================
- // Fetch wrapper
- // Using XHR to avoid issues with older browsers
- // ==========================================================================
- function fetch(url) {
- var responseType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text';
- return new Promise(function (resolve, reject) {
- try {
- var request = new XMLHttpRequest(); // Check for CORS support
-
- if (!('withCredentials' in request)) {
- return;
- }
-
- request.addEventListener('load', function () {
- if (responseType === 'text') {
- try {
- resolve(JSON.parse(request.responseText));
- } catch (e) {
- resolve(request.responseText);
- }
- } else {
- resolve(request.response);
- }
- });
- request.addEventListener('error', function () {
- throw new Error(request.status);
- });
- request.open('GET', url, true); // Set the required response type
-
- request.responseType = responseType;
- request.send();
- } catch (e) {
- reject(e);
- }
- });
- }
-
- // ==========================================================================
-
- function loadSprite(url, id) {
- if (!is$1.string(url)) {
- return;
- }
-
- var prefix = 'cache';
- var hasId = is$1.string(id);
- var isCached = false;
-
- var exists = function exists() {
- return document.getElementById(id) !== null;
- };
-
- var update = function update(container, data) {
- container.innerHTML = data; // Check again incase of race condition
-
- if (hasId && exists()) {
- return;
- } // Inject the SVG to the body
-
-
- document.body.insertAdjacentElement('afterbegin', container);
- }; // Only load once if ID set
-
-
- if (!hasId || !exists()) {
- var useStorage = Storage.supported; // Create container
-
- var container = document.createElement('div');
- container.setAttribute('hidden', '');
-
- if (hasId) {
- container.setAttribute('id', id);
- } // Check in cache
-
-
- if (useStorage) {
- var cached = window.localStorage.getItem("".concat(prefix, "-").concat(id));
- isCached = cached !== null;
-
- if (isCached) {
- var data = JSON.parse(cached);
- update(container, data.content);
- }
- } // Get the sprite
-
-
- fetch(url).then(function (result) {
- if (is$1.empty(result)) {
- return;
- }
-
- if (useStorage) {
- window.localStorage.setItem("".concat(prefix, "-").concat(id), JSON.stringify({
- content: result
- }));
- }
-
- update(container, result);
- }).catch(function () {});
- }
- }
-
- // ==========================================================================
-
- var getHours = function getHours(value) {
- return parseInt(value / 60 / 60 % 60, 10);
- };
- var getMinutes = function getMinutes(value) {
- return parseInt(value / 60 % 60, 10);
- };
- var getSeconds = function getSeconds(value) {
- return parseInt(value % 60, 10);
- }; // Format time to UI friendly string
-
- function formatTime() {
- var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- var displayHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var inverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- // Bail if the value isn't a number
- if (!is$1.number(time)) {
- return formatTime(null, displayHours, inverted);
- } // Format time component to add leading zero
-
-
- var format = function format(value) {
- return "0".concat(value).slice(-2);
- }; // Breakdown to hours, mins, secs
-
-
- var hours = getHours(time);
- var mins = getMinutes(time);
- var secs = getSeconds(time); // Do we need to display hours?
-
- if (displayHours || hours > 0) {
- hours = "".concat(hours, ":");
- } else {
- hours = '';
- } // Render
-
-
- return "".concat(inverted && time > 0 ? '-' : '').concat(hours).concat(format(mins), ":").concat(format(secs));
- }
-
- var controls = {
- // Get icon URL
- getIconUrl: function getIconUrl() {
- var url = new URL(this.config.iconUrl, window.location);
- var cors = url.host !== window.location.host || browser.isIE && !window.svg4everybody;
- return {
- url: this.config.iconUrl,
- cors: cors
- };
- },
- // Find the UI controls
- findElements: function findElements() {
- try {
- this.elements.controls = getElement.call(this, this.config.selectors.controls.wrapper); // Buttons
-
- this.elements.buttons = {
- play: getElements.call(this, this.config.selectors.buttons.play),
- pause: getElement.call(this, this.config.selectors.buttons.pause),
- restart: getElement.call(this, this.config.selectors.buttons.restart),
- rewind: getElement.call(this, this.config.selectors.buttons.rewind),
- fastForward: getElement.call(this, this.config.selectors.buttons.fastForward),
- mute: getElement.call(this, this.config.selectors.buttons.mute),
- pip: getElement.call(this, this.config.selectors.buttons.pip),
- airplay: getElement.call(this, this.config.selectors.buttons.airplay),
- settings: getElement.call(this, this.config.selectors.buttons.settings),
- captions: getElement.call(this, this.config.selectors.buttons.captions),
- fullscreen: getElement.call(this, this.config.selectors.buttons.fullscreen)
- }; // Progress
-
- this.elements.progress = getElement.call(this, this.config.selectors.progress); // Inputs
-
- this.elements.inputs = {
- seek: getElement.call(this, this.config.selectors.inputs.seek),
- volume: getElement.call(this, this.config.selectors.inputs.volume)
- }; // Display
-
- this.elements.display = {
- buffer: getElement.call(this, this.config.selectors.display.buffer),
- currentTime: getElement.call(this, this.config.selectors.display.currentTime),
- duration: getElement.call(this, this.config.selectors.display.duration)
- }; // Seek tooltip
-
- if (is$1.element(this.elements.progress)) {
- this.elements.display.seekTooltip = this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip));
- }
-
- return true;
- } catch (error) {
- // Log it
- this.debug.warn('It looks like there is a problem with your custom controls HTML', error); // Restore native video controls
-
- this.toggleNativeControls(true);
- return false;
- }
- },
- // Create
"].join("");this.$dialog=this.ui.dialog({title:this.lang.options.help,fade:this.options.dialogsFade,body:this.createShortcutList(),footer:e,callback:function(t){t.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"createShortcutList",value:function(){var t=this,e=this.options.keyMap[m.isMac?"mac":"pc"];return Object.keys(e).map((function(n){var o=e[n],r=i()('');return r.append(i()("").css({width:180,"margin-right":10})).append(i()("").html(t.context.memo("help."+o)||o)),r.html()})).join("")}},{key:"showHelpDialog",value:function(){var t=this;return i.a.Deferred((function(e){t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),e.resolve()})),t.ui.showDialog(t.$dialog)})).promise()}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showHelpDialog().then((function(){t.context.invoke("editor.restoreRange")}))}}])&&Ce(e.prototype,n),o&&Ce(e,o),t}();function Se(t,e){for(var n=0;n0}},{key:"initialize",value:function(){var t=this;this.lastWordRange=null,this.matchingWord=null,this.$popover=this.ui.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo(this.options.container),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",(function(e){t.$content.find(".active").removeClass("active"),i()(e.currentTarget).addClass("active"),t.replace()})),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"selectItem",value:function(t){this.$content.find(".active").removeClass("active"),t.addClass("active"),this.$content[0].scrollTop=t[0].offsetTop-this.$content.innerHeight()/2}},{key:"moveDown",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.next();if(e.length)this.selectItem(e);else{var n=t.parent().next();n.length||(n=this.$content.find(".note-hint-group").first()),this.selectItem(n.find(".note-hint-item").first())}}},{key:"moveUp",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.prev();if(e.length)this.selectItem(e);else{var n=t.parent().prev();n.length||(n=this.$content.find(".note-hint-group").last()),this.selectItem(n.find(".note-hint-item").last())}}},{key:"replace",value:function(){var t=this.$content.find(".note-hint-item.active");if(t.length){var e=this.nodeFromItem(t);if(null!==this.matchingWord&&0===this.matchingWord.length)this.lastWordRange.so=this.lastWordRange.eo;else if(null!==this.matchingWord&&this.matchingWord.length>0&&!this.lastWordRange.isCollapsed()){var n=this.lastWordRange.eo-this.lastWordRange.so-this.matchingWord.length;n>0&&(this.lastWordRange.so+=n)}if(this.lastWordRange.insertNode(e),"next"===this.options.hintSelect){var o=document.createTextNode("");i()(e).after(o),wt.createFromNodeBefore(o).select()}else wt.createFromNodeAfter(e).select();this.lastWordRange=null,this.hide(),this.context.invoke("editor.focus")}}},{key:"nodeFromItem",value:function(t){var e=this.hints[t.data("index")],n=t.data("item"),o=e.content?e.content(n):n;return"string"==typeof o&&(o=pt.createText(o)),o}},{key:"createItemTemplates",value:function(t,e){var n=this.hints[t];return e.map((function(e){var o=i()('');return o.append(n.template?n.template(e):e+""),o.data({index:t,item:e}),o}))}},{key:"handleKeydown",value:function(t){this.$popover.is(":visible")&&(t.keyCode===xt.code.ENTER?(t.preventDefault(),this.replace()):t.keyCode===xt.code.UP?(t.preventDefault(),this.moveUp()):t.keyCode===xt.code.DOWN&&(t.preventDefault(),this.moveDown()))}},{key:"searchKeyword",value:function(t,e,n){var o=this.hints[t];if(o&&o.match.test(e)&&o.search){var i=o.match.exec(e);this.matchingWord=i[0],o.search(i[1],n)}else n()}},{key:"createGroup",value:function(t,e){var n=this,o=i()('');return this.searchKeyword(t,e,(function(e){(e=e||[]).length&&(o.html(n.createItemTemplates(t,e)),n.show())})),o}},{key:"handleKeyup",value:function(t){var e=this;if(!C.contains([xt.code.ENTER,xt.code.UP,xt.code.DOWN],t.keyCode)){var n,o,r=this.context.invoke("editor.getLastRange");if("words"===this.options.hintMode){if(n=r.getWordsRange(r),o=n.toString(),this.hints.forEach((function(t){if(t.match.test(o))return n=r.getWordsMatchRange(t.match),!1})),!n)return void this.hide();o=n.toString()}else n=r.getWordRange(),o=n.toString();if(this.hints.length&&o){this.$content.empty();var a=g.rect2bnd(C.last(n.getClientRects())),s=i()(this.options.container).offset();a&&(a.top-=s.top,a.left-=s.left,this.$popover.hide(),this.lastWordRange=n,this.hints.forEach((function(t,n){t.match.test(o)&&e.createGroup(n,o).appendTo(e.$content)})),this.$content.find(".note-hint-item:first").addClass("active"),"top"===this.direction?this.$popover.css({left:a.left,top:a.top-this.$popover.outerHeight()-5}):this.$popover.css({left:a.left,top:a.top+a.height+5}))}else this.hide()}}},{key:"show",value:function(){this.$popover.show()}},{key:"hide",value:function(){this.$popover.hide()}}])&&Ee(e.prototype,n),o&&Ee(e,o),t}();i.a.summernote=i.a.extend(i.a.summernote,{version:"0.8.18",plugins:{},dom:pt,range:wt,lists:C,options:{langInfo:i.a.summernote.lang["en-US"],editing:!0,modules:{editor:Ht,clipboard:Bt,dropzone:Ot,codeview:Kt,statusbar:qt,fullscreen:Gt,handle:Zt,hintPopover:Ie,autoLink:Jt,autoSync:ee,autoReplace:oe,placeholder:re,buttons:se,toolbar:ce,linkDialog:de,linkPopover:fe,imageDialog:me,imagePopover:ge,tablePopover:ye,videoDialog:we,helpDialog:xe,airPopover:Te},buttons:{},lang:"en-US",followingToolbar:!1,toolbarPosition:"top",otherStaticBar:"",codeviewKeepButton:!1,toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popatmouse:!0,popover:{image:[["resize",["resizeFull","resizeHalf","resizeQuarter","resizeNone"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]],["view",["fullscreen","codeview"]]]},airMode:!1,overrideContextMenu:!1,width:null,height:null,linkTargetBlank:!0,useProtocol:!0,defaultProtocol:"http://",focus:!1,tabDisabled:!1,tabSize:4,styleWithCSS:!1,shortcuts:!0,textareaAutoSync:!0,tooltip:"auto",container:null,maxTextLength:0,blockquoteBreakingLevel:2,spellCheck:!0,disableGrammar:!1,placeholder:null,inheritPlaceholder:!1,recordEveryKeystroke:!1,historyLimit:200,showDomainOnlyForAutolink:!1,hintMode:"word",hintSelect:"after",hintDirection:"bottom",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],addDefaultFonts:!0,fontSizes:["8","9","10","11","12","14","18","24","36"],fontSizeUnits:["px","pt"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],colorsName:[["Black","Tundora","Dove Gray","Star Dust","Pale Slate","Gallery","Alabaster","White"],["Red","Orange Peel","Yellow","Green","Cyan","Blue","Electric Violet","Magenta"],["Azalea","Karry","Egg White","Zanah","Botticelli","Tropical Blue","Mischka","Twilight"],["Tonys Pink","Peach Orange","Cream Brulee","Sprout","Casper","Perano","Cold Purple","Careys Pink"],["Mandy","Rajah","Dandelion","Olivine","Gulf Stream","Viking","Blue Marguerite","Puce"],["Guardsman Red","Fire Bush","Golden Dream","Chelsea Cucumber","Smalt Blue","Boston Blue","Butterfly Bush","Cadillac"],["Sangria","Mai Tai","Buddha Gold","Forest Green","Eden","Venice Blue","Meteorite","Claret"],["Rosewood","Cinnamon","Olive","Parsley","Tiber","Midnight Blue","Valentino","Loulou"]],colorButton:{foreColor:"#000000",backColor:"#FFFF00"},lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onBeforeCommand:null,onBlur:null,onBlurCodeview:null,onChange:null,onChangeCodeview:null,onDialogShown:null,onEnter:null,onFocus:null,onImageLinkInsert:null,onImageUpload:null,onImageUploadError:null,onInit:null,onKeydown:null,onKeyup:null,onMousedown:null,onMouseup:null,onPaste:null,onScroll:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},codeviewFilter:!1,codeviewFilterRegex:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,codeviewIframeFilter:!0,codeviewIframeWhitelistSrc:[],codeviewIframeWhitelistSrcBase:["www.youtube.com","www.youtube-nocookie.com","www.facebook.com","vine.co","instagram.com","player.vimeo.com","www.dailymotion.com","player.youku.com","v.qq.com"],keyMap:{pc:{ESC:"escape",ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ESC:"escape",ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",floatLeft:"note-icon-float-left",floatRight:"note-icon-float-right",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",rollback:"note-icon-rollback",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})},4:function(t,e,n){},52:function(t,e,n){"use strict";n.r(e);var o=n(0),i=n.n(o),r=n(1);function a(t){return(a="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)}var s=r.a.create(''),l=r.a.create(''),c=r.a.create(''),u=r.a.create(''),d=r.a.create(''),h=r.a.create(['','"].join("")),f=r.a.create(''),p=r.a.create(['',''].join("")),m=r.a.create(''),v=r.a.create('
-
-