diff --git a/.github/changelog-configuration.json b/.github/changelog-configuration.json index 2f7f375b..926651f8 100644 --- a/.github/changelog-configuration.json +++ b/.github/changelog-configuration.json @@ -69,11 +69,11 @@ ], "label_extractor": [ { - "pattern": "^(build|ci|change|chore|doc|docs|wiki|remove|deprecate|security|dependency|dep|package|feat|feature|fix|bug|perf|optimize|optimization|refactor|revert|style|test|tests|vault):(.*)", + "pattern": "^(build|ci|change|chore|doc|docs|wiki|remove|deprecate|security|dependency|dep|package|feat|feature|fix|bug|perf|optimize|optimization|refactor|style|test|tests|vault):(.*)", "target": "$1" }, { - "pattern": "^(build|ci|change|chore|doc|docs|wiki|remove|deprecate|security|dependency|dep|package|feat|feature|fix|bug|perf|optimize|optimization|refactor|revert|style|test|tests|vault){1}(\\([\\w\\-\\.]+\\))?(!)?:(.*)", + "pattern": "^(build|ci|change|chore|doc|docs|wiki|remove|deprecate|security|dependency|dep|package|feat|feature|fix|bug|perf|optimize|optimization|refactor|style|test|tests|vault){1}(\\([\\w\\-\\.]+\\))?(!)?:(.*)", "target": "$1" } ], diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index e0da262d..7f7bfb43 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -7,6 +7,17 @@ tags: ![Version](https://img.shields.io/github/v/tag/Aetherinox/obsidian-gistr?logo=GitHub&label=version&color=ba5225) ![Downloads](https://img.shields.io/github/downloads/Aetherinox/obsidian-gistr/total) ![Repo Size](https://img.shields.io/github/repo-size/Aetherinox/obsidian-gistr?label=size&color=59702a) ![Last Commit)](https://img.shields.io/github/last-commit/Aetherinox/obsidian-gistr?color=b43bcc) +### 1.6.5 April 04, 2024 { id="1.6.5" } + +- `chore`: update language entries +- `chore`: update environment vars for branch main and stable +- `change`: github default dark theme scrollbar color +- `change`: add Env.Api to store api links +- `change`: remove 'AppBase' declaration, migrated to pluginBase +- `tests`: bump version 1.6.5 +- `fix`: opengist bug improperly formatting text +- `fix`: css syntax errors + ### 1.6.4 April 02, 2024 { id="1.6.4" } - `feat`: add `gistr-web` codeblock as alternative to `raw: true` diff --git a/manifest.json b/manifest.json index 602ed8d9..35479596 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "gistr", "name": "Gistr", - "version": "1.6.4", + "version": "1.6.5", "minAppVersion": "1.0.0", "description": "Integrate Opengist and Github gists into your notes, allowing you to create, update, and share between your notes and gist services", "author": "Aetherinox", diff --git a/package-lock.json b/package-lock.json index e0ede62b..857de932 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gistr", - "version": "1.6.4", + "version": "1.6.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gistr", - "version": "1.6.4", + "version": "1.6.5", "license": "MIT", "dependencies": { "@aetherinox/noxkit": "^1.1.0", @@ -480,9 +480,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.2.tgz", - "integrity": "sha512-3XFIDKWMFZrMnao1mJhnOT1h2g0169Os848NhhmGweEcfJ4rCi+3yMCOLG4zA61rbJdkcrM/DjVZm9Hg5p5w7g==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.0.tgz", + "integrity": "sha512-jwXtxYbRt1V+CdQSy6Z+uZti7JF5irRKF8hlKfEnF/xJpcNGuuiZMBvuoYM+x9sr9iWGnzrlM0+9hvQ1kgkf1w==", "cpu": [ "arm" ], @@ -493,9 +493,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.2.tgz", - "integrity": "sha512-GdxxXbAuM7Y/YQM9/TwwP+L0omeE/lJAR1J+olu36c3LqqZEBdsIWeQ91KBe6nxwOnb06Xh7JS2U5ooWU5/LgQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.0.tgz", + "integrity": "sha512-fI9nduZhCccjzlsA/OuAwtFGWocxA4gqXGTLvOyiF8d+8o0fZUeSztixkYjcGq1fGZY3Tkq4yRvHPFxU+jdZ9Q==", "cpu": [ "arm64" ], @@ -506,9 +506,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.2.tgz", - "integrity": "sha512-mCMlpzlBgOTdaFs83I4XRr8wNPveJiJX1RLfv4hggyIVhfB5mJfN4P8Z6yKh+oE4Luz+qq1P3kVdWrCKcMYrrA==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.0.tgz", + "integrity": "sha512-BcnSPRM76/cD2gQC+rQNGBN6GStBs2pl/FpweW8JYuz5J/IEa0Fr4AtrPv766DB/6b2MZ/AfSIOSGw3nEIP8SA==", "cpu": [ "arm64" ], @@ -519,9 +519,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.2.tgz", - "integrity": "sha512-yUoEvnH0FBef/NbB1u6d3HNGyruAKnN74LrPAfDQL3O32e3k3OSfLrPgSJmgb3PJrBZWfPyt6m4ZhAFa2nZp2A==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.0.tgz", + "integrity": "sha512-LDyFB9GRolGN7XI6955aFeI3wCdCUszFWumWU0deHA8VpR3nWRrjG6GtGjBrQxQKFevnUTHKCfPR4IvrW3kCgQ==", "cpu": [ "x64" ], @@ -532,9 +532,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.2.tgz", - "integrity": "sha512-GYbLs5ErswU/Xs7aGXqzc3RrdEjKdmoCrgzhJWyFL0r5fL3qd1NPcDKDowDnmcoSiGJeU68/Vy+OMUluRxPiLQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.0.tgz", + "integrity": "sha512-ygrGVhQP47mRh0AAD0zl6QqCbNsf0eTo+vgwkY6LunBcg0f2Jv365GXlDUECIyoXp1kKwL5WW6rsO429DBY/bA==", "cpu": [ "arm" ], @@ -545,9 +545,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.2.tgz", - "integrity": "sha512-L1+D8/wqGnKQIlh4Zre9i4R4b4noxzH5DDciyahX4oOz62CphY7WDWqJoQ66zNR4oScLNOqQJfNSIAe/6TPUmQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.0.tgz", + "integrity": "sha512-x+uJ6MAYRlHGe9wi4HQjxpaKHPM3d3JjqqCkeC5gpnnI6OWovLdXTpfa8trjxPLnWKyBsSi5kne+146GAxFt4A==", "cpu": [ "arm64" ], @@ -558,9 +558,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.2.tgz", - "integrity": "sha512-tK5eoKFkXdz6vjfkSTCupUzCo40xueTOiOO6PeEIadlNBkadH1wNOH8ILCPIl8by/Gmb5AGAeQOFeLev7iZDOA==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.0.tgz", + "integrity": "sha512-nrRw8ZTQKg6+Lttwqo6a2VxR9tOroa2m91XbdQ2sUUzHoedXlsyvY1fN4xWdqz8PKmf4orDwejxXHjh7YBGUCA==", "cpu": [ "arm64" ], @@ -571,9 +571,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.13.2.tgz", - "integrity": "sha512-zvXvAUGGEYi6tYhcDmb9wlOckVbuD+7z3mzInCSTACJ4DQrdSLPNUeDIcAQW39M3q6PDquqLWu7pnO39uSMRzQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.0.tgz", + "integrity": "sha512-xV0d5jDb4aFu84XKr+lcUJ9y3qpIWhttO3Qev97z8DKLXR62LC3cXT/bMZXrjLF9X+P5oSmJTzAhqwUbY96PnA==", "cpu": [ "ppc64le" ], @@ -584,9 +584,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.2.tgz", - "integrity": "sha512-C3GSKvMtdudHCN5HdmAMSRYR2kkhgdOfye4w0xzyii7lebVr4riCgmM6lRiSCnJn2w1Xz7ZZzHKuLrjx5620kw==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.0.tgz", + "integrity": "sha512-SDDhBQwZX6LPRoPYjAZWyL27LbcBo7WdBFWJi5PI9RPCzU8ijzkQn7tt8NXiXRiFMJCVpkuMkBf4OxSxVMizAw==", "cpu": [ "riscv64" ], @@ -597,9 +597,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.2.tgz", - "integrity": "sha512-l4U0KDFwzD36j7HdfJ5/TveEQ1fUTjFFQP5qIt9gBqBgu1G8/kCaq5Ok05kd5TG9F8Lltf3MoYsUMw3rNlJ0Yg==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.0.tgz", + "integrity": "sha512-RxB/qez8zIDshNJDufYlTT0ZTVut5eCpAZ3bdXDU9yTxBzui3KhbGjROK2OYTTor7alM7XBhssgoO3CZ0XD3qA==", "cpu": [ "s390x" ], @@ -610,9 +610,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.2.tgz", - "integrity": "sha512-xXMLUAMzrtsvh3cZ448vbXqlUa7ZL8z0MwHp63K2IIID2+DeP5iWIT6g1SN7hg1VxPzqx0xZdiDM9l4n9LRU1A==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.0.tgz", + "integrity": "sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg==", "cpu": [ "x64" ], @@ -623,9 +623,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.2.tgz", - "integrity": "sha512-M/JYAWickafUijWPai4ehrjzVPKRCyDb1SLuO+ZyPfoXgeCEAlgPkNXewFZx0zcnoIe3ay4UjXIMdXQXOZXWqA==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.0.tgz", + "integrity": "sha512-i0QwbHYfnOMYsBEyjxcwGu5SMIi9sImDVjDg087hpzXqhBSosxkE7gyIYFHgfFl4mr7RrXksIBZ4DoLoP4FhJg==", "cpu": [ "x64" ], @@ -636,9 +636,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.2.tgz", - "integrity": "sha512-2YWwoVg9KRkIKaXSh0mz3NmfurpmYoBBTAXA9qt7VXk0Xy12PoOP40EFuau+ajgALbbhi4uTj3tSG3tVseCjuA==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.0.tgz", + "integrity": "sha512-Fq52EYb0riNHLBTAcL0cun+rRwyZ10S9vKzhGKKgeD+XbwunszSY0rVMco5KbOsTlwovP2rTOkiII/fQ4ih/zQ==", "cpu": [ "arm64" ], @@ -649,9 +649,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.2.tgz", - "integrity": "sha512-2FSsE9aQ6OWD20E498NYKEQLneShWes0NGMPQwxWOdws35qQXH+FplabOSP5zEe1pVjurSDOGEVCE2agFwSEsw==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.0.tgz", + "integrity": "sha512-e/PBHxPdJ00O9p5Ui43+vixSgVf4NlLsmV6QneGERJ3lnjIua/kim6PRFe3iDueT1rQcgSkYP8ZBBXa/h4iPvw==", "cpu": [ "ia32" ], @@ -662,9 +662,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.2.tgz", - "integrity": "sha512-7h7J2nokcdPePdKykd8wtc8QqqkqxIrUz7MHj6aNr8waBRU//NLDVnNjQnqQO6fqtjrtCdftpbTuOKAyrAQETQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.0.tgz", + "integrity": "sha512-aGg7iToJjdklmxlUlJh/PaPNa4PmqHfyRMLunbL3eaMO0gp656+q1zOKkpJ/CVe9CryJv6tAN1HDoR8cNGzkag==", "cpu": [ "x64" ], @@ -1928,9 +1928,9 @@ "optional": true }, "node_modules/rollup": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.2.tgz", - "integrity": "sha512-MIlLgsdMprDBXC+4hsPgzWUasLO9CE4zOkj/u6j+Z6j5A4zRY+CtiXAdJyPtgCsc42g658Aeh1DlrdVEJhsL2g==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.0.tgz", + "integrity": "sha512-Qe7w62TyawbDzB4yt32R0+AbIo6m1/sqO7UPzFS8Z/ksL5mrfhA0v4CavfdmFav3D+ub4QeAgsGEe84DoWe/nQ==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -1943,21 +1943,21 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.13.2", - "@rollup/rollup-android-arm64": "4.13.2", - "@rollup/rollup-darwin-arm64": "4.13.2", - "@rollup/rollup-darwin-x64": "4.13.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.13.2", - "@rollup/rollup-linux-arm64-gnu": "4.13.2", - "@rollup/rollup-linux-arm64-musl": "4.13.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.13.2", - "@rollup/rollup-linux-riscv64-gnu": "4.13.2", - "@rollup/rollup-linux-s390x-gnu": "4.13.2", - "@rollup/rollup-linux-x64-gnu": "4.13.2", - "@rollup/rollup-linux-x64-musl": "4.13.2", - "@rollup/rollup-win32-arm64-msvc": "4.13.2", - "@rollup/rollup-win32-ia32-msvc": "4.13.2", - "@rollup/rollup-win32-x64-msvc": "4.13.2", + "@rollup/rollup-android-arm-eabi": "4.14.0", + "@rollup/rollup-android-arm64": "4.14.0", + "@rollup/rollup-darwin-arm64": "4.14.0", + "@rollup/rollup-darwin-x64": "4.14.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.14.0", + "@rollup/rollup-linux-arm64-gnu": "4.14.0", + "@rollup/rollup-linux-arm64-musl": "4.14.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.14.0", + "@rollup/rollup-linux-riscv64-gnu": "4.14.0", + "@rollup/rollup-linux-s390x-gnu": "4.14.0", + "@rollup/rollup-linux-x64-gnu": "4.14.0", + "@rollup/rollup-linux-x64-musl": "4.14.0", + "@rollup/rollup-win32-arm64-msvc": "4.14.0", + "@rollup/rollup-win32-ia32-msvc": "4.14.0", + "@rollup/rollup-win32-x64-msvc": "4.14.0", "fsevents": "~2.3.2" } }, @@ -2256,9 +2256,9 @@ } }, "node_modules/terser": { - "version": "5.30.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.2.tgz", - "integrity": "sha512-vTDjRKYKip4dOFL5VizdoxHTYDfEXPdz5t+FbxCC5Rp2s+KbEO8w5wqMDPgj7CtFKZuzq7PXv28fZoXfqqBVuw==", + "version": "5.30.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", + "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index 0ce2c7ee..278f76af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gistr", - "version": "1.6.4", + "version": "1.6.5", "description": "Integrate Opengist and Github gists into your notes, allowing you to create, update, and share between your notes and gist services", "main": "main.js", "repository": { diff --git a/src/api/Env.ts b/src/api/Env.ts index d05e9000..3ec4d228 100644 --- a/src/api/Env.ts +++ b/src/api/Env.ts @@ -1,4 +1,5 @@ import { App, PluginManifest, apiVersion } from 'obsidian' +import { lng } from 'src/lang' /* Plugin ID @@ -30,10 +31,20 @@ type Repo = urlWiki?: HttpsUrl urlIssues?: HttpsUrl urlReleases?: HttpsUrl - urlPackage?: HttpsUrl + urlBranchMain?: HttpsUrl + urlBranchBeta?: HttpsUrl urlDemoVault?: HttpsUrl } +/* + Api Strings +*/ + +type Api = +{ + github?: HttpsUrl +} + /* Class > Env */ @@ -44,6 +55,10 @@ export abstract class Env private static _obsidianApiVer: string private static _manifest: PluginManifest + /* + Repo Links + */ + public static readonly Links: Repo = { urlDocs: 'https://aetherinox.github.io/obsidian-gistr', @@ -51,10 +66,20 @@ export abstract class Env urlWiki: 'https://github.com/Aetherinox/obsidian-gistr/wiki', urlIssues: 'https://github.com/Aetherinox/obsidian-gistr/issues', urlReleases: 'https://github.com/Aetherinox/obsidian-gistr/releases', - urlPackage: 'https://raw.githubusercontent.com/Aetherinox/obsidian-gistr/{0}/package.json', + urlBranchMain: 'https://raw.githubusercontent.com/Aetherinox/obsidian-gistr/main/package.json', + urlBranchBeta: 'https://raw.githubusercontent.com/Aetherinox/obsidian-gistr/beta/package.json', urlDemoVault: 'https://github.com/Aetherinox/obsidian-gistr/tree/main/tests/gistr-vault', } + /* + Api + */ + + public static readonly Api: Api = + { + github: 'https://www.githubstatus.com/api/v2/summary.json', + } + /* Initialize */ @@ -62,7 +87,7 @@ export abstract class Env static _Initialize( app: App, manifest: PluginManifest ) { if ( this._manifest || this._obsidianApiVer ) - throw console.log( 'Plugin attempted to define data more than once' ) + throw console.log( lng( 'base_saturyn_define' ) ) this._obsidianApiVer = apiVersion this._manifest = manifest @@ -75,11 +100,20 @@ export abstract class Env static get obsidianVersion( ) { if ( !this._obsidianApiVer ) - throw console.log( 'Obsidian version not set. Ensure Env._Initialize() has fired. ' ) + throw console.log( lng( 'base_saturyn_obsidianver_notinitialized' ) ) return this._obsidianApiVer } + /* + Base + */ + + static get pluginBase( ): string + { + return 'app://obsidian.md' + } + /* Plugin ID */ @@ -105,7 +139,7 @@ export abstract class Env static get manifest( ): PluginManifest { if ( !this._manifest ) - throw console.log( 'Plugin manifest not set. Ensure Env._Initialize() has fired.' ) + throw console.log( lng( 'base_saturyn_pluginmanifest_notinitialized' ) ) return this._manifest } diff --git a/src/backend/Backend.ts b/src/backend/Backend.ts index c345d111..d486c9cf 100644 --- a/src/backend/Backend.ts +++ b/src/backend/Backend.ts @@ -14,7 +14,6 @@ import { SaturynHandleSyntax } from 'src/api/Saturyn' */ const sender = PID( ) -const AppBase = 'app://obsidian.md' /* Interface > Json @@ -236,7 +235,7 @@ css: | sender: '${ sender }', gid: '${ uuid }', scrollHeight: document.body.scrollHeight - }, '${ AppBase }') + }, '${ Env.pluginBase }') } ) ` @@ -378,7 +377,7 @@ css: | const css_og_tx_color = ( style.theme == "dark" ? this.settings.og_clr_tx_dark : this.settings.og_clr_tx_light ) let css_og_tx_color_user = ( !bIsEmpty( style.color_text ) ? style.color_text : css_og_tx_color ) css_og_tx_color_user = css_og_tx_color_user.replace( "#", "" ); - const css_og_wrap = ( this.settings.textwrap == "Enabled" ? "normal" : "pre" ) + const css_og_wrap = ( this.settings.textwrap == "Enabled" ? "pre-wrap" : "pre" ) const css_og_opacity = ( this.settings.og_opacity ) || 1 return ` diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 4f9e2779..0adbf21d 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -23,6 +23,12 @@ export default base_debug_updater_2: '{0} {1}', base_context_nofocus: 'Obsidian does not have focus, please open a file', base_reload_notice: 'Successfully reloaded Gistr', + base_saturyn_define: 'Plugin attempted to define data more than once', + base_saturyn_obsidianver_notinitialized: 'Obsidian version not set. Env._Initialize() has not fired.', + base_saturyn_pluginmanifest_notinitialized: 'Plugin manifest not set. Ensure Env._Initialize() has fired.', + base_promise_rejected: 'Promise rejected: {0}', + base_ver_nofind: 'Could not fetch version information: {0}', + base_ver_nofetch: 'Failed to fetch version ({0}): {1}', /* Context menu options @@ -143,15 +149,15 @@ export default */ cfg_tab_su_desc: 'The following buttons are associated to useful resources for this plugin.', - cfg_tab_su_doc_name: 'Documentation', - cfg_tab_su_doc_desc: 'View the official Gistr documentation', - cfg_tab_su_doc_btn: 'View', cfg_tab_su_gs_name: 'Introduction', cfg_tab_su_gs_desc: 'View brief introduction to getting started with this plugin', cfg_tab_su_gs_btn: 'Open', - cfg_tab_su_repo_label: 'Plugin repo', + cfg_tab_su_repo_label: 'Gistr repo', cfg_tab_su_repo_btn: 'View', - cfg_tab_su_vault_label: 'Plugin demo vault', + cfg_tab_su_doc_name: 'Gistr Documentation', + cfg_tab_su_doc_desc: 'View the official Gistr documentation', + cfg_tab_su_doc_btn: 'View', + cfg_tab_su_vault_label: 'Gistr demo vault', cfg_tab_su_vault_btn: 'View', cfg_tab_su_ogrepo_label: 'OpenGist: download', cfg_tab_su_ogrepo_url: 'https://github.com/thomiceli/opengist/releases', @@ -249,7 +255,7 @@ export default Tab > Sync */ - cfg_tab_sy_list_save_showall_name: 'Save list: Show All Saves', + cfg_tab_sy_list_save_showall_name: 'Save list: Show all saves', cfg_tab_sy_list_save_showall_desc: 'This setting effects how the gist save list displays saved gists.

Enabled: When saving an existing gist, the suggestion box will display ALL saves for that note in the same list; both public and secret.

Disabled: Public and secret gist saves will be separated when being displayed in the existing gist save list.', cfg_tab_sy_list_icon_name: 'Save list: Icon color', diff --git a/src/main.ts b/src/main.ts index a7318fee..30d4c10a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -647,7 +647,7 @@ export default class GistrPlugin extends Plugin try { const ver_running = this.manifest.version - let ver_stable = await requestUrl( lng( "ver_url", "main" ) ).then( async ( res ) => + let ver_stable = await requestUrl( Env.Links[ 'urlBranchMain' ] ).then( async ( res ) => { if ( res.status === 200 ) { @@ -657,10 +657,10 @@ export default class GistrPlugin extends Plugin } ) .catch( ( err ) => { - console.error( `Failed to fetch version (stable): ${ err }` ) + console.error( lng( 'base_ver_nofetch', 'stable', err ) ) } ) - let ver_beta = await requestUrl( lng( "ver_url", "beta" ) ).then( async ( res ) => + let ver_beta = await requestUrl( Env.Links[ 'urlBranchBeta' ] ).then( async ( res ) => { if ( res.status === 200 ) { @@ -670,7 +670,7 @@ export default class GistrPlugin extends Plugin } ) .catch( ( err ) => { - console.error( `Failed to fetch version (beta): ${ err }` ) + console.error( lng( 'base_ver_nofetch', 'beta', err ) ) } ) /* @@ -712,7 +712,7 @@ export default class GistrPlugin extends Plugin } catch ( exception ) { - console.error( `Could not fetch version information: ${ exception }\n` ) + console.error( lng( 'base_ver_nofind', exception ) ) } } diff --git a/src/modals/GettingStartedModal.ts b/src/modals/GettingStartedModal.ts index d02f523f..9f8c6f43 100644 --- a/src/modals/GettingStartedModal.ts +++ b/src/modals/GettingStartedModal.ts @@ -4,6 +4,7 @@ import { App, Modal, ButtonComponent, Setting, requestUrl, MarkdownRenderer } from "obsidian" import GistrPlugin from "src/main" +import { Env } from 'src/api' import { GistrSettings } from 'src/settings/' import { lng } from 'src/lang' @@ -115,7 +116,7 @@ export default class ModalGettingStarted extends Modal */ let json_delay = 1 * 1000 - const gh_status = requestUrl( "https://www.githubstatus.com/api/v2/summary.json" ).then( ( res ) => + const gh_status = requestUrl( Env.Api[ "github" ] ).then( ( res ) => { if ( res.status === 200 ) return res.json.components[ 0 ].status || lng( "gist_status_issues" ) diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index 8c7b2926..3f4d3913 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -30,7 +30,7 @@ export const SettingsDefaults: GistrSettings = gh_clr_bg_light: "#E5E5E5", gh_clr_bg_dark: "#121315", gh_clr_sb_light: "#BA4956", - gh_clr_sb_dark: "#BA496A", + gh_clr_sb_dark: "#4960ba", gh_clr_tx_light: "#2A2626", gh_clr_tx_dark: "#CAD3F5", gh_opacity: 1, diff --git a/src/settings/sections/SettingsSection.ts b/src/settings/sections/SettingsSection.ts index baf551be..79bf9acc 100644 --- a/src/settings/sections/SettingsSection.ts +++ b/src/settings/sections/SettingsSection.ts @@ -48,7 +48,7 @@ const ColorPickrDefaults: Record< string, Color > = "og_clr_bg_light": "#CBCBCB", "og_clr_bg_dark": "#121315", "og_clr_sb_light": "#BA4956", - "og_clr_sb_dark": "#4960ba", + "og_clr_sb_dark": "#4960BA", "og_clr_tx_light": "#2A2626", "og_clr_tx_dark": "#CAD3F5", @@ -867,7 +867,7 @@ export class SettingsSection extends PluginSettingTab */ let json_delay = 0.5 * 1000 - const gh_status = requestUrl( "https://www.githubstatus.com/api/v2/summary.json" ).then( ( res ) => + const gh_status = requestUrl( Env.Api[ "github" ] ).then( ( res ) => { if ( res.status === 200 ) return res.json.components[ 0 ].status || lng( "gist_status_issues" ) @@ -2016,7 +2016,7 @@ export class SettingsSection extends PluginSettingTab try { - get_ver_stable: requestUrl( lng( "ver_url", "main" ) ).then( ( res ) => + get_ver_stable: requestUrl( Env.Links[ 'urlBranchMain' ] ).then( ( res ) => { if ( res.status === 200 ) return res.json.version ?? lng( "cfg_tab_su_ver_connection_issues" ) @@ -2025,10 +2025,10 @@ export class SettingsSection extends PluginSettingTab }) .catch( ( err ) => { - console.error( `Promise rejected: ${ err }` ); + console.error( lng( 'base_promise_rejected', err ) ) } ) - get_ver_beta: requestUrl( lng( "ver_url", "beta" ) ).then( ( res ) => + get_ver_beta: requestUrl( Env.Links[ 'urlBranchBeta' ] ).then( ( res ) => { if ( res.status === 200 ) return res.json.version ?? lng( "cfg_tab_su_ver_connection_issues" ) @@ -2037,12 +2037,12 @@ export class SettingsSection extends PluginSettingTab } ) .catch( ( err ) => { - console.error( `Promise rejected: ${ err }` ); + console.error( lng( 'base_promise_rejected', err ) ) } ) } catch ( exception ) { - console.error( `Could not fetch version information: ${ exception }\n` ) + console.error( lng( 'base_ver_nofind', exception ) ) } /* diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 6244512d..b51df3cb 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -38,7 +38,7 @@ export interface GistrSettings gh_clr_bg_light: string | "E5E5E5" gh_clr_bg_dark: string | "121315" gh_clr_sb_light: string | "3D85C4" - gh_clr_sb_dark: string | "BA496A" + gh_clr_sb_dark: string | "4960BA" gh_clr_tx_light: string | "2A2626" gh_clr_tx_dark: string | "CAD3F5" gh_opacity: number | 1 diff --git a/styles.css b/styles.css index 4f84752e..30eb115f 100644 --- a/styles.css +++ b/styles.css @@ -1158,7 +1158,7 @@ h2.gistr-settings-header + div > div > div > .setting-item-description .pcr-app .pcr-swatches > button::before { background-size: 6px; - background: url('data:image/svg+xml; border-radius:.15em; content:''; height:100%; left:0; position:absolute; top:0; utf8,'); + background: url('data:image/svg+xml; border-radius:.15em; content:""; height:100%; left:0; position:absolute; top:0; utf8,'); width: 100%; z-index: -1; } @@ -1270,7 +1270,7 @@ h2.gistr-settings-header + div > div > div > .setting-item-description .pcr-app[data-theme='nano'] .pcr-selection .pcr-color-palette .pcr-palette::before { background-size: .5em; - background: url('data:image/svg+xml; border-radius:.15em; content:''; height:100%; left:0; position:absolute; top:0; utf8,'); + background: url('data:image/svg+xml; border-radius:.15em; content:""; height:100%; left:0; position:absolute; top:0; utf8,'); width: 100%; z-index: -1; } @@ -1299,7 +1299,7 @@ h2.gistr-settings-header + div > div > div > .setting-item-description .pcr-app[data-theme='nano'] .pcr-selection .pcr-color-preview .pcr-current-color::before { background-size: .5em; - background: url('data:image/svg+xml; border-radius:.15em; content:''; height:100%; left:0; position:absolute; top:0; utf8,'); + background: url('data:image/svg+xml; border-radius:.15em; content:""; height:100%; left:0; position:absolute; top:0; utf8,'); width: 100%; z-index: -1; } @@ -1374,7 +1374,7 @@ h2.gistr-settings-header + div > div > div > .setting-item-description .pickr .pcr-button::before { background-size: .5em; - background: url('data:image/svg+xml; border-radius:.15em; content:''; height:100%; left:0; position:absolute; top:0; utf8,'); + background: url('data:image/svg+xml; border-radius:.15em; content:""; height:100%; left:0; position:absolute; top:0; utf8,'); width: 100%; z-index: -1; } diff --git a/tests/Gistr Demo/.obsidian/plugins/gistr/main.js b/tests/Gistr Demo/.obsidian/plugins/gistr/main.js index 57ac5b98..7f5dd91b 100644 --- a/tests/Gistr Demo/.obsidian/plugins/gistr/main.js +++ b/tests/Gistr Demo/.obsidian/plugins/gistr/main.js @@ -1,13 +1,13 @@ /** - * @name: gistr v1.6.4 + * @name: gistr v1.6.5 * @author: Aetherinox * @url: https://github.com/Aetherinox/obsidian-gistr.git * @copyright: (c) 2024 Aetherinox * @license: MIT - * @build: 2024-04-02T23:08:38.000Z + * @build: 2024-04-03T18:55:35.000Z * @guid: 0a7f5dc4-b2fa-5064-9e54-f6e17fd14273 - * @uuid: 12189b9c-8d77-5ba4-919f-38f532b3002c + * @uuid: d3cd0aa0-8210-5924-b59c-103c17481deb */ -Object.defineProperty(exports,"__esModule",{value:!0});var e=require("obsidian"),t=require("crypto");function s(e,t,s,n){return new(s||(s=Promise))(((i,r)=>{function o(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((e=>{e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const n={keyword:"gistr",firststart:!0,css_og:"",css_gh:"",theme:"Light",blk_pad_t:16,blk_pad_b:19,textwrap:"Enabled",notitime:10,ge_enable_updatenoti:!0,sy_clr_lst_icon:"#757575E6",og_clr_bg_light:"#CBCBCB",og_clr_bg_dark:"#121315",og_clr_sb_light:"#BA4956",og_clr_sb_dark:"#4960ba",og_clr_tx_light:"#2A2626",og_clr_tx_dark:"#CAD3F5",og_opacity:1,gh_clr_bg_light:"#E5E5E5",gh_clr_bg_dark:"#121315",gh_clr_sb_light:"#BA4956",gh_clr_sb_dark:"#BA496A",gh_clr_tx_light:"#2A2626",gh_clr_tx_dark:"#CAD3F5",gh_opacity:1,ge_enable_ribbon_icons:!1,sy_enable_ribbon_icons:!0,sy_enable_autoupdate:!0,sy_enable_autosave:!1,sy_enable_autosave_strict:!1,sy_enable_autosave_notice:!1,sy_add_frontmatter:!1,sy_save_list_showall:!1,sy_save_list_datetime:"MM.DD.YYYY h:m:s a",sy_save_duration:120,ge_contextmenu_sorting:[],portals:{},uuid:""};var i={base_underdev_title:"Feature Under Development",base_underdev_msg:'I am currently working with the developer of OpenGist to make minor changes to how OpenGist pastes appear, including moving the "view raw" button to the bottom so that Obsidian\'s edit button does not overlap.',base_opt_enabled:"Enabled",base_opt_disabled:"Disabled",base_theme_light:"Light",base_theme_dark:"Dark",base_time_am:"AM",base_time_pm:"PM",base_component_reset:"Reset to Default",base_debug_loading:"Loading {0} v{1} [ {2} ]",base_debug_updater_1:"{0} Update Check",base_debug_updater_2:"{0} {1}",base_context_nofocus:"Obsidian does not have focus, please open a file",base_reload_notice:"Successfully reloaded Gistr",cfg_context_gist_public:"Save Gist (Github Public)",cfg_context_gist_secret:"Save Gist (Github Secret)",cfg_context_gist_copy:"Copy Gist URL",cfg_context_gist_reload:"Reload Gistr",cfg_modal_desc:"Gistr allows you to embed gists directly from Github and Opengist. You can also turn your notes into gists which can be updated manually, or monitored with autosave. For a detailed set of examples, view the demo vault in the support section below.",cfg_modal_expand:"Expand",cfg_tab_ge_title:"Global",cfg_tab_ge_header:"These settings affect all aspects of this plugin, including both Opengist and Github. If you change the trigger keyword, ensure you go back through your existing gist snippets and change the keyword at the top of each codeblock; otherwise embedded gists will not appear.",cfg_tab_sy_title:"Gist Save & Sync",cfg_tab_sy_header:"These settings allow you to create gists from your notes. The contents of your notes will be directly uploaded to Github under an existing account. You may also choose to create only new notes, or manage new and existing.",cfg_tab_og_title:"OpenGist",cfg_tab_og_header:"Opengist is a self-hosted pastebin powered by Git. All snippets are stored in a Git repository and can be read and/or modified using standard Git commands, or with the web interface. It is similiar to GitHub Gist, but open-source and is self-hosted. OpenGist supports Windows, Linux, and MacOS.",cfg_tab_gh_title:"Github",cfg_tab_gh_header:"Github Gists let you store and distribute code snippets without setting up a full-fledged repository. Store snippets such as strings, bash scripts, markdown, text files, and other small pieces of data.",cfg_tab_po_title:"Portal (Developer)",cfg_tab_po_header:"These settings display currently registered portals for Gistr.",cfg_tab_sp_title:"Support",cfg_tab_ge_keyword_name:"Trigger keyword",cfg_tab_ge_keyword_desc:"Word to use inside codeblocks to designate as a portal for showing gists",cfg_tab_ge_theme_name:"Theme",cfg_tab_ge_theme_desc:'This determines what color scheme will be used for gists. You can however, customize the colors in the Github and OpenGist categories below.

Note: When this is changed, place your cursor in the codeblock and then leave the codeblock to refresh it. Automatic refreshing only works in reading mode',cfg_tab_ge_wrap_name:"Text wrapping",cfg_tab_ge_wrap_desc:"If enabled, text will wrap to the next line. If disabled, you will see a horizontal scrollbar. This does not include gists that have no spaces anywhere in the body.",cfg_tab_ge_noti_dur_name:"Notification duration",cfg_tab_ge_noti_dur_desc:'How long a notification will display for (in seconds). Set to 0 to keep notification up until user dismisses it.',cfg_tab_ge_noti_update_name:"Enable Gistr update notifications",cfg_tab_ge_noti_update_desc:'Enabled: When launching Obsidian, you will get a notification if a new version of Gistr is available. This includes beta releases not available to the public yet.

Disabled: You will not get any notifications alerting you to new Gistr updates. You must manually check or use the Obsidian plugin checker.

Note: This update notification includes beta releases of Gistr. The Obsidian plugin updater does not track beta.',cfg_tab_ge_tog_enable_ribbon_debug_name:"Enable refresh icon",cfg_tab_ge_tog_enable_ribbon_debug_desc:'Enabled: Adds a special icon to your top header ribbon which allows you to force all embedded gists to be refreshed.
This is useful when modifying the colors / settings for Gistr, since all codeblocks are cached and changes do not appear immediately. The button added to your ribbon will force-refresh all codeblocks and immediately show new changes.',cfg_tab_ge_tog_enable_ribbon_debug_tip:"",cfg_tab_og_cb_light_name:"Codeblock bg (Light)",cfg_tab_og_cb_light_desc:'Color for Opengist codeblock background color (Light Theme)',cfg_tab_og_cb_dark_name:"Codeblock bg (Dark)",cfg_tab_og_cb_dark_desc:'Color for Opengist codeblock background color (Dark Theme)',cfg_tab_og_sb_light_name:"Scrollbar track (Light)",cfg_tab_og_sb_light_desc:'Color for Opengist scrollbar track (Light Theme)',cfg_tab_og_sb_dark_name:"Scrollbar track (Dark)",cfg_tab_og_sb_dark_desc:'Color for Opengist scrollbar track (Dark Theme)',cfg_tab_og_tx_light_name:"Codeblock text (Light)",cfg_tab_og_tx_light_desc:'Color for codeblock text color (Light Theme)',cfg_tab_og_tx_dark_name:"Codeblock text (Dark)",cfg_tab_og_tx_dark_desc:'Color for codeblock text color (Dark Theme)',cfg_tab_og_opacity_name:"Codeblock opacity",cfg_tab_og_opacity_desc:"Total opacity for codeblock. Do not set this too low, or your codeblocks will be invisible",cfg_tab_og_pad_top_name:"Padding: top",cfg_tab_og_pad_top_desc:"Padding between gist codeblock header and code.",cfg_tab_og_pad_btm_name:"Padding: bottom",cfg_tab_og_pad_btm_desc:"Padding between gist codeblock and the bottom scrollbar.",cfg_tab_og_css_name:"Custom CSS",cfg_tab_og_css_desc:"This textarea allows you to enter custom CSS properties to override existing colors.",cfg_tab_og_css_pholder:"Paste CSS here",cfg_tab_gh_cb_light_name:"Codeblock bg (Light)",cfg_tab_gh_cb_light_desc:'Color for Github codeblock background color (Light Theme)',cfg_tab_gh_cb_dark_name:"Codeblock bg (Dark)",cfg_tab_gh_cb_dark_desc:'Color for Github codeblock background color (Dark Theme)',cfg_tab_gh_sb_light_name:"Scrollbar track (Light)",cfg_tab_gh_sb_light_desc:'Color for Github scrollbar track (Light Theme)',cfg_tab_gh_sb_dark_name:"Scrollbar track (Dark)",cfg_tab_gh_sb_dark_desc:'Color for Github scrollbar track (Dark Theme)',cfg_tab_gh_tx_light_name:"Codeblock text (Light)",cfg_tab_gh_tx_light_desc:'Color for codeblock text color (Light Theme)',cfg_tab_gh_tx_dark_name:"Codeblock text (Dark)",cfg_tab_gh_tx_dark_desc:'Color for codeblock text color (Dark Theme)',cfg_tab_gh_opacity_name:"Codeblock opacity",cfg_tab_gh_opacity_desc:"Total opacity for codeblock. Do not set this too low, or your codeblocks will be invisible",cfg_tab_gh_css_name:"Custom CSS",cfg_tab_gh_css_desc:"This textarea allows you to enter custom CSS properties to override existing colors.",cfg_tab_gh_css_pholder:"Paste CSS here",cfg_tab_gh_pat_name:"Personal access token",cfg_tab_gh_pat_desc:"The personal access token (PAT) generated on Github.com which allows you to write gists from your Obsidian vault to Github gist.",cfg_tab_gh_pat_pholder:"githubpat_XXXXXX",cfg_tab_gh_pat_btn_tip_state_show:"Show token",cfg_tab_gh_pat_btn_tip_state_hide:"Hide token",cfg_tab_gh_pat_desc_l1:'This token allows you to authenticate with the GitHub API.
Create Token: here',cfg_tab_gh_pat_desc_l2:'For this to function with secret gists, select "All repositories" or "Only select repositories" from the dropdown on the Github Token page. The token must have at least the following permissions:',cfg_tab_gh_pat_perm_1:'Account Permissions ► Gists                                                                          Read-and-write',cfg_tab_gh_pat_perm_2:'Repository Permissions ► Pull Requests                                      Read-only',cfg_tab_gh_pat_perm_3:'Repository Permissions ► Contents                                                    Read-only',cfg_tab_gh_pat_perm_4:'Repository Permissions ► Issues                                                              Read-only',cfg_tab_gh_pat_footer:"Github icon to the right will turn into a checkmark when you've entered a valid token.",cfg_tab_gh_pat_help:'What is this for? Read the docs',cfg_tab_gh_pat_url_btn:"https://github.com/settings/tokens?type=beta",cfg_tab_gh_pat_ok_btn_tip:"Valid Github API Token",cfg_tab_gh_pat_bad_btn_tip:"Invalid Github API Token entered\n\nClick here to generate one",cfg_tab_gh_pat_invalid_btn_tip:"Github API token is not valid, ensure you type it correctly\n\nClick here to generate one",cfg_tag_gh_pat_notice_msg_success:"Gistr has detected a valid Github personal access token which has been saved",cfg_tag_gh_pat_notice_msg_cleared:"Personal access token cleared",cfg_tab_gh_pat_notice_type_fine:"Fine-Grained Github Token Detected",cfg_tab_gh_pat_notice_type_classic:"Classic Github Token Detected",cfg_tab_su_desc:"The following buttons are associated to useful resources for this plugin.",cfg_tab_su_doc_name:"Documentation",cfg_tab_su_doc_desc:"View the official Gistr documentation",cfg_tab_su_doc_btn:"View",cfg_tab_su_gs_name:"Introduction",cfg_tab_su_gs_desc:"View brief introduction to getting started with this plugin",cfg_tab_su_gs_btn:"Open",cfg_tab_su_repo_label:"Plugin repo",cfg_tab_su_repo_btn:"View",cfg_tab_su_vault_label:"Plugin demo vault",cfg_tab_su_vault_btn:"View",cfg_tab_su_ogrepo_label:"OpenGist: download",cfg_tab_su_ogrepo_url:"https://github.com/thomiceli/opengist/releases",cfg_tab_su_ogrepo_btn:"View",cfg_tab_su_ogdocs_label:"OpenGist: docs",cfg_tab_su_ogdocs_url:"https://github.com/thomiceli/opengist/blob/master/docs/index.md",cfg_tab_su_ogdocs_btn:"View",cfg_tab_su_ogdemo_label:"OpenGist: demo",cfg_tab_su_ogdemo_url:"https://opengist.thomice.li/all",cfg_tab_su_ogdemo_btn:"View",cfg_tab_su_gist_label:"Github gist",cfg_tab_su_gist_url:"https://gist.github.com/",cfg_tab_su_gist_btn:"View",cfg_tab_su_ver_cur_name:"Current version",cfg_tab_su_ver_cur_desc:"Current running version of Gistr",cfg_tab_su_guid_cur_name:"GUID",cfg_tab_su_guid_cur_desc:"Gistr plugin release",cfg_tab_su_guid_btn_tip:"Copy to clipboard",cfg_tab_su_guid_notice:"Copied Gistr GUID to clipboard\n\n{0}",cfg_tab_su_uuid_cur_name:"UUID",cfg_tab_su_uuid_cur_desc:"Unique id for your current running release of Gistr",cfg_tab_su_uuid_btn_tip:"Copy to clipboard",cfg_tab_su_uuid_notice:"Copied Gistr release UUID to clipboard\n\n{0}",cfg_tab_su_ver_stable:"Latest stable release ",cfg_tab_su_ver_beta:"Latest beta release ",cfg_tab_su_ver_connection_issues:"Server communication failed",cfg_tab_su_ver_status_checking:"Checking for newer version of Gistr",cfg_tab_su_ver_status_checking_btn_tip:"Checking for newer version of Gistr",cfg_tab_su_ver_status_updated_btn_tip:"You are running the latest version of Gistr",cfg_tab_su_ver_status_new_stable_btn_tip:"A newer stable release of Gistr is available",cfg_tab_su_ver_status_new_beta_btn_tip:"A newer beta release of Gistr is available",cfg_tab_su_ver_status_error_btn_tip:"Could not communicate with the gistr server, retrying later",cfg_tab_po_create_name:"Create Portal",cfg_tab_po_create_desc:"Created a new registered portal",cfg_tab_po_create_btn:"Create",cfg_tab_po_list_desc:"List of portals registered:",cfg_tab_po_list_none_title:"No Portals Found",cfg_tab_po_list_none_msg:"No created portals can be found. Click the **Create Portal** button at the top of this settings interface to create your first",cfg_po_edit_url_name:"URL",cfg_po_edit_url_desc:"Direct path URL which leads to your assigned website portal",cfg_po_edit_url_hold:"https://gist.github.com/username/XXXXXXXXX",cfg_po_edit_name_name:"Name",cfg_po_edit_name_desc:"Name assigned to the portal window. This can be used in a codeblock to call the name of the portal using a YAML structure.",cfg_po_edit_name_hold:"Portal Name",cfg_po_edit_icon_name:"Icon",cfg_po_edit_icon_desc:"Icon displayed in the portal",cfg_po_edit_icon_hold:"Leave blank to auto-detect",cfg_po_edit_agent_name:"User agent",cfg_po_edit_agent_desc:"Leave this alone if you are unsure what it does",cfg_po_edit_agent_hold:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0/HBpt3US8-18",cfg_po_edit_dock_name:"Dock / Position",cfg_po_edit_dock_desc:"Sets the position for the page",cfg_po_edit_pin_name:"Pin to menu",cfg_po_edit_pin_desc:"If enabled: Portal will be pinned to the left bar",cfg_po_edit_pkey_name:"Profile key",cfg_po_edit_pkey_desc:"Portals with the same profile key will share cookies & storage",cfg_po_edit_pkey_hold:"",cfg_po_edit_zoom_name:"Zoom",cfg_po_edit_zoom_desc:"Allows a webpage to be zoomed in or out on load",cfg_po_edit_css_name:"CSS",cfg_po_edit_css_desc:"Override CSS / stylesheet for window",cfg_po_edit_css_hold:"No custom CSS provided",cfg_po_edit_js_name:"JS",cfg_po_edit_js_desc:"Override JS / javascript for window",cfg_po_edit_js_hold:"No custom Javascript provided",cfg_po_edit_advtoggle_name:"Advanced Settings",cfg_po_edit_advtoggle_desc:"Make advanced menu options appear",cfg_po_button_name:"Portal Actions",cfg_po_button_desc:"Save or update settings for your configured portals",cfg_po_button_opt_create:"Create Portal",cfg_po_button_opt_update:"Update Portal",po_url_missing:"Missing url parameter",po_notice_restart_obsidian:"Change(s) will take effect after you restart Obsidian",po_notice_portal_not_found:"Portal not found",cfg_tab_sy_list_save_showall_name:"Save list: Show All Saves",cfg_tab_sy_list_save_showall_desc:'This setting effects how the gist save list displays saved gists.

Enabled: When saving an existing gist, the suggestion box will display ALL saves for that note in the same list; both public and secret.

Disabled: Public and secret gist saves will be separated when being displayed in the existing gist save list.',cfg_tab_sy_list_icon_name:"Save list: Icon color",cfg_tab_sy_list_icon_desc:"Color for icon in gist save list",cfg_tab_sy_list_datetime_name:"Save list: Datetime format",cfg_tab_sy_list_datetime_desc:'Defines what format the date and time will display as.
Datetime Format Options: view here',cfg_tab_sy_tog_enable_ribbon_name:"Enable ribbon icons",cfg_tab_sy_tog_enable_ribbon_desc:'Enabled: Adds Save Public / Secret Gist icons to left-side ribbon in Obsidian.

Disabled: You will only be able to access the save menu options from your right-click menu, or the Obsidian command palette',cfg_tab_sy_tog_enable_ribbon_tip:"",cfg_tab_sy_tog_allow_gist_updates_name:"Allow updating gists",cfg_tab_sy_tog_allow_gist_updates_desc:'Enabled: After you initially create a new gist, the note can be updated with newer revisions.

Disabled: Gists can only be created; no updates are allowed.

To update a gist after enabling this setting, right-click on the note, or open the Obsidian command palette and select Save Gist',cfg_tab_sy_tog_allow_gist_updates_tip:"",cfg_tab_sy_tog_autosave_enable_name:"Enable autosave",cfg_tab_sy_tog_autosave_enable_desc:'Enabled: This will allow gists to be updated once they are created. It will also enable autosaving which will detect new changes and push them.

Disabled: You will only be able to create gists by manually doing so; there will be no way to update them.

If you wish to keep this disabled, you can create gists by right-clicking in the note and selecting Save Gist. Or opening your command palette and selecting the save option from there.',cfg_tab_sy_tog_autosave_enable_tip:"",cfg_tab_sy_tog_autosave_strict_name:"Enable autosave strict saving",cfg_tab_sy_tog_autosave_strict_desc:'Enabled: Your notes will be saved to the gist service precisely on time every {0} seconds, whether you are still typing or not.

Disabled: Time until save will not start until you have finished typing in that note. If you continue typing, the saving countdown will not start until your final key is pressed.

Autosave duration can be modified further down in these settings.',cfg_tab_sy_tog_autosave_strict_tip:"",cfg_tab_sy_tog_autosave_noti_name:"Enable autosave notices",cfg_tab_sy_tog_autosave_noti_desc:'Each time your note is saved automatically, a notice will appear on-screen informing you of the action. This only works if Autosave is enabled.',cfg_tab_sy_tog_autosave_noti_tip:"",cfg_tab_sy_num_save_dur_name:"Autosave duration",cfg_tab_sy_num_save_dur_desc:'How often autosave will execute in seconds. Set this to a fair amount so that the calls aren\'t being ran excessively to the gist API server (Github or OpenGist).

The save countdown timer will begin shortly after you stop typing.

If you wish to change this to save precisely every {0} seconds, enable the setting Autosave Strict Saving located above.',cfg_tab_sy_tog_inc_fm_name:"Include frontmatter",cfg_tab_sy_tog_inc_fm_desc:'When saving a note as a new gist, frontmatter will be added to the top of your note with information about the gist.

Enabled: frontmatter added to your notes will be included when your note is pushed to a gist service.

Disabled: the note will be cleaned before it is pushed to the gist service and no frontmatter fields will be present in the online version.

Frontmatter can be found at the very top of each note, in-between `---` ',cfg_tab_sy_tog_inc_fm_tip:"Frontmatter starts with three hyphens `---`",gist_upload_req_allowupload:'Must enable "Allow Uploading Gists" in the Gistr settings before you can use this command.',gist_upload_no_active_file:"No active file present. Open a note in Obsidian before continuing.",gist_copy_fail_notagist:"No URL to copy. You must turn your note into a gist first.",gist_copy_success_file:"Copied {0} URL to your clipboard",gist_copy_success:"Copied gist URL to clipboard.",gist_upload_fail_api:"GitHub API error: {0}",gist_upload_success:"File {0} has been updated successfully to your gist service.",gist_status_operational_raw:"operational",gist_status_connecting:"connecting ...",gist_status_connected:"Connected to API ...",gist_status_no_api:"Github token missing, no connection",gist_status_no_api_btn_tip:"You must create and specify a Github API token.\n\nAborting connection",gist_status_noconnection:"Failed to communicate with Github",gist_status_degraded_performance:"Degraded Performance",gist_status_partial_outage:"Partial Outage",gist_status_major_outage:"Major Outage",gist_status_issues:"service issues",gist_status_connecting_btn_tip:"Connecting to Github ...",gist_status_success_btn_tip:"Connected to Github API",gist_status_issues_btn_tip:"Github API is currently experiencing issues\n\nClick to view details.",gist_btn_create_new:"Create New Gist",gist_not_found:"Could not locate the specified Gist. Did you possibly delete it from Github?\n\nTo update this note as a new gist, remove the frontmatter text at the top of the note.",gs_base_header:"This plugin allows you to integrate both OpenGist and Github Gist pastes within your Obsidian notes. To use this plugin, you can either create a new Github gist, or setup your own OpenGist server. OpenGist is free, and takes only minutes to configure.",gs_og_btn_repo:"Download OpenGist",gs_og_btn_docs:"OpenGist Docs",gs_og_sub_1:"Once you install and set up OpenGist, you can sign in to your OpenGist website and create your first Gist. After your Gist is created, return to your Obsidian node, and integrate your Gist into your note using code similar to the following:",gs_og_name:"OpenGist integration",gs_og_desc:"OpenGist supports Windows, Linux, MacOS, and Docker. To download and set up OpenGist, click below.",gs_gh_name:"Github integration",gs_gh_desc:"To paste a Github Gist into your note, use a command similar to the following examples:",gs_btn_settings_open:"Open Settings",gs_btn_close:"Close",gh_status_error_api:"Github API Error: {0}",ver_update_stable:"An update is available for the Gistr plugin. Update to check out the latest features!",ver_update_stable_dn_title:"{0} Update Available ► Stable",ver_update_stable_dn_msg:"New stable release available for Gistr plugin.\n\n{0} ► {1}",ver_update_beta:"A new beta release is available for the Gistr plugin. Update to check out the latest features coming to stable!",ver_update_beta_dn_title:"{0} Update Available ► Beta",ver_update_beta_dn_msg:"New beta release available for Gistr plugin.\n\n{0} ► {1}",ver_url:"https://raw.githubusercontent.com/Aetherinox/obsidian-gistr/{0}/package.json",pickr_dialog:"Color Picker",pickr_swatch:"Color Swatch",pickr_toggle:"Pick Color",pickr_last:"Use Last Color",pickr_save:"Save",pickr_cancel:"Cancel",pickr_clear:"Clear",pickr_restore_default_btn_tip:"Restore default color",pickr_dev_unknown:"Gistr: Unknown color format: {0}",err_gist_token_missing:"Github API token missing. Open the Gistr plugin settings, click the Github tab, and enter your token. Instructions are found on the settings page.",err_gist_loading_fail_name:"⚠️ Gistr: Failed to load the specified gist:",err_gist_loading_fail_resp:"{0}",err_gist_loading_fail_detail:"Could not load a valid Javascript from gist url: {0}",err_gist_loading_fail_url:"Could not find gist id -- Make sure correct URL is specified. {0}",lst_repotype_pub:"Public",lst_repotype_pri:"Secret"};const r={en:i}[e.moment.locale()];function o(t,...s){return r||console.error("Gistr language not found",e.moment.locale()),(r&&r[t]||i[t]).replace(/{(\d+)}/g,((e,t)=>{const n=s[t];return void 0!==n?n:e}))}var a,c,l,u;(e=>{e.HEX="HEX",e.RGB="RGB",e.HSL="HSL",e.CIELab="CIELab",e.CMYK="CMYK"})(a||(a={})),(e=>{e.ANALOGOUS="ANALOGOUS",e.COMPLEMENTARY="COMPLEMENTARY",e.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",e.TRIADIC="TRIADIC",e.TETRADIC="TETRADIC",e.SQUARE="SQUARE"})(c||(c={})),(e=>{e.ADDITIVE="ADDITIVE",e.SUBTRACTIVE="SUBTRACTIVE"})(l||(l={})),(e=>{e.black="#000000",e.silver="#C0C0C0",e.gray="#808080",e.white="#FFFFFF",e.maroon="#800000",e.red="#FF0000",e.purple="#800080",e.fuchsia="#FF00FF",e.green="#008000",e.lime="#00FF00",e.olive="#808000",e.yellow="#FFFF00",e.navy="#000080",e.blue="#0000FF",e.teal="#008080",e.aqua="#00FFFF",e.orange="#FFA500",e.aliceblue="#F0F8FF",e.antiquewhite="#FAEBD7",e.aquamarine="#7FFFD4",e.azure="#F0FFFF",e.beige="#F5F5DC",e.bisque="#FFE4C4",e.blanchedalmond="#FFEBCD",e.blueviolet="#8A2BE2",e.brown="#A52A2A",e.burlywood="#DEB887",e.cadetblue="#5F9EA0",e.chartreuse="#7FFF00",e.chocolate="#D2691E",e.coral="#FF7F50",e.cornflowerblue="#6495ED",e.cornsilk="#FFF8DC",e.crimson="#DC143C",e.cyan="#00FFFF",e.darkblue="#00008B",e.darkcyan="#008B8B",e.darkgoldenrod="#B8860B",e.darkgray="#A9A9A9",e.darkgreen="#006400",e.darkgrey="#A9A9A9",e.darkkhaki="#BDB76B",e.darkmagenta="#8B008B",e.darkolivegreen="#556B2F",e.darkorange="#FF8C00",e.darkorchid="#9932CC",e.darkred="#8B0000",e.darksalmon="#E9967A",e.darkseagreen="#8FBC8F",e.darkslateblue="#483D8B",e.darkslategray="#2F4F4F",e.darkslategrey="#2F4F4F",e.darkturquoise="#00CED1",e.darkviolet="#9400D3",e.deeppink="#FF1493",e.deepskyblue="#00BFFF",e.dimgray="#696969",e.dimgrey="#696969",e.dodgerblue="#1E90FF",e.firebrick="#B22222",e.floralwhite="#FFFAF0",e.forestgreen="#228B22",e.gainsboro="#DCDCDC",e.ghostwhite="#F8F8FF",e.gold="#FFD700",e.goldenrod="#DAA520",e.greenyellow="#ADFF2F",e.grey="#808080",e.honeydew="#F0FFF0",e.hotpink="#FF69B4",e.indianred="#CD5C5C",e.indigo="#4B0082",e.ivory="#FFFFF0",e.khaki="#F0E68C",e.lavender="#E6E6FA",e.lavenderblush="#FFF0F5",e.lawngreen="#7CFC00",e.lemonchiffon="#FFFACD",e.lightblue="#ADD8E6",e.lightcoral="#F08080",e.lightcyan="#E0FFFF",e.lightgoldenrodyellow="#FAFAD2",e.lightgray="#D3D3D3",e.lightgreen="#90EE90",e.lightgrey="#D3D3D3",e.lightpink="#FFB6C1",e.lightsalmon="#FFA07A",e.lightseagreen="#20B2AA",e.lightskyblue="#87CEFA",e.lightslategray="#778899",e.lightslategrey="#778899",e.lightsteelblue="#B0C4DE",e.lightyellow="#FFFFE0",e.limegreen="#32CD32",e.linen="#FAF0E6",e.magenta="#FF00FF",e.mediumaquamarine="#66CDAA",e.mediumblue="#0000CD",e.mediumorchid="#BA55D3",e.mediumpurple="#9370DB",e.mediumseagreen="#3CB371",e.mediumslateblue="#7B68EE",e.mediumspringgreen="#00FA9A",e.mediumturquoise="#48D1CC",e.mediumvioletred="#C71585",e.midnightblue="#191970",e.mintcream="#F5FFFA",e.mistyrose="#FFE4E1",e.moccasin="#FFE4B5",e.navajowhite="#FFDEAD",e.oldlace="#FDF5E6",e.olivedrab="#6B8E23",e.orangered="#FF4500",e.orchid="#DA70D6",e.palegoldenrod="#EEE8AA",e.palegreen="#98FB98",e.paleturquoise="#AFEEEE",e.palevioletred="#DB7093",e.papayawhip="#FFEFD5",e.peachpuff="#FFDAB9",e.peru="#CD853F",e.pink="#FFC0CB",e.plum="#DDA0DD",e.powderblue="#B0E0E6",e.rosybrown="#BC8F8F",e.royalblue="#4169E1",e.saddlebrown="#8B4513",e.salmon="#FA8072",e.sandybrown="#F4A460",e.seagreen="#2E8B57",e.seashell="#FFF5EE",e.sienna="#A0522D",e.skyblue="#87CEEB",e.slateblue="#6A5ACD",e.slategray="#708090",e.slategrey="#708090",e.snow="#FFFAFA",e.springgreen="#00FF7F",e.steelblue="#4682B4",e.tan="#D2B48C",e.thistle="#D8BFD8",e.tomato="#FF6347",e.turquoise="#40E0D0",e.violet="#EE82EE",e.wheat="#F5DEB3",e.whitesmoke="#F5F5F5",e.yellowgreen="#9ACD32",e.rebeccapurple="#663399"})(u||(u={}));const d=Object.keys(u),p={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},g={BGR:a.RGB,ABGR:a.RGB,HLS:a.HSL,AHLS:a.HSL,LAB:a.CIELab,ALAB:a.CIELab,CKMY:a.CMYK,ACKMY:a.CMYK};var h;(e=>{e.NUMBER="number",e.BOOLEAN="boolean"})(h||(h={}));const m={[a.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[a.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[a.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[a.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[a.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},f=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,b=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,_=/^0x([a-f\d]{1,2})$/i,A=/\{(\d+)\}/g,y=/,( +|\d+)/g,w=/ +/;var E,v,k;(e=>{e.NONE="none",e.DEGREES="deg",e.GRADIANS="grad",e.RADIANS="rad",e.TURNS="turn"})(E||(E={})),(e=>{e.NONE="none",e.PERCENT="percent"})(v||(v={})),(e=>{e.DEVICE_CMYK="device-cmyk",e.CMYK="cmyk"})(k||(k={}));const T={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:E.NONE,rgbUnit:v.NONE,labUnit:v.NONE,cmykUnit:v.PERCENT,alphaUnit:v.NONE,cmykFunction:k.DEVICE_CMYK},S=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),C=e=>+`${e}`.replace(b,"$1"),D=e=>b.test(`${e}`)?C(e):Math.min(+e,100),O=e=>(1===e.length&&(e+=e),parseInt(e,16)),I=e=>{const t=B(e,0).toString(16).toUpperCase();return 1===t.length?`0x0${t}`:`0x${t}`},L=(e,t=!1)=>!t&&b.test(e)?Math.min(255*C(e)/100,255):_.test(e)?(3===e.length&&(e+=e.slice(-1)),t?B(e)/255:B(e)):Math.min(+e,t?1:255),G=e=>b.test(e)?P(125*C(e)/100,-125,125):P(+e,-125,125),R=e=>Math.min(b.test(e)?C(e)/100:+e,1),x=e=>[...e].sort().join("").toUpperCase(),B=(e,t=6)=>{const s=Math.pow(10,t);return Math.round(+e*s)/s},P=(e,t,s)=>Math.max(t,Math.min(e,s)),F=e=>{if("string"==typeof e){const t=e.match(f),s=+t[1];switch(t[2]){case E.RADIANS:e=B(180*s/Math.PI);break;case E.TURNS:e=B(360*s);break;case E.GRADIANS:e=B(.9*s);break;case E.DEGREES:default:e=s}}return(e>360||e<0)&&(e-=360*Math.floor(e/360)),e},M=(e,...t)=>{const s=[],n=[],i=[],r=[],o=[],a=[],c=Object.values(E),l=Object.values(v),u=Object.values(k),d={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const e of t)if("string"==typeof e){if(s.push(e),e.includes(",")){d.legacyCSS++;const t=e.match(y);1===new Set(t).size&&w.test(t[0].slice(1))&&d.spacesAfterCommas++}if(e.match(m.HSL)){const t=e.match(m.HSL),s=t[1]||t[5],i=t[8],r=s.match(f)[2];n.push(""===r?E.NONE:r),a.push(b.test(i));continue}if(m.RGB.test(e)){const t=e.match(m.RGB),s=t[1]||t[5],n=t[2]||t[6],r=t[3]||t[7],o=t[8];i.push(b.test(s)&&b.test(n)&&b.test(r)),a.push(b.test(o));continue}if(m.CIELab.test(e)){const t=e.match(m.CIELab),s=t[1],n=t[2],i=t[3],o=t[4];r.push(b.test(s)&&b.test(n)&&b.test(i)),a.push(b.test(o));continue}if(e.match(m.CMYK)){const t=e.match(m.CMYK),s=t[1]||t[6],n=t[2]||t[7],i=t[3]||t[8],r=t[4]||t[9],c=t[10];o.push(b.test(s)&&b.test(n)&&b.test(i)&&b.test(r)),e.startsWith("cmyk")&&d.cmykFunction++,a.push(b.test(c))}}return{decimals:typeof e.decimals===h.NUMBER?e.decimals:T.decimals,legacyCSS:typeof e.legacyCSS===h.BOOLEAN?e.legacyCSS:Boolean(s.length&&d.legacyCSS===s.length)||T.legacyCSS,spacesAfterCommas:typeof e.spacesAfterCommas===h.BOOLEAN?e.spacesAfterCommas:Boolean(s.length&&d.spacesAfterCommas===s.length)||T.spacesAfterCommas,anglesUnit:e.anglesUnit&&c.includes(e.anglesUnit)?e.anglesUnit:1===new Set(n).size?n[0]:T.anglesUnit,rgbUnit:e.rgbUnit&&l.includes(e.rgbUnit)?e.rgbUnit:1===new Set(i).size&&i[0]?v.PERCENT:T.rgbUnit,labUnit:e.labUnit&&l.includes(e.labUnit)?e.labUnit:1===new Set(r).size&&r[0]?v.PERCENT:T.labUnit,cmykUnit:e.cmykUnit&&l.includes(e.cmykUnit)?e.cmykUnit:1!==new Set(o).size||o[0]?T.cmykUnit:v.NONE,alphaUnit:e.alphaUnit&&l.includes(e.alphaUnit)?e.alphaUnit:1===new Set(a).size&&a[0]?v.PERCENT:T.alphaUnit,cmykFunction:e.cmykFunction&&u.includes(e.cmykFunction)?e.cmykFunction:o.length&&o.length===d.cmykFunction?k.CMYK:T.cmykFunction}},N=e=>`${e}`in l,U=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],H=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],j=U.map((e=>e.reduce(((e,t)=>e+t),0))),Y=(e,t,s)=>(s<0&&(s+=6),s>=6&&(s-=6),B(s<1?255*((t-e)*s+e):s<3?255*t:s<4?255*((t-e)*(4-s)+e):255*e)),Q=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,W=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,J=(e,t,s,n)=>{const i=[0,0,0],r=[e,t,s];return n.forEach(((e,t)=>{e.forEach(((e,s)=>{i[t]+=e*r[s]}))})),i},z=(e,t,s)=>{t/=100;const n=(s/=100)<=.5?s*(t+1):s+t-s*t,i=2*s-n;return{R:Y(i,n,2+(e/=60)),G:Y(i,n,e),B:Y(i,n,e-2)}},Z=(e,t,s,n=1)=>{e/=255,t/=255,s/=255,n=Math.min(n,1);const i=Math.max(e,t,s),r=Math.min(e,t,s),o=i-r;let a=0,c=0;const l=(i+r)/2;if(0!==o){switch(i){case e:a=(t-s)/o%6;break;case t:a=(s-e)/o+2;break;case s:a=(e-t)/o+4}a=B(60*a),a<0&&(a+=360),c=o/(1-Math.abs(2*l-1))}return{H:a,S:B(100*c),L:B(100*l),A:n}},V=(e,t,s)=>{const n=[e/255,t/255,s/255].map(Q),i=J(n[0],n[1],n[2],U),r=((e,t,s)=>{const n=e=>e>(6/29)**3?Math.cbrt(e):e/(3*(6/29)**2)+4/29,i=n(e/j[0]),r=n(t/j[1]);return[116*r-16,500*(i-r),200*(r-n(s/j[2]))]})(i[0],i[1],i[2]);return{L:r[0],a:r[1],b:r[2]}},K=(e,t,s)=>{const n=((e,t,s)=>{const n=e=>e>6/29?e**3:3*(6/29)**2*(e-4/29),i=(e+16)/116,r=t/500,o=s/200;return[j[0]*n(i+r),j[1]*n(i),j[2]*n(i-o)]})(e,t,s),i=J(n[0],n[1],n[2],H).map(W);return{R:P(255*i[0],0,255),G:P(255*i[1],0,255),B:P(255*i[2],0,255)}},X=(e,t,s,n)=>({R:B(255*(1-e)*(n=1-n)),G:B(255*(1-t)*n),B:B(255*(1-s)*n)}),q=(e,t,s)=>{e/=255,t/=255,s/=255;const n=1-Math.max(e,t,s),i=1-n,r=i&&(i-t)/i,o=i&&(i-s)/i;return{C:B(100*(i&&(i-e)/i)),M:B(100*r),Y:B(100*o),K:B(100*n)}},$=(e,t)=>{if(e<0&&(e+=360),e>360&&(e-=360),360===e||0===e)return e;const s=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],i=t?n:s;let r=0,o=0,a=0,c=0;return(t?s:n).find(((t,s)=>e>=t[0]&&ee?", ":",",te=(e,t)=>{const s=x(Object.keys(e));return p[g[s]].reduce(((s,n,i)=>{const r=e[n];return void 0!==r&&s.push(t(r,i)),s}),[])},se=(e,t)=>e.replace(A,((e,s)=>`${t[+s-1]}`)),ne=(e,t,s=!1)=>{const{alphaUnit:n,legacyCSS:i,decimals:r}=t;return n!==v.PERCENT||i&&!s?B(e,r):`${B(100*e,r)}%`},ie={[a.HEX]:e=>{const t=te(e,(e=>(e=>{let t=B(e,0).toString(16).toUpperCase();return 1===t.length&&(t=`0${t}`),t})(B(e)))),s=4===t.length?"#{1}{2}{3}{4}":"#{1}{2}{3}";return se(s,t)},[a.RGB]:(e,t)=>{const{decimals:s,legacyCSS:n,spacesAfterCommas:i,rgbUnit:r}=t,o=ee(i),a=te(e,((e,n)=>r===v.PERCENT&&n<3?`${((e,t)=>B(e/255*100,t))(e,s)}%`:3===n?ne(e,t):B(e,s))),c=n?4===a.length?`rgba({1}${o}{2}${o}{3}${o}{4})`:`rgb({1}${o}{2}${o}{3})`:4===a.length?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return se(c,a)},[a.HSL]:(e,t)=>{const{decimals:s,legacyCSS:n,spacesAfterCommas:i,anglesUnit:r}=t,o=ee(i),a=te(e,((e,n)=>0===n&&r!==E.NONE?`${B(((e,t)=>{let s;switch(t){case E.RADIANS:s=B((e=>e*Math.PI/180)(e));break;case E.TURNS:s=B(e/360);break;case E.GRADIANS:s=B(10/9*e);break;case E.DEGREES:case E.NONE:default:s=e}return s})(e,r),s)}${r}`:3===n?ne(e,t):B(e,s))),c=n?4===a.length?`hsla({1}${o}{2}%${o}{3}%${o}{4})`:`hsl({1}${o}{2}%${o}{3}%)`:4===a.length?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return se(c,a)},[a.CIELab]:(e,t)=>{const{decimals:s,labUnit:n}=t,i=te(e,((e,i)=>{if(0===i){const t=B(D(e),s);return n===v.PERCENT?`${t}%`:`${t}`}return i<3?n===v.PERCENT?`${((e,t)=>B(e/125*100,t))(e,s)}%`:B(e,s):ne(e,t,!0)})),r=4===i.length?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return se(r,i)},[a.CMYK]:(e,t)=>{const{decimals:s,legacyCSS:n,spacesAfterCommas:i,cmykUnit:r,cmykFunction:o}=t,a=ee(i),c=te(e,((e,n)=>r===v.PERCENT&&n<4?`${B(e,s)}%`:4===n?ne(e,t):B(e/100,s))),l=n?5===c.length?`${o}({1}${a}{2}${a}{3}${a}{4}${a}{5})`:`${o}({1}${a}{2}${a}{3}${a}{4})`:5===c.length?`${o}({1} {2} {3} {4} / {5})`:`${o}({1} {2} {3} {4})`;return se(l,c)}},re=e=>("string"==typeof e&&(e=b.test(e)?C(e)/100:+e),isNaN(+e)||e>1?1:B(e)),oe=(e,t,s)=>t.reduce(((t,n)=>[...t,{...e,H:s===l.ADDITIVE?F(e.H+n):F($($(e.H,!1)+n,!0))}]),[{...e}]),ae=(e,t)=>oe(e,[30,-30],t),ce=(e,t)=>oe(e,[180],t),le=(e,t)=>oe(e,[150,-150],t),ue=(e,t)=>oe(e,[120,-120],t),de=(e,t)=>oe(e,[60,-120,180],t),pe=(e,t)=>oe(e,[90,-90,180],t),ge=e=>"string"==typeof e?(e=>{let t;if(Object.keys(a).some((s=>{if(m[s].test(e))return t=s,!0})),!t&&~d.indexOf(e)&&(t=a.HEX),!t)throw new Error("The provided string color doesn't have a correct format");return t})(e):(e=>{let t,s=!1;const n=x(Object.keys(e));if(g[n]&&(t=g[n]),t&&t===a.RGB){const n=Object.entries(e).some((e=>!_.test(`${e[1]}`))),i=Object.entries(e).some((e=>!(b.test(`${e[1]}`)||!_.test(`${e[1]}`)&&!isNaN(+e[1])&&+e[1]<=255)));n&&i&&(s=!0),n||(t=a.HEX)}if(!t||s)throw new Error("The provided color object doesn't have the proper keys or format");return t})(e),he={[a.HEX](e){const t=(~d.indexOf(e)?u[e]:e).match(m.HEX),s={R:O(t[1]||t[5]),G:O(t[2]||t[6]),B:O(t[3]||t[7])},n=t[4]||t[8];return void 0!==n&&(s.A=O(n)/255),s},[a.RGB](e){const t=e.match(m.RGB),s=L(t[1]||t[5]),n=L(t[2]||t[6]),i=L(t[3]||t[7]),r=t[4]||t[8],o={R:Math.min(s,255),G:Math.min(n,255),B:Math.min(i,255)};return void 0!==r&&(o.A=re(r)),o},[a.HSL](e){const t=e.match(m.HSL),s=F(t[1]||t[5]),n=D(t[2]||t[6]),i=D(t[3]||t[7]),r=t[4]||t[8],o=z(s,n,i);return void 0!==r&&(o.A=re(r)),o},[a.CIELab](e){const t=e.match(m.CIELab),s=D(t[1]),n=G(t[2]),i=G(t[3]),r=t[4],o=K(s,n,i);return void 0!==r&&(o.A=re(r)),o},[a.CMYK](e){const t=e.match(m.CMYK),s=R(t[1]||t[6]),n=R(t[2]||t[7]),i=R(t[3]||t[8]),r=R(t[4]||t[9]),o=t[5]||t[10],a=X(s,n,i,r);return void 0!==o&&(a.A=re(o)),a}},me={[a.HEX](e){const t={R:L(`${e.R}`),G:L(`${e.G}`),B:L(`${e.B}`)};return S(e,"A")&&(t.A=Math.min(L(`${e.A}`,!0),1)),t},[a.RGB](e){return this.HEX(e)},[a.HSL](e){const t=D(`${e.S}`),s=D(`${e.L}`),n=z(F(e.H),t,s);return S(e,"A")&&(n.A=re(e.A)),n},[a.CIELab](e){const t=D(`${e.L}`),s=G(`${e.a}`),n=G(`${e.b}`),i=K(t,s,n);return S(e,"A")&&(i.A=re(e.A)),i},[a.CMYK](e){const t=R(`${e.C}`),s=R(`${e.M}`),n=R(`${e.Y}`),i=R(`${e.K}`),r=X(t,s,n,i);return S(e,"A")&&(r.A=re(e.A)),r}},fe=(e,t=ge(e))=>"string"==typeof e?he[t](e):me[t](e),be={[a.HEX]:e=>({R:I(e.R),G:I(e.G),B:I(e.B)}),HEXA(e){const t=be.HEX(e);return t.A=S(e,"A")?I(255*e.A):"0xFF",t},[a.RGB](e,t){const s=we(e,t);return S(s,"A")&&delete s.A,s},RGBA(e,t){const s=be.RGB(e,t);return s.A=S(e,"A")?B(e.A):1,s},[a.HSL](e,t){const s=Z(e.R,e.G,e.B);return delete s.A,Ee(s,t)},HSLA(e,t){const s=be.HSL(e,t);return s.A=S(e,"A")?B(e.A,t):1,s},[a.CIELab](e,t){const s=V(e.R,e.G,e.B);return ve(s,t)},CIELabA(e,t){const s=be.CIELab(e,t);return s.A=S(e,"A")?B(e.A,t):1,s},[a.CMYK]:(e,t)=>ke(q(e.R,e.G,e.B),t),CMYKA(e,t){const s=be.CMYK(e,t);return s.A=S(e,"A")?B(e.A,t):1,s}},_e=(e,t,s,n)=>{const i=ge(e),r="string"==typeof e,o=fe(e,i),c="string"==typeof e&&S(o,"A")||"string"!=typeof e&&S(e,"A"),l=Z(o.R,o.G,o.B,o.A);c||delete l.A;const u=s?l.L/(t+1):(100-l.L)/(t+1),d=Array(t).fill(null).map(((e,t)=>({...l,L:l.L+u*(t+1)*(1-2*+s)})));switch(i){case a.HEX:default:return d.map((e=>{const t=z(e.H,e.S,e.L);return c&&(t.A=e.A),r?c?ie.HEX({...t,A:B(255*t.A)}):ie.HEX(t):c?be.HEXA(t):be.HEX(t)}));case a.RGB:return d.map((e=>{const t=z(e.H,e.S,e.L);return c&&(t.A=e.A),r?ie.RGB(t,n):c?be.RGBA(t,n.decimals):be.RGB(t,n.decimals)}));case a.HSL:return d.map((e=>r?ie.HSL(e,n):c?be.HSLA({...z(e.H,e.S,e.L),A:e.A},n.decimals):be.HSL(z(e.H,e.S,e.L),n.decimals)));case a.CIELab:return d.map((e=>{const t=z(e.H,e.S,e.L);return r?ie.CIELab(c?be.CIELabA(t,n.decimals):be.CIELab(t,n.decimals),n):c?be.CIELabA({...t,A:e.A},n.decimals):be.CIELab(t,n.decimals)}))}},Ae={buildHarmony(e,t,s,n){const i=ge(e),r=fe(e,i),o=Z(r.R,r.G,r.B,r.A),c="string"==typeof e&&S(r,"A")||"string"!=typeof e&&S(e,"A"),l="string"==typeof e;switch(i){case a.HEX:default:return c?this.HEXA(Ee(o,0),t,s,l):this.HEX(Ee(o,0),t,s,l);case a.HSL:return c?this.HSLA(o,t,s,l,n):this.HSL(o,t,s,l,n);case a.RGB:return c?this.RGBA(o,t,s,l,n):this.RGB(o,t,s,l,n);case a.CIELab:return c?this.CIELabA(o,t,s,l,n):this.CIELab(o,t,s,l,n)}},[a.HEX]:(e,t,s,n)=>t(e,s).map((e=>n?ie.HEX(z(e.H,e.S,e.L)):be.HEX(z(e.H,e.S,e.L)))),HEXA:(e,t,s,n)=>t(e,s).map((e=>n?ie.HEX({...z(e.H,e.S,e.L),A:255*re(e.A)}):be.HEXA({...z(e.H,e.S,e.L),A:re(e.A)}))),[a.RGB]:(e,t,s,n,i)=>t(e,s).map((e=>n?ie.RGB(z(e.H,e.S,e.L),i):be.RGB(z(e.H,e.S,e.L),i.decimals))),RGBA:(e,t,s,n,i)=>t(e,s).map((e=>n?ie.RGB({...z(e.H,e.S,e.L),A:re(e.A)},i):be.RGBA({...z(e.H,e.S,e.L),A:re(e.A)},i.decimals))),[a.HSL]:(e,t,s,n,i)=>t(e,s).map((e=>n?ie.HSL({H:e.H,S:e.S,L:e.L},i):be.HSL(z(e.H,e.S,e.L),i.decimals))),HSLA:(e,t,s,n,i)=>t(e,s).map((e=>n?ie.HSL({...e,A:re(e.A)},i):be.HSLA({...z(e.H,e.S,e.L),A:re(e.A)},i.decimals))),[a.CIELab]:(e,t,s,n,i)=>t(e,s).map((e=>{const t=z(e.H,e.S,e.L);return n?ie.CIELab(V(t.R,t.G,t.B),i):be.CIELab(t,i.decimals)})),CIELabA:(e,t,s,n,i)=>t(e,s).map((e=>{const t=z(e.H,e.S,e.L);return n?ie.CIELab({...V(t.R,t.G,t.B),A:re(e.A)},i):be.CIELabA({...t,A:re(e.A)},i.decimals)}))},ye={mix(e,t){const s=e.map((e=>{const t=ge(e);return fe(e,t)})),n=t===l.SUBTRACTIVE?s.map((e=>{const t=((e,t,s)=>{const n=Math.min(e,t,s),i=Math.min(255-e,255-t,255-s),r=e-n,o=t-n,a=s-n,c=Math.min(r,o),l=r-c,u=(o+c)/2,d=(a+o-c)/2,p=Math.max(l,u,d)/Math.max(r,o,a),g=isNaN(p)||p===1/0||p<=0?1:p;return{R:l/g+i,Y:u/g+i,B:d/g+i}})(e.R,e.G,e.B);return S(e,"A")&&(t.A=e.A),t})):null;function i(e){const s=t===l.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return e.reduce(((e,s)=>{const n=S(s,"A")?s.A:1,i={R:Math.min(e.R+s.R*n,255),B:Math.min(e.B+s.B*n,255),A:1-(1-n)*(1-e.A)},r="G"in e?e.G:e.Y,o="G"in s?s.G:s.Y;return{...i,...t===l.ADDITIVE?{G:Math.min(r+o*n,255)}:{Y:Math.min(r+o*n,255)}}}),s)}let r;if(t===l.ADDITIVE)r=i(s);else{const e=i(n);r=((e,t,s)=>{const n=Math.min(e,t,s),i=Math.min(255-e,255-t,255-s),r=e-n,o=t-n,a=s-n,c=Math.min(o,a),l=r+o-c,u=o+c,d=2*(a-c),p=Math.max(l,u,d)/Math.max(r,o,a),g=isNaN(p)||p===1/0||p<=0?1:p;return{R:l/g+i,G:u/g+i,B:d/g+i}})(e.R,e.Y,e.B),r.A=e.A}return{R:B(r.R),G:B(r.G),B:B(r.B),A:P(r.A,0,1)}},[a.HEX](e,t,s){const n=this.mix(e,t);return delete n.A,s?ie.HEX(n):be.HEX(n)},HEXA(e,t,s){const n=this.mix(e,t);return n.A=s?255*re(n.A):re(n.A),s?ie.HEX(n):be.HEXA(n)},[a.RGB](e,t,s,n){const i=this.mix(e,t);return delete i.A,s?ie.RGB(i,n):be.RGB(i,n.decimals)},RGBA(e,t,s,n){const i=this.mix(e,t);return s?ie.RGB(i,n):be.RGBA(i,n.decimals)},[a.HSL](e,t,s,n){const i=this.mix(e,t),r=Z(i.R,i.G,i.B);return delete i.A,delete r.A,s?ie.HSL(r,n):be.HSL(i,n.decimals)},HSLA(e,t,s,n){const i=this.mix(e,t),r=Z(i.R,i.G,i.B,i.A);return s?ie.HSL(r,n):be.HSLA(i,n.decimals)},[a.CIELab](e,t,s,n){const i=this.mix(e,t),r=V(i.R,i.G,i.B);return delete i.A,s?ie.CIELab(r,n):be.CIELabA(i,n.decimals)},CIELabA(e,t,s,n){const i=this.mix(e,t),r=V(i.R,i.G,i.B);return S(i,"A")&&(r.A=i.A),s?ie.CIELab(r,n):be.CIELabA(i,n.decimals)}},we=(e,t)=>({R:B(e.R,t),G:B(e.G,t),B:B(e.B,t),...S(e,"A")?{A:B(e.A,t)}:{}}),Ee=(e,t)=>({H:B(e.H,t),S:B(e.S,t),L:B(e.L,t),...S(e,"A")?{A:B(e.A,t)}:{}}),ve=(e,t)=>({L:B(e.L,t),a:B(e.a,t),b:B(e.b,t)}),ke=(e,t)=>({C:B(e.C,t),M:B(e.M,t),Y:B(e.Y,t),K:B(e.K,t)}),Te=(e,t,s,n)=>n(fe(e,t),s),Se=(e,t,s,n,i)=>{s<1&&(s=5);const r=((e,t,s)=>{const n=s-1,i=(t.R-e.R)/n,r=(t.G-e.G)/n,o=(t.B-e.B)/n,a=re(e.A),c=(re(t.A)-a)/n;return Array(s).fill(null).map(((s,l)=>0===l?e:l===n?t:{R:B(e.R+i*l),G:B(e.G+r*l),B:B(e.B+o*l),A:B(a+c*l)}))})(fe(e),fe(t),s);return r.map((e=>i(e,n)))},Ce=(e,t,s,n)=>({[c.ANALOGOUS]:Ae.buildHarmony(t,ae,s,n),[c.COMPLEMENTARY]:Ae.buildHarmony(t,ce,s,n),[c.SPLIT_COMPLEMENTARY]:Ae.buildHarmony(t,le,s,n),[c.TRIADIC]:Ae.buildHarmony(t,ue,s,n),[c.TETRADIC]:Ae.buildHarmony(t,de,s,n),[c.SQUARE]:Ae.buildHarmony(t,pe,s,n)}[e]);class De{constructor(e,t={}){this._options=M(t,e),this.rgb=fe(e),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...z(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...X(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...K(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=Z(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...V(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=q(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(e={}){return this._options={...this._options,...e},this}setH(e){return this.hsl.H=F(e),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(e){return this.hsl.S=P(e,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(e){return this.hsl.L=P(e,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(e){this.rgb.R=P(e,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(e){return this.rgb.G=P(e,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(e){return this.rgb.B=P(e,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(e){return this.lab.L=P(e,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(e){return this.lab.a=P(e,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(e){return this.lab.b=P(e,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(e){return this.hsl.A=this.rgb.A=P(e,0,1),this}setC(e){return this.cmyk.C=P(e,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(e){return this.cmyk.M=P(e,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(e){return this.cmyk.Y=P(e,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(e){return this.cmyk.K=P(e,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return B(this.hsl.H,this.options.decimals)}get S(){return B(this.hsl.S,this.options.decimals)}get L(){return B(this.hsl.L,this.options.decimals)}get CIEL(){return B(this.lab.L,this.options.decimals)}get CIEa(){return B(this.lab.a,this.options.decimals)}get CIEb(){return B(this.lab.b,this.options.decimals)}get R(){return B(this.rgb.R,this.options.decimals)}get G(){return B(this.rgb.G,this.options.decimals)}get B(){return B(this.rgb.B,this.options.decimals)}get A(){return B(this.hsl.A,this.options.decimals)}get C(){return B(this.cmyk.C,this.options.decimals)}get M(){return B(this.cmyk.M,this.options.decimals)}get Y(){return B(this.cmyk.Y,this.options.decimals)}get K(){return B(this.cmyk.K,this.options.decimals)}get HEXObject(){return be.HEX(this.rgb)}get HEXAObject(){return be.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return ie.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return ie.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return ie.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return ie.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return ie.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return ie.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return ie.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return ie.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return ie.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return ie.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(e){const t=ge(e);return Te(e,t,0,be.HEX)}static toHEX(e){return ie.HEX(De.toHEXObject(e))}static toHEXAObject(e){const t=ge(e);return Te(e,t,0,be.HEXA)}static toHEXA(e){return ie.HEX(De.toHEXAObject(e))}static toRGBObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.RGB)}static toRGB(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.RGB);return ie.RGB(i,n)}static toRGBAObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.RGBA)}static toRGBA(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.RGBA);return ie.RGB(i,n)}static toHSLObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.HSL)}static toHSL(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.HSL);return ie.HSL(i,n)}static toHSLAObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.HSLA)}static toHSLA(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.HSLA);return ie.HSL(i,n)}static toCIELabObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.CIELab)}static toCIELab(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.CIELab);return ie.CIELab(i,n)}static toCIELabAObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.CIELabA)}static toCIELabA(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.CIELabA);return ie.CIELab(i,n)}static toCMYKObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.CMYK)}static toCMYK(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.CMYK);return ie.CMYK(i,n)}static toCMYKAObject(e,t={}){const s=ge(e);return Te(e,s,t.decimals,be.CMYKA)}static toCMYKA(e,t={}){const s=ge(e),n=M(t,e),i=Te(e,s,t.decimals,be.CMYKA);return ie.CMYK(i,n)}static getBlendHEXObject(e,t,s=5){return Se(e,t,s,0,be.HEX)}static getBlendHEX(e,t,s=5){return De.getBlendHEXObject(e,t,s).map((e=>ie.HEX(e)))}static getBlendHEXAObject(e,t,s=5){return Se(e,t,s,0,be.HEXA)}static getBlendHEXA(e,t,s=5){return De.getBlendHEXAObject(e,t,s).map((e=>ie.HEX(e)))}static getBlendRGBObject(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.RGB):Se(e,t,5,s?.decimals,be.RGB)}static getBlendRGB(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.RGB).map((s=>ie.RGB(s,M(n||{},e,t)))):Se(e,t,5,s?.decimals,be.RGB).map((n=>ie.RGB(n,M(s||{},e,t))))}static getBlendRGBAObject(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.RGBA):Se(e,t,5,s?.decimals,be.RGBA)}static getBlendRGBA(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.RGBA).map((s=>ie.RGB(s,M(n||{},e,t)))):Se(e,t,5,s?.decimals,be.RGBA).map((n=>ie.RGB(n,M(s||{},e,t))))}static getBlendHSLObject(e,t,s,n){return Se(e,t,"number"==typeof s?s:5,n?.decimals,be.HSL)}static getBlendHSL(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.HSL).map((s=>ie.HSL(s,M(n||{},e,t)))):Se(e,t,5,s?.decimals,be.HSL).map((n=>ie.HSL(n,M(s||{},e,t))))}static getBlendHSLAObject(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.HSLA):Se(e,t,5,s?.decimals,be.HSLA)}static getBlendHSLA(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.HSLA).map((s=>ie.HSL(s,M(n||{},e,t)))):Se(e,t,5,s?.decimals,be.HSLA).map((n=>ie.HSL(n,M(s||{},e,t))))}static getBlendCIELabObject(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.CIELab):Se(e,t,5,s?.decimals,be.CIELab)}static getBlendCIELab(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.CIELab).map((s=>ie.CIELab(s,M(n||{},e,t)))):Se(e,t,5,s?.decimals,be.CIELab).map((n=>ie.CIELab(n,M(s||{},e,t))))}static getBlendCIELabAObject(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.CIELabA):Se(e,t,5,s?.decimals,be.CIELabA)}static getBlendCIELabA(e,t,s,n){return"number"==typeof s?Se(e,t,s,n?.decimals,be.CIELabA).map((s=>ie.CIELab(s,M(n||{},e,t)))):Se(e,t,5,s?.decimals,be.CIELabA).map((n=>ie.CIELab(n,M(s||{},e,t))))}static getMixHEXObject(e,t=l.ADDITIVE){return ye.HEX(e,t,!1)}static getMixHEX(e,t=l.ADDITIVE){return ye.HEX(e,t,!0)}static getMixHEXAObject(e,t=l.ADDITIVE){return ye.HEXA(e,t,!1)}static getMixHEXA(e,t=l.ADDITIVE){return ye.HEXA(e,t,!0)}static getMixRGBObject(e,t,s){return"string"==typeof t?ye.RGB(e,t,!1,M(s||{},...e)):ye.RGB(e,l.ADDITIVE,!1,M(t||{},...e))}static getMixRGB(e,t,s){return"string"==typeof t?ye.RGB(e,t,!0,M(s||{},...e)):ye.RGB(e,l.ADDITIVE,!0,M(t||{},...e))}static getMixRGBAObject(e,t,s){return"string"==typeof t?ye.RGBA(e,t,!1,M(s||{},...e)):ye.RGBA(e,l.ADDITIVE,!1,M(t||{},...e))}static getMixRGBA(e,t,s){return"string"==typeof t?ye.RGBA(e,t,!0,M(s||{},...e)):ye.RGBA(e,l.ADDITIVE,!0,M(t||{},...e))}static getMixHSLObject(e,t,s){return"string"==typeof t?ye.HSL(e,t,!1,M(s||{},...e)):ye.HSL(e,l.ADDITIVE,!1,M(t||{},...e))}static getMixHSL(e,t,s){return"string"==typeof t?ye.HSL(e,t,!0,M(s||{},...e)):ye.HSL(e,l.ADDITIVE,!0,M(t||{},...e))}static getMixHSLAObject(e,t,s){return"string"==typeof t?ye.HSLA(e,t,!1,M(s||{},...e)):ye.HSLA(e,l.ADDITIVE,!1,M(t||{},...e))}static getMixHSLA(e,t,s){return"string"==typeof t?ye.HSLA(e,t,!0,M(s||{},...e)):ye.HSLA(e,l.ADDITIVE,!0,M(t||{},...e))}static getMixCIELabObject(e,t,s){return"string"==typeof t?ye.CIELab(e,t,!1,M(s||{},...e)):ye.CIELab(e,l.ADDITIVE,!1,M(t||{},...e))}static getMixCIELab(e,t,s){return"string"==typeof t?ye.CIELab(e,t,!0,M(s||{},...e)):ye.CIELab(e,l.ADDITIVE,!0,M(t||{},...e))}static getMixCIELabAObject(e,t,s){return"string"==typeof t?ye.CIELabA(e,t,!1,M(s||{},...e)):ye.CIELabA(e,l.ADDITIVE,!1,M(t||{},...e))}static getMixCIELabA(e,t,s){return"string"==typeof t?ye.CIELabA(e,t,!0,M(s||{},...e)):ye.CIELabA(e,l.ADDITIVE,!0,M(t||{},...e))}static getShades(e,t,s){return"number"==typeof t?_e(e,t,!0,M(s||{},e)):_e(e,5,!0,M(t||{},e))}static getTints(e,t,s){return"number"==typeof t?_e(e,t,!1,M(s||{},e)):_e(e,5,!1,M(t||{},e))}static getHarmony(e,t,s,n){return`${t}`in c?Ce(t,e,N(s)?s:l.ADDITIVE,M(N(s)?n||{}:s||{},e)):N(t)?Ce(c.COMPLEMENTARY,e,t,M(s||{},e)):Ce(c.COMPLEMENTARY,e,l.ADDITIVE,M(t||{},e))}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ie(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach((t=>{var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:()=>e[t]})})),s}var Le,Ge={exports:{}};Le=Ge,((e,t)=>{Le.exports=t()})(self,(()=>(()=>{var e={d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{default:()=>S});var s={};function n(e,t,s,n,i={}){t instanceof HTMLCollection||t instanceof NodeList?t=Array.from(t):Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);for(const r of t)for(const t of s)r[e](t,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}e.r(s),e.d(s,{adjustableInputNumbers:()=>u,createElementFromString:()=>o,createFromTemplate:()=>a,eventPath:()=>c,off:()=>r,on:()=>i,resolveElement:()=>l});const i=n.bind(null,"addEventListener"),r=n.bind(null,"removeEventListener");function o(e){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstElementChild}function a(e){const t=(e,t)=>{const s=e.getAttribute(t);return e.removeAttribute(t),s},s=(e,n={})=>{const i=t(e,":obj"),r=t(e,":ref"),o=i?n[i]={}:n;r&&(n[r]=e);for(const n of Array.from(e.children)){const e=t(n,":arr"),i=s(n,e?{}:o);e&&(o[e]||(o[e]=[])).push(Object.keys(i).length?i:n)}return n};return s(o(e))}function c(e){let t=e.path||e.composedPath&&e.composedPath();if(t)return t;let s=e.target.parentElement;for(t=[e.target,s];s=s.parentElement;)t.push(s);return t.push(document,window),t}function l(e){return e instanceof Element?e:"string"==typeof e?e.split(/>>/g).reduce(((e,t,s,n)=>(e=e.querySelector(t),se)){function s(s){const n=[.001,.01,.1][Number(s.shiftKey||2*s.ctrlKey)]*(s.deltaY<0?1:-1);let i=0,r=e.selectionStart;e.value=e.value.replace(/[\d.]+/g,((e,s)=>s<=r&&s+e.length>=r?(r=s,t(Number(e),n,i)):(i++,e))),e.focus(),e.setSelectionRange(r,r),s.preventDefault(),e.dispatchEvent(new Event("input"))}i(e,"focus",(()=>i(window,"wheel",s,{passive:!1}))),i(e,"blur",(()=>r(window,"wheel",s)))}const{min:d,max:p,floor:g,round:h}=Math;function m(e,t,s){t/=100,s/=100;const n=g(e=e/360*6),i=e-n,r=s*(1-t),o=s*(1-i*t),a=s*(1-(1-i)*t),c=n%6;return[255*[s,o,r,r,a,s][c],255*[a,s,s,o,r,r][c],255*[r,r,a,s,s,o][c]]}function f(e,t,s){const n=(2-(t/=100))*(s/=100)/2;return 0!==n&&(t=1===n?0:n<.5?t*s/(2*n):t*s/(2-2*n)),[e,100*t,100*n]}function b(e,t,s){const n=d(e/=255,t/=255,s/=255),i=p(e,t,s),r=i-n;let o,a;if(0===r)o=a=0;else{a=r/i;const n=((i-e)/6+r/2)/r,c=((i-t)/6+r/2)/r,l=((i-s)/6+r/2)/r;e===i?o=l-c:t===i?o=1/3+n-l:s===i&&(o=2/3+c-n),o<0?o+=1:o>1&&(o-=1)}return[360*o,100*a,100*i]}function _(e,t,s,n){return t/=100,s/=100,[...b(255*(1-d(1,(e/=100)*(1-(n/=100))+n)),255*(1-d(1,t*(1-n)+n)),255*(1-d(1,s*(1-n)+n)))]}function A(e,t,s){t/=100;const n=2*(t*=(s/=100)<.5?s:1-s)/(s+t)*100,i=100*(s+t);return[e,isNaN(n)?0:n,i]}function y(e){return b(...e.match(/.{2}/g).map((e=>parseInt(e,16))))}function w(e=0,t=0,s=0,n=1){const i=(e,t)=>(s=-1)=>t(~s?e.map((e=>Number(e.toFixed(s)))):e),r={h:e,s:t,v:s,a:n,toHSVA(){const e=[r.h,r.s,r.v,r.a];return e.toString=i(e,(e=>`hsva(${e[0]}, ${e[1]}%, ${e[2]}%, ${r.a})`)),e},toHSLA(){const e=[...f(r.h,r.s,r.v),r.a];return e.toString=i(e,(e=>`hsla(${e[0]}, ${e[1]}%, ${e[2]}%, ${r.a})`)),e},toRGBA(){const e=[...m(r.h,r.s,r.v),r.a];return e.toString=i(e,(e=>`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${r.a})`)),e},toCMYK(){const e=((e,t,s)=>{const n=m(e,t,s),i=n[0]/255,r=n[1]/255,o=n[2]/255,a=d(1-i,1-r,1-o);return[100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*(1===a?0:(1-o-a)/(1-a)),100*a]})(r.h,r.s,r.v);return e.toString=i(e,(e=>`cmyk(${e[0]}%, ${e[1]}%, ${e[2]}%, ${e[3]}%)`)),e},toHEXA(){const e=((e,t,s)=>m(e,t,s).map((e=>h(e).toString(16).padStart(2,"0"))))(r.h,r.s,r.v),t=r.a>=1?"":Number((255*r.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return t&&e.push(t),e.toString=()=>`#${e.join("").toUpperCase()}`,e},clone:()=>w(r.h,r.s,r.v,r.a)};return r}const E=e=>Math.max(Math.min(e,1),0);function v(e){const t={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},e),_keyboard(e){const{options:s}=t,{type:n,key:i}=e;if(document.activeElement===s.wrapper){const{lock:s}=t.options,r="ArrowUp"===i,o="ArrowRight"===i,a="ArrowDown"===i,c="ArrowLeft"===i;if("keydown"===n&&(r||o||a||c)){let n=0,i=0;"v"===s?n=r||o?1:-1:"h"===s?n=r||o?-1:1:(i=r?-1:a?1:0,n=c?-1:o?1:0),t.update(E(t.cache.x+.01*n),E(t.cache.y+.01*i)),e.preventDefault()}else i.startsWith("Arrow")&&(t.options.onstop(),e.preventDefault())}},_tapstart(e){i(document,["mouseup","touchend","touchcancel"],t._tapstop),i(document,["mousemove","touchmove"],t._tapmove),e.cancelable&&e.preventDefault(),t._tapmove(e)},_tapmove(e){const{options:s,cache:n}=t,{lock:i,element:r,wrapper:o}=s,a=o.getBoundingClientRect();let c=0,l=0;if(e){const t=e&&e.touches&&e.touches[0];c=e?(t||e).clientX:0,l=e?(t||e).clientY:0,ca.left+a.width&&(c=a.left+a.width),la.top+a.height&&(l=a.top+a.height),c-=a.left,l-=a.top}else n&&(c=n.x*a.width,l=n.y*a.height);"h"!==i&&(r.style.left=`calc(${c/a.width*100}% - ${r.offsetWidth/2}px)`),"v"!==i&&(r.style.top=`calc(${l/a.height*100}% - ${r.offsetHeight/2}px)`),t.cache={x:c/a.width,y:l/a.height};const u=E(c/a.width),d=E(l/a.height);switch(i){case"v":return s.onchange(u);case"h":return s.onchange(d);default:return s.onchange(u,d)}},_tapstop(){t.options.onstop(),r(document,["mouseup","touchend","touchcancel"],t._tapstop),r(document,["mousemove","touchmove"],t._tapmove)},trigger(){t._tapmove()},update(e=0,s=0){const{left:n,top:i,width:r,height:o}=t.options.wrapper.getBoundingClientRect();"h"===t.options.lock&&(s=e),t._tapmove({clientX:n+r*e,clientY:i+o*s})},destroy(){const{options:e,_tapstart:s,_keyboard:n}=t;r(document,["keydown","keyup"],n),r([e.wrapper,e.element],"mousedown",s),r([e.wrapper,e.element],"touchstart",s,{passive:!1})}},{options:s,_tapstart:n,_keyboard:o}=t;return i([s.wrapper,s.element],"mousedown",n),i([s.wrapper,s.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],o),t}function k(e={}){e=Object.assign({onchange:()=>0,className:"",elements:[]},e);const t=i(e.elements,"click",(t=>{e.elements.forEach((s=>s.classList[t.target===s?"add":"remove"](e.className))),e.onchange(t),t.stopPropagation()}));return{destroy:()=>r(...t)}}const T={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0};class S{static utils=s;static version="1.9.0";static I18N_DEFAULTS={"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"};static DEFAULT_OPTIONS={appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"};_initializingActive=!0;_recalc=!0;_nanopop=null;_root=null;_color=w();_lastColor=w();_swatchColors=[];_setupAnimationFrame=null;_eventListener={init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]};constructor(e){this.options=e=Object.assign({...S.DEFAULT_OPTIONS},e);const{swatches:t,components:s,theme:n,sliders:i,lockOpacity:r,padding:o}=e;["nano","monolith"].includes(n)&&!i&&(e.sliders="h"),s.interaction||(s.interaction={});const{preview:a,opacity:c,hue:l,palette:u}=s;s.opacity=!r&&c,s.palette=u||a||c||l,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),t&&t.length&&t.forEach((e=>this.addSwatch(e)));const{button:d,app:p}=this._root;this._nanopop=((e,t,s)=>{const n="object"!=typeof e||e instanceof HTMLElement?{reference:e,popper:t,...s}:e;return{update(e=n){const{reference:t,popper:s}=Object.assign(n,e);if(!s||!t)throw new Error("Popper- or reference-element missing.");return((e,t,s)=>{const{container:n,arrow:i,margin:r,padding:o,position:a,variantFlipOrder:c,positionFlipOrder:l}={container:document.documentElement.getBoundingClientRect(),...T,...s},{left:u,top:d}=t.style;t.style.left="0",t.style.top="0";const p=e.getBoundingClientRect(),g=t.getBoundingClientRect(),h={t:p.top-g.height-r,b:p.bottom+r,r:p.right+r,l:p.left-g.width-r},m={vs:p.left,vm:p.left+p.width/2-g.width/2,ve:p.left+p.width-g.width,hs:p.top,hm:p.bottom-p.height/2-g.height/2,he:p.bottom-g.height},[f,b="middle"]=a.split("-"),_=l[f],A=c[b],{top:y,left:w,bottom:E,right:v}=n;for(const e of _){const s="t"===e||"b"===e;let n=h[e];const[r,a]=s?["top","left"]:["left","top"],[c,l]=s?[g.height,g.width]:[g.width,g.height],[u,d]=s?[E,v]:[v,E],[f,b]=s?[y,w]:[w,y];if(!(nu))for(const u of A){let h=m[(s?"v":"h")+u];if(!(hd)){if(h-=g[a],n-=g[r],t.style[a]=`${h}px`,t.style[r]=`${n}px`,i){const e=s?p.width/2:p.height/2,t=2*enew S(e);_preBuild(){const{options:e}=this;for(const t of["el","container"])e[t]=l(e[t]);this._root=(e=>{const{components:t,useAsButton:s,inline:n,appClass:i,theme:r,lockOpacity:o}=e.options,c=e=>e?"":'style="display:none" hidden',l=t=>e._t(t),u=a(`\n
\n\n ${s?"":''}\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n
\n `),d=u.interaction;return d.options.find((e=>!e.hidden&&!e.classList.add("active"))),d.type=()=>d.options.find((e=>e.classList.contains("active"))),u})(this),e.useAsButton&&(this._root.button=e.el),e.container.appendChild(this._root.root)}_finalBuild(){const e=this.options,t=this._root;if(e.container.removeChild(t.root),e.inline){const s=e.el.parentElement;e.el.nextSibling?s.insertBefore(t.app,e.el.nextSibling):s.appendChild(t.app)}else e.container.appendChild(t.app);e.useAsButton?e.inline&&e.el.remove():e.el.parentNode.replaceChild(t.root,e.el),e.disabled&&this.disable(),e.comparison||(t.button.style.transition="none",e.useAsButton||(t.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const e=this,t=this.options.components,s=(e.options.sliders||"v").repeat(2),[n,i]=s.match(/^[vh]+$/g)?s:[],r=()=>this._color||(this._color=this._lastColor.clone()),o={palette:v({element:e._root.palette.picker,wrapper:e._root.palette.palette,onstop:()=>e._emit("changestop","slider",e),onchange(s,n){if(!t.palette)return;const i=r(),{_root:o,options:a}=e,{lastColor:c,currentColor:l}=o.preview;e._recalc&&(i.s=100*s,i.v=100-100*n,i.v<0&&(i.v=0),e._updateOutput("slider"));const u=i.toRGBA().toString(0);this.element.style.background=u,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||e._lastColor||c.style.setProperty("--pcr-color",u):(o.button.style.setProperty("--pcr-color",u),o.button.classList.remove("clear"));const d=i.toHEXA().toString();for(const{el:t,color:s}of e._swatchColors)t.classList[d===s.toHEXA().toString()?"add":"remove"]("pcr-active");l.style.setProperty("--pcr-color",u)}}),hue:v({lock:"v"===i?"h":"v",element:e._root.hue.picker,wrapper:e._root.hue.slider,onstop:()=>e._emit("changestop","slider",e),onchange(s){if(!t.hue||!t.palette)return;const n=r();e._recalc&&(n.h=360*s),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,o.palette.trigger()}}),opacity:v({lock:"v"===n?"h":"v",element:e._root.opacity.picker,wrapper:e._root.opacity.slider,onstop:()=>e._emit("changestop","slider",e),onchange(s){if(!t.opacity||!t.palette)return;const n=r();e._recalc&&(n.a=Math.round(100*s)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,o.palette.trigger()}}),selectable:k({elements:e._root.interaction.options,className:"active",onchange(t){e._representation=t.target.getAttribute("data-type").toUpperCase(),e._recalc&&e._updateOutput("swatch")}})};this._components=o}_bindEvents(){const{_root:e,options:t}=this,s=[i(e.interaction.clear,"click",(()=>this._clearColor())),i([e.interaction.cancel,e.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(e.interaction.save,"click",(()=>{!this.applyColor()&&!t.showAlways&&this.hide()})),i(e.interaction.result,["keyup","input"],(e=>{this.setColor(e.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),e.stopImmediatePropagation()})),i(e.interaction.result,["focus","blur"],(e=>{this._recalc="blur"===e.type,this._recalc&&this._updateOutput(null)})),i([e.palette.palette,e.palette.picker,e.hue.slider,e.hue.picker,e.opacity.slider,e.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!t.showAlways){const n=t.closeWithKey;s.push(i(e.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(e=>this.isOpen()&&(e.key===n||e.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(t=>{this.isOpen()&&!c(t).some((t=>t===e.app||t===e.button))&&this.hide()}),{capture:!0}))}if(t.adjustableNumbers){const t={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};u(e.interaction.result,((e,s,n)=>{const i=t[this.getColorRepresentation().toLowerCase()];if(i){const t=i[n],r=e+(t>=100?1e3*s:s);return r<=0?0:Number((r{n.isOpen()&&(t.closeOnScroll&&n.hide(),null===e?(e=setTimeout((()=>e=null),100),requestAnimationFrame((function t(){n._rePositioningPicker(),null!==e&&requestAnimationFrame(t)}))):(clearTimeout(e),e=setTimeout((()=>e=null),100)))}),{capture:!0}))}this._eventBindings=s}_rePositioningPicker(){const{options:e}=this;if(!e.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:e.position})){const e=this._root.app,t=e.getBoundingClientRect();e.style.top=(window.innerHeight-t.height)/2+"px",e.style.left=(window.innerWidth-t.width)/2+"px"}}_updateOutput(e){const{_root:t,_color:s,options:n}=this;if(t.interaction.type()){const e=`to${t.interaction.type().getAttribute("data-type")}`;t.interaction.result.value="function"==typeof s[e]?s[e]().toString(n.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",s,e,this)}_clearColor(e=!1){const{_root:t,options:s}=this;s.useAsButton||t.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),t.button.classList.add("clear"),s.showAlways||this.hide(),this._lastColor=null,this._initializingActive||e||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(e){const{values:t,type:s,a:n}=(e=>{e=e.match(/^[a-zA-Z]+$/)?(e=>{if("black"===e.toLowerCase())return"#000";const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,"#000"===t.fillStyle?null:t.fillStyle})(e):e;const t={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},s=e=>e.map((e=>/^(|\d+)\.\d+|\d+$/.test(e)?Number(e):void 0));let n;e:for(const i in t)if(n=t[i].exec(e))switch(i){case"cmyk":{const[,e,t,r,o]=s(n);if(e>100||t>100||r>100||o>100)break e;return{values:_(e,t,r,o),type:i}}case"rgba":{let[,e,,t,,r,,,o]=s(n);if(e="%"===n[2]?e/100*255:e,t="%"===n[4]?t/100*255:t,r="%"===n[6]?r/100*255:r,o="%"===n[9]?o/100:o,e>255||t>255||r>255||o<0||o>1)break e;return{values:[...b(e,t,r),o],a:o,type:i}}case"hexa":{let[,e]=n;4!==e.length&&3!==e.length||(e=e.split("").map((e=>e+e)).join(""));const t=e.substring(0,6);let s=e.substring(6);return s=s?parseInt(s,16)/255:void 0,{values:[...y(t),s],a:s,type:i}}case"hsla":{let[,e,t,r,,o]=s(n);if(o="%"===n[6]?o/100:o,e>360||t>100||r>100||o<0||o>1)break e;return{values:[...A(e,t,r),o],a:o,type:i}}case"hsva":{let[,e,t,r,,o]=s(n);if(o="%"===n[6]?o/100:o,e>360||t>100||r>100||o<0||o>1)break e;return{values:[e,t,r,o],a:o,type:i}}}return{values:null,type:null}})(e),{lockOpacity:i}=this.options,r=void 0!==n&&1!==n;return t&&3===t.length&&(t[3]=void 0),{values:!t||i&&r?null:t,type:s}}_t(e){return this.options.i18n[e]||S.I18N_DEFAULTS[e]}_emit(e,...t){this._eventListener[e].forEach((e=>e(...t,this)))}on(e,t){return this._eventListener[e].push(t),this}off(e,t){const s=this._eventListener[e]||[],n=s.indexOf(t);return~n&&s.splice(n,1),this}addSwatch(e){const{values:t}=this._parseLocalColor(e);if(t){const{_swatchColors:e,_root:s}=this,n=w(...t),r=o(`