diff --git a/.env.development.local.example b/.env.development.local.example deleted file mode 100644 index 04f0ca42..00000000 --- a/.env.development.local.example +++ /dev/null @@ -1 +0,0 @@ -VITE_DEBUG_MODE=true diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 07816050..a1993b7b 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,38 +1,4 @@ module.exports = { - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:svelte/recommended", - "turbo", - "prettier", - ], - - parser: "@typescript-eslint/parser", - - overrides: [ - { - files: ["*.svelte"], - parser: "svelte-eslint-parser", - // Parse the script in `.svelte` as TypeScript by adding the following configuration. - parserOptions: { - parser: "@typescript-eslint/parser", - }, - }, - ], - - plugins: ["@typescript-eslint", "prettier"], - - rules: { - // Note: you must disable the base rule as it can report incorrect errors - semi: "off", - quotes: "off", - "no-undef": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-explicit-any": "off", - "turbo/no-undeclared-env-vars": "off", - "prettier/prettier": "error", - }, + root: true, + extends: ["./node_modules/@terwer/eslint-config-custom/typescript/index.cjs"], } diff --git a/.prettierrc.cjs b/.prettierrc.cjs index e75550a8..eec8622f 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -24,8 +24,7 @@ */ module.exports = { - semi: false, - singleQuote: false, - printWidth: 120, - plugins: ["prettier-plugin-svelte"] + semi: false, + singleQuote: false, + printWidth: 120 } diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index ebe50731..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,603 +0,0 @@ -# Changelog - -## [0.8.0](https://github.com/terwer/src-sy-post-publisher/compare/v0.7.2...v0.8.0) (2023-03-25) -### Features -* github平台(hugo、hexo、vitepress等)支持笔记间的内部链接替换 ([a976a4c](https://github.com/terwer/src-sy-post-publisher/commit/a976a4c7b8506eecae3e8d1f8c754a1bc2745682)) -* 博客园、wordpress、typecho平台支持笔记间的内部链接替换 ([3294b4a](https://github.com/terwer/src-sy-post-publisher/commit/3294b4aa394ac9c47e294ae26901a1e786012489)) -* 发布至语雀支持笔记间的内部链接替换 ([2cc4cc1](https://github.com/terwer/src-sy-post-publisher/commit/2cc4cc121e84c16c1aafc96de92e53cbea3aac8b)) -### Bug Fixes -* [#434](https://github.com/terwer/src-sy-post-publisher/issues/434) 文章没有图片时候图床错误文章发布失败 ([53b5016](https://github.com/terwer/src-sy-post-publisher/commit/53b5016d40580099cb8d943c0e8be98dafca1d46)) -* fix siyuanhook ([4ab3d55](https://github.com/terwer/src-sy-post-publisher/commit/4ab3d551a432ecf317b8f57920ce41ab2110927b)) -* 修复 picgo 设置中的时间戳重命名关闭后会自动打开的问题 ([e673f58](https://github.com/terwer/src-sy-post-publisher/commit/e673f5879167b6eb889b688353c1d1e77611f6f8)) -* 修复普通挂件版使用方式wordpress和博客园发布文章报错问题 ([d6a21e1](https://github.com/terwer/src-sy-post-publisher/commit/d6a21e1ea1fced6f6f1128705e09214da7f01dc8)) -* 由于electron主窗口机制问题,图片上传仅支持新窗口 ([20c9a85](https://github.com/terwer/src-sy-post-publisher/commit/20c9a851afb26ebdcf32c62b3b561204878990bd)) -### Miscellaneous -* [#420](https://github.com/terwer/src-sy-post-publisher/issues/420) ankisiyuan.bin 默认不提供,手动下载,减小打包体积 ([9598fb1](https://github.com/terwer/src-sy-post-publisher/commit/9598fb1a3b4458aee9fc2525c232972b848cd4ad)) -* 主窗口移除picgo支持 ([18f7d61](https://github.com/terwer/src-sy-post-publisher/commit/18f7d618f3dfef1f0654caf3c4decd62120f95d9)) -* 修复图片有备注时无法上传问题 ([054eddd](https://github.com/terwer/src-sy-post-publisher/commit/054eddda8cf7198e70930e897de7b4a3bcfb8045)) -* 移除不必要的日志打印 ([cb68777](https://github.com/terwer/src-sy-post-publisher/commit/cb6877728262223a42c3a015352454c63e1abb1e)) -## [0.7.2](https://github.com/terwer/src-sy-post-publisher/compare/v0.7.1...v0.7.2) (2023-03-04) -* fix eslint ([31a2d06](https://github.com/terwer/src-sy-post-publisher/commit/31a2d06b2c15668200d8da12600a025bf260672c)) -## [0.7.1](https://github.com/terwer/src-sy-post-publisher/compare/v0.7.0...v0.7.1) (2023-03-03) -* [#416](https://github.com/terwer/src-sy-post-publisher/issues/416) 修复 PicGO 配置文件迁移路径问题 ([3e6c9bc](https://github.com/terwer/src-sy-post-publisher/commit/3e6c9bcbd64b776b24e223daf9b73339a43410a1)) -* **deps:** bump browser-fs-access from 0.32.1 to 0.33.0 ([7af5c5c](https://github.com/terwer/src-sy-post-publisher/commit/7af5c5cb1ded0c3e6405b95acf87a5dc90acf6a1)) -* fix file fomatter ([e34ab70](https://github.com/terwer/src-sy-post-publisher/commit/e34ab70481ae0b5a201610043d05c3c19678967e)) -* 修复 picgo 配置文件迁移路径问题 ([6f7e90c](https://github.com/terwer/src-sy-post-publisher/commit/6f7e90cea622f6693a195d34e7e43db904b9972a)) -* **deps-dev:** bump @vitest/coverage-c8 from 0.28.5 to 0.29.1 ([edbef57](https://github.com/terwer/src-sy-post-publisher/commit/edbef5715c41aa762fdb9649d7b0c86b84da63bf)) -* remove unused log ([442c052](https://github.com/terwer/src-sy-post-publisher/commit/442c05204402b5975b8192e86973a74712848431)) -* update coverage-c8 ([60e81aa](https://github.com/terwer/src-sy-post-publisher/commit/60e81aaec490e3b226bf65fb533737cc80da7ca1)) -## [0.7.0](https://github.com/terwer/src-sy-post-publisher/compare/v0.6.8...v0.7.0) (2023-02-27) -* [#209](https://github.com/terwer/src-sy-post-publisher/issues/209) 发布页面新增按钮支持绑定文章 ([239927b](https://github.com/terwer/src-sy-post-publisher/commit/239927b9593441ce6e646301d240c357915d1a9e)) -* [#276](https://github.com/terwer/src-sy-post-publisher/issues/276) 新窗口打开时操作按钮fixed不随页面滑动 ([1a094b2](https://github.com/terwer/src-sy-post-publisher/commit/1a094b20aabdaa0643e9638ac860a90b81f4731d)) -* [#319](https://github.com/terwer/src-sy-post-publisher/issues/319) PicGO图形化配置界面-默认图床为github ([51a2353](https://github.com/terwer/src-sy-post-publisher/commit/51a2353de7e1d78708823cce527fdb045ecdd32b)) -* [#341](https://github.com/terwer/src-sy-post-publisher/issues/341) 整合所有配置,提供单一统一的配置入口页面-整合思源地址配置到底部统一的偏好设置 ([7c8b3f3](https://github.com/terwer/src-sy-post-publisher/commit/7c8b3f301c7deab67d1d8fa11874e35141398329)) -* [#374](https://github.com/terwer/src-sy-post-publisher/issues/374) 使用python重构项目构建脚本-重构浏览器插件打包脚本 ([0c2da6d](https://github.com/terwer/src-sy-post-publisher/commit/0c2da6de922590d012b3a150db56ca335e81de5e)) -* [#375](https://github.com/terwer/src-sy-post-publisher/issues/375) 适配挂件背景 ([f66ccbf](https://github.com/terwer/src-sy-post-publisher/commit/f66ccbf555a1d780089419efe3ad25e077b5a3c2)) -* [#388](https://github.com/terwer/src-sy-post-publisher/issues/388) 支持自定义挂件背景色用来适配不同的主题 ([c1b1a7a](https://github.com/terwer/src-sy-post-publisher/commit/c1b1a7ac7ddb91e67cd25973ef9781fda7c40504)) -* 统一导入导出配置 ([99ca865](https://github.com/terwer/src-sy-post-publisher/commit/99ca865cebed6d267efbc0035e322f4045d1fb94)) -* 重构构建脚本 ([9f8376e](https://github.com/terwer/src-sy-post-publisher/commit/9f8376eebef0977ca792de87f09ef90664000989)) -* 重构构建脚本-解决新版本脚本乱码问题 ([a23ede1](https://github.com/terwer/src-sy-post-publisher/commit/a23ede131a15e3dd23b577c25c555c4332bc710f)) -* 重构构建脚本-重构serve命令脚本 ([b60aeb4](https://github.com/terwer/src-sy-post-publisher/commit/b60aeb4850f4c235235332ed77feff537f5b4b0b)) -* 重构构建脚本-重构新版本脚本 ([f77a706](https://github.com/terwer/src-sy-post-publisher/commit/f77a7069e604242bab5c70d56f250317fb8720eb)) -* [#376](https://github.com/terwer/src-sy-post-publisher/issues/376) typecho发布文章未成功解析文章id ([f5975f5](https://github.com/terwer/src-sy-post-publisher/commit/f5975f514ea62ab2464067be550d10f6c3c480fc)) -* [#385](https://github.com/terwer/src-sy-post-publisher/issues/385) 路径问题可能导致挂载过程思源崩溃页面空白问题 ([0f18eda](https://github.com/terwer/src-sy-post-publisher/commit/0f18eda86420727e79223c57756aade6e650b43f)) -* [#394](https://github.com/terwer/src-sy-post-publisher/issues/394) 思源内部Anki同步报错 ([d2e6492](https://github.com/terwer/src-sy-post-publisher/commit/d2e6492a0a917576b6551c21b35a8c5d6b55f112)) -* [#400](https://github.com/terwer/src-sy-post-publisher/issues/400) 浏览器插件不能使用http,只能用https-优化请求代理错误处理 ([1dd35c2](https://github.com/terwer/src-sy-post-publisher/commit/1dd35c2be39822312605eef94bc71e0bbac8de85)) -* ci complains of outdated lockfile but says the lockfile is up to date, see https://github.com/pnpm/pnpm/issues/5144 ([0b92761](https://github.com/terwer/src-sy-post-publisher/commit/0b92761afc64236e842969e4522ac79e6423ee7f)) -* **deps:** bump actions/checkout from 2 to 3 ([5cee6c7](https://github.com/terwer/src-sy-post-publisher/commit/5cee6c7eaf9227c6bfe9ef042b0e1214b59a8471)) -* **deps:** bump browser-fs-access from 0.31.2 to 0.32.1 ([5ccf58f](https://github.com/terwer/src-sy-post-publisher/commit/5ccf58fe8e093697ed5d75ec861e28da48510c7e)) -* **deps-dev:** bump eslint-config-standard-with-typescript ([a8866cf](https://github.com/terwer/src-sy-post-publisher/commit/a8866cf6545b7d8e05a0d541e38f942c157cf65f)) -* **deps-dev:** bump prettier from 2.8.3 to 2.8.4 ([fd3ec1a](https://github.com/terwer/src-sy-post-publisher/commit/fd3ec1a054d7225c8d3c5bcfc96db353c8511e91)) -* **deps-dev:** bump unplugin-vue-components from 0.22.12 to 0.24.0 ([a60a31f](https://github.com/terwer/src-sy-post-publisher/commit/a60a31f2fa25051d8de78da38a7440492dab02a8)) -* **deps-dev:** bump vitest from 0.28.5 to 0.29.1 ([11e0869](https://github.com/terwer/src-sy-post-publisher/commit/11e0869996da87350091ac11be67293811a3ddb5)) -* release 0.6.8 ([5015fa2](https://github.com/terwer/src-sy-post-publisher/commit/5015fa2d54cddffd065cd0cde83c6ad08114cd3e)) -* update browser-fs-access ([000610d](https://github.com/terwer/src-sy-post-publisher/commit/000610db65afe77717be07c1b1fef19965dda32f)) -* update plugin ([51fd486](https://github.com/terwer/src-sy-post-publisher/commit/51fd4862003b65620e2cd6e5e487f206adcdc1e8)) -* upgrade prettier ([64d5852](https://github.com/terwer/src-sy-post-publisher/commit/64d585271ee368429b8a6d7e98e9bf06c7442e1d)) -* y优化界面展示 ([3a3d100](https://github.com/terwer/src-sy-post-publisher/commit/3a3d100ad6c24000a713e3e488a5b2dd194a9508)) -* 优化日志输出 ([ff5a997](https://github.com/terwer/src-sy-post-publisher/commit/ff5a997c1cba4780c99f119a225eedad659f3da8)) -* 修复页面展示问题 ([92d75d6](https://github.com/terwer/src-sy-post-publisher/commit/92d75d6e5b2a30bb8aa211b3d52c9993fc958349)) -* 新增说明 ([9793a1a](https://github.com/terwer/src-sy-post-publisher/commit/9793a1aaf817f6cec54d4f0517d0f2370d48b08a)) -* 更新eslint-config-standard-with-typescript ([8f08863](https://github.com/terwer/src-sy-post-publisher/commit/8f08863dfb33c6481aca89b32ea53df452c2eaa0)) -* 添加灰度测试提示 ([202205a](https://github.com/terwer/src-sy-post-publisher/commit/202205aba4c30ef6405a61d321d5093cea3cae2e)) -## [0.6.8](https://github.com/terwer/src-sy-post-publisher/compare/v0.6.7...v0.6.8) (2023-01-30) -* [#326](https://github.com/terwer/src-sy-post-publisher/issues/326) 思源配置读取出错 ([b3b8ddd](https://github.com/terwer/src-sy-post-publisher/commit/b3b8ddd5103ec77d9c175f92bcf2a5f3e1e0641e)) -* [#338](https://github.com/terwer/src-sy-post-publisher/issues/338) 联动Sofill=主题,提供统一的hook入口,除了js片段之外,新增挂件触发插槽显示 ([c55437e](https://github.com/terwer/src-sy-post-publisher/commit/c55437ef1686aec8c841538c8606869017c1fe0c)) -* [#340](https://github.com/terwer/src-sy-post-publisher/issues/340) README精简 ([38aa0ee](https://github.com/terwer/src-sy-post-publisher/commit/38aa0ee5c7471c7ac339471d91ec25a88d79003f)) -* [#342](https://github.com/terwer/src-sy-post-publisher/issues/342) 适配2.6.3+的localstorage改动,重构配置数据存储方案-多空间配置适配 ([5c051d9](https://github.com/terwer/src-sy-post-publisher/commit/5c051d9b1895c5fc692867997213d2c79192ca68)) -* metaweblog平台增加友好提示 ([9699356](https://github.com/terwer/src-sy-post-publisher/commit/9699356aaa4ca8ec4c6ecbc4942e9d40b22d0487)) -* metaweblog平台支持图床 ([6b1c95d](https://github.com/terwer/src-sy-post-publisher/commit/6b1c95d7e70eaff9013aa60e02ff5f5ab368b305)) -* 优化设备判断 ([ddfb467](https://github.com/terwer/src-sy-post-publisher/commit/ddfb467791c8098d27b4332c396c13e21a3efd2e)) -* 优化设备判断-chrome跳转链接修复 ([305f046](https://github.com/terwer/src-sy-post-publisher/commit/305f0463244ec515732b0f50a9769c947d2d22cb)) -* 优化设备判断-优化url处理 ([aae7ee0](https://github.com/terwer/src-sy-post-publisher/commit/aae7ee0ee3f1d1bcd759d80ceb9cf55928c65db3)) -* 优化设备判断-优化链接来源判断 ([9d238ce](https://github.com/terwer/src-sy-post-publisher/commit/9d238ceebed421a1f14393b87b554d74c6f60ca7)) -* 优化设备判断-修复chrome分享链接问题 ([f6d693b](https://github.com/terwer/src-sy-post-publisher/commit/f6d693b6ba81016b97c39aeb043ad348458f3c66)) -* 优化设备判断-修复链接跳转 ([c0d37b5](https://github.com/terwer/src-sy-post-publisher/commit/c0d37b5f2276a9c3ed01bb6e19f5d34bc9fab799)) -* 修复配置保存之后刷新页面错误的问题 ([6a69cc9](https://github.com/terwer/src-sy-post-publisher/commit/6a69cc99cf22fe8faba6a46c722ed9b71a0a82e3)) -* 切换跨域代理 ([79f8882](https://github.com/terwer/src-sy-post-publisher/commit/79f8882872ab8f5feda4729351d79ffbee541e5d)) -* 局域网文章分享给出提示,因为可能存在伺服未打开的情况 ([9afa0e6](https://github.com/terwer/src-sy-post-publisher/commit/9afa0e68f2d0e4e8521c4b0590cf95e3e093284d)) -* 提前simple-xmlrpc为新项目 ([6b099eb](https://github.com/terwer/src-sy-post-publisher/commit/6b099ebd4d34278a663105f0b19ebd5ecd99ce92)) -* **deps-dev:** bump @esbuild-plugins/node-modules-polyfill ([ba8eab9](https://github.com/terwer/src-sy-post-publisher/commit/ba8eab95254853e09a19fb744f5ff74e5b755dd4)) -* **deps-dev:** bump @vitest/coverage-c8 from 0.27.3 to 0.28.2 ([1125eaf](https://github.com/terwer/src-sy-post-publisher/commit/1125eafe82f992c5554d06f4651bc343166332e7)) -* **deps-dev:** bump prettier from 2.8.2 to 2.8.3 ([e1ed42c](https://github.com/terwer/src-sy-post-publisher/commit/e1ed42c234488ebcd7de0c535d2a31050a71d64c)) -* **deps-dev:** bump vitest from 0.27.3 to 0.28.2 ([c12654d](https://github.com/terwer/src-sy-post-publisher/commit/c12654de6d1fa7e5dc2ba58b651a47f3a4a70221)) -* fix build error ([6a0899a](https://github.com/terwer/src-sy-post-publisher/commit/6a0899aa9aa8457dcca111afa5aef76e8ce2f03b)) -* fix imports ([862c67f](https://github.com/terwer/src-sy-post-publisher/commit/862c67ff277467f7455378c07232f7ee20e9b851)) -* pretty code ([071b6c0](https://github.com/terwer/src-sy-post-publisher/commit/071b6c0996c55256e7a6ed35adc22de374c12c23)) -* remove pnpm-lock.yaml ([c76dc14](https://github.com/terwer/src-sy-post-publisher/commit/c76dc1490aa91e755c29edc919bbd2e38f8add47)) -* start 0.6.8 ([ed4bd82](https://github.com/terwer/src-sy-post-publisher/commit/ed4bd821c0ee36ffce5918ffc7b108e040928037)) -* start 0.7.0 ([105ba99](https://github.com/terwer/src-sy-post-publisher/commit/105ba99a094a30059f7160eec99728144d67387f)) -* update @types/node ([58bb4cd](https://github.com/terwer/src-sy-post-publisher/commit/58bb4cd16f07f059a66b4265f2b328c27df5e325)) -* update node-globals-polyfill ([85b09af](https://github.com/terwer/src-sy-post-publisher/commit/85b09af08c179988e7645e837d9a35c1c132a237)) -* 先发个小版本0.6.2,解决核心bug ([cdb7a3d](https://github.com/terwer/src-sy-post-publisher/commit/cdb7a3d3b00bc50c4614a3c7dc8b521b671f11eb)) -* 准备开发 0.7.0 ([412a08e](https://github.com/terwer/src-sy-post-publisher/commit/412a08ee51d160a0a79a9082fd94736bd01a55b2)) -## [0.6.1](https://github.com/terwer/src-sy-post-publisher/compare/v0.6.0...v0.6.1) (2023-01-10) -* [#235](https://github.com/terwer/src-sy-post-publisher/issues/235) 支持复制分享链接,支持预览页面使用系统默认浏览器打开 ([a19b367](https://github.com/terwer/src-sy-post-publisher/commit/a19b36748434c0678dd0fd429a8dcdbe5f914e06)) -* [#264](https://github.com/terwer/src-sy-post-publisher/issues/264) 虚拟链接转换为真实链接 ([c633334](https://github.com/terwer/src-sy-post-publisher/commit/c63333433f67e607655341b7ebe1d9a13613d018)) -* [#304](https://github.com/terwer/src-sy-post-publisher/issues/304) 文章图片有备注的时候解析错误 ([4612d01](https://github.com/terwer/src-sy-post-publisher/commit/4612d01d2a9d69cd7b7824e6d17c1cbc6bcf2b81)) -* [#309](https://github.com/terwer/src-sy-post-publisher/issues/309) 深度适配Typecho-移除头部错误信息 ([975ccfd](https://github.com/terwer/src-sy-post-publisher/commit/975ccfd7e90c9bdf141f879fc97b411acd6918cf)) -* [#311](https://github.com/terwer/src-sy-post-publisher/issues/311) Github系列平台支持单篇文章重新设置formatter ([72569a7](https://github.com/terwer/src-sy-post-publisher/commit/72569a7553849bd89799c29cff8cb8f0fdd5cf59)) -* [#314](https://github.com/terwer/src-sy-post-publisher/issues/314) HUGO平台支持修改菜单标题和权重 ([2fd2274](https://github.com/terwer/src-sy-post-publisher/commit/2fd22740be2502952c7c263ff167fb5724c0f3c7)) -* [#315](https://github.com/terwer/src-sy-post-publisher/issues/315) Github单独生成所有属性需要刷新页面 ([9c6eb87](https://github.com/terwer/src-sy-post-publisher/commit/9c6eb87f5e7b4ae8c9560d9dbf0b10fc846657c6)) -* github平台支持上传图片到图床 ([da17e2b](https://github.com/terwer/src-sy-post-publisher/commit/da17e2baa22794e78a358172bf50d3569693861d)) -* github平台支持上传图片到图床-适配成功 ([da5e16d](https://github.com/terwer/src-sy-post-publisher/commit/da5e16def97e3804cbe436ed61aa4406c0a11ff6)) -* metaweblog平台适配新的xmlrpc解析库 ([aa6dc4f](https://github.com/terwer/src-sy-post-publisher/commit/aa6dc4f1dc7ffa9000f0bd160576b63bbe18213c)) -* metaweblog的chrome插件暂时走代理 ([3c47f8a](https://github.com/terwer/src-sy-post-publisher/commit/3c47f8a5305e6e23c0a7351411afc292d54ae98c)) -* picgo配置文件优化 ([6e27ccd](https://github.com/terwer/src-sy-post-publisher/commit/6e27ccda5c0b36285ef98c3633efe05b92b98c0e)) -* 下载图片到本地其实不太需要,搁置 ([17c94ac](https://github.com/terwer/src-sy-post-publisher/commit/17c94ace138a7b7b40dbda306a6244a84ec0246d)) -* 代码块新增markdown支持 ([350d123](https://github.com/terwer/src-sy-post-publisher/commit/350d12315e8751481cc4480a586cd11e6331cf50)) -* 代码高亮新增php语言 ([49cb6d8](https://github.com/terwer/src-sy-post-publisher/commit/49cb6d8a26db1596f17e88cf869948fdec9f1107)) -* 优化blockquote样式 ([97e18d5](https://github.com/terwer/src-sy-post-publisher/commit/97e18d5c9c68883f7f8ccfee271e62a9fbf7b1d5)) -* 优化picgo图片列表展示 ([832f11d](https://github.com/terwer/src-sy-post-publisher/commit/832f11d7b47d1d334ee0f865fbc07fe1cd902ded)) -* 优化picgo图片预览 ([6e10b31](https://github.com/terwer/src-sy-post-publisher/commit/6e10b31ded1f11629d7ed49033c0e90232a3d0ee)) -* 优化picgo路径读取 ([b897cec](https://github.com/terwer/src-sy-post-publisher/commit/b897ceccd2d98cc1f490f00e201be38784350730)) -* 优化体验,非插槽不显示按钮 ([b340bd2](https://github.com/terwer/src-sy-post-publisher/commit/b340bd267ed09e511a0539a6b8c41530b3cabe6b)) -* 优化按钮,新增图床配置按钮 ([25b0480](https://github.com/terwer/src-sy-post-publisher/commit/25b0480af0534554dbee36099bc0ba5063d0f690)) -* 优化按钮图标 ([5b71ccc](https://github.com/terwer/src-sy-post-publisher/commit/5b71ccc955a7dd4ef740d940185410d76c4fb930)) -* 优化操作图标 ([0565da4](https://github.com/terwer/src-sy-post-publisher/commit/0565da4dbf25b7152f596d93c6626e554cf70d06)) -* 优化本地图片完整链接展示错误问题 ([1541a00](https://github.com/terwer/src-sy-post-publisher/commit/1541a0020b741333be92a62274f3a8d6fc9130dd)) -* 优化详情页操作按钮 ([6db3250](https://github.com/terwer/src-sy-post-publisher/commit/6db3250b6f5a584b0423806c0dc93cb7c106f2e8)) -* 修复docsy不显示文档问题 ([6e7f76c](https://github.com/terwer/src-sy-post-publisher/commit/6e7f76cf9ef3564a092b10ae553a9388af16e376)) -* 修复github平台发布状态bug ([45b9264](https://github.com/terwer/src-sy-post-publisher/commit/45b92640b2189d3aa01c22ccb9d6c335222c1f22)) -* 修复md5依赖库 ([11eeaf3](https://github.com/terwer/src-sy-post-publisher/commit/11eeaf334ed010b02fd5e3a89cf89028f477feeb)) -* 修复平台判断问题 ([2e105b0](https://github.com/terwer/src-sy-post-publisher/commit/2e105b02cf18b930f86070daedc4b143d966f2a7)) -* 修复当前页面未正确显示问题 ([397f2ee](https://github.com/terwer/src-sy-post-publisher/commit/397f2ee3551f09a984fc83e9726afe38ff089337)) -* 修复思源笔记2.6.3版本之后弹出窗口无法关闭的问题 ([985258f](https://github.com/terwer/src-sy-post-publisher/commit/985258f682f7ec8a9497d178eae8c00b5b380f05)) -* 修复标签样式错乱问题 ([f489996](https://github.com/terwer/src-sy-post-publisher/commit/f48999606806dc3e2bb5bd3bce2b154fd2b622c2)) -* 修复通用api请求错误 ([45cea7e](https://github.com/terwer/src-sy-post-publisher/commit/45cea7e14025d27b8d43d3605f083feb921a3a29)) -* 修复错误信息返回 ([b26b76c](https://github.com/terwer/src-sy-post-publisher/commit/b26b76c9b857dd49ca875c9ba9e98363cea89297)) -* 修改英文默认字体为time new man,此字体展示公式更美观 ([42e4c1d](https://github.com/terwer/src-sy-post-publisher/commit/42e4c1d5619181ec10af94c195bb18f43a9c7f77)) -* 图床列表支持单个图片强制上传覆盖 ([96ee6ac](https://github.com/terwer/src-sy-post-publisher/commit/96ee6acfe411c5e7ab19f0b860e317c2f0b2a371)) -* 图床支持重新上传图片 ([9b27cf0](https://github.com/terwer/src-sy-post-publisher/commit/9b27cf0e07c68546df3faf5936eb8e11f351fc1a)) -* 图床适配公共平台 ([849d1d1](https://github.com/terwer/src-sy-post-publisher/commit/849d1d135f41f7c8ff4649ec6d7e051aa7391f87)) -* 处理数据加载失败的情况 ([aa6d2a3](https://github.com/terwer/src-sy-post-publisher/commit/aa6d2a3c1de3a84f84d2a2c6982637a2219ff17d)) -* 导出数据格式改为sy-p-v-[version]-json ([c42c2b4](https://github.com/terwer/src-sy-post-publisher/commit/c42c2b47599eb05446145fe4cee14f28fa2b9feb)) -* 封装文章图片上传到图床的公共方法 ([9760285](https://github.com/terwer/src-sy-post-publisher/commit/9760285228f40210cf90ab570097732551bb486b)) -* 废弃发布时候的双链替换 ([be64013](https://github.com/terwer/src-sy-post-publisher/commit/be64013dfddb5418e0f0aeede7b3bae18b74a34a)) -* 忽略不是本地图片的链接 ([6ece79f](https://github.com/terwer/src-sy-post-publisher/commit/6ece79fcf5500a38bdf4c105c75eb1f93c1085b9)) -* 提供更友好的picgo错误提示 ([dc779ed](https://github.com/terwer/src-sy-post-publisher/commit/dc779ed2965f110ca892496deb3d11179cdd165e)) -* 文章列表加入loading提升用户体验 ([c727600](https://github.com/terwer/src-sy-post-publisher/commit/c72760005c590fd3a6a38e067c840fedaafe3d14)) -* 新增图床全局开关 ([e410615](https://github.com/terwer/src-sy-post-publisher/commit/e4106153d73f489f6b16ef2a50eb11b2720db53d)) -* 新增成功提示 ([c102f3d](https://github.com/terwer/src-sy-post-publisher/commit/c102f3d90f7add478972362488fdb66cf357a57c)) -* 新增链接解析器 ([861f029](https://github.com/terwer/src-sy-post-publisher/commit/861f029a5981ea1076109e56f4c1efafb00e8d5b)) -* 本地资源单个文件上传到图床 ([c031533](https://github.com/terwer/src-sy-post-publisher/commit/c031533f4b447a5a381ed9814f19f56005502716)) -* 极致简化简洁模式下的github平台发布操作 ([948a5d8](https://github.com/terwer/src-sy-post-publisher/commit/948a5d8a6a41a803611a61fba2dff689b641e30a)) -* 极致简化简洁模式下的其他平台发布操作 ([23564de](https://github.com/terwer/src-sy-post-publisher/commit/23564deeb9846268a1b3ad4f605cb47dc8824c57)) -* 浏览器插件设置项增加提示 ([56786d3](https://github.com/terwer/src-sy-post-publisher/commit/56786d36282fb8268850568ea50a2515ea7591cf)) -* 统一代理地址获取 ([8b8f466](https://github.com/terwer/src-sy-post-publisher/commit/8b8f466fa72ef3fc18a9658ed41851a8a5bc75ee)) -* 美化picgo上传按钮 ([6a176ce](https://github.com/terwer/src-sy-post-publisher/commit/6a176cee54a31963b59effddef2c1c65c2ca50bc)) -* 计划支持docsy ([9ca06f8](https://github.com/terwer/src-sy-post-publisher/commit/9ca06f801f71b6c651c239d17f290e5e53548efc)) -* 通用平台新增更加友好的提示 ([5d59fdb](https://github.com/terwer/src-sy-post-publisher/commit/5d59fdbd186a5acde55ca2bd263ca1e7c2dfeb07)) -* 隐藏浏览器放插件由于限制而无法实现的功能 ([c7172ee](https://github.com/terwer/src-sy-post-publisher/commit/c7172ee35ed59f1a0eaba96fd774adc4d3b3651e)) -* [#310](https://github.com/terwer/src-sy-post-publisher/issues/310) 更换xmlrpc解析库-通用同一套请求逻辑 ([d49f535](https://github.com/terwer/src-sy-post-publisher/commit/d49f5353ffc33b041da69daa52385e99f6981ce4)) -* **deps-dev:** bump @vitest/coverage-c8 from 0.26.3 to 0.27.0 ([58d15e6](https://github.com/terwer/src-sy-post-publisher/commit/58d15e60cc15671ac74bae9fcc37b9100e4ddd87)) -* **deps-dev:** bump prettier from 2.8.1 to 2.8.2 ([b2e83de](https://github.com/terwer/src-sy-post-publisher/commit/b2e83de5110532172092515a3983e29bcd9664d1)) -* **deps-dev:** bump vitest from 0.26.3 to 0.27.0 ([276be85](https://github.com/terwer/src-sy-post-publisher/commit/276be85b5c20544caf2e86c63a99e9d80cd8e18d)) -* release 0.6.0 ([226e963](https://github.com/terwer/src-sy-post-publisher/commit/226e963751e0f3cad05d524b54a34ed72066fd9a)) -* 修复注释被忽略问题 ([d66a151](https://github.com/terwer/src-sy-post-publisher/commit/d66a151a6e7021fa4b2b755853583a6d4f80a816)) -* 升级eslint ([49e224b](https://github.com/terwer/src-sy-post-publisher/commit/49e224b012848e6498ae8da229558ff6785d15a4)) -* 升级picgo-core ([682f42c](https://github.com/terwer/src-sy-post-publisher/commit/682f42c86df7f828a248d0fe3387fcda51a8d795)) -* 升级依赖 ([a25f672](https://github.com/terwer/src-sy-post-publisher/commit/a25f672771cdfe84af52906090268259b2160b38)) -* 对picgo组件进行组件化重构 ([713a9e8](https://github.com/terwer/src-sy-post-publisher/commit/713a9e874cbaa2ae4ab4bfe996ee267dd940e5bb)) -* 提供picogo配置在线文档 ([f514fc0](https://github.com/terwer/src-sy-post-publisher/commit/f514fc0f019319385daf76dd760976810baff58e)) -* 文章发布时图床批量上传的错误由发布逻辑自己控制,公共接口只提供返回消息 ([5ae587e](https://github.com/terwer/src-sy-post-publisher/commit/5ae587e2154bb1eff1e45886115a12a3af0322f6)) -* 更新文档链接 ([1df39eb](https://github.com/terwer/src-sy-post-publisher/commit/1df39eb66d7b443aa48c28ea4b56a238dfaafc8c)) -## [0.6.0](https://github.com/terwer/src-sy-post-publisher/compare/v0.5.1...v0.6.0) (2022-12-29) -* [#132](https://github.com/terwer/src-sy-post-publisher/issues/132) 集成PicGO以及图床-非electron环境支持剪贴板上传 ([b6dea35](https://github.com/terwer/src-sy-post-publisher/commit/b6dea359f6d4e4dd0ecf04205667fed4a484092f)) -* [#285](https://github.com/terwer/src-sy-post-publisher/issues/285) 支持生成ankilink牌组标记-调用shell的公共方法 ([51f6a68](https://github.com/terwer/src-sy-post-publisher/commit/51f6a6807246946383d6a7fbc44236c452ad122f)) -* 集成picgo以及图床-pico上传 ([8d26ff6](https://github.com/terwer/src-sy-post-publisher/commit/8d26ff649f6a60092b52529c9a74d3710dba0573)) -* 集成picgo以及图床-pico依赖库 ([6f57baa](https://github.com/terwer/src-sy-post-publisher/commit/6f57baa70c2715fe85741feff9a293a3e824c652)) -* 集成picgo以及图床-pico图床可用 ([4800d48](https://github.com/terwer/src-sy-post-publisher/commit/4800d480c378d926bf4bdd5158c7d05535e39cbc)) -* 集成picgo以及图床-修复图标 ([a764286](https://github.com/terwer/src-sy-post-publisher/commit/a76428650735721a88bc7e3b21ca18d971557000)) -* 集成picgo以及图床-图片路径复制 ([503e3ad](https://github.com/terwer/src-sy-post-publisher/commit/503e3ad963bda87f1b5db9f377c96089477a0e31)) -* 集成picgo以及图床-展示文章中的图片 ([f5341a1](https://github.com/terwer/src-sy-post-publisher/commit/f5341a12b3b15a327af1dc1bf99c777875c2cfc6)) -* 集成picgo以及图床-提取并构建构建单独可运行的picgo依赖库 ([f83957c](https://github.com/terwer/src-sy-post-publisher/commit/f83957c58df386391f941f9d46299d6351acc872)) -* 集成picgo以及图床-显示操作状态 ([1332329](https://github.com/terwer/src-sy-post-publisher/commit/13323293362340228061ac017e0ad8a8a5844123)) -* 修复未生成属性时点击发布造成的文件名错误问题 ([a98eef8](https://github.com/terwer/src-sy-post-publisher/commit/a98eef8002a21722aaa70e3ac9ca49b724f3b05c)) -* 修改window构建脚本,优化构建体验 ([2bac0eb](https://github.com/terwer/src-sy-post-publisher/commit/2bac0eb8721c7d18e33083231e4bce1e3693166a)) -* 未修改过别名才去更改 ([03e2736](https://github.com/terwer/src-sy-post-publisher/commit/03e27360ede3364befd2ab2f36b91cfe3c3a618b)) -* add script comment ([fd961e3](https://github.com/terwer/src-sy-post-publisher/commit/fd961e3a27fca83992988b8736fc94545f30b08e)) -* **deps-dev:** bump @vitest/coverage-c8 from 0.25.8 to 0.26.2 ([fca56ba](https://github.com/terwer/src-sy-post-publisher/commit/fca56baf8cec698ae0314530e4343ea899d7e749)) -* **deps-dev:** bump vitest from 0.25.8 to 0.26.2 ([97f450a](https://github.com/terwer/src-sy-post-publisher/commit/97f450ad0e8ccfe32575a554ddbd964908c464d1)) -* fix default config ([b958626](https://github.com/terwer/src-sy-post-publisher/commit/b958626e028120379f8b3e44e5691271f59218a2)) -* fix image link ([51ff027](https://github.com/terwer/src-sy-post-publisher/commit/51ff02722ec54fab2603adee644f4ec0536ebb2c)) -* new version script ([0c88ade](https://github.com/terwer/src-sy-post-publisher/commit/0c88ade3e47ed4efaa55ab430e0f3f60823a3b5f)) -* release 0.5.1 ([82a1067](https://github.com/terwer/src-sy-post-publisher/commit/82a106791f72fe3a140f7d37d20dcf1696c02b58)) -* update deps ([92c3dc5](https://github.com/terwer/src-sy-post-publisher/commit/92c3dc53f651c474c065bc12270d8a4069fdbaf2)) -* use python script change new version ([64eb99c](https://github.com/terwer/src-sy-post-publisher/commit/64eb99c3960c99ad5742b71055d561e99455e741)) -* 新增fontawesome感谢 ([b7d19b8](https://github.com/terwer/src-sy-post-publisher/commit/b7d19b808f5f3f2eb9808f9178e2ba01b323cc08)) -## [0.5.1](https://github.com/terwer/src-sy-post-publisher/compare/v0.5.0...v0.5.1) (2022-12-17) -* [#275](https://github.com/terwer/src-sy-post-publisher/issues/275) 保存属性到思源需要刷新页面-成功提示 ([d5602f5](https://github.com/terwer/src-sy-post-publisher/commit/d5602f56aec752ce1e583e47ffb1fcfdbe803acc)) -* [#280](https://github.com/terwer/src-sy-post-publisher/issues/280) 弹窗新窗口打开404 ([361b397](https://github.com/terwer/src-sy-post-publisher/commit/361b397a2cf836273f05112df09c2716fce0fbc5)) -* [#281](https://github.com/terwer/src-sy-post-publisher/issues/281) 文章搜索支持ID ([6573afc](https://github.com/terwer/src-sy-post-publisher/commit/6573afcb1f2f924ec47962a681ec8f014d59786b)) -* [#282](https://github.com/terwer/src-sy-post-publisher/issues/282) 弹窗支持手动切换发布页面与列表-美化按钮图标 ([fe745c1](https://github.com/terwer/src-sy-post-publisher/commit/fe745c1d9db7e011d3e0a6aaee2edcea42294fae)) -* 修复文章预览h1标签问题 ([58df259](https://github.com/terwer/src-sy-post-publisher/commit/58df25942585119d30b3d3c67446dedaf8cb73e0)) -* 0.5.0 release ([7f162d0](https://github.com/terwer/src-sy-post-publisher/commit/7f162d05e1d6af9196d0e9fad940f6a25a43e21f)) -* fix doc ([cc14f05](https://github.com/terwer/src-sy-post-publisher/commit/cc14f058568c368ac2f5533c0d370839765facfc)) -* 新增感谢说明 ([e953552](https://github.com/terwer/src-sy-post-publisher/commit/e9535522ef1d9024cf28a68a1da54323a6599eb1)) -* 新增感谢说明,qq群 ([8e77a8b](https://github.com/terwer/src-sy-post-publisher/commit/8e77a8b2eee5ec55ef6099dc811544f33238e3da)) -## [0.5.0](https://github.com/terwer/src-sy-post-publisher/compare/v0.4.1...v0.5.0) (2022-12-15) -* [#213](https://github.com/terwer/src-sy-post-publisher/issues/213) 挂件模式用挂载菜单的方式使用-样式优化,pageId错误逻辑修复 ([1a20189](https://github.com/terwer/src-sy-post-publisher/commit/1a20189450b27e7139a67e2979a7431713739dee)) -* widget 0.4.1 ([d9386f3](https://github.com/terwer/src-sy-post-publisher/commit/d9386f3978248d2083e6278764ceaabe51d68c53)) -* 修改项目说明 ([739b69b](https://github.com/terwer/src-sy-post-publisher/commit/739b69beeb7b3bbbda54fc6fcef22257715bbef2)) -* 升级eslint,更改下载统计 ([9ad0592](https://github.com/terwer/src-sy-post-publisher/commit/9ad0592201782acff8fcb6478f661455a4d08754)) -## [0.4.1](https://github.com/terwer/src-sy-post-publisher/compare/v0.4.0...v0.4.1) (2022-12-14) -* 更新文档说明 ([5e20d65](https://github.com/terwer/src-sy-post-publisher/commit/5e20d656bd482402dcc8001cee3cb160f70d477e)) -## [0.4.0](https://github.com/terwer/src-sy-post-publisher/compare/v0.3.0...v0.4.0) (2022-12-14) -* [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持Github系列-源码模式展示方式切换 ([558950c](https://github.com/terwer/src-sy-post-publisher/commit/558950caab418456a803a22ac74f14159e5f67e3)) -* [#268](https://github.com/terwer/src-sy-post-publisher/issues/268) 直接点击发布,不生成属性,文件名会undefined ([01d3bf7](https://github.com/terwer/src-sy-post-publisher/commit/01d3bf73884d2b46c6855b71f050c7a2ce441989)) -* 优化项目说明 ([4d60d86](https://github.com/terwer/src-sy-post-publisher/commit/4d60d868b79a33581b7095d366c247a2280037e1)) -* 新增0.2.0项特性说明 ([2619353](https://github.com/terwer/src-sy-post-publisher/commit/2619353615b5f25a29292e88767b701d60bfb451)) -## [0.3.0](https://github.com/terwer/src-sy-post-publisher/compare/v0.2.0...v0.3.0) (2022-12-13) -* 组件化重构-github pages组件 ([31353dd](https://github.com/terwer/src-sy-post-publisher/commit/31353dd56ba446c3a4418419e470ba1485e61308)) -* 组件化重构-yaml转换 ([731e324](https://github.com/terwer/src-sy-post-publisher/commit/731e32496754980ec60e40092503cb47c8bd0f3c)) -* 组件化重构-yaml转文章属性 ([8be4954](https://github.com/terwer/src-sy-post-publisher/commit/8be4954288b15b6e52b42b24f0b1ab916d3821d1)) -* 组件化重构-y优化自定义组件结构 ([5979782](https://github.com/terwer/src-sy-post-publisher/commit/5979782d2c58a97370ef62fe291e93db3204afa6)) -* 组件化重构-y优化预览规则 ([2b811e2](https://github.com/terwer/src-sy-post-publisher/commit/2b811e2092f0bb6cc9bb22c896e5687f3bc43a61)) -* 组件化重构-优化tab刷新 ([d6c01fd](https://github.com/terwer/src-sy-post-publisher/commit/d6c01fdfc54b16e68f16f9769f0bacb865a2b7ab)) -* 组件化重构-优化tab加载 ([c31083e](https://github.com/terwer/src-sy-post-publisher/commit/c31083ea647ee7a1c28ab4dc44bbddf013323d7e)) -* 组件化重构-优化分类预览 ([16a3d83](https://github.com/terwer/src-sy-post-publisher/commit/16a3d83aced7ceb17ed1423d8bf106e7028ac1cc)) -* 组件化重构-偏好设置 ([71f1149](https://github.com/terwer/src-sy-post-publisher/commit/71f11497f3936d9fc3ba809cfc385d42ef2b2011)) -* 组件化重构-完成发布功能 ([2f9dccf](https://github.com/terwer/src-sy-post-publisher/commit/2f9dccf49e4a77b21f6c0cfeb0c6c550e695a729)) -* 组件化重构-快捷操作 ([59f380e](https://github.com/terwer/src-sy-post-publisher/commit/59f380e3383e3eec035c7cc926febd8ccfdf9ed8)) -* 组件化重构-提取标签组件 ([ac61b34](https://github.com/terwer/src-sy-post-publisher/commit/ac61b34bae7461d0b09a61bfc4d9da496746476e)) -* 组件化重构-提取生成摘要组件 ([9d4d7fd](https://github.com/terwer/src-sy-post-publisher/commit/9d4d7fd8321e7b667b49b128135fbce4161b8652)) -* 组件化重构-文章取消发布 ([864a72d](https://github.com/terwer/src-sy-post-publisher/commit/864a72df14f0f510860dc5ca06fba94c68d4af14)) -* 组件化重构-文章预览规则调整 ([8b30665](https://github.com/terwer/src-sy-post-publisher/commit/8b3066596c9fb3280b53d3a6e97832ad9b7d32fb)) -* 组件化重构-新增只读模式查看yaml ([ad9ca14](https://github.com/terwer/src-sy-post-publisher/commit/ad9ca147abce58b18e62034fed97e0f151b41f76)) -* 组件化重构-新增新窗口开关 ([ef9f465](https://github.com/terwer/src-sy-post-publisher/commit/ef9f46536f9ad987c1f2e8455957b9daea8ae5b8)) -* 组件化重构-移除冗余的配置 ([6a4c72c](https://github.com/terwer/src-sy-post-publisher/commit/6a4c72c5e5d9a8ae2befb410b1bbde4ee11fc90d)) -* 组件化重构-简化操作按钮 ([b22ea25](https://github.com/terwer/src-sy-post-publisher/commit/b22ea258ef8081e57c85948057ba74e6821fd40a)) -* 组件化重构-通用设置优化 ([0e64757](https://github.com/terwer/src-sy-post-publisher/commit/0e64757815abd348e20fc6e78309f0cfe62abdd7)) -* 组件化重构-页面初始化组件提取 ([d571e87](https://github.com/terwer/src-sy-post-publisher/commit/d571e87d2f6100d16a8bf9dfc9ceb910f2893801)) -* 修复版本检测构建失败问题 ([ce0b4f6](https://github.com/terwer/src-sy-post-publisher/commit/ce0b4f6c95d985dd276876a94c9360dff30d1e12)) -* 组件化重构-修复转换未及时更新问题 ([dfbf9de](https://github.com/terwer/src-sy-post-publisher/commit/dfbf9de79e296e53c7075db0c9820c0874a624fc)) -* **deps-dev:** bump happy-dom from 7.8.1 to 8.1.0 ([9ac1e24](https://github.com/terwer/src-sy-post-publisher/commit/9ac1e24b5c744973a9f579ab7a12bf4e0cf23afe)) -* **deps-dev:** bump prettier from 2.8.0 to 2.8.1 ([82e1667](https://github.com/terwer/src-sy-post-publisher/commit/82e16678d3eb69a9cbde39607659bf8d651c3854)) -* 合并历史记录 ([3c94bfc](https://github.com/terwer/src-sy-post-publisher/commit/3c94bfca1089efb5188683d4938f18d2c46e11ff)) -* 思源页面数据封装 ([929d19b](https://github.com/terwer/src-sy-post-publisher/commit/929d19b737c62195e6382e263d42ad253ec198ed)) -* 组件化重构 ([6ab2504](https://github.com/terwer/src-sy-post-publisher/commit/6ab25041794a4005ef31eaa0b83e5db78d728c8d)) -* 组件化重构-formdata转yaml ([940ec77](https://github.com/terwer/src-sy-post-publisher/commit/940ec77b45234fdd29685433102ca29a514b0f99)) -* 组件化重构-抽取别名生成组件 ([b09e7a5](https://github.com/terwer/src-sy-post-publisher/commit/b09e7a5273083cb4b16e1d8e6e75c19ce0e3acb8)) -* 组件化重构-改进源码模式 ([94541df](https://github.com/terwer/src-sy-post-publisher/commit/94541df113d79d7cd8862f4fc0dc2e00c0d87db2)) -* 组件化重构-文章别名 ([69d29f1](https://github.com/terwer/src-sy-post-publisher/commit/69d29f15399eded2234d66bd34d5156912c0ad45)) -* 调整目录结构 ([cd9b0a9](https://github.com/terwer/src-sy-post-publisher/commit/cd9b0a9a84322f6c6a8b1729c853a1551b8cf090)) -## [0.2.0](https://github.com/terwer/src-sy-post-publisher/compare/v0.1.0...v0.2.0) (2022-12-07) -- [#101](https://github.com/terwer/src-sy-post-publisher/issues/101) 代码优化以及空状态处理 ([f3444dc](https://github.com/terwer/src-sy-post-publisher/commit/f3444dc1e61135749e99a4b26d70cd1b29a4cc8b)) -- [#101](https://github.com/terwer/src-sy-post-publisher/issues/101) 错误处理 ([b19b813](https://github.com/terwer/src-sy-post-publisher/commit/b19b8137a90fbd000ec136e71ead82a2a51f88c4)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) v0.0.1 发版说明 ([40a8043](https://github.com/terwer/src-sy-post-publisher/commit/40a8043c88c963a0158e9d14bf916c68e7600289)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 修复说明图片 ([45ad34d](https://github.com/terwer/src-sy-post-publisher/commit/45ad34d0aa70227b96cb92fc7809487db27234bf)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 修复说明图片 ([186500f](https://github.com/terwer/src-sy-post-publisher/commit/186500fa21de78358541e5450245412a198afd8b)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-api 模拟调用 ([24e0afe](https://github.com/terwer/src-sy-post-publisher/commit/24e0afe4b8f15f7d364855575f1b727b02a9d577)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-修复一个构建错误 ([cd530a1](https://github.com/terwer/src-sy-post-publisher/commit/cd530a1448b7b73145379dafce1e594b3d1793b7)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-修复标题未即时更新的问题 ([6adc1cb](https://github.com/terwer/src-sy-post-publisher/commit/6adc1cbdd67caf92b112a324360f9895b8031b56)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-兼容非挂件模式请求 ([da6bf58](https://github.com/terwer/src-sy-post-publisher/commit/da6bf581677e54d8d3bcc74ef970eaee5b491b94)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-完成 Vuepress 支持 ([1e7e007](https://github.com/terwer/src-sy-post-publisher/commit/1e7e007fdfed9a7eb0acf2a75330a0019fe4e23c)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-开发阶段模拟 ID,使得整个逻辑更加通用 ([b49fc3e](https://github.com/terwer/src-sy-post-publisher/commit/b49fc3e2e179a165483ea12de83539829e063c58)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-数据绑定 ([7566cb5](https://github.com/terwer/src-sy-post-publisher/commit/7566cb514f1cf287aa77a7c89f36d02bb087c95f)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-文本复制 ([325c4d0](https://github.com/terwer/src-sy-post-publisher/commit/325c4d091bd2695982570d73feae8314a74ba0f7)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-文章发布与取消 ([10423d4](https://github.com/terwer/src-sy-post-publisher/commit/10423d4728b31be8a810be454cca5b23e2fcf5c5)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-生成摘要和读取标签 ([613269d](https://github.com/terwer/src-sy-post-publisher/commit/613269d9784898c9c8cf8ff1c046a55672e048d7)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 发布到 Vuepress-自动生成别名 ([1eedf0c](https://github.com/terwer/src-sy-post-publisher/commit/1eedf0c49e51d3f6a598fd185dc105599b4af4b9)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 演示图片 ([3cf870c](https://github.com/terwer/src-sy-post-publisher/commit/3cf870ca2ad9be3a6820228826f0dc84b933cfc3)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 点击演示 ([ea24922](https://github.com/terwer/src-sy-post-publisher/commit/ea249225724ff9492d9e73e192a7146090f94bd2)) -- [#13](https://github.com/terwer/src-sy-post-publisher/issues/13) 补充 v0.0.1 发版说明 ([59c44cd](https://github.com/terwer/src-sy-post-publisher/commit/59c44cd4686e75df8766197d98e31bfcf3570f83)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 插件图标 ([2b48628](https://github.com/terwer/src-sy-post-publisher/commit/2b48628b81f550b70f92b26c4b01554b8c3bdf39)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-Hexo 适配 ([ef417b4](https://github.com/terwer/src-sy-post-publisher/commit/ef417b484b3daa529671aed8feee548f7c5e1408)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-Hugo 设置适配 ([903c16c](https://github.com/terwer/src-sy-post-publisher/commit/903c16c97d9b13023da09b2d011a1ad1d2e2b113)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-Jekyll 适配 ([1f3ea54](https://github.com/terwer/src-sy-post-publisher/commit/1f3ea548973610146f1d83c7c240985060978d10)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-动态添加 Hugo 平台设置适配 ([ca7236c](https://github.com/terwer/src-sy-post-publisher/commit/ca7236c7d2c1af02f11c2a24870c8aef0cf6665a)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-完成配置适配 ([73d4eb7](https://github.com/terwer/src-sy-post-publisher/commit/73d4eb7904459f5115730c703491c91326c328ae)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-添加友好提示 ([2d81fd3](https://github.com/terwer/src-sy-post-publisher/commit/2d81fd3b517c6577eda9d81b455b08f0ecdb74c4)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-重构平台发布页面 ([4e512ab](https://github.com/terwer/src-sy-post-publisher/commit/4e512ab80371b745085bed405f8cea0794ea7971)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持 Github 系列-重构平台发布页面 ([d5264c6](https://github.com/terwer/src-sy-post-publisher/commit/d5264c67d5dfd9d8515d63f40b2ff89fb95d670a)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-动态平台平台开关 ([180183f](https://github.com/terwer/src-sy-post-publisher/commit/180183fdfdfcf1866910586ea8bf30d54ed82fa6)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-动态平台类型管理重构 ([ef252b6](https://github.com/terwer/src-sy-post-publisher/commit/ef252b66537cb0d0d8c5a22daa9e8c6e0181ac76)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-发布平台通用接口定义 ([cda8ec3](https://github.com/terwer/src-sy-post-publisher/commit/cda8ec3fdbd23983bbffa44e16743426c40fa579)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-文章 API 适配 ([269b7db](https://github.com/terwer/src-sy-post-publisher/commit/269b7dbe8ffe31f6394146f53c59a9e667ff7ab5)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-文章绑定 ([340750c](https://github.com/terwer/src-sy-post-publisher/commit/340750c165df97911413e228feccab54f585e80b)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-文章配置 ([c629d00](https://github.com/terwer/src-sy-post-publisher/commit/c629d000edccc1950e0dad3e57e681de103d66bb)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-设置适配 ([588c448](https://github.com/terwer/src-sy-post-publisher/commit/588c448480b81772435c11bd1fd2f1973c098042)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-项目整体结构调整 ([f7886a2](https://github.com/terwer/src-sy-post-publisher/commit/f7886a228cad511da66357c8582431bb33bef4a8)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content-项目整体结构调整 ([1826fcd](https://github.com/terwer/src-sy-post-publisher/commit/1826fcd5cfc0d251f2522ad3afd20280daf027a2)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 项目结构优化 ([0ad9803](https://github.com/terwer/src-sy-post-publisher/commit/0ad9803557b3c3d46a40428478b13a70195a330e)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133)支持 Github 系列-发布页面 ([3a4d8a8](https://github.com/terwer/src-sy-post-publisher/commit/3a4d8a88b6e6c7d467fc61ddcc1b8e8b53065b86)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133)支持 Github 系列-发布页面 ([1bce4d4](https://github.com/terwer/src-sy-post-publisher/commit/1bce4d4d58a7fb5ede80659b7db94b99cc4509fa)) -- [#138](https://github.com/terwer/src-sy-post-publisher/issues/138) 支持 Vuepress 设置真实预览链接 ([dbed166](https://github.com/terwer/src-sy-post-publisher/commit/dbed166d8f9bcf2f58ae2af2d0ab79c17d812a4f)) -- [#138](https://github.com/terwer/src-sy-post-publisher/issues/138) 支持 Vuepress 设置真实预览链接-修复显示问题 ([534e766](https://github.com/terwer/src-sy-post-publisher/commit/534e766d8d3d85b1615b213442b4da773d883797)) -- [#138](https://github.com/terwer/src-sy-post-publisher/issues/138) 新增 MyEclipse 支持 ([8bca3ee](https://github.com/terwer/src-sy-post-publisher/commit/8bca3ee1062aba5f2a73a483b66b623529df2a3f)) -- [#138](https://github.com/terwer/src-sy-post-publisher/issues/138) 新增 MyEclipse 支持-更新设置 ([7f451fc](https://github.com/terwer/src-sy-post-publisher/commit/7f451fc08bcaf90029b2465f98baa6de0f670096)) -- [#140](https://github.com/terwer/src-sy-post-publisher/issues/140) 明确版本边界-v0.x 版本更新 ([ea5cb00](https://github.com/terwer/src-sy-post-publisher/commit/ea5cb00438c4199162a483aa33672663a23da650)) -- [#143](https://github.com/terwer/src-sy-post-publisher/issues/143) 图片资源备份 ([75ee2ea](https://github.com/terwer/src-sy-post-publisher/commit/75ee2eaca506944e8fa9686d149781a22ca80a23)) -- [#143](https://github.com/terwer/src-sy-post-publisher/issues/143) 浏览器插件支持 Edge、Firefox、360、搜狗、猎豹 ([e6a6a0a](https://github.com/terwer/src-sy-post-publisher/commit/e6a6a0ad78b84fe3b6495b361b5b5304f5ea7938)) -- [#143](https://github.com/terwer/src-sy-post-publisher/issues/143) 浏览器插件支持 Edge、Firefox、360、搜狗、猎豹 ([1c30a90](https://github.com/terwer/src-sy-post-publisher/commit/1c30a90e27b44f013930dec293f935da0c48e45b)) -- [#143](https://github.com/terwer/src-sy-post-publisher/issues/143) 浏览器插件支持 Edge、Firefox、360、搜狗、猎豹-Firefox 发送请求探索 ([f3b20b7](https://github.com/terwer/src-sy-post-publisher/commit/f3b20b7a1f8e0d678db6203f4625f54e46a89d8d)) -- [#143](https://github.com/terwer/src-sy-post-publisher/issues/143) 浏览器插件支持 Edge、Firefox、360、搜狗、猎豹-MV2 的 background ([14a865b](https://github.com/terwer/src-sy-post-publisher/commit/14a865b6a524bb1cc0cdb18ea2a0fff509a06fe4)) -- [#143](https://github.com/terwer/src-sy-post-publisher/issues/143) 浏览器插件支持 Edge、Firefox、360、搜狗、猎豹-增加 firefox 判断 ([1dc294c](https://github.com/terwer/src-sy-post-publisher/commit/1dc294cd0d321413b75b69586b93be381e96f323)) -- [#143](https://github.com/terwer/src-sy-post-publisher/issues/143) 浏览器插件支持 Edge、Firefox、360、搜狗、猎豹-支持 Firefox ([0a94df2](https://github.com/terwer/src-sy-post-publisher/commit/0a94df2448be1e917055d83a8890f7f843eebf8b)) -- [#144](https://github.com/terwer/src-sy-post-publisher/issues/144) 挂件版支持统一管理子目录所有文章 ([9131a68](https://github.com/terwer/src-sy-post-publisher/commit/9131a687ad27fdfd7c8e841fea77d7bcb9fd7d37)) -- [#144](https://github.com/terwer/src-sy-post-publisher/issues/144) 挂件版支持统一管理子目录所有文章-数据获取以及页面跳转适配 ([9b6d79b](https://github.com/terwer/src-sy-post-publisher/commit/9b6d79bda91ebf82479ddea02d5f8651ee028395)) -- [#144](https://github.com/terwer/src-sy-post-publisher/issues/144) 挂件版支持统一管理子目录所有文章-条件切换 ([55b2408](https://github.com/terwer/src-sy-post-publisher/commit/55b24088a02aca041b1fc7c51914fe855d4dcbcb)) -- [#144](https://github.com/terwer/src-sy-post-publisher/issues/144) 挂件版支持统一管理子目录所有文章-链接跳转优化 ([d8f99ff](https://github.com/terwer/src-sy-post-publisher/commit/d8f99ffc87736c9d9e47f121727eddd07b733826)) -- [#144](https://github.com/terwer/src-sy-post-publisher/issues/144) 挂件版支持统一管理子目录所有文章-页面参数优化 ([cff2d0a](https://github.com/terwer/src-sy-post-publisher/commit/cff2d0aed88d6fcac47d3eab022d2f57b8e4d530)) -- [#144](https://github.com/terwer/src-sy-post-publisher/issues/144) 挂件版支持统一管理子目录所有文章-页面预览 ([804f3d8](https://github.com/terwer/src-sy-post-publisher/commit/804f3d88c55db5063fa7664c1905852772cb2612)) -- [#147](https://github.com/terwer/src-sy-post-publisher/issues/147) 支持自定义配置思源笔记的 API 地址 ([14692b8](https://github.com/terwer/src-sy-post-publisher/commit/14692b8d848dccee9b80c7509ab3f00cf61067e0)) -- [#147](https://github.com/terwer/src-sy-post-publisher/issues/147) 支持自定义配置思源笔记的 API 地址 ([49006dc](https://github.com/terwer/src-sy-post-publisher/commit/49006dcfc76d735db98ce5e17e07d55b79405802)) -- [#147](https://github.com/terwer/src-sy-post-publisher/issues/147) 支持自定义配置思源笔记的 API 地址-修改临时尝鲜新版说明 ([ba57f57](https://github.com/terwer/src-sy-post-publisher/commit/ba57f5775495266c058e6c78a0ea3cecf298a274)) -- [#147](https://github.com/terwer/src-sy-post-publisher/issues/147) 支持自定义配置思源笔记的 API 地址-增加临时尝鲜新版说明,直接体验,无需等待版本发布 ([2842a0c](https://github.com/terwer/src-sy-post-publisher/commit/2842a0ca2044032ec341062ce94a58adae4b5db8)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-API 测试 ([69632db](https://github.com/terwer/src-sy-post-publisher/commit/69632dbe43ce20eee113fc0c6e86f2e1937e4e2a)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-下阶段开发规划 ([4567f16](https://github.com/terwer/src-sy-post-publisher/commit/4567f165bf1a3a499f1167c1129a7c605c679dda)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-jvue、博客园文章发布与更新 ([9e2c24a](https://github.com/terwer/src-sy-post-publisher/commit/9e2c24a82bd0b53a07533925cd7838b9514a29fa)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-y 优化存储格式,按类型获取 ([f92b968](https://github.com/terwer/src-sy-post-publisher/commit/f92b968b9d59c29b4366cf4e0024ab36741515ab)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-修复 Confluence 发布问题 ([4cf35a5](https://github.com/terwer/src-sy-post-publisher/commit/4cf35a5d47dfa535ffc0a570565586481867b024)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-修复 Wordpress 发布问题 ([5d47f1d](https://github.com/terwer/src-sy-post-publisher/commit/5d47f1dee53fa3ee53ff20f5df86e9df6f0c8cf1)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-修复文章绑定无法取消的问题 ([b620aec](https://github.com/terwer/src-sy-post-publisher/commit/b620aece33bd385b7d9480cc1d8bf7a5b89e3ba1)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-修复构建错误 ([1ac6e75](https://github.com/terwer/src-sy-post-publisher/commit/1ac6e75758a255e6b73956b8745efdd02583c32c)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-修复预览链接问题 ([969199e](https://github.com/terwer/src-sy-post-publisher/commit/969199e123d4ada9ea987cb7cb77d0fc5d7897be)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-修复预览链接问题,更好的方法解决路径组合 ([67048e3](https://github.com/terwer/src-sy-post-publisher/commit/67048e3175ffc2ace111e9c9f0311c068eacb47e)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-其他平台配置 tab ([2c607d5](https://github.com/terwer/src-sy-post-publisher/commit/2c607d5b5e4b91591c22fcc669f8e51f87e3b566)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-动态发布成功 ([9a4dc00](https://github.com/terwer/src-sy-post-publisher/commit/9a4dc003e1a97ee1f07edd222830d7398bc0ea0c)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-动态展示发布平台 ([8b98647](https://github.com/terwer/src-sy-post-publisher/commit/8b9864710c84f7123a6fb4dad164571161495d6e)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-动态平台配置 ([124054f](https://github.com/terwer/src-sy-post-publisher/commit/124054fdd7b82ae345f0daac68b6871252354131)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-动态文章绑定 ([1620fa7](https://github.com/terwer/src-sy-post-publisher/commit/1620fa7eac22716157a123a61fff0d2155f4ead7)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-动态服务开关 ([1058fa9](https://github.com/terwer/src-sy-post-publisher/commit/1058fa9dc976796c3f7de387926a7d66686ed74e)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-动态配置适配完成 ([dca6ca2](https://github.com/terwer/src-sy-post-publisher/commit/dca6ca2483b0af221ae5ca9cbc4221c35085f04f)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-发布到 JVue 和博客园成功 ([cd156f8](https://github.com/terwer/src-sy-post-publisher/commit/cd156f8b6f2f6a014c555320b433fc4e9e3687d5)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-发布前生成属性 ([503e016](https://github.com/terwer/src-sy-post-publisher/commit/503e016bbebd05c24c65428e93d2a682d63bad1a)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-完美解决打包后 xmlrpc 调用问题 ([5869b98](https://github.com/terwer/src-sy-post-publisher/commit/5869b98a4c7bf251049b5b40a39f9535a9e14807)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-封装文章 ID 到适配器 ([ae52ee1](https://github.com/terwer/src-sy-post-publisher/commit/ae52ee13ba7e8f6c5e5587385ebde1af20c69c5c)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-根据不同类型选择发布 markdown 还是 html ([0d644da](https://github.com/terwer/src-sy-post-publisher/commit/0d644dac240587934c0c8cbabf2f97d07b428dfc)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-添加强制刷新选项 ([260116e](https://github.com/terwer/src-sy-post-publisher/commit/260116e982ea49e8be5970ed2ab0709cef552453)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-添加链滴 API 定义以及测试 ([dd497b9](https://github.com/terwer/src-sy-post-publisher/commit/dd497b98b7232061b3b328d0dc7ae9301d04f75b)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-组装发布数据 ([1aed161](https://github.com/terwer/src-sy-post-publisher/commit/1aed16158f118e3881bdd5840ea8c49e028bdd00)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-自动寻找 API 适配器 ([5dce440](https://github.com/terwer/src-sy-post-publisher/commit/5dce440a2ce9991c6b9b41e9db0430e2d583137d)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-解决 electron 适配问题 ([88f0831](https://github.com/terwer/src-sy-post-publisher/commit/88f0831725ea0f87caac48edb298148516a8a74f)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-调整目录结构 ([d6f579d](https://github.com/terwer/src-sy-post-publisher/commit/d6f579d480db73c360fc982924eaee9086bba0fd)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 发布到其他平台-博客园、Wordpress、链滴社区等-通用 API 定义 ([7936af6](https://github.com/terwer/src-sy-post-publisher/commit/7936af61a31532099bb137d2bad43ffbb95f6d54)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 增强 Vuepress 支持-默认开启别名 hash ([f5151c7](https://github.com/terwer/src-sy-post-publisher/commit/f5151c78a8124e1725e0b7cca2b4f17c401a4d4b)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 开始 v0.0.2 版本 ([a85fd1b](https://github.com/terwer/src-sy-post-publisher/commit/a85fd1b239ab18a4694924947225d82c61d477a2)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 文章绑定 ([c51a207](https://github.com/terwer/src-sy-post-publisher/commit/c51a2070ae4bdbc96d30f266d5caac6abf83464e)) -- [#15](https://github.com/terwer/src-sy-post-publisher/issues/15) 文章绑定 tab 切换数据刷新 ([9ed17d6](https://github.com/terwer/src-sy-post-publisher/commit/9ed17d62125a450c2021d80a27667ad520c2e09e)) -- [#152](https://github.com/terwer/src-sy-post-publisher/issues/152) 调整版本号为 1.0.0 ([c40d15b](https://github.com/terwer/src-sy-post-publisher/commit/c40d15b1cf4eb6e8a45471a893af74b58e5823b2)) -- [#152](https://github.com/terwer/src-sy-post-publisher/issues/152) 调整版本号为 1.0.0 ([a15a1e0](https://github.com/terwer/src-sy-post-publisher/commit/a15a1e083c6a7f68174ab23955db20f1f7f92457)) -- [#152](https://github.com/terwer/src-sy-post-publisher/issues/152) 集成 Github 的 CI 与依赖检测 ([acec282](https://github.com/terwer/src-sy-post-publisher/commit/acec282a8dbdb2f477a59da92c5536d9d668ae0b)) -- [#152](https://github.com/terwer/src-sy-post-publisher/issues/152) 集成 Github 的 CI 与依赖检测 ([3ad6c62](https://github.com/terwer/src-sy-post-publisher/commit/3ad6c62d3712a9ecce423e2acc89cdedd4909bff)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([36e5189](https://github.com/terwer/src-sy-post-publisher/commit/36e518948ab92ffa54a59ffb58393aebe54e9693)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([69b0f4b](https://github.com/terwer/src-sy-post-publisher/commit/69b0f4b1b7a066753c005642d43f6193535e852c)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([a0d70b2](https://github.com/terwer/src-sy-post-publisher/commit/a0d70b2e313e0c3a7ac6c05cdf4d9a513dc682db)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([649795c](https://github.com/terwer/src-sy-post-publisher/commit/649795c5f95fb5ceee3ff96e6d3601d56137a25a)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([b9afe93](https://github.com/terwer/src-sy-post-publisher/commit/b9afe93502725be486ccdef27da5fd9abda896b2)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([c564888](https://github.com/terwer/src-sy-post-publisher/commit/c564888b9d73115d902dd0b27e6f0934e00a2695)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([335e60a](https://github.com/terwer/src-sy-post-publisher/commit/335e60a66569a919614040ed43b1bdf8cd7416af)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([0a01139](https://github.com/terwer/src-sy-post-publisher/commit/0a01139f4ce830301aa079f04956df5f94cb695e)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化 ([df36f82](https://github.com/terwer/src-sy-post-publisher/commit/df36f82bb2fdc180ac131a83a5cda181b3599e5b)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化-自适应高度,去除滚动条 ([d652f57](https://github.com/terwer/src-sy-post-publisher/commit/d652f573be8f01b473ccaea435e280ff33cec9d4)) -- [#158](https://github.com/terwer/src-sy-post-publisher/issues/158) 使用体验优化-自适应高度,去除滚动条 ([d13f28d](https://github.com/terwer/src-sy-post-publisher/commit/d13f28d8a5c5cc89b1cb75f6ae621208c3d21669)) -- [#166](https://github.com/terwer/src-sy-post-publisher/issues/166) 除了当前简单模式和详细模式,新增源码模式 ([2c92a9f](https://github.com/terwer/src-sy-post-publisher/commit/2c92a9fd98adf4afe9ab2c26def3c2e61fe84c15)) -- [#166](https://github.com/terwer/src-sy-post-publisher/issues/166) 除了当前简单模式和详细模式,新增源码模式-默认目录 ([b71b9d8](https://github.com/terwer/src-sy-post-publisher/commit/b71b9d8d2c2cd08d8d1f43a7b8a95e58afe3cbde)) -- [#179](https://github.com/terwer/src-sy-post-publisher/issues/179) 修复 powershell 路径问题 ([4aa3d74](https://github.com/terwer/src-sy-post-publisher/commit/4aa3d74b925906adb0f2b58d6bd73edf0a77b6b0)) -- [#179](https://github.com/terwer/src-sy-post-publisher/issues/179) 完善文档说明 ([6661f49](https://github.com/terwer/src-sy-post-publisher/commit/6661f490b42a9b3a3ceaba928efe0af8bcd16dd0)) -- [#179](https://github.com/terwer/src-sy-post-publisher/issues/179) 添加 Windows 构建脚本 ([a98c117](https://github.com/terwer/src-sy-post-publisher/commit/a98c117f9422689a0e1b6c4b1632f9207b8c619b)) -- [#179](https://github.com/terwer/src-sy-post-publisher/issues/179) 源码添加版权说明 ([e929b15](https://github.com/terwer/src-sy-post-publisher/commit/e929b15cf1ba95cd9f661393a4f0051cee73f0dc)) -- [#179](https://github.com/terwer/src-sy-post-publisher/issues/179) 还原构建 ([d743210](https://github.com/terwer/src-sy-post-publisher/commit/d7432106a12e26ccadd667e967dff1f046e44654)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) v0.0.2 发版 ([fc5d2bc](https://github.com/terwer/src-sy-post-publisher/commit/fc5d2bc96f37796edf391f6cd7e389a1db80d5a7)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) v0.0.2 发版 ([8765c6e](https://github.com/terwer/src-sy-post-publisher/commit/8765c6e165d35471e86413a68c17f87dd7ce0e3a)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-Form 请求兼容 CORS ([cf7259a](https://github.com/terwer/src-sy-post-publisher/commit/cf7259a17a571501dd806ae9fc7cd0d088e4933c)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-KMS 集成完成 ([bcafebc](https://github.com/terwer/src-sy-post-publisher/commit/bcafebcde81f1eb8170172f202ed3e9884a13f03)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-localStorage 测试 ([5cb8acc](https://github.com/terwer/src-sy-post-publisher/commit/5cb8acc8171d1d74f4b86fb095545948e4241654)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-中间层开发完毕 ([c724993](https://github.com/terwer/src-sy-post-publisher/commit/c724993c5cf2e26e7a8824d518d26e7fd97afbf6)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-优化引用 ([f1546a4](https://github.com/terwer/src-sy-post-publisher/commit/f1546a41bfa88fa2c0603d3e26bd221f73910d35)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-使用 POST 请求 ([2bd2766](https://github.com/terwer/src-sy-post-publisher/commit/2bd2766654cf98cf352c92203f49bb1015497b72)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-修复依赖 ([dcb1843](https://github.com/terwer/src-sy-post-publisher/commit/dcb18432260b37ed19997fe85a670018d73dc55b)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-修复导入 ([064510e](https://github.com/terwer/src-sy-post-publisher/commit/064510ed6dff65adca934c930fee77cab50cd552)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-修复语雀问题 ([9363609](https://github.com/terwer/src-sy-post-publisher/commit/936360942f96cac39095ac4b33bfdd2cf52f33bb)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-修复配置 ([de771a3](https://github.com/terwer/src-sy-post-publisher/commit/de771a305e1565433078c03848488e71ce5da9a4)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-发布到链滴社区完成 ([19c2fb9](https://github.com/terwer/src-sy-post-publisher/commit/19c2fb95da6a011c6aac3de118057c6f64340e76)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-发布平台信息切换 ([1e9e568](https://github.com/terwer/src-sy-post-publisher/commit/1e9e56830d6ac114b995305ae496d4ddb4820f18)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-完成通用请求 CORS ([3596e00](https://github.com/terwer/src-sy-post-publisher/commit/3596e0095a9acd7e17685b36b4e9daa4c99c1301)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-完成通用配置 ([4e9ef56](https://github.com/terwer/src-sy-post-publisher/commit/4e9ef56102d24dc332d9d1f9a5ac4048b2d64377)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-寻找跨域解决方案 ([ffd6b2c](https://github.com/terwer/src-sy-post-publisher/commit/ffd6b2ced8b299057656e1acddf11d73d67e417e)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-排查构建错误 ([3e90e37](https://github.com/terwer/src-sy-post-publisher/commit/3e90e37f3c632afccdf4d2df7c47c4548d534e7b)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-文章取消优化 ([176cd70](https://github.com/terwer/src-sy-post-publisher/commit/176cd70e72fd0a3264745272436b3ea4399af828)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-新增调试模式,挂架模式直接请求,浏览器模式利用代理中转实现 CORS 跨域 ([6fa899f](https://github.com/terwer/src-sy-post-publisher/commit/6fa899f7f173afbd5a7182cac74025ed814ca093)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-测试 CORS ([0465ccd](https://github.com/terwer/src-sy-post-publisher/commit/0465ccd3673752522db1a43ad9580419c8e86ca0)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-测试 Express 的 Vercel 部署 ([88274c1](https://github.com/terwer/src-sy-post-publisher/commit/88274c1232bb428465d61d3ff65e8dad055696b3)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-浏览器版本 Wordpress 不传日期 ([63c5a3a](https://github.com/terwer/src-sy-post-publisher/commit/63c5a3ad08944bd4087b36d02ce3b77158618e2f)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-添加 CORS 地址 ([2550487](https://github.com/terwer/src-sy-post-publisher/commit/2550487c722ca08d2e34d1f5073cc9e8edb49fe4)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-添加 vercel 本地开发 CLI ([3e8ce96](https://github.com/terwer/src-sy-post-publisher/commit/3e8ce9685123021ea4765e9d957c93ef56fccc4f)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-添加各种接口适配器 ([143cd5c](https://github.com/terwer/src-sy-post-publisher/commit/143cd5c149503f437e077bbe925f9cd136f928b8)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-添加本地测试 ([15eeb06](https://github.com/terwer/src-sy-post-publisher/commit/15eeb0675e4f140f2fadf3ba682e752c58d005cf)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-移除测试代码 ([775857f](https://github.com/terwer/src-sy-post-publisher/commit/775857f9c2f8d805bdda10f5e6951128b2f4ed4f)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-移除测试代码 ([fd98625](https://github.com/terwer/src-sy-post-publisher/commit/fd98625bf2a8265899966711511a25b611d0c151)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-语雀集成 ([412a52e](https://github.com/terwer/src-sy-post-publisher/commit/412a52e079cd061ce8949d98c89ff8f79f6bd8c7)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-迁移别名功能 ([043a549](https://github.com/terwer/src-sy-post-publisher/commit/043a549a181c5f79fd7a1a6febce4d1e9bd2bb57)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-适配器优化 ([1818205](https://github.com/terwer/src-sy-post-publisher/commit/18182058d039a2fa6826d510ac58df3b23744e8d)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-通用设置模板 ([f38c043](https://github.com/terwer/src-sy-post-publisher/commit/f38c043405f40649ce823baaad8d53e279283ac8)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-重写 API ([f2598fb](https://github.com/terwer/src-sy-post-publisher/commit/f2598fbe8bd96b352d0499b57915deefe6ea2710)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-集成 KMS 的 Api ([f412961](https://github.com/terwer/src-sy-post-publisher/commit/f412961fe2c22779bbcf30ba7227837a052b43f2)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-集成 vitest,更换 fetch 为 cross-fetch ([2d78971](https://github.com/terwer/src-sy-post-publisher/commit/2d78971f3813bf971de1c8082481ec6d7935ac1f)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-api 客户端-集成语雀 API ([cc1075e](https://github.com/terwer/src-sy-post-publisher/commit/cc1075eda4e27f59d922f129fe545ed8c9bae183)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-PowerShell 构建脚本 ([7c00e35](https://github.com/terwer/src-sy-post-publisher/commit/7c00e35fa4454146013450b0e2c1c74c9250dfd1)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-Wordpress 支持 ([4c85aef](https://github.com/terwer/src-sy-post-publisher/commit/4c85aef888351a1c71f947d7e029748a4b11ea48)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-修复挂件版数据解析问题 ([3f92e87](https://github.com/terwer/src-sy-post-publisher/commit/3f92e87f3e9d25858c46dd5d15a7ff13f2f2e3e8)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-修复构建错误 ([152301c](https://github.com/terwer/src-sy-post-publisher/commit/152301cdeae72e718814fc886cd902b638a4c719)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-完美替换 markdown 解析器为 Lute ([64d51bc](https://github.com/terwer/src-sy-post-publisher/commit/64d51bcbfa857e5fb043a8b1eca46d6b04886932)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-挂件版调试成功 ([b372cc5](https://github.com/terwer/src-sy-post-publisher/commit/b372cc52254907df74a06661ff96e832c031ec33)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-支持 Confluence(基于 metaweblog 适配) ([6357784](https://github.com/terwer/src-sy-post-publisher/commit/6357784e38194a5e629fea39579fe30be53abc69)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-测试 API 配置 ([ecbbeb5](https://github.com/terwer/src-sy-post-publisher/commit/ecbbeb5dd97284940d63863d1fe6395895f00f4a)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-解决 node-fetch 依赖问题 ([96dd654](https://github.com/terwer/src-sy-post-publisher/commit/96dd654249bd7ba9277033052552290ea7500955)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-调整目录结构 ([c9d8d88](https://github.com/terwer/src-sy-post-publisher/commit/c9d8d885c329c7ff3522fccfeb5065986a85c139)) -- [#18](https://github.com/terwer/src-sy-post-publisher/issues/18) 实现 metaweblog-非挂件版调试成功 ([c570daf](https://github.com/terwer/src-sy-post-publisher/commit/c570daf5c0af4993506acd6144a13a1938e04d29)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-ts 泛型实现 Vuepress 发布参数配置 ([e0bac49](https://github.com/terwer/src-sy-post-publisher/commit/e0bac4966c4f62aa0ee285976effda9ae3c43d07)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-ts 泛型实现 Vuepress 发布参数配置 ([a317614](https://github.com/terwer/src-sy-post-publisher/commit/a3176144f5652f223fc7c97ef75f1f626224603e)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-修复 octokit 在 vite 构建报错问题,替换 node-fetch 为 isomorphic-fetch ([4dc65d3](https://github.com/terwer/src-sy-post-publisher/commit/4dc65d3f4d6e06ee0281a20600eae420a8e8eb73)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-修改项目说明 ([a2338ad](https://github.com/terwer/src-sy-post-publisher/commit/a2338ad90f1734c7c685792b128d4dba3061c686)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-增强 Vuepress 支持完毕 ([a69a49c](https://github.com/terwer/src-sy-post-publisher/commit/a69a49c497e4b1a4acab17543e7e108893c882de)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-支持文章取消发布 ([e9da035](https://github.com/terwer/src-sy-post-publisher/commit/e9da035111ac5e7377d9ee7611fb281eff63de74)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-支持简洁模式与详细模式 ([944b7a4](https://github.com/terwer/src-sy-post-publisher/commit/944b7a4939df50bc2c9989e5302772f2d5ad77b6)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-支持简洁模式与详细模式 ([68391c4](https://github.com/terwer/src-sy-post-publisher/commit/68391c46b71345f375a07337acb4a128fe469b6b)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-支持选择自定义发布目录 ([79bab18](https://github.com/terwer/src-sy-post-publisher/commit/79bab18648c5a1a0fdcd529c1b33acefb79f0b7d)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-文章默认路径发布 ([45880e7](https://github.com/terwer/src-sy-post-publisher/commit/45880e76a1bd325c0dbcb64756debe21ec7a437a)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-新增 api 状态,确保 api 可用性 ([fde68ad](https://github.com/terwer/src-sy-post-publisher/commit/fde68ad44a4f58faba5b1df9654164ba88208e17)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-新增标题空格校验 ([47519f9](https://github.com/terwer/src-sy-post-publisher/commit/47519f95e889ac1e89acafbddd1dde3eb796d6f3)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-更新开发计划 ([70b0b19](https://github.com/terwer/src-sy-post-publisher/commit/70b0b194347ae686e72af15dbdd608eefa92bbe6)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-更新说明 ([56e9207](https://github.com/terwer/src-sy-post-publisher/commit/56e92079b6d3d149832c4e9df2bd16b829895710)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-添加开发进度项目地址 ([274aff8](https://github.com/terwer/src-sy-post-publisher/commit/274aff8bf99b5019517d95d3a2dffb036c8205fc)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-耗时的按钮操作添加 loading ([71ec781](https://github.com/terwer/src-sy-post-publisher/commit/71ec7813a4f4e62073b4ffd94af6b9241beef00c)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-调整目录结果、新增 Github 的 rest api ([eead79e](https://github.com/terwer/src-sy-post-publisher/commit/eead79eed479bde42bc653a2c5d67e7d4090de8b)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-配置开关自动生效 ([22fc585](https://github.com/terwer/src-sy-post-publisher/commit/22fc585a5b0765818b1768b4fa8e5f8bc61c25e7)) -- [#19](https://github.com/terwer/src-sy-post-publisher/issues/19) 增强 Vuepress 支持-页面初始化也附加内容 ([21443ba](https://github.com/terwer/src-sy-post-publisher/commit/21443ba18b84fd9b6df06ade4ae198686c1d46b4)) -- [#236](https://github.com/terwer/src-sy-post-publisher/issues/236) 支持配置导入导出 ([16f030e](https://github.com/terwer/src-sy-post-publisher/commit/16f030e06e04b8a8c932066a1589bd192ab8062f)) -- [#239](https://github.com/terwer/src-sy-post-publisher/issues/239) 新窗口打开所有链接-自定义插件实现 ([a48ba76](https://github.com/terwer/src-sy-post-publisher/commit/a48ba762539b14a82c9ea15136e1f52209c6623b)) -- [#24](https://github.com/terwer/src-sy-post-publisher/issues/24) 环境变量调整 ([ab1d415](https://github.com/terwer/src-sy-post-publisher/commit/ab1d415cb1a9b020fec9472ef413af87659c6141)) -- [#24](https://github.com/terwer/src-sy-post-publisher/issues/24) 非挂件服务器版-修复构建错误 ([8a6655a](https://github.com/terwer/src-sy-post-publisher/commit/8a6655aec391273ef72e245b71b0bb3eb1da58aa)) -- [#24](https://github.com/terwer/src-sy-post-publisher/issues/24) 非挂件服务器版-修复默认测试 ID 获取 ([6e77b99](https://github.com/terwer/src-sy-post-publisher/commit/6e77b99587f621e4101e7e2a4543507ae0fe7f19)) -- [#24](https://github.com/terwer/src-sy-post-publisher/issues/24) 非挂件服务器版-权限验证 ([057a808](https://github.com/terwer/src-sy-post-publisher/commit/057a8080832a085a0dd539a10e2aad1388d85531)) -- [#24](https://github.com/terwer/src-sy-post-publisher/issues/24) 非挂件服务器版,需要传递文档 ID,建议配合我的另一个作品 node-siyuan 使用 ([e07ae0a](https://github.com/terwer/src-sy-post-publisher/commit/e07ae0ae8afdbbdd8134f8a8d0d0ea6fa97ad45d)) -- [#24](https://github.com/terwer/src-sy-post-publisher/issues/24) 非挂件服务器版,需要传递文档 ID,建议配合我的另一个作品 node-siyuan 使用-用=代替分隔符 ([eb54b29](https://github.com/terwer/src-sy-post-publisher/commit/eb54b295ffba39bf77c8eb6d9f1b2e76cc5ab1fd)) -- [#34](https://github.com/terwer/src-sy-post-publisher/issues/34) Vuepress 配置通过自动删除测试文章# ([4800afb](https://github.com/terwer/src-sy-post-publisher/commit/4800afbe42eb9be397cc7ea76df5d693d9b166f9)) -- [#59](https://github.com/terwer/src-sy-post-publisher/issues/59) Wordpress 默认发布为 Markdown ([4a9d534](https://github.com/terwer/src-sy-post-publisher/commit/4a9d534eaa9a75addcd1dfd7cd4d8bb202b13fdd)) -- [#59](https://github.com/terwer/src-sy-post-publisher/issues/59) 修复数字编号 ([6675aec](https://github.com/terwer/src-sy-post-publisher/commit/6675aecad7ac83c65d3837fd09bf7d25a32240c1)) -- [#59](https://github.com/terwer/src-sy-post-publisher/issues/59) 修复数字编号 ([b4fafb3](https://github.com/terwer/src-sy-post-publisher/commit/b4fafb303aeb96fbf266f24bea18e898ecad0d40)) -- [#59](https://github.com/terwer/src-sy-post-publisher/issues/59) 修复数字编号 ([6609058](https://github.com/terwer/src-sy-post-publisher/commit/6609058ec56bbef5cb343895cfc05c5bf4e6de21)) -- [#59](https://github.com/terwer/src-sy-post-publisher/issues/59) 标题支持数字编号 ([0e6ad8e](https://github.com/terwer/src-sy-post-publisher/commit/0e6ad8efec29593cfe4d4e86c0c27434d960777a)) -- [#59](https://github.com/terwer/src-sy-post-publisher/issues/59) 标题支持数字编号 ([9d9cd7f](https://github.com/terwer/src-sy-post-publisher/commit/9d9cd7fbbf002fcea1dd27acbdf9fa76fbf63085)) -- [#59](https://github.com/terwer/src-sy-post-publisher/issues/59) 标题支持数字编号 ([112e016](https://github.com/terwer/src-sy-post-publisher/commit/112e016d2f5e717957fb0ebc3b00ca37f82dde4b)) -- [#65](https://github.com/terwer/src-sy-post-publisher/issues/65) 支持可设置分类的平台选择分类-优化排版 ([a157235](https://github.com/terwer/src-sy-post-publisher/commit/a1572359ce0cfafb9a5efc57767ba9e3ba5a46a5)) -- [#65](https://github.com/terwer/src-sy-post-publisher/issues/65) 支持可设置分类的平台选择分类-自动标签开关 ([72a5c59](https://github.com/terwer/src-sy-post-publisher/commit/72a5c59d0b6285b9bdb1805e9dcbfffbea73a031)) -- [#65](https://github.com/terwer/src-sy-post-publisher/issues/65) 支持可设置分类的平台选择分类-语雀支持选择分类 ([57adfae](https://github.com/terwer/src-sy-post-publisher/commit/57adfae65936112c61afdfa17d7f00a14f143e5b)) -- [#65](https://github.com/terwer/src-sy-post-publisher/issues/65) 支持可设置分类的平台选择分类-调整界面 ([96a2990](https://github.com/terwer/src-sy-post-publisher/commit/96a29904fb396f8ed8487c1b342a7363181aea4f)) -- [#67](https://github.com/terwer/src-sy-post-publisher/issues/67) 动态类型支持选择发布格式 ([e32fb99](https://github.com/terwer/src-sy-post-publisher/commit/e32fb995b3f0f5c14f0e35466704d0f5e48d9374)) -- [#69](https://github.com/terwer/src-sy-post-publisher/issues/69) 动态类型支持自定义预览地址 ([8193e2e](https://github.com/terwer/src-sy-post-publisher/commit/8193e2e7db4337465c99b304b3ab9738db26e1ae)) -- [#69](https://github.com/terwer/src-sy-post-publisher/issues/69) 动态类型支持自定义预览地址-适配暗黑模式 ([2aae7d2](https://github.com/terwer/src-sy-post-publisher/commit/2aae7d21304e9104b1bb85cfc1cd3291da1a61ec)) -- [#74](https://github.com/terwer/src-sy-post-publisher/issues/74) 支持 Metaweblog 选择分类(博客园、Wordpress 等) ([657b74e](https://github.com/terwer/src-sy-post-publisher/commit/657b74e7872d1f958775d73112f2d29f1e05c818)) -- [#74](https://github.com/terwer/src-sy-post-publisher/issues/74) 支持 Metaweblog 选择分类(博客园、Wordpress 等)-添加单元测试 ([8dce104](https://github.com/terwer/src-sy-post-publisher/commit/8dce104d574d33ceada0c93e9fb4f24976dbb470)) -- [#78](https://github.com/terwer/src-sy-post-publisher/issues/78) 支持取消所有平台 ([1c6bb16](https://github.com/terwer/src-sy-post-publisher/commit/1c6bb164ea986b5b6a0be87b9d1e1e4e7fe40559)) -- [#78](https://github.com/terwer/src-sy-post-publisher/issues/78) 支持取消所有平台-修复取消平台后的提示问题 ([2314596](https://github.com/terwer/src-sy-post-publisher/commit/2314596bedbf669315331467452895aa89784de2)) -- [#80](https://github.com/terwer/src-sy-post-publisher/issues/80) 适配暗色模式 ([510b9fa](https://github.com/terwer/src-sy-post-publisher/commit/510b9fa319b7ecbe55dd9f63742abce87b2d818a)) -- [#83](https://github.com/terwer/src-sy-post-publisher/issues/83) 页面初始化支持骨架,提升用户体验-metaweblog 平台 ([72472db](https://github.com/terwer/src-sy-post-publisher/commit/72472db53da480cc0b55697dc44c8e4b3cd06bf9)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([8aa2a23](https://github.com/terwer/src-sy-post-publisher/commit/8aa2a236e65f091e40748f814b381b5095038ee0)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([ad911e0](https://github.com/terwer/src-sy-post-publisher/commit/ad911e0bca8acd2e5a977e2ac60bea0ed528ec93)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([5e93ae7](https://github.com/terwer/src-sy-post-publisher/commit/5e93ae7cc698d6152612a22c646edf6da0011488)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([c28bea9](https://github.com/terwer/src-sy-post-publisher/commit/c28bea903ababea279c3c38ff5d37400da66b73e)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([ec14d55](https://github.com/terwer/src-sy-post-publisher/commit/ec14d5545dd828fe196800d28796b761d1d770c1)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([6be3d67](https://github.com/terwer/src-sy-post-publisher/commit/6be3d67e3af241ee9be90d8014a52215e35fd38d)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([9c64d6d](https://github.com/terwer/src-sy-post-publisher/commit/9c64d6ddfaf34ac7365d531ad58e7d8cd5a5e446)) -- [#84](https://github.com/terwer/src-sy-post-publisher/issues/84) 平台配置帮助文档 ([7e44a4f](https://github.com/terwer/src-sy-post-publisher/commit/7e44a4f0c9bf45c52b993cbd0d79c3aaa9a4b271)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-代码高亮 ([a70c997](https://github.com/terwer/src-sy-post-publisher/commit/a70c99729665d8e3f6d2af4dc7b28dc73006a383)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-修复 Form 表单参数传递 ([0cb8be2](https://github.com/terwer/src-sy-post-publisher/commit/0cb8be2676f709ee3549dae093e9f2b9fc3e4fa5)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-修复 Metaweblog 发布问题 ([e7a8c46](https://github.com/terwer/src-sy-post-publisher/commit/e7a8c46646ce17bbba69438a432e433ecaf11a2e)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-修复样式 ([2397a3b](https://github.com/terwer/src-sy-post-publisher/commit/2397a3b7d06aa0a56724fe3e0f6475fccbfd261e)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-公共请求及错误处理 ([933ed0a](https://github.com/terwer/src-sy-post-publisher/commit/933ed0aaa9ecf484ed5cd1aa4876e8e97fb646c2)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-发布脚本 ([3432b46](https://github.com/terwer/src-sy-post-publisher/commit/3432b46cb086f028d4999274880661eb0302b0a2)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-同时兼容 Google 扩展与思源挂件构建 ([9e1fba4](https://github.com/terwer/src-sy-post-publisher/commit/9e1fba4b445d5509bd369b019b521b9b1c16db6b)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-同时兼容 Google 扩展与思源挂件构建,修复缺失文件 ([5399e94](https://github.com/terwer/src-sy-post-publisher/commit/5399e9457e365ce5d93ed7f1b23e115c2cc5fd28)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-基本适配 ([61ce753](https://github.com/terwer/src-sy-post-publisher/commit/61ce7534774218fc26bcb8fea27d286acb49932d)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-多页面支持 ([24bece8](https://github.com/terwer/src-sy-post-publisher/commit/24bece8837bde29948ec894eff85f6c97a95dd57)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-已兼容 Chrome 插件 ([2db93ca](https://github.com/terwer/src-sy-post-publisher/commit/2db93ca6e243e3c49c7fed4ae7927855085c047b)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-当前页面使用发布工具 ([2647015](https://github.com/terwer/src-sy-post-publisher/commit/26470151bf17c464aba0670d58d359e34160d2d6)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-当前页面样式问题修复 ([2993563](https://github.com/terwer/src-sy-post-publisher/commit/2993563973bdcf18245074555ebc312af256158c)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-数据适配 ([83a3693](https://github.com/terwer/src-sy-post-publisher/commit/83a369346834893b9add75f8aed679ecc18caa5b)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-文章详情页支持新窗口单独预览 ([aeb31ff](https://github.com/terwer/src-sy-post-publisher/commit/aeb31ff607e17c9bc9f9295acbc1d7498983ca9e)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-暗黑模式适配 ([a81968f](https://github.com/terwer/src-sy-post-publisher/commit/a81968f9827c716cf95af56e75cc1ba28de4ec91)) -- [#85](https://github.com/terwer/src-sy-post-publisher/issues/85) Google 插件扩展-错误处理 ([e1b449c](https://github.com/terwer/src-sy-post-publisher/commit/e1b449c6412626c2327e71174fe8dc11fa905f8c)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-优化当前页面预览 ([1dce514](https://github.com/terwer/src-sy-post-publisher/commit/1dce514a38a686c2c2478eecacd1a300d95bfc0b)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-优化首页布局 ([c592222](https://github.com/terwer/src-sy-post-publisher/commit/c59222247fd04c692affe5cae04cb0a9ca47d673)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-列表分页 ([e67e30a](https://github.com/terwer/src-sy-post-publisher/commit/e67e30a0222290ab5a427c81c63433033922f57f)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-完善 UI ([537d8df](https://github.com/terwer/src-sy-post-publisher/commit/537d8df8c301add03df7f5d14a5be0fcdd3c3fb1)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-数据分页 ([4931091](https://github.com/terwer/src-sy-post-publisher/commit/4931091a29e3b1b9baf6c29fa6a2677d88309e54)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-详情页面基本布局 ([b619b23](https://github.com/terwer/src-sy-post-publisher/commit/b619b238b610b7789f1fee57cc0c270cc74bab02)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-集成搜索与分页 ([5d28b24](https://github.com/terwer/src-sy-post-publisher/commit/5d28b24933a38f624798b275eb27439c3ece2a02)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-首页基本布局 ([299a1d6](https://github.com/terwer/src-sy-post-publisher/commit/299a1d61d420f67b32482bad4104e2cddd973dcd)) -- [#87](https://github.com/terwer/src-sy-post-publisher/issues/87) 整合 node-siyuan 到挂件-首页支持切换暗黑模式 ([33b7922](https://github.com/terwer/src-sy-post-publisher/commit/33b79229a33b5870fb6f628f6fbdbd9521b211e9)) -- mpa 集成 ([4e2df05](https://github.com/terwer/src-sy-post-publisher/commit/4e2df05055c083bf950d021647c640a2af7b33dc)) -- release-please 集成 ([8b884c6](https://github.com/terwer/src-sy-post-publisher/commit/8b884c6fcdaa65e68d0d9e247c31d4705c535fc4)) -- release-please 集成 ([a3b06c2](https://github.com/terwer/src-sy-post-publisher/commit/a3b06c2280fa50c300e3bca168627eeffe6f0b4b)) -- release-please 集成 ([12973e9](https://github.com/terwer/src-sy-post-publisher/commit/12973e9e59ebf0a8f7f22e75cac459848e00e524)) -- release-please 集成 ([4215e0c](https://github.com/terwer/src-sy-post-publisher/commit/4215e0cfd1c3e9770b5402615b82f74282627b2d)) -- release-please 集成 ([79c0597](https://github.com/terwer/src-sy-post-publisher/commit/79c059742a82ac1e94dee80a7f19a2b33b55f039)) -- release-please 集成 ([9f8f490](https://github.com/terwer/src-sy-post-publisher/commit/9f8f490ed186ecbb814abc769f43d7708c432f7b)) -- support docker dev envoronments ([650e5e6](https://github.com/terwer/src-sy-post-publisher/commit/650e5e688c470f6af1cb74be4c73417093132532)) -- unit tests ([c06b769](https://github.com/terwer/src-sy-post-publisher/commit/c06b7690c6dde07b56e25854d4904e0a9e25c1b3)) -- 自定义类型文件 ([574abed](https://github.com/terwer/src-sy-post-publisher/commit/574abed407e4b447d66abfa4772c8d0d636a5eb2)) -- 项目打包瘦身 ([db2d311](https://github.com/terwer/src-sy-post-publisher/commit/db2d3115cf17199ad74ac428c0c46f07734ce34f)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) Chrome 公式单独渲染 ([c84971f](https://github.com/terwer/src-sy-post-publisher/commit/c84971f60d8f57f27055506ad22c06204c785bc3)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) UI 持续优化 ([a99ea3a](https://github.com/terwer/src-sy-post-publisher/commit/a99ea3af3117e7905f193973cf1176b9bf1c7c04)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 优先使用落霞孤鹜字体 ([3d04f74](https://github.com/terwer/src-sy-post-publisher/commit/3d04f7414ac6de73abb351e79820fecf827f524b)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 优先使用落霞孤鹜字体 ([7e35ab0](https://github.com/terwer/src-sy-post-publisher/commit/7e35ab021b5b0cc15f4167979d4b0b6f1993649a)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 优化界面显示 ([4553cc4](https://github.com/terwer/src-sy-post-publisher/commit/4553cc4321d509ba26c4b250ca4e3d382088133f)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 备份 0.0.3 发布秘钥 ([3bde583](https://github.com/terwer/src-sy-post-publisher/commit/3bde583492142a81ddef1a16f27cd5f6ef2e1dfb)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 字体兼容-Mac 使用-apple-system,Windows 使用微软雅黑,自部署使用 JetBrainsMono 配合落霞孤鹜文楷 ([22a97f3](https://github.com/terwer/src-sy-post-publisher/commit/22a97f3cd2a2db0716acf8956b5db861424d864c)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 支持 MathJax3 渲染公式 ([1762d40](https://github.com/terwer/src-sy-post-publisher/commit/1762d40dfce3b1af386e82e1bb7639b23dee343b)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 更新预览图片 ([347f83b](https://github.com/terwer/src-sy-post-publisher/commit/347f83b20d6aa0a03ded86906676cd19c23e2f22)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 添加隐私声明 ([6775c27](https://github.com/terwer/src-sy-post-publisher/commit/6775c27cc6fc7bd6997a7c4b8014dc9b0cea40d7)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 界面优化调整 ([9777a97](https://github.com/terwer/src-sy-post-publisher/commit/9777a97c36ccb6762e89f63f01c6b47ffa0736f8)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 详情页面代码样式优化 ([84c9b46](https://github.com/terwer/src-sy-post-publisher/commit/84c9b46b8f9aaef93609644b88e49de773c2d074)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 详情页面展示优化 ([f863658](https://github.com/terwer/src-sy-post-publisher/commit/f8636586c689da84b831a817928010ad29fb34f3)) -- [#112](https://github.com/terwer/src-sy-post-publisher/issues/112) 调整构建脚本 ([ea68be8](https://github.com/terwer/src-sy-post-publisher/commit/ea68be8c9c262b77cc2e943c7d5abf92ae57e940)) -- [#119](https://github.com/terwer/src-sy-post-publisher/issues/119) 优化构建参数 ([4850678](https://github.com/terwer/src-sy-post-publisher/commit/48506784c2ad5d596cb5781fdddb693252a90bc4)) -- [#119](https://github.com/terwer/src-sy-post-publisher/issues/119) 发布到链滴,剔除图片,取消打赏 ([b52e783](https://github.com/terwer/src-sy-post-publisher/commit/b52e783c0f5d66f49a7c1a83249a5053e8cd66b2)) -- [#119](https://github.com/terwer/src-sy-post-publisher/issues/119) 发布到链滴,图片转换为 base64 ([5464b33](https://github.com/terwer/src-sy-post-publisher/commit/5464b33e4ae20139bdb322d06930728ffa36bde5)) -- [#119](https://github.com/terwer/src-sy-post-publisher/issues/119) 发布到链滴,图片转换为 base64-base64 代理 ([358e912](https://github.com/terwer/src-sy-post-publisher/commit/358e912bdedfd40ff47d23093ab7b09abd86d777)) -- [#119](https://github.com/terwer/src-sy-post-publisher/issues/119) 发布到链滴,图片转换为 base64-CORS 处理 ([899a508](https://github.com/terwer/src-sy-post-publisher/commit/899a508d0037aeadf2a2794afecece205efdb8c5)) -- [#119](https://github.com/terwer/src-sy-post-publisher/issues/119) 发布到链滴,图片转换为 base64-添加 PowerShell 脚本 ([6af5c2d](https://github.com/terwer/src-sy-post-publisher/commit/6af5c2d74205212cf6cbe97db3fd3ee34d342a4e)) -- [#119](https://github.com/terwer/src-sy-post-publisher/issues/119) 发布到链滴,添加发布和更新确认,避免发布频率限制 ([5f4b492](https://github.com/terwer/src-sy-post-publisher/commit/5f4b492e984cab1ce267d71a569030aaaf267061)) -- [#133](https://github.com/terwer/src-sy-post-publisher/issues/133) 支持支持 Github pages、HUGO、Jekyll、Next.js content、Nuxt.js content ([79ca9a9](https://github.com/terwer/src-sy-post-publisher/commit/79ca9a9aa1b37aae07d6fcb75052824bf7b83848)) -- [#139](https://github.com/terwer/src-sy-post-publisher/issues/139) Vuepress 分类未保存问题 ([f4c23a8](https://github.com/terwer/src-sy-post-publisher/commit/f4c23a8eab35e6b88308efbeef0bc397b59237b1)) -- [#146](https://github.com/terwer/src-sy-post-publisher/issues/146) 浏览器与插件显示图标修复 ([bd533b4](https://github.com/terwer/src-sy-post-publisher/commit/bd533b4d44fd6f6ea4e934a46b64e1fab0465c95)) -- [#193](https://github.com/terwer/src-sy-post-publisher/issues/193) 挂件列表发布文档选择子文档时读取的是当前文档的信息 ([c4b741a](https://github.com/terwer/src-sy-post-publisher/commit/c4b741af5fffb080d192bea4045836777fe58de6)) -- [#21](https://github.com/terwer/src-sy-post-publisher/issues/21) Vuepress 调用 Github APi 导致 getPage 中文乱码导致更新失败问题 ([54844e1](https://github.com/terwer/src-sy-post-publisher/commit/54844e12033aeec4908c344c796919b8436d6759)) -- [#21](https://github.com/terwer/src-sy-post-publisher/issues/21) 修复文章更新的路径问题 ([73dec10](https://github.com/terwer/src-sy-post-publisher/commit/73dec108b382542a6a5aa6feb547a4ab9dcb86f9)) -- [#210](https://github.com/terwer/src-sy-post-publisher/issues/210) 发布文章部分内容缺失 ([faa9532](https://github.com/terwer/src-sy-post-publisher/commit/faa953274dfc61711d7fa65abeb4f8eb7ec40812)) -- [#66](https://github.com/terwer/src-sy-post-publisher/issues/66) 发布到语雀偶发的获取默认知识库失败问题 ([7947870](https://github.com/terwer/src-sy-post-publisher/commit/7947870ede970f4568c3ea03ccfe0bf31d95e10d)) -- **deps:** bump @vueuse/core from 9.5.0 to 9.6.0 ([0ba8c7b](https://github.com/terwer/src-sy-post-publisher/commit/0ba8c7b8889e422134b6dc4240a9a12d340f355a)) -- **deps:** bump element-plus from 2.2.22 to 2.2.25 ([f4e5dca](https://github.com/terwer/src-sy-post-publisher/commit/f4e5dca46a88577f5a7315d2ba6f3138951c0597)) -- **deps:** bump pinia from 2.0.24 to 2.0.25 ([5397dc7](https://github.com/terwer/src-sy-post-publisher/commit/5397dc73005413773f4342055951d6c84ef31328)) -- **deps:** bump pinia from 2.0.26 to 2.0.27 ([ad36241](https://github.com/terwer/src-sy-post-publisher/commit/ad36241260fc8391a2ac6872436b36e248dec519)) -- **deps:** bump uuid from 8.3.2 to 9.0.0 ([95c0983](https://github.com/terwer/src-sy-post-publisher/commit/95c09833f61a5d1a016a21171a549748da0f2f93)) -- 优化整体布局 ([601b8e7](https://github.com/terwer/src-sy-post-publisher/commit/601b8e7bfc1f4464be876c2bb7095c9f8cf1dd4f)) -- 修复动态平台无法删除问题 ([597b483](https://github.com/terwer/src-sy-post-publisher/commit/597b483469bb6022c172e89d630f52eccdf9dda3)) -- 去除页面底部空白 ([a2c0bb5](https://github.com/terwer/src-sy-post-publisher/commit/a2c0bb54e76e55eb311a27fc40d416b6e4606846)) -- 去除页面底部空白-根据浏览器宽度判断 ([368e699](https://github.com/terwer/src-sy-post-publisher/commit/368e699152bae31e36f1d4ecde654d73376eadd1)) -- 发布页面样式优化 ([422a3c9](https://github.com/terwer/src-sy-post-publisher/commit/422a3c9cd6d7d3ea7c8c942b67e065cea52b6c7b)) -- 导入取消不提示错误,不打扰用户 ([0d41624](https://github.com/terwer/src-sy-post-publisher/commit/0d4162425e927e023b32fbb712d4c06998526a00)) -- 导出不刷新页面,导入成功之后才刷新页面 ([ef26986](https://github.com/terwer/src-sy-post-publisher/commit/ef26986150c02d84c35945e56d983e8ff20cdc63)) -- 添加 window 构建脚本,优化构建体验 ([30e6d8f](https://github.com/terwer/src-sy-post-publisher/commit/30e6d8fdae7a1ef12cb2f35d68567dd1c25a6376)) -- component test ([6dd319d](https://github.com/terwer/src-sy-post-publisher/commit/6dd319d7e71b2152ffa589067e403af6301a99ea)) -- **deps-dev:** bump @vitest/coverage-c8 from 0.25.2 to 0.25.3 ([2ae763c](https://github.com/terwer/src-sy-post-publisher/commit/2ae763c0f0361cb889b4ba626af7801bfd2f4a73)) -- **deps-dev:** bump unplugin-vue-components from 0.22.9 to 0.22.11 ([0bfc0dc](https://github.com/terwer/src-sy-post-publisher/commit/0bfc0dcf5b8db73678e78b7fa4e13b09266d039c)) -- **deps-dev:** bump vercel from 28.5.6 to 28.7.0 ([87184c1](https://github.com/terwer/src-sy-post-publisher/commit/87184c19916654b522d2b8f689a3a6d435b6674a)) -- **deps-dev:** bump vitest from 0.22.1 to 0.25.2 ([9966f67](https://github.com/terwer/src-sy-post-publisher/commit/9966f67621b85c269b86b85c5d2e309258c0bccd)) -- **deps-dev:** bump vitest from 0.25.2 to 0.25.3 ([c32c373](https://github.com/terwer/src-sy-post-publisher/commit/c32c3734c4e12ea5d261c4648a192b087b1aa21e)) -- **deps-dev:** bump vue-tsc from 0.38.9 to 1.0.9 ([5632177](https://github.com/terwer/src-sy-post-publisher/commit/563217798ca1f4a87516b4884c1513298674bc53)) -- **deps-dev:** bump vue-tsc from 1.0.9 to 1.0.10 ([1ee6583](https://github.com/terwer/src-sy-post-publisher/commit/1ee658382ae6b554308c8a47cdf384d41ee6148d)) -- fix build error ([5ead9ed](https://github.com/terwer/src-sy-post-publisher/commit/5ead9ed47be6e235a09e5fe33e56bd6e9d271cc1)) -- fix build error ([6b8e4e7](https://github.com/terwer/src-sy-post-publisher/commit/6b8e4e78ad20c454e319b6ed22d2091a7054d8c8)) -- fix changelog ([dbe39e6](https://github.com/terwer/src-sy-post-publisher/commit/dbe39e65d311337d8dafd7fe5e1f32f134211871)) -- fix error ([bf03d89](https://github.com/terwer/src-sy-post-publisher/commit/bf03d89cea8a75091be882b531b614aefa32d746)) -- fix style ([305942b](https://github.com/terwer/src-sy-post-publisher/commit/305942b5e9dba28d0d57d89128176746cb21892a)) -- **main:** release 0.1.0 ([90048a5](https://github.com/terwer/src-sy-post-publisher/commit/90048a5fe5582d7a65ea571243de7e88a875fea8)) -- prettier 重构 ([eda85bb](https://github.com/terwer/src-sy-post-publisher/commit/eda85bb56fce0278bd4ef92f252b368f5fc351a1)) -- prettier 重构 ([ee7a98a](https://github.com/terwer/src-sy-post-publisher/commit/ee7a98af77cf02f330128936f20a39d9510eef66)) -- prettier 重构-update copyright ([a493a5f](https://github.com/terwer/src-sy-post-publisher/commit/a493a5fe8dc9aaaa33af0f7dead16827c197ed7a)) -- prettier 重构-update copyright ([b38902b](https://github.com/terwer/src-sy-post-publisher/commit/b38902b241388f0372288e3baefd109cd40e4a61)) -- prettier 重构-update copyright ([7c9c2c0](https://github.com/terwer/src-sy-post-publisher/commit/7c9c2c01d5b72dcecebbeeefb47ecf82df54ce68)) -- prettier 重构-使用 loglevel 重构日志框架 ([39a9a48](https://github.com/terwer/src-sy-post-publisher/commit/39a9a489420d88b21a66a23352f59766ca4ce4df)) -- prettier 重构-公共方法测试 ([0b9ca89](https://github.com/terwer/src-sy-post-publisher/commit/0b9ca89819febc807472a31efc2472eedc6f584d)) -- prettier 重构-挂载 app 测试 ([b411bb3](https://github.com/terwer/src-sy-post-publisher/commit/b411bb38822a0bf12579cd5561e073c50d13672b)) -- prettier 重构代码 ([c7a273b](https://github.com/terwer/src-sy-post-publisher/commit/c7a273b3809fa8c8425491231fdf905487cef634)) -- pretty code ([f45fe28](https://github.com/terwer/src-sy-post-publisher/commit/f45fe28b33f061655782343716c4205eee1d8541)) -- pretty code ([4c64f62](https://github.com/terwer/src-sy-post-publisher/commit/4c64f62f33eabe7eac4d582aa623494da49e1b2e)) -- pretty code ([9dca577](https://github.com/terwer/src-sy-post-publisher/commit/9dca577ad4b9dcfd4da0e2fb580c8cb926386463)) -- pretty code ([89b584c](https://github.com/terwer/src-sy-post-publisher/commit/89b584c882671a0254ba24ac7cd7f5b4e59f8997)) -- pretty code ([f51cdaf](https://github.com/terwer/src-sy-post-publisher/commit/f51cdafc7e132d24e9bc363484bb62282752467c)) -- pretty code-add ext dev mode ([4063ac2](https://github.com/terwer/src-sy-post-publisher/commit/4063ac2f3e33e740087479c7226a3739ce00fff0)) -- pretty code-fix error tips ([e0caee7](https://github.com/terwer/src-sy-post-publisher/commit/e0caee7db4764e044f3498e40bca51e21db7ebd8)) -- pretty code-fix error tips ([03e2b14](https://github.com/terwer/src-sy-post-publisher/commit/03e2b140cf1b5162d06f3b2a2f513ce0c47efb81)) -- pretty code, use ~ as relative path ([b7bb2d5](https://github.com/terwer/src-sy-post-publisher/commit/b7bb2d5eb5346fe7ec75a22d3c3933f93fd827a2)) -- 优化文档说明 ([0949d6d](https://github.com/terwer/src-sy-post-publisher/commit/0949d6d1f9b10819e857061f0c3c9dba877fa6eb)) -- 优化构建脚本 ([e03121c](https://github.com/terwer/src-sy-post-publisher/commit/e03121c2dd9f7c0ffa18385077bdc901f5932f82)) -- 引入 eslint ([ffe1719](https://github.com/terwer/src-sy-post-publisher/commit/ffe1719efe81623c2d327827a3b6876f74a95058)) -- 更新文档 ([2b2a52a](https://github.com/terwer/src-sy-post-publisher/commit/2b2a52a3d16b1ac6ecc012639a63da28e29062a1)) -- 灰色模式 ([81c1f13](https://github.com/terwer/src-sy-post-publisher/commit/81c1f13934c857fb8d63c045f3d650782bfad703)) -- 集成 jsdoc 和 better-docs ([44bf3f5](https://github.com/terwer/src-sy-post-publisher/commit/44bf3f58f0a834e9a18b8502a91d6797cbaf8a5b)) -- 集成 jsdoc 和 better-docs ([e20aa7e](https://github.com/terwer/src-sy-post-publisher/commit/e20aa7ed50fb272df21736985f10f54b7df6fc3d)) -- 项目重构-pageid 优先级修复 ([762ef30](https://github.com/terwer/src-sy-post-publisher/commit/762ef30d72a7e3abd38b517111ff461c5b177e72)) -- 项目重构-yaml 解析 ([6595ef8](https://github.com/terwer/src-sy-post-publisher/commit/6595ef8865c19f36884501222218d1c8123979b5)) -- 项目重构-优化构建脚本,修复错误 ([ff01c2a](https://github.com/terwer/src-sy-post-publisher/commit/ff01c2a8d16fdb874d90ad3507c257e0b240c4e2)) -- 项目重构-动态平台 ([b2d3a61](https://github.com/terwer/src-sy-post-publisher/commit/b2d3a616c855ea241fa5cbdce63787fb5103a7e9)) -- 项目重构-发布平台 api 整合 ([5dd04e4](https://github.com/terwer/src-sy-post-publisher/commit/5dd04e4a8a5d8fc2ad3b92557e027d1d4f86f2e0)) -- 项目重构-发布平台 api 重构 ([95bf6ac](https://github.com/terwer/src-sy-post-publisher/commit/95bf6ac464272c75957601924dd2e18ac0223f3a)) -- 项目重构-发布平台配置 ([8c88b01](https://github.com/terwer/src-sy-post-publisher/commit/8c88b0152c10c270d0f1bb08ed7a1289be57199a)) -- 项目重构-发布页面重构 ([9f8c750](https://github.com/terwer/src-sy-post-publisher/commit/9f8c750c7ab05ca84fe996789cda637cfd754322)) -- 项目重构-平台开关 ([ce6dd47](https://github.com/terwer/src-sy-post-publisher/commit/ce6dd4700d86045d298d257d08cf58eef69873d6)) -- 项目重构-平台开关优化 ([716a181](https://github.com/terwer/src-sy-post-publisher/commit/716a18151dceddcb6c5f3fe7526dce3d205de9ce)) -- 项目重构-挂件模式使用体验优化 ([88687cf](https://github.com/terwer/src-sy-post-publisher/commit/88687cf7ef07c60b93dd90fd2d28bac66f591898)) -- 项目重构-文章绑定 ([88bdcd5](https://github.com/terwer/src-sy-post-publisher/commit/88bdcd59fbef8b0159de6e8deb654e2b8d82c0a6)) -- 项目重构-日期和浏览器工具类 ([1674b8f](https://github.com/terwer/src-sy-post-publisher/commit/1674b8ff7b0c2081f36cd8bf8a287eb33d13f23c)) -- 项目重构-版本号与暗黑模式切换样式 ([d09634e](https://github.com/terwer/src-sy-post-publisher/commit/d09634e1ed88e1c835a1d2baac01b4eb286f314a)) -- 项目重构-语言设置 ([aeb3181](https://github.com/terwer/src-sy-post-publisher/commit/aeb3181268695fb0bc264db0eefea8603b915e22)) -- 项目重构-请求代理重构 ([8638e14](https://github.com/terwer/src-sy-post-publisher/commit/8638e1491acfde695ebd35fbfb72eb809e65d3ef)) -- 项目重构-调整 markdown 渲染库 ([8e1bf98](https://github.com/terwer/src-sy-post-publisher/commit/8e1bf9854f384bdfb922852a4cd8c1a3ff705b6a)) -- 项目重构-重构图片解析器 ([a0fd062](https://github.com/terwer/src-sy-post-publisher/commit/a0fd062af0c200f35b5fc5cbcd9649cb2ab860fd)) -- 项目重构-页面适配 ([043236d](https://github.com/terwer/src-sy-post-publisher/commit/043236d3162b09ff420700f9aa70e1b817d3e869)) \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 29ebfa54..00000000 --- a/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. \ No newline at end of file diff --git a/README.md b/README.md index 26a3f652..a51165da 100644 --- a/README.md +++ b/README.md @@ -1,145 +1,5 @@ [中文](README_zh_CN.md) -# Publisher +# siyuan-plugin-publisher -![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/plugins/publisher-main/public/icon.png) - -Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo, etc. - -Support features such as fast publishing, image bed management, platform expansion, smart labels, etc. - -This plugin promises that all functions will be free forever. If you want to support the developer, please [Donate](https://github.com/terwer/siyuan-plugin-publisher#Donate) freely. - -> 🌹Reminder: This plugin is an upgraded version of the original `Siyuan Notes Publishing Tool` widget. Its functions -> include all the functions provided by the original widget. It also provides a convenient menu operation entry, and has -> carried out a series of bug fixes and experience optimization. - -> If you want to see previous version, please refer to my original -> widget: [sy-post-publisher](https://github.com/terwer/src-sy-post-publisher) - -## Core Features - -- **Extremely fast release**: One-time configuration, one-click release -- **Picture bed management**: Integrate PicGO picture bed, support s3, minio, watermark plugin -- **Support for extensions**: Based on the unified blog API specification, built-in support for metaweblogAPI, WordPress - and Github, and provides a unified adapter, which can theoretically be extended to any platform -- **Platform switch**: All platforms support enabling and disabling, the blog garden is enabled by default, and can be - disabled at any time -- **Dynamic Newly Added**: Support custom adding platform -- **Smart Classification**: Support smart tags, smart slug aliases, smart summaries, and continue to improve -- **Article Binding**: Support linking existing platform articles to Siyuan Notes to facilitate follow-up management, - support Siyuan->platform one-way synchronization -- **Adapt to Theme**: Automatically adapt to dark mode and light mode -- **Language support**: multi-language support, support Chinese version and English version -- **Release view**: Support multiple release views, simple mode, detailed mode and source code mode -- **Multiple deployments**: support Siyuan notes plugin, Chrome browser extension, self-deployment - -## Platform List - -Names not listed in order - -- Cnblogs -- WordPress -- Yu Que -- Github - - Hexo - - Hugo - -## Platform Adaptation Plan - -If you have a platform you want to use, but this tool has not yet been implemented, you can submit -the [Siyuan Note Publishing Tool Plugin Platform Adaptation Tracking Form](https://terwergreen.feishu.cn/share/base/form/shrcnGRdThUiqnhBg15xgclMM0c%20) -, the developer will consider including it in the development plan. - -For platform adaptation, please refer -to [Latest Adaptation](https://terwergreen.feishu.cn/share/base/view/shrcnWT2IGIz1r94z9qvqUghDzd) - -## FAQ - -* Q1:How to install the publishing tool plugin? Where can I find his entrance after installation? - - A1:Find **`Bazaar->Plugins->Publishing Tools`** to download and enable. - - The installation process requires no further action. This is no different from the download and installation of other plugins. - - After the installation is complete, find the ✈️ icon on the top right toolbar, click the menu, and follow the corresponding instructions to use it. - -‍ - -* Q2:After installing the publishing tool plugin, do I still need to install the widget? - - A2:**unnecessary. ​** - - The plugin version contains all the functions of the widget version. - -‍ - -* Q3:I am not used to the operation of the new version, and I want to continue to use the previous widget through the plugin, is that possible? - - A3:**Yes.** - - The plugin has a builtin bridge by default, which can invoke the widget through the plugin. This feature needs to be turned on in `Settings -> Use Widget`​. - - Note 1: The plugin version uses the builtin menu of the plugin system, and the menu slot will be disabled when the widget version is activated via plugin. ​ - - Note 2: After opening the widget version, all functions of the plugin version will be disabled to avoid confusion. - - **We strongly recommend you to use the plugin version, because the plugin version will be the main version for long-term maintenance in the future, and the widget version is obsolete, and it is only used to fix problems and compatible with historical users.** - -‍ - -* Q4:I used to use `Custom JS Fragment`​ or add `Widget`​ directly, do I still need to download the plugin now? - - A4:**Optional.** But we highly recommended to remove JS snippets and widgets to download the plugin version. - - If you don't want to use the plugin version, you don't need to download it, just use the original `custom JS fragment`​ or add `widget`​ to continue using. - - If you want to use the plugin version, then we strongly recommend that you delete the previously added `custom JS snippets`​ and `widgets`​, download the plugin version directly, and enable it. No other additional action is required. - -‍ - -* Q5:Is it possible to migrate my historical configuration data items to the plugin? - -* A5:**Yes.** - - Please go to `Settings->Import and Export->Import the historical data of the widget version. ` Operation. - - Note: The widget version configuration data import only supports `sy-p-cfg-v0.8.0.json` and `picgo.json`. - -‍ - -* Q6:What should I do if the platform I need to publish is not provided by the publishing tool? -* A6:Reference: [Platform Adaptation Plan](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#platform-adaptation-plan "Platform Adaptation Plan") - - -## Donate - -If you approve of this project, invite me to have a cup of coffee, which will encourage me to keep updating and create -more useful tools~ - -### Wechat - -
-wechat -
- -### Alipay - -
-alipay -
- -# Thanks - -- Thanks to the third-party framework for supporting the bottom layer of this project - - Names not listed in order - - |Name|version|vendor| - | :---------: | :-----: | :---------: | - |turbo|1.9+|Vercel| - |vite|4.2+|Evan You| - |Svelte|3.57+|Rich Harris| - |TypeScript|5.0+|Microsoft| - |siyuan-note|2.9.0+|D,V| -- Thanks to [leolee9086](https://github.com/leolee9086) for the icon resource +Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo, etc. \ No newline at end of file diff --git a/README_zh_CN.md b/README_zh_CN.md index b4edc3e1..3339e077 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -1,134 +1,5 @@ [English](README.md) -# 发布工具 +# {{name}} -![](https://raw.githubusercontent.com/terwer/siyuan-plugin-publisher/main/plugins/publisher-main/public/icon.png) - -将思源笔记的文章发布到语雀、Cnblogs、WordPress、Typecho、Hexo、Hugo 等支持的开放平台,支持极速发布、图床管理、平台扩展、智能标签等特色功能。 - -本插件承诺,所有功能永久免费。如果您想支持开发者,请在这里 [随意打赏](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#捐赠)。 - -> 🌹 温馨提示:这个插件是原 `思源笔记发布工具` 挂件的插件升级版,功能包含原有挂件提供的所有功能,同时提供了方便的菜单操作入口,并进行了一系列问题修复和体验优化。 - -> 如果想看 `0.8.0` -> 之前的版本,请参考我之前写的的挂件:[sy-post-publisher](https://github.com/terwer/src-sy-post-publisher) - -## 核心特色 - -- **极速发布**:一次配置,一键发布 -- **图床管理**:集成 PicGO 图床,支持 s3、minio、水印插件 -- **支持扩展**:基于统一的博客 API 规范,内置 metaweblogAPI 、 WordPress 和 Github 支持,并提供了统一的适配器,理论上可支持扩展到任何平台 -- **平台开关**:所有平台均支持启用禁用,默认开启博客园,可随时禁用 -- **动态新增**:支持自定义添加平台 -- **智能分类**:支持智能标签、智能 slug 别名、智能摘要,并持续完善中 -- **文章绑定**:支持关联已有的平台文章到思源笔记,方便后续管理,支持思源-> 平台单向同步 -- **适应主题**:自动适配暗黑模式与浅色模式 -- **语言支持**:多语言支持,支持中文版和英文版 -- **发布视图**:支持多种发布视图,简单模式、详细模式和源码模式 -- **多种部署**:支持思源笔记插件、Chrome 浏览器扩展、自部署 - -## 平台列表 - -排名不分先后 - -- 博客园 -- WordPress -- 语雀 -- Github - - Hexo - - Hugo - -## 平台适配计划 - -如果你有想使用的平台,但是此工具目前还没实现,可在这里提交 [思源笔记发布工具插件平台适配跟踪表](https://terwergreen.feishu.cn/share/base/form/shrcnGRdThUiqnhBg15xgclMM0c) -,开发者会考虑列入开发计划中。 - -平台适配情况请查看请参考 [最新适配情况](https://terwergreen.feishu.cn/share/base/view/shrcnWT2IGIz1r94z9qvqUghDzd) - -## FAQ - -* Q1:发布工具插件怎么安装?安装之后在哪里找到他的入口? - - A1:找到 **`集市->插件->发布工具`** 下载启用即可。 - - 安装过程无需其他任何操作。这个跟其他插件的下载安装无任何区别。 - - 安装完成后,在顶部右侧工具栏找到 ✈️ 图标,点击菜单,按照对应说明操作使用即可。 - -‍ - -* Q2:装了发布工具插件之后,还需要安装挂件吗? - - A2:**不需要。** - - 插件版包含挂件版的所有功能。 - -‍ - -* Q3:我不习惯新版操作,想继续通过插件使用以前的挂件,可以吗? - - A3:**可以。** - - 插件默认内置了一个桥接器,可以通过插件唤起挂件。该功能需要在 `设置 -> 使用挂件版`​​ 开启。 - - 注意 1:插件版用插件系统内置的菜单,所有插件版唤起的时候菜单插槽会禁用。 - - 注意 2:开启挂件版之后会关闭插件版的所有功能,避免引起混淆。 - - **我们强烈推荐您使用插件版,因为插件版将是以后长久维护的主要版本,挂架版本已废弃,仅作为修复问题以及兼容历史用户。** - -‍ - -* Q4:我以前是通过 `自定义JS片段 ​`​​ 或者 直接添加 `挂件`​​ 来使用的,现在还需要下载该插件吗? - - A4:**可选。** 但是我们强烈推荐您删除 JS 片段和挂件,下载插件版使用。 - - 如果您不想使用插件版,那么您无需下载,使用原有 `自定义 JS 片段`​​ 或者 添加 `挂件`​​ 继续使用即可。 - - 如果您想使用插件版,那么我们强烈建议您删除之前添加的 `自定义JS片段`​​ 和 `挂件`​​,直接下载插件版,启用即可。无需其他额外操作。 - -‍ - -* Q5:我的历史配置数据项迁移到插件,可以吗? -* A5:**可以。** - - 请在 `设置->导入导出->导入挂件版历史数据。` 操作。 - - 注意:挂件版配置数据导入仅支持 `sy-p-cfg-v0.8.0.json` 和 `picgo.json` 。 - -‍ - -* Q6:我需要发布的平台,发布工具没有提供怎么办? -* A6:参考:[平台适配计划](https://github.com/terwer/siyuan-plugin-publisher/blob/main/README_zh_CN.md#平台适配计划 "平台适配计划")​ - -## 捐赠 - -如果您认可这个项目,请我喝一杯咖啡吧,这将鼓励我持续更新,并创作出更多好用的工具~ - -### 微信 - -
-wechat -
- -### 支付宝 - -
-alipay -
- -# 感谢 - -* 感谢第三方框架对本项目底层的支持 - - 排名不分先后 - - |Name|version|vendor| - | :---------: | :-----: | :---------: | - |turbo|1.9+|Vercel| - |vite|4.2+|Evan You| - |Svelte|3.57+|Rich Harris| - |TypeScript|5.0+|Microsoft| - |siyuan-note|2.9.0+|D,V| - -* 感谢 [leolee9086](https://github.com/leolee9086) 提供的图标资源 \ No newline at end of file +{{description}} \ No newline at end of file diff --git a/icon.png b/icon.png index c35702c5..47d51af4 100644 Binary files a/icon.png and b/icon.png differ diff --git a/src/index.styl b/index.styl similarity index 97% rename from src/index.styl rename to index.styl index 024d4778..4339c5d5 100644 --- a/src/index.styl +++ b/index.styl @@ -27,9 +27,9 @@ // 建议使用 iconfont ,可以调色,可以调整大小 // https://fontawesome.com/search?q=yuque&o=r&m=free // https://www.iconfont.cn/search/index?searchType=icon&q=cnblogs&page=1&tag=&fromCollection=1&fills= -.pt-icon{ +.iconfont-icon{ width 12px height 12px margin-right 10px - margin-top 3px -} + margin-top 0 +} \ No newline at end of file diff --git a/package.json b/package.json index 805ba727..83fdf5fb 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "siyuan-plugin-importer", - "version": "0.8.0", + "name": "siyuan-plugin-publisher", + "version": "0.0.1", "type": "module", - "description": "Import from epub, docx, html etc. to siyuan-note", - "repository": "terwer/siyuan-plugin-importer", - "homepage": "https://github.com/terwer/siyuan-plugin-importer", + "description": "Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo, etc.", + "repository": "terwer/siyuan-plugin-publisher", + "homepage": "https://github.com/terwer/siyuan-plugin-publisher", "author": "terwer", "license": "MIT", "scripts": { @@ -21,21 +21,13 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^2.0.3", "@terwer/eslint-config-custom": "^1.2.0", - "@terwer/vite-config-custom": "^0.6.0", + "@terwer/vite-config-custom": "^0.5.0", "@tsconfig/svelte": "^4.0.1", - "@types/node": "16", - "fast-glob": "^3.2.12", - "glob": "^7.2.3", - "minimist": "^1.2.8", - "rollup-plugin-livereload": "^2.0.5", - "siyuan": "^0.7.1", + "siyuan": "^0.7.2", "stylus": "^0.59.0", - "svelte": "^3.57.0", - "svelte-routing": "^1.8.9", - "ts-node": "^10.9.1", - "vite": "^4.3.7", - "vite-plugin-dynamic-import": "^1.4.0", - "vite-plugin-static-copy": "^0.15.0", - "vitest": "^0.31.1" + "svelte": "^3.57.0" + }, + "dependencies": { + "zhi-lib-base": "^0.1.0" } } diff --git a/plugin.json b/plugin.json index a07ca6bc..a5869872 100644 --- a/plugin.json +++ b/plugin.json @@ -1,15 +1,15 @@ { - "name": "siyuan-publisher", + "name": "demo", "author": "terwer", - "url": "https://github.com/terwer/siyuan-plugin-publisher", - "version": "0.8.0", + "url": "https://github.com/terwer/siyuan-plugin-demo", + "version": "0.0.1", "displayName": { - "default": "Publisher", - "zh_CN": "发布工具" + "default": "Demo", + "zh_CN": "示例" }, "description": { - "default": "Publishing articles from siyuan-note to platforms such as Yuque, Cnblogs, WordPress, Typecho, Hexo, Hugo, etc.", - "zh_CN": "将思源笔记的文章发布到语雀、博客园、WordPress、Typecho、Hexo、Hugo等平台,支持极速发布、图床管理、平台扩展、智能标签等特色功能" + "default": "This a demo plugin project", + "zh_CN": "这是一个示例插件项目" }, "readme": { "default": "README.md", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8658cac3..a8214a3c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,60 +1,36 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + zhi-lib-base: + specifier: ^0.1.0 + version: 0.1.0 devDependencies: '@sveltejs/vite-plugin-svelte': specifier: ^2.0.3 - version: 2.0.3(svelte@3.57.0)(vite@4.3.7) + version: 2.0.3(svelte@3.57.0)(vite@4.3.9) '@terwer/eslint-config-custom': specifier: ^1.2.0 - version: 1.2.0(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.59.6)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.8.0)(eslint-config-turbo@1.9.6)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.28.0)(eslint-plugin-vue@9.13.0)(eslint@8.40.0)(prettier-plugin-svelte@2.10.0)(prettier@2.8.8)(typescript@5.0.4) + version: 1.2.0(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.59.8)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.8.0)(eslint-config-turbo@1.10.1)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.30.0)(eslint-plugin-vue@9.14.1)(eslint@8.42.0)(prettier-plugin-svelte@2.10.1)(prettier@2.8.8)(typescript@5.1.3) '@terwer/vite-config-custom': - specifier: ^0.6.0 - version: 0.6.0(@types/minimist@1.2.2)(jsdom@22.0.0)(minimist@1.2.8)(rollup-plugin-livereload@2.0.5)(tslib@2.5.0)(typescript@5.0.4)(vite-plugin-css-injected-by-js@3.1.1)(vite-plugin-dts@2.3.0)(vite-plugin-no-bundle@2.0.2)(vite-plugin-static-copy@0.15.0)(vite-tsconfig-paths@4.2.0)(vite@4.3.7)(vitest@0.31.1) + specifier: ^0.5.0 + version: 0.5.0(jsdom@22.1.0)(minimist@1.2.8)(rollup-plugin-livereload@2.0.5)(tslib@2.5.3)(typescript@5.1.3)(vite-plugin-css-injected-by-js@3.1.1)(vite-plugin-dts@2.3.0)(vite-plugin-no-bundle@2.0.2)(vite-plugin-static-copy@0.15.0)(vite-tsconfig-paths@4.2.0)(vite@4.3.9)(vitest@0.31.4) '@tsconfig/svelte': specifier: ^4.0.1 version: 4.0.1 - '@types/node': - specifier: '16' - version: 16.0.0 - fast-glob: - specifier: ^3.2.12 - version: 3.2.12 - glob: - specifier: ^7.2.3 - version: 7.2.3 - minimist: - specifier: ^1.2.8 - version: 1.2.8 - rollup-plugin-livereload: - specifier: ^2.0.5 - version: 2.0.5 siyuan: - specifier: ^0.7.1 - version: 0.7.1 + specifier: ^0.7.2 + version: 0.7.2 stylus: specifier: ^0.59.0 version: 0.59.0 svelte: specifier: ^3.57.0 version: 3.57.0 - svelte-routing: - specifier: ^1.8.9 - version: 1.8.9 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@16.0.0)(typescript@5.0.4) - vite: - specifier: ^4.3.7 - version: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) - vite-plugin-dynamic-import: - specifier: ^1.4.0 - version: 1.4.0 - vite-plugin-static-copy: - specifier: ^0.15.0 - version: 0.15.0(vite@4.3.7) - vitest: - specifier: ^0.31.1 - version: 0.31.1(jsdom@22.0.0)(stylus@0.59.0) packages: @@ -62,8 +38,8 @@ packages: resolution: {integrity: sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==} dev: true - /@astrojs/compiler@1.4.2: - resolution: {integrity: sha512-xoRp7JpiMZPK/beUcZEM5kM44Z/h20wwwQcl54duPqQMyySG9vZ5xMM6dYiQmn7b3XzpZs0cT6TRDoJJ5gwHAQ==} + /@astrojs/compiler@1.5.0: + resolution: {integrity: sha512-k04X/7nlMklU0HQUScxbCTf5n8/Vr+0U0bawb9QWulWxd6qJf3FmBrNATgTYiltjB4pc5HBqmmttAfFi7m4lLg==} dev: true /@babel/helper-string-parser@7.21.5: @@ -76,16 +52,16 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/parser@7.21.8: - resolution: {integrity: sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==} + /@babel/parser@7.22.4: + resolution: {integrity: sha512-VLLsx06XkEYqBtE5YGPwfSGwfrjnyPP5oiGty3S8pQLFDFLaS8VwWSIxkTXpcvr5zeYLE6+MBNl2npl/YnfofA==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.22.4 dev: true - /@babel/types@7.21.5: - resolution: {integrity: sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==} + /@babel/types@7.22.4: + resolution: {integrity: sha512-Tx9x3UBHTTsMSW85WB2kphxYQVvrZ/t1FxD88IpSgIjiUJlCm9z+xWIDwyo1vffTwSqteqyznB8ZE9vYYk16zA==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.21.5 @@ -93,13 +69,6 @@ packages: to-fast-properties: 2.0.0 dev: true - /@cspotcode/source-map-support@0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - dev: true - /@esbuild/android-arm64@0.17.19: resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} engines: {node: '>=12'} @@ -298,13 +267,13 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.40.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.42.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.40.0 + eslint: 8.42.0 eslint-visitor-keys: 3.4.1 dev: true @@ -330,13 +299,13 @@ packages: - supports-color dev: true - /@eslint/js@8.40.0: - resolution: {integrity: sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==} + /@eslint/js@8.42.0: + resolution: {integrity: sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@humanwhocodes/config-array@0.11.8: - resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} + /@humanwhocodes/config-array@0.11.10: + resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -355,48 +324,36 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true - /@jridgewell/resolve-uri@3.1.1: - resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} - engines: {node: '>=6.0.0'} - dev: true - /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - - /@microsoft/api-extractor-model@7.26.9(@types/node@16.0.0): - resolution: {integrity: sha512-1AowqcRy5qMH/OB7UNkdXa4qLoJp58WFdJ026IMFS8skA0OOAOcvBV/Fi4L7fO1R/8uCMz5KHi3NsqVH4Li8xg==} + /@microsoft/api-extractor-model@7.27.1: + resolution: {integrity: sha512-WgmuQwElTuRLATQxCx+pqk5FtUeRX3FW8WDo7tSDmrN/7+XAggeVg5t8ItiJt688jEdbiPvagZlvjAcJMpXspg==} dependencies: '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.0(@types/node@16.0.0) + '@rushstack/node-core-library': 3.59.2 transitivePeerDependencies: - '@types/node' dev: true - /@microsoft/api-extractor@7.34.9(@types/node@16.0.0): - resolution: {integrity: sha512-dasBIbqgHgxvfRfEOX4+ynNYQPnTYc6k7jkL3V4f/MoaS2xFUoIj/D71crrsDxf5MNMybjzeyZPdRNZdzvKBVw==} + /@microsoft/api-extractor@7.35.1: + resolution: {integrity: sha512-xGVf1lKCYKEyJsspLzQjo4Oo6PGDPH95Z5/te75xQWpcRHcfemb6zTSPtiFeVDHkg9Tan5HW2QXGLwQRkW199w==} hasBin: true dependencies: - '@microsoft/api-extractor-model': 7.26.9(@types/node@16.0.0) + '@microsoft/api-extractor-model': 7.27.1 '@microsoft/tsdoc': 0.14.2 '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.0(@types/node@16.0.0) - '@rushstack/rig-package': 0.3.18 - '@rushstack/ts-command-line': 4.13.2 + '@rushstack/node-core-library': 3.59.2 + '@rushstack/rig-package': 0.3.19 + '@rushstack/ts-command-line': 4.13.3 colors: 1.2.5 lodash: 4.17.21 resolve: 1.22.2 semver: 7.3.8 source-map: 0.6.1 - typescript: 4.8.4 + typescript: 5.0.4 transitivePeerDependencies: - '@types/node' dev: true @@ -435,23 +392,23 @@ packages: fastq: 1.15.0 dev: true - /@nuxt/eslint-config@0.1.1(eslint@8.40.0): + /@nuxt/eslint-config@0.1.1(eslint@8.42.0): resolution: {integrity: sha512-znm1xlbhldUubB2XGx6Ca5uarwlIieKf0o8CtxtF6eEauDbpa3T2p3JnTcdguMW2nj1YPneoGmhshANfOlghiQ==} peerDependencies: eslint: ^8.29.0 dependencies: - '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/eslint-plugin': 5.59.6(@typescript-eslint/parser@5.59.6)(eslint@8.40.0)(typescript@4.9.5) - '@typescript-eslint/parser': 5.59.6(eslint@8.40.0)(typescript@4.9.5) - eslint: 8.40.0 - eslint-plugin-vue: 9.13.0(eslint@8.40.0) + '@rushstack/eslint-patch': 1.3.0 + '@typescript-eslint/eslint-plugin': 5.59.8(@typescript-eslint/parser@5.59.8)(eslint@8.42.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.59.8(eslint@8.42.0)(typescript@4.9.5) + eslint: 8.42.0 + eslint-plugin-vue: 9.14.1(eslint@8.42.0) typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true - /@pkgr/utils@2.4.0: - resolution: {integrity: sha512-2OCURAmRtdlL8iUDTypMrrxfwe8frXTeXaxGsVOaYtc/wrUyk8Z/0OBetM7cdlsy7ZFWlMX72VogKeh+A4Xcjw==} + /@pkgr/utils@2.4.1: + resolution: {integrity: sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dependencies: cross-spawn: 7.0.3 @@ -459,7 +416,7 @@ packages: is-glob: 4.0.3 open: 9.1.0 picocolors: 1.0.0 - tslib: 2.5.0 + tslib: 2.5.3 dev: true /@rollup/pluginutils@5.0.2: @@ -476,19 +433,18 @@ packages: picomatch: 2.3.1 dev: true - /@rushstack/eslint-patch@1.2.0: - resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} + /@rushstack/eslint-patch@1.3.0: + resolution: {integrity: sha512-IthPJsJR85GhOkp3Hvp8zFOPK5ynKn6STyHa/WZpioK7E1aYDiBzpqQPrngc14DszIUkIrdd3k9Iu0XSzlP/1w==} dev: true - /@rushstack/node-core-library@3.59.0(@types/node@16.0.0): - resolution: {integrity: sha512-f8ilzooAu8vj60dDe7weqHvR1NujOaKfe3TaNgAoT22rk+daUTmDtY3TlVGJ3HayVPmw3ffWToDatITi7Ic4ag==} + /@rushstack/node-core-library@3.59.2: + resolution: {integrity: sha512-Od8i9ZXiRPHrnkuNOZ9IjEYRQ9JsBLNHlkWJr1wSQZrD2TVIc8APpIB/FnzEcjfpbJMT4XhtcCZaa0pVx+hTXw==} peerDependencies: '@types/node': '*' peerDependenciesMeta: '@types/node': optional: true dependencies: - '@types/node': 16.0.0 colors: 1.2.5 fs-extra: 7.0.1 import-lazy: 4.0.0 @@ -498,15 +454,15 @@ packages: z-schema: 5.0.5 dev: true - /@rushstack/rig-package@0.3.18: - resolution: {integrity: sha512-SGEwNTwNq9bI3pkdd01yCaH+gAsHqs0uxfGvtw9b0LJXH52qooWXnrFTRRLG1aL9pf+M2CARdrA9HLHJys3jiQ==} + /@rushstack/rig-package@0.3.19: + resolution: {integrity: sha512-2d0/Gn+qjOYneZbiHjn4SjyDwq9I0WagV37z0F1V71G+yONgH7wlt3K/UoNiDkhA8gTHYPRo2jz3CvttybwSag==} dependencies: resolve: 1.22.2 strip-json-comments: 3.1.1 dev: true - /@rushstack/ts-command-line@4.13.2: - resolution: {integrity: sha512-bCU8qoL9HyWiciltfzg7GqdfODUeda/JpI0602kbN5YH22rzTxyqYvv7aRLENCM7XCQ1VRs7nMkEqgJUOU8Sag==} + /@rushstack/ts-command-line@4.13.3: + resolution: {integrity: sha512-6aQIv/o1EgsC/+SpgUyRmzg2QIAL6sudEzw3sWzJKwWuQTc5XRsyZpyldfE7WAmIqMXDao9QG35/NYORjHm5Zw==} dependencies: '@types/argparse': 1.0.38 argparse: 1.0.10 @@ -514,7 +470,7 @@ packages: string-argv: 0.3.2 dev: true - /@sveltejs/vite-plugin-svelte@2.0.3(svelte@3.57.0)(vite@4.3.7): + /@sveltejs/vite-plugin-svelte@2.0.3(svelte@3.57.0)(vite@4.3.9): resolution: {integrity: sha512-o+cguBFdwIGtRbNkYOyqTM7KvRUffxh5bfK4oJsWKG2obu+v/cbpT03tJrGl58C7tRXo/aEC0/axN5FVHBj0nA==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -526,14 +482,14 @@ packages: kleur: 4.1.5 magic-string: 0.29.0 svelte: 3.57.0 - svelte-hmr: 0.15.1(svelte@3.57.0) - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) - vitefu: 0.2.4(vite@4.3.7) + svelte-hmr: 0.15.2(svelte@3.57.0) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) + vitefu: 0.2.4(vite@4.3.9) transitivePeerDependencies: - supports-color dev: true - /@terwer/eslint-config-custom@1.2.0(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.59.6)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.8.0)(eslint-config-turbo@1.9.6)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.28.0)(eslint-plugin-vue@9.13.0)(eslint@8.40.0)(prettier-plugin-svelte@2.10.0)(prettier@2.8.8)(typescript@5.0.4): + /@terwer/eslint-config-custom@1.2.0(@nuxt/eslint-config@0.1.1)(@typescript-eslint/eslint-plugin@5.59.8)(astro-eslint-parser@0.13.3)(eslint-config-prettier@8.8.0)(eslint-config-turbo@1.10.1)(eslint-plugin-prettier@4.2.1)(eslint-plugin-svelte@2.30.0)(eslint-plugin-vue@9.14.1)(eslint@8.42.0)(prettier-plugin-svelte@2.10.1)(prettier@2.8.8)(typescript@5.1.3): resolution: {integrity: sha512-gygsswnGgCsYvhEsLNgdjA8DZidzWFj6i8sfGJYzOEk2Bwc1o7dteis5e5+LBIeQhEPHuvKGUiaSfcqdNL8qIA==} peerDependencies: '@nuxt/eslint-config': ^0.1.1 @@ -549,24 +505,23 @@ packages: prettier-plugin-svelte: ^2.10.0 typescript: ^5.0.4 dependencies: - '@nuxt/eslint-config': 0.1.1(eslint@8.40.0) - '@typescript-eslint/eslint-plugin': 5.59.6(@typescript-eslint/parser@5.59.6)(eslint@8.40.0)(typescript@5.0.4) + '@nuxt/eslint-config': 0.1.1(eslint@8.42.0) + '@typescript-eslint/eslint-plugin': 5.59.8(@typescript-eslint/parser@5.59.8)(eslint@8.42.0)(typescript@5.1.3) astro-eslint-parser: 0.13.3 - eslint: 8.40.0 - eslint-config-prettier: 8.8.0(eslint@8.40.0) - eslint-config-turbo: 1.9.6(eslint@8.40.0) - eslint-plugin-prettier: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.40.0)(prettier@2.8.8) - eslint-plugin-svelte: 2.28.0(eslint@8.40.0)(svelte@3.57.0)(ts-node@10.9.1) - eslint-plugin-vue: 9.13.0(eslint@8.40.0) + eslint: 8.42.0 + eslint-config-prettier: 8.8.0(eslint@8.42.0) + eslint-config-turbo: 1.10.1(eslint@8.42.0) + eslint-plugin-prettier: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.42.0)(prettier@2.8.8) + eslint-plugin-svelte: 2.30.0(eslint@8.42.0)(svelte@3.57.0) + eslint-plugin-vue: 9.14.1(eslint@8.42.0) prettier: 2.8.8 - prettier-plugin-svelte: 2.10.0(prettier@2.8.8)(svelte@3.57.0) - typescript: 5.0.4 + prettier-plugin-svelte: 2.10.1(prettier@2.8.8)(svelte@3.57.0) + typescript: 5.1.3 dev: true - /@terwer/vite-config-custom@0.6.0(@types/minimist@1.2.2)(jsdom@22.0.0)(minimist@1.2.8)(rollup-plugin-livereload@2.0.5)(tslib@2.5.0)(typescript@5.0.4)(vite-plugin-css-injected-by-js@3.1.1)(vite-plugin-dts@2.3.0)(vite-plugin-no-bundle@2.0.2)(vite-plugin-static-copy@0.15.0)(vite-tsconfig-paths@4.2.0)(vite@4.3.7)(vitest@0.31.1): - resolution: {integrity: sha512-2ZykymbEIpnWmWt6Alw2zGeTDuW+cbKkVyuHXOW4w/MvX11STxWy7YoL6jM3kqpk78iMGvcvcSNcPfxGcw77oQ==} + /@terwer/vite-config-custom@0.5.0(jsdom@22.1.0)(minimist@1.2.8)(rollup-plugin-livereload@2.0.5)(tslib@2.5.3)(typescript@5.1.3)(vite-plugin-css-injected-by-js@3.1.1)(vite-plugin-dts@2.3.0)(vite-plugin-no-bundle@2.0.2)(vite-plugin-static-copy@0.15.0)(vite-tsconfig-paths@4.2.0)(vite@4.3.9)(vitest@0.31.4): + resolution: {integrity: sha512-92CrNpu147xR/1gSVB9z7GZEyApoq6ZTgRoE18/AHVYpfkeNqHPmHdaX7rEwJTs1KxlDIP5m46BBS9JTF6DO3g==} peerDependencies: - '@types/minimist': 1.2.2 jsdom: ^22.0.0 minimist: ^1.2.8 rollup-plugin-livereload: ^2.0.5 @@ -580,19 +535,18 @@ packages: vite-tsconfig-paths: ^4.2.0 vitest: ^0.31.0 dependencies: - '@types/minimist': 1.2.2 - jsdom: 22.0.0 + jsdom: 22.1.0 minimist: 1.2.8 rollup-plugin-livereload: 2.0.5 - tslib: 2.5.0 - typescript: 5.0.4 - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) - vite-plugin-css-injected-by-js: 3.1.1(vite@4.3.7) - vite-plugin-dts: 2.3.0(@types/node@16.0.0)(vite@4.3.7) + tslib: 2.5.3 + typescript: 5.1.3 + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) + vite-plugin-css-injected-by-js: 3.1.1(vite@4.3.9) + vite-plugin-dts: 2.3.0(vite@4.3.9) vite-plugin-no-bundle: 2.0.2 - vite-plugin-static-copy: 0.15.0(vite@4.3.7) - vite-tsconfig-paths: 4.2.0(typescript@5.0.4)(vite@4.3.7) - vitest: 0.31.1(jsdom@22.0.0)(stylus@0.59.0) + vite-plugin-static-copy: 0.15.0(vite@4.3.9) + vite-tsconfig-paths: 4.2.0(typescript@5.1.3)(vite@4.3.9) + vitest: 0.31.4(jsdom@22.1.0)(stylus@0.59.0) dev: true /@tootallnate/once@2.0.0: @@ -609,22 +563,6 @@ packages: path-browserify: 1.0.1 dev: true - /@tsconfig/node10@1.0.9: - resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} - dev: true - - /@tsconfig/node12@1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - dev: true - - /@tsconfig/node14@1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - dev: true - - /@tsconfig/node16@1.0.4: - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - dev: true - /@tsconfig/svelte@4.0.1: resolution: {integrity: sha512-B+XlGpmuAQzJqDoBATNCvEPqQg0HkO7S8pM14QDI5NsmtymzRexQ1N+nX2H6RTtFbuFgaZD4I8AAi8voGg0GLg==} dev: true @@ -647,24 +585,20 @@ packages: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} dev: true - /@types/json-schema@7.0.11: - resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} - dev: true - - /@types/minimist@1.2.2: - resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} + /@types/json-schema@7.0.12: + resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} dev: true - /@types/node@16.0.0: - resolution: {integrity: sha512-TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSdg==} + /@types/node@20.2.5: + resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==} dev: true /@types/semver@7.5.0: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true - /@typescript-eslint/eslint-plugin@5.59.6(@typescript-eslint/parser@5.59.6)(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw==} + /@typescript-eslint/eslint-plugin@5.59.8(@typescript-eslint/parser@5.59.8)(eslint@8.42.0)(typescript@4.9.5): + resolution: {integrity: sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -675,12 +609,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.6(eslint@8.40.0)(typescript@4.9.5) - '@typescript-eslint/scope-manager': 5.59.6 - '@typescript-eslint/type-utils': 5.59.6(eslint@8.40.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.59.6(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.59.8(eslint@8.42.0)(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.59.8 + '@typescript-eslint/type-utils': 5.59.8(eslint@8.42.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.59.8(eslint@8.42.0)(typescript@4.9.5) debug: 4.3.4 - eslint: 8.40.0 + eslint: 8.42.0 grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 @@ -691,8 +625,8 @@ packages: - supports-color dev: true - /@typescript-eslint/eslint-plugin@5.59.6(@typescript-eslint/parser@5.59.6)(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-sXtOgJNEuRU5RLwPUb1jxtToZbgvq3M6FPpY4QENxoOggK+UpTxUBpj6tD8+Qh2g46Pi9We87E+eHnUw8YcGsw==} + /@typescript-eslint/eslint-plugin@5.59.8(@typescript-eslint/parser@5.59.8)(eslint@8.42.0)(typescript@5.1.3): + resolution: {integrity: sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -703,24 +637,24 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.6(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/scope-manager': 5.59.6 - '@typescript-eslint/type-utils': 5.59.6(eslint@8.40.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.6(eslint@8.40.0)(typescript@5.0.4) + '@typescript-eslint/parser': 5.59.8(eslint@8.42.0)(typescript@5.1.3) + '@typescript-eslint/scope-manager': 5.59.8 + '@typescript-eslint/type-utils': 5.59.8(eslint@8.42.0)(typescript@5.1.3) + '@typescript-eslint/utils': 5.59.8(eslint@8.42.0)(typescript@5.1.3) debug: 4.3.4 - eslint: 8.40.0 + eslint: 8.42.0 grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 semver: 7.5.1 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + tsutils: 3.21.0(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.59.6(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==} + /@typescript-eslint/parser@5.59.8(eslint@8.42.0)(typescript@4.9.5): + resolution: {integrity: sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -729,18 +663,18 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.59.6 - '@typescript-eslint/types': 5.59.6 - '@typescript-eslint/typescript-estree': 5.59.6(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.59.8 + '@typescript-eslint/types': 5.59.8 + '@typescript-eslint/typescript-estree': 5.59.8(typescript@4.9.5) debug: 4.3.4 - eslint: 8.40.0 + eslint: 8.42.0 typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.59.6(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-7pCa6al03Pv1yf/dUg/s1pXz/yGMUBAw5EeWqNTFiSueKvRNonze3hma3lhdsOrQcaOXhbk5gKu2Fludiho9VA==} + /@typescript-eslint/parser@5.59.8(eslint@8.42.0)(typescript@5.1.3): + resolution: {integrity: sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -749,26 +683,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.59.6 - '@typescript-eslint/types': 5.59.6 - '@typescript-eslint/typescript-estree': 5.59.6(typescript@5.0.4) + '@typescript-eslint/scope-manager': 5.59.8 + '@typescript-eslint/types': 5.59.8 + '@typescript-eslint/typescript-estree': 5.59.8(typescript@5.1.3) debug: 4.3.4 - eslint: 8.40.0 - typescript: 5.0.4 + eslint: 8.42.0 + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@5.59.6: - resolution: {integrity: sha512-gLbY3Le9Dxcb8KdpF0+SJr6EQ+hFGYFl6tVY8VxLPFDfUZC7BHFw+Vq7bM5lE9DwWPfx4vMWWTLGXgpc0mAYyQ==} + /@typescript-eslint/scope-manager@5.59.8: + resolution: {integrity: sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.6 - '@typescript-eslint/visitor-keys': 5.59.6 + '@typescript-eslint/types': 5.59.8 + '@typescript-eslint/visitor-keys': 5.59.8 dev: true - /@typescript-eslint/type-utils@5.59.6(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ==} + /@typescript-eslint/type-utils@5.59.8(eslint@8.42.0)(typescript@4.9.5): + resolution: {integrity: sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -777,18 +711,18 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.59.6(typescript@4.9.5) - '@typescript-eslint/utils': 5.59.6(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 5.59.8(typescript@4.9.5) + '@typescript-eslint/utils': 5.59.8(eslint@8.42.0)(typescript@4.9.5) debug: 4.3.4 - eslint: 8.40.0 + eslint: 8.42.0 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/type-utils@5.59.6(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-A4tms2Mp5yNvLDlySF+kAThV9VTBPCvGf0Rp8nl/eoDX9Okun8byTKoj3fJ52IJitjWOk0fKPNQhXEB++eNozQ==} + /@typescript-eslint/type-utils@5.59.8(eslint@8.42.0)(typescript@5.1.3): + resolution: {integrity: sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -797,23 +731,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.59.6(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.6(eslint@8.40.0)(typescript@5.0.4) + '@typescript-eslint/typescript-estree': 5.59.8(typescript@5.1.3) + '@typescript-eslint/utils': 5.59.8(eslint@8.42.0)(typescript@5.1.3) debug: 4.3.4 - eslint: 8.40.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + eslint: 8.42.0 + tsutils: 3.21.0(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types@5.59.6: - resolution: {integrity: sha512-tH5lBXZI7T2MOUgOWFdVNUILsI02shyQvfzG9EJkoONWugCG77NDDa1EeDGw7oJ5IvsTAAGVV8I3Tk2PNu9QfA==} + /@typescript-eslint/types@5.59.8: + resolution: {integrity: sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@5.59.6(typescript@4.9.5): - resolution: {integrity: sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA==} + /@typescript-eslint/typescript-estree@5.59.8(typescript@4.9.5): + resolution: {integrity: sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -821,8 +755,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.59.6 - '@typescript-eslint/visitor-keys': 5.59.6 + '@typescript-eslint/types': 5.59.8 + '@typescript-eslint/visitor-keys': 5.59.8 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -833,8 +767,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@5.59.6(typescript@5.0.4): - resolution: {integrity: sha512-vW6JP3lMAs/Tq4KjdI/RiHaaJSO7IUsbkz17it/Rl9Q+WkQ77EOuOnlbaU8kKfVIOJxMhnRiBG+olE7f3M16DA==} + /@typescript-eslint/typescript-estree@5.59.8(typescript@5.1.3): + resolution: {integrity: sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -842,31 +776,31 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.59.6 - '@typescript-eslint/visitor-keys': 5.59.6 + '@typescript-eslint/types': 5.59.8 + '@typescript-eslint/visitor-keys': 5.59.8 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.1 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + tsutils: 3.21.0(typescript@5.1.3) + typescript: 5.1.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.59.6(eslint@8.40.0)(typescript@4.9.5): - resolution: {integrity: sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg==} + /@typescript-eslint/utils@5.59.8(eslint@8.42.0)(typescript@4.9.5): + resolution: {integrity: sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@types/json-schema': 7.0.11 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) + '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.6 - '@typescript-eslint/types': 5.59.6 - '@typescript-eslint/typescript-estree': 5.59.6(typescript@4.9.5) - eslint: 8.40.0 + '@typescript-eslint/scope-manager': 5.59.8 + '@typescript-eslint/types': 5.59.8 + '@typescript-eslint/typescript-estree': 5.59.8(typescript@4.9.5) + eslint: 8.42.0 eslint-scope: 5.1.1 semver: 7.5.1 transitivePeerDependencies: @@ -874,19 +808,19 @@ packages: - typescript dev: true - /@typescript-eslint/utils@5.59.6(eslint@8.40.0)(typescript@5.0.4): - resolution: {integrity: sha512-vzaaD6EXbTS29cVH0JjXBdzMt6VBlv+hE31XktDRMX1j3462wZCJa7VzO2AxXEXcIl8GQqZPcOPuW/Z1tZVogg==} + /@typescript-eslint/utils@5.59.8(eslint@8.42.0)(typescript@5.1.3): + resolution: {integrity: sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - '@types/json-schema': 7.0.11 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) + '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.6 - '@typescript-eslint/types': 5.59.6 - '@typescript-eslint/typescript-estree': 5.59.6(typescript@5.0.4) - eslint: 8.40.0 + '@typescript-eslint/scope-manager': 5.59.8 + '@typescript-eslint/types': 5.59.8 + '@typescript-eslint/typescript-estree': 5.59.8(typescript@5.1.3) + eslint: 8.42.0 eslint-scope: 5.1.1 semver: 7.5.1 transitivePeerDependencies: @@ -894,47 +828,47 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@5.59.6: - resolution: {integrity: sha512-zEfbFLzB9ETcEJ4HZEEsCR9HHeNku5/Qw1jSS5McYJv5BR+ftYXwFFAH5Al+xkGaZEqowMwl7uoJjQb1YSPF8Q==} + /@typescript-eslint/visitor-keys@5.59.8: + resolution: {integrity: sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.6 + '@typescript-eslint/types': 5.59.8 eslint-visitor-keys: 3.4.1 dev: true - /@vitest/expect@0.31.1: - resolution: {integrity: sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==} + /@vitest/expect@0.31.4: + resolution: {integrity: sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg==} dependencies: - '@vitest/spy': 0.31.1 - '@vitest/utils': 0.31.1 + '@vitest/spy': 0.31.4 + '@vitest/utils': 0.31.4 chai: 4.3.7 dev: true - /@vitest/runner@0.31.1: - resolution: {integrity: sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==} + /@vitest/runner@0.31.4: + resolution: {integrity: sha512-Wgm6UER+gwq6zkyrm5/wbpXGF+g+UBB78asJlFkIOwyse0pz8lZoiC6SW5i4gPnls/zUcPLWS7Zog0LVepXnpg==} dependencies: - '@vitest/utils': 0.31.1 + '@vitest/utils': 0.31.4 concordance: 5.0.4 p-limit: 4.0.0 - pathe: 1.1.0 + pathe: 1.1.1 dev: true - /@vitest/snapshot@0.31.1: - resolution: {integrity: sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==} + /@vitest/snapshot@0.31.4: + resolution: {integrity: sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==} dependencies: magic-string: 0.30.0 - pathe: 1.1.0 + pathe: 1.1.1 pretty-format: 27.5.1 dev: true - /@vitest/spy@0.31.1: - resolution: {integrity: sha512-1cTpt2m9mdo3hRLDyCG2hDQvRrePTDgEJBFQQNz1ydHHZy03EiA6EpFxY+7ODaY7vMRCie+WlFZBZ0/dQWyssQ==} + /@vitest/spy@0.31.4: + resolution: {integrity: sha512-3ei5ZH1s3aqbEyftPAzSuunGICRuhE+IXOmpURFdkm5ybUADk+viyQfejNk6q8M5QGX8/EVKw+QWMEP3DTJDag==} dependencies: - tinyspy: 2.1.0 + tinyspy: 2.1.1 dev: true - /@vitest/utils@0.31.1: - resolution: {integrity: sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==} + /@vitest/utils@0.31.4: + resolution: {integrity: sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==} dependencies: concordance: 5.0.4 loupe: 2.3.6 @@ -1007,10 +941,6 @@ packages: picomatch: 2.3.1 dev: true - /arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - dev: true - /argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -1034,10 +964,10 @@ packages: resolution: {integrity: sha512-n+fb6O40SM6sD36lGwgVIE3zeVQUMdl6ZHaHEjRI4zdaBu658XaAV1YDztF7Iga5kmeOxJYB87mcQ+lUnQs0Nw==} engines: {node: ^14.18.0 || >=16.0.0} dependencies: - '@astrojs/compiler': 1.4.2 - '@typescript-eslint/scope-manager': 5.59.6 - '@typescript-eslint/types': 5.59.6 - astrojs-compiler-sync: 0.3.2(@astrojs/compiler@1.4.2) + '@astrojs/compiler': 1.5.0 + '@typescript-eslint/scope-manager': 5.59.8 + '@typescript-eslint/types': 5.59.8 + astrojs-compiler-sync: 0.3.3(@astrojs/compiler@1.5.0) debug: 4.3.4 eslint-visitor-keys: 3.4.1 espree: 9.5.2 @@ -1046,13 +976,13 @@ packages: - supports-color dev: true - /astrojs-compiler-sync@0.3.2(@astrojs/compiler@1.4.2): - resolution: {integrity: sha512-q/8Z30WNpsktLKS5NdT/6QAF9Q/C4ucLldqUpHgvRhuj/6jkJyOQfapQxkTKp8MK4RjH9sSsClfrTIdk8JZlKw==} + /astrojs-compiler-sync@0.3.3(@astrojs/compiler@1.5.0): + resolution: {integrity: sha512-LbhchWgsvjvRBb5n5ez8/Q/f9ZKViuox27VxMDOdTUm8MRv9U7phzOiLue5KluqTmC0z1LId4gY2SekvoDrkuw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@astrojs/compiler': '>=0.27.0' dependencies: - '@astrojs/compiler': 1.4.2 + '@astrojs/compiler': 1.5.0 synckit: 0.8.5 dev: true @@ -1210,7 +1140,7 @@ packages: dependencies: date-time: 3.1.0 esutils: 2.0.3 - fast-diff: 1.2.0 + fast-diff: 1.3.0 js-string-escape: 1.0.1 lodash: 4.17.21 md5-hex: 3.0.1 @@ -1218,10 +1148,6 @@ packages: well-known-symbols: 2.0.0 dev: true - /create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - dev: true - /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -1320,11 +1246,6 @@ packages: engines: {node: '>=0.4.0'} dev: true - /diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - dev: true - /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -1351,10 +1272,6 @@ packages: engines: {node: '>=0.12'} dev: true - /es-module-lexer@1.2.1: - resolution: {integrity: sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==} - dev: true - /esbuild@0.17.19: resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} engines: {node: '>=12'} @@ -1390,25 +1307,25 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier@8.8.0(eslint@8.40.0): + /eslint-config-prettier@8.8.0(eslint@8.42.0): resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.40.0 + eslint: 8.42.0 dev: true - /eslint-config-turbo@1.9.6(eslint@8.40.0): - resolution: {integrity: sha512-ZIIfcUZ3kW8owIdC1ykebSGJOmVjUidOin1j7ZxpFDGSGcRc2/r5MBNQ7z347lsJs0rNXk/LpOiFHNbdtE+n6w==} + /eslint-config-turbo@1.10.1(eslint@8.42.0): + resolution: {integrity: sha512-XRF5adpGJIX+IQNRHcGtUCsPZV95vabSvttrxuLOyWufzBctWNkgIo8Mpi5om8ZmYuMqXPUo8IOh3sRR5H1HCw==} peerDependencies: eslint: '>6.6.0' dependencies: - eslint: 8.40.0 - eslint-plugin-turbo: 1.9.6(eslint@8.40.0) + eslint: 8.42.0 + eslint-plugin-turbo: 1.10.1(eslint@8.42.0) dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.40.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.42.0)(prettier@2.8.8): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1419,59 +1336,59 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.40.0 - eslint-config-prettier: 8.8.0(eslint@8.40.0) + eslint: 8.42.0 + eslint-config-prettier: 8.8.0(eslint@8.42.0) prettier: 2.8.8 prettier-linter-helpers: 1.0.0 dev: true - /eslint-plugin-svelte@2.28.0(eslint@8.40.0)(svelte@3.57.0)(ts-node@10.9.1): - resolution: {integrity: sha512-bXPXKnjq5uKoVAQtC2E0L1Vp+mmJ3nlC9jyz8zwfZ99pQROL2h7Hes01QdYil1vxgh6tLXl5YVpZ2wwyAbBz5g==} + /eslint-plugin-svelte@2.30.0(eslint@8.42.0)(svelte@3.57.0): + resolution: {integrity: sha512-2/qj0BJsfM0U2j4EjGb7iC/0nbUvXx1Gn78CdtyuXpi/rSomLPCPwnsZsloXMzlt6Xwe8LBlpRvZObSKEHLP5A==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0-0 - svelte: ^3.37.0 + svelte: ^3.37.0 || ^4.0.0-0 peerDependenciesMeta: svelte: optional: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) '@jridgewell/sourcemap-codec': 1.4.15 debug: 4.3.4 - eslint: 8.40.0 + eslint: 8.42.0 esutils: 2.0.3 known-css-properties: 0.27.0 - postcss: 8.4.23 - postcss-load-config: 3.1.4(postcss@8.4.23)(ts-node@10.9.1) - postcss-safe-parser: 6.0.0(postcss@8.4.23) + postcss: 8.4.24 + postcss-load-config: 3.1.4(postcss@8.4.24) + postcss-safe-parser: 6.0.0(postcss@8.4.24) svelte: 3.57.0 - svelte-eslint-parser: 0.28.0(svelte@3.57.0) + svelte-eslint-parser: 0.30.0(svelte@3.57.0) transitivePeerDependencies: - supports-color - ts-node dev: true - /eslint-plugin-turbo@1.9.6(eslint@8.40.0): - resolution: {integrity: sha512-xxa+gfTg3CG7wKJbkOIqdZw2eXhriORjw/55GDjJiUrNhU4vo1tA+9HDo/glTQygZ22Pj3nxYhxINFnQ/IU3lg==} + /eslint-plugin-turbo@1.10.1(eslint@8.42.0): + resolution: {integrity: sha512-bScQeG42PhVPzSeJgCTk79hRqN8jFYY6Io7fw2qyuOtlff4QkSuBTot+BBooxk4BL11gJglWZUJk2nqumLJGOA==} peerDependencies: eslint: '>6.6.0' dependencies: - eslint: 8.40.0 + eslint: 8.42.0 dev: true - /eslint-plugin-vue@9.13.0(eslint@8.40.0): - resolution: {integrity: sha512-aBz9A8WB4wmpnVv0pYUt86cmH9EkcwWzgEwecBxMoRNhQjTL5i4sqadnwShv/hOdr8Hbl8XANGV7dtX9UQIAyA==} + /eslint-plugin-vue@9.14.1(eslint@8.42.0): + resolution: {integrity: sha512-LQazDB1qkNEKejLe/b5a9VfEbtbczcOaui5lQ4Qw0tbRBbQYREyxxOV5BQgNDTqGPs9pxqiEpbMi9ywuIaF7vw==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) - eslint: 8.40.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) + eslint: 8.42.0 natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 6.0.13 semver: 7.5.1 - vue-eslint-parser: 9.3.0(eslint@8.40.0) + vue-eslint-parser: 9.3.0(eslint@8.42.0) xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color @@ -1498,16 +1415,16 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.40.0: - resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==} + /eslint@8.42.0: + resolution: {integrity: sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) '@eslint-community/regexpp': 4.5.1 '@eslint/eslintrc': 2.0.3 - '@eslint/js': 8.40.0 - '@humanwhocodes/config-array': 0.11.8 + '@eslint/js': 8.42.0 + '@humanwhocodes/config-array': 0.11.10 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -1526,13 +1443,12 @@ packages: find-up: 5.0.0 glob-parent: 6.0.2 globals: 13.20.0 - grapheme-splitter: 1.0.4 + graphemer: 1.4.0 ignore: 5.2.4 import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-sdsl: 4.4.0 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 @@ -1623,8 +1539,8 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-diff@1.2.0: - resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} + /fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} dev: true /fast-glob@3.2.12: @@ -1803,6 +1719,10 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: true + /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -1978,10 +1898,6 @@ packages: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} dev: true - /js-sdsl@4.4.0: - resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} - dev: true - /js-string-escape@1.0.1: resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} engines: {node: '>= 0.8'} @@ -1994,8 +1910,8 @@ packages: argparse: 2.0.1 dev: true - /jsdom@22.0.0: - resolution: {integrity: sha512-p5ZTEb5h+O+iU02t0GfEjAnkdYPrQSkfuTSMkMYyIoMvUNEHsbG0bHHbfXIcfTqD2UfvjQX7mmgiFsyRwGscVw==} + /jsdom@22.1.0: + resolution: {integrity: sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==} engines: {node: '>=16'} peerDependencies: canvas: ^2.5.0 @@ -2013,7 +1929,7 @@ packages: http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.4 + nwsapi: 2.2.5 parse5: 7.1.2 rrweb-cssom: 0.6.0 saxes: 6.0.0 @@ -2157,10 +2073,6 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - dev: true - /md5-hex@3.0.1: resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} engines: {node: '>=8'} @@ -2230,11 +2142,11 @@ packages: hasBin: true dev: true - /mlly@1.2.1: - resolution: {integrity: sha512-1aMEByaWgBPEbWV2BOPEMySRrzl7rIHXmQxam4DM8jVjalTQDjpN2ZKOLUrwyhfZQO7IXHml2StcHMhooDeEEQ==} + /mlly@1.3.0: + resolution: {integrity: sha512-HT5mcgIQKkOrZecOjOX3DJorTikWXwsBfpcr/MGBkhfWcjiqvnaL/9ppxvIUXfjT6xt4DVIAsN9fMUz1ev4bIw==} dependencies: acorn: 8.8.2 - pathe: 1.1.0 + pathe: 1.1.1 pkg-types: 1.0.3 ufo: 1.1.2 dev: true @@ -2282,8 +2194,8 @@ packages: boolbase: 1.0.0 dev: true - /nwsapi@2.2.4: - resolution: {integrity: sha512-NHj4rzRo0tQdijE9ZqAx6kYDcoRwYwSYzCA8MY3JzfxlrvEU0jhnhJT9BhqhJs7I/dKcrDm6TyulaRqZPIhN5g==} + /nwsapi@2.2.5: + resolution: {integrity: sha512-6xpotnECFy/og7tKSBVmUNft7J3jyXAka4XvG6AUhFWRz+Q/Ljus7znJAA3bxColfQLdS+XsjoodtJfCgeTEFQ==} dev: true /once@1.4.0: @@ -2399,8 +2311,8 @@ packages: engines: {node: '>=8'} dev: true - /pathe@1.1.0: - resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} + /pathe@1.1.1: + resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} dev: true /pathval@1.1.1: @@ -2420,11 +2332,11 @@ packages: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: jsonc-parser: 3.2.0 - mlly: 1.2.1 - pathe: 1.1.0 + mlly: 1.3.0 + pathe: 1.1.1 dev: true - /postcss-load-config@3.1.4(postcss@8.4.23)(ts-node@10.9.1): + /postcss-load-config@3.1.4(postcss@8.4.24): resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} peerDependencies: @@ -2437,18 +2349,17 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - postcss: 8.4.23 - ts-node: 10.9.1(@types/node@16.0.0)(typescript@5.0.4) + postcss: 8.4.24 yaml: 1.10.2 dev: true - /postcss-safe-parser@6.0.0(postcss@8.4.23): + /postcss-safe-parser@6.0.0(postcss@8.4.24): resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.3.3 dependencies: - postcss: 8.4.23 + postcss: 8.4.24 dev: true /postcss-selector-parser@6.0.13: @@ -2459,8 +2370,8 @@ packages: util-deprecate: 1.0.2 dev: true - /postcss@8.4.23: - resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} + /postcss@8.4.24: + resolution: {integrity: sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -2477,14 +2388,14 @@ packages: resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} engines: {node: '>=6.0.0'} dependencies: - fast-diff: 1.2.0 + fast-diff: 1.3.0 dev: true - /prettier-plugin-svelte@2.10.0(prettier@2.8.8)(svelte@3.57.0): - resolution: {integrity: sha512-GXMY6t86thctyCvQq+jqElO+MKdB09BkL3hexyGP3Oi8XLKRFaJP1ud/xlWCZ9ZIa2BxHka32zhHfcuU+XsRQg==} + /prettier-plugin-svelte@2.10.1(prettier@2.8.8)(svelte@3.57.0): + resolution: {integrity: sha512-Wlq7Z5v2ueCubWo0TZzKc9XHcm7TDxqcuzRuGd0gcENfzfT4JZ9yDlCbEgxWgiPmLHkBjfOtpAWkcT28MCDpUQ==} peerDependencies: prettier: ^1.16.4 || ^2.0.0 - svelte: ^3.2.0 + svelte: ^3.2.0 || ^4.0.0-next.0 dependencies: prettier: 2.8.8 svelte: 3.57.0 @@ -2580,8 +2491,8 @@ packages: - utf-8-validate dev: true - /rollup@3.22.0: - resolution: {integrity: sha512-imsigcWor5Y/dC0rz2q0bBt9PabcL3TORry2hAa6O6BuMvY71bqHyfReAz5qyAqiQATD1m70qdntqBfBQjVWpQ==} + /rollup@3.23.1: + resolution: {integrity: sha512-ybRdFVHOoljGEFILHLd2g/qateqUdjE6YS41WXq4p3C/WwD3xtWxV4FYWETA1u9TeXQc5K8L8zHE5d/scOvrOQ==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -2656,8 +2567,8 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true - /siyuan@0.7.1: - resolution: {integrity: sha512-Q7OZqpJ8h+axLDkn6afoAdKD6mHPAona/jsoUpf8UgFqHuOscNS6ub8RudhTCPKppDnQzBy5o35xhlecxnrbjQ==} + /siyuan@0.7.2: + resolution: {integrity: sha512-+yunPkAkgUX8wredZNf45AlGUEuFg+VeHUJOKauGJ4TeocalrQifxOUlrJuR2wO4v0apD4z6e7mT5Pa1gaFQUQ==} dev: true /slash@3.0.0: @@ -2750,11 +2661,11 @@ packages: engines: {node: '>= 0.4'} dev: true - /svelte-eslint-parser@0.28.0(svelte@3.57.0): - resolution: {integrity: sha512-qWg5M3CIp7LkcdG5bpn44QEd48UxvgxG5L+Sbl701EG8Wujht7EqJuJhqgzvO3bbI9ENbWCXK49eCcwiNnpMzw==} + /svelte-eslint-parser@0.30.0(svelte@3.57.0): + resolution: {integrity: sha512-H0Cn2TKr70DU9p/Gb04CfwtS7eK28MYumrHYPaDNkIFbfwGDLADpbERBn7u8G1Rcm2RMr2/mL6mq0J2e8iKFlA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: - svelte: ^3.37.0 + svelte: ^3.37.0 || ^4.0.0-0 peerDependenciesMeta: svelte: optional: true @@ -2765,19 +2676,15 @@ packages: svelte: 3.57.0 dev: true - /svelte-hmr@0.15.1(svelte@3.57.0): - resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==} + /svelte-hmr@0.15.2(svelte@3.57.0): + resolution: {integrity: sha512-q/bAruCvFLwvNbeE1x3n37TYFb3mTBJ6TrCq6p2CoFbSTNhDE9oAtEfpy+wmc9So8AG0Tja+X0/mJzX9tSfvIg==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: - svelte: '>=3.19.0' + svelte: ^3.19.0 || ^4.0.0-next.0 dependencies: svelte: 3.57.0 dev: true - /svelte-routing@1.8.9: - resolution: {integrity: sha512-4+J1F57sKkI5+d5nhCQs2ChPo9tn0gIFqFaA38c+yNYZ5UzsGq80mCVA2E0tqPtkO2VzZTJD0Lw2P8N3Z/068g==} - dev: true - /svelte@3.57.0: resolution: {integrity: sha512-WMXEvF+RtAaclw0t3bPDTUe19pplMlfyKDsixbHQYgCWi9+O9VN0kXU1OppzrB9gPAvz4NALuoca2LfW2bOjTQ==} engines: {node: '>= 8'} @@ -2791,8 +2698,8 @@ packages: resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} engines: {node: ^14.18.0 || >=16.0.0} dependencies: - '@pkgr/utils': 2.4.0 - tslib: 2.5.0 + '@pkgr/utils': 2.4.1 + tslib: 2.5.3 dev: true /text-table@0.2.0: @@ -2813,8 +2720,8 @@ packages: engines: {node: '>=14.0.0'} dev: true - /tinyspy@2.1.0: - resolution: {integrity: sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==} + /tinyspy@2.1.1: + resolution: {integrity: sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==} engines: {node: '>=14.0.0'} dev: true @@ -2859,38 +2766,7 @@ packages: code-block-writer: 12.0.0 dev: true - /ts-node@10.9.1(@types/node@16.0.0)(typescript@5.0.4): - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 16.0.0 - acorn: 8.8.2 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.0.4 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - - /tsconfck@2.1.1(typescript@5.0.4): + /tsconfck@2.1.1(typescript@5.1.3): resolution: {integrity: sha512-ZPCkJBKASZBmBUNqGHmRhdhM8pJYDdOXp4nRgj/O0JwUwsMq50lCDRQP/M5GBNAA0elPrq4gAeu4dkaVCuKWww==} engines: {node: ^14.13.1 || ^16 || >=18} hasBin: true @@ -2900,15 +2776,15 @@ packages: typescript: optional: true dependencies: - typescript: 5.0.4 + typescript: 5.1.3 dev: true /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tslib@2.5.0: - resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + /tslib@2.5.3: + resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} dev: true /tsutils@3.21.0(typescript@4.9.5): @@ -2921,14 +2797,14 @@ packages: typescript: 4.9.5 dev: true - /tsutils@3.21.0(typescript@5.0.4): + /tsutils@3.21.0(typescript@5.1.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.0.4 + typescript: 5.1.3 dev: true /type-check@0.4.0: @@ -2948,12 +2824,6 @@ packages: engines: {node: '>=10'} dev: true - /typescript@4.8.4: - resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: true - /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -2966,6 +2836,12 @@ packages: hasBin: true dev: true + /typescript@5.1.3: + resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + /ufo@1.1.2: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true @@ -3007,26 +2883,22 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - dev: true - /validator@13.9.0: resolution: {integrity: sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==} engines: {node: '>= 0.10'} dev: true - /vite-node@0.31.1(@types/node@16.0.0)(stylus@0.59.0): - resolution: {integrity: sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==} + /vite-node@0.31.4(@types/node@20.2.5)(stylus@0.59.0): + resolution: {integrity: sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==} engines: {node: '>=v14.18.0'} hasBin: true dependencies: cac: 6.7.14 debug: 4.3.4 - mlly: 1.2.1 - pathe: 1.1.0 + mlly: 1.3.0 + pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) transitivePeerDependencies: - '@types/node' - less @@ -3037,45 +2909,37 @@ packages: - terser dev: true - /vite-plugin-css-injected-by-js@3.1.1(vite@4.3.7): + /vite-plugin-css-injected-by-js@3.1.1(vite@4.3.9): resolution: {integrity: sha512-mwrFvEEy0TuH8Ul0cb2HgjmNboQ/JnEFy+kHCWqAJph3ikMOiIuyYVdx0JO4nEIWJyzSnc4TTdmoTulsikvJEg==} peerDependencies: vite: '>2.0.0-0' dependencies: - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) dev: true - /vite-plugin-dts@2.3.0(@types/node@16.0.0)(vite@4.3.7): + /vite-plugin-dts@2.3.0(vite@4.3.9): resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: '>=2.9.0' dependencies: - '@babel/parser': 7.21.8 - '@microsoft/api-extractor': 7.34.9(@types/node@16.0.0) + '@babel/parser': 7.22.4 + '@microsoft/api-extractor': 7.35.1 '@rollup/pluginutils': 5.0.2 - '@rushstack/node-core-library': 3.59.0(@types/node@16.0.0) + '@rushstack/node-core-library': 3.59.2 debug: 4.3.4 fast-glob: 3.2.12 fs-extra: 10.1.0 kolorist: 1.8.0 magic-string: 0.29.0 ts-morph: 18.0.0 - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) transitivePeerDependencies: - '@types/node' - rollup - supports-color dev: true - /vite-plugin-dynamic-import@1.4.0: - resolution: {integrity: sha512-OBWeCGyWE4iIwCUfx3RK8XwT1BjPAJNeMQmdO5md5Gq8PD8gLMCfUnuEiX9dIQDL9Gdvao1GNRqZwfcpwWDTNw==} - dependencies: - acorn: 8.8.2 - es-module-lexer: 1.2.1 - fast-glob: 3.2.12 - dev: true - /vite-plugin-no-bundle@2.0.2: resolution: {integrity: sha512-QtMJ0Dzml8mQzZ+Ta09fPJAgy6WXp5rN2w77KQEIV79OeAwkpnaaig/KwH9r6tZLMfa5LkMO7DmmOGQwtph+2A==} dependencies: @@ -3083,7 +2947,7 @@ packages: micromatch: 4.0.5 dev: true - /vite-plugin-static-copy@0.15.0(vite@4.3.7): + /vite-plugin-static-copy@0.15.0(vite@4.3.9): resolution: {integrity: sha512-Ww+/Ug9guV45oIfIi/lA2z8v3K+lLHV9zCJqTVO4FTdqrJoZBj68VgGBSH1fi0N4q/EHW32RsL3ympi4Wlsq5w==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3093,10 +2957,10 @@ packages: fast-glob: 3.2.12 fs-extra: 11.1.1 picocolors: 1.0.0 - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) dev: true - /vite-tsconfig-paths@4.2.0(typescript@5.0.4)(vite@4.3.7): + /vite-tsconfig-paths@4.2.0(typescript@5.1.3)(vite@4.3.9): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: vite: '*' @@ -3106,15 +2970,15 @@ packages: dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 2.1.1(typescript@5.0.4) - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) + tsconfck: 2.1.1(typescript@5.1.3) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.3.7(@types/node@16.0.0)(stylus@0.59.0): - resolution: {integrity: sha512-MTIFpbIm9v7Hh5b0wSBgkcWzSBz7SAa6K/cBTwS4kUiQJfQLFlZZRJRQgqunCVzhTPCk674tW+0Qaqh3Q00dBg==} + /vite@4.3.9(@types/node@20.2.5)(stylus@0.59.0): + resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -3138,16 +3002,16 @@ packages: terser: optional: true dependencies: - '@types/node': 16.0.0 + '@types/node': 20.2.5 esbuild: 0.17.19 - postcss: 8.4.23 - rollup: 3.22.0 + postcss: 8.4.24 + rollup: 3.23.1 stylus: 0.59.0 optionalDependencies: fsevents: 2.3.2 dev: true - /vitefu@0.2.4(vite@4.3.7): + /vitefu@0.2.4(vite@4.3.9): resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} peerDependencies: vite: ^3.0.0 || ^4.0.0 @@ -3155,11 +3019,11 @@ packages: vite: optional: true dependencies: - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) dev: true - /vitest@0.31.1(jsdom@22.0.0)(stylus@0.59.0): - resolution: {integrity: sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==} + /vitest@0.31.4(jsdom@22.1.0)(stylus@0.59.0): + resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==} engines: {node: '>=v14.18.0'} hasBin: true peerDependencies: @@ -3191,29 +3055,29 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 16.0.0 - '@vitest/expect': 0.31.1 - '@vitest/runner': 0.31.1 - '@vitest/snapshot': 0.31.1 - '@vitest/spy': 0.31.1 - '@vitest/utils': 0.31.1 + '@types/node': 20.2.5 + '@vitest/expect': 0.31.4 + '@vitest/runner': 0.31.4 + '@vitest/snapshot': 0.31.4 + '@vitest/spy': 0.31.4 + '@vitest/utils': 0.31.4 acorn: 8.8.2 acorn-walk: 8.2.0 cac: 6.7.14 chai: 4.3.7 concordance: 5.0.4 debug: 4.3.4 - jsdom: 22.0.0 + jsdom: 22.1.0 local-pkg: 0.4.3 magic-string: 0.30.0 - pathe: 1.1.0 + pathe: 1.1.1 picocolors: 1.0.0 std-env: 3.3.3 strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.5.0 - vite: 4.3.7(@types/node@16.0.0)(stylus@0.59.0) - vite-node: 0.31.1(@types/node@16.0.0)(stylus@0.59.0) + vite: 4.3.9(@types/node@20.2.5)(stylus@0.59.0) + vite-node: 0.31.4(@types/node@20.2.5)(stylus@0.59.0) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -3224,14 +3088,14 @@ packages: - terser dev: true - /vue-eslint-parser@9.3.0(eslint@8.40.0): + /vue-eslint-parser@9.3.0(eslint@8.42.0): resolution: {integrity: sha512-48IxT9d0+wArT1+3wNIy0tascRoywqSUe2E1YalIC1L8jsUGe5aJQItWfRok7DVFGz3UYvzEI7n5wiTXsCMAcQ==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.3.4 - eslint: 8.40.0 + eslint: 8.42.0 eslint-scope: 7.2.0 eslint-visitor-keys: 3.4.1 espree: 9.5.2 @@ -3349,11 +3213,6 @@ packages: engines: {node: '>= 6'} dev: true - /yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - dev: true - /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -3375,3 +3234,7 @@ packages: optionalDependencies: commander: 9.5.0 dev: true + + /zhi-lib-base@0.1.0: + resolution: {integrity: sha512-Ls3VJgLWCnfhEWOAfxVVJ8mWoeEIXwukRe5ay+n4FjTRQRzpRTMU/yV7t1ytT3CubsP1XmAbiPUq3k6nCVetNw==} + dev: false diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100755 index 6a87e79e..00000000 Binary files a/public/favicon.png and /dev/null differ diff --git a/public/libs/plugin-publisher-bridge/index.js b/public/libs/plugin-publisher-bridge/index.js deleted file mode 100644 index d0e79395..00000000 --- a/public/libs/plugin-publisher-bridge/index.js +++ /dev/null @@ -1,3039 +0,0 @@ -var at = Object.defineProperty; -var st = (e, r, t) => r in e ? at(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t; -var be = (e, r, t) => (st(e, typeof r != "symbol" ? r + "" : r, t), t); -var lt = Object.defineProperty, ct = (e, r, t) => r in e ? lt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, fe = (e, r, t) => (ct(e, typeof r != "symbol" ? r + "" : r, t), t), ut = Object.defineProperty, ht = (e, r, t) => r in e ? ut(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, N = (e, r, t) => (ht(e, typeof r != "symbol" ? r + "" : r, t), t); -const Y = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return Y.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let R = Y; -N(R, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -N(R, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -N(R, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -N(R, "isElectron", () => !Y.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -N(R, "hasNodeEnv", () => Y.isElectron() || Y.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -N(R, "getQueryString", (e) => { - if (!Y.isInBrowser) - return ""; - const r = window.location.search.substring(1).split("&"); - for (let t = 0; t < r.length; t++) { - const i = r[t].split("="); - if (i[0] === e) - return i[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -N(R, "replaceUrlParam", (e, r, t) => { - t == null && (t = ""); - const i = new RegExp("\\b(" + r + "=).*?(&|#|$)"); - if (e.search(i) >= 0) - return e.replace(i, "$1" + t + "$2"); - const [n, o] = e.split("#"), [s, c] = n.split("?"), l = new URLSearchParams(c); - l.set(r, t); - const u = l.toString(), a = s + (u ? "?" + u : ""); - return o ? a + "#" + o : a; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -N(R, "setUrlParameter", (e, r, t) => { - if (e.includes(r)) - return Y.replaceUrlParam(e, r, t); - const i = e.split("#"); - let n = i[0]; - const o = i[1]; - return n.includes("?") ? n += `&${r}=${t}` : n += `?${r}=${t}`, o && (n += "#" + o), n; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -N(R, "reloadTabPage", (e, r = 200) => { - setTimeout(function() { - if (Y.isInBrowser) { - const t = window.location.href; - window.location.href = Y.setUrlParameter(t, "tab", e); - } - }, r); -}), /** -* 刷新当前tab页面 -*/ -N(R, "reloadPage", () => { - setTimeout(function() { - Y.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -N(R, "reloadPageWithMessageCallback", (e, r) => { - r && r(e), setTimeout(function() { - Y.isInBrowser && window.location.reload(); - }, 200); -}); -var A = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(A || {}); -const j = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return R.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let r; - return this.isInSiyuanWidget() ? r = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? r = window : r = void 0, r; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(r, t) { - let i = r; - switch (t) { - case A.BasePathType_Appearance: - i = this.browserJoinPath(this.siyuanAppearanceRelativePath(), r); - break; - case A.BasePathType_Data: - i = this.browserJoinPath(this.siyuanDataRelativePath(), r); - break; - case A.BasePathType_Themes: - i = this.browserJoinPath(this.siyuanThemeRelativePath(), r); - break; - case A.BasePathType_ZhiTheme: - i = this.browserJoinPath(this.zhiThemeRelativePath(), r); - break; - default: - throw new Error("type must be provided"); - } - const { default: n } = await import( - /* @vite-ignore */ - i - ); - return n; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(r) { - return await this.importJs(r, A.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...r) { - if (R.hasNodeEnv()) { - const t = this.requireLib("path"); - if (t) - return t.join(...r); - } - return this.browserJoinPath(...r); - } - static browserJoinPath(...r) { - return r.join(R.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const r = this.siyuanWindow(); - if (!r) - throw new Error("Not in siyuan env"); - return r.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const r = this.siyuanWindow(); - if (!r) - throw new Error("Not in siyuan env"); - return r.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (R.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const r = this.siyuanWindow(); - if (!r) - throw new Error("Not in siyuan env"); - return this.joinPath(r.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let re = j; -N(re, "isInSiyuanWidget", () => R.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -N(re, "isInSiyuanNewWin", () => !R.isInBrowser || !R.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -N(re, "requireLib", (e, r = !0, t = A.BasePathType_None) => { - if (!R.hasNodeEnv()) - throw new Error("require ony works on node env"); - let i = e; - if (!r) - switch (t) { - case A.BasePathType_Appearance: - i = j.joinPath(j.siyuanAppearancePath(), e); - break; - case A.BasePathType_Data: - i = j.joinPath(j.siyuanDataPath(), e); - break; - case A.BasePathType_Themes: - i = j.joinPath(j.siyuanAppearancePath(), "themes", e); - break; - case A.BasePathType_ZhiTheme: - i = j.joinPath(j.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const n = j.siyuanWindow(); - if (!n) - return require(i); - if (typeof n.require < "u") - return n.require(i); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -N(re, "requireAppearanceLib", (e) => j.requireLib(e, !1, A.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -N(re, "requireDataLib", (e) => j.requireLib(e, !1, A.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -N(re, "requireThemesLib", (e) => j.requireLib(e, !1, A.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -N(re, "requireZhiThemeLib", (e) => j.requireLib(e, !1, A.BasePathType_ZhiTheme)); -var gt = Object.defineProperty, pt = (e, r, t) => r in e ? gt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, ue = (e, r, t) => (pt(e, typeof r != "symbol" ? r + "" : r, t), t); -let ie = class { -}; -ue(ie, "NODE_ENV_KEY", "NODE_ENV"), /** -* 开发环境 -*/ -ue(ie, "NODE_ENV_DEVELOPMENT", "development"), /** -* 生产环境 -*/ -ue(ie, "NODE_ENV_PRODUCTION", "production"), /** -* 测试环境 -*/ -ue(ie, "NODE_ENV_TEST", "test"), /** -* 是否处于调试模式 -*/ -ue(ie, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -let yt = class { - /** - * 环境初始化 - * - * @param envMeta - 需要传入 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false} 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(r) { - ue(this, "envMeta"), this.envMeta = r; - } - /** - * 是否是开发阶段调试 - */ - isNodeDev() { - return this.getEnv(ie.NODE_ENV_KEY) === ie.NODE_ENV_DEVELOPMENT; - } - /** - * 是否是调试阶段 - */ - isDev() { - return this.isNodeDev() || this.getBooleanEnv(ie.VITE_DEBUG_MODE_KEY); - } - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(r) { - let t; - try { - this.envMeta[r] && (t = this.envMeta[r]); - } catch { - } - return t; - } - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(r) { - return this.getEnv(r) ?? ""; - } - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(r) { - let t = !1; - return this.getEnv(r) && (t = this.getStringEnv(r).toLowerCase() === "true"), t; - } - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(r, t) { - const i = this.getStringEnv(r); - return i.trim().length == 0 ? t : i; - } -}; -var dt = Object.defineProperty, wt = (e, r, t) => r in e ? dt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, ge = (e, r, t) => (wt(e, typeof r != "symbol" ? r + "" : r, t), t); -class ve { -} -ge(ve, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), ge(ve, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX"); -var X = /* @__PURE__ */ ((e) => (e.LOG_LEVEL_TRACE = "TRACE", e.LOG_LEVEL_DEBUG = "DEBUG", e.LOG_LEVEL_INFO = "INFO", e.LOG_LEVEL_WARN = "WARN", e.LOG_LEVEL_ERROR = "ERROR", e))(X || {}), Fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function _e(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var Ve = { exports: {} }; -(function(e) { - (function(r, t) { - e.exports ? e.exports = t() : r.log = t(); - })(Fe, function() { - var r = function() { - }, t = "undefined", i = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), n = [ - "trace", - "debug", - "info", - "warn", - "error" - ]; - function o(h, f) { - var E = h[f]; - if (typeof E.bind == "function") - return E.bind(h); - try { - return Function.prototype.bind.call(E, h); - } catch { - return function() { - return Function.prototype.apply.apply(E, [h, arguments]); - }; - } - } - function s() { - console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace(); - } - function c(h) { - return h === "debug" && (h = "log"), typeof console === t ? !1 : h === "trace" && i ? s : console[h] !== void 0 ? o(console, h) : console.log !== void 0 ? o(console, "log") : r; - } - function l(h, f) { - for (var E = 0; E < n.length; E++) { - var p = n[E]; - this[p] = E < h ? r : this.methodFactory(p, h, f); - } - this.log = this.debug; - } - function u(h, f, E) { - return function() { - typeof console !== t && (l.call(this, f, E), this[h].apply(this, arguments)); - }; - } - function a(h, f, E) { - return c(h) || u.apply(this, arguments); - } - function y(h, f, E) { - var p = this, ee; - f = f ?? "WARN"; - var d = "loglevel"; - typeof h == "string" ? d += ":" + h : typeof h == "symbol" && (d = void 0); - function ae(g) { - var P = (n[g] || "silent").toUpperCase(); - if (!(typeof window === t || !d)) { - try { - window.localStorage[d] = P; - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(d) + "=" + P + ";"; - } catch { - } - } - } - function te() { - var g; - if (!(typeof window === t || !d)) { - try { - g = window.localStorage[d]; - } catch { - } - if (typeof g === t) - try { - var P = window.document.cookie, x = P.indexOf( - encodeURIComponent(d) + "=" - ); - x !== -1 && (g = /^([^;]+)/.exec(P.slice(x))[1]); - } catch { - } - return p.levels[g] === void 0 && (g = void 0), g; - } - } - function se() { - if (!(typeof window === t || !d)) { - try { - window.localStorage.removeItem(d); - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(d) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; - } catch { - } - } - } - p.name = h, p.levels = { - TRACE: 0, - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - SILENT: 5 - }, p.methodFactory = E || a, p.getLevel = function() { - return ee; - }, p.setLevel = function(g, P) { - if (typeof g == "string" && p.levels[g.toUpperCase()] !== void 0 && (g = p.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= p.levels.SILENT) { - if (ee = g, P !== !1 && ae(g), l.call(p, g, h), typeof console === t && g < p.levels.SILENT) - return "No console available for logging"; - } else - throw "log.setLevel() called with invalid level: " + g; - }, p.setDefaultLevel = function(g) { - f = g, te() || p.setLevel(g, !1); - }, p.resetLevel = function() { - p.setLevel(f, !1), se(); - }, p.enableAll = function(g) { - p.setLevel(p.levels.TRACE, g); - }, p.disableAll = function(g) { - p.setLevel(p.levels.SILENT, g); - }; - var B = te(); - B == null && (B = f), p.setLevel(B, !1); - } - var m = new y(), v = {}; - m.getLogger = function(h) { - if (typeof h != "symbol" && typeof h != "string" || h === "") - throw new TypeError("You must supply a name when creating a logger."); - var f = v[h]; - return f || (f = v[h] = new y( - h, - m.getLevel(), - m.methodFactory - )), f; - }; - var z = typeof window !== t ? window.log : void 0; - return m.noConflict = function() { - return typeof window !== t && window.log === m && (window.log = z), m; - }, m.getLoggers = function() { - return v; - }, m.default = m, m; - }); -})(Ve); -var bt = Ve.exports; -const me = /* @__PURE__ */ _e(bt); -var Ue = { exports: {} }; -(function(e) { - (function(r, t) { - e.exports ? e.exports = t() : r.prefix = t(r); - })(Fe, function(r) { - var t = function(a) { - for (var y = 1, m = arguments.length, v; y < m; y++) - for (v in arguments[y]) - Object.prototype.hasOwnProperty.call(arguments[y], v) && (a[v] = arguments[y][v]); - return a; - }, i = { - template: "[%t] %l:", - levelFormatter: function(a) { - return a.toUpperCase(); - }, - nameFormatter: function(a) { - return a || "root"; - }, - timestampFormatter: function(a) { - return a.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); - }, - format: void 0 - }, n, o = {}, s = function(a) { - if (!a || !a.getLogger) - throw new TypeError("Argument is not a root logger"); - n = a; - }, c = function(a, y) { - if (!a || !a.setLevel) - throw new TypeError("Argument is not a logger"); - var m = a.methodFactory, v = a.name || "", z = o[v] || o[""] || i; - function h(f, E, p) { - var ee = m(f, E, p), d = o[p] || o[""], ae = d.template.indexOf("%t") !== -1, te = d.template.indexOf("%l") !== -1, se = d.template.indexOf("%n") !== -1; - return function() { - for (var B = "", g = arguments.length, P = Array(g), x = 0; x < g; x++) - P[x] = arguments[x]; - if (v || !o[p]) { - var ye = d.timestampFormatter(/* @__PURE__ */ new Date()), de = d.levelFormatter(f), we = d.nameFormatter(p); - d.format ? B += d.format(de, we, ye) : (B += d.template, ae && (B = B.replace(/%t/, ye)), te && (B = B.replace(/%l/, de)), se && (B = B.replace(/%n/, we))), P.length && typeof P[0] == "string" ? P[0] = B + " " + P[0] : P.unshift(B); - } - ee.apply(void 0, P); - }; - } - return o[v] || (a.methodFactory = h), y = y || {}, y.template && (y.format = void 0), o[v] = t({}, z, y), a.setLevel(a.getLevel()), n || a.warn( - "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md" - ), a; - }, l = { - reg: s, - apply: c - }, u; - return r && (u = r.prefix, l.noConflict = function() { - return r.prefix === l && (r.prefix = u), l; - }), l; - }); -})(Ue); -var ft = Ue.exports; -const De = /* @__PURE__ */ _e(ft); -function mt() { - const e = Error.prepareStackTrace; - Error.prepareStackTrace = (t, i) => i; - const r = new Error().stack.slice(1); - return Error.prepareStackTrace = e, r; -} -let Ie = class Me { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - static stringToEnumValue(r, t) { - return r[Object.keys(r).filter((i) => r[i].toString() === t)[0]]; - } - /** - * 获取配置的日志级别 - */ - static getEnvLevel(r) { - if (!r) - return; - const t = r.getEnvOrDefault(ve.LOG_LEVEL_KEY, X.LOG_LEVEL_INFO), i = Me.stringToEnumValue(X, t.toUpperCase()); - return i || console.warn( - "[zhi-log] LOG_LEVEL is invalid in you .env file.It must be either debug, info, warn or error, fallback to default info level" - ), i; - } - /** - * 获取默认日志 - */ - static getEnvLogger(r) { - return r ? r.getEnv(ve.LOG_PREFIX_KEY) : void 0; - } -}; -var Oe = { exports: {} }, Se = { exports: {} }, xe; -function Et() { - return xe || (xe = 1, function(e) { - const r = typeof process < "u" && process.env.TERM_PROGRAM === "Hyper", t = typeof process < "u" && process.platform === "win32", i = typeof process < "u" && process.platform === "linux", n = { - ballotDisabled: "☒", - ballotOff: "☐", - ballotOn: "☑", - bullet: "•", - bulletWhite: "◦", - fullBlock: "█", - heart: "❤", - identicalTo: "≡", - line: "─", - mark: "※", - middot: "·", - minus: "-", - multiplication: "×", - obelus: "÷", - pencilDownRight: "✎", - pencilRight: "✏", - pencilUpRight: "✐", - percent: "%", - pilcrow2: "❡", - pilcrow: "¶", - plusMinus: "±", - question: "?", - section: "§", - starsOff: "☆", - starsOn: "★", - upDownArrow: "↕" - }, o = Object.assign({}, n, { - check: "√", - cross: "×", - ellipsisLarge: "...", - ellipsis: "...", - info: "i", - questionSmall: "?", - pointer: ">", - pointerSmall: "»", - radioOff: "( )", - radioOn: "(*)", - warning: "‼" - }), s = Object.assign({}, n, { - ballotCross: "✘", - check: "✔", - cross: "✖", - ellipsisLarge: "⋯", - ellipsis: "…", - info: "ℹ", - questionFull: "?", - questionSmall: "﹖", - pointer: i ? "▸" : "❯", - pointerSmall: i ? "‣" : "›", - radioOff: "◯", - radioOn: "◉", - warning: "⚠" - }); - e.exports = t && !r ? o : s, Reflect.defineProperty(e.exports, "common", { enumerable: !1, value: n }), Reflect.defineProperty(e.exports, "windows", { enumerable: !1, value: o }), Reflect.defineProperty(e.exports, "other", { enumerable: !1, value: s }); - }(Se)), Se.exports; -} -const vt = (e) => e !== null && typeof e == "object" && !Array.isArray(e), Pt = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, Lt = () => typeof process < "u" ? process.env.FORCE_COLOR !== "0" : !1, Je = () => { - const e = { - enabled: Lt(), - visible: !0, - styles: {}, - keys: {} - }, r = (o) => { - let s = o.open = `\x1B[${o.codes[0]}m`, c = o.close = `\x1B[${o.codes[1]}m`, l = o.regex = new RegExp(`\\u001b\\[${o.codes[1]}m`, "g"); - return o.wrap = (u, a) => { - u.includes(c) && (u = u.replace(l, c + s)); - let y = s + u + c; - return a ? y.replace(/\r*\n/g, `${c}$&${s}`) : y; - }, o; - }, t = (o, s, c) => typeof o == "function" ? o(s) : o.wrap(s, c), i = (o, s) => { - if (o === "" || o == null) - return ""; - if (e.enabled === !1) - return o; - if (e.visible === !1) - return ""; - let c = "" + o, l = c.includes(` -`), u = s.length; - for (u > 0 && s.includes("unstyle") && (s = [.../* @__PURE__ */ new Set(["unstyle", ...s])].reverse()); u-- > 0; ) - c = t(e.styles[s[u]], c, l); - return c; - }, n = (o, s, c) => { - e.styles[o] = r({ name: o, codes: s }), (e.keys[c] || (e.keys[c] = [])).push(o), Reflect.defineProperty(e, o, { - configurable: !0, - enumerable: !0, - set(l) { - e.alias(o, l); - }, - get() { - let l = (u) => i(u, l.stack); - return Reflect.setPrototypeOf(l, e), l.stack = this.stack ? this.stack.concat(o) : [o], l; - } - }); - }; - return n("reset", [0, 0], "modifier"), n("bold", [1, 22], "modifier"), n("dim", [2, 22], "modifier"), n("italic", [3, 23], "modifier"), n("underline", [4, 24], "modifier"), n("inverse", [7, 27], "modifier"), n("hidden", [8, 28], "modifier"), n("strikethrough", [9, 29], "modifier"), n("black", [30, 39], "color"), n("red", [31, 39], "color"), n("green", [32, 39], "color"), n("yellow", [33, 39], "color"), n("blue", [34, 39], "color"), n("magenta", [35, 39], "color"), n("cyan", [36, 39], "color"), n("white", [37, 39], "color"), n("gray", [90, 39], "color"), n("grey", [90, 39], "color"), n("bgBlack", [40, 49], "bg"), n("bgRed", [41, 49], "bg"), n("bgGreen", [42, 49], "bg"), n("bgYellow", [43, 49], "bg"), n("bgBlue", [44, 49], "bg"), n("bgMagenta", [45, 49], "bg"), n("bgCyan", [46, 49], "bg"), n("bgWhite", [47, 49], "bg"), n("blackBright", [90, 39], "bright"), n("redBright", [91, 39], "bright"), n("greenBright", [92, 39], "bright"), n("yellowBright", [93, 39], "bright"), n("blueBright", [94, 39], "bright"), n("magentaBright", [95, 39], "bright"), n("cyanBright", [96, 39], "bright"), n("whiteBright", [97, 39], "bright"), n("bgBlackBright", [100, 49], "bgBright"), n("bgRedBright", [101, 49], "bgBright"), n("bgGreenBright", [102, 49], "bgBright"), n("bgYellowBright", [103, 49], "bgBright"), n("bgBlueBright", [104, 49], "bgBright"), n("bgMagentaBright", [105, 49], "bgBright"), n("bgCyanBright", [106, 49], "bgBright"), n("bgWhiteBright", [107, 49], "bgBright"), e.ansiRegex = Pt, e.hasColor = e.hasAnsi = (o) => (e.ansiRegex.lastIndex = 0, typeof o == "string" && o !== "" && e.ansiRegex.test(o)), e.alias = (o, s) => { - let c = typeof s == "string" ? e[s] : s; - if (typeof c != "function") - throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); - c.stack || (Reflect.defineProperty(c, "name", { value: o }), e.styles[o] = c, c.stack = [o]), Reflect.defineProperty(e, o, { - configurable: !0, - enumerable: !0, - set(l) { - e.alias(o, l); - }, - get() { - let l = (u) => i(u, l.stack); - return Reflect.setPrototypeOf(l, e), l.stack = this.stack ? this.stack.concat(c.stack) : c.stack, l; - } - }); - }, e.theme = (o) => { - if (!vt(o)) - throw new TypeError("Expected theme to be an object"); - for (let s of Object.keys(o)) - e.alias(s, o[s]); - return e; - }, e.alias("unstyle", (o) => typeof o == "string" && o !== "" ? (e.ansiRegex.lastIndex = 0, o.replace(e.ansiRegex, "")) : ""), e.alias("noop", (o) => o), e.none = e.clear = e.noop, e.stripColor = e.unstyle, e.symbols = Et(), e.define = n, e; -}; -Oe.exports = Je(); -Oe.exports.create = Je; -var Tt = Oe.exports; -const V = /* @__PURE__ */ _e(Tt); -let Te, ze, Ye, Ze, He = !0; -typeof process < "u" && ({ FORCE_COLOR: Te, NODE_DISABLE_COLORS: ze, NO_COLOR: Ye, TERM: Ze } = process.env || {}, He = process.stdout && process.stdout.isTTY); -const w = { - enabled: !ze && Ye == null && Ze !== "dumb" && (Te != null && Te !== "0" || He), - // modifiers - reset: _(0, 0), - bold: _(1, 22), - dim: _(2, 22), - italic: _(3, 23), - underline: _(4, 24), - inverse: _(7, 27), - hidden: _(8, 28), - strikethrough: _(9, 29), - // colors - black: _(30, 39), - red: _(31, 39), - green: _(32, 39), - yellow: _(33, 39), - blue: _(34, 39), - magenta: _(35, 39), - cyan: _(36, 39), - white: _(37, 39), - gray: _(90, 39), - grey: _(90, 39), - // background colors - bgBlack: _(40, 49), - bgRed: _(41, 49), - bgGreen: _(42, 49), - bgYellow: _(43, 49), - bgBlue: _(44, 49), - bgMagenta: _(45, 49), - bgCyan: _(46, 49), - bgWhite: _(47, 49) -}; -function Ae(e, r) { - let t = 0, i, n = "", o = ""; - for (; t < e.length; t++) - i = e[t], n += i.open, o += i.close, ~r.indexOf(i.close) && (r = r.replace(i.rgx, i.close + i.open)); - return n + r + o; -} -function Bt(e, r) { - let t = { has: e, keys: r }; - return t.reset = w.reset.bind(t), t.bold = w.bold.bind(t), t.dim = w.dim.bind(t), t.italic = w.italic.bind(t), t.underline = w.underline.bind(t), t.inverse = w.inverse.bind(t), t.hidden = w.hidden.bind(t), t.strikethrough = w.strikethrough.bind(t), t.black = w.black.bind(t), t.red = w.red.bind(t), t.green = w.green.bind(t), t.yellow = w.yellow.bind(t), t.blue = w.blue.bind(t), t.magenta = w.magenta.bind(t), t.cyan = w.cyan.bind(t), t.white = w.white.bind(t), t.gray = w.gray.bind(t), t.grey = w.grey.bind(t), t.bgBlack = w.bgBlack.bind(t), t.bgRed = w.bgRed.bind(t), t.bgGreen = w.bgGreen.bind(t), t.bgYellow = w.bgYellow.bind(t), t.bgBlue = w.bgBlue.bind(t), t.bgMagenta = w.bgMagenta.bind(t), t.bgCyan = w.bgCyan.bind(t), t.bgWhite = w.bgWhite.bind(t), t; -} -function _(e, r) { - let t = { - open: `\x1B[${e}m`, - close: `\x1B[${r}m`, - rgx: new RegExp(`\\x1b\\[${r}m`, "g") - }; - return function(i) { - return this !== void 0 && this.has !== void 0 ? (~this.has.indexOf(e) || (this.has.push(e), this.keys.push(t)), i === void 0 ? this : w.enabled ? Ae(this.keys, i + "") : i + "") : i === void 0 ? Bt([e], [t]) : w.enabled ? Ae([t], i + "") : i + ""; - }; -} -var _t = Object.defineProperty, Ot = (e, r, t) => r in e ? _t(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, D = (e, r, t) => (Ot(e, typeof r != "symbol" ? r + "" : r, t), t); -const Z = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return Z.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let L = Z; -D(L, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -D(L, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -D(L, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -D(L, "isElectron", () => !Z.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -D(L, "hasNodeEnv", () => Z.isElectron() || Z.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -D(L, "getQueryString", (e) => { - if (!Z.isInBrowser) - return ""; - const r = window.location.search.substring(1).split("&"); - for (let t = 0; t < r.length; t++) { - const i = r[t].split("="); - if (i[0] === e) - return i[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -D(L, "replaceUrlParam", (e, r, t) => { - t == null && (t = ""); - const i = new RegExp("\\b(" + r + "=).*?(&|#|$)"); - if (e.search(i) >= 0) - return e.replace(i, "$1" + t + "$2"); - const [n, o] = e.split("#"), [s, c] = n.split("?"), l = new URLSearchParams(c); - l.set(r, t); - const u = l.toString(), a = s + (u ? "?" + u : ""); - return o ? a + "#" + o : a; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -D(L, "setUrlParameter", (e, r, t) => { - if (e.includes(r)) - return Z.replaceUrlParam(e, r, t); - const i = e.split("#"); - let n = i[0]; - const o = i[1]; - return n.includes("?") ? n += `&${r}=${t}` : n += `?${r}=${t}`, o && (n += "#" + o), n; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -D(L, "reloadTabPage", (e, r = 200) => { - setTimeout(function() { - if (Z.isInBrowser) { - const t = window.location.href; - window.location.href = Z.setUrlParameter(t, "tab", e); - } - }, r); -}), /** -* 刷新当前tab页面 -*/ -D(L, "reloadPage", () => { - setTimeout(function() { - Z.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -D(L, "reloadPageWithMessageCallback", (e, r) => { - r && r(e), setTimeout(function() { - Z.isInBrowser && window.location.reload(); - }, 200); -}); -var C = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(C || {}); -const q = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return L.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let r; - return this.isInSiyuanWidget() ? r = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? r = window : r = void 0, r; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(r, t) { - let i = r; - switch (t) { - case C.BasePathType_Appearance: - i = this.browserJoinPath(this.siyuanAppearanceRelativePath(), r); - break; - case C.BasePathType_Data: - i = this.browserJoinPath(this.siyuanDataRelativePath(), r); - break; - case C.BasePathType_Themes: - i = this.browserJoinPath(this.siyuanThemeRelativePath(), r); - break; - case C.BasePathType_ZhiTheme: - i = this.browserJoinPath(this.zhiThemeRelativePath(), r); - break; - default: - throw new Error("type must be provided"); - } - const { default: n } = await import( - /* @vite-ignore */ - i - ); - return n; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(r) { - return await this.importJs(r, C.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...r) { - if (L.hasNodeEnv()) { - const t = this.requireLib("path"); - if (t) - return t.join(...r); - } - return this.browserJoinPath(...r); - } - static browserJoinPath(...r) { - return r.join(L.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const r = this.siyuanWindow(); - if (!r) - throw new Error("Not in siyuan env"); - return r.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const r = this.siyuanWindow(); - if (!r) - throw new Error("Not in siyuan env"); - return r.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (L.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const r = this.siyuanWindow(); - if (!r) - throw new Error("Not in siyuan env"); - return this.joinPath(r.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let le = q; -D(le, "isInSiyuanWidget", () => L.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -D(le, "isInSiyuanNewWin", () => !L.isInBrowser || !L.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -D(le, "requireLib", (e, r = !0, t = C.BasePathType_None) => { - if (!L.hasNodeEnv()) - throw new Error("require ony works on node env"); - let i = e; - if (!r) - switch (t) { - case C.BasePathType_Appearance: - i = q.joinPath(q.siyuanAppearancePath(), e); - break; - case C.BasePathType_Data: - i = q.joinPath(q.siyuanDataPath(), e); - break; - case C.BasePathType_Themes: - i = q.joinPath(q.siyuanAppearancePath(), "themes", e); - break; - case C.BasePathType_ZhiTheme: - i = q.joinPath(q.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const n = q.siyuanWindow(); - if (!n) - return require(i); - if (typeof n.require < "u") - return n.require(i); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -D(le, "requireAppearanceLib", (e) => q.requireLib(e, !1, C.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -D(le, "requireDataLib", (e) => q.requireLib(e, !1, C.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -D(le, "requireThemesLib", (e) => q.requireLib(e, !1, C.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -D(le, "requireZhiThemeLib", (e) => q.requireLib(e, !1, C.BasePathType_ZhiTheme)); -const U = { - white: (e) => L.isElectron() ? V.whiteBright(e) : w.white(e), - gray: (e) => L.isElectron() ? V.gray(e) : w.gray(e), - blue: (e) => L.isElectron() ? V.blue(e) : w.blue(e), - green: (e) => L.isElectron() ? V.green(e) : w.green(e), - yellow: (e) => L.isElectron() ? V.yellow(e) : w.yellow(e), - red: (e) => L.isElectron() ? V.red(e) : w.red(e), - bgWhite: (e) => L.isElectron() ? V.bgWhiteBright(e) : w.bgWhite(e), - bgGrey: (e) => L.isElectron() ? V.bgCyanBright(e) : w.bgCyan(e), - bgBlue: (e) => L.isElectron() ? V.bgBlueBright(e) : w.bgBlue(e), - bgGreen: (e) => L.isElectron() ? V.bgGreenBright(e) : w.bgGreen(e), - bgYellow: (e) => L.isElectron() ? V.bgYellowBright(e) : w.bgYellow(e), - bgRed: (e) => L.isElectron() ? V.bgRedBright(e) : w.bgRed(e) -}; -class Rt { - constructor(r, t, i) { - ge(this, "consoleLogger", "console"), ge(this, "stackSize", 1), ge(this, "getLogger", (s) => { - let c; - if (s) - c = s; - else { - const l = this.getCallStack(), u = [], a = []; - for (let y = 0; y < l.length; y++) { - const m = l[y], v = m.getFileName() ?? "none"; - if (y > this.stackSize - 1) - break; - const z = v + "-" + m.getLineNumber() + ":" + m.getColumnNumber(); - u.push(z); - } - a.length > 0 && (c = u.join(" -> ")); - } - return (!c || c.trim().length === 0) && (c = this.consoleLogger), me.getLogger(c); - }), this.stackSize = 1; - let n; - r ? n = r : n = Ie.getEnvLevel(i), n = n ?? X.LOG_LEVEL_INFO, me.setLevel(n); - const o = (s, c, l, u) => { - const a = [], y = t ?? Ie.getEnvLogger(i) ?? "zhi"; - return a.push(U.gray("[") + u(y) + U.gray("]")), a.push(U.gray("[") + U.gray(l.toString()) + U.gray("]")), a.push(u(s.toUpperCase().toString())), a.push(u(c)), a.push(U.gray(":")), a; - }; - De.reg(me), De.apply(me, { - format(s, c, l) { - let u = []; - const a = c ?? ""; - switch (s) { - case X.LOG_LEVEL_TRACE: - u = o(s, a, l, U.gray); - break; - case X.LOG_LEVEL_DEBUG: - u = o(s, a, l, U.blue); - break; - case X.LOG_LEVEL_INFO: - u = o(s, a, l, U.green); - break; - case X.LOG_LEVEL_WARN: - u = o(s, a, l, U.yellow); - break; - case X.LOG_LEVEL_ERROR: - u = o(s, a, l, U.red); - break; - default: - u = o(X.LOG_LEVEL_INFO, a, l, U.green); - break; - } - return u.join(" "); - } - }); - } - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(r) { - this.stackSize = r ?? 1; - } - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack() { - let r; - try { - r = mt(); - } catch { - r = []; - } - return r; - } -} -class kt { - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - constructor(r, t, i) { - ge(this, "logger"), this.logger = new Rt(r, t, i); - } - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - getLogger(r, t) { - return this.logger.setStackSize(t), this.logger.getLogger(r); - } -} -let Ce = class extends kt { - constructor(r, t, i) { - super(r, t, i); - } - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(r, t) { - return super.getLogger(r, t); - } -}, Nt = class Ke { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(r, t) { - return Ke.customLogFactory(void 0, void 0, r).getLogger(void 0, t); - } - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(r, t, i) { - return new Ce(r, t, i); - } - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(r, t) { - return new Ce(void 0, r, t); - } -}; -class Dt { - constructor() { - fe(this, "logger"), fe(this, "siyuanDevice"), fe(this, "initMethods", { - /** - * 初始化 sy-post-publisher 配置文件存储,适用于【iframe挂件模式】、【新窗口模式】以及【js片段模式】 - */ - initLocalStorageMethod: (t) => { - const i = this.siyuanDevice.siyuanWindow(), n = this.siyuanDevice.siyuanDataPath(); - if (i.JsonLocalStorage) { - this.logger.debug("JsonLocalStorage loaded, ignore.", t); - return; - } - this.siyuanDevice.requireLib( - `${n}/widgets/sy-post-publisher/lib/json-localstorage/json-localstorage.js` - ).init("../../../../storage/syp/"); - }, - /** - * 初始化插槽,仅【iframe挂件模式】、【自定义js片段模式】可用 - */ - initSlotMethod: () => { - const t = this.siyuanDevice.siyuanDataPath(); - this.siyuanDevice.requireLib(`${t}/widgets/sy-post-publisher/lib/siyuan/silot.js`)(); - }, - /** - * 初始化主题适配 - * @param entryName 入口名称 - */ - initThemeAdaptor: (t) => { - const i = this.siyuanDevice.siyuanWindow(), n = this.siyuanDevice.siyuanDataPath(); - if (i.customstyle) { - this.logger.debug("customstyle loaded, ignore.", t); - return; - } - const o = this.siyuanDevice.requireLib(`${n}/widgets/sy-post-publisher/lib/siyuan/theme.js`); - setTimeout(o, 3e3); - }, - /** - * 初始化初始化发布辅助功能 - * @param entryName 入口名称 - */ - initPublishHelper: (t) => { - const i = this.siyuanDevice.siyuanWindow(), n = this.siyuanDevice.siyuanDataPath(); - if (i.syp) { - this.logger.debug("syp已挂载,忽略", t); - return; - } - this.siyuanDevice.requireLib( - `${n}/widgets/sy-post-publisher/lib/siyuan/publish-helper.js` - )(); - }, - /** - * 初始化 PicGO 配置 - * @param entryName 入口名称 - */ - initPicgoExtension: (t) => { - const i = this.siyuanDevice.siyuanWindow(), n = this.siyuanDevice.siyuanDataPath(); - if (i.SyPicgo) { - this.logger.debug("SyPicgo loaded, ignore.", t); - return; - } - const o = this.siyuanDevice.requireLib( - `${n}/widgets/sy-post-publisher/lib/picgo/syPicgo.js` - ).default, s = o.getCrossPlatformAppDataFolder(), c = `${n}/widgets/sy-post-publisher/lib/picgo/picgo.cfg.json`, l = o.joinPath(s, "sy-picgo"), u = "picgo.cfg.json", a = o.joinPath(l, u); - o.upgradeCfg(c, l, u), this.logger.debug("PicGO配置文件初始化为=>", a); - const y = o.initPicgo(a); - i.SyPicgo = y, this.logger.debug("syPicgo=>", y); - }, - /** - * 初始化 SyCmd 配置,适用于【iframe挂件模式】、【新窗口模式】以及【js片段模式】 - * @param entryName 入口名称 - */ - initCmder: (t) => { - const i = this.siyuanDevice.siyuanWindow(), n = this.siyuanDevice.siyuanDataPath(); - if (i.SyCmd) { - this.logger.debug("SyCmd已挂载,忽略", t); - return; - } - const o = this.siyuanDevice.requireLib(`${n}/widgets/sy-post-publisher/lib/cmd/syCmd.js`); - i.SyCmd = o, this.logger.debug("syCmd=>", o); - } - }), fe(this, "doInit", (t = {}) => { - const { - isInitLocalStorage: i = !1, - isInitSlot: n = !1, - isInitThemeAdaptor: o = !1, - isInitPublishHelper: s = !1, - isInitPicgoExtension: c = !1, - isInitCmder: l = !1 - } = t; - i && this.initMethods.initLocalStorageMethod("PublisherHook"), n && this.initMethods.initSlotMethod(), o && this.initMethods.initThemeAdaptor("PublisherHook"), s && this.initMethods.initPublishHelper("PublisherHook"), c && this.initMethods.initPicgoExtension("PublisherHook"), l && this.initMethods.initCmder("PublisherHook"); - }); - const r = new yt({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 }); - this.logger = Nt.customLogFactory(X.LOG_LEVEL_INFO, "publish-hook", r).getLogger(), this.siyuanDevice = re; - } - async init() { - this.logger.info("Initiating sy-post-publisher from publish hook ..."); - try { - this.doInit({ - isInitLocalStorage: !0, - isInitSlot: !0, - isInitThemeAdaptor: !0, - isInitPublishHelper: !0, - isInitPicgoExtension: !0, - isInitCmder: !0 - }); - } catch (r) { - this.logger.warn("Failed to init sy-post-publisher,it may not work in some case.Error=>", r); - } - } -} -var It = Object.defineProperty, St = (e, r, t) => r in e ? It(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, he = (e, r, t) => (St(e, typeof r != "symbol" ? r + "" : r, t), t); -let oe = class { -}; -he(oe, "NODE_ENV_KEY", "NODE_ENV"), /** -* 开发环境 -*/ -he(oe, "NODE_ENV_DEVELOPMENT", "development"), /** -* 生产环境 -*/ -he(oe, "NODE_ENV_PRODUCTION", "production"), /** -* 测试环境 -*/ -he(oe, "NODE_ENV_TEST", "test"), /** -* 是否处于调试模式 -*/ -he(oe, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -class xt { - /** - * 环境初始化 - * - * @param envMeta - 需要传入 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false} 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(r) { - he(this, "envMeta"), this.envMeta = r; - } - /** - * 是否是开发阶段调试 - */ - isNodeDev() { - return this.getEnv(oe.NODE_ENV_KEY) === oe.NODE_ENV_DEVELOPMENT; - } - /** - * 是否是调试阶段 - */ - isDev() { - return this.isNodeDev() || this.getBooleanEnv(oe.VITE_DEBUG_MODE_KEY); - } - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(r) { - let t; - try { - this.envMeta[r] && (t = this.envMeta[r]); - } catch { - } - return t; - } - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(r) { - return this.getEnv(r) ?? ""; - } - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(r) { - let t = !1; - return this.getEnv(r) && (t = this.getStringEnv(r).toLowerCase() === "true"), t; - } - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(r, t) { - const i = this.getStringEnv(r); - return i.trim().length == 0 ? t : i; - } -} -var At = Object.defineProperty, Ct = (e, r, t) => r in e ? At(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, pe = (e, r, t) => (Ct(e, typeof r != "symbol" ? r + "" : r, t), t); -class Pe { -} -pe(Pe, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), pe(Pe, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX"); -var Q = /* @__PURE__ */ ((e) => (e.LOG_LEVEL_TRACE = "TRACE", e.LOG_LEVEL_DEBUG = "DEBUG", e.LOG_LEVEL_INFO = "INFO", e.LOG_LEVEL_WARN = "WARN", e.LOG_LEVEL_ERROR = "ERROR", e))(Q || {}), Xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function Re(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var Qe = { exports: {} }; -(function(e) { - (function(r, t) { - e.exports ? e.exports = t() : r.log = t(); - })(Xe, function() { - var r = function() { - }, t = "undefined", i = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), n = [ - "trace", - "debug", - "info", - "warn", - "error" - ]; - function o(h, f) { - var E = h[f]; - if (typeof E.bind == "function") - return E.bind(h); - try { - return Function.prototype.bind.call(E, h); - } catch { - return function() { - return Function.prototype.apply.apply(E, [h, arguments]); - }; - } - } - function s() { - console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace(); - } - function c(h) { - return h === "debug" && (h = "log"), typeof console === t ? !1 : h === "trace" && i ? s : console[h] !== void 0 ? o(console, h) : console.log !== void 0 ? o(console, "log") : r; - } - function l(h, f) { - for (var E = 0; E < n.length; E++) { - var p = n[E]; - this[p] = E < h ? r : this.methodFactory(p, h, f); - } - this.log = this.debug; - } - function u(h, f, E) { - return function() { - typeof console !== t && (l.call(this, f, E), this[h].apply(this, arguments)); - }; - } - function a(h, f, E) { - return c(h) || u.apply(this, arguments); - } - function y(h, f, E) { - var p = this, ee; - f = f ?? "WARN"; - var d = "loglevel"; - typeof h == "string" ? d += ":" + h : typeof h == "symbol" && (d = void 0); - function ae(g) { - var P = (n[g] || "silent").toUpperCase(); - if (!(typeof window === t || !d)) { - try { - window.localStorage[d] = P; - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(d) + "=" + P + ";"; - } catch { - } - } - } - function te() { - var g; - if (!(typeof window === t || !d)) { - try { - g = window.localStorage[d]; - } catch { - } - if (typeof g === t) - try { - var P = window.document.cookie, x = P.indexOf( - encodeURIComponent(d) + "=" - ); - x !== -1 && (g = /^([^;]+)/.exec(P.slice(x))[1]); - } catch { - } - return p.levels[g] === void 0 && (g = void 0), g; - } - } - function se() { - if (!(typeof window === t || !d)) { - try { - window.localStorage.removeItem(d); - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(d) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; - } catch { - } - } - } - p.name = h, p.levels = { - TRACE: 0, - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - SILENT: 5 - }, p.methodFactory = E || a, p.getLevel = function() { - return ee; - }, p.setLevel = function(g, P) { - if (typeof g == "string" && p.levels[g.toUpperCase()] !== void 0 && (g = p.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= p.levels.SILENT) { - if (ee = g, P !== !1 && ae(g), l.call(p, g, h), typeof console === t && g < p.levels.SILENT) - return "No console available for logging"; - } else - throw "log.setLevel() called with invalid level: " + g; - }, p.setDefaultLevel = function(g) { - f = g, te() || p.setLevel(g, !1); - }, p.resetLevel = function() { - p.setLevel(f, !1), se(); - }, p.enableAll = function(g) { - p.setLevel(p.levels.TRACE, g); - }, p.disableAll = function(g) { - p.setLevel(p.levels.SILENT, g); - }; - var B = te(); - B == null && (B = f), p.setLevel(B, !1); - } - var m = new y(), v = {}; - m.getLogger = function(h) { - if (typeof h != "symbol" && typeof h != "string" || h === "") - throw new TypeError("You must supply a name when creating a logger."); - var f = v[h]; - return f || (f = v[h] = new y( - h, - m.getLevel(), - m.methodFactory - )), f; - }; - var z = typeof window !== t ? window.log : void 0; - return m.noConflict = function() { - return typeof window !== t && window.log === m && (window.log = z), m; - }, m.getLoggers = function() { - return v; - }, m.default = m, m; - }); -})(Qe); -var Wt = Qe.exports; -const Ee = /* @__PURE__ */ Re(Wt); -var et = { exports: {} }; -(function(e) { - (function(r, t) { - e.exports ? e.exports = t() : r.prefix = t(r); - })(Xe, function(r) { - var t = function(a) { - for (var y = 1, m = arguments.length, v; y < m; y++) - for (v in arguments[y]) - Object.prototype.hasOwnProperty.call(arguments[y], v) && (a[v] = arguments[y][v]); - return a; - }, i = { - template: "[%t] %l:", - levelFormatter: function(a) { - return a.toUpperCase(); - }, - nameFormatter: function(a) { - return a || "root"; - }, - timestampFormatter: function(a) { - return a.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); - }, - format: void 0 - }, n, o = {}, s = function(a) { - if (!a || !a.getLogger) - throw new TypeError("Argument is not a root logger"); - n = a; - }, c = function(a, y) { - if (!a || !a.setLevel) - throw new TypeError("Argument is not a logger"); - var m = a.methodFactory, v = a.name || "", z = o[v] || o[""] || i; - function h(f, E, p) { - var ee = m(f, E, p), d = o[p] || o[""], ae = d.template.indexOf("%t") !== -1, te = d.template.indexOf("%l") !== -1, se = d.template.indexOf("%n") !== -1; - return function() { - for (var B = "", g = arguments.length, P = Array(g), x = 0; x < g; x++) - P[x] = arguments[x]; - if (v || !o[p]) { - var ye = d.timestampFormatter(/* @__PURE__ */ new Date()), de = d.levelFormatter(f), we = d.nameFormatter(p); - d.format ? B += d.format(de, we, ye) : (B += d.template, ae && (B = B.replace(/%t/, ye)), te && (B = B.replace(/%l/, de)), se && (B = B.replace(/%n/, we))), P.length && typeof P[0] == "string" ? P[0] = B + " " + P[0] : P.unshift(B); - } - ee.apply(void 0, P); - }; - } - return o[v] || (a.methodFactory = h), y = y || {}, y.template && (y.format = void 0), o[v] = t({}, z, y), a.setLevel(a.getLevel()), n || a.warn( - "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md" - ), a; - }, l = { - reg: s, - apply: c - }, u; - return r && (u = r.prefix, l.noConflict = function() { - return r.prefix === l && (r.prefix = u), l; - }), l; - }); -})(et); -var $t = et.exports; -const We = /* @__PURE__ */ Re($t); -function jt() { - const e = Error.prepareStackTrace; - Error.prepareStackTrace = (t, i) => i; - const r = new Error().stack.slice(1); - return Error.prepareStackTrace = e, r; -} -class Le { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - static stringToEnumValue(r, t) { - return r[Object.keys(r).filter((i) => r[i].toString() === t)[0]]; - } - /** - * 获取配置的日志级别 - */ - static getEnvLevel(r) { - if (!r) - return; - const t = r.getEnvOrDefault(Pe.LOG_LEVEL_KEY, Q.LOG_LEVEL_INFO), i = Le.stringToEnumValue(Q, t.toUpperCase()); - return i || console.warn( - "[zhi-log] LOG_LEVEL is invalid in you .env file.It must be either debug, info, warn or error, fallback to default info level" - ), i; - } - /** - * 获取默认日志 - */ - static getEnvLogger(r) { - return r ? r.getEnv(Pe.LOG_PREFIX_KEY) : void 0; - } -} -var ke = { exports: {} }, $e = { exports: {} }, je; -function qt() { - return je || (je = 1, function(e) { - const r = typeof process < "u" && process.env.TERM_PROGRAM === "Hyper", t = typeof process < "u" && process.platform === "win32", i = typeof process < "u" && process.platform === "linux", n = { - ballotDisabled: "☒", - ballotOff: "☐", - ballotOn: "☑", - bullet: "•", - bulletWhite: "◦", - fullBlock: "█", - heart: "❤", - identicalTo: "≡", - line: "─", - mark: "※", - middot: "·", - minus: "-", - multiplication: "×", - obelus: "÷", - pencilDownRight: "✎", - pencilRight: "✏", - pencilUpRight: "✐", - percent: "%", - pilcrow2: "❡", - pilcrow: "¶", - plusMinus: "±", - question: "?", - section: "§", - starsOff: "☆", - starsOn: "★", - upDownArrow: "↕" - }, o = Object.assign({}, n, { - check: "√", - cross: "×", - ellipsisLarge: "...", - ellipsis: "...", - info: "i", - questionSmall: "?", - pointer: ">", - pointerSmall: "»", - radioOff: "( )", - radioOn: "(*)", - warning: "‼" - }), s = Object.assign({}, n, { - ballotCross: "✘", - check: "✔", - cross: "✖", - ellipsisLarge: "⋯", - ellipsis: "…", - info: "ℹ", - questionFull: "?", - questionSmall: "﹖", - pointer: i ? "▸" : "❯", - pointerSmall: i ? "‣" : "›", - radioOff: "◯", - radioOn: "◉", - warning: "⚠" - }); - e.exports = t && !r ? o : s, Reflect.defineProperty(e.exports, "common", { enumerable: !1, value: n }), Reflect.defineProperty(e.exports, "windows", { enumerable: !1, value: o }), Reflect.defineProperty(e.exports, "other", { enumerable: !1, value: s }); - }($e)), $e.exports; -} -const Gt = (e) => e !== null && typeof e == "object" && !Array.isArray(e), Ft = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, Vt = () => typeof process < "u" ? process.env.FORCE_COLOR !== "0" : !1, tt = () => { - const e = { - enabled: Vt(), - visible: !0, - styles: {}, - keys: {} - }, r = (o) => { - let s = o.open = `\x1B[${o.codes[0]}m`, c = o.close = `\x1B[${o.codes[1]}m`, l = o.regex = new RegExp(`\\u001b\\[${o.codes[1]}m`, "g"); - return o.wrap = (u, a) => { - u.includes(c) && (u = u.replace(l, c + s)); - let y = s + u + c; - return a ? y.replace(/\r*\n/g, `${c}$&${s}`) : y; - }, o; - }, t = (o, s, c) => typeof o == "function" ? o(s) : o.wrap(s, c), i = (o, s) => { - if (o === "" || o == null) - return ""; - if (e.enabled === !1) - return o; - if (e.visible === !1) - return ""; - let c = "" + o, l = c.includes(` -`), u = s.length; - for (u > 0 && s.includes("unstyle") && (s = [.../* @__PURE__ */ new Set(["unstyle", ...s])].reverse()); u-- > 0; ) - c = t(e.styles[s[u]], c, l); - return c; - }, n = (o, s, c) => { - e.styles[o] = r({ name: o, codes: s }), (e.keys[c] || (e.keys[c] = [])).push(o), Reflect.defineProperty(e, o, { - configurable: !0, - enumerable: !0, - set(l) { - e.alias(o, l); - }, - get() { - let l = (u) => i(u, l.stack); - return Reflect.setPrototypeOf(l, e), l.stack = this.stack ? this.stack.concat(o) : [o], l; - } - }); - }; - return n("reset", [0, 0], "modifier"), n("bold", [1, 22], "modifier"), n("dim", [2, 22], "modifier"), n("italic", [3, 23], "modifier"), n("underline", [4, 24], "modifier"), n("inverse", [7, 27], "modifier"), n("hidden", [8, 28], "modifier"), n("strikethrough", [9, 29], "modifier"), n("black", [30, 39], "color"), n("red", [31, 39], "color"), n("green", [32, 39], "color"), n("yellow", [33, 39], "color"), n("blue", [34, 39], "color"), n("magenta", [35, 39], "color"), n("cyan", [36, 39], "color"), n("white", [37, 39], "color"), n("gray", [90, 39], "color"), n("grey", [90, 39], "color"), n("bgBlack", [40, 49], "bg"), n("bgRed", [41, 49], "bg"), n("bgGreen", [42, 49], "bg"), n("bgYellow", [43, 49], "bg"), n("bgBlue", [44, 49], "bg"), n("bgMagenta", [45, 49], "bg"), n("bgCyan", [46, 49], "bg"), n("bgWhite", [47, 49], "bg"), n("blackBright", [90, 39], "bright"), n("redBright", [91, 39], "bright"), n("greenBright", [92, 39], "bright"), n("yellowBright", [93, 39], "bright"), n("blueBright", [94, 39], "bright"), n("magentaBright", [95, 39], "bright"), n("cyanBright", [96, 39], "bright"), n("whiteBright", [97, 39], "bright"), n("bgBlackBright", [100, 49], "bgBright"), n("bgRedBright", [101, 49], "bgBright"), n("bgGreenBright", [102, 49], "bgBright"), n("bgYellowBright", [103, 49], "bgBright"), n("bgBlueBright", [104, 49], "bgBright"), n("bgMagentaBright", [105, 49], "bgBright"), n("bgCyanBright", [106, 49], "bgBright"), n("bgWhiteBright", [107, 49], "bgBright"), e.ansiRegex = Ft, e.hasColor = e.hasAnsi = (o) => (e.ansiRegex.lastIndex = 0, typeof o == "string" && o !== "" && e.ansiRegex.test(o)), e.alias = (o, s) => { - let c = typeof s == "string" ? e[s] : s; - if (typeof c != "function") - throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); - c.stack || (Reflect.defineProperty(c, "name", { value: o }), e.styles[o] = c, c.stack = [o]), Reflect.defineProperty(e, o, { - configurable: !0, - enumerable: !0, - set(l) { - e.alias(o, l); - }, - get() { - let l = (u) => i(u, l.stack); - return Reflect.setPrototypeOf(l, e), l.stack = this.stack ? this.stack.concat(c.stack) : c.stack, l; - } - }); - }, e.theme = (o) => { - if (!Gt(o)) - throw new TypeError("Expected theme to be an object"); - for (let s of Object.keys(o)) - e.alias(s, o[s]); - return e; - }, e.alias("unstyle", (o) => typeof o == "string" && o !== "" ? (e.ansiRegex.lastIndex = 0, o.replace(e.ansiRegex, "")) : ""), e.alias("noop", (o) => o), e.none = e.clear = e.noop, e.stripColor = e.unstyle, e.symbols = qt(), e.define = n, e; -}; -ke.exports = tt(); -ke.exports.create = tt; -var Ut = ke.exports; -const M = /* @__PURE__ */ Re(Ut); -let Be, rt, nt, it, ot = !0; -typeof process < "u" && ({ FORCE_COLOR: Be, NODE_DISABLE_COLORS: rt, NO_COLOR: nt, TERM: it } = process.env || {}, ot = process.stdout && process.stdout.isTTY); -const b = { - enabled: !rt && nt == null && it !== "dumb" && (Be != null && Be !== "0" || ot), - // modifiers - reset: O(0, 0), - bold: O(1, 22), - dim: O(2, 22), - italic: O(3, 23), - underline: O(4, 24), - inverse: O(7, 27), - hidden: O(8, 28), - strikethrough: O(9, 29), - // colors - black: O(30, 39), - red: O(31, 39), - green: O(32, 39), - yellow: O(33, 39), - blue: O(34, 39), - magenta: O(35, 39), - cyan: O(36, 39), - white: O(37, 39), - gray: O(90, 39), - grey: O(90, 39), - // background colors - bgBlack: O(40, 49), - bgRed: O(41, 49), - bgGreen: O(42, 49), - bgYellow: O(43, 49), - bgBlue: O(44, 49), - bgMagenta: O(45, 49), - bgCyan: O(46, 49), - bgWhite: O(47, 49) -}; -function qe(e, r) { - let t = 0, i, n = "", o = ""; - for (; t < e.length; t++) - i = e[t], n += i.open, o += i.close, ~r.indexOf(i.close) && (r = r.replace(i.rgx, i.close + i.open)); - return n + r + o; -} -function Mt(e, r) { - let t = { has: e, keys: r }; - return t.reset = b.reset.bind(t), t.bold = b.bold.bind(t), t.dim = b.dim.bind(t), t.italic = b.italic.bind(t), t.underline = b.underline.bind(t), t.inverse = b.inverse.bind(t), t.hidden = b.hidden.bind(t), t.strikethrough = b.strikethrough.bind(t), t.black = b.black.bind(t), t.red = b.red.bind(t), t.green = b.green.bind(t), t.yellow = b.yellow.bind(t), t.blue = b.blue.bind(t), t.magenta = b.magenta.bind(t), t.cyan = b.cyan.bind(t), t.white = b.white.bind(t), t.gray = b.gray.bind(t), t.grey = b.grey.bind(t), t.bgBlack = b.bgBlack.bind(t), t.bgRed = b.bgRed.bind(t), t.bgGreen = b.bgGreen.bind(t), t.bgYellow = b.bgYellow.bind(t), t.bgBlue = b.bgBlue.bind(t), t.bgMagenta = b.bgMagenta.bind(t), t.bgCyan = b.bgCyan.bind(t), t.bgWhite = b.bgWhite.bind(t), t; -} -function O(e, r) { - let t = { - open: `\x1B[${e}m`, - close: `\x1B[${r}m`, - rgx: new RegExp(`\\x1b\\[${r}m`, "g") - }; - return function(i) { - return this !== void 0 && this.has !== void 0 ? (~this.has.indexOf(e) || (this.has.push(e), this.keys.push(t)), i === void 0 ? this : b.enabled ? qe(this.keys, i + "") : i + "") : i === void 0 ? Mt([e], [t]) : b.enabled ? qe([t], i + "") : i + ""; - }; -} -var Jt = Object.defineProperty, zt = (e, r, t) => r in e ? Jt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, I = (e, r, t) => (zt(e, typeof r != "symbol" ? r + "" : r, t), t); -const H = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return H.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let T = H; -I(T, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -I(T, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -I(T, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -I(T, "isElectron", () => !H.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -I(T, "hasNodeEnv", () => H.isElectron() || H.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -I(T, "getQueryString", (e) => { - if (!H.isInBrowser) - return ""; - const r = window.location.search.substring(1).split("&"); - for (let t = 0; t < r.length; t++) { - const i = r[t].split("="); - if (i[0] === e) - return i[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -I(T, "replaceUrlParam", (e, r, t) => { - t == null && (t = ""); - const i = new RegExp("\\b(" + r + "=).*?(&|#|$)"); - if (e.search(i) >= 0) - return e.replace(i, "$1" + t + "$2"); - const [n, o] = e.split("#"), [s, c] = n.split("?"), l = new URLSearchParams(c); - l.set(r, t); - const u = l.toString(), a = s + (u ? "?" + u : ""); - return o ? a + "#" + o : a; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -I(T, "setUrlParameter", (e, r, t) => { - if (e.includes(r)) - return H.replaceUrlParam(e, r, t); - const i = e.split("#"); - let n = i[0]; - const o = i[1]; - return n.includes("?") ? n += `&${r}=${t}` : n += `?${r}=${t}`, o && (n += "#" + o), n; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -I(T, "reloadTabPage", (e, r = 200) => { - setTimeout(function() { - if (H.isInBrowser) { - const t = window.location.href; - window.location.href = H.setUrlParameter(t, "tab", e); - } - }, r); -}), /** -* 刷新当前tab页面 -*/ -I(T, "reloadPage", () => { - setTimeout(function() { - H.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -I(T, "reloadPageWithMessageCallback", (e, r) => { - r && r(e), setTimeout(function() { - H.isInBrowser && window.location.reload(); - }, 200); -}); -var W = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(W || {}); -const G = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return T.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, r) { - let t = e; - switch (r) { - case W.BasePathType_Appearance: - t = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case W.BasePathType_Data: - t = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case W.BasePathType_Themes: - t = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case W.BasePathType_ZhiTheme: - t = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: i } = await import( - /* @vite-ignore */ - t - ); - return i; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, W.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (T.hasNodeEnv()) { - const r = this.requireLib("path"); - if (r) - return r.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(T.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (T.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let ce = G; -I(ce, "isInSiyuanWidget", () => T.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -I(ce, "isInSiyuanNewWin", () => !T.isInBrowser || !T.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -I(ce, "requireLib", (e, r = !0, t = W.BasePathType_None) => { - if (!T.hasNodeEnv()) - throw new Error("require ony works on node env"); - let i = e; - if (!r) - switch (t) { - case W.BasePathType_Appearance: - i = G.joinPath(G.siyuanAppearancePath(), e); - break; - case W.BasePathType_Data: - i = G.joinPath(G.siyuanDataPath(), e); - break; - case W.BasePathType_Themes: - i = G.joinPath(G.siyuanAppearancePath(), "themes", e); - break; - case W.BasePathType_ZhiTheme: - i = G.joinPath(G.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const n = G.siyuanWindow(); - if (!n) - return require(i); - if (typeof n.require < "u") - return n.require(i); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -I(ce, "requireAppearanceLib", (e) => G.requireLib(e, !1, W.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -I(ce, "requireDataLib", (e) => G.requireLib(e, !1, W.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -I(ce, "requireThemesLib", (e) => G.requireLib(e, !1, W.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -I(ce, "requireZhiThemeLib", (e) => G.requireLib(e, !1, W.BasePathType_ZhiTheme)); -const J = { - white: (e) => T.isElectron() ? M.whiteBright(e) : b.white(e), - gray: (e) => T.isElectron() ? M.gray(e) : b.gray(e), - blue: (e) => T.isElectron() ? M.blue(e) : b.blue(e), - green: (e) => T.isElectron() ? M.green(e) : b.green(e), - yellow: (e) => T.isElectron() ? M.yellow(e) : b.yellow(e), - red: (e) => T.isElectron() ? M.red(e) : b.red(e), - bgWhite: (e) => T.isElectron() ? M.bgWhiteBright(e) : b.bgWhite(e), - bgGrey: (e) => T.isElectron() ? M.bgCyanBright(e) : b.bgCyan(e), - bgBlue: (e) => T.isElectron() ? M.bgBlueBright(e) : b.bgBlue(e), - bgGreen: (e) => T.isElectron() ? M.bgGreenBright(e) : b.bgGreen(e), - bgYellow: (e) => T.isElectron() ? M.bgYellowBright(e) : b.bgYellow(e), - bgRed: (e) => T.isElectron() ? M.bgRedBright(e) : b.bgRed(e) -}; -class Yt { - constructor(r, t, i) { - pe(this, "consoleLogger", "console"), pe(this, "stackSize", 1), pe(this, "getLogger", (s) => { - let c; - if (s) - c = s; - else { - const l = this.getCallStack(), u = [], a = []; - for (let y = 0; y < l.length; y++) { - const m = l[y], v = m.getFileName() ?? "none"; - if (y > this.stackSize - 1) - break; - const z = v + "-" + m.getLineNumber() + ":" + m.getColumnNumber(); - u.push(z); - } - a.length > 0 && (c = u.join(" -> ")); - } - return (!c || c.trim().length === 0) && (c = this.consoleLogger), Ee.getLogger(c); - }), this.stackSize = 1; - let n; - r ? n = r : n = Le.getEnvLevel(i), n = n ?? Q.LOG_LEVEL_INFO, Ee.setLevel(n); - const o = (s, c, l, u) => { - const a = [], y = t ?? Le.getEnvLogger(i) ?? "zhi"; - return a.push(J.gray("[") + u(y) + J.gray("]")), a.push(J.gray("[") + J.gray(l.toString()) + J.gray("]")), a.push(u(s.toUpperCase().toString())), a.push(u(c)), a.push(J.gray(":")), a; - }; - We.reg(Ee), We.apply(Ee, { - format(s, c, l) { - let u = []; - const a = c ?? ""; - switch (s) { - case Q.LOG_LEVEL_TRACE: - u = o(s, a, l, J.gray); - break; - case Q.LOG_LEVEL_DEBUG: - u = o(s, a, l, J.blue); - break; - case Q.LOG_LEVEL_INFO: - u = o(s, a, l, J.green); - break; - case Q.LOG_LEVEL_WARN: - u = o(s, a, l, J.yellow); - break; - case Q.LOG_LEVEL_ERROR: - u = o(s, a, l, J.red); - break; - default: - u = o(Q.LOG_LEVEL_INFO, a, l, J.green); - break; - } - return u.join(" "); - } - }); - } - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(r) { - this.stackSize = r ?? 1; - } - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack() { - let r; - try { - r = jt(); - } catch { - r = []; - } - return r; - } -} -class Zt { - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - constructor(r, t, i) { - pe(this, "logger"), this.logger = new Yt(r, t, i); - } - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - getLogger(r, t) { - return this.logger.setStackSize(t), this.logger.getLogger(r); - } -} -class Ge extends Zt { - constructor(r, t, i) { - super(r, t, i); - } - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(r, t) { - return super.getLogger(r, t); - } -} -class Ne { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(r, t) { - return Ne.customLogFactory(void 0, void 0, r).getLogger(void 0, t); - } - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(r, t, i) { - return new Ge(r, t, i); - } - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(r, t) { - return new Ge(void 0, r, t); - } -} -var Ht = Object.defineProperty, Kt = (e, r, t) => r in e ? Ht(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, S = (e, r, t) => (Kt(e, typeof r != "symbol" ? r + "" : r, t), t); -const K = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return K.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let k = K; -S(k, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -S(k, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -S(k, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -S(k, "isElectron", () => !K.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -S(k, "hasNodeEnv", () => K.isElectron() || K.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -S(k, "getQueryString", (e) => { - if (!K.isInBrowser) - return ""; - const r = window.location.search.substring(1).split("&"); - for (let t = 0; t < r.length; t++) { - const i = r[t].split("="); - if (i[0] === e) - return i[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -S(k, "replaceUrlParam", (e, r, t) => { - t == null && (t = ""); - const i = new RegExp("\\b(" + r + "=).*?(&|#|$)"); - if (e.search(i) >= 0) - return e.replace(i, "$1" + t + "$2"); - const [n, o] = e.split("#"), [s, c] = n.split("?"), l = new URLSearchParams(c); - l.set(r, t); - const u = l.toString(), a = s + (u ? "?" + u : ""); - return o ? a + "#" + o : a; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -S(k, "setUrlParameter", (e, r, t) => { - if (e.includes(r)) - return K.replaceUrlParam(e, r, t); - const i = e.split("#"); - let n = i[0]; - const o = i[1]; - return n.includes("?") ? n += `&${r}=${t}` : n += `?${r}=${t}`, o && (n += "#" + o), n; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -S(k, "reloadTabPage", (e, r = 200) => { - setTimeout(function() { - if (K.isInBrowser) { - const t = window.location.href; - window.location.href = K.setUrlParameter(t, "tab", e); - } - }, r); -}), /** -* 刷新当前tab页面 -*/ -S(k, "reloadPage", () => { - setTimeout(function() { - K.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -S(k, "reloadPageWithMessageCallback", (e, r) => { - r && r(e), setTimeout(function() { - K.isInBrowser && window.location.reload(); - }, 200); -}); -var $ = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))($ || {}); -const F = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return k.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, r) { - let t = e; - switch (r) { - case $.BasePathType_Appearance: - t = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case $.BasePathType_Data: - t = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case $.BasePathType_Themes: - t = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case $.BasePathType_ZhiTheme: - t = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: i } = await import( - /* @vite-ignore */ - t - ); - return i; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, $.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (k.hasNodeEnv()) { - const r = this.requireLib("path"); - if (r) - return r.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(k.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (k.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let ne = F; -S(ne, "isInSiyuanWidget", () => k.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -S(ne, "isInSiyuanNewWin", () => !k.isInBrowser || !k.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -S(ne, "requireLib", (e, r = !0, t = $.BasePathType_None) => { - if (!k.hasNodeEnv()) - throw new Error("require ony works on node env"); - let i = e; - if (!r) - switch (t) { - case $.BasePathType_Appearance: - i = F.joinPath(F.siyuanAppearancePath(), e); - break; - case $.BasePathType_Data: - i = F.joinPath(F.siyuanDataPath(), e); - break; - case $.BasePathType_Themes: - i = F.joinPath(F.siyuanAppearancePath(), "themes", e); - break; - case $.BasePathType_ZhiTheme: - i = F.joinPath(F.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const n = F.siyuanWindow(); - if (!n) - return require(i); - if (typeof n.require < "u") - return n.require(i); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -S(ne, "requireAppearanceLib", (e) => F.requireLib(e, !1, $.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -S(ne, "requireDataLib", (e) => F.requireLib(e, !1, $.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -S(ne, "requireThemesLib", (e) => F.requireLib(e, !1, $.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -S(ne, "requireZhiThemeLib", (e) => F.requireLib(e, !1, $.BasePathType_ZhiTheme)); -const Xt = "c6f0e84b0df40a0c5b9de2b5716fc33f93291f1a"; -class ar { - constructor() { - be(this, "repoHash", Xt); - be(this, "logger"); - be(this, "publishHook"); - be(this, "siyuanDevice"); - const r = new xt({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 }); - this.logger = Ne.customLogFactory(Q.LOG_LEVEL_INFO, "publish-bridge", r).getLogger(), this.siyuanDevice = ne, this.publishHook = new Dt(); - } - async init() { - this.logger.info("Initiating sy-post-publisher from publish bridge ..."); - try { - const t = `${this.siyuanDevice.siyuanDataPath()}/widgets/sy-post-publisher`, i = this.siyuanDevice.requireLib("fs"); - this.logger.info("Widget sy-post-publisher folder=>", t), i.existsSync(t) || (this.logger.info("Widget sy-post-publisher not exist, downloading..."), await this.doDownload(), this.logger.info("Widget sy-post-publisher downloaded")), this.publishHook.doInit({ - isInitLocalStorage: !0, - // 桥接版禁用菜单插槽 - isInitSlot: !1, - isInitThemeAdaptor: !0, - isInitPublishHelper: !0, - isInitPicgoExtension: !0, - isInitCmder: !0 - }); - } catch (r) { - this.logger.error("Failed to init sy-post-publisher,it may not work in some case.Error=>", r); - } - } - async doDownload() { - this.logger.warn("Downloading sy-post-publisher from bazaar..."); - const r = "/api/bazaar/installBazaarWidget", t = { - repoURL: "https://github.com/terwer/sy-post-publisher", - packageName: "sy-post-publisher", - repoHash: this.repoHash, - mode: 0 - }, i = { - body: JSON.stringify(t), - method: "POST" - }; - if ((await (await fetch(r, i)).json()).code == 0) - this.logger.info("Download sy-post-publisher from bazaar success"); - else - throw new Error("Download sy-post-publisher error, this plugin will not work!"); - } -} -export { - ar as default -}; diff --git a/public/libs/zhi-blog-api/README.md b/public/libs/zhi-blog-api/README.md deleted file mode 100644 index aec2043d..00000000 --- a/public/libs/zhi-blog-api/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# zhi-blog-api - -a common blog interface - -Note: BlogApi should be implemented as a specific BlogApi, it cannot be used directly - -## Deps - -``` -├── zhi-env -├── zhi-log -``` - -## Dev - -```bash -pnpm dev -F zhi-blog-api -``` - -## Build - -```bash -pnpm build -F zhi-blog-api -``` - -## Test - -Execute the unit tests via [vitest](https://vitest.dev) - -```bash -pnpm test -F zhi-blog-api -``` - -## Publish - -```bash -pnpm publish -F zhi-blog-api --tag latest -``` \ No newline at end of file diff --git a/public/libs/zhi-blog-api/index.d.ts b/public/libs/zhi-blog-api/index.d.ts deleted file mode 100644 index 9e843223..00000000 --- a/public/libs/zhi-blog-api/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import BlogConfig, { PageType, PasswordType } from "./lib/blogConfig"; -import BlogPlaceholder from "./lib/blogPlaceholder"; -import BlogApi from "./lib/zhi-blog-api"; -import { IBlogApi } from "./lib/IBlogApi"; -import Post from "./lib/models/post"; -import UserBlog from "./lib/models/userBlog"; -import SiteConfig from "./lib/models/siteConfig"; -import PostStatusEnum from "./lib/enums/postStatusEnum"; -import CategoryInfo from "./lib/models/categoryInfo"; -import MediaObject from "./lib/models/mediaObject"; -import BlogConstants from "./lib/blogConstants"; -import BlogTypeEnum from "./lib/enums/blogTypeEnum"; -export { BlogApi }; -export type { IBlogApi }; -export { BlogConfig, BlogPlaceholder, PasswordType, PageType, PostStatusEnum }; -export { Post, UserBlog, SiteConfig, CategoryInfo, MediaObject }; -export { BlogConstants, BlogTypeEnum }; diff --git a/public/libs/zhi-blog-api/index.js b/public/libs/zhi-blog-api/index.js deleted file mode 100644 index 4676e49e..00000000 --- a/public/libs/zhi-blog-api/index.js +++ /dev/null @@ -1,9393 +0,0 @@ -var oo = Object.defineProperty; -var so = (e, t, n) => t in e ? oo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var X = (e, t, n) => (so(e, typeof t != "symbol" ? t + "" : t, n), n); -var io = /* @__PURE__ */ ((e) => (e[e.Markdown = 0] = "Markdown", e[e.Html = 1] = "Html", e[e.Formatter = 2] = "Formatter", e[e.Markdown_And_Formatter = 3] = "Markdown_And_Formatter", e[e.MDX = 4] = "MDX", e))(io || {}), co = /* @__PURE__ */ ((e) => (e[e.PasswordType_Password = 0] = "PasswordType_Password", e[e.PasswordType_Token = 1] = "PasswordType_Token", e))(co || {}); -class nl { - constructor() { - /** - * 首页 - */ - X(this, "home"); - /** - * API地址 - */ - X(this, "apiUrl"); - /** - * 用户名 - */ - X(this, "username"); - /** - * 密码类型 - */ - X(this, "passwordType"); - /** - * 密码 - */ - X(this, "password"); - /** - * 是否发布 - */ - X(this, "apiStatus"); - /** - * 博客名(API获取) - */ - X(this, "blogName"); - /** - * 文章别名key - */ - X(this, "posidKey"); - /** - * 文章预览链接 - */ - X(this, "previewUrl"); - /** - * 文章类型 - */ - X(this, "pageType"); - /** - * 操作提示 - */ - X(this, "placeholder"); - /** - * 是否处理标题 - * - * @protected - */ - X(this, "fixTitle"); - this.home = "", this.apiUrl = "", this.username = "", this.passwordType = 0, this.password = "", this.apiStatus = !1, this.blogName = "", this.posidKey = "", this.previewUrl = "", this.pageType = 0, this.placeholder = void 0, this.fixTitle = !1; - } -} -class ol { - constructor() { - /** - * 首页操作提示 - */ - X(this, "homePlaceholder"); - /** - * API 地址操作提示 - */ - X(this, "apiUrlPlaceholder"); - /** - * 用户名操作提示 - */ - X(this, "usernamePlaceholder"); - /** - * 密码类型操作提示 - */ - X(this, "passwordTypePlaceholder"); - /** - * 密码操作提示 - */ - X(this, "passwordPlaceholder"); - /** - * API状态是否正常操作提示 - */ - X(this, "apiStatusPlaceholder"); - /** - * 博客名(API获取)操作提示 - */ - X(this, "blogNamePlaceholder"); - /** - * 文章别名key操作提示 - */ - X(this, "posidKeyPlaceholder"); - /** - * 文章预览链接操作提示 - */ - X(this, "previewUrlPlaceholder"); - /** - * 文章类型操作提示 - */ - X(this, "pageTypePlaceholder"); - this.homePlaceholder = "", this.apiUrlPlaceholder = "", this.usernamePlaceholder = "", this.passwordTypePlaceholder = "", this.passwordPlaceholder = "", this.apiStatusPlaceholder = !1, this.blogNamePlaceholder = "", this.posidKeyPlaceholder = "", this.previewUrlPlaceholder = "", this.pageTypePlaceholder = ""; - } -} -var mn = /* @__PURE__ */ ((e) => (e.PostStatusEnum_Publish = "publish", e.PostStatusEnum_Draft = "draft", e.PostStatusEnum_Inherit = "inherit", e))(mn || {}); -class lo { - constructor() { - /** - * 文章ID - */ - X(this, "postid"); - /** - * 标题 - */ - X(this, "title"); - /** - * 逗号分隔的标签 - */ - X(this, "mt_keywords"); - /** - * 链接 - */ - X(this, "link"); - /** - * 永久链接 - */ - X(this, "permalink"); - /** - * 摘要 - */ - X(this, "shortDesc"); - /** - * 描述 - */ - X(this, "description"); - /** - * 短评 - */ - X(this, "mt_excerpt"); - /** - * 别名 - */ - X(this, "wp_slug"); - /** - * 创建时间 - */ - X(this, "dateCreated"); - /** - * 分类 - */ - X(this, "categories"); - /** - * 更多 - */ - X(this, "mt_text_more"); - /** - * 发布状态 - */ - X(this, "post_status"); - /** - * 是否发布 - */ - X(this, "isPublished"); - /** - * 发布密码 - */ - X(this, "wp_password"); - this.postid = "", this.title = "", this.mt_keywords = "", this.permalink = "", this.description = "", this.wp_slug = "", this.dateCreated = /* @__PURE__ */ new Date(), this.categories = [], this.isPublished = !0, this.post_status = mn.PostStatusEnum_Publish, this.wp_password = ""; - } -} -var uo = Object.defineProperty, ho = (e, t, n) => t in e ? uo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, xe = (e, t, n) => (ho(e, typeof t != "symbol" ? t + "" : t, n), n), gn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function _n(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var Or = { exports: {} }, bn = {}, rt = {}, gt = {}, Jt = {}, ue = {}, Gt = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0; - class t { - } - e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; - class n extends t { - constructor(A) { - if (super(), !e.IDENTIFIER.test(A)) - throw new Error("CodeGen: name must be a valid identifier"); - this.str = A; - } - toString() { - return this.str; - } - emptyStr() { - return !1; - } - get names() { - return { [this.str]: 1 }; - } - } - e.Name = n; - class a extends t { - constructor(A) { - super(), this._items = typeof A == "string" ? [A] : A; - } - toString() { - return this.str; - } - emptyStr() { - if (this._items.length > 1) - return !1; - const A = this._items[0]; - return A === "" || A === '""'; - } - get str() { - var A; - return (A = this._str) !== null && A !== void 0 ? A : this._str = this._items.reduce((L, r) => `${L}${r}`, ""); - } - get names() { - var A; - return (A = this._names) !== null && A !== void 0 ? A : this._names = this._items.reduce((L, r) => (r instanceof n && (L[r.str] = (L[r.str] || 0) + 1), L), {}); - } - } - e._Code = a, e.nil = new a(""); - function i(k, ...A) { - const L = [k[0]]; - let r = 0; - for (; r < A.length; ) - p(L, A[r]), L.push(k[++r]); - return new a(L); - } - e._ = i; - const l = new a("+"); - function m(k, ...A) { - const L = [M(k[0])]; - let r = 0; - for (; r < A.length; ) - L.push(l), p(L, A[r]), L.push(l, M(k[++r])); - return g(L), new a(L); - } - e.str = m; - function p(k, A) { - A instanceof a ? k.push(...A._items) : A instanceof n ? k.push(A) : k.push(S(A)); - } - e.addCodeArg = p; - function g(k) { - let A = 1; - for (; A < k.length - 1; ) { - if (k[A] === l) { - const L = v(k[A - 1], k[A + 1]); - if (L !== void 0) { - k.splice(A - 1, 3, L); - continue; - } - k[A++] = "+"; - } - A++; - } - } - function v(k, A) { - if (A === '""') - return k; - if (k === '""') - return A; - if (typeof k == "string") - return A instanceof n || k[k.length - 1] !== '"' ? void 0 : typeof A != "string" ? `${k.slice(0, -1)}${A}"` : A[0] === '"' ? k.slice(0, -1) + A.slice(1) : void 0; - if (typeof A == "string" && A[0] === '"' && !(k instanceof n)) - return `"${k}${A.slice(1)}`; - } - function b(k, A) { - return A.emptyStr() ? k : k.emptyStr() ? A : m`${k}${A}`; - } - e.strConcat = b; - function S(k) { - return typeof k == "number" || typeof k == "boolean" || k === null ? k : M(Array.isArray(k) ? k.join(",") : k); - } - function I(k) { - return new a(M(k)); - } - e.stringify = I; - function M(k) { - return JSON.stringify(k).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); - } - e.safeStringify = M; - function O(k) { - return typeof k == "string" && e.IDENTIFIER.test(k) ? new a(`.${k}`) : i`[${k}]`; - } - e.getProperty = O; - function x(k) { - if (typeof k == "string" && e.IDENTIFIER.test(k)) - return new a(`${k}`); - throw new Error(`CodeGen: invalid export name: ${k}, use explicit $id name mapping`); - } - e.getEsmExportName = x; - function T(k) { - return new a(k.toString()); - } - e.regexpCode = T; -})(Gt); -var Ar = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0; - const t = Gt; - class n extends Error { - constructor(v) { - super(`CodeGen: "code" for ${v} not defined`), this.value = v.value; - } - } - var a; - (function(g) { - g[g.Started = 0] = "Started", g[g.Completed = 1] = "Completed"; - })(a = e.UsedValueState || (e.UsedValueState = {})), e.varKinds = { - const: new t.Name("const"), - let: new t.Name("let"), - var: new t.Name("var") - }; - class i { - constructor({ prefixes: v, parent: b } = {}) { - this._names = {}, this._prefixes = v, this._parent = b; - } - toName(v) { - return v instanceof t.Name ? v : this.name(v); - } - name(v) { - return new t.Name(this._newName(v)); - } - _newName(v) { - const b = this._names[v] || this._nameGroup(v); - return `${v}${b.index++}`; - } - _nameGroup(v) { - var b, S; - if (!((S = (b = this._parent) === null || b === void 0 ? void 0 : b._prefixes) === null || S === void 0) && S.has(v) || this._prefixes && !this._prefixes.has(v)) - throw new Error(`CodeGen: prefix "${v}" is not allowed in this scope`); - return this._names[v] = { prefix: v, index: 0 }; - } - } - e.Scope = i; - class l extends t.Name { - constructor(v, b) { - super(b), this.prefix = v; - } - setValue(v, { property: b, itemIndex: S }) { - this.value = v, this.scopePath = (0, t._)`.${new t.Name(b)}[${S}]`; - } - } - e.ValueScopeName = l; - const m = (0, t._)`\n`; - class p extends i { - constructor(v) { - super(v), this._values = {}, this._scope = v.scope, this.opts = { ...v, _n: v.lines ? m : t.nil }; - } - get() { - return this._scope; - } - name(v) { - return new l(v, this._newName(v)); - } - value(v, b) { - var S; - if (b.ref === void 0) - throw new Error("CodeGen: ref must be passed in value"); - const I = this.toName(v), { prefix: M } = I, O = (S = b.key) !== null && S !== void 0 ? S : b.ref; - let x = this._values[M]; - if (x) { - const A = x.get(O); - if (A) - return A; - } else - x = this._values[M] = /* @__PURE__ */ new Map(); - x.set(O, I); - const T = this._scope[M] || (this._scope[M] = []), k = T.length; - return T[k] = b.ref, I.setValue(b, { property: M, itemIndex: k }), I; - } - getValue(v, b) { - const S = this._values[v]; - if (S) - return S.get(b); - } - scopeRefs(v, b = this._values) { - return this._reduceValues(b, (S) => { - if (S.scopePath === void 0) - throw new Error(`CodeGen: name "${S}" has no value`); - return (0, t._)`${v}${S.scopePath}`; - }); - } - scopeCode(v = this._values, b, S) { - return this._reduceValues(v, (I) => { - if (I.value === void 0) - throw new Error(`CodeGen: name "${I}" has no value`); - return I.value.code; - }, b, S); - } - _reduceValues(v, b, S = {}, I) { - let M = t.nil; - for (const O in v) { - const x = v[O]; - if (!x) - continue; - const T = S[O] = S[O] || /* @__PURE__ */ new Map(); - x.forEach((k) => { - if (T.has(k)) - return; - T.set(k, a.Started); - let A = b(k); - if (A) { - const L = this.opts.es5 ? e.varKinds.var : e.varKinds.const; - M = (0, t._)`${M}${L} ${k} = ${A};${this.opts._n}`; - } else if (A = I == null ? void 0 : I(k)) - M = (0, t._)`${M}${A}${this.opts._n}`; - else - throw new n(k); - T.set(k, a.Completed); - }); - } - return M; - } - } - e.ValueScope = p; -})(Ar); -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0; - const t = Gt, n = Ar; - var a = Gt; - Object.defineProperty(e, "_", { enumerable: !0, get: function() { - return a._; - } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() { - return a.str; - } }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() { - return a.strConcat; - } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() { - return a.nil; - } }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() { - return a.getProperty; - } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() { - return a.stringify; - } }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() { - return a.regexpCode; - } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() { - return a.Name; - } }); - var i = Ar; - Object.defineProperty(e, "Scope", { enumerable: !0, get: function() { - return i.Scope; - } }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() { - return i.ValueScope; - } }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() { - return i.ValueScopeName; - } }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() { - return i.varKinds; - } }), e.operators = { - GT: new t._Code(">"), - GTE: new t._Code(">="), - LT: new t._Code("<"), - LTE: new t._Code("<="), - EQ: new t._Code("==="), - NEQ: new t._Code("!=="), - NOT: new t._Code("!"), - OR: new t._Code("||"), - AND: new t._Code("&&"), - ADD: new t._Code("+") - }; - class l { - optimizeNodes() { - return this; - } - optimizeNames(d, y) { - return this; - } - } - class m extends l { - constructor(d, y, z) { - super(), this.varKind = d, this.name = y, this.rhs = z; - } - render({ es5: d, _n: y }) { - const z = d ? n.varKinds.var : this.varKind, J = this.rhs === void 0 ? "" : ` = ${this.rhs}`; - return `${z} ${this.name}${J};` + y; - } - optimizeNames(d, y) { - if (d[this.name.str]) - return this.rhs && (this.rhs = D(this.rhs, d, y)), this; - } - get names() { - return this.rhs instanceof t._CodeOrName ? this.rhs.names : {}; - } - } - class p extends l { - constructor(d, y, z) { - super(), this.lhs = d, this.rhs = y, this.sideEffects = z; - } - render({ _n: d }) { - return `${this.lhs} = ${this.rhs};` + d; - } - optimizeNames(d, y) { - if (!(this.lhs instanceof t.Name && !d[this.lhs.str] && !this.sideEffects)) - return this.rhs = D(this.rhs, d, y), this; - } - get names() { - const d = this.lhs instanceof t.Name ? {} : { ...this.lhs.names }; - return U(d, this.rhs); - } - } - class g extends p { - constructor(d, y, z, J) { - super(d, z, J), this.op = y; - } - render({ _n: d }) { - return `${this.lhs} ${this.op}= ${this.rhs};` + d; - } - } - class v extends l { - constructor(d) { - super(), this.label = d, this.names = {}; - } - render({ _n: d }) { - return `${this.label}:` + d; - } - } - class b extends l { - constructor(d) { - super(), this.label = d, this.names = {}; - } - render({ _n: d }) { - return `break${this.label ? ` ${this.label}` : ""};` + d; - } - } - class S extends l { - constructor(d) { - super(), this.error = d; - } - render({ _n: d }) { - return `throw ${this.error};` + d; - } - get names() { - return this.error.names; - } - } - class I extends l { - constructor(d) { - super(), this.code = d; - } - render({ _n: d }) { - return `${this.code};` + d; - } - optimizeNodes() { - return `${this.code}` ? this : void 0; - } - optimizeNames(d, y) { - return this.code = D(this.code, d, y), this; - } - get names() { - return this.code instanceof t._CodeOrName ? this.code.names : {}; - } - } - class M extends l { - constructor(d = []) { - super(), this.nodes = d; - } - render(d) { - return this.nodes.reduce((y, z) => y + z.render(d), ""); - } - optimizeNodes() { - const { nodes: d } = this; - let y = d.length; - for (; y--; ) { - const z = d[y].optimizeNodes(); - Array.isArray(z) ? d.splice(y, 1, ...z) : z ? d[y] = z : d.splice(y, 1); - } - return d.length > 0 ? this : void 0; - } - optimizeNames(d, y) { - const { nodes: z } = this; - let J = z.length; - for (; J--; ) { - const Y = z[J]; - Y.optimizeNames(d, y) || (W(d, Y.names), z.splice(J, 1)); - } - return z.length > 0 ? this : void 0; - } - get names() { - return this.nodes.reduce((d, y) => F(d, y.names), {}); - } - } - class O extends M { - render(d) { - return "{" + d._n + super.render(d) + "}" + d._n; - } - } - class x extends M { - } - class T extends O { - } - T.kind = "else"; - class k extends O { - constructor(d, y) { - super(y), this.condition = d; - } - render(d) { - let y = `if(${this.condition})` + super.render(d); - return this.else && (y += "else " + this.else.render(d)), y; - } - optimizeNodes() { - super.optimizeNodes(); - const d = this.condition; - if (d === !0) - return this.nodes; - let y = this.else; - if (y) { - const z = y.optimizeNodes(); - y = this.else = Array.isArray(z) ? new T(z) : z; - } - if (y) - return d === !1 ? y instanceof k ? y : y.nodes : this.nodes.length ? this : new k(w(d), y instanceof k ? [y] : y.nodes); - if (!(d === !1 || !this.nodes.length)) - return this; - } - optimizeNames(d, y) { - var z; - if (this.else = (z = this.else) === null || z === void 0 ? void 0 : z.optimizeNames(d, y), !!(super.optimizeNames(d, y) || this.else)) - return this.condition = D(this.condition, d, y), this; - } - get names() { - const d = super.names; - return U(d, this.condition), this.else && F(d, this.else.names), d; - } - } - k.kind = "if"; - class A extends O { - } - A.kind = "for"; - class L extends A { - constructor(d) { - super(), this.iteration = d; - } - render(d) { - return `for(${this.iteration})` + super.render(d); - } - optimizeNames(d, y) { - if (super.optimizeNames(d, y)) - return this.iteration = D(this.iteration, d, y), this; - } - get names() { - return F(super.names, this.iteration.names); - } - } - class r extends A { - constructor(d, y, z, J) { - super(), this.varKind = d, this.name = y, this.from = z, this.to = J; - } - render(d) { - const y = d.es5 ? n.varKinds.var : this.varKind, { name: z, from: J, to: Y } = this; - return `for(${y} ${z}=${J}; ${z}<${Y}; ${z}++)` + super.render(d); - } - get names() { - const d = U(super.names, this.from); - return U(d, this.to); - } - } - class s extends A { - constructor(d, y, z, J) { - super(), this.loop = d, this.varKind = y, this.name = z, this.iterable = J; - } - render(d) { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(d); - } - optimizeNames(d, y) { - if (super.optimizeNames(d, y)) - return this.iterable = D(this.iterable, d, y), this; - } - get names() { - return F(super.names, this.iterable.names); - } - } - class o extends O { - constructor(d, y, z) { - super(), this.name = d, this.args = y, this.async = z; - } - render(d) { - return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(d); - } - } - o.kind = "func"; - class c extends M { - render(d) { - return "return " + super.render(d); - } - } - c.kind = "return"; - class u extends O { - render(d) { - let y = "try" + super.render(d); - return this.catch && (y += this.catch.render(d)), this.finally && (y += this.finally.render(d)), y; - } - optimizeNodes() { - var d, y; - return super.optimizeNodes(), (d = this.catch) === null || d === void 0 || d.optimizeNodes(), (y = this.finally) === null || y === void 0 || y.optimizeNodes(), this; - } - optimizeNames(d, y) { - var z, J; - return super.optimizeNames(d, y), (z = this.catch) === null || z === void 0 || z.optimizeNames(d, y), (J = this.finally) === null || J === void 0 || J.optimizeNames(d, y), this; - } - get names() { - const d = super.names; - return this.catch && F(d, this.catch.names), this.finally && F(d, this.finally.names), d; - } - } - class _ extends O { - constructor(d) { - super(), this.error = d; - } - render(d) { - return `catch(${this.error})` + super.render(d); - } - } - _.kind = "catch"; - class f extends O { - render(d) { - return "finally" + super.render(d); - } - } - f.kind = "finally"; - class j { - constructor(d, y = {}) { - this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...y, _n: y.lines ? ` -` : "" }, this._extScope = d, this._scope = new n.Scope({ parent: d }), this._nodes = [new x()]; - } - toString() { - return this._root.render(this.opts); - } - // returns unique name in the internal scope - name(d) { - return this._scope.name(d); - } - // reserves unique name in the external scope - scopeName(d) { - return this._extScope.name(d); - } - // reserves unique name in the external scope and assigns value to it - scopeValue(d, y) { - const z = this._extScope.value(d, y); - return (this._values[z.prefix] || (this._values[z.prefix] = /* @__PURE__ */ new Set())).add(z), z; - } - getScopeValue(d, y) { - return this._extScope.getValue(d, y); - } - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(d) { - return this._extScope.scopeRefs(d, this._values); - } - scopeCode() { - return this._extScope.scopeCode(this._values); - } - _def(d, y, z, J) { - const Y = this._scope.toName(y); - return z !== void 0 && J && (this._constants[Y.str] = z), this._leafNode(new m(d, Y, z)), Y; - } - // `const` declaration (`var` in es5 mode) - const(d, y, z) { - return this._def(n.varKinds.const, d, y, z); - } - // `let` declaration with optional assignment (`var` in es5 mode) - let(d, y, z) { - return this._def(n.varKinds.let, d, y, z); - } - // `var` declaration with optional assignment - var(d, y, z) { - return this._def(n.varKinds.var, d, y, z); - } - // assignment code - assign(d, y, z) { - return this._leafNode(new p(d, y, z)); - } - // `+=` code - add(d, y) { - return this._leafNode(new g(d, e.operators.ADD, y)); - } - // appends passed SafeExpr to code or executes Block - code(d) { - return typeof d == "function" ? d() : d !== t.nil && this._leafNode(new I(d)), this; - } - // returns code for object literal for the passed argument list of key-value pairs - object(...d) { - const y = ["{"]; - for (const [z, J] of d) - y.length > 1 && y.push(","), y.push(z), (z !== J || this.opts.es5) && (y.push(":"), (0, t.addCodeArg)(y, J)); - return y.push("}"), new t._Code(y); - } - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(d, y, z) { - if (this._blockNode(new k(d)), y && z) - this.code(y).else().code(z).endIf(); - else if (y) - this.code(y).endIf(); - else if (z) - throw new Error('CodeGen: "else" body without "then" body'); - return this; - } - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(d) { - return this._elseNode(new k(d)); - } - // `else` clause - only valid after `if` or `else if` clauses - else() { - return this._elseNode(new T()); - } - // end `if` statement (needed if gen.if was used only with condition) - endIf() { - return this._endBlockNode(k, T); - } - _for(d, y) { - return this._blockNode(d), y && this.code(y).endFor(), this; - } - // a generic `for` clause (or statement if `forBody` is passed) - for(d, y) { - return this._for(new L(d), y); - } - // `for` statement for a range of values - forRange(d, y, z, J, Y = this.opts.es5 ? n.varKinds.var : n.varKinds.let) { - const se = this._scope.toName(d); - return this._for(new r(Y, se, y, z), () => J(se)); - } - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf(d, y, z, J = n.varKinds.const) { - const Y = this._scope.toName(d); - if (this.opts.es5) { - const se = y instanceof t.Name ? y : this.var("_arr", y); - return this.forRange("_i", 0, (0, t._)`${se}.length`, (ie) => { - this.var(Y, (0, t._)`${se}[${ie}]`), z(Y); - }); - } - return this._for(new s("of", J, Y, y), () => z(Y)); - } - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn(d, y, z, J = this.opts.es5 ? n.varKinds.var : n.varKinds.const) { - if (this.opts.ownProperties) - return this.forOf(d, (0, t._)`Object.keys(${y})`, z); - const Y = this._scope.toName(d); - return this._for(new s("in", J, Y, y), () => z(Y)); - } - // end `for` loop - endFor() { - return this._endBlockNode(A); - } - // `label` statement - label(d) { - return this._leafNode(new v(d)); - } - // `break` statement - break(d) { - return this._leafNode(new b(d)); - } - // `return` statement - return(d) { - const y = new c(); - if (this._blockNode(y), this.code(d), y.nodes.length !== 1) - throw new Error('CodeGen: "return" should have one node'); - return this._endBlockNode(c); - } - // `try` statement - try(d, y, z) { - if (!y && !z) - throw new Error('CodeGen: "try" without "catch" and "finally"'); - const J = new u(); - if (this._blockNode(J), this.code(d), y) { - const Y = this.name("e"); - this._currNode = J.catch = new _(Y), y(Y); - } - return z && (this._currNode = J.finally = new f(), this.code(z)), this._endBlockNode(_, f); - } - // `throw` statement - throw(d) { - return this._leafNode(new S(d)); - } - // start self-balancing block - block(d, y) { - return this._blockStarts.push(this._nodes.length), d && this.code(d).endBlock(y), this; - } - // end the current self-balancing block - endBlock(d) { - const y = this._blockStarts.pop(); - if (y === void 0) - throw new Error("CodeGen: not in self-balancing block"); - const z = this._nodes.length - y; - if (z < 0 || d !== void 0 && z !== d) - throw new Error(`CodeGen: wrong number of nodes: ${z} vs ${d} expected`); - return this._nodes.length = y, this; - } - // `function` heading (or definition if funcBody is passed) - func(d, y = t.nil, z, J) { - return this._blockNode(new o(d, y, z)), J && this.code(J).endFunc(), this; - } - // end function definition - endFunc() { - return this._endBlockNode(o); - } - optimize(d = 1) { - for (; d-- > 0; ) - this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants); - } - _leafNode(d) { - return this._currNode.nodes.push(d), this; - } - _blockNode(d) { - this._currNode.nodes.push(d), this._nodes.push(d); - } - _endBlockNode(d, y) { - const z = this._currNode; - if (z instanceof d || y && z instanceof y) - return this._nodes.pop(), this; - throw new Error(`CodeGen: not in block "${y ? `${d.kind}/${y.kind}` : d.kind}"`); - } - _elseNode(d) { - const y = this._currNode; - if (!(y instanceof k)) - throw new Error('CodeGen: "else" without "if"'); - return this._currNode = y.else = d, this; - } - get _root() { - return this._nodes[0]; - } - get _currNode() { - const d = this._nodes; - return d[d.length - 1]; - } - set _currNode(d) { - const y = this._nodes; - y[y.length - 1] = d; - } - } - e.CodeGen = j; - function F(N, d) { - for (const y in d) - N[y] = (N[y] || 0) + (d[y] || 0); - return N; - } - function U(N, d) { - return d instanceof t._CodeOrName ? F(N, d.names) : N; - } - function D(N, d, y) { - if (N instanceof t.Name) - return z(N); - if (!J(N)) - return N; - return new t._Code(N._items.reduce((Y, se) => (se instanceof t.Name && (se = z(se)), se instanceof t._Code ? Y.push(...se._items) : Y.push(se), Y), [])); - function z(Y) { - const se = y[Y.str]; - return se === void 0 || d[Y.str] !== 1 ? Y : (delete d[Y.str], se); - } - function J(Y) { - return Y instanceof t._Code && Y._items.some((se) => se instanceof t.Name && d[se.str] === 1 && y[se.str] !== void 0); - } - } - function W(N, d) { - for (const y in d) - N[y] = (N[y] || 0) - (d[y] || 0); - } - function w(N) { - return typeof N == "boolean" || typeof N == "number" || N === null ? !N : (0, t._)`!${H(N)}`; - } - e.not = w; - const G = P(e.operators.AND); - function Q(...N) { - return N.reduce(G); - } - e.and = Q; - const ee = P(e.operators.OR); - function q(...N) { - return N.reduce(ee); - } - e.or = q; - function P(N) { - return (d, y) => d === t.nil ? y : y === t.nil ? d : (0, t._)`${H(d)} ${N} ${H(y)}`; - } - function H(N) { - return N instanceof t.Name ? N : (0, t._)`(${N})`; - } -})(ue); -var he = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0; - const t = ue, n = Gt; - function a(o) { - const c = {}; - for (const u of o) - c[u] = !0; - return c; - } - e.toHash = a; - function i(o, c) { - return typeof c == "boolean" ? c : Object.keys(c).length === 0 ? !0 : (l(o, c), !m(c, o.self.RULES.all)); - } - e.alwaysValidSchema = i; - function l(o, c = o.schema) { - const { opts: u, self: _ } = o; - if (!u.strictSchema || typeof c == "boolean") - return; - const f = _.RULES.keywords; - for (const j in c) - f[j] || s(o, `unknown keyword: "${j}"`); - } - e.checkUnknownRules = l; - function m(o, c) { - if (typeof o == "boolean") - return !o; - for (const u in o) - if (c[u]) - return !0; - return !1; - } - e.schemaHasRules = m; - function p(o, c) { - if (typeof o == "boolean") - return !o; - for (const u in o) - if (u !== "$ref" && c.all[u]) - return !0; - return !1; - } - e.schemaHasRulesButRef = p; - function g({ topSchemaRef: o, schemaPath: c }, u, _, f) { - if (!f) { - if (typeof u == "number" || typeof u == "boolean") - return u; - if (typeof u == "string") - return (0, t._)`${u}`; - } - return (0, t._)`${o}${c}${(0, t.getProperty)(_)}`; - } - e.schemaRefOrVal = g; - function v(o) { - return I(decodeURIComponent(o)); - } - e.unescapeFragment = v; - function b(o) { - return encodeURIComponent(S(o)); - } - e.escapeFragment = b; - function S(o) { - return typeof o == "number" ? `${o}` : o.replace(/~/g, "~0").replace(/\//g, "~1"); - } - e.escapeJsonPointer = S; - function I(o) { - return o.replace(/~1/g, "/").replace(/~0/g, "~"); - } - e.unescapeJsonPointer = I; - function M(o, c) { - if (Array.isArray(o)) - for (const u of o) - c(u); - else - c(o); - } - e.eachItem = M; - function O({ mergeNames: o, mergeToName: c, mergeValues: u, resultToName: _ }) { - return (f, j, F, U) => { - const D = F === void 0 ? j : F instanceof t.Name ? (j instanceof t.Name ? o(f, j, F) : c(f, j, F), F) : j instanceof t.Name ? (c(f, F, j), j) : u(j, F); - return U === t.Name && !(D instanceof t.Name) ? _(f, D) : D; - }; - } - e.mergeEvaluated = { - props: O({ - mergeNames: (o, c, u) => o.if((0, t._)`${u} !== true && ${c} !== undefined`, () => { - o.if((0, t._)`${c} === true`, () => o.assign(u, !0), () => o.assign(u, (0, t._)`${u} || {}`).code((0, t._)`Object.assign(${u}, ${c})`)); - }), - mergeToName: (o, c, u) => o.if((0, t._)`${u} !== true`, () => { - c === !0 ? o.assign(u, !0) : (o.assign(u, (0, t._)`${u} || {}`), T(o, u, c)); - }), - mergeValues: (o, c) => o === !0 ? !0 : { ...o, ...c }, - resultToName: x - }), - items: O({ - mergeNames: (o, c, u) => o.if((0, t._)`${u} !== true && ${c} !== undefined`, () => o.assign(u, (0, t._)`${c} === true ? true : ${u} > ${c} ? ${u} : ${c}`)), - mergeToName: (o, c, u) => o.if((0, t._)`${u} !== true`, () => o.assign(u, c === !0 ? !0 : (0, t._)`${u} > ${c} ? ${u} : ${c}`)), - mergeValues: (o, c) => o === !0 ? !0 : Math.max(o, c), - resultToName: (o, c) => o.var("items", c) - }) - }; - function x(o, c) { - if (c === !0) - return o.var("props", !0); - const u = o.var("props", (0, t._)`{}`); - return c !== void 0 && T(o, u, c), u; - } - e.evaluatedPropsToName = x; - function T(o, c, u) { - Object.keys(u).forEach((_) => o.assign((0, t._)`${c}${(0, t.getProperty)(_)}`, !0)); - } - e.setEvaluated = T; - const k = {}; - function A(o, c) { - return o.scopeValue("func", { - ref: c, - code: k[c.code] || (k[c.code] = new n._Code(c.code)) - }); - } - e.useFunc = A; - var L; - (function(o) { - o[o.Num = 0] = "Num", o[o.Str = 1] = "Str"; - })(L = e.Type || (e.Type = {})); - function r(o, c, u) { - if (o instanceof t.Name) { - const _ = c === L.Num; - return u ? _ ? (0, t._)`"[" + ${o} + "]"` : (0, t._)`"['" + ${o} + "']"` : _ ? (0, t._)`"/" + ${o}` : (0, t._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`; - } - return u ? (0, t.getProperty)(o).toString() : "/" + S(o); - } - e.getErrorPath = r; - function s(o, c, u = o.opts.strictSchema) { - if (u) { - if (c = `strict mode: ${c}`, u === !0) - throw new Error(c); - o.self.logger.warn(c); - } - } - e.checkStrictMode = s; -})(he); -var nr = {}, Ra; -function ut() { - if (Ra) - return nr; - Ra = 1, Object.defineProperty(nr, "__esModule", { value: !0 }); - const e = ue, t = { - // validation function arguments - data: new e.Name("data"), - // args passed from referencing schema - valCxt: new e.Name("valCxt"), - instancePath: new e.Name("instancePath"), - parentData: new e.Name("parentData"), - parentDataProperty: new e.Name("parentDataProperty"), - rootData: new e.Name("rootData"), - dynamicAnchors: new e.Name("dynamicAnchors"), - // function scoped variables - vErrors: new e.Name("vErrors"), - errors: new e.Name("errors"), - this: new e.Name("this"), - // "globals" - self: new e.Name("self"), - scope: new e.Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new e.Name("json"), - jsonPos: new e.Name("jsonPos"), - jsonLen: new e.Name("jsonLen"), - jsonPart: new e.Name("jsonPart") - }; - return nr.default = t, nr; -} -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0; - const t = ue, n = he, a = ut(); - e.keywordError = { - message: ({ keyword: T }) => (0, t.str)`must pass "${T}" keyword validation` - }, e.keyword$DataError = { - message: ({ keyword: T, schemaType: k }) => k ? (0, t.str)`"${T}" keyword must be ${k} ($data)` : (0, t.str)`"${T}" keyword is invalid ($data)` - }; - function i(T, k = e.keywordError, A, L) { - const { it: r } = T, { gen: s, compositeRule: o, allErrors: c } = r, u = S(T, k, A); - L ?? (o || c) ? g(s, u) : v(r, (0, t._)`[${u}]`); - } - e.reportError = i; - function l(T, k = e.keywordError, A) { - const { it: L } = T, { gen: r, compositeRule: s, allErrors: o } = L, c = S(T, k, A); - g(r, c), s || o || v(L, a.default.vErrors); - } - e.reportExtraError = l; - function m(T, k) { - T.assign(a.default.errors, k), T.if((0, t._)`${a.default.vErrors} !== null`, () => T.if(k, () => T.assign((0, t._)`${a.default.vErrors}.length`, k), () => T.assign(a.default.vErrors, null))); - } - e.resetErrorsCount = m; - function p({ gen: T, keyword: k, schemaValue: A, data: L, errsCount: r, it: s }) { - if (r === void 0) - throw new Error("ajv implementation error"); - const o = T.name("err"); - T.forRange("i", r, a.default.errors, (c) => { - T.const(o, (0, t._)`${a.default.vErrors}[${c}]`), T.if((0, t._)`${o}.instancePath === undefined`, () => T.assign((0, t._)`${o}.instancePath`, (0, t.strConcat)(a.default.instancePath, s.errorPath))), T.assign((0, t._)`${o}.schemaPath`, (0, t.str)`${s.errSchemaPath}/${k}`), s.opts.verbose && (T.assign((0, t._)`${o}.schema`, A), T.assign((0, t._)`${o}.data`, L)); - }); - } - e.extendErrors = p; - function g(T, k) { - const A = T.const("err", k); - T.if((0, t._)`${a.default.vErrors} === null`, () => T.assign(a.default.vErrors, (0, t._)`[${A}]`), (0, t._)`${a.default.vErrors}.push(${A})`), T.code((0, t._)`${a.default.errors}++`); - } - function v(T, k) { - const { gen: A, validateName: L, schemaEnv: r } = T; - r.$async ? A.throw((0, t._)`new ${T.ValidationError}(${k})`) : (A.assign((0, t._)`${L}.errors`, k), A.return(!1)); - } - const b = { - keyword: new t.Name("keyword"), - schemaPath: new t.Name("schemaPath"), - params: new t.Name("params"), - propertyName: new t.Name("propertyName"), - message: new t.Name("message"), - schema: new t.Name("schema"), - parentSchema: new t.Name("parentSchema") - }; - function S(T, k, A) { - const { createErrors: L } = T.it; - return L === !1 ? (0, t._)`{}` : I(T, k, A); - } - function I(T, k, A = {}) { - const { gen: L, it: r } = T, s = [ - M(r, A), - O(T, A) - ]; - return x(T, k, s), L.object(...s); - } - function M({ errorPath: T }, { instancePath: k }) { - const A = k ? (0, t.str)`${T}${(0, n.getErrorPath)(k, n.Type.Str)}` : T; - return [a.default.instancePath, (0, t.strConcat)(a.default.instancePath, A)]; - } - function O({ keyword: T, it: { errSchemaPath: k } }, { schemaPath: A, parentSchema: L }) { - let r = L ? k : (0, t.str)`${k}/${T}`; - return A && (r = (0, t.str)`${r}${(0, n.getErrorPath)(A, n.Type.Str)}`), [b.schemaPath, r]; - } - function x(T, { params: k, message: A }, L) { - const { keyword: r, data: s, schemaValue: o, it: c } = T, { opts: u, propertyName: _, topSchemaRef: f, schemaPath: j } = c; - L.push([b.keyword, r], [b.params, typeof k == "function" ? k(T) : k || (0, t._)`{}`]), u.messages && L.push([b.message, typeof A == "function" ? A(T) : A]), u.verbose && L.push([b.schema, o], [b.parentSchema, (0, t._)`${f}${j}`], [a.default.data, s]), _ && L.push([b.propertyName, _]); - } -})(Jt); -var La; -function po() { - if (La) - return gt; - La = 1, Object.defineProperty(gt, "__esModule", { value: !0 }), gt.boolOrEmptySchema = gt.topBoolOrEmptySchema = void 0; - const e = Jt, t = ue, n = ut(), a = { - message: "boolean schema is false" - }; - function i(p) { - const { gen: g, schema: v, validateName: b } = p; - v === !1 ? m(p, !1) : typeof v == "object" && v.$async === !0 ? g.return(n.default.data) : (g.assign((0, t._)`${b}.errors`, null), g.return(!0)); - } - gt.topBoolOrEmptySchema = i; - function l(p, g) { - const { gen: v, schema: b } = p; - b === !1 ? (v.var(g, !1), m(p)) : v.var(g, !0); - } - gt.boolOrEmptySchema = l; - function m(p, g) { - const { gen: v, data: b } = p, S = { - gen: v, - keyword: "false schema", - data: b, - schema: !1, - schemaCode: !1, - schemaValue: !1, - params: {}, - it: p - }; - (0, e.reportError)(S, a, void 0, g); - } - return gt; -} -var Wt = {}, yt = {}; -Object.defineProperty(yt, "__esModule", { value: !0 }); -yt.getRules = yt.isJSONType = void 0; -const fo = ["string", "number", "integer", "boolean", "null", "object", "array"], mo = new Set(fo); -function go(e) { - return typeof e == "string" && mo.has(e); -} -yt.isJSONType = go; -function _o() { - const e = { - number: { type: "number", rules: [] }, - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] } - }; - return { - types: { ...e, integer: !0, boolean: !0, null: !0 }, - rules: [{ rules: [] }, e.number, e.string, e.array, e.object], - post: { rules: [] }, - all: {}, - keywords: {} - }; -} -yt.getRules = _o; -var at = {}, za; -function wn() { - if (za) - return at; - za = 1, Object.defineProperty(at, "__esModule", { value: !0 }), at.shouldUseRule = at.shouldUseGroup = at.schemaHasRulesForType = void 0; - function e({ schema: a, self: i }, l) { - const m = i.RULES.types[l]; - return m && m !== !0 && t(a, m); - } - at.schemaHasRulesForType = e; - function t(a, i) { - return i.rules.some((l) => n(a, l)); - } - at.shouldUseGroup = t; - function n(a, i) { - var l; - return a[i.keyword] !== void 0 || ((l = i.definition.implements) === null || l === void 0 ? void 0 : l.some((m) => a[m] !== void 0)); - } - return at.shouldUseRule = n, at; -} -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0; - const t = yt, n = wn(), a = Jt, i = ue, l = he; - var m; - (function(L) { - L[L.Correct = 0] = "Correct", L[L.Wrong = 1] = "Wrong"; - })(m = e.DataType || (e.DataType = {})); - function p(L) { - const r = g(L.type); - if (r.includes("null")) { - if (L.nullable === !1) - throw new Error("type: null contradicts nullable: false"); - } else { - if (!r.length && L.nullable !== void 0) - throw new Error('"nullable" cannot be used without "type"'); - L.nullable === !0 && r.push("null"); - } - return r; - } - e.getSchemaTypes = p; - function g(L) { - const r = Array.isArray(L) ? L : L ? [L] : []; - if (r.every(t.isJSONType)) - return r; - throw new Error("type must be JSONType or JSONType[]: " + r.join(",")); - } - e.getJSONTypes = g; - function v(L, r) { - const { gen: s, data: o, opts: c } = L, u = S(r, c.coerceTypes), _ = r.length > 0 && !(u.length === 0 && r.length === 1 && (0, n.schemaHasRulesForType)(L, r[0])); - if (_) { - const f = x(r, o, c.strictNumbers, m.Wrong); - s.if(f, () => { - u.length ? I(L, r, u) : k(L); - }); - } - return _; - } - e.coerceAndCheckDataType = v; - const b = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); - function S(L, r) { - return r ? L.filter((s) => b.has(s) || r === "array" && s === "array") : []; - } - function I(L, r, s) { - const { gen: o, data: c, opts: u } = L, _ = o.let("dataType", (0, i._)`typeof ${c}`), f = o.let("coerced", (0, i._)`undefined`); - u.coerceTypes === "array" && o.if((0, i._)`${_} == 'object' && Array.isArray(${c}) && ${c}.length == 1`, () => o.assign(c, (0, i._)`${c}[0]`).assign(_, (0, i._)`typeof ${c}`).if(x(r, c, u.strictNumbers), () => o.assign(f, c))), o.if((0, i._)`${f} !== undefined`); - for (const F of s) - (b.has(F) || F === "array" && u.coerceTypes === "array") && j(F); - o.else(), k(L), o.endIf(), o.if((0, i._)`${f} !== undefined`, () => { - o.assign(c, f), M(L, f); - }); - function j(F) { - switch (F) { - case "string": - o.elseIf((0, i._)`${_} == "number" || ${_} == "boolean"`).assign(f, (0, i._)`"" + ${c}`).elseIf((0, i._)`${c} === null`).assign(f, (0, i._)`""`); - return; - case "number": - o.elseIf((0, i._)`${_} == "boolean" || ${c} === null - || (${_} == "string" && ${c} && ${c} == +${c})`).assign(f, (0, i._)`+${c}`); - return; - case "integer": - o.elseIf((0, i._)`${_} === "boolean" || ${c} === null - || (${_} === "string" && ${c} && ${c} == +${c} && !(${c} % 1))`).assign(f, (0, i._)`+${c}`); - return; - case "boolean": - o.elseIf((0, i._)`${c} === "false" || ${c} === 0 || ${c} === null`).assign(f, !1).elseIf((0, i._)`${c} === "true" || ${c} === 1`).assign(f, !0); - return; - case "null": - o.elseIf((0, i._)`${c} === "" || ${c} === 0 || ${c} === false`), o.assign(f, null); - return; - case "array": - o.elseIf((0, i._)`${_} === "string" || ${_} === "number" - || ${_} === "boolean" || ${c} === null`).assign(f, (0, i._)`[${c}]`); - } - } - } - function M({ gen: L, parentData: r, parentDataProperty: s }, o) { - L.if((0, i._)`${r} !== undefined`, () => L.assign((0, i._)`${r}[${s}]`, o)); - } - function O(L, r, s, o = m.Correct) { - const c = o === m.Correct ? i.operators.EQ : i.operators.NEQ; - let u; - switch (L) { - case "null": - return (0, i._)`${r} ${c} null`; - case "array": - u = (0, i._)`Array.isArray(${r})`; - break; - case "object": - u = (0, i._)`${r} && typeof ${r} == "object" && !Array.isArray(${r})`; - break; - case "integer": - u = _((0, i._)`!(${r} % 1) && !isNaN(${r})`); - break; - case "number": - u = _(); - break; - default: - return (0, i._)`typeof ${r} ${c} ${L}`; - } - return o === m.Correct ? u : (0, i.not)(u); - function _(f = i.nil) { - return (0, i.and)((0, i._)`typeof ${r} == "number"`, f, s ? (0, i._)`isFinite(${r})` : i.nil); - } - } - e.checkDataType = O; - function x(L, r, s, o) { - if (L.length === 1) - return O(L[0], r, s, o); - let c; - const u = (0, l.toHash)(L); - if (u.array && u.object) { - const _ = (0, i._)`typeof ${r} != "object"`; - c = u.null ? _ : (0, i._)`!${r} || ${_}`, delete u.null, delete u.array, delete u.object; - } else - c = i.nil; - u.number && delete u.integer; - for (const _ in u) - c = (0, i.and)(c, O(_, r, s, o)); - return c; - } - e.checkDataTypes = x; - const T = { - message: ({ schema: L }) => `must be ${L}`, - params: ({ schema: L, schemaValue: r }) => typeof L == "string" ? (0, i._)`{type: ${L}}` : (0, i._)`{type: ${r}}` - }; - function k(L) { - const r = A(L); - (0, a.reportError)(r, T); - } - e.reportTypeError = k; - function A(L) { - const { gen: r, data: s, schema: o } = L, c = (0, l.schemaRefOrVal)(L, o, "type"); - return { - gen: r, - keyword: "type", - data: s, - schema: o.type, - schemaCode: c, - schemaValue: c, - parentSchema: o, - params: {}, - it: L - }; - } -})(Wt); -var Dt = {}, Da; -function bo() { - if (Da) - return Dt; - Da = 1, Object.defineProperty(Dt, "__esModule", { value: !0 }), Dt.assignDefaults = void 0; - const e = ue, t = he; - function n(i, l) { - const { properties: m, items: p } = i.schema; - if (l === "object" && m) - for (const g in m) - a(i, g, m[g].default); - else - l === "array" && Array.isArray(p) && p.forEach((g, v) => a(i, v, g.default)); - } - Dt.assignDefaults = n; - function a(i, l, m) { - const { gen: p, compositeRule: g, data: v, opts: b } = i; - if (m === void 0) - return; - const S = (0, e._)`${v}${(0, e.getProperty)(l)}`; - if (g) { - (0, t.checkStrictMode)(i, `default is ignored for: ${S}`); - return; - } - let I = (0, e._)`${S} === undefined`; - b.useDefaults === "empty" && (I = (0, e._)`${I} || ${S} === null || ${S} === ""`), p.if(I, (0, e._)`${S} = ${(0, e.stringify)(m)}`); - } - return Dt; -} -var Ke = {}, le = {}; -Object.defineProperty(le, "__esModule", { value: !0 }); -le.validateUnion = le.validateArray = le.usePattern = le.callValidateCode = le.schemaProperties = le.allSchemaProperties = le.noPropertyInData = le.propertyInData = le.isOwnProperty = le.hasPropFunc = le.reportMissingProp = le.checkMissingProp = le.checkReportMissingProp = void 0; -const we = ue, Dr = he, ot = ut(), wo = he; -function vo(e, t) { - const { gen: n, data: a, it: i } = e; - n.if(Br(n, a, t, i.opts.ownProperties), () => { - e.setParams({ missingProperty: (0, we._)`${t}` }, !0), e.error(); - }); -} -le.checkReportMissingProp = vo; -function yo({ gen: e, data: t, it: { opts: n } }, a, i) { - return (0, we.or)(...a.map((l) => (0, we.and)(Br(e, t, l, n.ownProperties), (0, we._)`${i} = ${l}`))); -} -le.checkMissingProp = yo; -function $o(e, t) { - e.setParams({ missingProperty: t }, !0), e.error(); -} -le.reportMissingProp = $o; -function vn(e) { - return e.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: (0, we._)`Object.prototype.hasOwnProperty` - }); -} -le.hasPropFunc = vn; -function Vr(e, t, n) { - return (0, we._)`${vn(e)}.call(${t}, ${n})`; -} -le.isOwnProperty = Vr; -function ko(e, t, n, a) { - const i = (0, we._)`${t}${(0, we.getProperty)(n)} !== undefined`; - return a ? (0, we._)`${i} && ${Vr(e, t, n)}` : i; -} -le.propertyInData = ko; -function Br(e, t, n, a) { - const i = (0, we._)`${t}${(0, we.getProperty)(n)} === undefined`; - return a ? (0, we.or)(i, (0, we.not)(Vr(e, t, n))) : i; -} -le.noPropertyInData = Br; -function yn(e) { - return e ? Object.keys(e).filter((t) => t !== "__proto__") : []; -} -le.allSchemaProperties = yn; -function Po(e, t) { - return yn(t).filter((n) => !(0, Dr.alwaysValidSchema)(e, t[n])); -} -le.schemaProperties = Po; -function Eo({ schemaCode: e, data: t, it: { gen: n, topSchemaRef: a, schemaPath: i, errorPath: l }, it: m }, p, g, v) { - const b = v ? (0, we._)`${e}, ${t}, ${a}${i}` : t, S = [ - [ot.default.instancePath, (0, we.strConcat)(ot.default.instancePath, l)], - [ot.default.parentData, m.parentData], - [ot.default.parentDataProperty, m.parentDataProperty], - [ot.default.rootData, ot.default.rootData] - ]; - m.opts.dynamicRef && S.push([ot.default.dynamicAnchors, ot.default.dynamicAnchors]); - const I = (0, we._)`${b}, ${n.object(...S)}`; - return g !== we.nil ? (0, we._)`${p}.call(${g}, ${I})` : (0, we._)`${p}(${I})`; -} -le.callValidateCode = Eo; -const So = (0, we._)`new RegExp`; -function jo({ gen: e, it: { opts: t } }, n) { - const a = t.unicodeRegExp ? "u" : "", { regExp: i } = t.code, l = i(n, a); - return e.scopeValue("pattern", { - key: l.toString(), - ref: l, - code: (0, we._)`${i.code === "new RegExp" ? So : (0, wo.useFunc)(e, i)}(${n}, ${a})` - }); -} -le.usePattern = jo; -function xo(e) { - const { gen: t, data: n, keyword: a, it: i } = e, l = t.name("valid"); - if (i.allErrors) { - const p = t.let("valid", !0); - return m(() => t.assign(p, !1)), p; - } - return t.var(l, !0), m(() => t.break()), l; - function m(p) { - const g = t.const("len", (0, we._)`${n}.length`); - t.forRange("i", 0, g, (v) => { - e.subschema({ - keyword: a, - dataProp: v, - dataPropType: Dr.Type.Num - }, l), t.if((0, we.not)(l), p); - }); - } -} -le.validateArray = xo; -function To(e) { - const { gen: t, schema: n, keyword: a, it: i } = e; - if (!Array.isArray(n)) - throw new Error("ajv implementation error"); - if (n.some((p) => (0, Dr.alwaysValidSchema)(i, p)) && !i.opts.unevaluated) - return; - const l = t.let("valid", !1), m = t.name("_valid"); - t.block(() => n.forEach((p, g) => { - const v = e.subschema({ - keyword: a, - schemaProp: g, - compositeRule: !0 - }, m); - t.assign(l, (0, we._)`${l} || ${m}`), e.mergeValidEvaluated(v, m) || t.if((0, we.not)(l)); - })), e.result(l, () => e.reset(), () => e.error(!0)); -} -le.validateUnion = To; -var Va; -function Co() { - if (Va) - return Ke; - Va = 1, Object.defineProperty(Ke, "__esModule", { value: !0 }), Ke.validateKeywordUsage = Ke.validSchemaType = Ke.funcKeywordCode = Ke.macroKeywordCode = void 0; - const e = ue, t = ut(), n = le, a = Jt; - function i(I, M) { - const { gen: O, keyword: x, schema: T, parentSchema: k, it: A } = I, L = M.macro.call(A.self, T, k, A), r = v(O, x, L); - A.opts.validateSchema !== !1 && A.self.validateSchema(L, !0); - const s = O.name("valid"); - I.subschema({ - schema: L, - schemaPath: e.nil, - errSchemaPath: `${A.errSchemaPath}/${x}`, - topSchemaRef: r, - compositeRule: !0 - }, s), I.pass(s, () => I.error(!0)); - } - Ke.macroKeywordCode = i; - function l(I, M) { - var O; - const { gen: x, keyword: T, schema: k, parentSchema: A, $data: L, it: r } = I; - g(r, M); - const s = !L && M.compile ? M.compile.call(r.self, k, A, r) : M.validate, o = v(x, T, s), c = x.let("valid"); - I.block$data(c, u), I.ok((O = M.valid) !== null && O !== void 0 ? O : c); - function u() { - if (M.errors === !1) - j(), M.modifying && m(I), F(() => I.error()); - else { - const U = M.async ? _() : f(); - M.modifying && m(I), F(() => p(I, U)); - } - } - function _() { - const U = x.let("ruleErrs", null); - return x.try(() => j((0, e._)`await `), (D) => x.assign(c, !1).if((0, e._)`${D} instanceof ${r.ValidationError}`, () => x.assign(U, (0, e._)`${D}.errors`), () => x.throw(D))), U; - } - function f() { - const U = (0, e._)`${o}.errors`; - return x.assign(U, null), j(e.nil), U; - } - function j(U = M.async ? (0, e._)`await ` : e.nil) { - const D = r.opts.passContext ? t.default.this : t.default.self, W = !("compile" in M && !L || M.schema === !1); - x.assign(c, (0, e._)`${U}${(0, n.callValidateCode)(I, o, D, W)}`, M.modifying); - } - function F(U) { - var D; - x.if((0, e.not)((D = M.valid) !== null && D !== void 0 ? D : c), U); - } - } - Ke.funcKeywordCode = l; - function m(I) { - const { gen: M, data: O, it: x } = I; - M.if(x.parentData, () => M.assign(O, (0, e._)`${x.parentData}[${x.parentDataProperty}]`)); - } - function p(I, M) { - const { gen: O } = I; - O.if((0, e._)`Array.isArray(${M})`, () => { - O.assign(t.default.vErrors, (0, e._)`${t.default.vErrors} === null ? ${M} : ${t.default.vErrors}.concat(${M})`).assign(t.default.errors, (0, e._)`${t.default.vErrors}.length`), (0, a.extendErrors)(I); - }, () => I.error()); - } - function g({ schemaEnv: I }, M) { - if (M.async && !I.$async) - throw new Error("async keyword in sync schema"); - } - function v(I, M, O) { - if (O === void 0) - throw new Error(`keyword "${M}" failed to compile`); - return I.scopeValue("keyword", typeof O == "function" ? { ref: O } : { ref: O, code: (0, e.stringify)(O) }); - } - function b(I, M, O = !1) { - return !M.length || M.some((x) => x === "array" ? Array.isArray(I) : x === "object" ? I && typeof I == "object" && !Array.isArray(I) : typeof I == x || O && typeof I > "u"); - } - Ke.validSchemaType = b; - function S({ schema: I, opts: M, self: O, errSchemaPath: x }, T, k) { - if (Array.isArray(T.keyword) ? !T.keyword.includes(k) : T.keyword !== k) - throw new Error("ajv implementation error"); - const A = T.dependencies; - if (A != null && A.some((L) => !Object.prototype.hasOwnProperty.call(I, L))) - throw new Error(`parent schema must have dependencies of ${k}: ${A.join(",")}`); - if (T.validateSchema && !T.validateSchema(I[k])) { - const L = `keyword "${k}" value is invalid at path "${x}": ` + O.errorsText(T.validateSchema.errors); - if (M.validateSchema === "log") - O.logger.error(L); - else - throw new Error(L); - } - } - return Ke.validateKeywordUsage = S, Ke; -} -var nt = {}, Ba; -function Oo() { - if (Ba) - return nt; - Ba = 1, Object.defineProperty(nt, "__esModule", { value: !0 }), nt.extendSubschemaMode = nt.extendSubschemaData = nt.getSubschema = void 0; - const e = ue, t = he; - function n(l, { keyword: m, schemaProp: p, schema: g, schemaPath: v, errSchemaPath: b, topSchemaRef: S }) { - if (m !== void 0 && g !== void 0) - throw new Error('both "keyword" and "schema" passed, only one allowed'); - if (m !== void 0) { - const I = l.schema[m]; - return p === void 0 ? { - schema: I, - schemaPath: (0, e._)`${l.schemaPath}${(0, e.getProperty)(m)}`, - errSchemaPath: `${l.errSchemaPath}/${m}` - } : { - schema: I[p], - schemaPath: (0, e._)`${l.schemaPath}${(0, e.getProperty)(m)}${(0, e.getProperty)(p)}`, - errSchemaPath: `${l.errSchemaPath}/${m}/${(0, t.escapeFragment)(p)}` - }; - } - if (g !== void 0) { - if (v === void 0 || b === void 0 || S === void 0) - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); - return { - schema: g, - schemaPath: v, - topSchemaRef: S, - errSchemaPath: b - }; - } - throw new Error('either "keyword" or "schema" must be passed'); - } - nt.getSubschema = n; - function a(l, m, { dataProp: p, dataPropType: g, data: v, dataTypes: b, propertyName: S }) { - if (v !== void 0 && p !== void 0) - throw new Error('both "data" and "dataProp" passed, only one allowed'); - const { gen: I } = m; - if (p !== void 0) { - const { errorPath: O, dataPathArr: x, opts: T } = m, k = I.let("data", (0, e._)`${m.data}${(0, e.getProperty)(p)}`, !0); - M(k), l.errorPath = (0, e.str)`${O}${(0, t.getErrorPath)(p, g, T.jsPropertySyntax)}`, l.parentDataProperty = (0, e._)`${p}`, l.dataPathArr = [...x, l.parentDataProperty]; - } - if (v !== void 0) { - const O = v instanceof e.Name ? v : I.let("data", v, !0); - M(O), S !== void 0 && (l.propertyName = S); - } - b && (l.dataTypes = b); - function M(O) { - l.data = O, l.dataLevel = m.dataLevel + 1, l.dataTypes = [], m.definedProperties = /* @__PURE__ */ new Set(), l.parentData = m.data, l.dataNames = [...m.dataNames, O]; - } - } - nt.extendSubschemaData = a; - function i(l, { jtdDiscriminator: m, jtdMetadata: p, compositeRule: g, createErrors: v, allErrors: b }) { - g !== void 0 && (l.compositeRule = g), v !== void 0 && (l.createErrors = v), b !== void 0 && (l.allErrors = b), l.jtdDiscriminator = m, l.jtdMetadata = p; - } - return nt.extendSubschemaMode = i, nt; -} -var Ae = {}, $n = function e(t, n) { - if (t === n) - return !0; - if (t && n && typeof t == "object" && typeof n == "object") { - if (t.constructor !== n.constructor) - return !1; - var a, i, l; - if (Array.isArray(t)) { - if (a = t.length, a != n.length) - return !1; - for (i = a; i-- !== 0; ) - if (!e(t[i], n[i])) - return !1; - return !0; - } - if (t.constructor === RegExp) - return t.source === n.source && t.flags === n.flags; - if (t.valueOf !== Object.prototype.valueOf) - return t.valueOf() === n.valueOf(); - if (t.toString !== Object.prototype.toString) - return t.toString() === n.toString(); - if (l = Object.keys(t), a = l.length, a !== Object.keys(n).length) - return !1; - for (i = a; i-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(n, l[i])) - return !1; - for (i = a; i-- !== 0; ) { - var m = l[i]; - if (!e(t[m], n[m])) - return !1; - } - return !0; - } - return t !== t && n !== n; -}, kn = { exports: {} }, lt = kn.exports = function(e, t, n) { - typeof t == "function" && (n = t, t = {}), n = t.cb || n; - var a = typeof n == "function" ? n : n.pre || function() { - }, i = n.post || function() { - }; - dr(t, a, i, e, "", e); -}; -lt.keywords = { - additionalItems: !0, - items: !0, - contains: !0, - additionalProperties: !0, - propertyNames: !0, - not: !0, - if: !0, - then: !0, - else: !0 -}; -lt.arrayKeywords = { - items: !0, - allOf: !0, - anyOf: !0, - oneOf: !0 -}; -lt.propsKeywords = { - $defs: !0, - definitions: !0, - properties: !0, - patternProperties: !0, - dependencies: !0 -}; -lt.skipKeywords = { - default: !0, - enum: !0, - const: !0, - required: !0, - maximum: !0, - minimum: !0, - exclusiveMaximum: !0, - exclusiveMinimum: !0, - multipleOf: !0, - maxLength: !0, - minLength: !0, - pattern: !0, - format: !0, - maxItems: !0, - minItems: !0, - uniqueItems: !0, - maxProperties: !0, - minProperties: !0 -}; -function dr(e, t, n, a, i, l, m, p, g, v) { - if (a && typeof a == "object" && !Array.isArray(a)) { - t(a, i, l, m, p, g, v); - for (var b in a) { - var S = a[b]; - if (Array.isArray(S)) { - if (b in lt.arrayKeywords) - for (var I = 0; I < S.length; I++) - dr(e, t, n, S[I], i + "/" + b + "/" + I, l, i, b, a, I); - } else if (b in lt.propsKeywords) { - if (S && typeof S == "object") - for (var M in S) - dr(e, t, n, S[M], i + "/" + b + "/" + Ao(M), l, i, b, a, M); - } else - (b in lt.keywords || e.allKeys && !(b in lt.skipKeywords)) && dr(e, t, n, S, i + "/" + b, l, i, b, a); - } - n(a, i, l, m, p, g, v); - } -} -function Ao(e) { - return e.replace(/~/g, "~0").replace(/\//g, "~1"); -} -var Io = kn.exports; -Object.defineProperty(Ae, "__esModule", { value: !0 }); -Ae.getSchemaRefs = Ae.resolveUrl = Ae.normalizeId = Ae._getFullPath = Ae.getFullPath = Ae.inlineRef = void 0; -const No = he, Mo = $n, Ro = Io, Lo = /* @__PURE__ */ new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const" -]); -function zo(e, t = !0) { - return typeof e == "boolean" ? !0 : t === !0 ? !Ir(e) : t ? Pn(e) <= t : !1; -} -Ae.inlineRef = zo; -const Do = /* @__PURE__ */ new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor" -]); -function Ir(e) { - for (const t in e) { - if (Do.has(t)) - return !0; - const n = e[t]; - if (Array.isArray(n) && n.some(Ir) || typeof n == "object" && Ir(n)) - return !0; - } - return !1; -} -function Pn(e) { - let t = 0; - for (const n in e) - if (n === "$ref" || (t++, !Lo.has(n) && (typeof e[n] == "object" && (0, No.eachItem)(e[n], (a) => t += Pn(a)), t === 1 / 0))) - return 1 / 0; - return t; -} -function En(e, t = "", n) { - n !== !1 && (t = Ct(t)); - const a = e.parse(t); - return Sn(e, a); -} -Ae.getFullPath = En; -function Sn(e, t) { - return e.serialize(t).split("#")[0] + "#"; -} -Ae._getFullPath = Sn; -const Vo = /#\/?$/; -function Ct(e) { - return e ? e.replace(Vo, "") : ""; -} -Ae.normalizeId = Ct; -function Bo(e, t, n) { - return n = Ct(n), e.resolve(t, n); -} -Ae.resolveUrl = Bo; -const Fo = /^[a-z_][-a-z0-9._]*$/i; -function Uo(e, t) { - if (typeof e == "boolean") - return {}; - const { schemaId: n, uriResolver: a } = this.opts, i = Ct(e[n] || t), l = { "": i }, m = En(a, i, !1), p = {}, g = /* @__PURE__ */ new Set(); - return Ro(e, { allKeys: !0 }, (S, I, M, O) => { - if (O === void 0) - return; - const x = m + I; - let T = l[O]; - typeof S[n] == "string" && (T = k.call(this, S[n])), A.call(this, S.$anchor), A.call(this, S.$dynamicAnchor), l[I] = T; - function k(L) { - const r = this.opts.uriResolver.resolve; - if (L = Ct(T ? r(T, L) : L), g.has(L)) - throw b(L); - g.add(L); - let s = this.refs[L]; - return typeof s == "string" && (s = this.refs[s]), typeof s == "object" ? v(S, s.schema, L) : L !== Ct(x) && (L[0] === "#" ? (v(S, p[L], L), p[L] = S) : this.refs[L] = x), L; - } - function A(L) { - if (typeof L == "string") { - if (!Fo.test(L)) - throw new Error(`invalid anchor "${L}"`); - k.call(this, `#${L}`); - } - } - }), p; - function v(S, I, M) { - if (I !== void 0 && !Mo(S, I)) - throw b(M); - } - function b(S) { - return new Error(`reference "${S}" resolves to more than one schema`); - } -} -Ae.getSchemaRefs = Uo; -var Fa; -function yr() { - if (Fa) - return rt; - Fa = 1, Object.defineProperty(rt, "__esModule", { value: !0 }), rt.getData = rt.KeywordCxt = rt.validateFunctionCode = void 0; - const e = po(), t = Wt, n = wn(), a = Wt, i = bo(), l = Co(), m = Oo(), p = ue, g = ut(), v = Ae, b = he, S = Jt; - function I(C) { - if (s(C) && (c(C), r(C))) { - T(C); - return; - } - M(C, () => (0, e.topBoolOrEmptySchema)(C)); - } - rt.validateFunctionCode = I; - function M({ gen: C, validateName: R, schema: K, schemaEnv: Z, opts: te }, ne) { - te.code.es5 ? C.func(R, (0, p._)`${g.default.data}, ${g.default.valCxt}`, Z.$async, () => { - C.code((0, p._)`"use strict"; ${A(K, te)}`), x(C, te), C.code(ne); - }) : C.func(R, (0, p._)`${g.default.data}, ${O(te)}`, Z.$async, () => C.code(A(K, te)).code(ne)); - } - function O(C) { - return (0, p._)`{${g.default.instancePath}="", ${g.default.parentData}, ${g.default.parentDataProperty}, ${g.default.rootData}=${g.default.data}${C.dynamicRef ? (0, p._)`, ${g.default.dynamicAnchors}={}` : p.nil}}={}`; - } - function x(C, R) { - C.if(g.default.valCxt, () => { - C.var(g.default.instancePath, (0, p._)`${g.default.valCxt}.${g.default.instancePath}`), C.var(g.default.parentData, (0, p._)`${g.default.valCxt}.${g.default.parentData}`), C.var(g.default.parentDataProperty, (0, p._)`${g.default.valCxt}.${g.default.parentDataProperty}`), C.var(g.default.rootData, (0, p._)`${g.default.valCxt}.${g.default.rootData}`), R.dynamicRef && C.var(g.default.dynamicAnchors, (0, p._)`${g.default.valCxt}.${g.default.dynamicAnchors}`); - }, () => { - C.var(g.default.instancePath, (0, p._)`""`), C.var(g.default.parentData, (0, p._)`undefined`), C.var(g.default.parentDataProperty, (0, p._)`undefined`), C.var(g.default.rootData, g.default.data), R.dynamicRef && C.var(g.default.dynamicAnchors, (0, p._)`{}`); - }); - } - function T(C) { - const { schema: R, opts: K, gen: Z } = C; - M(C, () => { - K.$comment && R.$comment && U(C), f(C), Z.let(g.default.vErrors, null), Z.let(g.default.errors, 0), K.unevaluated && k(C), u(C), D(C); - }); - } - function k(C) { - const { gen: R, validateName: K } = C; - C.evaluated = R.const("evaluated", (0, p._)`${K}.evaluated`), R.if((0, p._)`${C.evaluated}.dynamicProps`, () => R.assign((0, p._)`${C.evaluated}.props`, (0, p._)`undefined`)), R.if((0, p._)`${C.evaluated}.dynamicItems`, () => R.assign((0, p._)`${C.evaluated}.items`, (0, p._)`undefined`)); - } - function A(C, R) { - const K = typeof C == "object" && C[R.schemaId]; - return K && (R.code.source || R.code.process) ? (0, p._)`/*# sourceURL=${K} */` : p.nil; - } - function L(C, R) { - if (s(C) && (c(C), r(C))) { - o(C, R); - return; - } - (0, e.boolOrEmptySchema)(C, R); - } - function r({ schema: C, self: R }) { - if (typeof C == "boolean") - return !C; - for (const K in C) - if (R.RULES.all[K]) - return !0; - return !1; - } - function s(C) { - return typeof C.schema != "boolean"; - } - function o(C, R) { - const { schema: K, gen: Z, opts: te } = C; - te.$comment && K.$comment && U(C), j(C), F(C); - const ne = Z.const("_errs", g.default.errors); - u(C, ne), Z.var(R, (0, p._)`${ne} === ${g.default.errors}`); - } - function c(C) { - (0, b.checkUnknownRules)(C), _(C); - } - function u(C, R) { - if (C.opts.jtd) - return w(C, [], !1, R); - const K = (0, t.getSchemaTypes)(C.schema), Z = (0, t.coerceAndCheckDataType)(C, K); - w(C, K, !Z, R); - } - function _(C) { - const { schema: R, errSchemaPath: K, opts: Z, self: te } = C; - R.$ref && Z.ignoreKeywordsWithRef && (0, b.schemaHasRulesButRef)(R, te.RULES) && te.logger.warn(`$ref: keywords ignored in schema at path "${K}"`); - } - function f(C) { - const { schema: R, opts: K } = C; - R.default !== void 0 && K.useDefaults && K.strictSchema && (0, b.checkStrictMode)(C, "default is ignored in the schema root"); - } - function j(C) { - const R = C.schema[C.opts.schemaId]; - R && (C.baseId = (0, v.resolveUrl)(C.opts.uriResolver, C.baseId, R)); - } - function F(C) { - if (C.schema.$async && !C.schemaEnv.$async) - throw new Error("async schema in sync schema"); - } - function U({ gen: C, schemaEnv: R, schema: K, errSchemaPath: Z, opts: te }) { - const ne = K.$comment; - if (te.$comment === !0) - C.code((0, p._)`${g.default.self}.logger.log(${ne})`); - else if (typeof te.$comment == "function") { - const Ee = (0, p.str)`${Z}/$comment`, Ne = C.scopeValue("root", { ref: R.root }); - C.code((0, p._)`${g.default.self}.opts.$comment(${ne}, ${Ee}, ${Ne}.schema)`); - } - } - function D(C) { - const { gen: R, schemaEnv: K, validateName: Z, ValidationError: te, opts: ne } = C; - K.$async ? R.if((0, p._)`${g.default.errors} === 0`, () => R.return(g.default.data), () => R.throw((0, p._)`new ${te}(${g.default.vErrors})`)) : (R.assign((0, p._)`${Z}.errors`, g.default.vErrors), ne.unevaluated && W(C), R.return((0, p._)`${g.default.errors} === 0`)); - } - function W({ gen: C, evaluated: R, props: K, items: Z }) { - K instanceof p.Name && C.assign((0, p._)`${R}.props`, K), Z instanceof p.Name && C.assign((0, p._)`${R}.items`, Z); - } - function w(C, R, K, Z) { - const { gen: te, schema: ne, data: Ee, allErrors: Ne, opts: Te, self: Ce } = C, { RULES: Se } = Ce; - if (ne.$ref && (Te.ignoreKeywordsWithRef || !(0, b.schemaHasRulesButRef)(ne, Se))) { - te.block(() => J(C, "$ref", Se.all.$ref.definition)); - return; - } - Te.jtd || Q(C, R), te.block(() => { - for (const ve of Se.rules) - ze(ve); - ze(Se.post); - }); - function ze(ve) { - (0, n.shouldUseGroup)(ne, ve) && (ve.type ? (te.if((0, a.checkDataType)(ve.type, Ee, Te.strictNumbers)), G(C, ve), R.length === 1 && R[0] === ve.type && K && (te.else(), (0, a.reportTypeError)(C)), te.endIf()) : G(C, ve), Ne || te.if((0, p._)`${g.default.errors} === ${Z || 0}`)); - } - } - function G(C, R) { - const { gen: K, schema: Z, opts: { useDefaults: te } } = C; - te && (0, i.assignDefaults)(C, R.type), K.block(() => { - for (const ne of R.rules) - (0, n.shouldUseRule)(Z, ne) && J(C, ne.keyword, ne.definition, R.type); - }); - } - function Q(C, R) { - C.schemaEnv.meta || !C.opts.strictTypes || (ee(C, R), C.opts.allowUnionTypes || q(C, R), P(C, C.dataTypes)); - } - function ee(C, R) { - if (R.length) { - if (!C.dataTypes.length) { - C.dataTypes = R; - return; - } - R.forEach((K) => { - N(C.dataTypes, K) || y(C, `type "${K}" not allowed by context "${C.dataTypes.join(",")}"`); - }), d(C, R); - } - } - function q(C, R) { - R.length > 1 && !(R.length === 2 && R.includes("null")) && y(C, "use allowUnionTypes to allow union type keyword"); - } - function P(C, R) { - const K = C.self.RULES.all; - for (const Z in K) { - const te = K[Z]; - if (typeof te == "object" && (0, n.shouldUseRule)(C.schema, te)) { - const { type: ne } = te.definition; - ne.length && !ne.some((Ee) => H(R, Ee)) && y(C, `missing type "${ne.join(",")}" for keyword "${Z}"`); - } - } - } - function H(C, R) { - return C.includes(R) || R === "number" && C.includes("integer"); - } - function N(C, R) { - return C.includes(R) || R === "integer" && C.includes("number"); - } - function d(C, R) { - const K = []; - for (const Z of C.dataTypes) - N(R, Z) ? K.push(Z) : R.includes("integer") && Z === "number" && K.push("integer"); - C.dataTypes = K; - } - function y(C, R) { - const K = C.schemaEnv.baseId + C.errSchemaPath; - R += ` at "${K}" (strictTypes)`, (0, b.checkStrictMode)(C, R, C.opts.strictTypes); - } - class z { - constructor(R, K, Z) { - if ((0, l.validateKeywordUsage)(R, K, Z), this.gen = R.gen, this.allErrors = R.allErrors, this.keyword = Z, this.data = R.data, this.schema = R.schema[Z], this.$data = K.$data && R.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, b.schemaRefOrVal)(R, this.schema, Z, this.$data), this.schemaType = K.schemaType, this.parentSchema = R.schema, this.params = {}, this.it = R, this.def = K, this.$data) - this.schemaCode = R.gen.const("vSchema", ie(this.$data, R)); - else if (this.schemaCode = this.schemaValue, !(0, l.validSchemaType)(this.schema, K.schemaType, K.allowUndefined)) - throw new Error(`${Z} value must be ${JSON.stringify(K.schemaType)}`); - ("code" in K ? K.trackErrors : K.errors !== !1) && (this.errsCount = R.gen.const("_errs", g.default.errors)); - } - result(R, K, Z) { - this.failResult((0, p.not)(R), K, Z); - } - failResult(R, K, Z) { - this.gen.if(R), Z ? Z() : this.error(), K ? (this.gen.else(), K(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else(); - } - pass(R, K) { - this.failResult((0, p.not)(R), void 0, K); - } - fail(R) { - if (R === void 0) { - this.error(), this.allErrors || this.gen.if(!1); - return; - } - this.gen.if(R), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else(); - } - fail$data(R) { - if (!this.$data) - return this.fail(R); - const { schemaCode: K } = this; - this.fail((0, p._)`${K} !== undefined && (${(0, p.or)(this.invalid$data(), R)})`); - } - error(R, K, Z) { - if (K) { - this.setParams(K), this._error(R, Z), this.setParams({}); - return; - } - this._error(R, Z); - } - _error(R, K) { - (R ? S.reportExtraError : S.reportError)(this, this.def.error, K); - } - $dataError() { - (0, S.reportError)(this, this.def.$dataError || S.keyword$DataError); - } - reset() { - if (this.errsCount === void 0) - throw new Error('add "trackErrors" to keyword definition'); - (0, S.resetErrorsCount)(this.gen, this.errsCount); - } - ok(R) { - this.allErrors || this.gen.if(R); - } - setParams(R, K) { - K ? Object.assign(this.params, R) : this.params = R; - } - block$data(R, K, Z = p.nil) { - this.gen.block(() => { - this.check$data(R, Z), K(); - }); - } - check$data(R = p.nil, K = p.nil) { - if (!this.$data) - return; - const { gen: Z, schemaCode: te, schemaType: ne, def: Ee } = this; - Z.if((0, p.or)((0, p._)`${te} === undefined`, K)), R !== p.nil && Z.assign(R, !0), (ne.length || Ee.validateSchema) && (Z.elseIf(this.invalid$data()), this.$dataError(), R !== p.nil && Z.assign(R, !1)), Z.else(); - } - invalid$data() { - const { gen: R, schemaCode: K, schemaType: Z, def: te, it: ne } = this; - return (0, p.or)(Ee(), Ne()); - function Ee() { - if (Z.length) { - if (!(K instanceof p.Name)) - throw new Error("ajv implementation error"); - const Te = Array.isArray(Z) ? Z : [Z]; - return (0, p._)`${(0, a.checkDataTypes)(Te, K, ne.opts.strictNumbers, a.DataType.Wrong)}`; - } - return p.nil; - } - function Ne() { - if (te.validateSchema) { - const Te = R.scopeValue("validate$data", { ref: te.validateSchema }); - return (0, p._)`!${Te}(${K})`; - } - return p.nil; - } - } - subschema(R, K) { - const Z = (0, m.getSubschema)(this.it, R); - (0, m.extendSubschemaData)(Z, this.it, R), (0, m.extendSubschemaMode)(Z, R); - const te = { ...this.it, ...Z, items: void 0, props: void 0 }; - return L(te, K), te; - } - mergeEvaluated(R, K) { - const { it: Z, gen: te } = this; - Z.opts.unevaluated && (Z.props !== !0 && R.props !== void 0 && (Z.props = b.mergeEvaluated.props(te, R.props, Z.props, K)), Z.items !== !0 && R.items !== void 0 && (Z.items = b.mergeEvaluated.items(te, R.items, Z.items, K))); - } - mergeValidEvaluated(R, K) { - const { it: Z, gen: te } = this; - if (Z.opts.unevaluated && (Z.props !== !0 || Z.items !== !0)) - return te.if(K, () => this.mergeEvaluated(R, p.Name)), !0; - } - } - rt.KeywordCxt = z; - function J(C, R, K, Z) { - const te = new z(C, K, R); - "code" in K ? K.code(te, Z) : te.$data && K.validate ? (0, l.funcKeywordCode)(te, K) : "macro" in K ? (0, l.macroKeywordCode)(te, K) : (K.compile || K.validate) && (0, l.funcKeywordCode)(te, K); - } - const Y = /^\/(?:[^~]|~0|~1)*$/, se = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; - function ie(C, { dataLevel: R, dataNames: K, dataPathArr: Z }) { - let te, ne; - if (C === "") - return g.default.rootData; - if (C[0] === "/") { - if (!Y.test(C)) - throw new Error(`Invalid JSON-pointer: ${C}`); - te = C, ne = g.default.rootData; - } else { - const Ce = se.exec(C); - if (!Ce) - throw new Error(`Invalid JSON-pointer: ${C}`); - const Se = +Ce[1]; - if (te = Ce[2], te === "#") { - if (Se >= R) - throw new Error(Te("property/index", Se)); - return Z[R - Se]; - } - if (Se > R) - throw new Error(Te("data", Se)); - if (ne = K[R - Se], !te) - return ne; - } - let Ee = ne; - const Ne = te.split("/"); - for (const Ce of Ne) - Ce && (ne = (0, p._)`${ne}${(0, p.getProperty)((0, b.unescapeJsonPointer)(Ce))}`, Ee = (0, p._)`${Ee} && ${ne}`); - return Ee; - function Te(Ce, Se) { - return `Cannot access ${Ce} ${Se} levels up, current level is ${R}`; - } - } - return rt.getData = ie, rt; -} -var Zt = {}; -Object.defineProperty(Zt, "__esModule", { value: !0 }); -class qo extends Error { - constructor(t) { - super("validation failed"), this.errors = t, this.ajv = this.validation = !0; - } -} -Zt.default = qo; -var Yt = {}; -Object.defineProperty(Yt, "__esModule", { value: !0 }); -const Sr = Ae; -class Ho extends Error { - constructor(t, n, a, i) { - super(i || `can't resolve reference ${a} from id ${n}`), this.missingRef = (0, Sr.resolveUrl)(t, n, a), this.missingSchema = (0, Sr.normalizeId)((0, Sr.getFullPath)(t, this.missingRef)); - } -} -Yt.default = Ho; -var Le = {}; -Object.defineProperty(Le, "__esModule", { value: !0 }); -Le.resolveSchema = Le.getCompilingSchema = Le.resolveRef = Le.compileSchema = Le.SchemaEnv = void 0; -const Ge = ue, Ko = Zt, _t = ut(), Ze = Ae, Ua = he, Go = yr(); -class $r { - constructor(t) { - var n; - this.refs = {}, this.dynamicAnchors = {}; - let a; - typeof t.schema == "object" && (a = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (n = t.baseId) !== null && n !== void 0 ? n : (0, Ze.normalizeId)(a == null ? void 0 : a[t.schemaId || "$id"]), this.schemaPath = t.schemaPath, this.localRefs = t.localRefs, this.meta = t.meta, this.$async = a == null ? void 0 : a.$async, this.refs = {}; - } -} -Le.SchemaEnv = $r; -function Fr(e) { - const t = jn.call(this, e); - if (t) - return t; - const n = (0, Ze.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: a, lines: i } = this.opts.code, { ownProperties: l } = this.opts, m = new Ge.CodeGen(this.scope, { es5: a, lines: i, ownProperties: l }); - let p; - e.$async && (p = m.scopeValue("Error", { - ref: Ko.default, - code: (0, Ge._)`require("ajv/dist/runtime/validation_error").default` - })); - const g = m.scopeName("validate"); - e.validateName = g; - const v = { - gen: m, - allErrors: this.opts.allErrors, - data: _t.default.data, - parentData: _t.default.parentData, - parentDataProperty: _t.default.parentDataProperty, - dataNames: [_t.default.data], - dataPathArr: [Ge.nil], - dataLevel: 0, - dataTypes: [], - definedProperties: /* @__PURE__ */ new Set(), - topSchemaRef: m.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0, Ge.stringify)(e.schema) } : { ref: e.schema }), - validateName: g, - ValidationError: p, - schema: e.schema, - schemaEnv: e, - rootId: n, - baseId: e.baseId || n, - schemaPath: Ge.nil, - errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: (0, Ge._)`""`, - opts: this.opts, - self: this - }; - let b; - try { - this._compilations.add(e), (0, Go.validateFunctionCode)(v), m.optimize(this.opts.code.optimize); - const S = m.toString(); - b = `${m.scopeRefs(_t.default.scope)}return ${S}`, this.opts.code.process && (b = this.opts.code.process(b, e)); - const I = new Function(`${_t.default.self}`, `${_t.default.scope}`, b)(this, this.scope.get()); - if (this.scope.value(g, { ref: I }), I.errors = null, I.schema = e.schema, I.schemaEnv = e, e.$async && (I.$async = !0), this.opts.code.source === !0 && (I.source = { validateName: g, validateCode: S, scopeValues: m._values }), this.opts.unevaluated) { - const { props: M, items: O } = v; - I.evaluated = { - props: M instanceof Ge.Name ? void 0 : M, - items: O instanceof Ge.Name ? void 0 : O, - dynamicProps: M instanceof Ge.Name, - dynamicItems: O instanceof Ge.Name - }, I.source && (I.source.evaluated = (0, Ge.stringify)(I.evaluated)); - } - return e.validate = I, e; - } catch (S) { - throw delete e.validate, delete e.validateName, b && this.logger.error("Error compiling schema, function code:", b), S; - } finally { - this._compilations.delete(e); - } -} -Le.compileSchema = Fr; -function Wo(e, t, n) { - var a; - n = (0, Ze.resolveUrl)(this.opts.uriResolver, t, n); - const i = e.refs[n]; - if (i) - return i; - let l = Yo.call(this, e, n); - if (l === void 0) { - const m = (a = e.localRefs) === null || a === void 0 ? void 0 : a[n], { schemaId: p } = this.opts; - m && (l = new $r({ schema: m, schemaId: p, root: e, baseId: t })); - } - if (l !== void 0) - return e.refs[n] = Jo.call(this, l); -} -Le.resolveRef = Wo; -function Jo(e) { - return (0, Ze.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : Fr.call(this, e); -} -function jn(e) { - for (const t of this._compilations) - if (Zo(t, e)) - return t; -} -Le.getCompilingSchema = jn; -function Zo(e, t) { - return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId; -} -function Yo(e, t) { - let n; - for (; typeof (n = this.refs[t]) == "string"; ) - t = n; - return n || this.schemas[t] || kr.call(this, e, t); -} -function kr(e, t) { - const n = this.opts.uriResolver.parse(t), a = (0, Ze._getFullPath)(this.opts.uriResolver, n); - let i = (0, Ze.getFullPath)(this.opts.uriResolver, e.baseId, void 0); - if (Object.keys(e.schema).length > 0 && a === i) - return jr.call(this, n, e); - const l = (0, Ze.normalizeId)(a), m = this.refs[l] || this.schemas[l]; - if (typeof m == "string") { - const p = kr.call(this, e, m); - return typeof (p == null ? void 0 : p.schema) != "object" ? void 0 : jr.call(this, n, p); - } - if (typeof (m == null ? void 0 : m.schema) == "object") { - if (m.validate || Fr.call(this, m), l === (0, Ze.normalizeId)(t)) { - const { schema: p } = m, { schemaId: g } = this.opts, v = p[g]; - return v && (i = (0, Ze.resolveUrl)(this.opts.uriResolver, i, v)), new $r({ schema: p, schemaId: g, root: e, baseId: i }); - } - return jr.call(this, n, m); - } -} -Le.resolveSchema = kr; -const Qo = /* @__PURE__ */ new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions" -]); -function jr(e, { baseId: t, schema: n, root: a }) { - var i; - if (((i = e.fragment) === null || i === void 0 ? void 0 : i[0]) !== "/") - return; - for (const p of e.fragment.slice(1).split("/")) { - if (typeof n == "boolean") - return; - const g = n[(0, Ua.unescapeFragment)(p)]; - if (g === void 0) - return; - n = g; - const v = typeof n == "object" && n[this.opts.schemaId]; - !Qo.has(p) && v && (t = (0, Ze.resolveUrl)(this.opts.uriResolver, t, v)); - } - let l; - if (typeof n != "boolean" && n.$ref && !(0, Ua.schemaHasRulesButRef)(n, this.RULES)) { - const p = (0, Ze.resolveUrl)(this.opts.uriResolver, t, n.$ref); - l = kr.call(this, a, p); - } - const { schemaId: m } = this.opts; - if (l = l || new $r({ schema: n, schemaId: m, root: a, baseId: t }), l.schema !== l.root.schema) - return l; -} -const Xo = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", es = "Meta-schema for $data reference (JSON AnySchema extension proposal)", ts = "object", rs = [ - "$data" -], as = { - $data: { - type: "string", - anyOf: [ - { - format: "relative-json-pointer" - }, - { - format: "json-pointer" - } - ] - } -}, ns = !1, os = { - $id: Xo, - description: es, - type: ts, - required: rs, - properties: as, - additionalProperties: ns -}; -var Ur = {}, Nr = { exports: {} }; -/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -(function(e, t) { - (function(n, a) { - a(t); - })(gn, function(n) { - function a() { - for (var h = arguments.length, $ = Array(h), E = 0; E < h; E++) - $[E] = arguments[E]; - if ($.length > 1) { - $[0] = $[0].slice(0, -1); - for (var V = $.length - 1, B = 1; B < V; ++B) - $[B] = $[B].slice(1, -1); - return $[V] = $[V].slice(1), $.join(""); - } else - return $[0]; - } - function i(h) { - return "(?:" + h + ")"; - } - function l(h) { - return h === void 0 ? "undefined" : h === null ? "null" : Object.prototype.toString.call(h).split(" ").pop().split("]").shift().toLowerCase(); - } - function m(h) { - return h.toUpperCase(); - } - function p(h) { - return h != null ? h instanceof Array ? h : typeof h.length != "number" || h.split || h.setInterval || h.call ? [h] : Array.prototype.slice.call(h) : []; - } - function g(h, $) { - var E = h; - if ($) - for (var V in $) - E[V] = $[V]; - return E; - } - function v(h) { - var $ = "[A-Za-z]", E = "[0-9]", V = a(E, "[A-Fa-f]"), B = i(i("%[EFef]" + V + "%" + V + V + "%" + V + V) + "|" + i("%[89A-Fa-f]" + V + "%" + V + V) + "|" + i("%" + V + V)), ae = "[\\:\\/\\?\\#\\[\\]\\@]", re = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", pe = a(ae, re), ke = h ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", me = h ? "[\\uE000-\\uF8FF]" : "[]", de = a($, E, "[\\-\\.\\_\\~]", ke); - i($ + a($, E, "[\\+\\-\\.]") + "*"), i(i(B + "|" + a(de, re, "[\\:]")) + "*"); - var be = i(i("25[0-5]") + "|" + i("2[0-4]" + E) + "|" + i("1" + E + E) + "|" + i("0?[1-9]" + E) + "|0?0?" + E), ye = i(be + "\\." + be + "\\." + be + "\\." + be), oe = i(V + "{1,4}"), Pe = i(i(oe + "\\:" + oe) + "|" + ye), ge = i(i(oe + "\\:") + "{6}" + Pe), Ve = i("\\:\\:" + i(oe + "\\:") + "{5}" + Pe), Et = i(i(oe) + "?\\:\\:" + i(oe + "\\:") + "{4}" + Pe), He = i(i(i(oe + "\\:") + "{0,1}" + oe) + "?\\:\\:" + i(oe + "\\:") + "{3}" + Pe), et = i(i(i(oe + "\\:") + "{0,2}" + oe) + "?\\:\\:" + i(oe + "\\:") + "{2}" + Pe), pt = i(i(i(oe + "\\:") + "{0,3}" + oe) + "?\\:\\:" + oe + "\\:" + Pe), ft = i(i(i(oe + "\\:") + "{0,4}" + oe) + "?\\:\\:" + Pe), Be = i(i(i(oe + "\\:") + "{0,5}" + oe) + "?\\:\\:" + oe), tt = i(i(i(oe + "\\:") + "{0,6}" + oe) + "?\\:\\:"), mt = i([ge, Ve, Et, He, et, pt, ft, Be, tt].join("|")), Qe = i(i(de + "|" + B) + "+"); - i("[vV]" + V + "+\\." + a(de, re, "[\\:]") + "+"), i(i(B + "|" + a(de, re)) + "*"); - var er = i(B + "|" + a(de, re, "[\\:\\@]")); - return i(i(B + "|" + a(de, re, "[\\@]")) + "+"), i(i(er + "|" + a("[\\/\\?]", me)) + "*"), { - NOT_SCHEME: new RegExp(a("[^]", $, E, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(a("[^\\%\\:]", de, re), "g"), - NOT_HOST: new RegExp(a("[^\\%\\[\\]\\:]", de, re), "g"), - NOT_PATH: new RegExp(a("[^\\%\\/\\:\\@]", de, re), "g"), - NOT_PATH_NOSCHEME: new RegExp(a("[^\\%\\/\\@]", de, re), "g"), - NOT_QUERY: new RegExp(a("[^\\%]", de, re, "[\\:\\@\\/\\?]", me), "g"), - NOT_FRAGMENT: new RegExp(a("[^\\%]", de, re, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(a("[^]", de, re), "g"), - UNRESERVED: new RegExp(de, "g"), - OTHER_CHARS: new RegExp(a("[^\\%]", de, pe), "g"), - PCT_ENCODED: new RegExp(B, "g"), - IPV4ADDRESS: new RegExp("^(" + ye + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + mt + ")" + i(i("\\%25|\\%(?!" + V + "{2})") + "(" + Qe + ")") + "?\\]?$") - //RFC 6874, with relaxed parsing rules - }; - } - var b = v(!1), S = v(!0), I = function() { - function h($, E) { - var V = [], B = !0, ae = !1, re = void 0; - try { - for (var pe = $[Symbol.iterator](), ke; !(B = (ke = pe.next()).done) && (V.push(ke.value), !(E && V.length === E)); B = !0) - ; - } catch (me) { - ae = !0, re = me; - } finally { - try { - !B && pe.return && pe.return(); - } finally { - if (ae) - throw re; - } - } - return V; - } - return function($, E) { - if (Array.isArray($)) - return $; - if (Symbol.iterator in Object($)) - return h($, E); - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - }; - }(), M = function(h) { - if (Array.isArray(h)) { - for (var $ = 0, E = Array(h.length); $ < h.length; $++) - E[$] = h[$]; - return E; - } else - return Array.from(h); - }, O = 2147483647, x = 36, T = 1, k = 26, A = 38, L = 700, r = 72, s = 128, o = "-", c = /^xn--/, u = /[^\0-\x7E]/, _ = /[\x2E\u3002\uFF0E\uFF61]/g, f = { - overflow: "Overflow: input needs wider integers to process", - "not-basic": "Illegal input >= 0x80 (not a basic code point)", - "invalid-input": "Invalid input" - }, j = x - T, F = Math.floor, U = String.fromCharCode; - function D(h) { - throw new RangeError(f[h]); - } - function W(h, $) { - for (var E = [], V = h.length; V--; ) - E[V] = $(h[V]); - return E; - } - function w(h, $) { - var E = h.split("@"), V = ""; - E.length > 1 && (V = E[0] + "@", h = E[1]), h = h.replace(_, "."); - var B = h.split("."), ae = W(B, $).join("."); - return V + ae; - } - function G(h) { - for (var $ = [], E = 0, V = h.length; E < V; ) { - var B = h.charCodeAt(E++); - if (B >= 55296 && B <= 56319 && E < V) { - var ae = h.charCodeAt(E++); - (ae & 64512) == 56320 ? $.push(((B & 1023) << 10) + (ae & 1023) + 65536) : ($.push(B), E--); - } else - $.push(B); - } - return $; - } - var Q = function(h) { - return String.fromCodePoint.apply(String, M(h)); - }, ee = function(h) { - return h - 48 < 10 ? h - 22 : h - 65 < 26 ? h - 65 : h - 97 < 26 ? h - 97 : x; - }, q = function(h, $) { - return h + 22 + 75 * (h < 26) - (($ != 0) << 5); - }, P = function(h, $, E) { - var V = 0; - for ( - h = E ? F(h / L) : h >> 1, h += F(h / $); - /* no initialization */ - h > j * k >> 1; - V += x - ) - h = F(h / j); - return F(V + (j + 1) * h / (h + A)); - }, H = function(h) { - var $ = [], E = h.length, V = 0, B = s, ae = r, re = h.lastIndexOf(o); - re < 0 && (re = 0); - for (var pe = 0; pe < re; ++pe) - h.charCodeAt(pe) >= 128 && D("not-basic"), $.push(h.charCodeAt(pe)); - for (var ke = re > 0 ? re + 1 : 0; ke < E; ) { - for ( - var me = V, de = 1, be = x; - ; - /* no condition */ - be += x - ) { - ke >= E && D("invalid-input"); - var ye = ee(h.charCodeAt(ke++)); - (ye >= x || ye > F((O - V) / de)) && D("overflow"), V += ye * de; - var oe = be <= ae ? T : be >= ae + k ? k : be - ae; - if (ye < oe) - break; - var Pe = x - oe; - de > F(O / Pe) && D("overflow"), de *= Pe; - } - var ge = $.length + 1; - ae = P(V - me, ge, me == 0), F(V / ge) > O - B && D("overflow"), B += F(V / ge), V %= ge, $.splice(V++, 0, B); - } - return String.fromCodePoint.apply(String, $); - }, N = function(h) { - var $ = []; - h = G(h); - var E = h.length, V = s, B = 0, ae = r, re = !0, pe = !1, ke = void 0; - try { - for (var me = h[Symbol.iterator](), de; !(re = (de = me.next()).done); re = !0) { - var be = de.value; - be < 128 && $.push(U(be)); - } - } catch (zt) { - pe = !0, ke = zt; - } finally { - try { - !re && me.return && me.return(); - } finally { - if (pe) - throw ke; - } - } - var ye = $.length, oe = ye; - for (ye && $.push(o); oe < E; ) { - var Pe = O, ge = !0, Ve = !1, Et = void 0; - try { - for (var He = h[Symbol.iterator](), et; !(ge = (et = He.next()).done); ge = !0) { - var pt = et.value; - pt >= V && pt < Pe && (Pe = pt); - } - } catch (zt) { - Ve = !0, Et = zt; - } finally { - try { - !ge && He.return && He.return(); - } finally { - if (Ve) - throw Et; - } - } - var ft = oe + 1; - Pe - V > F((O - B) / ft) && D("overflow"), B += (Pe - V) * ft, V = Pe; - var Be = !0, tt = !1, mt = void 0; - try { - for (var Qe = h[Symbol.iterator](), er; !(Be = (er = Qe.next()).done); Be = !0) { - var Ia = er.value; - if (Ia < V && ++B > O && D("overflow"), Ia == V) { - for ( - var tr = B, rr = x; - ; - /* no condition */ - rr += x - ) { - var ar = rr <= ae ? T : rr >= ae + k ? k : rr - ae; - if (tr < ar) - break; - var Na = tr - ar, Ma = x - ar; - $.push(U(q(ar + Na % Ma, 0))), tr = F(Na / Ma); - } - $.push(U(q(tr, 0))), ae = P(B, ft, oe == ye), B = 0, ++oe; - } - } - } catch (zt) { - tt = !0, mt = zt; - } finally { - try { - !Be && Qe.return && Qe.return(); - } finally { - if (tt) - throw mt; - } - } - ++B, ++V; - } - return $.join(""); - }, d = function(h) { - return w(h, function($) { - return c.test($) ? H($.slice(4).toLowerCase()) : $; - }); - }, y = function(h) { - return w(h, function($) { - return u.test($) ? "xn--" + N($) : $; - }); - }, z = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - version: "2.1.0", - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - ucs2: { - decode: G, - encode: Q - }, - decode: H, - encode: N, - toASCII: y, - toUnicode: d - }, J = {}; - function Y(h) { - var $ = h.charCodeAt(0), E = void 0; - return $ < 16 ? E = "%0" + $.toString(16).toUpperCase() : $ < 128 ? E = "%" + $.toString(16).toUpperCase() : $ < 2048 ? E = "%" + ($ >> 6 | 192).toString(16).toUpperCase() + "%" + ($ & 63 | 128).toString(16).toUpperCase() : E = "%" + ($ >> 12 | 224).toString(16).toUpperCase() + "%" + ($ >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + ($ & 63 | 128).toString(16).toUpperCase(), E; - } - function se(h) { - for (var $ = "", E = 0, V = h.length; E < V; ) { - var B = parseInt(h.substr(E + 1, 2), 16); - if (B < 128) - $ += String.fromCharCode(B), E += 3; - else if (B >= 194 && B < 224) { - if (V - E >= 6) { - var ae = parseInt(h.substr(E + 4, 2), 16); - $ += String.fromCharCode((B & 31) << 6 | ae & 63); - } else - $ += h.substr(E, 6); - E += 6; - } else if (B >= 224) { - if (V - E >= 9) { - var re = parseInt(h.substr(E + 4, 2), 16), pe = parseInt(h.substr(E + 7, 2), 16); - $ += String.fromCharCode((B & 15) << 12 | (re & 63) << 6 | pe & 63); - } else - $ += h.substr(E, 9); - E += 9; - } else - $ += h.substr(E, 3), E += 3; - } - return $; - } - function ie(h, $) { - function E(V) { - var B = se(V); - return B.match($.UNRESERVED) ? B : V; - } - return h.scheme && (h.scheme = String(h.scheme).replace($.PCT_ENCODED, E).toLowerCase().replace($.NOT_SCHEME, "")), h.userinfo !== void 0 && (h.userinfo = String(h.userinfo).replace($.PCT_ENCODED, E).replace($.NOT_USERINFO, Y).replace($.PCT_ENCODED, m)), h.host !== void 0 && (h.host = String(h.host).replace($.PCT_ENCODED, E).toLowerCase().replace($.NOT_HOST, Y).replace($.PCT_ENCODED, m)), h.path !== void 0 && (h.path = String(h.path).replace($.PCT_ENCODED, E).replace(h.scheme ? $.NOT_PATH : $.NOT_PATH_NOSCHEME, Y).replace($.PCT_ENCODED, m)), h.query !== void 0 && (h.query = String(h.query).replace($.PCT_ENCODED, E).replace($.NOT_QUERY, Y).replace($.PCT_ENCODED, m)), h.fragment !== void 0 && (h.fragment = String(h.fragment).replace($.PCT_ENCODED, E).replace($.NOT_FRAGMENT, Y).replace($.PCT_ENCODED, m)), h; - } - function C(h) { - return h.replace(/^0*(.*)/, "$1") || "0"; - } - function R(h, $) { - var E = h.match($.IPV4ADDRESS) || [], V = I(E, 2), B = V[1]; - return B ? B.split(".").map(C).join(".") : h; - } - function K(h, $) { - var E = h.match($.IPV6ADDRESS) || [], V = I(E, 3), B = V[1], ae = V[2]; - if (B) { - for (var re = B.toLowerCase().split("::").reverse(), pe = I(re, 2), ke = pe[0], me = pe[1], de = me ? me.split(":").map(C) : [], be = ke.split(":").map(C), ye = $.IPV4ADDRESS.test(be[be.length - 1]), oe = ye ? 7 : 8, Pe = be.length - oe, ge = Array(oe), Ve = 0; Ve < oe; ++Ve) - ge[Ve] = de[Ve] || be[Pe + Ve] || ""; - ye && (ge[oe - 1] = R(ge[oe - 1], $)); - var Et = ge.reduce(function(Be, tt, mt) { - if (!tt || tt === "0") { - var Qe = Be[Be.length - 1]; - Qe && Qe.index + Qe.length === mt ? Qe.length++ : Be.push({ index: mt, length: 1 }); - } - return Be; - }, []), He = Et.sort(function(Be, tt) { - return tt.length - Be.length; - })[0], et = void 0; - if (He && He.length > 1) { - var pt = ge.slice(0, He.index), ft = ge.slice(He.index + He.length); - et = pt.join(":") + "::" + ft.join(":"); - } else - et = ge.join(":"); - return ae && (et += "%" + ae), et; - } else - return h; - } - var Z = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, te = "".match(/(){0}/)[1] === void 0; - function ne(h) { - var $ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, E = {}, V = $.iri !== !1 ? S : b; - $.reference === "suffix" && (h = ($.scheme ? $.scheme + ":" : "") + "//" + h); - var B = h.match(Z); - if (B) { - te ? (E.scheme = B[1], E.userinfo = B[3], E.host = B[4], E.port = parseInt(B[5], 10), E.path = B[6] || "", E.query = B[7], E.fragment = B[8], isNaN(E.port) && (E.port = B[5])) : (E.scheme = B[1] || void 0, E.userinfo = h.indexOf("@") !== -1 ? B[3] : void 0, E.host = h.indexOf("//") !== -1 ? B[4] : void 0, E.port = parseInt(B[5], 10), E.path = B[6] || "", E.query = h.indexOf("?") !== -1 ? B[7] : void 0, E.fragment = h.indexOf("#") !== -1 ? B[8] : void 0, isNaN(E.port) && (E.port = h.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? B[4] : void 0)), E.host && (E.host = K(R(E.host, V), V)), E.scheme === void 0 && E.userinfo === void 0 && E.host === void 0 && E.port === void 0 && !E.path && E.query === void 0 ? E.reference = "same-document" : E.scheme === void 0 ? E.reference = "relative" : E.fragment === void 0 ? E.reference = "absolute" : E.reference = "uri", $.reference && $.reference !== "suffix" && $.reference !== E.reference && (E.error = E.error || "URI is not a " + $.reference + " reference."); - var ae = J[($.scheme || E.scheme || "").toLowerCase()]; - if (!$.unicodeSupport && (!ae || !ae.unicodeSupport)) { - if (E.host && ($.domainHost || ae && ae.domainHost)) - try { - E.host = z.toASCII(E.host.replace(V.PCT_ENCODED, se).toLowerCase()); - } catch (re) { - E.error = E.error || "Host's domain name can not be converted to ASCII via punycode: " + re; - } - ie(E, b); - } else - ie(E, V); - ae && ae.parse && ae.parse(E, $); - } else - E.error = E.error || "URI can not be parsed."; - return E; - } - function Ee(h, $) { - var E = $.iri !== !1 ? S : b, V = []; - return h.userinfo !== void 0 && (V.push(h.userinfo), V.push("@")), h.host !== void 0 && V.push(K(R(String(h.host), E), E).replace(E.IPV6ADDRESS, function(B, ae, re) { - return "[" + ae + (re ? "%25" + re : "") + "]"; - })), (typeof h.port == "number" || typeof h.port == "string") && (V.push(":"), V.push(String(h.port))), V.length ? V.join("") : void 0; - } - var Ne = /^\.\.?\//, Te = /^\/\.(\/|$)/, Ce = /^\/\.\.(\/|$)/, Se = /^\/?(?:.|\n)*?(?=\/|$)/; - function ze(h) { - for (var $ = []; h.length; ) - if (h.match(Ne)) - h = h.replace(Ne, ""); - else if (h.match(Te)) - h = h.replace(Te, "/"); - else if (h.match(Ce)) - h = h.replace(Ce, "/"), $.pop(); - else if (h === "." || h === "..") - h = ""; - else { - var E = h.match(Se); - if (E) { - var V = E[0]; - h = h.slice(V.length), $.push(V); - } else - throw new Error("Unexpected dot segment condition"); - } - return $.join(""); - } - function ve(h) { - var $ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, E = $.iri ? S : b, V = [], B = J[($.scheme || h.scheme || "").toLowerCase()]; - if (B && B.serialize && B.serialize(h, $), h.host && !E.IPV6ADDRESS.test(h.host) && ($.domainHost || B && B.domainHost)) - try { - h.host = $.iri ? z.toUnicode(h.host) : z.toASCII(h.host.replace(E.PCT_ENCODED, se).toLowerCase()); - } catch (pe) { - h.error = h.error || "Host's domain name can not be converted to " + ($.iri ? "Unicode" : "ASCII") + " via punycode: " + pe; - } - ie(h, E), $.reference !== "suffix" && h.scheme && (V.push(h.scheme), V.push(":")); - var ae = Ee(h, $); - if (ae !== void 0 && ($.reference !== "suffix" && V.push("//"), V.push(ae), h.path && h.path.charAt(0) !== "/" && V.push("/")), h.path !== void 0) { - var re = h.path; - !$.absolutePath && (!B || !B.absolutePath) && (re = ze(re)), ae === void 0 && (re = re.replace(/^\/\//, "/%2F")), V.push(re); - } - return h.query !== void 0 && (V.push("?"), V.push(h.query)), h.fragment !== void 0 && (V.push("#"), V.push(h.fragment)), V.join(""); - } - function kt(h, $) { - var E = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, V = arguments[3], B = {}; - return V || (h = ne(ve(h, E), E), $ = ne(ve($, E), E)), E = E || {}, !E.tolerant && $.scheme ? (B.scheme = $.scheme, B.userinfo = $.userinfo, B.host = $.host, B.port = $.port, B.path = ze($.path || ""), B.query = $.query) : ($.userinfo !== void 0 || $.host !== void 0 || $.port !== void 0 ? (B.userinfo = $.userinfo, B.host = $.host, B.port = $.port, B.path = ze($.path || ""), B.query = $.query) : ($.path ? ($.path.charAt(0) === "/" ? B.path = ze($.path) : ((h.userinfo !== void 0 || h.host !== void 0 || h.port !== void 0) && !h.path ? B.path = "/" + $.path : h.path ? B.path = h.path.slice(0, h.path.lastIndexOf("/") + 1) + $.path : B.path = $.path, B.path = ze(B.path)), B.query = $.query) : (B.path = h.path, $.query !== void 0 ? B.query = $.query : B.query = h.query), B.userinfo = h.userinfo, B.host = h.host, B.port = h.port), B.scheme = h.scheme), B.fragment = $.fragment, B; - } - function Mt(h, $, E) { - var V = g({ scheme: "null" }, E); - return ve(kt(ne(h, V), ne($, V), V, !0), V); - } - function dt(h, $) { - return typeof h == "string" ? h = ve(ne(h, $), $) : l(h) === "object" && (h = ne(ve(h, $), $)), h; - } - function Rt(h, $, E) { - return typeof h == "string" ? h = ve(ne(h, E), E) : l(h) === "object" && (h = ve(h, E)), typeof $ == "string" ? $ = ve(ne($, E), E) : l($) === "object" && ($ = ve($, E)), h === $; - } - function Xt(h, $) { - return h && h.toString().replace(!$ || !$.iri ? b.ESCAPE : S.ESCAPE, Y); - } - function De(h, $) { - return h && h.toString().replace(!$ || !$.iri ? b.PCT_ENCODED : S.PCT_ENCODED, se); - } - var ht = { - scheme: "http", - domainHost: !0, - parse: function(h, $) { - return h.host || (h.error = h.error || "HTTP URIs must have a host."), h; - }, - serialize: function(h, $) { - var E = String(h.scheme).toLowerCase() === "https"; - return (h.port === (E ? 443 : 80) || h.port === "") && (h.port = void 0), h.path || (h.path = "/"), h; - } - }, Ea = { - scheme: "https", - domainHost: ht.domainHost, - parse: ht.parse, - serialize: ht.serialize - }; - function Sa(h) { - return typeof h.secure == "boolean" ? h.secure : String(h.scheme).toLowerCase() === "wss"; - } - var Lt = { - scheme: "ws", - domainHost: !0, - parse: function(h, $) { - var E = h; - return E.secure = Sa(E), E.resourceName = (E.path || "/") + (E.query ? "?" + E.query : ""), E.path = void 0, E.query = void 0, E; - }, - serialize: function(h, $) { - if ((h.port === (Sa(h) ? 443 : 80) || h.port === "") && (h.port = void 0), typeof h.secure == "boolean" && (h.scheme = h.secure ? "wss" : "ws", h.secure = void 0), h.resourceName) { - var E = h.resourceName.split("?"), V = I(E, 2), B = V[0], ae = V[1]; - h.path = B && B !== "/" ? B : void 0, h.query = ae, h.resourceName = void 0; - } - return h.fragment = void 0, h; - } - }, ja = { - scheme: "wss", - domainHost: Lt.domainHost, - parse: Lt.parse, - serialize: Lt.serialize - }, Wn = {}, xa = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", Ye = "[0-9A-Fa-f]", Jn = i(i("%[EFef]" + Ye + "%" + Ye + Ye + "%" + Ye + Ye) + "|" + i("%[89A-Fa-f]" + Ye + "%" + Ye + Ye) + "|" + i("%" + Ye + Ye)), Zn = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", Yn = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", Qn = a(Yn, '[\\"\\\\]'), Xn = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", eo = new RegExp(xa, "g"), Pt = new RegExp(Jn, "g"), to = new RegExp(a("[^]", Zn, "[\\.]", '[\\"]', Qn), "g"), Ta = new RegExp(a("[^]", xa, Xn), "g"), ro = Ta; - function Er(h) { - var $ = se(h); - return $.match(eo) ? $ : h; - } - var Ca = { - scheme: "mailto", - parse: function(h, $) { - var E = h, V = E.to = E.path ? E.path.split(",") : []; - if (E.path = void 0, E.query) { - for (var B = !1, ae = {}, re = E.query.split("&"), pe = 0, ke = re.length; pe < ke; ++pe) { - var me = re[pe].split("="); - switch (me[0]) { - case "to": - for (var de = me[1].split(","), be = 0, ye = de.length; be < ye; ++be) - V.push(de[be]); - break; - case "subject": - E.subject = De(me[1], $); - break; - case "body": - E.body = De(me[1], $); - break; - default: - B = !0, ae[De(me[0], $)] = De(me[1], $); - break; - } - } - B && (E.headers = ae); - } - E.query = void 0; - for (var oe = 0, Pe = V.length; oe < Pe; ++oe) { - var ge = V[oe].split("@"); - if (ge[0] = De(ge[0]), $.unicodeSupport) - ge[1] = De(ge[1], $).toLowerCase(); - else - try { - ge[1] = z.toASCII(De(ge[1], $).toLowerCase()); - } catch (Ve) { - E.error = E.error || "Email address's domain name can not be converted to ASCII via punycode: " + Ve; - } - V[oe] = ge.join("@"); - } - return E; - }, - serialize: function(h, $) { - var E = h, V = p(h.to); - if (V) { - for (var B = 0, ae = V.length; B < ae; ++B) { - var re = String(V[B]), pe = re.lastIndexOf("@"), ke = re.slice(0, pe).replace(Pt, Er).replace(Pt, m).replace(to, Y), me = re.slice(pe + 1); - try { - me = $.iri ? z.toUnicode(me) : z.toASCII(De(me, $).toLowerCase()); - } catch (oe) { - E.error = E.error || "Email address's domain name can not be converted to " + ($.iri ? "Unicode" : "ASCII") + " via punycode: " + oe; - } - V[B] = ke + "@" + me; - } - E.path = V.join(","); - } - var de = h.headers = h.headers || {}; - h.subject && (de.subject = h.subject), h.body && (de.body = h.body); - var be = []; - for (var ye in de) - de[ye] !== Wn[ye] && be.push(ye.replace(Pt, Er).replace(Pt, m).replace(Ta, Y) + "=" + de[ye].replace(Pt, Er).replace(Pt, m).replace(ro, Y)); - return be.length && (E.query = be.join("&")), E; - } - }, ao = /^([^\:]+)\:(.*)/, Oa = { - scheme: "urn", - parse: function(h, $) { - var E = h.path && h.path.match(ao), V = h; - if (E) { - var B = $.scheme || V.scheme || "urn", ae = E[1].toLowerCase(), re = E[2], pe = B + ":" + ($.nid || ae), ke = J[pe]; - V.nid = ae, V.nss = re, V.path = void 0, ke && (V = ke.parse(V, $)); - } else - V.error = V.error || "URN can not be parsed."; - return V; - }, - serialize: function(h, $) { - var E = $.scheme || h.scheme || "urn", V = h.nid, B = E + ":" + ($.nid || V), ae = J[B]; - ae && (h = ae.serialize(h, $)); - var re = h, pe = h.nss; - return re.path = (V || $.nid) + ":" + pe, re; - } - }, no = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Aa = { - scheme: "urn:uuid", - parse: function(h, $) { - var E = h; - return E.uuid = E.nss, E.nss = void 0, !$.tolerant && (!E.uuid || !E.uuid.match(no)) && (E.error = E.error || "UUID is not valid."), E; - }, - serialize: function(h, $) { - var E = h; - return E.nss = (h.uuid || "").toLowerCase(), E; - } - }; - J[ht.scheme] = ht, J[Ea.scheme] = Ea, J[Lt.scheme] = Lt, J[ja.scheme] = ja, J[Ca.scheme] = Ca, J[Oa.scheme] = Oa, J[Aa.scheme] = Aa, n.SCHEMES = J, n.pctEncChar = Y, n.pctDecChars = se, n.parse = ne, n.removeDotSegments = ze, n.serialize = ve, n.resolveComponents = kt, n.resolve = Mt, n.normalize = dt, n.equal = Rt, n.escapeComponent = Xt, n.unescapeComponent = De, Object.defineProperty(n, "__esModule", { value: !0 }); - }); -})(Nr, Nr.exports); -var ss = Nr.exports; -Object.defineProperty(Ur, "__esModule", { value: !0 }); -const xn = ss; -xn.code = 'require("ajv/dist/runtime/uri").default'; -Ur.default = xn; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0; - var t = yr(); - Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() { - return t.KeywordCxt; - } }); - var n = ue; - Object.defineProperty(e, "_", { enumerable: !0, get: function() { - return n._; - } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() { - return n.str; - } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() { - return n.stringify; - } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() { - return n.nil; - } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() { - return n.Name; - } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() { - return n.CodeGen; - } }); - const a = Zt, i = Yt, l = yt, m = Le, p = ue, g = Ae, v = Wt, b = he, S = os, I = Ur, M = (q, P) => new RegExp(q, P); - M.code = "new RegExp"; - const O = ["removeAdditional", "useDefaults", "coerceTypes"], x = /* @__PURE__ */ new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error" - ]), T = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", - ajvErrors: "It is default now." - }, k = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.' - }, A = 200; - function L(q) { - var P, H, N, d, y, z, J, Y, se, ie, C, R, K, Z, te, ne, Ee, Ne, Te, Ce, Se, ze, ve, kt, Mt; - const dt = q.strict, Rt = (P = q.code) === null || P === void 0 ? void 0 : P.optimize, Xt = Rt === !0 || Rt === void 0 ? 1 : Rt || 0, De = (N = (H = q.code) === null || H === void 0 ? void 0 : H.regExp) !== null && N !== void 0 ? N : M, ht = (d = q.uriResolver) !== null && d !== void 0 ? d : I.default; - return { - strictSchema: (z = (y = q.strictSchema) !== null && y !== void 0 ? y : dt) !== null && z !== void 0 ? z : !0, - strictNumbers: (Y = (J = q.strictNumbers) !== null && J !== void 0 ? J : dt) !== null && Y !== void 0 ? Y : !0, - strictTypes: (ie = (se = q.strictTypes) !== null && se !== void 0 ? se : dt) !== null && ie !== void 0 ? ie : "log", - strictTuples: (R = (C = q.strictTuples) !== null && C !== void 0 ? C : dt) !== null && R !== void 0 ? R : "log", - strictRequired: (Z = (K = q.strictRequired) !== null && K !== void 0 ? K : dt) !== null && Z !== void 0 ? Z : !1, - code: q.code ? { ...q.code, optimize: Xt, regExp: De } : { optimize: Xt, regExp: De }, - loopRequired: (te = q.loopRequired) !== null && te !== void 0 ? te : A, - loopEnum: (ne = q.loopEnum) !== null && ne !== void 0 ? ne : A, - meta: (Ee = q.meta) !== null && Ee !== void 0 ? Ee : !0, - messages: (Ne = q.messages) !== null && Ne !== void 0 ? Ne : !0, - inlineRefs: (Te = q.inlineRefs) !== null && Te !== void 0 ? Te : !0, - schemaId: (Ce = q.schemaId) !== null && Ce !== void 0 ? Ce : "$id", - addUsedSchema: (Se = q.addUsedSchema) !== null && Se !== void 0 ? Se : !0, - validateSchema: (ze = q.validateSchema) !== null && ze !== void 0 ? ze : !0, - validateFormats: (ve = q.validateFormats) !== null && ve !== void 0 ? ve : !0, - unicodeRegExp: (kt = q.unicodeRegExp) !== null && kt !== void 0 ? kt : !0, - int32range: (Mt = q.int32range) !== null && Mt !== void 0 ? Mt : !0, - uriResolver: ht - }; - } - class r { - constructor(P = {}) { - this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), P = this.opts = { ...P, ...L(P) }; - const { es5: H, lines: N } = this.opts.code; - this.scope = new p.ValueScope({ scope: {}, prefixes: x, es5: H, lines: N }), this.logger = F(P.logger); - const d = P.validateFormats; - P.validateFormats = !1, this.RULES = (0, l.getRules)(), s.call(this, T, P, "NOT SUPPORTED"), s.call(this, k, P, "DEPRECATED", "warn"), this._metaOpts = f.call(this), P.formats && u.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), P.keywords && _.call(this, P.keywords), typeof P.meta == "object" && this.addMetaSchema(P.meta), c.call(this), P.validateFormats = d; - } - _addVocabularies() { - this.addKeyword("$async"); - } - _addDefaultMetaSchema() { - const { $data: P, meta: H, schemaId: N } = this.opts; - let d = S; - N === "id" && (d = { ...S }, d.id = d.$id, delete d.$id), H && P && this.addMetaSchema(d, d[N], !1); - } - defaultMeta() { - const { meta: P, schemaId: H } = this.opts; - return this.opts.defaultMeta = typeof P == "object" ? P[H] || P : void 0; - } - validate(P, H) { - let N; - if (typeof P == "string") { - if (N = this.getSchema(P), !N) - throw new Error(`no schema with key or ref "${P}"`); - } else - N = this.compile(P); - const d = N(H); - return "$async" in N || (this.errors = N.errors), d; - } - compile(P, H) { - const N = this._addSchema(P, H); - return N.validate || this._compileSchemaEnv(N); - } - compileAsync(P, H) { - if (typeof this.opts.loadSchema != "function") - throw new Error("options.loadSchema should be a function"); - const { loadSchema: N } = this.opts; - return d.call(this, P, H); - async function d(ie, C) { - await y.call(this, ie.$schema); - const R = this._addSchema(ie, C); - return R.validate || z.call(this, R); - } - async function y(ie) { - ie && !this.getSchema(ie) && await d.call(this, { $ref: ie }, !0); - } - async function z(ie) { - try { - return this._compileSchemaEnv(ie); - } catch (C) { - if (!(C instanceof i.default)) - throw C; - return J.call(this, C), await Y.call(this, C.missingSchema), z.call(this, ie); - } - } - function J({ missingSchema: ie, missingRef: C }) { - if (this.refs[ie]) - throw new Error(`AnySchema ${ie} is loaded but ${C} cannot be resolved`); - } - async function Y(ie) { - const C = await se.call(this, ie); - this.refs[ie] || await y.call(this, C.$schema), this.refs[ie] || this.addSchema(C, ie, H); - } - async function se(ie) { - const C = this._loading[ie]; - if (C) - return C; - try { - return await (this._loading[ie] = N(ie)); - } finally { - delete this._loading[ie]; - } - } - } - // Adds schema to the instance - addSchema(P, H, N, d = this.opts.validateSchema) { - if (Array.isArray(P)) { - for (const z of P) - this.addSchema(z, void 0, N, d); - return this; - } - let y; - if (typeof P == "object") { - const { schemaId: z } = this.opts; - if (y = P[z], y !== void 0 && typeof y != "string") - throw new Error(`schema ${z} must be string`); - } - return H = (0, g.normalizeId)(H || y), this._checkUnique(H), this.schemas[H] = this._addSchema(P, N, H, d, !0), this; - } - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema(P, H, N = this.opts.validateSchema) { - return this.addSchema(P, H, !0, N), this; - } - // Validate schema against its meta-schema - validateSchema(P, H) { - if (typeof P == "boolean") - return !0; - let N; - if (N = P.$schema, N !== void 0 && typeof N != "string") - throw new Error("$schema must be a string"); - if (N = N || this.opts.defaultMeta || this.defaultMeta(), !N) - return this.logger.warn("meta-schema not available"), this.errors = null, !0; - const d = this.validate(N, P); - if (!d && H) { - const y = "schema is invalid: " + this.errorsText(); - if (this.opts.validateSchema === "log") - this.logger.error(y); - else - throw new Error(y); - } - return d; - } - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(P) { - let H; - for (; typeof (H = o.call(this, P)) == "string"; ) - P = H; - if (H === void 0) { - const { schemaId: N } = this.opts, d = new m.SchemaEnv({ schema: {}, schemaId: N }); - if (H = m.resolveSchema.call(this, d, P), !H) - return; - this.refs[P] = H; - } - return H.validate || this._compileSchemaEnv(H); - } - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(P) { - if (P instanceof RegExp) - return this._removeAllSchemas(this.schemas, P), this._removeAllSchemas(this.refs, P), this; - switch (typeof P) { - case "undefined": - return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this; - case "string": { - const H = o.call(this, P); - return typeof H == "object" && this._cache.delete(H.schema), delete this.schemas[P], delete this.refs[P], this; - } - case "object": { - const H = P; - this._cache.delete(H); - let N = P[this.opts.schemaId]; - return N && (N = (0, g.normalizeId)(N), delete this.schemas[N], delete this.refs[N]), this; - } - default: - throw new Error("ajv.removeSchema: invalid parameter"); - } - } - // add "vocabulary" - a collection of keywords - addVocabulary(P) { - for (const H of P) - this.addKeyword(H); - return this; - } - addKeyword(P, H) { - let N; - if (typeof P == "string") - N = P, typeof H == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), H.keyword = N); - else if (typeof P == "object" && H === void 0) { - if (H = P, N = H.keyword, Array.isArray(N) && !N.length) - throw new Error("addKeywords: keyword must be string or non-empty array"); - } else - throw new Error("invalid addKeywords parameters"); - if (D.call(this, N, H), !H) - return (0, b.eachItem)(N, (y) => W.call(this, y)), this; - G.call(this, H); - const d = { - ...H, - type: (0, v.getJSONTypes)(H.type), - schemaType: (0, v.getJSONTypes)(H.schemaType) - }; - return (0, b.eachItem)(N, d.type.length === 0 ? (y) => W.call(this, y, d) : (y) => d.type.forEach((z) => W.call(this, y, d, z))), this; - } - getKeyword(P) { - const H = this.RULES.all[P]; - return typeof H == "object" ? H.definition : !!H; - } - // Remove keyword - removeKeyword(P) { - const { RULES: H } = this; - delete H.keywords[P], delete H.all[P]; - for (const N of H.rules) { - const d = N.rules.findIndex((y) => y.keyword === P); - d >= 0 && N.rules.splice(d, 1); - } - return this; - } - // Add format - addFormat(P, H) { - return typeof H == "string" && (H = new RegExp(H)), this.formats[P] = H, this; - } - errorsText(P = this.errors, { separator: H = ", ", dataVar: N = "data" } = {}) { - return !P || P.length === 0 ? "No errors" : P.map((d) => `${N}${d.instancePath} ${d.message}`).reduce((d, y) => d + H + y); - } - $dataMetaSchema(P, H) { - const N = this.RULES.all; - P = JSON.parse(JSON.stringify(P)); - for (const d of H) { - const y = d.split("/").slice(1); - let z = P; - for (const J of y) - z = z[J]; - for (const J in N) { - const Y = N[J]; - if (typeof Y != "object") - continue; - const { $data: se } = Y.definition, ie = z[J]; - se && ie && (z[J] = ee(ie)); - } - } - return P; - } - _removeAllSchemas(P, H) { - for (const N in P) { - const d = P[N]; - (!H || H.test(N)) && (typeof d == "string" ? delete P[N] : d && !d.meta && (this._cache.delete(d.schema), delete P[N])); - } - } - _addSchema(P, H, N, d = this.opts.validateSchema, y = this.opts.addUsedSchema) { - let z; - const { schemaId: J } = this.opts; - if (typeof P == "object") - z = P[J]; - else { - if (this.opts.jtd) - throw new Error("schema must be object"); - if (typeof P != "boolean") - throw new Error("schema must be object or boolean"); - } - let Y = this._cache.get(P); - if (Y !== void 0) - return Y; - N = (0, g.normalizeId)(z || N); - const se = g.getSchemaRefs.call(this, P, N); - return Y = new m.SchemaEnv({ schema: P, schemaId: J, meta: H, baseId: N, localRefs: se }), this._cache.set(Y.schema, Y), y && !N.startsWith("#") && (N && this._checkUnique(N), this.refs[N] = Y), d && this.validateSchema(P, !0), Y; - } - _checkUnique(P) { - if (this.schemas[P] || this.refs[P]) - throw new Error(`schema with key or id "${P}" already exists`); - } - _compileSchemaEnv(P) { - if (P.meta ? this._compileMetaSchema(P) : m.compileSchema.call(this, P), !P.validate) - throw new Error("ajv implementation error"); - return P.validate; - } - _compileMetaSchema(P) { - const H = this.opts; - this.opts = this._metaOpts; - try { - m.compileSchema.call(this, P); - } finally { - this.opts = H; - } - } - } - e.default = r, r.ValidationError = a.default, r.MissingRefError = i.default; - function s(q, P, H, N = "error") { - for (const d in q) { - const y = d; - y in P && this.logger[N](`${H}: option ${d}. ${q[y]}`); - } - } - function o(q) { - return q = (0, g.normalizeId)(q), this.schemas[q] || this.refs[q]; - } - function c() { - const q = this.opts.schemas; - if (q) - if (Array.isArray(q)) - this.addSchema(q); - else - for (const P in q) - this.addSchema(q[P], P); - } - function u() { - for (const q in this.opts.formats) { - const P = this.opts.formats[q]; - P && this.addFormat(q, P); - } - } - function _(q) { - if (Array.isArray(q)) { - this.addVocabulary(q); - return; - } - this.logger.warn("keywords option as map is deprecated, pass array"); - for (const P in q) { - const H = q[P]; - H.keyword || (H.keyword = P), this.addKeyword(H); - } - } - function f() { - const q = { ...this.opts }; - for (const P of O) - delete q[P]; - return q; - } - const j = { log() { - }, warn() { - }, error() { - } }; - function F(q) { - if (q === !1) - return j; - if (q === void 0) - return console; - if (q.log && q.warn && q.error) - return q; - throw new Error("logger must implement log, warn and error methods"); - } - const U = /^[a-z_$][a-z0-9_$:-]*$/i; - function D(q, P) { - const { RULES: H } = this; - if ((0, b.eachItem)(q, (N) => { - if (H.keywords[N]) - throw new Error(`Keyword ${N} is already defined`); - if (!U.test(N)) - throw new Error(`Keyword ${N} has invalid name`); - }), !!P && P.$data && !("code" in P || "validate" in P)) - throw new Error('$data keyword must have "code" or "validate" function'); - } - function W(q, P, H) { - var N; - const d = P == null ? void 0 : P.post; - if (H && d) - throw new Error('keyword with "post" flag cannot have "type"'); - const { RULES: y } = this; - let z = d ? y.post : y.rules.find(({ type: Y }) => Y === H); - if (z || (z = { type: H, rules: [] }, y.rules.push(z)), y.keywords[q] = !0, !P) - return; - const J = { - keyword: q, - definition: { - ...P, - type: (0, v.getJSONTypes)(P.type), - schemaType: (0, v.getJSONTypes)(P.schemaType) - } - }; - P.before ? w.call(this, z, J, P.before) : z.rules.push(J), y.all[q] = J, (N = P.implements) === null || N === void 0 || N.forEach((Y) => this.addKeyword(Y)); - } - function w(q, P, H) { - const N = q.rules.findIndex((d) => d.keyword === H); - N >= 0 ? q.rules.splice(N, 0, P) : (q.rules.push(P), this.logger.warn(`rule ${H} is not defined`)); - } - function G(q) { - let { metaSchema: P } = q; - P !== void 0 && (q.$data && this.opts.$data && (P = ee(P)), q.validateSchema = this.compile(P, !0)); - } - const Q = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" - }; - function ee(q) { - return { anyOf: [q, Q] }; - } -})(bn); -var qr = {}, Hr = {}, Kr = {}; -Object.defineProperty(Kr, "__esModule", { value: !0 }); -const is = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); - } -}; -Kr.default = is; -var $t = {}; -Object.defineProperty($t, "__esModule", { value: !0 }); -$t.callRef = $t.getValidate = void 0; -const cs = Yt, qa = le, Re = ue, St = ut(), Ha = Le, or = he, ls = { - keyword: "$ref", - schemaType: "string", - code(e) { - const { gen: t, schema: n, it: a } = e, { baseId: i, schemaEnv: l, validateName: m, opts: p, self: g } = a, { root: v } = l; - if ((n === "#" || n === "#/") && i === v.baseId) - return S(); - const b = Ha.resolveRef.call(g, v, i, n); - if (b === void 0) - throw new cs.default(a.opts.uriResolver, i, n); - if (b instanceof Ha.SchemaEnv) - return I(b); - return M(b); - function S() { - if (l === v) - return hr(e, m, l, l.$async); - const O = t.scopeValue("root", { ref: v }); - return hr(e, (0, Re._)`${O}.validate`, v, v.$async); - } - function I(O) { - const x = Tn(e, O); - hr(e, x, O, O.$async); - } - function M(O) { - const x = t.scopeValue("schema", p.code.source === !0 ? { ref: O, code: (0, Re.stringify)(O) } : { ref: O }), T = t.name("valid"), k = e.subschema({ - schema: O, - dataTypes: [], - schemaPath: Re.nil, - topSchemaRef: x, - errSchemaPath: n - }, T); - e.mergeEvaluated(k), e.ok(T); - } - } -}; -function Tn(e, t) { - const { gen: n } = e; - return t.validate ? n.scopeValue("validate", { ref: t.validate }) : (0, Re._)`${n.scopeValue("wrapper", { ref: t })}.validate`; -} -$t.getValidate = Tn; -function hr(e, t, n, a) { - const { gen: i, it: l } = e, { allErrors: m, schemaEnv: p, opts: g } = l, v = g.passContext ? St.default.this : Re.nil; - a ? b() : S(); - function b() { - if (!p.$async) - throw new Error("async schema referenced by sync schema"); - const O = i.let("valid"); - i.try(() => { - i.code((0, Re._)`await ${(0, qa.callValidateCode)(e, t, v)}`), M(t), m || i.assign(O, !0); - }, (x) => { - i.if((0, Re._)`!(${x} instanceof ${l.ValidationError})`, () => i.throw(x)), I(x), m || i.assign(O, !1); - }), e.ok(O); - } - function S() { - e.result((0, qa.callValidateCode)(e, t, v), () => M(t), () => I(t)); - } - function I(O) { - const x = (0, Re._)`${O}.errors`; - i.assign(St.default.vErrors, (0, Re._)`${St.default.vErrors} === null ? ${x} : ${St.default.vErrors}.concat(${x})`), i.assign(St.default.errors, (0, Re._)`${St.default.vErrors}.length`); - } - function M(O) { - var x; - if (!l.opts.unevaluated) - return; - const T = (x = n == null ? void 0 : n.validate) === null || x === void 0 ? void 0 : x.evaluated; - if (l.props !== !0) - if (T && !T.dynamicProps) - T.props !== void 0 && (l.props = or.mergeEvaluated.props(i, T.props, l.props)); - else { - const k = i.var("props", (0, Re._)`${O}.evaluated.props`); - l.props = or.mergeEvaluated.props(i, k, l.props, Re.Name); - } - if (l.items !== !0) - if (T && !T.dynamicItems) - T.items !== void 0 && (l.items = or.mergeEvaluated.items(i, T.items, l.items)); - else { - const k = i.var("items", (0, Re._)`${O}.evaluated.items`); - l.items = or.mergeEvaluated.items(i, k, l.items, Re.Name); - } - } -} -$t.callRef = hr; -$t.default = ls; -Object.defineProperty(Hr, "__esModule", { value: !0 }); -const us = Kr, ds = $t, hs = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - { keyword: "$comment" }, - "definitions", - us.default, - ds.default -]; -Hr.default = hs; -var Gr = {}, Wr = {}; -Object.defineProperty(Wr, "__esModule", { value: !0 }); -const mr = ue, st = mr.operators, gr = { - maximum: { okStr: "<=", ok: st.LTE, fail: st.GT }, - minimum: { okStr: ">=", ok: st.GTE, fail: st.LT }, - exclusiveMaximum: { okStr: "<", ok: st.LT, fail: st.GTE }, - exclusiveMinimum: { okStr: ">", ok: st.GT, fail: st.LTE } -}, ps = { - message: ({ keyword: e, schemaCode: t }) => (0, mr.str)`must be ${gr[e].okStr} ${t}`, - params: ({ keyword: e, schemaCode: t }) => (0, mr._)`{comparison: ${gr[e].okStr}, limit: ${t}}` -}, fs = { - keyword: Object.keys(gr), - type: "number", - schemaType: "number", - $data: !0, - error: ps, - code(e) { - const { keyword: t, data: n, schemaCode: a } = e; - e.fail$data((0, mr._)`${n} ${gr[t].fail} ${a} || isNaN(${n})`); - } -}; -Wr.default = fs; -var Jr = {}; -Object.defineProperty(Jr, "__esModule", { value: !0 }); -const Ft = ue, ms = { - message: ({ schemaCode: e }) => (0, Ft.str)`must be multiple of ${e}`, - params: ({ schemaCode: e }) => (0, Ft._)`{multipleOf: ${e}}` -}, gs = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: !0, - error: ms, - code(e) { - const { gen: t, data: n, schemaCode: a, it: i } = e, l = i.opts.multipleOfPrecision, m = t.let("res"), p = l ? (0, Ft._)`Math.abs(Math.round(${m}) - ${m}) > 1e-${l}` : (0, Ft._)`${m} !== parseInt(${m})`; - e.fail$data((0, Ft._)`(${a} === 0 || (${m} = ${n}/${a}, ${p}))`); - } -}; -Jr.default = gs; -var Zr = {}, Yr = {}; -Object.defineProperty(Yr, "__esModule", { value: !0 }); -function Cn(e) { - const t = e.length; - let n = 0, a = 0, i; - for (; a < t; ) - n++, i = e.charCodeAt(a++), i >= 55296 && i <= 56319 && a < t && (i = e.charCodeAt(a), (i & 64512) === 56320 && a++); - return n; -} -Yr.default = Cn; -Cn.code = 'require("ajv/dist/runtime/ucs2length").default'; -Object.defineProperty(Zr, "__esModule", { value: !0 }); -const wt = ue, _s = he, bs = Yr, ws = { - message({ keyword: e, schemaCode: t }) { - const n = e === "maxLength" ? "more" : "fewer"; - return (0, wt.str)`must NOT have ${n} than ${t} characters`; - }, - params: ({ schemaCode: e }) => (0, wt._)`{limit: ${e}}` -}, vs = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: !0, - error: ws, - code(e) { - const { keyword: t, data: n, schemaCode: a, it: i } = e, l = t === "maxLength" ? wt.operators.GT : wt.operators.LT, m = i.opts.unicode === !1 ? (0, wt._)`${n}.length` : (0, wt._)`${(0, _s.useFunc)(e.gen, bs.default)}(${n})`; - e.fail$data((0, wt._)`${m} ${l} ${a}`); - } -}; -Zr.default = vs; -var Qr = {}; -Object.defineProperty(Qr, "__esModule", { value: !0 }); -const ys = le, _r = ue, $s = { - message: ({ schemaCode: e }) => (0, _r.str)`must match pattern "${e}"`, - params: ({ schemaCode: e }) => (0, _r._)`{pattern: ${e}}` -}, ks = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: !0, - error: $s, - code(e) { - const { data: t, $data: n, schema: a, schemaCode: i, it: l } = e, m = l.opts.unicodeRegExp ? "u" : "", p = n ? (0, _r._)`(new RegExp(${i}, ${m}))` : (0, ys.usePattern)(e, a); - e.fail$data((0, _r._)`!${p}.test(${t})`); - } -}; -Qr.default = ks; -var Xr = {}; -Object.defineProperty(Xr, "__esModule", { value: !0 }); -const Ut = ue, Ps = { - message({ keyword: e, schemaCode: t }) { - const n = e === "maxProperties" ? "more" : "fewer"; - return (0, Ut.str)`must NOT have ${n} than ${t} properties`; - }, - params: ({ schemaCode: e }) => (0, Ut._)`{limit: ${e}}` -}, Es = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: !0, - error: Ps, - code(e) { - const { keyword: t, data: n, schemaCode: a } = e, i = t === "maxProperties" ? Ut.operators.GT : Ut.operators.LT; - e.fail$data((0, Ut._)`Object.keys(${n}).length ${i} ${a}`); - } -}; -Xr.default = Es; -var ea = {}; -Object.defineProperty(ea, "__esModule", { value: !0 }); -const Vt = le, qt = ue, Ss = he, js = { - message: ({ params: { missingProperty: e } }) => (0, qt.str)`must have required property '${e}'`, - params: ({ params: { missingProperty: e } }) => (0, qt._)`{missingProperty: ${e}}` -}, xs = { - keyword: "required", - type: "object", - schemaType: "array", - $data: !0, - error: js, - code(e) { - const { gen: t, schema: n, schemaCode: a, data: i, $data: l, it: m } = e, { opts: p } = m; - if (!l && n.length === 0) - return; - const g = n.length >= p.loopRequired; - if (m.allErrors ? v() : b(), p.strictRequired) { - const M = e.parentSchema.properties, { definedProperties: O } = e.it; - for (const x of n) - if ((M == null ? void 0 : M[x]) === void 0 && !O.has(x)) { - const T = m.schemaEnv.baseId + m.errSchemaPath, k = `required property "${x}" is not defined at "${T}" (strictRequired)`; - (0, Ss.checkStrictMode)(m, k, m.opts.strictRequired); - } - } - function v() { - if (g || l) - e.block$data(qt.nil, S); - else - for (const M of n) - (0, Vt.checkReportMissingProp)(e, M); - } - function b() { - const M = t.let("missing"); - if (g || l) { - const O = t.let("valid", !0); - e.block$data(O, () => I(M, O)), e.ok(O); - } else - t.if((0, Vt.checkMissingProp)(e, n, M)), (0, Vt.reportMissingProp)(e, M), t.else(); - } - function S() { - t.forOf("prop", a, (M) => { - e.setParams({ missingProperty: M }), t.if((0, Vt.noPropertyInData)(t, i, M, p.ownProperties), () => e.error()); - }); - } - function I(M, O) { - e.setParams({ missingProperty: M }), t.forOf(M, a, () => { - t.assign(O, (0, Vt.propertyInData)(t, i, M, p.ownProperties)), t.if((0, qt.not)(O), () => { - e.error(), t.break(); - }); - }, qt.nil); - } - } -}; -ea.default = xs; -var ta = {}; -Object.defineProperty(ta, "__esModule", { value: !0 }); -const Ht = ue, Ts = { - message({ keyword: e, schemaCode: t }) { - const n = e === "maxItems" ? "more" : "fewer"; - return (0, Ht.str)`must NOT have ${n} than ${t} items`; - }, - params: ({ schemaCode: e }) => (0, Ht._)`{limit: ${e}}` -}, Cs = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: !0, - error: Ts, - code(e) { - const { keyword: t, data: n, schemaCode: a } = e, i = t === "maxItems" ? Ht.operators.GT : Ht.operators.LT; - e.fail$data((0, Ht._)`${n}.length ${i} ${a}`); - } -}; -ta.default = Cs; -var ra = {}, Qt = {}; -Object.defineProperty(Qt, "__esModule", { value: !0 }); -const On = $n; -On.code = 'require("ajv/dist/runtime/equal").default'; -Qt.default = On; -Object.defineProperty(ra, "__esModule", { value: !0 }); -const xr = Wt, Oe = ue, Os = he, As = Qt, Is = { - message: ({ params: { i: e, j: t } }) => (0, Oe.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`, - params: ({ params: { i: e, j: t } }) => (0, Oe._)`{i: ${e}, j: ${t}}` -}, Ns = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: !0, - error: Is, - code(e) { - const { gen: t, data: n, $data: a, schema: i, parentSchema: l, schemaCode: m, it: p } = e; - if (!a && !i) - return; - const g = t.let("valid"), v = l.items ? (0, xr.getSchemaTypes)(l.items) : []; - e.block$data(g, b, (0, Oe._)`${m} === false`), e.ok(g); - function b() { - const O = t.let("i", (0, Oe._)`${n}.length`), x = t.let("j"); - e.setParams({ i: O, j: x }), t.assign(g, !0), t.if((0, Oe._)`${O} > 1`, () => (S() ? I : M)(O, x)); - } - function S() { - return v.length > 0 && !v.some((O) => O === "object" || O === "array"); - } - function I(O, x) { - const T = t.name("item"), k = (0, xr.checkDataTypes)(v, T, p.opts.strictNumbers, xr.DataType.Wrong), A = t.const("indices", (0, Oe._)`{}`); - t.for((0, Oe._)`;${O}--;`, () => { - t.let(T, (0, Oe._)`${n}[${O}]`), t.if(k, (0, Oe._)`continue`), v.length > 1 && t.if((0, Oe._)`typeof ${T} == "string"`, (0, Oe._)`${T} += "_"`), t.if((0, Oe._)`typeof ${A}[${T}] == "number"`, () => { - t.assign(x, (0, Oe._)`${A}[${T}]`), e.error(), t.assign(g, !1).break(); - }).code((0, Oe._)`${A}[${T}] = ${O}`); - }); - } - function M(O, x) { - const T = (0, Os.useFunc)(t, As.default), k = t.name("outer"); - t.label(k).for((0, Oe._)`;${O}--;`, () => t.for((0, Oe._)`${x} = ${O}; ${x}--;`, () => t.if((0, Oe._)`${T}(${n}[${O}], ${n}[${x}])`, () => { - e.error(), t.assign(g, !1).break(k); - }))); - } - } -}; -ra.default = Ns; -var aa = {}; -Object.defineProperty(aa, "__esModule", { value: !0 }); -const Mr = ue, Ms = he, Rs = Qt, Ls = { - message: "must be equal to constant", - params: ({ schemaCode: e }) => (0, Mr._)`{allowedValue: ${e}}` -}, zs = { - keyword: "const", - $data: !0, - error: Ls, - code(e) { - const { gen: t, data: n, $data: a, schemaCode: i, schema: l } = e; - a || l && typeof l == "object" ? e.fail$data((0, Mr._)`!${(0, Ms.useFunc)(t, Rs.default)}(${n}, ${i})`) : e.fail((0, Mr._)`${l} !== ${n}`); - } -}; -aa.default = zs; -var na = {}; -Object.defineProperty(na, "__esModule", { value: !0 }); -const Bt = ue, Ds = he, Vs = Qt, Bs = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode: e }) => (0, Bt._)`{allowedValues: ${e}}` -}, Fs = { - keyword: "enum", - schemaType: "array", - $data: !0, - error: Bs, - code(e) { - const { gen: t, data: n, $data: a, schema: i, schemaCode: l, it: m } = e; - if (!a && i.length === 0) - throw new Error("enum must have non-empty array"); - const p = i.length >= m.opts.loopEnum; - let g; - const v = () => g ?? (g = (0, Ds.useFunc)(t, Vs.default)); - let b; - if (p || a) - b = t.let("valid"), e.block$data(b, S); - else { - if (!Array.isArray(i)) - throw new Error("ajv implementation error"); - const M = t.const("vSchema", l); - b = (0, Bt.or)(...i.map((O, x) => I(M, x))); - } - e.pass(b); - function S() { - t.assign(b, !1), t.forOf("v", l, (M) => t.if((0, Bt._)`${v()}(${n}, ${M})`, () => t.assign(b, !0).break())); - } - function I(M, O) { - const x = i[O]; - return typeof x == "object" && x !== null ? (0, Bt._)`${v()}(${n}, ${M}[${O}])` : (0, Bt._)`${n} === ${x}`; - } - } -}; -na.default = Fs; -Object.defineProperty(Gr, "__esModule", { value: !0 }); -const Us = Wr, qs = Jr, Hs = Zr, Ks = Qr, Gs = Xr, Ws = ea, Js = ta, Zs = ra, Ys = aa, Qs = na, Xs = [ - // number - Us.default, - qs.default, - // string - Hs.default, - Ks.default, - // object - Gs.default, - Ws.default, - // array - Js.default, - Zs.default, - // any - { keyword: "type", schemaType: ["string", "array"] }, - { keyword: "nullable", schemaType: "boolean" }, - Ys.default, - Qs.default -]; -Gr.default = Xs; -var oa = {}, It = {}; -Object.defineProperty(It, "__esModule", { value: !0 }); -It.validateAdditionalItems = void 0; -const vt = ue, Rr = he, ei = { - message: ({ params: { len: e } }) => (0, vt.str)`must NOT have more than ${e} items`, - params: ({ params: { len: e } }) => (0, vt._)`{limit: ${e}}` -}, ti = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error: ei, - code(e) { - const { parentSchema: t, it: n } = e, { items: a } = t; - if (!Array.isArray(a)) { - (0, Rr.checkStrictMode)(n, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - An(e, a); - } -}; -function An(e, t) { - const { gen: n, schema: a, data: i, keyword: l, it: m } = e; - m.items = !0; - const p = n.const("len", (0, vt._)`${i}.length`); - if (a === !1) - e.setParams({ len: t.length }), e.pass((0, vt._)`${p} <= ${t.length}`); - else if (typeof a == "object" && !(0, Rr.alwaysValidSchema)(m, a)) { - const v = n.var("valid", (0, vt._)`${p} <= ${t.length}`); - n.if((0, vt.not)(v), () => g(v)), e.ok(v); - } - function g(v) { - n.forRange("i", t.length, p, (b) => { - e.subschema({ keyword: l, dataProp: b, dataPropType: Rr.Type.Num }, v), m.allErrors || n.if((0, vt.not)(v), () => n.break()); - }); - } -} -It.validateAdditionalItems = An; -It.default = ti; -var sa = {}, Nt = {}; -Object.defineProperty(Nt, "__esModule", { value: !0 }); -Nt.validateTuple = void 0; -const Ka = ue, pr = he, ri = le, ai = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(e) { - const { schema: t, it: n } = e; - if (Array.isArray(t)) - return In(e, "additionalItems", t); - n.items = !0, !(0, pr.alwaysValidSchema)(n, t) && e.ok((0, ri.validateArray)(e)); - } -}; -function In(e, t, n = e.schema) { - const { gen: a, parentSchema: i, data: l, keyword: m, it: p } = e; - b(i), p.opts.unevaluated && n.length && p.items !== !0 && (p.items = pr.mergeEvaluated.items(a, n.length, p.items)); - const g = a.name("valid"), v = a.const("len", (0, Ka._)`${l}.length`); - n.forEach((S, I) => { - (0, pr.alwaysValidSchema)(p, S) || (a.if((0, Ka._)`${v} > ${I}`, () => e.subschema({ - keyword: m, - schemaProp: I, - dataProp: I - }, g)), e.ok(g)); - }); - function b(S) { - const { opts: I, errSchemaPath: M } = p, O = n.length, x = O === S.minItems && (O === S.maxItems || S[t] === !1); - if (I.strictTuples && !x) { - const T = `"${m}" is ${O}-tuple, but minItems or maxItems/${t} are not specified or different at path "${M}"`; - (0, pr.checkStrictMode)(p, T, I.strictTuples); - } - } -} -Nt.validateTuple = In; -Nt.default = ai; -Object.defineProperty(sa, "__esModule", { value: !0 }); -const ni = Nt, oi = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (e) => (0, ni.validateTuple)(e, "items") -}; -sa.default = oi; -var ia = {}; -Object.defineProperty(ia, "__esModule", { value: !0 }); -const Ga = ue, si = he, ii = le, ci = It, li = { - message: ({ params: { len: e } }) => (0, Ga.str)`must NOT have more than ${e} items`, - params: ({ params: { len: e } }) => (0, Ga._)`{limit: ${e}}` -}, ui = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error: li, - code(e) { - const { schema: t, parentSchema: n, it: a } = e, { prefixItems: i } = n; - a.items = !0, !(0, si.alwaysValidSchema)(a, t) && (i ? (0, ci.validateAdditionalItems)(e, i) : e.ok((0, ii.validateArray)(e))); - } -}; -ia.default = ui; -var ca = {}; -Object.defineProperty(ca, "__esModule", { value: !0 }); -const qe = ue, sr = he, di = { - message: ({ params: { min: e, max: t } }) => t === void 0 ? (0, qe.str)`must contain at least ${e} valid item(s)` : (0, qe.str)`must contain at least ${e} and no more than ${t} valid item(s)`, - params: ({ params: { min: e, max: t } }) => t === void 0 ? (0, qe._)`{minContains: ${e}}` : (0, qe._)`{minContains: ${e}, maxContains: ${t}}` -}, hi = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: !0, - error: di, - code(e) { - const { gen: t, schema: n, parentSchema: a, data: i, it: l } = e; - let m, p; - const { minContains: g, maxContains: v } = a; - l.opts.next ? (m = g === void 0 ? 1 : g, p = v) : m = 1; - const b = t.const("len", (0, qe._)`${i}.length`); - if (e.setParams({ min: m, max: p }), p === void 0 && m === 0) { - (0, sr.checkStrictMode)(l, '"minContains" == 0 without "maxContains": "contains" keyword ignored'); - return; - } - if (p !== void 0 && m > p) { - (0, sr.checkStrictMode)(l, '"minContains" > "maxContains" is always invalid'), e.fail(); - return; - } - if ((0, sr.alwaysValidSchema)(l, n)) { - let x = (0, qe._)`${b} >= ${m}`; - p !== void 0 && (x = (0, qe._)`${x} && ${b} <= ${p}`), e.pass(x); - return; - } - l.items = !0; - const S = t.name("valid"); - p === void 0 && m === 1 ? M(S, () => t.if(S, () => t.break())) : m === 0 ? (t.let(S, !0), p !== void 0 && t.if((0, qe._)`${i}.length > 0`, I)) : (t.let(S, !1), I()), e.result(S, () => e.reset()); - function I() { - const x = t.name("_valid"), T = t.let("count", 0); - M(x, () => t.if(x, () => O(T))); - } - function M(x, T) { - t.forRange("i", 0, b, (k) => { - e.subschema({ - keyword: "contains", - dataProp: k, - dataPropType: sr.Type.Num, - compositeRule: !0 - }, x), T(); - }); - } - function O(x) { - t.code((0, qe._)`${x}++`), p === void 0 ? t.if((0, qe._)`${x} >= ${m}`, () => t.assign(S, !0).break()) : (t.if((0, qe._)`${x} > ${p}`, () => t.assign(S, !1).break()), m === 1 ? t.assign(S, !0) : t.if((0, qe._)`${x} >= ${m}`, () => t.assign(S, !0))); - } - } -}; -ca.default = hi; -var Nn = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0; - const t = ue, n = he, a = le; - e.error = { - message: ({ params: { property: g, depsCount: v, deps: b } }) => { - const S = v === 1 ? "property" : "properties"; - return (0, t.str)`must have ${S} ${b} when property ${g} is present`; - }, - params: ({ params: { property: g, depsCount: v, deps: b, missingProperty: S } }) => (0, t._)`{property: ${g}, - missingProperty: ${S}, - depsCount: ${v}, - deps: ${b}}` - // TODO change to reference - }; - const i = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error: e.error, - code(g) { - const [v, b] = l(g); - m(g, v), p(g, b); - } - }; - function l({ schema: g }) { - const v = {}, b = {}; - for (const S in g) { - if (S === "__proto__") - continue; - const I = Array.isArray(g[S]) ? v : b; - I[S] = g[S]; - } - return [v, b]; - } - function m(g, v = g.schema) { - const { gen: b, data: S, it: I } = g; - if (Object.keys(v).length === 0) - return; - const M = b.let("missing"); - for (const O in v) { - const x = v[O]; - if (x.length === 0) - continue; - const T = (0, a.propertyInData)(b, S, O, I.opts.ownProperties); - g.setParams({ - property: O, - depsCount: x.length, - deps: x.join(", ") - }), I.allErrors ? b.if(T, () => { - for (const k of x) - (0, a.checkReportMissingProp)(g, k); - }) : (b.if((0, t._)`${T} && (${(0, a.checkMissingProp)(g, x, M)})`), (0, a.reportMissingProp)(g, M), b.else()); - } - } - e.validatePropertyDeps = m; - function p(g, v = g.schema) { - const { gen: b, data: S, keyword: I, it: M } = g, O = b.name("valid"); - for (const x in v) - (0, n.alwaysValidSchema)(M, v[x]) || (b.if( - (0, a.propertyInData)(b, S, x, M.opts.ownProperties), - () => { - const T = g.subschema({ keyword: I, schemaProp: x }, O); - g.mergeValidEvaluated(T, O); - }, - () => b.var(O, !0) - // TODO var - ), g.ok(O)); - } - e.validateSchemaDeps = p, e.default = i; -})(Nn); -var la = {}; -Object.defineProperty(la, "__esModule", { value: !0 }); -const Mn = ue, pi = he, fi = { - message: "property name must be valid", - params: ({ params: e }) => (0, Mn._)`{propertyName: ${e.propertyName}}` -}, mi = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error: fi, - code(e) { - const { gen: t, schema: n, data: a, it: i } = e; - if ((0, pi.alwaysValidSchema)(i, n)) - return; - const l = t.name("valid"); - t.forIn("key", a, (m) => { - e.setParams({ propertyName: m }), e.subschema({ - keyword: "propertyNames", - data: m, - dataTypes: ["string"], - propertyName: m, - compositeRule: !0 - }, l), t.if((0, Mn.not)(l), () => { - e.error(!0), i.allErrors || t.break(); - }); - }), e.ok(l); - } -}; -la.default = mi; -var Pr = {}; -Object.defineProperty(Pr, "__esModule", { value: !0 }); -const ir = le, We = ue, gi = ut(), cr = he, _i = { - message: "must NOT have additional properties", - params: ({ params: e }) => (0, We._)`{additionalProperty: ${e.additionalProperty}}` -}, bi = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: !0, - trackErrors: !0, - error: _i, - code(e) { - const { gen: t, schema: n, parentSchema: a, data: i, errsCount: l, it: m } = e; - if (!l) - throw new Error("ajv implementation error"); - const { allErrors: p, opts: g } = m; - if (m.props = !0, g.removeAdditional !== "all" && (0, cr.alwaysValidSchema)(m, n)) - return; - const v = (0, ir.allSchemaProperties)(a.properties), b = (0, ir.allSchemaProperties)(a.patternProperties); - S(), e.ok((0, We._)`${l} === ${gi.default.errors}`); - function S() { - t.forIn("key", i, (T) => { - !v.length && !b.length ? O(T) : t.if(I(T), () => O(T)); - }); - } - function I(T) { - let k; - if (v.length > 8) { - const A = (0, cr.schemaRefOrVal)(m, a.properties, "properties"); - k = (0, ir.isOwnProperty)(t, A, T); - } else - v.length ? k = (0, We.or)(...v.map((A) => (0, We._)`${T} === ${A}`)) : k = We.nil; - return b.length && (k = (0, We.or)(k, ...b.map((A) => (0, We._)`${(0, ir.usePattern)(e, A)}.test(${T})`))), (0, We.not)(k); - } - function M(T) { - t.code((0, We._)`delete ${i}[${T}]`); - } - function O(T) { - if (g.removeAdditional === "all" || g.removeAdditional && n === !1) { - M(T); - return; - } - if (n === !1) { - e.setParams({ additionalProperty: T }), e.error(), p || t.break(); - return; - } - if (typeof n == "object" && !(0, cr.alwaysValidSchema)(m, n)) { - const k = t.name("valid"); - g.removeAdditional === "failing" ? (x(T, k, !1), t.if((0, We.not)(k), () => { - e.reset(), M(T); - })) : (x(T, k), p || t.if((0, We.not)(k), () => t.break())); - } - } - function x(T, k, A) { - const L = { - keyword: "additionalProperties", - dataProp: T, - dataPropType: cr.Type.Str - }; - A === !1 && Object.assign(L, { - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }), e.subschema(L, k); - } - } -}; -Pr.default = bi; -var ua = {}; -Object.defineProperty(ua, "__esModule", { value: !0 }); -const wi = yr(), Wa = le, Tr = he, Ja = Pr, vi = { - keyword: "properties", - type: "object", - schemaType: "object", - code(e) { - const { gen: t, schema: n, parentSchema: a, data: i, it: l } = e; - l.opts.removeAdditional === "all" && a.additionalProperties === void 0 && Ja.default.code(new wi.KeywordCxt(l, Ja.default, "additionalProperties")); - const m = (0, Wa.allSchemaProperties)(n); - for (const S of m) - l.definedProperties.add(S); - l.opts.unevaluated && m.length && l.props !== !0 && (l.props = Tr.mergeEvaluated.props(t, (0, Tr.toHash)(m), l.props)); - const p = m.filter((S) => !(0, Tr.alwaysValidSchema)(l, n[S])); - if (p.length === 0) - return; - const g = t.name("valid"); - for (const S of p) - v(S) ? b(S) : (t.if((0, Wa.propertyInData)(t, i, S, l.opts.ownProperties)), b(S), l.allErrors || t.else().var(g, !0), t.endIf()), e.it.definedProperties.add(S), e.ok(g); - function v(S) { - return l.opts.useDefaults && !l.compositeRule && n[S].default !== void 0; - } - function b(S) { - e.subschema({ - keyword: "properties", - schemaProp: S, - dataProp: S - }, g); - } - } -}; -ua.default = vi; -var da = {}; -Object.defineProperty(da, "__esModule", { value: !0 }); -const Za = le, lr = ue, Ya = he, Qa = he, yi = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(e) { - const { gen: t, schema: n, data: a, parentSchema: i, it: l } = e, { opts: m } = l, p = (0, Za.allSchemaProperties)(n), g = p.filter((x) => (0, Ya.alwaysValidSchema)(l, n[x])); - if (p.length === 0 || g.length === p.length && (!l.opts.unevaluated || l.props === !0)) - return; - const v = m.strictSchema && !m.allowMatchingProperties && i.properties, b = t.name("valid"); - l.props !== !0 && !(l.props instanceof lr.Name) && (l.props = (0, Qa.evaluatedPropsToName)(t, l.props)); - const { props: S } = l; - I(); - function I() { - for (const x of p) - v && M(x), l.allErrors ? O(x) : (t.var(b, !0), O(x), t.if(b)); - } - function M(x) { - for (const T in v) - new RegExp(x).test(T) && (0, Ya.checkStrictMode)(l, `property ${T} matches pattern ${x} (use allowMatchingProperties)`); - } - function O(x) { - t.forIn("key", a, (T) => { - t.if((0, lr._)`${(0, Za.usePattern)(e, x)}.test(${T})`, () => { - const k = g.includes(x); - k || e.subschema({ - keyword: "patternProperties", - schemaProp: x, - dataProp: T, - dataPropType: Qa.Type.Str - }, b), l.opts.unevaluated && S !== !0 ? t.assign((0, lr._)`${S}[${T}]`, !0) : !k && !l.allErrors && t.if((0, lr.not)(b), () => t.break()); - }); - }); - } - } -}; -da.default = yi; -var ha = {}; -Object.defineProperty(ha, "__esModule", { value: !0 }); -const $i = he, ki = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: !0, - code(e) { - const { gen: t, schema: n, it: a } = e; - if ((0, $i.alwaysValidSchema)(a, n)) { - e.fail(); - return; - } - const i = t.name("valid"); - e.subschema({ - keyword: "not", - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }, i), e.failResult(i, () => e.reset(), () => e.error()); - }, - error: { message: "must NOT be valid" } -}; -ha.default = ki; -var pa = {}; -Object.defineProperty(pa, "__esModule", { value: !0 }); -const Pi = le, Ei = { - keyword: "anyOf", - schemaType: "array", - trackErrors: !0, - code: Pi.validateUnion, - error: { message: "must match a schema in anyOf" } -}; -pa.default = Ei; -var fa = {}; -Object.defineProperty(fa, "__esModule", { value: !0 }); -const fr = ue, Si = he, ji = { - message: "must match exactly one schema in oneOf", - params: ({ params: e }) => (0, fr._)`{passingSchemas: ${e.passing}}` -}, xi = { - keyword: "oneOf", - schemaType: "array", - trackErrors: !0, - error: ji, - code(e) { - const { gen: t, schema: n, parentSchema: a, it: i } = e; - if (!Array.isArray(n)) - throw new Error("ajv implementation error"); - if (i.opts.discriminator && a.discriminator) - return; - const l = n, m = t.let("valid", !1), p = t.let("passing", null), g = t.name("_valid"); - e.setParams({ passing: p }), t.block(v), e.result(m, () => e.reset(), () => e.error(!0)); - function v() { - l.forEach((b, S) => { - let I; - (0, Si.alwaysValidSchema)(i, b) ? t.var(g, !0) : I = e.subschema({ - keyword: "oneOf", - schemaProp: S, - compositeRule: !0 - }, g), S > 0 && t.if((0, fr._)`${g} && ${m}`).assign(m, !1).assign(p, (0, fr._)`[${p}, ${S}]`).else(), t.if(g, () => { - t.assign(m, !0), t.assign(p, S), I && e.mergeEvaluated(I, fr.Name); - }); - }); - } - } -}; -fa.default = xi; -var ma = {}; -Object.defineProperty(ma, "__esModule", { value: !0 }); -const Ti = he, Ci = { - keyword: "allOf", - schemaType: "array", - code(e) { - const { gen: t, schema: n, it: a } = e; - if (!Array.isArray(n)) - throw new Error("ajv implementation error"); - const i = t.name("valid"); - n.forEach((l, m) => { - if ((0, Ti.alwaysValidSchema)(a, l)) - return; - const p = e.subschema({ keyword: "allOf", schemaProp: m }, i); - e.ok(i), e.mergeEvaluated(p); - }); - } -}; -ma.default = Ci; -var ga = {}; -Object.defineProperty(ga, "__esModule", { value: !0 }); -const br = ue, Rn = he, Oi = { - message: ({ params: e }) => (0, br.str)`must match "${e.ifClause}" schema`, - params: ({ params: e }) => (0, br._)`{failingKeyword: ${e.ifClause}}` -}, Ai = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: !0, - error: Oi, - code(e) { - const { gen: t, parentSchema: n, it: a } = e; - n.then === void 0 && n.else === void 0 && (0, Rn.checkStrictMode)(a, '"if" without "then" and "else" is ignored'); - const i = Xa(a, "then"), l = Xa(a, "else"); - if (!i && !l) - return; - const m = t.let("valid", !0), p = t.name("_valid"); - if (g(), e.reset(), i && l) { - const b = t.let("ifClause"); - e.setParams({ ifClause: b }), t.if(p, v("then", b), v("else", b)); - } else - i ? t.if(p, v("then")) : t.if((0, br.not)(p), v("else")); - e.pass(m, () => e.error(!0)); - function g() { - const b = e.subschema({ - keyword: "if", - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }, p); - e.mergeEvaluated(b); - } - function v(b, S) { - return () => { - const I = e.subschema({ keyword: b }, p); - t.assign(m, p), e.mergeValidEvaluated(I, m), S ? t.assign(S, (0, br._)`${b}`) : e.setParams({ ifClause: b }); - }; - } - } -}; -function Xa(e, t) { - const n = e.schema[t]; - return n !== void 0 && !(0, Rn.alwaysValidSchema)(e, n); -} -ga.default = Ai; -var _a = {}; -Object.defineProperty(_a, "__esModule", { value: !0 }); -const Ii = he, Ni = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword: e, parentSchema: t, it: n }) { - t.if === void 0 && (0, Ii.checkStrictMode)(n, `"${e}" without "if" is ignored`); - } -}; -_a.default = Ni; -Object.defineProperty(oa, "__esModule", { value: !0 }); -const Mi = It, Ri = sa, Li = Nt, zi = ia, Di = ca, Vi = Nn, Bi = la, Fi = Pr, Ui = ua, qi = da, Hi = ha, Ki = pa, Gi = fa, Wi = ma, Ji = ga, Zi = _a; -function Yi(e = !1) { - const t = [ - // any - Hi.default, - Ki.default, - Gi.default, - Wi.default, - Ji.default, - Zi.default, - // object - Bi.default, - Fi.default, - Vi.default, - Ui.default, - qi.default - ]; - return e ? t.push(Ri.default, zi.default) : t.push(Mi.default, Li.default), t.push(Di.default), t; -} -oa.default = Yi; -var ba = {}, wa = {}; -Object.defineProperty(wa, "__esModule", { value: !0 }); -const $e = ue, Qi = { - message: ({ schemaCode: e }) => (0, $e.str)`must match format "${e}"`, - params: ({ schemaCode: e }) => (0, $e._)`{format: ${e}}` -}, Xi = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: !0, - error: Qi, - code(e, t) { - const { gen: n, data: a, $data: i, schema: l, schemaCode: m, it: p } = e, { opts: g, errSchemaPath: v, schemaEnv: b, self: S } = p; - if (!g.validateFormats) - return; - i ? I() : M(); - function I() { - const O = n.scopeValue("formats", { - ref: S.formats, - code: g.code.formats - }), x = n.const("fDef", (0, $e._)`${O}[${m}]`), T = n.let("fType"), k = n.let("format"); - n.if((0, $e._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`, () => n.assign(T, (0, $e._)`${x}.type || "string"`).assign(k, (0, $e._)`${x}.validate`), () => n.assign(T, (0, $e._)`"string"`).assign(k, x)), e.fail$data((0, $e.or)(A(), L())); - function A() { - return g.strictSchema === !1 ? $e.nil : (0, $e._)`${m} && !${k}`; - } - function L() { - const r = b.$async ? (0, $e._)`(${x}.async ? await ${k}(${a}) : ${k}(${a}))` : (0, $e._)`${k}(${a})`, s = (0, $e._)`(typeof ${k} == "function" ? ${r} : ${k}.test(${a}))`; - return (0, $e._)`${k} && ${k} !== true && ${T} === ${t} && !${s}`; - } - } - function M() { - const O = S.formats[l]; - if (!O) { - A(); - return; - } - if (O === !0) - return; - const [x, T, k] = L(O); - x === t && e.pass(r()); - function A() { - if (g.strictSchema === !1) { - S.logger.warn(s()); - return; - } - throw new Error(s()); - function s() { - return `unknown format "${l}" ignored in schema at path "${v}"`; - } - } - function L(s) { - const o = s instanceof RegExp ? (0, $e.regexpCode)(s) : g.code.formats ? (0, $e._)`${g.code.formats}${(0, $e.getProperty)(l)}` : void 0, c = n.scopeValue("formats", { key: l, ref: s, code: o }); - return typeof s == "object" && !(s instanceof RegExp) ? [s.type || "string", s.validate, (0, $e._)`${c}.validate`] : ["string", s, c]; - } - function r() { - if (typeof O == "object" && !(O instanceof RegExp) && O.async) { - if (!b.$async) - throw new Error("async format in sync schema"); - return (0, $e._)`await ${k}(${a})`; - } - return typeof T == "function" ? (0, $e._)`${k}(${a})` : (0, $e._)`${k}.test(${a})`; - } - } - } -}; -wa.default = Xi; -Object.defineProperty(ba, "__esModule", { value: !0 }); -const ec = wa, tc = [ec.default]; -ba.default = tc; -var At = {}; -Object.defineProperty(At, "__esModule", { value: !0 }); -At.contentVocabulary = At.metadataVocabulary = void 0; -At.metadataVocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples" -]; -At.contentVocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema" -]; -Object.defineProperty(qr, "__esModule", { value: !0 }); -const rc = Hr, ac = Gr, nc = oa, oc = ba, en = At, sc = [ - rc.default, - ac.default, - (0, nc.default)(), - oc.default, - en.metadataVocabulary, - en.contentVocabulary -]; -qr.default = sc; -var va = {}, Ln = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.DiscrError = void 0, function(t) { - t.Tag = "tag", t.Mapping = "mapping"; - }(e.DiscrError || (e.DiscrError = {})); -})(Ln); -Object.defineProperty(va, "__esModule", { value: !0 }); -const jt = ue, Lr = Ln, tn = Le, ic = he, cc = { - message: ({ params: { discrError: e, tagName: t } }) => e === Lr.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`, - params: ({ params: { discrError: e, tag: t, tagName: n } }) => (0, jt._)`{error: ${e}, tag: ${n}, tagValue: ${t}}` -}, lc = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error: cc, - code(e) { - const { gen: t, data: n, schema: a, parentSchema: i, it: l } = e, { oneOf: m } = i; - if (!l.opts.discriminator) - throw new Error("discriminator: requires discriminator option"); - const p = a.propertyName; - if (typeof p != "string") - throw new Error("discriminator: requires propertyName"); - if (a.mapping) - throw new Error("discriminator: mapping is not supported"); - if (!m) - throw new Error("discriminator: requires oneOf keyword"); - const g = t.let("valid", !1), v = t.const("tag", (0, jt._)`${n}${(0, jt.getProperty)(p)}`); - t.if((0, jt._)`typeof ${v} == "string"`, () => b(), () => e.error(!1, { discrError: Lr.DiscrError.Tag, tag: v, tagName: p })), e.ok(g); - function b() { - const M = I(); - t.if(!1); - for (const O in M) - t.elseIf((0, jt._)`${v} === ${O}`), t.assign(g, S(M[O])); - t.else(), e.error(!1, { discrError: Lr.DiscrError.Mapping, tag: v, tagName: p }), t.endIf(); - } - function S(M) { - const O = t.name("valid"), x = e.subschema({ keyword: "oneOf", schemaProp: M }, O); - return e.mergeEvaluated(x, jt.Name), O; - } - function I() { - var M; - const O = {}, x = k(i); - let T = !0; - for (let r = 0; r < m.length; r++) { - let s = m[r]; - s != null && s.$ref && !(0, ic.schemaHasRulesButRef)(s, l.self.RULES) && (s = tn.resolveRef.call(l.self, l.schemaEnv.root, l.baseId, s == null ? void 0 : s.$ref), s instanceof tn.SchemaEnv && (s = s.schema)); - const o = (M = s == null ? void 0 : s.properties) === null || M === void 0 ? void 0 : M[p]; - if (typeof o != "object") - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`); - T = T && (x || k(s)), A(o, r); - } - if (!T) - throw new Error(`discriminator: "${p}" must be required`); - return O; - function k({ required: r }) { - return Array.isArray(r) && r.includes(p); - } - function A(r, s) { - if (r.const) - L(r.const, s); - else if (r.enum) - for (const o of r.enum) - L(o, s); - else - throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`); - } - function L(r, s) { - if (typeof r != "string" || r in O) - throw new Error(`discriminator: "${p}" values must be unique strings`); - O[r] = s; - } - } - } -}; -va.default = lc; -const uc = "http://json-schema.org/draft-07/schema#", dc = "http://json-schema.org/draft-07/schema#", hc = "Core schema meta-schema", pc = { - schemaArray: { - type: "array", - minItems: 1, - items: { - $ref: "#" - } - }, - nonNegativeInteger: { - type: "integer", - minimum: 0 - }, - nonNegativeIntegerDefault0: { - allOf: [ - { - $ref: "#/definitions/nonNegativeInteger" - }, - { - default: 0 - } - ] - }, - simpleTypes: { - enum: [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - stringArray: { - type: "array", - items: { - type: "string" - }, - uniqueItems: !0, - default: [] - } -}, fc = [ - "object", - "boolean" -], mc = { - $id: { - type: "string", - format: "uri-reference" - }, - $schema: { - type: "string", - format: "uri" - }, - $ref: { - type: "string", - format: "uri-reference" - }, - $comment: { - type: "string" - }, - title: { - type: "string" - }, - description: { - type: "string" - }, - default: !0, - readOnly: { - type: "boolean", - default: !1 - }, - examples: { - type: "array", - items: !0 - }, - multipleOf: { - type: "number", - exclusiveMinimum: 0 - }, - maximum: { - type: "number" - }, - exclusiveMaximum: { - type: "number" - }, - minimum: { - type: "number" - }, - exclusiveMinimum: { - type: "number" - }, - maxLength: { - $ref: "#/definitions/nonNegativeInteger" - }, - minLength: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - pattern: { - type: "string", - format: "regex" - }, - additionalItems: { - $ref: "#" - }, - items: { - anyOf: [ - { - $ref: "#" - }, - { - $ref: "#/definitions/schemaArray" - } - ], - default: !0 - }, - maxItems: { - $ref: "#/definitions/nonNegativeInteger" - }, - minItems: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - uniqueItems: { - type: "boolean", - default: !1 - }, - contains: { - $ref: "#" - }, - maxProperties: { - $ref: "#/definitions/nonNegativeInteger" - }, - minProperties: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - required: { - $ref: "#/definitions/stringArray" - }, - additionalProperties: { - $ref: "#" - }, - definitions: { - type: "object", - additionalProperties: { - $ref: "#" - }, - default: {} - }, - properties: { - type: "object", - additionalProperties: { - $ref: "#" - }, - default: {} - }, - patternProperties: { - type: "object", - additionalProperties: { - $ref: "#" - }, - propertyNames: { - format: "regex" - }, - default: {} - }, - dependencies: { - type: "object", - additionalProperties: { - anyOf: [ - { - $ref: "#" - }, - { - $ref: "#/definitions/stringArray" - } - ] - } - }, - propertyNames: { - $ref: "#" - }, - const: !0, - enum: { - type: "array", - items: !0, - minItems: 1, - uniqueItems: !0 - }, - type: { - anyOf: [ - { - $ref: "#/definitions/simpleTypes" - }, - { - type: "array", - items: { - $ref: "#/definitions/simpleTypes" - }, - minItems: 1, - uniqueItems: !0 - } - ] - }, - format: { - type: "string" - }, - contentMediaType: { - type: "string" - }, - contentEncoding: { - type: "string" - }, - if: { - $ref: "#" - }, - then: { - $ref: "#" - }, - else: { - $ref: "#" - }, - allOf: { - $ref: "#/definitions/schemaArray" - }, - anyOf: { - $ref: "#/definitions/schemaArray" - }, - oneOf: { - $ref: "#/definitions/schemaArray" - }, - not: { - $ref: "#" - } -}, gc = { - $schema: uc, - $id: dc, - title: hc, - definitions: pc, - type: fc, - properties: mc, - default: !0 -}; -(function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = void 0; - const n = bn, a = qr, i = va, l = gc, m = ["/properties"], p = "http://json-schema.org/draft-07/schema"; - class g extends n.default { - _addVocabularies() { - super._addVocabularies(), a.default.forEach((O) => this.addVocabulary(O)), this.opts.discriminator && this.addKeyword(i.default); - } - _addDefaultMetaSchema() { - if (super._addDefaultMetaSchema(), !this.opts.meta) - return; - const O = this.opts.$data ? this.$dataMetaSchema(l, m) : l; - this.addMetaSchema(O, p, !1), this.refs["http://json-schema.org/schema"] = p; - } - defaultMeta() { - return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(p) ? p : void 0); - } - } - e.exports = t = g, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = g; - var v = yr(); - Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() { - return v.KeywordCxt; - } }); - var b = ue; - Object.defineProperty(t, "_", { enumerable: !0, get: function() { - return b._; - } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() { - return b.str; - } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() { - return b.stringify; - } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() { - return b.nil; - } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() { - return b.Name; - } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() { - return b.CodeGen; - } }); - var S = Zt; - Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() { - return S.default; - } }); - var I = Yt; - Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() { - return I.default; - } }); -})(Or, Or.exports); -var _c = Or.exports; -const bc = /* @__PURE__ */ _n(_c); -class wc { - constructor() { - xe(this, "ajv"), this.ajv = new bc(); - } - validateJson(t, n) { - const a = this.ajv.validate(t, n); - return a ? { valid: a } : { valid: a, error: this.ajv.errorsText() }; - } - validateObjectSchema(t, n) { - const a = this.ajv.validate(t, n); - return a ? { valid: a } : { valid: a, error: this.ajv.errorsText() }; - } -} -class vc { - constructor() { - xe(this, "TIME_SPLIT", " "); - } - /** - * 给日期添加小时 - * - * @param date - Date - * @param numOfHours - 数字 - * @author terwer - * @since 1.0.0 - */ - addHoursToDate(t, n) { - return t.setTime(t.getTime() + n * 60 * 60 * 1e3), t; - } - /** - * 转换ISO日期为中文日期的通用转换方法 - * - * @param str - '2022-07-18T06:25:48.000Z - * @param isAddTimeZone - 是否增加时区(默认不增加) - * @param isShort - 是否只返回日期 - * @author terwer - * @since 1.0.0 - */ - formatIsoToZhDateFormat(t, n, a) { - if (!t) - return ""; - let i = t; - const l = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(.\d{3})Z$/gm, m = i.match(l); - if (m == null) - return t; - for (let p = 0; p < m.length; p++) { - const g = m[p]; - let v = g; - n && (v = this.addHoursToDate(new Date(g), 8).toISOString()); - const b = v.split("T"), S = b[0], I = b[1].split(".")[0]; - let M = S + this.TIME_SPLIT + I; - a && (M = S), i = i.replace(g, M); - } - return i; - } - /** - * 转换ISO日期为中文完整时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZh(t) { - return this.formatIsoToZhDateFormat(t, !1, !1); - } - /** - * 转换ISO日期为中文日期 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhDate(t) { - return this.formatIsoToZhDateFormat(t, !1, !0); - } - /** - * 转换ISO日期为中文时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhTime(t) { - return this.formatIsoToZhDateFormat(t, !1).split(this.TIME_SPLIT)[1]; - } - /** - * 当前日期时间完整格式,格式:2023-03-10 02:03:43 - */ - nowZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0); - } - /** - * 当前日期,格式:2023-03-10 - */ - nowDateZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0, !0); - } - /** - * 当前时间,格式:02:03:43 - */ - nowTimeZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0).split(this.TIME_SPLIT)[1]; - } -} -class yc { - /** - * 格式化字符串 - * - * @param str - 字符串,可用占位符,例如:test \{0\} str - * @param args - 按占位符顺序排列的参数 - * @author terwer - * @since 0.0.1 - */ - f(t, ...n) { - let a = t; - for (let i = 0; i < n.length; i++) { - const l = n[i]; - typeof l == "string" ? a = a.replace(`{${i}}`, l) : a = a.replace(`{${i}}`, l.toString()); - } - return a; - } - /** - * 字符串拼接 - * - * @param str - 字符串数组 - */ - appendStr(...t) { - return t.join(""); - } - /** - * 判断字符串中,是否包含数组中任何一个元素 - * - * @param str - 字符串 - * @param arr - 字符串数组 - */ - includeInArray(t, n) { - let a = !1; - for (let i = 0; i < n.length; i++) { - const l = n[i]; - t.includes(l) && (a = !0); - } - return a; - } - /** - * 截取指定长度的字符串 - * - * @param str - str - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - getByLength(t, n, a) { - const i = t; - return i.length < n ? i : a ? i.substring(0, n) : i.substring(0, n) + "..."; - } - /** - * 字符串空值检测 - * - * @param str - 待检测的字符串 - */ - isEmptyString(t) { - return !t || typeof t != "string" ? !0 : t.trim().length === 0; - } - /** - * 路径组合,解决多出来/的问题 - * - * @param path1 - 路径1 - * @param path2 - 路径2 - */ - pathJoin(t, n) { - let a = t; - const i = t.lastIndexOf("/"); - return i + 1 === t.length && (a = t.substring(0, i)), n.indexOf("/") > 0 ? a = a + "/" + n : a = a + n, a; - } - /** - * 强转boolean - * - * @param val - val - */ - parseBoolean(t) { - return t || (t = "false"), t.toString().toLowerCase() === "true"; - } -} -const Cr = (e, t) => { - const n = rn(e), a = rn(t), i = n.pop(), l = a.pop(), m = on(n, a); - return m !== 0 ? m : i && l ? on(i.split("."), l.split(".")) : i || l ? i ? -1 : 1 : 0; -}, $c = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, rn = (e) => { - if (typeof e != "string") - throw new TypeError("Invalid argument expected string"); - const t = e.match($c); - if (!t) - throw new Error(`Invalid argument not valid semver ('${e}' received)`); - return t.shift(), t; -}, an = (e) => e === "*" || e === "x" || e === "X", nn = (e) => { - const t = parseInt(e, 10); - return isNaN(t) ? e : t; -}, kc = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Pc = (e, t) => { - if (an(e) || an(t)) - return 0; - const [n, a] = kc(nn(e), nn(t)); - return n > a ? 1 : n < a ? -1 : 0; -}, on = (e, t) => { - for (let n = 0; n < Math.max(e.length, t.length); n++) { - const a = Pc(e[n] || "0", t[n] || "0"); - if (a !== 0) - return a; - } - return 0; -}; -class Ec { - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is higher than v2 - */ - greater(t, n) { - return Cr(t, n) > 0; - } - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is equal to v2 - */ - equal(t, n) { - return Cr(t, n) === 0; - } - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is lesser than v2 - */ - lesser(t, n) { - return Cr(t, n) < 0; - } -} -var Sc = Object.defineProperty, jc = (e, t, n) => t in e ? Sc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, xt = (e, t, n) => (jc(e, typeof t != "symbol" ? t + "" : t, n), n); -let it = class { -}; -xt(it, "NODE_ENV_KEY", "NODE_ENV"), /** -* 开发环境 -*/ -xt(it, "NODE_ENV_DEVELOPMENT", "development"), /** -* 生产环境 -*/ -xt(it, "NODE_ENV_PRODUCTION", "production"), /** -* 测试环境 -*/ -xt(it, "NODE_ENV_TEST", "test"), /** -* 是否处于调试模式 -*/ -xt(it, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -class xc { - /** - * 环境初始化 - * - * @param envMeta - 需要传入 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false} 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(t) { - xt(this, "envMeta"), this.envMeta = t; - } - /** - * 是否是开发阶段调试 - */ - isNodeDev() { - return this.getEnv(it.NODE_ENV_KEY) === it.NODE_ENV_DEVELOPMENT; - } - /** - * 是否是调试阶段 - */ - isDev() { - return this.isNodeDev() || this.getBooleanEnv(it.VITE_DEBUG_MODE_KEY); - } - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(t) { - let n; - try { - this.envMeta[t] && (n = this.envMeta[t]); - } catch { - } - return n; - } - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(t) { - return this.getEnv(t) ?? ""; - } - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(t) { - let n = !1; - return this.getEnv(t) && (n = this.getStringEnv(t).toLowerCase() === "true"), n; - } - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(t, n) { - const a = this.getStringEnv(t); - return a.trim().length == 0 ? n : a; - } -} -var Tc = Object.defineProperty, Cc = (e, t, n) => t in e ? Tc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ot = (e, t, n) => (Cc(e, typeof t != "symbol" ? t + "" : t, n), n); -class wr { -} -Ot(wr, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), Ot(wr, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX"); -var Xe = /* @__PURE__ */ ((e) => (e.LOG_LEVEL_TRACE = "TRACE", e.LOG_LEVEL_DEBUG = "DEBUG", e.LOG_LEVEL_INFO = "INFO", e.LOG_LEVEL_WARN = "WARN", e.LOG_LEVEL_ERROR = "ERROR", e))(Xe || {}), zn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function ya(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var Dn = { exports: {} }; -(function(e) { - (function(t, n) { - e.exports ? e.exports = n() : t.log = n(); - })(zn, function() { - var t = function() { - }, n = "undefined", a = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), i = [ - "trace", - "debug", - "info", - "warn", - "error" - ]; - function l(x, T) { - var k = x[T]; - if (typeof k.bind == "function") - return k.bind(x); - try { - return Function.prototype.bind.call(k, x); - } catch { - return function() { - return Function.prototype.apply.apply(k, [x, arguments]); - }; - } - } - function m() { - console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace(); - } - function p(x) { - return x === "debug" && (x = "log"), typeof console === n ? !1 : x === "trace" && a ? m : console[x] !== void 0 ? l(console, x) : console.log !== void 0 ? l(console, "log") : t; - } - function g(x, T) { - for (var k = 0; k < i.length; k++) { - var A = i[k]; - this[A] = k < x ? t : this.methodFactory(A, x, T); - } - this.log = this.debug; - } - function v(x, T, k) { - return function() { - typeof console !== n && (g.call(this, T, k), this[x].apply(this, arguments)); - }; - } - function b(x, T, k) { - return p(x) || v.apply(this, arguments); - } - function S(x, T, k) { - var A = this, L; - T = T ?? "WARN"; - var r = "loglevel"; - typeof x == "string" ? r += ":" + x : typeof x == "symbol" && (r = void 0); - function s(_) { - var f = (i[_] || "silent").toUpperCase(); - if (!(typeof window === n || !r)) { - try { - window.localStorage[r] = f; - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(r) + "=" + f + ";"; - } catch { - } - } - } - function o() { - var _; - if (!(typeof window === n || !r)) { - try { - _ = window.localStorage[r]; - } catch { - } - if (typeof _ === n) - try { - var f = window.document.cookie, j = f.indexOf( - encodeURIComponent(r) + "=" - ); - j !== -1 && (_ = /^([^;]+)/.exec(f.slice(j))[1]); - } catch { - } - return A.levels[_] === void 0 && (_ = void 0), _; - } - } - function c() { - if (!(typeof window === n || !r)) { - try { - window.localStorage.removeItem(r); - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(r) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; - } catch { - } - } - } - A.name = x, A.levels = { - TRACE: 0, - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - SILENT: 5 - }, A.methodFactory = k || b, A.getLevel = function() { - return L; - }, A.setLevel = function(_, f) { - if (typeof _ == "string" && A.levels[_.toUpperCase()] !== void 0 && (_ = A.levels[_.toUpperCase()]), typeof _ == "number" && _ >= 0 && _ <= A.levels.SILENT) { - if (L = _, f !== !1 && s(_), g.call(A, _, x), typeof console === n && _ < A.levels.SILENT) - return "No console available for logging"; - } else - throw "log.setLevel() called with invalid level: " + _; - }, A.setDefaultLevel = function(_) { - T = _, o() || A.setLevel(_, !1); - }, A.resetLevel = function() { - A.setLevel(T, !1), c(); - }, A.enableAll = function(_) { - A.setLevel(A.levels.TRACE, _); - }, A.disableAll = function(_) { - A.setLevel(A.levels.SILENT, _); - }; - var u = o(); - u == null && (u = T), A.setLevel(u, !1); - } - var I = new S(), M = {}; - I.getLogger = function(x) { - if (typeof x != "symbol" && typeof x != "string" || x === "") - throw new TypeError("You must supply a name when creating a logger."); - var T = M[x]; - return T || (T = M[x] = new S( - x, - I.getLevel(), - I.methodFactory - )), T; - }; - var O = typeof window !== n ? window.log : void 0; - return I.noConflict = function() { - return typeof window !== n && window.log === I && (window.log = O), I; - }, I.getLoggers = function() { - return M; - }, I.default = I, I; - }); -})(Dn); -var Oc = Dn.exports; -const ur = /* @__PURE__ */ ya(Oc); -var Vn = { exports: {} }; -(function(e) { - (function(t, n) { - e.exports ? e.exports = n() : t.prefix = n(t); - })(zn, function(t) { - var n = function(b) { - for (var S = 1, I = arguments.length, M; S < I; S++) - for (M in arguments[S]) - Object.prototype.hasOwnProperty.call(arguments[S], M) && (b[M] = arguments[S][M]); - return b; - }, a = { - template: "[%t] %l:", - levelFormatter: function(b) { - return b.toUpperCase(); - }, - nameFormatter: function(b) { - return b || "root"; - }, - timestampFormatter: function(b) { - return b.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); - }, - format: void 0 - }, i, l = {}, m = function(b) { - if (!b || !b.getLogger) - throw new TypeError("Argument is not a root logger"); - i = b; - }, p = function(b, S) { - if (!b || !b.setLevel) - throw new TypeError("Argument is not a logger"); - var I = b.methodFactory, M = b.name || "", O = l[M] || l[""] || a; - function x(T, k, A) { - var L = I(T, k, A), r = l[A] || l[""], s = r.template.indexOf("%t") !== -1, o = r.template.indexOf("%l") !== -1, c = r.template.indexOf("%n") !== -1; - return function() { - for (var u = "", _ = arguments.length, f = Array(_), j = 0; j < _; j++) - f[j] = arguments[j]; - if (M || !l[A]) { - var F = r.timestampFormatter(/* @__PURE__ */ new Date()), U = r.levelFormatter(T), D = r.nameFormatter(A); - r.format ? u += r.format(U, D, F) : (u += r.template, s && (u = u.replace(/%t/, F)), o && (u = u.replace(/%l/, U)), c && (u = u.replace(/%n/, D))), f.length && typeof f[0] == "string" ? f[0] = u + " " + f[0] : f.unshift(u); - } - L.apply(void 0, f); - }; - } - return l[M] || (b.methodFactory = x), S = S || {}, S.template && (S.format = void 0), l[M] = n({}, O, S), b.setLevel(b.getLevel()), i || b.warn( - "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md" - ), b; - }, g = { - reg: m, - apply: p - }, v; - return t && (v = t.prefix, g.noConflict = function() { - return t.prefix === g && (t.prefix = v), g; - }), g; - }); -})(Vn); -var Ac = Vn.exports; -const sn = /* @__PURE__ */ ya(Ac); -function Ic() { - const e = Error.prepareStackTrace; - Error.prepareStackTrace = (n, a) => a; - const t = new Error().stack.slice(1); - return Error.prepareStackTrace = e, t; -} -class vr { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - static stringToEnumValue(t, n) { - return t[Object.keys(t).filter((a) => t[a].toString() === n)[0]]; - } - /** - * 获取配置的日志级别 - */ - static getEnvLevel(t) { - if (!t) - return; - const n = t.getEnvOrDefault(wr.LOG_LEVEL_KEY, Xe.LOG_LEVEL_INFO), a = vr.stringToEnumValue(Xe, n.toUpperCase()); - return a || console.warn( - "[zhi-log] LOG_LEVEL is invalid in you .env file.It must be either debug, info, warn or error, fallback to default info level" - ), a; - } - /** - * 获取默认日志 - */ - static getEnvLogger(t) { - return t ? t.getEnv(wr.LOG_PREFIX_KEY) : void 0; - } -} -var $a = { exports: {} }, cn = { exports: {} }, ln; -function Nc() { - return ln || (ln = 1, function(e) { - const t = typeof process < "u" && process.env.TERM_PROGRAM === "Hyper", n = typeof process < "u" && process.platform === "win32", a = typeof process < "u" && process.platform === "linux", i = { - ballotDisabled: "☒", - ballotOff: "☐", - ballotOn: "☑", - bullet: "•", - bulletWhite: "◦", - fullBlock: "█", - heart: "❤", - identicalTo: "≡", - line: "─", - mark: "※", - middot: "·", - minus: "-", - multiplication: "×", - obelus: "÷", - pencilDownRight: "✎", - pencilRight: "✏", - pencilUpRight: "✐", - percent: "%", - pilcrow2: "❡", - pilcrow: "¶", - plusMinus: "±", - question: "?", - section: "§", - starsOff: "☆", - starsOn: "★", - upDownArrow: "↕" - }, l = Object.assign({}, i, { - check: "√", - cross: "×", - ellipsisLarge: "...", - ellipsis: "...", - info: "i", - questionSmall: "?", - pointer: ">", - pointerSmall: "»", - radioOff: "( )", - radioOn: "(*)", - warning: "‼" - }), m = Object.assign({}, i, { - ballotCross: "✘", - check: "✔", - cross: "✖", - ellipsisLarge: "⋯", - ellipsis: "…", - info: "ℹ", - questionFull: "?", - questionSmall: "﹖", - pointer: a ? "▸" : "❯", - pointerSmall: a ? "‣" : "›", - radioOff: "◯", - radioOn: "◉", - warning: "⚠" - }); - e.exports = n && !t ? l : m, Reflect.defineProperty(e.exports, "common", { enumerable: !1, value: i }), Reflect.defineProperty(e.exports, "windows", { enumerable: !1, value: l }), Reflect.defineProperty(e.exports, "other", { enumerable: !1, value: m }); - }(cn)), cn.exports; -} -const Mc = (e) => e !== null && typeof e == "object" && !Array.isArray(e), Rc = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, Lc = () => typeof process < "u" ? process.env.FORCE_COLOR !== "0" : !1, Bn = () => { - const e = { - enabled: Lc(), - visible: !0, - styles: {}, - keys: {} - }, t = (l) => { - let m = l.open = `\x1B[${l.codes[0]}m`, p = l.close = `\x1B[${l.codes[1]}m`, g = l.regex = new RegExp(`\\u001b\\[${l.codes[1]}m`, "g"); - return l.wrap = (v, b) => { - v.includes(p) && (v = v.replace(g, p + m)); - let S = m + v + p; - return b ? S.replace(/\r*\n/g, `${p}$&${m}`) : S; - }, l; - }, n = (l, m, p) => typeof l == "function" ? l(m) : l.wrap(m, p), a = (l, m) => { - if (l === "" || l == null) - return ""; - if (e.enabled === !1) - return l; - if (e.visible === !1) - return ""; - let p = "" + l, g = p.includes(` -`), v = m.length; - for (v > 0 && m.includes("unstyle") && (m = [.../* @__PURE__ */ new Set(["unstyle", ...m])].reverse()); v-- > 0; ) - p = n(e.styles[m[v]], p, g); - return p; - }, i = (l, m, p) => { - e.styles[l] = t({ name: l, codes: m }), (e.keys[p] || (e.keys[p] = [])).push(l), Reflect.defineProperty(e, l, { - configurable: !0, - enumerable: !0, - set(g) { - e.alias(l, g); - }, - get() { - let g = (v) => a(v, g.stack); - return Reflect.setPrototypeOf(g, e), g.stack = this.stack ? this.stack.concat(l) : [l], g; - } - }); - }; - return i("reset", [0, 0], "modifier"), i("bold", [1, 22], "modifier"), i("dim", [2, 22], "modifier"), i("italic", [3, 23], "modifier"), i("underline", [4, 24], "modifier"), i("inverse", [7, 27], "modifier"), i("hidden", [8, 28], "modifier"), i("strikethrough", [9, 29], "modifier"), i("black", [30, 39], "color"), i("red", [31, 39], "color"), i("green", [32, 39], "color"), i("yellow", [33, 39], "color"), i("blue", [34, 39], "color"), i("magenta", [35, 39], "color"), i("cyan", [36, 39], "color"), i("white", [37, 39], "color"), i("gray", [90, 39], "color"), i("grey", [90, 39], "color"), i("bgBlack", [40, 49], "bg"), i("bgRed", [41, 49], "bg"), i("bgGreen", [42, 49], "bg"), i("bgYellow", [43, 49], "bg"), i("bgBlue", [44, 49], "bg"), i("bgMagenta", [45, 49], "bg"), i("bgCyan", [46, 49], "bg"), i("bgWhite", [47, 49], "bg"), i("blackBright", [90, 39], "bright"), i("redBright", [91, 39], "bright"), i("greenBright", [92, 39], "bright"), i("yellowBright", [93, 39], "bright"), i("blueBright", [94, 39], "bright"), i("magentaBright", [95, 39], "bright"), i("cyanBright", [96, 39], "bright"), i("whiteBright", [97, 39], "bright"), i("bgBlackBright", [100, 49], "bgBright"), i("bgRedBright", [101, 49], "bgBright"), i("bgGreenBright", [102, 49], "bgBright"), i("bgYellowBright", [103, 49], "bgBright"), i("bgBlueBright", [104, 49], "bgBright"), i("bgMagentaBright", [105, 49], "bgBright"), i("bgCyanBright", [106, 49], "bgBright"), i("bgWhiteBright", [107, 49], "bgBright"), e.ansiRegex = Rc, e.hasColor = e.hasAnsi = (l) => (e.ansiRegex.lastIndex = 0, typeof l == "string" && l !== "" && e.ansiRegex.test(l)), e.alias = (l, m) => { - let p = typeof m == "string" ? e[m] : m; - if (typeof p != "function") - throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); - p.stack || (Reflect.defineProperty(p, "name", { value: l }), e.styles[l] = p, p.stack = [l]), Reflect.defineProperty(e, l, { - configurable: !0, - enumerable: !0, - set(g) { - e.alias(l, g); - }, - get() { - let g = (v) => a(v, g.stack); - return Reflect.setPrototypeOf(g, e), g.stack = this.stack ? this.stack.concat(p.stack) : p.stack, g; - } - }); - }, e.theme = (l) => { - if (!Mc(l)) - throw new TypeError("Expected theme to be an object"); - for (let m of Object.keys(l)) - e.alias(m, l[m]); - return e; - }, e.alias("unstyle", (l) => typeof l == "string" && l !== "" ? (e.ansiRegex.lastIndex = 0, l.replace(e.ansiRegex, "")) : ""), e.alias("noop", (l) => l), e.none = e.clear = e.noop, e.stripColor = e.unstyle, e.symbols = Nc(), e.define = i, e; -}; -$a.exports = Bn(); -$a.exports.create = Bn; -var zc = $a.exports; -const Fe = /* @__PURE__ */ ya(zc); -let zr, Fn, Un, qn, Hn = !0; -typeof process < "u" && ({ FORCE_COLOR: zr, NODE_DISABLE_COLORS: Fn, NO_COLOR: Un, TERM: qn } = process.env || {}, Hn = process.stdout && process.stdout.isTTY); -const ce = { - enabled: !Fn && Un == null && qn !== "dumb" && (zr != null && zr !== "0" || Hn), - // modifiers - reset: _e(0, 0), - bold: _e(1, 22), - dim: _e(2, 22), - italic: _e(3, 23), - underline: _e(4, 24), - inverse: _e(7, 27), - hidden: _e(8, 28), - strikethrough: _e(9, 29), - // colors - black: _e(30, 39), - red: _e(31, 39), - green: _e(32, 39), - yellow: _e(33, 39), - blue: _e(34, 39), - magenta: _e(35, 39), - cyan: _e(36, 39), - white: _e(37, 39), - gray: _e(90, 39), - grey: _e(90, 39), - // background colors - bgBlack: _e(40, 49), - bgRed: _e(41, 49), - bgGreen: _e(42, 49), - bgYellow: _e(43, 49), - bgBlue: _e(44, 49), - bgMagenta: _e(45, 49), - bgCyan: _e(46, 49), - bgWhite: _e(47, 49) -}; -function un(e, t) { - let n = 0, a, i = "", l = ""; - for (; n < e.length; n++) - a = e[n], i += a.open, l += a.close, ~t.indexOf(a.close) && (t = t.replace(a.rgx, a.close + a.open)); - return i + t + l; -} -function Dc(e, t) { - let n = { has: e, keys: t }; - return n.reset = ce.reset.bind(n), n.bold = ce.bold.bind(n), n.dim = ce.dim.bind(n), n.italic = ce.italic.bind(n), n.underline = ce.underline.bind(n), n.inverse = ce.inverse.bind(n), n.hidden = ce.hidden.bind(n), n.strikethrough = ce.strikethrough.bind(n), n.black = ce.black.bind(n), n.red = ce.red.bind(n), n.green = ce.green.bind(n), n.yellow = ce.yellow.bind(n), n.blue = ce.blue.bind(n), n.magenta = ce.magenta.bind(n), n.cyan = ce.cyan.bind(n), n.white = ce.white.bind(n), n.gray = ce.gray.bind(n), n.grey = ce.grey.bind(n), n.bgBlack = ce.bgBlack.bind(n), n.bgRed = ce.bgRed.bind(n), n.bgGreen = ce.bgGreen.bind(n), n.bgYellow = ce.bgYellow.bind(n), n.bgBlue = ce.bgBlue.bind(n), n.bgMagenta = ce.bgMagenta.bind(n), n.bgCyan = ce.bgCyan.bind(n), n.bgWhite = ce.bgWhite.bind(n), n; -} -function _e(e, t) { - let n = { - open: `\x1B[${e}m`, - close: `\x1B[${t}m`, - rgx: new RegExp(`\\x1b\\[${t}m`, "g") - }; - return function(a) { - return this !== void 0 && this.has !== void 0 ? (~this.has.indexOf(e) || (this.has.push(e), this.keys.push(n)), a === void 0 ? this : ce.enabled ? un(this.keys, a + "") : a + "") : a === void 0 ? Dc([e], [n]) : ce.enabled ? un([n], a + "") : a + ""; - }; -} -var Vc = Object.defineProperty, Bc = (e, t, n) => t in e ? Vc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, je = (e, t, n) => (Bc(e, typeof t != "symbol" ? t + "" : t, n), n); -const Je = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return Je.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let fe = Je; -je(fe, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -je(fe, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -je(fe, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -je(fe, "isElectron", () => !Je.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -je(fe, "hasNodeEnv", () => Je.isElectron() || Je.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -je(fe, "getQueryString", (e) => { - if (!Je.isInBrowser) - return ""; - const t = window.location.search.substring(1).split("&"); - for (let n = 0; n < t.length; n++) { - const a = t[n].split("="); - if (a[0] === e) - return a[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -je(fe, "replaceUrlParam", (e, t, n) => { - n == null && (n = ""); - const a = new RegExp("\\b(" + t + "=).*?(&|#|$)"); - if (e.search(a) >= 0) - return e.replace(a, "$1" + n + "$2"); - const [i, l] = e.split("#"), [m, p] = i.split("?"), g = new URLSearchParams(p); - g.set(t, n); - const v = g.toString(), b = m + (v ? "?" + v : ""); - return l ? b + "#" + l : b; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -je(fe, "setUrlParameter", (e, t, n) => { - if (e.includes(t)) - return Je.replaceUrlParam(e, t, n); - const a = e.split("#"); - let i = a[0]; - const l = a[1]; - return i.includes("?") ? i += `&${t}=${n}` : i += `?${t}=${n}`, l && (i += "#" + l), i; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -je(fe, "reloadTabPage", (e, t = 200) => { - setTimeout(function() { - if (Je.isInBrowser) { - const n = window.location.href; - window.location.href = Je.setUrlParameter(n, "tab", e); - } - }, t); -}), /** -* 刷新当前tab页面 -*/ -je(fe, "reloadPage", () => { - setTimeout(function() { - Je.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -je(fe, "reloadPageWithMessageCallback", (e, t) => { - t && t(e), setTimeout(function() { - Je.isInBrowser && window.location.reload(); - }, 200); -}); -var Ie = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(Ie || {}); -const Me = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return fe.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, t) { - let n = e; - switch (t) { - case Ie.BasePathType_Appearance: - n = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case Ie.BasePathType_Data: - n = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case Ie.BasePathType_Themes: - n = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case Ie.BasePathType_ZhiTheme: - n = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: a } = await import( - /* @vite-ignore */ - n - ); - return a; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, Ie.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (fe.hasNodeEnv()) { - const t = this.requireLib("path"); - if (t) - return t.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(fe.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (fe.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let bt = Me; -je(bt, "isInSiyuanWidget", () => fe.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -je(bt, "isInSiyuanNewWin", () => !fe.isInBrowser || !fe.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -je(bt, "requireLib", (e, t = !0, n = Ie.BasePathType_None) => { - if (!fe.hasNodeEnv()) - throw new Error("require ony works on node env"); - let a = e; - if (!t) - switch (n) { - case Ie.BasePathType_Appearance: - a = Me.joinPath(Me.siyuanAppearancePath(), e); - break; - case Ie.BasePathType_Data: - a = Me.joinPath(Me.siyuanDataPath(), e); - break; - case Ie.BasePathType_Themes: - a = Me.joinPath(Me.siyuanAppearancePath(), "themes", e); - break; - case Ie.BasePathType_ZhiTheme: - a = Me.joinPath(Me.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const i = Me.siyuanWindow(); - if (!i) - return require(a); - if (typeof i.require < "u") - return i.require(a); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -je(bt, "requireAppearanceLib", (e) => Me.requireLib(e, !1, Ie.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -je(bt, "requireDataLib", (e) => Me.requireLib(e, !1, Ie.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -je(bt, "requireThemesLib", (e) => Me.requireLib(e, !1, Ie.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -je(bt, "requireZhiThemeLib", (e) => Me.requireLib(e, !1, Ie.BasePathType_ZhiTheme)); -const Ue = { - white: (e) => fe.isElectron() ? Fe.whiteBright(e) : ce.white(e), - gray: (e) => fe.isElectron() ? Fe.gray(e) : ce.gray(e), - blue: (e) => fe.isElectron() ? Fe.blue(e) : ce.blue(e), - green: (e) => fe.isElectron() ? Fe.green(e) : ce.green(e), - yellow: (e) => fe.isElectron() ? Fe.yellow(e) : ce.yellow(e), - red: (e) => fe.isElectron() ? Fe.red(e) : ce.red(e), - bgWhite: (e) => fe.isElectron() ? Fe.bgWhiteBright(e) : ce.bgWhite(e), - bgGrey: (e) => fe.isElectron() ? Fe.bgCyanBright(e) : ce.bgCyan(e), - bgBlue: (e) => fe.isElectron() ? Fe.bgBlueBright(e) : ce.bgBlue(e), - bgGreen: (e) => fe.isElectron() ? Fe.bgGreenBright(e) : ce.bgGreen(e), - bgYellow: (e) => fe.isElectron() ? Fe.bgYellowBright(e) : ce.bgYellow(e), - bgRed: (e) => fe.isElectron() ? Fe.bgRedBright(e) : ce.bgRed(e) -}; -class Fc { - constructor(t, n, a) { - Ot(this, "consoleLogger", "console"), Ot(this, "stackSize", 1), Ot(this, "getLogger", (m) => { - let p; - if (m) - p = m; - else { - const g = this.getCallStack(), v = [], b = []; - for (let S = 0; S < g.length; S++) { - const I = g[S], M = I.getFileName() ?? "none"; - if (S > this.stackSize - 1) - break; - const O = M + "-" + I.getLineNumber() + ":" + I.getColumnNumber(); - v.push(O); - } - b.length > 0 && (p = v.join(" -> ")); - } - return (!p || p.trim().length === 0) && (p = this.consoleLogger), ur.getLogger(p); - }), this.stackSize = 1; - let i; - t ? i = t : i = vr.getEnvLevel(a), i = i ?? Xe.LOG_LEVEL_INFO, ur.setLevel(i); - const l = (m, p, g, v) => { - const b = [], S = n ?? vr.getEnvLogger(a) ?? "zhi"; - return b.push(Ue.gray("[") + v(S) + Ue.gray("]")), b.push(Ue.gray("[") + Ue.gray(g.toString()) + Ue.gray("]")), b.push(v(m.toUpperCase().toString())), b.push(v(p)), b.push(Ue.gray(":")), b; - }; - sn.reg(ur), sn.apply(ur, { - format(m, p, g) { - let v = []; - const b = p ?? ""; - switch (m) { - case Xe.LOG_LEVEL_TRACE: - v = l(m, b, g, Ue.gray); - break; - case Xe.LOG_LEVEL_DEBUG: - v = l(m, b, g, Ue.blue); - break; - case Xe.LOG_LEVEL_INFO: - v = l(m, b, g, Ue.green); - break; - case Xe.LOG_LEVEL_WARN: - v = l(m, b, g, Ue.yellow); - break; - case Xe.LOG_LEVEL_ERROR: - v = l(m, b, g, Ue.red); - break; - default: - v = l(Xe.LOG_LEVEL_INFO, b, g, Ue.green); - break; - } - return v.join(" "); - } - }); - } - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(t) { - this.stackSize = t ?? 1; - } - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack() { - let t; - try { - t = Ic(); - } catch { - t = []; - } - return t; - } -} -class Uc { - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - constructor(t, n, a) { - Ot(this, "logger"), this.logger = new Fc(t, n, a); - } - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - getLogger(t, n) { - return this.logger.setStackSize(n), this.logger.getLogger(t); - } -} -class dn extends Uc { - constructor(t, n, a) { - super(t, n, a); - } - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(t, n) { - return super.getLogger(t, n); - } -} -class ka { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(t, n) { - return ka.customLogFactory(void 0, void 0, t).getLogger(void 0, n); - } - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(t, n, a) { - return new dn(t, n, a); - } - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(t, n) { - return new dn(void 0, t, n); - } -} -const qc = "zhi"; -class Kt { - /** - * 某些情况下,可能需要手动 init 之后才能用 - */ - static initEnv(t) { - this.env = t; - } - /** - * 获取 zhi-env 实例 - 必须在使用的时候重写此方法 - * - * ``` - * if (!this.env) { - * this.env = new Env({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false}) - * } - * return this.env - * ``` - * - * @see {@link https://github.com/terwer/zhi/tree/main/apps/zhi-env#usage docs for zhi-env usage} - */ - static zhiEnv() { - throw new Error("Method 'zhiEnv' must be implemented"); - } - /** - * 获取 zhi-log 实例 - * - * @param sign - 标志 - * @param loggerName - 日志名称 - */ - static zhiLogWithSign(t, n) { - if (this.loggerMap[n]) - return this.loggerMap[n].debug("Zhi-log use cache"), this.loggerMap[n]; - const a = this.env, i = ka.customSignLogFactory(t, a).getLogger(n); - return this.loggerMap[n] = i, i.debug("Zhi-log add new logger"), i; - } - /** - * 获取 zhi-log 实例 - * - * @param loggerName - 日志名称 - */ - static zhiLog(t) { - return this.zhiLogWithSign(qc, t); - } - /** - * 获取 zhi-common 实例 - */ - static zhiCommon() { - return this.common || (this.common = new Jc()), this.common; - } -} -xe(Kt, "env"), /** -* zhi-util 的日志器缓存 -*/ -xe(Kt, "loggerMap", {}), /** -* zhi-util 的通用工具类 -*/ -xe(Kt, "common"); -class Pa extends Kt { - static zhiEnv() { - return this.env || (this.env = new xc({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 })), this.env; - } -} -class hn { - constructor() { - xe(this, "logger"), this.logger = Pa.zhiLog("lute-adaptor"), Lute ? this.logger.debug("Detected Lute is bundled, will use!") : this.logger.debug("Lute is not available!"); - } - isAvailable() { - return typeof Lute < "u"; - } - /** - * 高亮关键字 - * - * @param str - 字符串 - * @private - */ - highlightWords(t) { - const n = new RegExp("(?<=^|[\\s\\S])==([^\\n]+?)==(?=($|[\\s\\S]))", "g"); - return t.replace(n, '$1'); - } - /** - * 渲染Markdown - * - * @param md - Markdown - */ - async renderMarkdownStr(t) { - if (!this.isAvailable()) - return this.logger.error("Lute is not available, will return original md"), t; - const n = Lute, a = n.New(), i = { - renderText: (l, m) => m ? [this.highlightWords(l.Text()), n.WalkContinue] : ["", n.WalkContinue] - // renderStrong: (node: any, entering: any) => { - // return ["", luteObj.WalkContinue] - // }, - // renderParagraph: (node: any, entering: any) => { - // return ["", luteObj.WalkContinue] - // } - }; - return a.SetJSRenderers({ - renderers: { - Md2HTML: i - } - }), this.logger.info("Lute is rendering md to HTML..."), a.MarkdownStr("", t); - } -} -var Kn = { exports: {} }; -(function(e) { - (function() { - function t(r) { - var s = { - omitExtraWLInCodeBlocks: { - defaultValue: !1, - describe: "Omit the default extra whiteline added to code blocks", - type: "boolean" - }, - noHeaderId: { - defaultValue: !1, - describe: "Turn on/off generated header id", - type: "boolean" - }, - prefixHeaderId: { - defaultValue: !1, - describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix", - type: "string" - }, - rawPrefixHeaderId: { - defaultValue: !1, - describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)', - type: "boolean" - }, - ghCompatibleHeaderId: { - defaultValue: !1, - describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)", - type: "boolean" - }, - rawHeaderId: { - defaultValue: !1, - describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`, - type: "boolean" - }, - headerLevelStart: { - defaultValue: !1, - describe: "The header blocks level start", - type: "integer" - }, - parseImgDimensions: { - defaultValue: !1, - describe: "Turn on/off image dimension parsing", - type: "boolean" - }, - simplifiedAutoLink: { - defaultValue: !1, - describe: "Turn on/off GFM autolink style", - type: "boolean" - }, - excludeTrailingPunctuationFromURLs: { - defaultValue: !1, - describe: "Excludes trailing punctuation from links generated with autoLinking", - type: "boolean" - }, - literalMidWordUnderscores: { - defaultValue: !1, - describe: "Parse midword underscores as literal underscores", - type: "boolean" - }, - literalMidWordAsterisks: { - defaultValue: !1, - describe: "Parse midword asterisks as literal asterisks", - type: "boolean" - }, - strikethrough: { - defaultValue: !1, - describe: "Turn on/off strikethrough support", - type: "boolean" - }, - tables: { - defaultValue: !1, - describe: "Turn on/off tables support", - type: "boolean" - }, - tablesHeaderId: { - defaultValue: !1, - describe: "Add an id to table headers", - type: "boolean" - }, - ghCodeBlocks: { - defaultValue: !0, - describe: "Turn on/off GFM fenced code blocks support", - type: "boolean" - }, - tasklists: { - defaultValue: !1, - describe: "Turn on/off GFM tasklist support", - type: "boolean" - }, - smoothLivePreview: { - defaultValue: !1, - describe: "Prevents weird effects in live previews due to incomplete input", - type: "boolean" - }, - smartIndentationFix: { - defaultValue: !1, - describe: "Tries to smartly fix indentation in es6 strings", - type: "boolean" - }, - disableForced4SpacesIndentedSublists: { - defaultValue: !1, - describe: "Disables the requirement of indenting nested sublists by 4 spaces", - type: "boolean" - }, - simpleLineBreaks: { - defaultValue: !1, - describe: "Parses simple line breaks as
(GFM Style)", - type: "boolean" - }, - requireSpaceBeforeHeadingText: { - defaultValue: !1, - describe: "Makes adding a space between `#` and the header text mandatory (GFM Style)", - type: "boolean" - }, - ghMentions: { - defaultValue: !1, - describe: "Enables github @mentions", - type: "boolean" - }, - ghMentionsLink: { - defaultValue: "https://github.com/{u}", - describe: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.", - type: "string" - }, - encodeEmails: { - defaultValue: !0, - describe: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities", - type: "boolean" - }, - openLinksInNewWindow: { - defaultValue: !1, - describe: "Open all links in new windows", - type: "boolean" - }, - backslashEscapesHTMLTags: { - defaultValue: !1, - describe: "Support for HTML Tag escaping. ex:
foo
", - type: "boolean" - }, - emoji: { - defaultValue: !1, - describe: "Enable emoji support. Ex: `this is a :smile: emoji`", - type: "boolean" - }, - underline: { - defaultValue: !1, - describe: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``", - type: "boolean" - }, - ellipsis: { - defaultValue: !0, - describe: "Replaces three dots with the ellipsis unicode character", - type: "boolean" - }, - completeHTMLDocument: { - defaultValue: !1, - describe: "Outputs a complete html document, including ``, `` and `` tags", - type: "boolean" - }, - metadata: { - defaultValue: !1, - describe: "Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).", - type: "boolean" - }, - splitAdjacentBlockquotes: { - defaultValue: !1, - describe: "Split adjacent blockquote blocks", - type: "boolean" - } - }; - if (r === !1) - return JSON.parse(JSON.stringify(s)); - var o = {}; - for (var c in s) - s.hasOwnProperty(c) && (o[c] = s[c].defaultValue); - return o; - } - function n() { - var r = t(!0), s = {}; - for (var o in r) - r.hasOwnProperty(o) && (s[o] = !0); - return s; - } - var a = {}, i = {}, l = {}, m = t(!0), p = "vanilla", g = { - github: { - omitExtraWLInCodeBlocks: !0, - simplifiedAutoLink: !0, - excludeTrailingPunctuationFromURLs: !0, - literalMidWordUnderscores: !0, - strikethrough: !0, - tables: !0, - tablesHeaderId: !0, - ghCodeBlocks: !0, - tasklists: !0, - disableForced4SpacesIndentedSublists: !0, - simpleLineBreaks: !0, - requireSpaceBeforeHeadingText: !0, - ghCompatibleHeaderId: !0, - ghMentions: !0, - backslashEscapesHTMLTags: !0, - emoji: !0, - splitAdjacentBlockquotes: !0 - }, - original: { - noHeaderId: !0, - ghCodeBlocks: !1 - }, - ghost: { - omitExtraWLInCodeBlocks: !0, - parseImgDimensions: !0, - simplifiedAutoLink: !0, - excludeTrailingPunctuationFromURLs: !0, - literalMidWordUnderscores: !0, - strikethrough: !0, - tables: !0, - tablesHeaderId: !0, - ghCodeBlocks: !0, - tasklists: !0, - smoothLivePreview: !0, - simpleLineBreaks: !0, - requireSpaceBeforeHeadingText: !0, - ghMentions: !1, - encodeEmails: !0 - }, - vanilla: t(!0), - allOn: n() - }; - a.helper = {}, a.extensions = {}, a.setOption = function(r, s) { - return m[r] = s, this; - }, a.getOption = function(r) { - return m[r]; - }, a.getOptions = function() { - return m; - }, a.resetOptions = function() { - m = t(!0); - }, a.setFlavor = function(r) { - if (!g.hasOwnProperty(r)) - throw Error(r + " flavor was not found"); - a.resetOptions(); - var s = g[r]; - p = r; - for (var o in s) - s.hasOwnProperty(o) && (m[o] = s[o]); - }, a.getFlavor = function() { - return p; - }, a.getFlavorOptions = function(r) { - if (g.hasOwnProperty(r)) - return g[r]; - }, a.getDefaultOptions = function(r) { - return t(r); - }, a.subParser = function(r, s) { - if (a.helper.isString(r)) - if (typeof s < "u") - i[r] = s; - else { - if (i.hasOwnProperty(r)) - return i[r]; - throw Error("SubParser named " + r + " not registered!"); - } - }, a.extension = function(r, s) { - if (!a.helper.isString(r)) - throw Error("Extension 'name' must be a string"); - if (r = a.helper.stdExtName(r), a.helper.isUndefined(s)) { - if (!l.hasOwnProperty(r)) - throw Error("Extension named " + r + " is not registered!"); - return l[r]; - } else { - typeof s == "function" && (s = s()), a.helper.isArray(s) || (s = [s]); - var o = v(s, r); - if (o.valid) - l[r] = s; - else - throw Error(o.error); - } - }, a.getAllExtensions = function() { - return l; - }, a.removeExtension = function(r) { - delete l[r]; - }, a.resetExtensions = function() { - l = {}; - }; - function v(r, s) { - var o = s ? "Error in " + s + " extension->" : "Error in unnamed extension", c = { - valid: !0, - error: "" - }; - a.helper.isArray(r) || (r = [r]); - for (var u = 0; u < r.length; ++u) { - var _ = o + " sub-extension " + u + ": ", f = r[u]; - if (typeof f != "object") - return c.valid = !1, c.error = _ + "must be an object, but " + typeof f + " given", c; - if (!a.helper.isString(f.type)) - return c.valid = !1, c.error = _ + 'property "type" must be a string, but ' + typeof f.type + " given", c; - var j = f.type = f.type.toLowerCase(); - if (j === "language" && (j = f.type = "lang"), j === "html" && (j = f.type = "output"), j !== "lang" && j !== "output" && j !== "listener") - return c.valid = !1, c.error = _ + "type " + j + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"', c; - if (j === "listener") { - if (a.helper.isUndefined(f.listeners)) - return c.valid = !1, c.error = _ + '. Extensions of type "listener" must have a property called "listeners"', c; - } else if (a.helper.isUndefined(f.filter) && a.helper.isUndefined(f.regex)) - return c.valid = !1, c.error = _ + j + ' extensions must define either a "regex" property or a "filter" method', c; - if (f.listeners) { - if (typeof f.listeners != "object") - return c.valid = !1, c.error = _ + '"listeners" property must be an object but ' + typeof f.listeners + " given", c; - for (var F in f.listeners) - if (f.listeners.hasOwnProperty(F) && typeof f.listeners[F] != "function") - return c.valid = !1, c.error = _ + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + F + " must be a function but " + typeof f.listeners[F] + " given", c; - } - if (f.filter) { - if (typeof f.filter != "function") - return c.valid = !1, c.error = _ + '"filter" must be a function, but ' + typeof f.filter + " given", c; - } else if (f.regex) { - if (a.helper.isString(f.regex) && (f.regex = new RegExp(f.regex, "g")), !(f.regex instanceof RegExp)) - return c.valid = !1, c.error = _ + '"regex" property must either be a string or a RegExp object, but ' + typeof f.regex + " given", c; - if (a.helper.isUndefined(f.replace)) - return c.valid = !1, c.error = _ + '"regex" extensions must implement a replace string or function', c; - } - } - return c; - } - a.validateExtension = function(r) { - var s = v(r, null); - return s.valid ? !0 : (console.warn(s.error), !1); - }, a.hasOwnProperty("helper") || (a.helper = {}), a.helper.isString = function(r) { - return typeof r == "string" || r instanceof String; - }, a.helper.isFunction = function(r) { - var s = {}; - return r && s.toString.call(r) === "[object Function]"; - }, a.helper.isArray = function(r) { - return Array.isArray(r); - }, a.helper.isUndefined = function(r) { - return typeof r > "u"; - }, a.helper.forEach = function(r, s) { - if (a.helper.isUndefined(r)) - throw new Error("obj param is required"); - if (a.helper.isUndefined(s)) - throw new Error("callback param is required"); - if (!a.helper.isFunction(s)) - throw new Error("callback param must be a function/closure"); - if (typeof r.forEach == "function") - r.forEach(s); - else if (a.helper.isArray(r)) - for (var o = 0; o < r.length; o++) - s(r[o], o, r); - else if (typeof r == "object") - for (var c in r) - r.hasOwnProperty(c) && s(r[c], c, r); - else - throw new Error("obj does not seem to be an array or an iterable object"); - }, a.helper.stdExtName = function(r) { - return r.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase(); - }; - function b(r, s) { - var o = s.charCodeAt(0); - return "¨E" + o + "E"; - } - a.helper.escapeCharactersCallback = b, a.helper.escapeCharacters = function(r, s, o) { - var c = "([" + s.replace(/([\[\]\\])/g, "\\$1") + "])"; - o && (c = "\\\\" + c); - var u = new RegExp(c, "g"); - return r = r.replace(u, b), r; - }, a.helper.unescapeHTMLEntities = function(r) { - return r.replace(/"/g, '"').replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"); - }; - var S = function(r, s, o, c) { - var u = c || "", _ = u.indexOf("g") > -1, f = new RegExp(s + "|" + o, "g" + u.replace(/g/g, "")), j = new RegExp(s, u.replace(/g/g, "")), F = [], U, D, W, w, G; - do - for (U = 0; W = f.exec(r); ) - if (j.test(W[0])) - U++ || (D = f.lastIndex, w = D - W[0].length); - else if (U && !--U) { - G = W.index + W[0].length; - var Q = { - left: { start: w, end: D }, - match: { start: D, end: W.index }, - right: { start: W.index, end: G }, - wholeMatch: { start: w, end: G } - }; - if (F.push(Q), !_) - return F; - } - while (U && (f.lastIndex = D)); - return F; - }; - a.helper.matchRecursiveRegExp = function(r, s, o, c) { - for (var u = S(r, s, o, c), _ = [], f = 0; f < u.length; ++f) - _.push([ - r.slice(u[f].wholeMatch.start, u[f].wholeMatch.end), - r.slice(u[f].match.start, u[f].match.end), - r.slice(u[f].left.start, u[f].left.end), - r.slice(u[f].right.start, u[f].right.end) - ]); - return _; - }, a.helper.replaceRecursiveRegExp = function(r, s, o, c, u) { - if (!a.helper.isFunction(s)) { - var _ = s; - s = function() { - return _; - }; - } - var f = S(r, o, c, u), j = r, F = f.length; - if (F > 0) { - var U = []; - f[0].wholeMatch.start !== 0 && U.push(r.slice(0, f[0].wholeMatch.start)); - for (var D = 0; D < F; ++D) - U.push( - s( - r.slice(f[D].wholeMatch.start, f[D].wholeMatch.end), - r.slice(f[D].match.start, f[D].match.end), - r.slice(f[D].left.start, f[D].left.end), - r.slice(f[D].right.start, f[D].right.end) - ) - ), D < F - 1 && U.push(r.slice(f[D].wholeMatch.end, f[D + 1].wholeMatch.start)); - f[F - 1].wholeMatch.end < r.length && U.push(r.slice(f[F - 1].wholeMatch.end)), j = U.join(""); - } - return j; - }, a.helper.regexIndexOf = function(r, s, o) { - if (!a.helper.isString(r)) - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; - if (!(s instanceof RegExp)) - throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp"; - var c = r.substring(o || 0).search(s); - return c >= 0 ? c + (o || 0) : c; - }, a.helper.splitAtIndex = function(r, s) { - if (!a.helper.isString(r)) - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; - return [r.substring(0, s), r.substring(s)]; - }, a.helper.encodeEmailAddress = function(r) { - var s = [ - function(o) { - return "&#" + o.charCodeAt(0) + ";"; - }, - function(o) { - return "&#x" + o.charCodeAt(0).toString(16) + ";"; - }, - function(o) { - return o; - } - ]; - return r = r.replace(/./g, function(o) { - if (o === "@") - o = s[Math.floor(Math.random() * 2)](o); - else { - var c = Math.random(); - o = c > 0.9 ? s[2](o) : c > 0.45 ? s[1](o) : s[0](o); - } - return o; - }), r; - }, a.helper.padEnd = function(r, s, o) { - return s = s >> 0, o = String(o || " "), r.length > s ? String(r) : (s = s - r.length, s > o.length && (o += o.repeat(s / o.length)), String(r) + o.slice(0, s)); - }, typeof console > "u" && (console = { - warn: function(r) { - alert(r); - }, - log: function(r) { - alert(r); - }, - error: function(r) { - throw r; - } - }), a.helper.regexes = { - asteriskDashAndColon: /([*_:~])/g - }, a.helper.emojis = { - "+1": "👍", - "-1": "👎", - 100: "💯", - 1234: "🔢", - "1st_place_medal": "🥇", - "2nd_place_medal": "🥈", - "3rd_place_medal": "🥉", - "8ball": "🎱", - a: "🅰️", - ab: "🆎", - abc: "🔤", - abcd: "🔡", - accept: "🉑", - aerial_tramway: "🚡", - airplane: "✈️", - alarm_clock: "⏰", - alembic: "⚗️", - alien: "👽", - ambulance: "🚑", - amphora: "🏺", - anchor: "⚓️", - angel: "👼", - anger: "💢", - angry: "😠", - anguished: "😧", - ant: "🐜", - apple: "🍎", - aquarius: "♒️", - aries: "♈️", - arrow_backward: "◀️", - arrow_double_down: "⏬", - arrow_double_up: "⏫", - arrow_down: "⬇️", - arrow_down_small: "🔽", - arrow_forward: "▶️", - arrow_heading_down: "⤵️", - arrow_heading_up: "⤴️", - arrow_left: "⬅️", - arrow_lower_left: "↙️", - arrow_lower_right: "↘️", - arrow_right: "➡️", - arrow_right_hook: "↪️", - arrow_up: "⬆️", - arrow_up_down: "↕️", - arrow_up_small: "🔼", - arrow_upper_left: "↖️", - arrow_upper_right: "↗️", - arrows_clockwise: "🔃", - arrows_counterclockwise: "🔄", - art: "🎨", - articulated_lorry: "🚛", - artificial_satellite: "🛰", - astonished: "😲", - athletic_shoe: "👟", - atm: "🏧", - atom_symbol: "⚛️", - avocado: "🥑", - b: "🅱️", - baby: "👶", - baby_bottle: "🍼", - baby_chick: "🐤", - baby_symbol: "🚼", - back: "🔙", - bacon: "🥓", - badminton: "🏸", - baggage_claim: "🛄", - baguette_bread: "🥖", - balance_scale: "⚖️", - balloon: "🎈", - ballot_box: "🗳", - ballot_box_with_check: "☑️", - bamboo: "🎍", - banana: "🍌", - bangbang: "‼️", - bank: "🏦", - bar_chart: "📊", - barber: "💈", - baseball: "⚾️", - basketball: "🏀", - basketball_man: "⛹️", - basketball_woman: "⛹️‍♀️", - bat: "🦇", - bath: "🛀", - bathtub: "🛁", - battery: "🔋", - beach_umbrella: "🏖", - bear: "🐻", - bed: "🛏", - bee: "🐝", - beer: "🍺", - beers: "🍻", - beetle: "🐞", - beginner: "🔰", - bell: "🔔", - bellhop_bell: "🛎", - bento: "🍱", - biking_man: "🚴", - bike: "🚲", - biking_woman: "🚴‍♀️", - bikini: "👙", - biohazard: "☣️", - bird: "🐦", - birthday: "🎂", - black_circle: "⚫️", - black_flag: "🏴", - black_heart: "🖤", - black_joker: "🃏", - black_large_square: "⬛️", - black_medium_small_square: "◾️", - black_medium_square: "◼️", - black_nib: "✒️", - black_small_square: "▪️", - black_square_button: "🔲", - blonde_man: "👱", - blonde_woman: "👱‍♀️", - blossom: "🌼", - blowfish: "🐡", - blue_book: "📘", - blue_car: "🚙", - blue_heart: "💙", - blush: "😊", - boar: "🐗", - boat: "⛵️", - bomb: "💣", - book: "📖", - bookmark: "🔖", - bookmark_tabs: "📑", - books: "📚", - boom: "💥", - boot: "👢", - bouquet: "💐", - bowing_man: "🙇", - bow_and_arrow: "🏹", - bowing_woman: "🙇‍♀️", - bowling: "🎳", - boxing_glove: "🥊", - boy: "👦", - bread: "🍞", - bride_with_veil: "👰", - bridge_at_night: "🌉", - briefcase: "💼", - broken_heart: "💔", - bug: "🐛", - building_construction: "🏗", - bulb: "💡", - bullettrain_front: "🚅", - bullettrain_side: "🚄", - burrito: "🌯", - bus: "🚌", - business_suit_levitating: "🕴", - busstop: "🚏", - bust_in_silhouette: "👤", - busts_in_silhouette: "👥", - butterfly: "🦋", - cactus: "🌵", - cake: "🍰", - calendar: "📆", - call_me_hand: "🤙", - calling: "📲", - camel: "🐫", - camera: "📷", - camera_flash: "📸", - camping: "🏕", - cancer: "♋️", - candle: "🕯", - candy: "🍬", - canoe: "🛶", - capital_abcd: "🔠", - capricorn: "♑️", - car: "🚗", - card_file_box: "🗃", - card_index: "📇", - card_index_dividers: "🗂", - carousel_horse: "🎠", - carrot: "🥕", - cat: "🐱", - cat2: "🐈", - cd: "💿", - chains: "⛓", - champagne: "🍾", - chart: "💹", - chart_with_downwards_trend: "📉", - chart_with_upwards_trend: "📈", - checkered_flag: "🏁", - cheese: "🧀", - cherries: "🍒", - cherry_blossom: "🌸", - chestnut: "🌰", - chicken: "🐔", - children_crossing: "🚸", - chipmunk: "🐿", - chocolate_bar: "🍫", - christmas_tree: "🎄", - church: "⛪️", - cinema: "🎦", - circus_tent: "🎪", - city_sunrise: "🌇", - city_sunset: "🌆", - cityscape: "🏙", - cl: "🆑", - clamp: "🗜", - clap: "👏", - clapper: "🎬", - classical_building: "🏛", - clinking_glasses: "🥂", - clipboard: "📋", - clock1: "🕐", - clock10: "🕙", - clock1030: "🕥", - clock11: "🕚", - clock1130: "🕦", - clock12: "🕛", - clock1230: "🕧", - clock130: "🕜", - clock2: "🕑", - clock230: "🕝", - clock3: "🕒", - clock330: "🕞", - clock4: "🕓", - clock430: "🕟", - clock5: "🕔", - clock530: "🕠", - clock6: "🕕", - clock630: "🕡", - clock7: "🕖", - clock730: "🕢", - clock8: "🕗", - clock830: "🕣", - clock9: "🕘", - clock930: "🕤", - closed_book: "📕", - closed_lock_with_key: "🔐", - closed_umbrella: "🌂", - cloud: "☁️", - cloud_with_lightning: "🌩", - cloud_with_lightning_and_rain: "⛈", - cloud_with_rain: "🌧", - cloud_with_snow: "🌨", - clown_face: "🤡", - clubs: "♣️", - cocktail: "🍸", - coffee: "☕️", - coffin: "⚰️", - cold_sweat: "😰", - comet: "☄️", - computer: "💻", - computer_mouse: "🖱", - confetti_ball: "🎊", - confounded: "😖", - confused: "😕", - congratulations: "㊗️", - construction: "🚧", - construction_worker_man: "👷", - construction_worker_woman: "👷‍♀️", - control_knobs: "🎛", - convenience_store: "🏪", - cookie: "🍪", - cool: "🆒", - policeman: "👮", - copyright: "©️", - corn: "🌽", - couch_and_lamp: "🛋", - couple: "👫", - couple_with_heart_woman_man: "💑", - couple_with_heart_man_man: "👨‍❤️‍👨", - couple_with_heart_woman_woman: "👩‍❤️‍👩", - couplekiss_man_man: "👨‍❤️‍💋‍👨", - couplekiss_man_woman: "💏", - couplekiss_woman_woman: "👩‍❤️‍💋‍👩", - cow: "🐮", - cow2: "🐄", - cowboy_hat_face: "🤠", - crab: "🦀", - crayon: "🖍", - credit_card: "💳", - crescent_moon: "🌙", - cricket: "🏏", - crocodile: "🐊", - croissant: "🥐", - crossed_fingers: "🤞", - crossed_flags: "🎌", - crossed_swords: "⚔️", - crown: "👑", - cry: "😢", - crying_cat_face: "😿", - crystal_ball: "🔮", - cucumber: "🥒", - cupid: "💘", - curly_loop: "➰", - currency_exchange: "💱", - curry: "🍛", - custard: "🍮", - customs: "🛃", - cyclone: "🌀", - dagger: "🗡", - dancer: "💃", - dancing_women: "👯", - dancing_men: "👯‍♂️", - dango: "🍡", - dark_sunglasses: "🕶", - dart: "🎯", - dash: "💨", - date: "📅", - deciduous_tree: "🌳", - deer: "🦌", - department_store: "🏬", - derelict_house: "🏚", - desert: "🏜", - desert_island: "🏝", - desktop_computer: "🖥", - male_detective: "🕵️", - diamond_shape_with_a_dot_inside: "💠", - diamonds: "♦️", - disappointed: "😞", - disappointed_relieved: "😥", - dizzy: "💫", - dizzy_face: "😵", - do_not_litter: "🚯", - dog: "🐶", - dog2: "🐕", - dollar: "💵", - dolls: "🎎", - dolphin: "🐬", - door: "🚪", - doughnut: "🍩", - dove: "🕊", - dragon: "🐉", - dragon_face: "🐲", - dress: "👗", - dromedary_camel: "🐪", - drooling_face: "🤤", - droplet: "💧", - drum: "🥁", - duck: "🦆", - dvd: "📀", - "e-mail": "📧", - eagle: "🦅", - ear: "👂", - ear_of_rice: "🌾", - earth_africa: "🌍", - earth_americas: "🌎", - earth_asia: "🌏", - egg: "🥚", - eggplant: "🍆", - eight_pointed_black_star: "✴️", - eight_spoked_asterisk: "✳️", - electric_plug: "🔌", - elephant: "🐘", - email: "✉️", - end: "🔚", - envelope_with_arrow: "📩", - euro: "💶", - european_castle: "🏰", - european_post_office: "🏤", - evergreen_tree: "🌲", - exclamation: "❗️", - expressionless: "😑", - eye: "👁", - eye_speech_bubble: "👁‍🗨", - eyeglasses: "👓", - eyes: "👀", - face_with_head_bandage: "🤕", - face_with_thermometer: "🤒", - fist_oncoming: "👊", - factory: "🏭", - fallen_leaf: "🍂", - family_man_woman_boy: "👪", - family_man_boy: "👨‍👦", - family_man_boy_boy: "👨‍👦‍👦", - family_man_girl: "👨‍👧", - family_man_girl_boy: "👨‍👧‍👦", - family_man_girl_girl: "👨‍👧‍👧", - family_man_man_boy: "👨‍👨‍👦", - family_man_man_boy_boy: "👨‍👨‍👦‍👦", - family_man_man_girl: "👨‍👨‍👧", - family_man_man_girl_boy: "👨‍👨‍👧‍👦", - family_man_man_girl_girl: "👨‍👨‍👧‍👧", - family_man_woman_boy_boy: "👨‍👩‍👦‍👦", - family_man_woman_girl: "👨‍👩‍👧", - family_man_woman_girl_boy: "👨‍👩‍👧‍👦", - family_man_woman_girl_girl: "👨‍👩‍👧‍👧", - family_woman_boy: "👩‍👦", - family_woman_boy_boy: "👩‍👦‍👦", - family_woman_girl: "👩‍👧", - family_woman_girl_boy: "👩‍👧‍👦", - family_woman_girl_girl: "👩‍👧‍👧", - family_woman_woman_boy: "👩‍👩‍👦", - family_woman_woman_boy_boy: "👩‍👩‍👦‍👦", - family_woman_woman_girl: "👩‍👩‍👧", - family_woman_woman_girl_boy: "👩‍👩‍👧‍👦", - family_woman_woman_girl_girl: "👩‍👩‍👧‍👧", - fast_forward: "⏩", - fax: "📠", - fearful: "😨", - feet: "🐾", - female_detective: "🕵️‍♀️", - ferris_wheel: "🎡", - ferry: "⛴", - field_hockey: "🏑", - file_cabinet: "🗄", - file_folder: "📁", - film_projector: "📽", - film_strip: "🎞", - fire: "🔥", - fire_engine: "🚒", - fireworks: "🎆", - first_quarter_moon: "🌓", - first_quarter_moon_with_face: "🌛", - fish: "🐟", - fish_cake: "🍥", - fishing_pole_and_fish: "🎣", - fist_raised: "✊", - fist_left: "🤛", - fist_right: "🤜", - flags: "🎏", - flashlight: "🔦", - fleur_de_lis: "⚜️", - flight_arrival: "🛬", - flight_departure: "🛫", - floppy_disk: "💾", - flower_playing_cards: "🎴", - flushed: "😳", - fog: "🌫", - foggy: "🌁", - football: "🏈", - footprints: "👣", - fork_and_knife: "🍴", - fountain: "⛲️", - fountain_pen: "🖋", - four_leaf_clover: "🍀", - fox_face: "🦊", - framed_picture: "🖼", - free: "🆓", - fried_egg: "🍳", - fried_shrimp: "🍤", - fries: "🍟", - frog: "🐸", - frowning: "😦", - frowning_face: "☹️", - frowning_man: "🙍‍♂️", - frowning_woman: "🙍", - middle_finger: "🖕", - fuelpump: "⛽️", - full_moon: "🌕", - full_moon_with_face: "🌝", - funeral_urn: "⚱️", - game_die: "🎲", - gear: "⚙️", - gem: "💎", - gemini: "♊️", - ghost: "👻", - gift: "🎁", - gift_heart: "💝", - girl: "👧", - globe_with_meridians: "🌐", - goal_net: "🥅", - goat: "🐐", - golf: "⛳️", - golfing_man: "🏌️", - golfing_woman: "🏌️‍♀️", - gorilla: "🦍", - grapes: "🍇", - green_apple: "🍏", - green_book: "📗", - green_heart: "💚", - green_salad: "🥗", - grey_exclamation: "❕", - grey_question: "❔", - grimacing: "😬", - grin: "😁", - grinning: "😀", - guardsman: "💂", - guardswoman: "💂‍♀️", - guitar: "🎸", - gun: "🔫", - haircut_woman: "💇", - haircut_man: "💇‍♂️", - hamburger: "🍔", - hammer: "🔨", - hammer_and_pick: "⚒", - hammer_and_wrench: "🛠", - hamster: "🐹", - hand: "✋", - handbag: "👜", - handshake: "🤝", - hankey: "💩", - hatched_chick: "🐥", - hatching_chick: "🐣", - headphones: "🎧", - hear_no_evil: "🙉", - heart: "❤️", - heart_decoration: "💟", - heart_eyes: "😍", - heart_eyes_cat: "😻", - heartbeat: "💓", - heartpulse: "💗", - hearts: "♥️", - heavy_check_mark: "✔️", - heavy_division_sign: "➗", - heavy_dollar_sign: "💲", - heavy_heart_exclamation: "❣️", - heavy_minus_sign: "➖", - heavy_multiplication_x: "✖️", - heavy_plus_sign: "➕", - helicopter: "🚁", - herb: "🌿", - hibiscus: "🌺", - high_brightness: "🔆", - high_heel: "👠", - hocho: "🔪", - hole: "🕳", - honey_pot: "🍯", - horse: "🐴", - horse_racing: "🏇", - hospital: "🏥", - hot_pepper: "🌶", - hotdog: "🌭", - hotel: "🏨", - hotsprings: "♨️", - hourglass: "⌛️", - hourglass_flowing_sand: "⏳", - house: "🏠", - house_with_garden: "🏡", - houses: "🏘", - hugs: "🤗", - hushed: "😯", - ice_cream: "🍨", - ice_hockey: "🏒", - ice_skate: "⛸", - icecream: "🍦", - id: "🆔", - ideograph_advantage: "🉐", - imp: "👿", - inbox_tray: "📥", - incoming_envelope: "📨", - tipping_hand_woman: "💁", - information_source: "ℹ️", - innocent: "😇", - interrobang: "⁉️", - iphone: "📱", - izakaya_lantern: "🏮", - jack_o_lantern: "🎃", - japan: "🗾", - japanese_castle: "🏯", - japanese_goblin: "👺", - japanese_ogre: "👹", - jeans: "👖", - joy: "😂", - joy_cat: "😹", - joystick: "🕹", - kaaba: "🕋", - key: "🔑", - keyboard: "⌨️", - keycap_ten: "🔟", - kick_scooter: "🛴", - kimono: "👘", - kiss: "💋", - kissing: "😗", - kissing_cat: "😽", - kissing_closed_eyes: "😚", - kissing_heart: "😘", - kissing_smiling_eyes: "😙", - kiwi_fruit: "🥝", - koala: "🐨", - koko: "🈁", - label: "🏷", - large_blue_circle: "🔵", - large_blue_diamond: "🔷", - large_orange_diamond: "🔶", - last_quarter_moon: "🌗", - last_quarter_moon_with_face: "🌜", - latin_cross: "✝️", - laughing: "😆", - leaves: "🍃", - ledger: "📒", - left_luggage: "🛅", - left_right_arrow: "↔️", - leftwards_arrow_with_hook: "↩️", - lemon: "🍋", - leo: "♌️", - leopard: "🐆", - level_slider: "🎚", - libra: "♎️", - light_rail: "🚈", - link: "🔗", - lion: "🦁", - lips: "👄", - lipstick: "💄", - lizard: "🦎", - lock: "🔒", - lock_with_ink_pen: "🔏", - lollipop: "🍭", - loop: "➿", - loud_sound: "🔊", - loudspeaker: "📢", - love_hotel: "🏩", - love_letter: "💌", - low_brightness: "🔅", - lying_face: "🤥", - m: "Ⓜ️", - mag: "🔍", - mag_right: "🔎", - mahjong: "🀄️", - mailbox: "📫", - mailbox_closed: "📪", - mailbox_with_mail: "📬", - mailbox_with_no_mail: "📭", - man: "👨", - man_artist: "👨‍🎨", - man_astronaut: "👨‍🚀", - man_cartwheeling: "🤸‍♂️", - man_cook: "👨‍🍳", - man_dancing: "🕺", - man_facepalming: "🤦‍♂️", - man_factory_worker: "👨‍🏭", - man_farmer: "👨‍🌾", - man_firefighter: "👨‍🚒", - man_health_worker: "👨‍⚕️", - man_in_tuxedo: "🤵", - man_judge: "👨‍⚖️", - man_juggling: "🤹‍♂️", - man_mechanic: "👨‍🔧", - man_office_worker: "👨‍💼", - man_pilot: "👨‍✈️", - man_playing_handball: "🤾‍♂️", - man_playing_water_polo: "🤽‍♂️", - man_scientist: "👨‍🔬", - man_shrugging: "🤷‍♂️", - man_singer: "👨‍🎤", - man_student: "👨‍🎓", - man_teacher: "👨‍🏫", - man_technologist: "👨‍💻", - man_with_gua_pi_mao: "👲", - man_with_turban: "👳", - tangerine: "🍊", - mans_shoe: "👞", - mantelpiece_clock: "🕰", - maple_leaf: "🍁", - martial_arts_uniform: "🥋", - mask: "😷", - massage_woman: "💆", - massage_man: "💆‍♂️", - meat_on_bone: "🍖", - medal_military: "🎖", - medal_sports: "🏅", - mega: "📣", - melon: "🍈", - memo: "📝", - men_wrestling: "🤼‍♂️", - menorah: "🕎", - mens: "🚹", - metal: "🤘", - metro: "🚇", - microphone: "🎤", - microscope: "🔬", - milk_glass: "🥛", - milky_way: "🌌", - minibus: "🚐", - minidisc: "💽", - mobile_phone_off: "📴", - money_mouth_face: "🤑", - money_with_wings: "💸", - moneybag: "💰", - monkey: "🐒", - monkey_face: "🐵", - monorail: "🚝", - moon: "🌔", - mortar_board: "🎓", - mosque: "🕌", - motor_boat: "🛥", - motor_scooter: "🛵", - motorcycle: "🏍", - motorway: "🛣", - mount_fuji: "🗻", - mountain: "⛰", - mountain_biking_man: "🚵", - mountain_biking_woman: "🚵‍♀️", - mountain_cableway: "🚠", - mountain_railway: "🚞", - mountain_snow: "🏔", - mouse: "🐭", - mouse2: "🐁", - movie_camera: "🎥", - moyai: "🗿", - mrs_claus: "🤶", - muscle: "💪", - mushroom: "🍄", - musical_keyboard: "🎹", - musical_note: "🎵", - musical_score: "🎼", - mute: "🔇", - nail_care: "💅", - name_badge: "📛", - national_park: "🏞", - nauseated_face: "🤢", - necktie: "👔", - negative_squared_cross_mark: "❎", - nerd_face: "🤓", - neutral_face: "😐", - new: "🆕", - new_moon: "🌑", - new_moon_with_face: "🌚", - newspaper: "📰", - newspaper_roll: "🗞", - next_track_button: "⏭", - ng: "🆖", - no_good_man: "🙅‍♂️", - no_good_woman: "🙅", - night_with_stars: "🌃", - no_bell: "🔕", - no_bicycles: "🚳", - no_entry: "⛔️", - no_entry_sign: "🚫", - no_mobile_phones: "📵", - no_mouth: "😶", - no_pedestrians: "🚷", - no_smoking: "🚭", - "non-potable_water": "🚱", - nose: "👃", - notebook: "📓", - notebook_with_decorative_cover: "📔", - notes: "🎶", - nut_and_bolt: "🔩", - o: "⭕️", - o2: "🅾️", - ocean: "🌊", - octopus: "🐙", - oden: "🍢", - office: "🏢", - oil_drum: "🛢", - ok: "🆗", - ok_hand: "👌", - ok_man: "🙆‍♂️", - ok_woman: "🙆", - old_key: "🗝", - older_man: "👴", - older_woman: "👵", - om: "🕉", - on: "🔛", - oncoming_automobile: "🚘", - oncoming_bus: "🚍", - oncoming_police_car: "🚔", - oncoming_taxi: "🚖", - open_file_folder: "📂", - open_hands: "👐", - open_mouth: "😮", - open_umbrella: "☂️", - ophiuchus: "⛎", - orange_book: "📙", - orthodox_cross: "☦️", - outbox_tray: "📤", - owl: "🦉", - ox: "🐂", - package: "📦", - page_facing_up: "📄", - page_with_curl: "📃", - pager: "📟", - paintbrush: "🖌", - palm_tree: "🌴", - pancakes: "🥞", - panda_face: "🐼", - paperclip: "📎", - paperclips: "🖇", - parasol_on_ground: "⛱", - parking: "🅿️", - part_alternation_mark: "〽️", - partly_sunny: "⛅️", - passenger_ship: "🛳", - passport_control: "🛂", - pause_button: "⏸", - peace_symbol: "☮️", - peach: "🍑", - peanuts: "🥜", - pear: "🍐", - pen: "🖊", - pencil2: "✏️", - penguin: "🐧", - pensive: "😔", - performing_arts: "🎭", - persevere: "😣", - person_fencing: "🤺", - pouting_woman: "🙎", - phone: "☎️", - pick: "⛏", - pig: "🐷", - pig2: "🐖", - pig_nose: "🐽", - pill: "💊", - pineapple: "🍍", - ping_pong: "🏓", - pisces: "♓️", - pizza: "🍕", - place_of_worship: "🛐", - plate_with_cutlery: "🍽", - play_or_pause_button: "⏯", - point_down: "👇", - point_left: "👈", - point_right: "👉", - point_up: "☝️", - point_up_2: "👆", - police_car: "🚓", - policewoman: "👮‍♀️", - poodle: "🐩", - popcorn: "🍿", - post_office: "🏣", - postal_horn: "📯", - postbox: "📮", - potable_water: "🚰", - potato: "🥔", - pouch: "👝", - poultry_leg: "🍗", - pound: "💷", - rage: "😡", - pouting_cat: "😾", - pouting_man: "🙎‍♂️", - pray: "🙏", - prayer_beads: "📿", - pregnant_woman: "🤰", - previous_track_button: "⏮", - prince: "🤴", - princess: "👸", - printer: "🖨", - purple_heart: "💜", - purse: "👛", - pushpin: "📌", - put_litter_in_its_place: "🚮", - question: "❓", - rabbit: "🐰", - rabbit2: "🐇", - racehorse: "🐎", - racing_car: "🏎", - radio: "📻", - radio_button: "🔘", - radioactive: "☢️", - railway_car: "🚃", - railway_track: "🛤", - rainbow: "🌈", - rainbow_flag: "🏳️‍🌈", - raised_back_of_hand: "🤚", - raised_hand_with_fingers_splayed: "🖐", - raised_hands: "🙌", - raising_hand_woman: "🙋", - raising_hand_man: "🙋‍♂️", - ram: "🐏", - ramen: "🍜", - rat: "🐀", - record_button: "⏺", - recycle: "♻️", - red_circle: "🔴", - registered: "®️", - relaxed: "☺️", - relieved: "😌", - reminder_ribbon: "🎗", - repeat: "🔁", - repeat_one: "🔂", - rescue_worker_helmet: "⛑", - restroom: "🚻", - revolving_hearts: "💞", - rewind: "⏪", - rhinoceros: "🦏", - ribbon: "🎀", - rice: "🍚", - rice_ball: "🍙", - rice_cracker: "🍘", - rice_scene: "🎑", - right_anger_bubble: "🗯", - ring: "💍", - robot: "🤖", - rocket: "🚀", - rofl: "🤣", - roll_eyes: "🙄", - roller_coaster: "🎢", - rooster: "🐓", - rose: "🌹", - rosette: "🏵", - rotating_light: "🚨", - round_pushpin: "📍", - rowing_man: "🚣", - rowing_woman: "🚣‍♀️", - rugby_football: "🏉", - running_man: "🏃", - running_shirt_with_sash: "🎽", - running_woman: "🏃‍♀️", - sa: "🈂️", - sagittarius: "♐️", - sake: "🍶", - sandal: "👡", - santa: "🎅", - satellite: "📡", - saxophone: "🎷", - school: "🏫", - school_satchel: "🎒", - scissors: "✂️", - scorpion: "🦂", - scorpius: "♏️", - scream: "😱", - scream_cat: "🙀", - scroll: "📜", - seat: "💺", - secret: "㊙️", - see_no_evil: "🙈", - seedling: "🌱", - selfie: "🤳", - shallow_pan_of_food: "🥘", - shamrock: "☘️", - shark: "🦈", - shaved_ice: "🍧", - sheep: "🐑", - shell: "🐚", - shield: "🛡", - shinto_shrine: "⛩", - ship: "🚢", - shirt: "👕", - shopping: "🛍", - shopping_cart: "🛒", - shower: "🚿", - shrimp: "🦐", - signal_strength: "📶", - six_pointed_star: "🔯", - ski: "🎿", - skier: "⛷", - skull: "💀", - skull_and_crossbones: "☠️", - sleeping: "😴", - sleeping_bed: "🛌", - sleepy: "😪", - slightly_frowning_face: "🙁", - slightly_smiling_face: "🙂", - slot_machine: "🎰", - small_airplane: "🛩", - small_blue_diamond: "🔹", - small_orange_diamond: "🔸", - small_red_triangle: "🔺", - small_red_triangle_down: "🔻", - smile: "😄", - smile_cat: "😸", - smiley: "😃", - smiley_cat: "😺", - smiling_imp: "😈", - smirk: "😏", - smirk_cat: "😼", - smoking: "🚬", - snail: "🐌", - snake: "🐍", - sneezing_face: "🤧", - snowboarder: "🏂", - snowflake: "❄️", - snowman: "⛄️", - snowman_with_snow: "☃️", - sob: "😭", - soccer: "⚽️", - soon: "🔜", - sos: "🆘", - sound: "🔉", - space_invader: "👾", - spades: "♠️", - spaghetti: "🍝", - sparkle: "❇️", - sparkler: "🎇", - sparkles: "✨", - sparkling_heart: "💖", - speak_no_evil: "🙊", - speaker: "🔈", - speaking_head: "🗣", - speech_balloon: "💬", - speedboat: "🚤", - spider: "🕷", - spider_web: "🕸", - spiral_calendar: "🗓", - spiral_notepad: "🗒", - spoon: "🥄", - squid: "🦑", - stadium: "🏟", - star: "⭐️", - star2: "🌟", - star_and_crescent: "☪️", - star_of_david: "✡️", - stars: "🌠", - station: "🚉", - statue_of_liberty: "🗽", - steam_locomotive: "🚂", - stew: "🍲", - stop_button: "⏹", - stop_sign: "🛑", - stopwatch: "⏱", - straight_ruler: "📏", - strawberry: "🍓", - stuck_out_tongue: "😛", - stuck_out_tongue_closed_eyes: "😝", - stuck_out_tongue_winking_eye: "😜", - studio_microphone: "🎙", - stuffed_flatbread: "🥙", - sun_behind_large_cloud: "🌥", - sun_behind_rain_cloud: "🌦", - sun_behind_small_cloud: "🌤", - sun_with_face: "🌞", - sunflower: "🌻", - sunglasses: "😎", - sunny: "☀️", - sunrise: "🌅", - sunrise_over_mountains: "🌄", - surfing_man: "🏄", - surfing_woman: "🏄‍♀️", - sushi: "🍣", - suspension_railway: "🚟", - sweat: "😓", - sweat_drops: "💦", - sweat_smile: "😅", - sweet_potato: "🍠", - swimming_man: "🏊", - swimming_woman: "🏊‍♀️", - symbols: "🔣", - synagogue: "🕍", - syringe: "💉", - taco: "🌮", - tada: "🎉", - tanabata_tree: "🎋", - taurus: "♉️", - taxi: "🚕", - tea: "🍵", - telephone_receiver: "📞", - telescope: "🔭", - tennis: "🎾", - tent: "⛺️", - thermometer: "🌡", - thinking: "🤔", - thought_balloon: "💭", - ticket: "🎫", - tickets: "🎟", - tiger: "🐯", - tiger2: "🐅", - timer_clock: "⏲", - tipping_hand_man: "💁‍♂️", - tired_face: "😫", - tm: "™️", - toilet: "🚽", - tokyo_tower: "🗼", - tomato: "🍅", - tongue: "👅", - top: "🔝", - tophat: "🎩", - tornado: "🌪", - trackball: "🖲", - tractor: "🚜", - traffic_light: "🚥", - train: "🚋", - train2: "🚆", - tram: "🚊", - triangular_flag_on_post: "🚩", - triangular_ruler: "📐", - trident: "🔱", - triumph: "😤", - trolleybus: "🚎", - trophy: "🏆", - tropical_drink: "🍹", - tropical_fish: "🐠", - truck: "🚚", - trumpet: "🎺", - tulip: "🌷", - tumbler_glass: "🥃", - turkey: "🦃", - turtle: "🐢", - tv: "📺", - twisted_rightwards_arrows: "🔀", - two_hearts: "💕", - two_men_holding_hands: "👬", - two_women_holding_hands: "👭", - u5272: "🈹", - u5408: "🈴", - u55b6: "🈺", - u6307: "🈯️", - u6708: "🈷️", - u6709: "🈶", - u6e80: "🈵", - u7121: "🈚️", - u7533: "🈸", - u7981: "🈲", - u7a7a: "🈳", - umbrella: "☔️", - unamused: "😒", - underage: "🔞", - unicorn: "🦄", - unlock: "🔓", - up: "🆙", - upside_down_face: "🙃", - v: "✌️", - vertical_traffic_light: "🚦", - vhs: "📼", - vibration_mode: "📳", - video_camera: "📹", - video_game: "🎮", - violin: "🎻", - virgo: "♍️", - volcano: "🌋", - volleyball: "🏐", - vs: "🆚", - vulcan_salute: "🖖", - walking_man: "🚶", - walking_woman: "🚶‍♀️", - waning_crescent_moon: "🌘", - waning_gibbous_moon: "🌖", - warning: "⚠️", - wastebasket: "🗑", - watch: "⌚️", - water_buffalo: "🐃", - watermelon: "🍉", - wave: "👋", - wavy_dash: "〰️", - waxing_crescent_moon: "🌒", - wc: "🚾", - weary: "😩", - wedding: "💒", - weight_lifting_man: "🏋️", - weight_lifting_woman: "🏋️‍♀️", - whale: "🐳", - whale2: "🐋", - wheel_of_dharma: "☸️", - wheelchair: "♿️", - white_check_mark: "✅", - white_circle: "⚪️", - white_flag: "🏳️", - white_flower: "💮", - white_large_square: "⬜️", - white_medium_small_square: "◽️", - white_medium_square: "◻️", - white_small_square: "▫️", - white_square_button: "🔳", - wilted_flower: "🥀", - wind_chime: "🎐", - wind_face: "🌬", - wine_glass: "🍷", - wink: "😉", - wolf: "🐺", - woman: "👩", - woman_artist: "👩‍🎨", - woman_astronaut: "👩‍🚀", - woman_cartwheeling: "🤸‍♀️", - woman_cook: "👩‍🍳", - woman_facepalming: "🤦‍♀️", - woman_factory_worker: "👩‍🏭", - woman_farmer: "👩‍🌾", - woman_firefighter: "👩‍🚒", - woman_health_worker: "👩‍⚕️", - woman_judge: "👩‍⚖️", - woman_juggling: "🤹‍♀️", - woman_mechanic: "👩‍🔧", - woman_office_worker: "👩‍💼", - woman_pilot: "👩‍✈️", - woman_playing_handball: "🤾‍♀️", - woman_playing_water_polo: "🤽‍♀️", - woman_scientist: "👩‍🔬", - woman_shrugging: "🤷‍♀️", - woman_singer: "👩‍🎤", - woman_student: "👩‍🎓", - woman_teacher: "👩‍🏫", - woman_technologist: "👩‍💻", - woman_with_turban: "👳‍♀️", - womans_clothes: "👚", - womans_hat: "👒", - women_wrestling: "🤼‍♀️", - womens: "🚺", - world_map: "🗺", - worried: "😟", - wrench: "🔧", - writing_hand: "✍️", - x: "❌", - yellow_heart: "💛", - yen: "💴", - yin_yang: "☯️", - yum: "😋", - zap: "⚡️", - zipper_mouth_face: "🤐", - zzz: "💤", - /* special emojis :P */ - octocat: ':octocat:', - showdown: `S` - }, a.Converter = function(r) { - var s = {}, o = [], c = [], u = {}, _ = p, f = { - parsed: {}, - raw: "", - format: "" - }; - j(); - function j() { - r = r || {}; - for (var w in m) - m.hasOwnProperty(w) && (s[w] = m[w]); - if (typeof r == "object") - for (var G in r) - r.hasOwnProperty(G) && (s[G] = r[G]); - else - throw Error("Converter expects the passed parameter to be an object, but " + typeof r + " was passed instead."); - s.extensions && a.helper.forEach(s.extensions, F); - } - function F(w, G) { - if (G = G || null, a.helper.isString(w)) - if (w = a.helper.stdExtName(w), G = w, a.extensions[w]) { - console.warn("DEPRECATION WARNING: " + w + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"), U(a.extensions[w], w); - return; - } else if (!a.helper.isUndefined(l[w])) - w = l[w]; - else - throw Error('Extension "' + w + '" could not be loaded. It was either not found or is not a valid extension.'); - typeof w == "function" && (w = w()), a.helper.isArray(w) || (w = [w]); - var Q = v(w, G); - if (!Q.valid) - throw Error(Q.error); - for (var ee = 0; ee < w.length; ++ee) { - switch (w[ee].type) { - case "lang": - o.push(w[ee]); - break; - case "output": - c.push(w[ee]); - break; - } - if (w[ee].hasOwnProperty("listeners")) - for (var q in w[ee].listeners) - w[ee].listeners.hasOwnProperty(q) && D(q, w[ee].listeners[q]); - } - } - function U(w, G) { - typeof w == "function" && (w = w(new a.Converter())), a.helper.isArray(w) || (w = [w]); - var Q = v(w, G); - if (!Q.valid) - throw Error(Q.error); - for (var ee = 0; ee < w.length; ++ee) - switch (w[ee].type) { - case "lang": - o.push(w[ee]); - break; - case "output": - c.push(w[ee]); - break; - default: - throw Error("Extension loader error: Type unrecognized!!!"); - } - } - function D(w, G) { - if (!a.helper.isString(w)) - throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof w + " given"); - if (typeof G != "function") - throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof G + " given"); - u.hasOwnProperty(w) || (u[w] = []), u[w].push(G); - } - function W(w) { - var G = w.match(/^\s*/)[0].length, Q = new RegExp("^\\s{0," + G + "}", "gm"); - return w.replace(Q, ""); - } - this._dispatch = function(w, G, Q, ee) { - if (u.hasOwnProperty(w)) - for (var q = 0; q < u[w].length; ++q) { - var P = u[w][q](w, G, this, Q, ee); - P && typeof P < "u" && (G = P); - } - return G; - }, this.listen = function(w, G) { - return D(w, G), this; - }, this.makeHtml = function(w) { - if (!w) - return w; - var G = { - gHtmlBlocks: [], - gHtmlMdBlocks: [], - gHtmlSpans: [], - gUrls: {}, - gTitles: {}, - gDimensions: {}, - gListLevel: 0, - hashLinkCounts: {}, - langExtensions: o, - outputModifiers: c, - converter: this, - ghCodeBlocks: [], - metadata: { - parsed: {}, - raw: "", - format: "" - } - }; - return w = w.replace(/¨/g, "¨T"), w = w.replace(/\$/g, "¨D"), w = w.replace(/\r\n/g, ` -`), w = w.replace(/\r/g, ` -`), w = w.replace(/\u00A0/g, " "), s.smartIndentationFix && (w = W(w)), w = ` - -` + w + ` - -`, w = a.subParser("detab")(w, s, G), w = w.replace(/^[ \t]+$/mg, ""), a.helper.forEach(o, function(Q) { - w = a.subParser("runExtension")(Q, w, s, G); - }), w = a.subParser("metadata")(w, s, G), w = a.subParser("hashPreCodeTags")(w, s, G), w = a.subParser("githubCodeBlocks")(w, s, G), w = a.subParser("hashHTMLBlocks")(w, s, G), w = a.subParser("hashCodeTags")(w, s, G), w = a.subParser("stripLinkDefinitions")(w, s, G), w = a.subParser("blockGamut")(w, s, G), w = a.subParser("unhashHTMLSpans")(w, s, G), w = a.subParser("unescapeSpecialChars")(w, s, G), w = w.replace(/¨D/g, "$$"), w = w.replace(/¨T/g, "¨"), w = a.subParser("completeHTMLDocument")(w, s, G), a.helper.forEach(c, function(Q) { - w = a.subParser("runExtension")(Q, w, s, G); - }), f = G.metadata, w; - }, this.makeMarkdown = this.makeMd = function(w, G) { - if (w = w.replace(/\r\n/g, ` -`), w = w.replace(/\r/g, ` -`), w = w.replace(/>[ \t]+¨NBSP;<"), !G) - if (window && window.document) - G = window.document; - else - throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM"); - var Q = G.createElement("div"); - Q.innerHTML = w; - var ee = { - preList: d(Q) - }; - N(Q); - for (var q = Q.childNodes, P = "", H = 0; H < q.length; H++) - P += a.subParser("makeMarkdown.node")(q[H], ee); - function N(y) { - for (var z = 0; z < y.childNodes.length; ++z) { - var J = y.childNodes[z]; - J.nodeType === 3 ? !/\S/.test(J.nodeValue) && !/^[ ]+$/.test(J.nodeValue) ? (y.removeChild(J), --z) : (J.nodeValue = J.nodeValue.split(` -`).join(" "), J.nodeValue = J.nodeValue.replace(/(\s)+/g, "$1")) : J.nodeType === 1 && N(J); - } - } - function d(y) { - for (var z = y.querySelectorAll("pre"), J = [], Y = 0; Y < z.length; ++Y) - if (z[Y].childElementCount === 1 && z[Y].firstChild.tagName.toLowerCase() === "code") { - var se = z[Y].firstChild.innerHTML.trim(), ie = z[Y].firstChild.getAttribute("data-language") || ""; - if (ie === "") - for (var C = z[Y].firstChild.className.split(" "), R = 0; R < C.length; ++R) { - var K = C[R].match(/^language-(.+)$/); - if (K !== null) { - ie = K[1]; - break; - } - } - se = a.helper.unescapeHTMLEntities(se), J.push(se), z[Y].outerHTML = ''; - } else - J.push(z[Y].innerHTML), z[Y].innerHTML = "", z[Y].setAttribute("prenum", Y.toString()); - return J; - } - return P; - }, this.setOption = function(w, G) { - s[w] = G; - }, this.getOption = function(w) { - return s[w]; - }, this.getOptions = function() { - return s; - }, this.addExtension = function(w, G) { - G = G || null, F(w, G); - }, this.useExtension = function(w) { - F(w); - }, this.setFlavor = function(w) { - if (!g.hasOwnProperty(w)) - throw Error(w + " flavor was not found"); - var G = g[w]; - _ = w; - for (var Q in G) - G.hasOwnProperty(Q) && (s[Q] = G[Q]); - }, this.getFlavor = function() { - return _; - }, this.removeExtension = function(w) { - a.helper.isArray(w) || (w = [w]); - for (var G = 0; G < w.length; ++G) { - for (var Q = w[G], ee = 0; ee < o.length; ++ee) - o[ee] === Q && o.splice(ee, 1); - for (var q = 0; q < c.length; ++q) - c[q] === Q && c.splice(q, 1); - } - }, this.getAllExtensions = function() { - return { - language: o, - output: c - }; - }, this.getMetadata = function(w) { - return w ? f.raw : f.parsed; - }, this.getMetadataFormat = function() { - return f.format; - }, this._setMetadataPair = function(w, G) { - f.parsed[w] = G; - }, this._setMetadataFormat = function(w) { - f.format = w; - }, this._setMetadataRaw = function(w) { - f.raw = w; - }; - }, a.subParser("anchors", function(r, s, o) { - r = o.converter._dispatch("anchors.before", r, s, o); - var c = function(u, _, f, j, F, U, D) { - if (a.helper.isUndefined(D) && (D = ""), f = f.toLowerCase(), u.search(/\(? ?(['"].*['"])?\)$/m) > -1) - j = ""; - else if (!j) - if (f || (f = _.toLowerCase().replace(/ ?\n/g, " ")), j = "#" + f, !a.helper.isUndefined(o.gUrls[f])) - j = o.gUrls[f], a.helper.isUndefined(o.gTitles[f]) || (D = o.gTitles[f]); - else - return u; - j = j.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var W = '", W; - }; - return r = r.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, c), r = r.replace( - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, - c - ), r = r.replace( - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, - c - ), r = r.replace(/\[([^\[\]]+)]()()()()()/g, c), s.ghMentions && (r = r.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function(u, _, f, j, F) { - if (f === "\\") - return _ + j; - if (!a.helper.isString(s.ghMentionsLink)) - throw new Error("ghMentionsLink option must be a string"); - var U = s.ghMentionsLink.replace(/\{u}/g, F), D = ""; - return s.openLinksInNewWindow && (D = ' rel="noopener noreferrer" target="¨E95Eblank"'), _ + '" + j + ""; - })), r = o.converter._dispatch("anchors.after", r, s, o), r; - }); - var I = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, M = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, O = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, x = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, T = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, k = function(r) { - return function(s, o, c, u, _, f, j) { - c = c.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var F = c, U = "", D = "", W = o || "", w = j || ""; - return /^www\./i.test(c) && (c = c.replace(/^www\./i, "http://www.")), r.excludeTrailingPunctuationFromURLs && f && (U = f), r.openLinksInNewWindow && (D = ' rel="noopener noreferrer" target="¨E95Eblank"'), W + '" + F + "" + U + w; - }; - }, A = function(r, s) { - return function(o, c, u) { - var _ = "mailto:"; - return c = c || "", u = a.subParser("unescapeSpecialChars")(u, r, s), r.encodeEmails ? (_ = a.helper.encodeEmailAddress(_ + u), u = a.helper.encodeEmailAddress(u)) : _ = _ + u, c + '' + u + ""; - }; - }; - a.subParser("autoLinks", function(r, s, o) { - return r = o.converter._dispatch("autoLinks.before", r, s, o), r = r.replace(O, k(s)), r = r.replace(T, A(s, o)), r = o.converter._dispatch("autoLinks.after", r, s, o), r; - }), a.subParser("simplifiedAutoLinks", function(r, s, o) { - return s.simplifiedAutoLink && (r = o.converter._dispatch("simplifiedAutoLinks.before", r, s, o), s.excludeTrailingPunctuationFromURLs ? r = r.replace(M, k(s)) : r = r.replace(I, k(s)), r = r.replace(x, A(s, o)), r = o.converter._dispatch("simplifiedAutoLinks.after", r, s, o)), r; - }), a.subParser("blockGamut", function(r, s, o) { - return r = o.converter._dispatch("blockGamut.before", r, s, o), r = a.subParser("blockQuotes")(r, s, o), r = a.subParser("headers")(r, s, o), r = a.subParser("horizontalRule")(r, s, o), r = a.subParser("lists")(r, s, o), r = a.subParser("codeBlocks")(r, s, o), r = a.subParser("tables")(r, s, o), r = a.subParser("hashHTMLBlocks")(r, s, o), r = a.subParser("paragraphs")(r, s, o), r = o.converter._dispatch("blockGamut.after", r, s, o), r; - }), a.subParser("blockQuotes", function(r, s, o) { - r = o.converter._dispatch("blockQuotes.before", r, s, o), r = r + ` - -`; - var c = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm; - return s.splitAdjacentBlockquotes && (c = /^ {0,3}>[\s\S]*?(?:\n\n)/gm), r = r.replace(c, function(u) { - return u = u.replace(/^[ \t]*>[ \t]?/gm, ""), u = u.replace(/¨0/g, ""), u = u.replace(/^[ \t]+$/gm, ""), u = a.subParser("githubCodeBlocks")(u, s, o), u = a.subParser("blockGamut")(u, s, o), u = u.replace(/(^|\n)/g, "$1 "), u = u.replace(/(\s*
[^\r]+?<\/pre>)/gm, function(_, f) {
-          var j = f;
-          return j = j.replace(/^  /mg, "¨0"), j = j.replace(/¨0/g, ""), j;
-        }), a.subParser("hashBlock")(`
-` + u + ` -
`, s, o); - }), r = o.converter._dispatch("blockQuotes.after", r, s, o), r; - }), a.subParser("codeBlocks", function(r, s, o) { - r = o.converter._dispatch("codeBlocks.before", r, s, o), r += "¨0"; - var c = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g; - return r = r.replace(c, function(u, _, f) { - var j = _, F = f, U = ` -`; - return j = a.subParser("outdent")(j, s, o), j = a.subParser("encodeCode")(j, s, o), j = a.subParser("detab")(j, s, o), j = j.replace(/^\n+/g, ""), j = j.replace(/\n+$/g, ""), s.omitExtraWLInCodeBlocks && (U = ""), j = "
" + j + U + "
", a.subParser("hashBlock")(j, s, o) + F; - }), r = r.replace(/¨0/, ""), r = o.converter._dispatch("codeBlocks.after", r, s, o), r; - }), a.subParser("codeSpans", function(r, s, o) { - return r = o.converter._dispatch("codeSpans.before", r, s, o), typeof r > "u" && (r = ""), r = r.replace( - /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, - function(c, u, _, f) { - var j = f; - return j = j.replace(/^([ \t]*)/g, ""), j = j.replace(/[ \t]*$/g, ""), j = a.subParser("encodeCode")(j, s, o), j = u + "" + j + "", j = a.subParser("hashHTMLSpans")(j, s, o), j; - } - ), r = o.converter._dispatch("codeSpans.after", r, s, o), r; - }), a.subParser("completeHTMLDocument", function(r, s, o) { - if (!s.completeHTMLDocument) - return r; - r = o.converter._dispatch("completeHTMLDocument.before", r, s, o); - var c = "html", u = ` -`, _ = "", f = ` -`, j = "", F = ""; - typeof o.metadata.parsed.doctype < "u" && (u = " -`, c = o.metadata.parsed.doctype.toString().toLowerCase(), (c === "html" || c === "html5") && (f = '')); - for (var U in o.metadata.parsed) - if (o.metadata.parsed.hasOwnProperty(U)) - switch (U.toLowerCase()) { - case "doctype": - break; - case "title": - _ = "" + o.metadata.parsed.title + ` -`; - break; - case "charset": - c === "html" || c === "html5" ? f = ' -` : f = ' -`; - break; - case "language": - case "lang": - j = ' lang="' + o.metadata.parsed[U] + '"', F += ' -`; - break; - default: - F += ' -`; - } - return r = u + " - -` + _ + f + F + ` - -` + r.trim() + ` - -`, r = o.converter._dispatch("completeHTMLDocument.after", r, s, o), r; - }), a.subParser("detab", function(r, s, o) { - return r = o.converter._dispatch("detab.before", r, s, o), r = r.replace(/\t(?=\t)/g, " "), r = r.replace(/\t/g, "¨A¨B"), r = r.replace(/¨B(.+?)¨A/g, function(c, u) { - for (var _ = u, f = 4 - _.length % 4, j = 0; j < f; j++) - _ += " "; - return _; - }), r = r.replace(/¨A/g, " "), r = r.replace(/¨B/g, ""), r = o.converter._dispatch("detab.after", r, s, o), r; - }), a.subParser("ellipsis", function(r, s, o) { - return s.ellipsis && (r = o.converter._dispatch("ellipsis.before", r, s, o), r = r.replace(/\.\.\./g, "…"), r = o.converter._dispatch("ellipsis.after", r, s, o)), r; - }), a.subParser("emoji", function(r, s, o) { - if (!s.emoji) - return r; - r = o.converter._dispatch("emoji.before", r, s, o); - var c = /:([\S]+?):/g; - return r = r.replace(c, function(u, _) { - return a.helper.emojis.hasOwnProperty(_) ? a.helper.emojis[_] : u; - }), r = o.converter._dispatch("emoji.after", r, s, o), r; - }), a.subParser("encodeAmpsAndAngles", function(r, s, o) { - return r = o.converter._dispatch("encodeAmpsAndAngles.before", r, s, o), r = r.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"), r = r.replace(/<(?![a-z\/?$!])/gi, "<"), r = r.replace(//g, ">"), r = o.converter._dispatch("encodeAmpsAndAngles.after", r, s, o), r; - }), a.subParser("encodeBackslashEscapes", function(r, s, o) { - return r = o.converter._dispatch("encodeBackslashEscapes.before", r, s, o), r = r.replace(/\\(\\)/g, a.helper.escapeCharactersCallback), r = r.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g, a.helper.escapeCharactersCallback), r = o.converter._dispatch("encodeBackslashEscapes.after", r, s, o), r; - }), a.subParser("encodeCode", function(r, s, o) { - return r = o.converter._dispatch("encodeCode.before", r, s, o), r = r.replace(/&/g, "&").replace(//g, ">").replace(/([*_{}\[\]\\=~-])/g, a.helper.escapeCharactersCallback), r = o.converter._dispatch("encodeCode.after", r, s, o), r; - }), a.subParser("escapeSpecialCharsWithinTagAttributes", function(r, s, o) { - r = o.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", r, s, o); - var c = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, u = /-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; - return r = r.replace(c, function(_) { - return _.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, a.helper.escapeCharactersCallback); - }), r = r.replace(u, function(_) { - return _.replace(/([\\`*_~=|])/g, a.helper.escapeCharactersCallback); - }), r = o.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", r, s, o), r; - }), a.subParser("githubCodeBlocks", function(r, s, o) { - return s.ghCodeBlocks ? (r = o.converter._dispatch("githubCodeBlocks.before", r, s, o), r += "¨0", r = r.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(c, u, _, f) { - var j = s.omitExtraWLInCodeBlocks ? "" : ` -`; - return f = a.subParser("encodeCode")(f, s, o), f = a.subParser("detab")(f, s, o), f = f.replace(/^\n+/g, ""), f = f.replace(/\n+$/g, ""), f = "
" + f + j + "
", f = a.subParser("hashBlock")(f, s, o), ` - -¨G` + (o.ghCodeBlocks.push({ text: c, codeblock: f }) - 1) + `G - -`; - }), r = r.replace(/¨0/, ""), o.converter._dispatch("githubCodeBlocks.after", r, s, o)) : r; - }), a.subParser("hashBlock", function(r, s, o) { - return r = o.converter._dispatch("hashBlock.before", r, s, o), r = r.replace(/(^\n+|\n+$)/g, ""), r = ` - -¨K` + (o.gHtmlBlocks.push(r) - 1) + `K - -`, r = o.converter._dispatch("hashBlock.after", r, s, o), r; - }), a.subParser("hashCodeTags", function(r, s, o) { - r = o.converter._dispatch("hashCodeTags.before", r, s, o); - var c = function(u, _, f, j) { - var F = f + a.subParser("encodeCode")(_, s, o) + j; - return "¨C" + (o.gHtmlSpans.push(F) - 1) + "C"; - }; - return r = a.helper.replaceRecursiveRegExp(r, c, "]*>", "", "gim"), r = o.converter._dispatch("hashCodeTags.after", r, s, o), r; - }), a.subParser("hashElement", function(r, s, o) { - return function(c, u) { - var _ = u; - return _ = _.replace(/\n\n/g, ` -`), _ = _.replace(/^\n/, ""), _ = _.replace(/\n+$/g, ""), _ = ` - -¨K` + (o.gHtmlBlocks.push(_) - 1) + `K - -`, _; - }; - }), a.subParser("hashHTMLBlocks", function(r, s, o) { - r = o.converter._dispatch("hashHTMLBlocks.before", r, s, o); - var c = [ - "pre", - "div", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "blockquote", - "table", - "dl", - "ol", - "ul", - "script", - "noscript", - "form", - "fieldset", - "iframe", - "math", - "style", - "section", - "header", - "footer", - "nav", - "article", - "aside", - "address", - "audio", - "canvas", - "figure", - "hgroup", - "output", - "video", - "p" - ], u = function(w, G, Q, ee) { - var q = w; - return Q.search(/\bmarkdown\b/) !== -1 && (q = Q + o.converter.makeHtml(G) + ee), ` - -¨K` + (o.gHtmlBlocks.push(q) - 1) + `K - -`; - }; - s.backslashEscapesHTMLTags && (r = r.replace(/\\<(\/?[^>]+?)>/g, function(w, G) { - return "<" + G + ">"; - })); - for (var _ = 0; _ < c.length; ++_) - for (var f, j = new RegExp("^ {0,3}(<" + c[_] + "\\b[^>]*>)", "im"), F = "<" + c[_] + "\\b[^>]*>", U = ""; (f = a.helper.regexIndexOf(r, j)) !== -1; ) { - var D = a.helper.splitAtIndex(r, f), W = a.helper.replaceRecursiveRegExp(D[1], u, F, U, "im"); - if (W === D[1]) - break; - r = D[0].concat(W); - } - return r = r.replace( - /(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, - a.subParser("hashElement")(r, s, o) - ), r = a.helper.replaceRecursiveRegExp(r, function(w) { - return ` - -¨K` + (o.gHtmlBlocks.push(w) - 1) + `K - -`; - }, "^ {0,3}", "gm"), r = r.replace( - /(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, - a.subParser("hashElement")(r, s, o) - ), r = o.converter._dispatch("hashHTMLBlocks.after", r, s, o), r; - }), a.subParser("hashHTMLSpans", function(r, s, o) { - r = o.converter._dispatch("hashHTMLSpans.before", r, s, o); - function c(u) { - return "¨C" + (o.gHtmlSpans.push(u) - 1) + "C"; - } - return r = r.replace(/<[^>]+?\/>/gi, function(u) { - return c(u); - }), r = r.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function(u) { - return c(u); - }), r = r.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function(u) { - return c(u); - }), r = r.replace(/<[^>]+?>/gi, function(u) { - return c(u); - }), r = o.converter._dispatch("hashHTMLSpans.after", r, s, o), r; - }), a.subParser("unhashHTMLSpans", function(r, s, o) { - r = o.converter._dispatch("unhashHTMLSpans.before", r, s, o); - for (var c = 0; c < o.gHtmlSpans.length; ++c) { - for (var u = o.gHtmlSpans[c], _ = 0; /¨C(\d+)C/.test(u); ) { - var f = RegExp.$1; - if (u = u.replace("¨C" + f + "C", o.gHtmlSpans[f]), _ === 10) { - console.error("maximum nesting of 10 spans reached!!!"); - break; - } - ++_; - } - r = r.replace("¨C" + c + "C", u); - } - return r = o.converter._dispatch("unhashHTMLSpans.after", r, s, o), r; - }), a.subParser("hashPreCodeTags", function(r, s, o) { - r = o.converter._dispatch("hashPreCodeTags.before", r, s, o); - var c = function(u, _, f, j) { - var F = f + a.subParser("encodeCode")(_, s, o) + j; - return ` - -¨G` + (o.ghCodeBlocks.push({ text: u, codeblock: F }) - 1) + `G - -`; - }; - return r = a.helper.replaceRecursiveRegExp(r, c, "^ {0,3}]*>\\s*]*>", "^ {0,3}\\s*
", "gim"), r = o.converter._dispatch("hashPreCodeTags.after", r, s, o), r; - }), a.subParser("headers", function(r, s, o) { - r = o.converter._dispatch("headers.before", r, s, o); - var c = isNaN(parseInt(s.headerLevelStart)) ? 1 : parseInt(s.headerLevelStart), u = s.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, _ = s.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm; - r = r.replace(u, function(F, U) { - var D = a.subParser("spanGamut")(U, s, o), W = s.noHeaderId ? "" : ' id="' + j(U) + '"', w = c, G = "" + D + ""; - return a.subParser("hashBlock")(G, s, o); - }), r = r.replace(_, function(F, U) { - var D = a.subParser("spanGamut")(U, s, o), W = s.noHeaderId ? "" : ' id="' + j(U) + '"', w = c + 1, G = "" + D + ""; - return a.subParser("hashBlock")(G, s, o); - }); - var f = s.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm; - r = r.replace(f, function(F, U, D) { - var W = D; - s.customizedHeaderId && (W = D.replace(/\s?\{([^{]+?)}\s*$/, "")); - var w = a.subParser("spanGamut")(W, s, o), G = s.noHeaderId ? "" : ' id="' + j(D) + '"', Q = c - 1 + U.length, ee = "" + w + ""; - return a.subParser("hashBlock")(ee, s, o); - }); - function j(F) { - var U, D; - if (s.customizedHeaderId) { - var W = F.match(/\{([^{]+?)}\s*$/); - W && W[1] && (F = W[1]); - } - return U = F, a.helper.isString(s.prefixHeaderId) ? D = s.prefixHeaderId : s.prefixHeaderId === !0 ? D = "section-" : D = "", s.rawPrefixHeaderId || (U = D + U), s.ghCompatibleHeaderId ? U = U.replace(/ /g, "-").replace(/&/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase() : s.rawHeaderId ? U = U.replace(/ /g, "-").replace(/&/g, "&").replace(/¨T/g, "¨").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase() : U = U.replace(/[^\w]/g, "").toLowerCase(), s.rawPrefixHeaderId && (U = D + U), o.hashLinkCounts[U] ? U = U + "-" + o.hashLinkCounts[U]++ : o.hashLinkCounts[U] = 1, U; - } - return r = o.converter._dispatch("headers.after", r, s, o), r; - }), a.subParser("horizontalRule", function(r, s, o) { - r = o.converter._dispatch("horizontalRule.before", r, s, o); - var c = a.subParser("hashBlock")("
", s, o); - return r = r.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, c), r = r.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, c), r = r.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, c), r = o.converter._dispatch("horizontalRule.after", r, s, o), r; - }), a.subParser("images", function(r, s, o) { - r = o.converter._dispatch("images.before", r, s, o); - var c = /!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, u = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, _ = /!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, f = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, j = /!\[([^\[\]]+)]()()()()()/g; - function F(D, W, w, G, Q, ee, q, P) { - return G = G.replace(/\s/g, ""), U(D, W, w, G, Q, ee, q, P); - } - function U(D, W, w, G, Q, ee, q, P) { - var H = o.gUrls, N = o.gTitles, d = o.gDimensions; - if (w = w.toLowerCase(), P || (P = ""), D.search(/\(? ?(['"].*['"])?\)$/m) > -1) - G = ""; - else if (G === "" || G === null) - if ((w === "" || w === null) && (w = W.toLowerCase().replace(/ ?\n/g, " ")), G = "#" + w, !a.helper.isUndefined(H[w])) - G = H[w], a.helper.isUndefined(N[w]) || (P = N[w]), a.helper.isUndefined(d[w]) || (Q = d[w].width, ee = d[w].height); - else - return D; - W = W.replace(/"/g, """).replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback), G = G.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var y = '' + W + '", "
"); - }), r = r.replace(/\b__(\S[\s\S]*?)__\b/g, function(u, _) { - return c(_, "", ""); - }), r = r.replace(/\b_(\S[\s\S]*?)_\b/g, function(u, _) { - return c(_, "", ""); - })) : (r = r.replace(/___(\S[\s\S]*?)___/g, function(u, _) { - return /\S$/.test(_) ? c(_, "", "") : u; - }), r = r.replace(/__(\S[\s\S]*?)__/g, function(u, _) { - return /\S$/.test(_) ? c(_, "", "") : u; - }), r = r.replace(/_([^\s_][\s\S]*?)_/g, function(u, _) { - return /\S$/.test(_) ? c(_, "", "") : u; - })), s.literalMidWordAsterisks ? (r = r.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(u, _, f) { - return c(f, _ + "", ""); - }), r = r.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(u, _, f) { - return c(f, _ + "", ""); - }), r = r.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(u, _, f) { - return c(f, _ + "", ""); - })) : (r = r.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(u, _) { - return /\S$/.test(_) ? c(_, "", "") : u; - }), r = r.replace(/\*\*(\S[\s\S]*?)\*\*/g, function(u, _) { - return /\S$/.test(_) ? c(_, "", "") : u; - }), r = r.replace(/\*([^\s*][\s\S]*?)\*/g, function(u, _) { - return /\S$/.test(_) ? c(_, "", "") : u; - })), r = o.converter._dispatch("italicsAndBold.after", r, s, o), r; - }), a.subParser("lists", function(r, s, o) { - function c(f, j) { - o.gListLevel++, f = f.replace(/\n{2,}$/, ` -`), f += "¨0"; - var F = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, U = /\n[ \t]*\n(?!¨0)/.test(f); - return s.disableForced4SpacesIndentedSublists && (F = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm), f = f.replace(F, function(D, W, w, G, Q, ee, q) { - q = q && q.trim() !== ""; - var P = a.subParser("outdent")(Q, s, o), H = ""; - return ee && s.tasklists && (H = ' class="task-list-item" style="list-style-type: none;"', P = P.replace(/^[ \t]*\[(x|X| )?]/m, function() { - var N = ' -1 ? (P = a.subParser("githubCodeBlocks")(P, s, o), P = a.subParser("blockGamut")(P, s, o)) : (P = a.subParser("lists")(P, s, o), P = P.replace(/\n$/, ""), P = a.subParser("hashHTMLBlocks")(P, s, o), P = P.replace(/\n\n+/g, ` - -`), U ? P = a.subParser("paragraphs")(P, s, o) : P = a.subParser("spanGamut")(P, s, o)), P = P.replace("¨A", ""), P = "" + P + ` -`, P; - }), f = f.replace(/¨0/g, ""), o.gListLevel--, j && (f = f.replace(/\s+$/, "")), f; - } - function u(f, j) { - if (j === "ol") { - var F = f.match(/^ *(\d+)\./); - if (F && F[1] !== "1") - return ' start="' + F[1] + '"'; - } - return ""; - } - function _(f, j, F) { - var U = s.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, D = s.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, W = j === "ul" ? U : D, w = ""; - if (f.search(W) !== -1) - (function Q(ee) { - var q = ee.search(W), P = u(f, j); - q !== -1 ? (w += ` - -<` + j + P + `> -` + c(ee.slice(0, q), !!F) + " -`, j = j === "ul" ? "ol" : "ul", W = j === "ul" ? U : D, Q(ee.slice(q))) : w += ` - -<` + j + P + `> -` + c(ee, !!F) + " -`; - })(f); - else { - var G = u(f, j); - w = ` - -<` + j + G + `> -` + c(f, !!F) + " -`; - } - return w; - } - return r = o.converter._dispatch("lists.before", r, s, o), r += "¨0", o.gListLevel ? r = r.replace( - /^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, - function(f, j, F) { - var U = F.search(/[*+-]/g) > -1 ? "ul" : "ol"; - return _(j, U, !0); - } - ) : r = r.replace( - /(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, - function(f, j, F, U) { - var D = U.search(/[*+-]/g) > -1 ? "ul" : "ol"; - return _(F, D, !1); - } - ), r = r.replace(/¨0/, ""), r = o.converter._dispatch("lists.after", r, s, o), r; - }), a.subParser("metadata", function(r, s, o) { - if (!s.metadata) - return r; - r = o.converter._dispatch("metadata.before", r, s, o); - function c(u) { - o.metadata.raw = u, u = u.replace(/&/g, "&").replace(/"/g, """), u = u.replace(/\n {4}/g, " "), u.replace(/^([\S ]+): +([\s\S]+?)$/gm, function(_, f, j) { - return o.metadata.parsed[f] = j, ""; - }); - } - return r = r.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(u, _, f) { - return c(f), "¨M"; - }), r = r.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(u, _, f) { - return _ && (o.metadata.format = _), c(f), "¨M"; - }), r = r.replace(/¨M/g, ""), r = o.converter._dispatch("metadata.after", r, s, o), r; - }), a.subParser("outdent", function(r, s, o) { - return r = o.converter._dispatch("outdent.before", r, s, o), r = r.replace(/^(\t|[ ]{1,4})/gm, "¨0"), r = r.replace(/¨0/g, ""), r = o.converter._dispatch("outdent.after", r, s, o), r; - }), a.subParser("paragraphs", function(r, s, o) { - r = o.converter._dispatch("paragraphs.before", r, s, o), r = r.replace(/^\n+/g, ""), r = r.replace(/\n+$/g, ""); - for (var c = r.split(/\n{2,}/g), u = [], _ = c.length, f = 0; f < _; f++) { - var j = c[f]; - j.search(/¨(K|G)(\d+)\1/g) >= 0 ? u.push(j) : j.search(/\S/) >= 0 && (j = a.subParser("spanGamut")(j, s, o), j = j.replace(/^([ \t]*)/g, "

"), j += "

", u.push(j)); - } - for (_ = u.length, f = 0; f < _; f++) { - for (var F = "", U = u[f], D = !1; /¨(K|G)(\d+)\1/.test(U); ) { - var W = RegExp.$1, w = RegExp.$2; - W === "K" ? F = o.gHtmlBlocks[w] : D ? F = a.subParser("encodeCode")(o.ghCodeBlocks[w].text, s, o) : F = o.ghCodeBlocks[w].codeblock, F = F.replace(/\$/g, "$$$$"), U = U.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, F), /^]*>\s*]*>/.test(U) && (D = !0); - } - u[f] = U; - } - return r = u.join(` -`), r = r.replace(/^\n+/g, ""), r = r.replace(/\n+$/g, ""), o.converter._dispatch("paragraphs.after", r, s, o); - }), a.subParser("runExtension", function(r, s, o, c) { - if (r.filter) - s = r.filter(s, c.converter, o); - else if (r.regex) { - var u = r.regex; - u instanceof RegExp || (u = new RegExp(u, "g")), s = s.replace(u, r.replace); - } - return s; - }), a.subParser("spanGamut", function(r, s, o) { - return r = o.converter._dispatch("spanGamut.before", r, s, o), r = a.subParser("codeSpans")(r, s, o), r = a.subParser("escapeSpecialCharsWithinTagAttributes")(r, s, o), r = a.subParser("encodeBackslashEscapes")(r, s, o), r = a.subParser("images")(r, s, o), r = a.subParser("anchors")(r, s, o), r = a.subParser("autoLinks")(r, s, o), r = a.subParser("simplifiedAutoLinks")(r, s, o), r = a.subParser("emoji")(r, s, o), r = a.subParser("underline")(r, s, o), r = a.subParser("italicsAndBold")(r, s, o), r = a.subParser("strikethrough")(r, s, o), r = a.subParser("ellipsis")(r, s, o), r = a.subParser("hashHTMLSpans")(r, s, o), r = a.subParser("encodeAmpsAndAngles")(r, s, o), s.simpleLineBreaks ? /\n\n¨K/.test(r) || (r = r.replace(/\n+/g, `
-`)) : r = r.replace(/ +\n/g, `
-`), r = o.converter._dispatch("spanGamut.after", r, s, o), r; - }), a.subParser("strikethrough", function(r, s, o) { - function c(u) { - return s.simplifiedAutoLink && (u = a.subParser("simplifiedAutoLinks")(u, s, o)), "" + u + ""; - } - return s.strikethrough && (r = o.converter._dispatch("strikethrough.before", r, s, o), r = r.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(u, _) { - return c(_); - }), r = o.converter._dispatch("strikethrough.after", r, s, o)), r; - }), a.subParser("stripLinkDefinitions", function(r, s, o) { - var c = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, u = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm; - r += "¨0"; - var _ = function(f, j, F, U, D, W, w) { - return j = j.toLowerCase(), r.toLowerCase().split(j).length - 1 < 2 ? f : (F.match(/^data:.+?\/.+?;base64,/) ? o.gUrls[j] = F.replace(/\s/g, "") : o.gUrls[j] = a.subParser("encodeAmpsAndAngles")(F, s, o), W ? W + w : (w && (o.gTitles[j] = w.replace(/"|'/g, """)), s.parseImgDimensions && U && D && (o.gDimensions[j] = { - width: U, - height: D - }), "")); - }; - return r = r.replace(u, _), r = r.replace(c, _), r = r.replace(/¨0/, ""), r; - }), a.subParser("tables", function(r, s, o) { - if (!s.tables) - return r; - var c = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, u = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm; - function _(D) { - return /^:[ \t]*--*$/.test(D) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(D) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(D) ? ' style="text-align:center;"' : ""; - } - function f(D, W) { - var w = ""; - return D = D.trim(), (s.tablesHeaderId || s.tableHeaderId) && (w = ' id="' + D.replace(/ /g, "_").toLowerCase() + '"'), D = a.subParser("spanGamut")(D, s, o), "" + D + ` -`; - } - function j(D, W) { - var w = a.subParser("spanGamut")(D, s, o); - return "" + w + ` -`; - } - function F(D, W) { - for (var w = ` - - -`, G = D.length, Q = 0; Q < G; ++Q) - w += D[Q]; - for (w += ` - - -`, Q = 0; Q < W.length; ++Q) { - w += ` -`; - for (var ee = 0; ee < G; ++ee) - w += W[Q][ee]; - w += ` -`; - } - return w += ` -
-`, w; - } - function U(D) { - var W, w = D.split(` -`); - for (W = 0; W < w.length; ++W) - /^ {0,3}\|/.test(w[W]) && (w[W] = w[W].replace(/^ {0,3}\|/, "")), /\|[ \t]*$/.test(w[W]) && (w[W] = w[W].replace(/\|[ \t]*$/, "")), w[W] = a.subParser("codeSpans")(w[W], s, o); - var G = w[0].split("|").map(function(y) { - return y.trim(); - }), Q = w[1].split("|").map(function(y) { - return y.trim(); - }), ee = [], q = [], P = [], H = []; - for (w.shift(), w.shift(), W = 0; W < w.length; ++W) - w[W].trim() !== "" && ee.push( - w[W].split("|").map(function(y) { - return y.trim(); - }) - ); - if (G.length < Q.length) - return D; - for (W = 0; W < Q.length; ++W) - P.push(_(Q[W])); - for (W = 0; W < G.length; ++W) - a.helper.isUndefined(P[W]) && (P[W] = ""), q.push(f(G[W], P[W])); - for (W = 0; W < ee.length; ++W) { - for (var N = [], d = 0; d < q.length; ++d) - a.helper.isUndefined(ee[W][d]), N.push(j(ee[W][d], P[d])); - H.push(N); - } - return F(q, H); - } - return r = o.converter._dispatch("tables.before", r, s, o), r = r.replace(/\\(\|)/g, a.helper.escapeCharactersCallback), r = r.replace(c, U), r = r.replace(u, U), r = o.converter._dispatch("tables.after", r, s, o), r; - }), a.subParser("underline", function(r, s, o) { - return s.underline && (r = o.converter._dispatch("underline.before", r, s, o), s.literalMidWordUnderscores ? (r = r.replace(/\b___(\S[\s\S]*?)___\b/g, function(c, u) { - return "" + u + ""; - }), r = r.replace(/\b__(\S[\s\S]*?)__\b/g, function(c, u) { - return "" + u + ""; - })) : (r = r.replace(/___(\S[\s\S]*?)___/g, function(c, u) { - return /\S$/.test(u) ? "" + u + "" : c; - }), r = r.replace(/__(\S[\s\S]*?)__/g, function(c, u) { - return /\S$/.test(u) ? "" + u + "" : c; - })), r = r.replace(/(_)/g, a.helper.escapeCharactersCallback), r = o.converter._dispatch("underline.after", r, s, o)), r; - }), a.subParser("unescapeSpecialChars", function(r, s, o) { - return r = o.converter._dispatch("unescapeSpecialChars.before", r, s, o), r = r.replace(/¨E(\d+)E/g, function(c, u) { - var _ = parseInt(u); - return String.fromCharCode(_); - }), r = o.converter._dispatch("unescapeSpecialChars.after", r, s, o), r; - }), a.subParser("makeMarkdown.blockquote", function(r, s) { - var o = ""; - if (r.hasChildNodes()) - for (var c = r.childNodes, u = c.length, _ = 0; _ < u; ++_) { - var f = a.subParser("makeMarkdown.node")(c[_], s); - f !== "" && (o += f); - } - return o = o.trim(), o = "> " + o.split(` -`).join(` -> `), o; - }), a.subParser("makeMarkdown.codeBlock", function(r, s) { - var o = r.getAttribute("language"), c = r.getAttribute("precodenum"); - return "```" + o + ` -` + s.preList[c] + "\n```"; - }), a.subParser("makeMarkdown.codeSpan", function(r) { - return "`" + r.innerHTML + "`"; - }), a.subParser("makeMarkdown.emphasis", function(r, s) { - var o = ""; - if (r.hasChildNodes()) { - o += "*"; - for (var c = r.childNodes, u = c.length, _ = 0; _ < u; ++_) - o += a.subParser("makeMarkdown.node")(c[_], s); - o += "*"; - } - return o; - }), a.subParser("makeMarkdown.header", function(r, s, o) { - var c = new Array(o + 1).join("#"), u = ""; - if (r.hasChildNodes()) { - u = c + " "; - for (var _ = r.childNodes, f = _.length, j = 0; j < f; ++j) - u += a.subParser("makeMarkdown.node")(_[j], s); - } - return u; - }), a.subParser("makeMarkdown.hr", function() { - return "---"; - }), a.subParser("makeMarkdown.image", function(r) { - var s = ""; - return r.hasAttribute("src") && (s += "![" + r.getAttribute("alt") + "](", s += "<" + r.getAttribute("src") + ">", r.hasAttribute("width") && r.hasAttribute("height") && (s += " =" + r.getAttribute("width") + "x" + r.getAttribute("height")), r.hasAttribute("title") && (s += ' "' + r.getAttribute("title") + '"'), s += ")"), s; - }), a.subParser("makeMarkdown.links", function(r, s) { - var o = ""; - if (r.hasChildNodes() && r.hasAttribute("href")) { - var c = r.childNodes, u = c.length; - o = "["; - for (var _ = 0; _ < u; ++_) - o += a.subParser("makeMarkdown.node")(c[_], s); - o += "](", o += "<" + r.getAttribute("href") + ">", r.hasAttribute("title") && (o += ' "' + r.getAttribute("title") + '"'), o += ")"; - } - return o; - }), a.subParser("makeMarkdown.list", function(r, s, o) { - var c = ""; - if (!r.hasChildNodes()) - return ""; - for (var u = r.childNodes, _ = u.length, f = r.getAttribute("start") || 1, j = 0; j < _; ++j) - if (!(typeof u[j].tagName > "u" || u[j].tagName.toLowerCase() !== "li")) { - var F = ""; - o === "ol" ? F = f.toString() + ". " : F = "- ", c += F + a.subParser("makeMarkdown.listItem")(u[j], s), ++f; - } - return c += ` - -`, c.trim(); - }), a.subParser("makeMarkdown.listItem", function(r, s) { - for (var o = "", c = r.childNodes, u = c.length, _ = 0; _ < u; ++_) - o += a.subParser("makeMarkdown.node")(c[_], s); - return /\n$/.test(o) ? o = o.split(` -`).join(` - `).replace(/^ {4}$/gm, "").replace(/\n\n+/g, ` - -`) : o += ` -`, o; - }), a.subParser("makeMarkdown.node", function(r, s, o) { - o = o || !1; - var c = ""; - if (r.nodeType === 3) - return a.subParser("makeMarkdown.txt")(r, s); - if (r.nodeType === 8) - return " - -`; - if (r.nodeType !== 1) - return ""; - var u = r.tagName.toLowerCase(); - switch (u) { - case "h1": - o || (c = a.subParser("makeMarkdown.header")(r, s, 1) + ` - -`); - break; - case "h2": - o || (c = a.subParser("makeMarkdown.header")(r, s, 2) + ` - -`); - break; - case "h3": - o || (c = a.subParser("makeMarkdown.header")(r, s, 3) + ` - -`); - break; - case "h4": - o || (c = a.subParser("makeMarkdown.header")(r, s, 4) + ` - -`); - break; - case "h5": - o || (c = a.subParser("makeMarkdown.header")(r, s, 5) + ` - -`); - break; - case "h6": - o || (c = a.subParser("makeMarkdown.header")(r, s, 6) + ` - -`); - break; - case "p": - o || (c = a.subParser("makeMarkdown.paragraph")(r, s) + ` - -`); - break; - case "blockquote": - o || (c = a.subParser("makeMarkdown.blockquote")(r, s) + ` - -`); - break; - case "hr": - o || (c = a.subParser("makeMarkdown.hr")(r, s) + ` - -`); - break; - case "ol": - o || (c = a.subParser("makeMarkdown.list")(r, s, "ol") + ` - -`); - break; - case "ul": - o || (c = a.subParser("makeMarkdown.list")(r, s, "ul") + ` - -`); - break; - case "precode": - o || (c = a.subParser("makeMarkdown.codeBlock")(r, s) + ` - -`); - break; - case "pre": - o || (c = a.subParser("makeMarkdown.pre")(r, s) + ` - -`); - break; - case "table": - o || (c = a.subParser("makeMarkdown.table")(r, s) + ` - -`); - break; - case "code": - c = a.subParser("makeMarkdown.codeSpan")(r, s); - break; - case "em": - case "i": - c = a.subParser("makeMarkdown.emphasis")(r, s); - break; - case "strong": - case "b": - c = a.subParser("makeMarkdown.strong")(r, s); - break; - case "del": - c = a.subParser("makeMarkdown.strikethrough")(r, s); - break; - case "a": - c = a.subParser("makeMarkdown.links")(r, s); - break; - case "img": - c = a.subParser("makeMarkdown.image")(r, s); - break; - default: - c = r.outerHTML + ` - -`; - } - return c; - }), a.subParser("makeMarkdown.paragraph", function(r, s) { - var o = ""; - if (r.hasChildNodes()) - for (var c = r.childNodes, u = c.length, _ = 0; _ < u; ++_) - o += a.subParser("makeMarkdown.node")(c[_], s); - return o = o.trim(), o; - }), a.subParser("makeMarkdown.pre", function(r, s) { - var o = r.getAttribute("prenum"); - return "
" + s.preList[o] + "
"; - }), a.subParser("makeMarkdown.strikethrough", function(r, s) { - var o = ""; - if (r.hasChildNodes()) { - o += "~~"; - for (var c = r.childNodes, u = c.length, _ = 0; _ < u; ++_) - o += a.subParser("makeMarkdown.node")(c[_], s); - o += "~~"; - } - return o; - }), a.subParser("makeMarkdown.strong", function(r, s) { - var o = ""; - if (r.hasChildNodes()) { - o += "**"; - for (var c = r.childNodes, u = c.length, _ = 0; _ < u; ++_) - o += a.subParser("makeMarkdown.node")(c[_], s); - o += "**"; - } - return o; - }), a.subParser("makeMarkdown.table", function(r, s) { - var o = "", c = [[], []], u = r.querySelectorAll("thead>tr>th"), _ = r.querySelectorAll("tbody>tr"), f, j; - for (f = 0; f < u.length; ++f) { - var F = a.subParser("makeMarkdown.tableCell")(u[f], s), U = "---"; - if (u[f].hasAttribute("style")) { - var D = u[f].getAttribute("style").toLowerCase().replace(/\s/g, ""); - switch (D) { - case "text-align:left;": - U = ":---"; - break; - case "text-align:right;": - U = "---:"; - break; - case "text-align:center;": - U = ":---:"; - break; - } - } - c[0][f] = F.trim(), c[1][f] = U; - } - for (f = 0; f < _.length; ++f) { - var W = c.push([]) - 1, w = _[f].getElementsByTagName("td"); - for (j = 0; j < u.length; ++j) { - var G = " "; - typeof w[j] < "u" && (G = a.subParser("makeMarkdown.tableCell")(w[j], s)), c[W].push(G); - } - } - var Q = 3; - for (f = 0; f < c.length; ++f) - for (j = 0; j < c[f].length; ++j) { - var ee = c[f][j].length; - ee > Q && (Q = ee); - } - for (f = 0; f < c.length; ++f) { - for (j = 0; j < c[f].length; ++j) - f === 1 ? c[f][j].slice(-1) === ":" ? c[f][j] = a.helper.padEnd(c[f][j].slice(-1), Q - 1, "-") + ":" : c[f][j] = a.helper.padEnd(c[f][j], Q, "-") : c[f][j] = a.helper.padEnd(c[f][j], Q); - o += "| " + c[f].join(" | ") + ` | -`; - } - return o.trim(); - }), a.subParser("makeMarkdown.tableCell", function(r, s) { - var o = ""; - if (!r.hasChildNodes()) - return ""; - for (var c = r.childNodes, u = c.length, _ = 0; _ < u; ++_) - o += a.subParser("makeMarkdown.node")(c[_], s, !0); - return o.trim(); - }), a.subParser("makeMarkdown.txt", function(r) { - var s = r.nodeValue; - return s = s.replace(/ +/g, " "), s = s.replace(/¨NBSP;/g, " "), s = a.helper.unescapeHTMLEntities(s), s = s.replace(/([*_~|`])/g, "\\$1"), s = s.replace(/^(\s*)>/g, "\\$1>"), s = s.replace(/^#/gm, "\\#"), s = s.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3"), s = s.replace(/^( {0,3}\d+)\./gm, "$1\\."), s = s.replace(/^( {0,3})([+-])/gm, "$1\\$2"), s = s.replace(/]([\s]*)\(/g, "\\]$1\\("), s = s.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:"), s; - }); - var L = this; - e.exports ? e.exports = a : L.showdown = a; - }).call(gn); -})(Kn); -var Hc = Kn.exports; -const pn = /* @__PURE__ */ _n(Hc); -class fn { - constructor() { - xe(this, "logger"), xe(this, "converter"), this.logger = Pa.zhiLog("showdown-adaptor"), this.converter = new pn.Converter(); - } - isAvailable() { - return typeof pn < "u"; - } - renderMarkdownStr(t) { - if (!this.isAvailable()) - throw new Error("Showdown is not available"); - return this.logger.info("Showdown is rendering md to HTML..."), Promise.resolve(this.converter.makeHtml(t)); - } -} -class Gn { - constructor() { - xe(this, "logger"), xe(this, "mdAdaptor", new fn()), this.logger = Pa.zhiLog("markdown-util"); - } - /** - * 获取当前 MD 解析器名称 - */ - getCurrentAdaptorName() { - return this.mdAdaptor instanceof hn ? "Lute" : this.mdAdaptor instanceof fn ? "Showdown" : "None"; - } - /** - * 渲染Markdown - * - * @param md - Markdown文本 - */ - async renderHTML(t) { - const n = new hn(); - return this.logger.debug("Lute status =>", n.isAvailable()), n.isAvailable() && (this.mdAdaptor = n), this.logger.info(`Using ${this.getCurrentAdaptorName()} as markdown renderer`), await this.mdAdaptor.renderMarkdownStr(t); - } -} -class Kc { - constructor() { - xe(this, "mdUtil"), this.mdUtil = new Gn(); - } - /** - * 移除标题数字 - * - * @param str - 字符串 - */ - removeTitleNumber(t) { - let n = t; - const a = /([0-9]*)\./; - return n = n.replace(a, ""), n; - } - /** - * 删除挂件的HTML - * - * @param str - 原字符 - */ - removeWidgetTag(t) { - let n = t.toString(); - const a = //g; - n = n.replace(a, ""); - const i = //g; - n = n.replace(i, ""); - const l = //g; - return n = n.replace(l, ""), n; - } - /** - * 删除Markdown文本的挂件的HTML - * - * @param str - 原字符 - */ - removeMdWidgetTag(t) { - let n = t.toString(); - return n = this.removeWidgetTag(n), n; - } - /** - * 去除html标签,残缺不全也可以 - * - * @param str - 字符串 - */ - filterHtml(t) { - t = t.replace(//g, ""), t = t.replace(//g, ""), t = t.replace(/<[^>]*>/g, ""), t = t.replace(/&.*;/g, ""), t = t.replace(/(^\s*)|(\s*$)/g, ""), t = t.replace(//g, ""), t = t.replace(/"/g, "").replace(/'/g, ""), t = t.replace(/\*/g, ""), t = t.replace(/\$/g, ""), t = t.replace(/\./g, ""), t = t.replace(/\+/g, ""), t = t.replace(/\s+/g, ""), t = t.replace(/[:|:]/g, "_"), t = t.replace(/[;|;]/g, "_"), t = t.replace(/\^/g, "_"), t = t.replace(/!/g, "_"), t = t.replace(/@/g, "at_"); - const n = ["\\d*/\\d/\\d*", "[、|\\\\]", "[,|,]", "\\d", "/", "-"]; - for (let a = 0; a < n.length; a++) { - const i = new RegExp(n[a], "g"); - t = t.replace(i, ""); - } - return t = t.toLowerCase(), t; - } - /** - * 截取指定长度html - * - * @param html - html - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - parseHtml(t, n, a) { - const i = this.filterHtml(t); - return i.length < n ? i : a === !0 ? i.substring(0, n) : i.substring(0, n) + "..."; - } - /** - * 将Markdown转换为HTML - * - * @param md - Markdown - */ - async mdToHtml(t) { - const n = await this.mdUtil.renderHTML(t); - return this.removeWidgetTag(n); - } - /** - * 将Markdown转换为纯文本 - * - * @param md - Markdown - */ - async mdToPlainText(t) { - const n = await this.mdToHtml(t); - return this.filterHtml(n); - } - /** - * 移除H1标签 - * - * @param html - html - */ - removeH1(t) { - let n = t; - const a = //g; - return n = n.replace(a, ""), n; - } - /** - * 移除Markdown里面的H1标签 - * - * JavaScript 正则表达式可以用来删除所有 Markdown 中的 h1 标签。下面是一个示例代码: - * - * const str = "# This is an H1\n## This is an H2\n### This is an H3"; - * - * const regex = /^# .*$/gm; - * const result = str.replace(regex, ''); - * - * console.log(result); - * 在这个例子中,我们使用正则表达式 /^# .*$/gm 来匹配所有的 h1 标签。 - * 在 JavaScript 中,^ 匹配行首,# 匹配 # 字符,.* 匹配任意字符,$ 匹配行尾,m 标记表示多行模式。 - */ - removeMdH1(t) { - let n = t; - const a = /^# .*$/gm; - return n = n.replace(a, ""), n; - } -} -class Gc { - /** - * 检测是否是空对象 - * - * @param obj - 对象 - */ - isEmptyObject(t) { - return t ? Object.getPrototypeOf(t) === Object.prototype && Object.getOwnPropertyNames(t).length === 0 && Object.getOwnPropertySymbols(t).length === 0 : !0; - } -} -class Wc { - constructor() { - xe(this, "dateUtil"), xe(this, "strUtil"), xe(this, "versionUtil"), xe(this, "htmlUtil"), xe(this, "markdownUtil"), xe(this, "jsonUtil"), xe(this, "objectUtil"), this.dateUtil = new vc(), this.strUtil = new yc(), this.versionUtil = new Ec(), this.htmlUtil = new Kc(), this.markdownUtil = new Gn(), this.jsonUtil = new wc(), this.objectUtil = new Gc(); - } -} -const Jc = Wc; -var Zc = Object.defineProperty, Yc = (e, t, n) => t in e ? Zc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Tt = (e, t, n) => (Yc(e, typeof t != "symbol" ? t + "" : t, n), n); -class ct { -} -Tt(ct, "NODE_ENV_KEY", "NODE_ENV"), /** -* 开发环境 -*/ -Tt(ct, "NODE_ENV_DEVELOPMENT", "development"), /** -* 生产环境 -*/ -Tt(ct, "NODE_ENV_PRODUCTION", "production"), /** -* 测试环境 -*/ -Tt(ct, "NODE_ENV_TEST", "test"), /** -* 是否处于调试模式 -*/ -Tt(ct, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -class Qc { - /** - * 环境初始化 - * - * @param envMeta - 需要传入 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false} 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(t) { - Tt(this, "envMeta"), this.envMeta = t; - } - /** - * 是否是开发阶段调试 - */ - isNodeDev() { - return this.getEnv(ct.NODE_ENV_KEY) === ct.NODE_ENV_DEVELOPMENT; - } - /** - * 是否是调试阶段 - */ - isDev() { - return this.isNodeDev() || this.getBooleanEnv(ct.VITE_DEBUG_MODE_KEY); - } - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(t) { - let n; - try { - this.envMeta[t] && (n = this.envMeta[t]); - } catch { - } - return n; - } - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(t) { - return this.getEnv(t) ?? ""; - } - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(t) { - let n = !1; - return this.getEnv(t) && (n = this.getStringEnv(t).toLowerCase() === "true"), n; - } - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(t, n) { - const a = this.getStringEnv(t); - return a.trim().length == 0 ? n : a; - } -} -class Xc extends Kt { - static zhiEnv() { - return this.env || (this.env = new Qc({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 })), this.env; - } -} -class sl { - /** - * 初始化博客 API - * - * @param apiAdaptor - 对应博客的适配器,例如:SiYuanApiAdaptor - */ - constructor(t) { - X(this, "logger"); - X(this, "apiAdaptor"); - /** - * 博客API版本号 - */ - X(this, "VERSION"); - this.logger = Xc.zhiLog("zhi-blog-api"), this.VERSION = "1.0.0", this.apiAdaptor = t; - } - /** - * 博客配置列表 - */ - async getUsersBlogs() { - return await this.apiAdaptor.getUsersBlogs(); - } - /** - * 最新文章数目 - * - * @param keyword - 关键字(可选,部分平台不支持搜索) - */ - async getRecentPostsCount(t) { - return await this.apiAdaptor.getRecentPostsCount(t); - } - /** - * 最新文章 - * - * @param numOfPosts - 文章数目 - * @param page - 页码(可选,从0开始,部分平台不支持分页) - * @param keyword - 关键字(可选,部分平台不支持搜索) - */ - async getRecentPosts(t, n, a) { - try { - return await this.apiAdaptor.getRecentPosts(t, n, a); - } catch (i) { - return this.logger.error("getRecentPosts fetch posts failed", i), Promise.resolve([]); - } - } - /** - * 发布文章 - * - * @param post - 文章 - * @param publish - 可选,是否发布 - */ - async newPost(t, n) { - return await this.apiAdaptor.newPost(t, n); - } - /** - * 文章详情 - * @param postid - postid - * @param useSlug - 是否使用的是别名(可选,部分平台不支持) - */ - async getPost(t, n) { - try { - return await this.apiAdaptor.getPost(t, n); - } catch (a) { - return this.logger.error(`getPost fetch posts failed => ${t},`, a), Promise.resolve(new lo()); - } - } - /** - * 更新文章 - * - * @param postid - 文章id - * @param post - 文章 - * @param publish - 可选,是否发布 - */ - async editPost(t, n, a) { - return await this.apiAdaptor.editPost(t, n, a); - } - /** - * 删除文章 - * - * @param postid - 文章ID - */ - async deletePost(t) { - return await this.apiAdaptor.deletePost(t); - } - /** - * 获取分类列表 - */ - async getCategories() { - return await this.apiAdaptor.getCategories(); - } - /** - * 获取预览链接 - * - * @param postid - 文章ID - */ - async getPreviewUrl(t) { - return await this.apiAdaptor.getPreviewUrl(t); - } - /** - * 上传附件 - * - * @param mediaObject - */ - async newMediaObject(t) { - return await this.apiAdaptor.newMediaObject(t); - } -} -class el { - constructor() { - /** - * 博客ID - */ - X(this, "blogid"); - /** - * 博客地址 - */ - X(this, "url"); - /** - * 博客名称 - */ - X(this, "blogName"); - /** - * 是否是管理员 - */ - X(this, "isAdmin"); - /** - * xmlrpc地址 - */ - X(this, "xmlrpc"); - this.blogid = "", this.url = "", this.blogName = ""; - } -} -class il { - constructor() { - /** - * 博客信息 - */ - X(this, "userBlog"); - /** - * 域名 - */ - X(this, "domain"); - /** - * 站点链接 - */ - X(this, "weburl"); - /** - * 站点主题 - */ - X(this, "webtheme"); - /** - * 站点名称 - */ - X(this, "webname"); - /** - * 站点口号 - */ - X(this, "webslogen"); - /** - * 关键字 - */ - X(this, "keywords"); - /** - * 描述 - */ - X(this, "description"); - /** - * 备案信息 - */ - X(this, "beianinfo"); - this.userBlog = new el(), this.domain = "", this.weburl = "", this.webtheme = "default", this.webname = "浅海拾贝", this.webslogen = "寻找未知的技术拼图", this.keywords = "软件架构、服务端开发、Java、Spring、Dubbo、Zookeeper、微服务", this.description = "浅海拾贝致力于Java后端开发及服务端技术、软件架构、微服务技术分享的个人博客", this.beianinfo = "粤ICP备18023717号-1"; - } -} -class cl { - constructor() { - /** - * 分类ID - */ - X(this, "categoryId"); - /** - * 父分类ID - */ - X(this, "parentId"); - /** - * 分类名称 - */ - X(this, "description"); - /** - * 分类英文名 - */ - X(this, "categoryName"); - /** - * 分类详情 - */ - X(this, "categoryDescription"); - /** - * 分类地址 - */ - X(this, "htmlUrl"); - /** - * 分类订阅地址 - */ - X(this, "rssUrl"); - this.categoryId = "-1", this.parentId = "0", this.description = "分类1", this.categoryDescription = "这是测试分类1", this.categoryName = "cate1", this.htmlUrl = "", this.rssUrl = ""; - } -} -class ll { - constructor(t, n, a) { - X(this, "name"); - X(this, "type"); - X(this, "bits"); - this.name = t, this.type = n, this.bits = a; - } -} -class tl { -} -/** - * 博客类型 - */ -X(tl, "DEFAULT_BLOG_TYPE_KEY", "VITE_DEFAULT_TYPE"); -var rl = /* @__PURE__ */ ((e) => (e.BlogTypeEnum_Siyuan = "siyuan", e.BlogTypeEnum_Metaweblog = "metaweblog", e.BlogTypeEnum_Wordpress = "wordpress", e))(rl || {}); -export { - sl as BlogApi, - nl as BlogConfig, - tl as BlogConstants, - ol as BlogPlaceholder, - rl as BlogTypeEnum, - cl as CategoryInfo, - ll as MediaObject, - io as PageType, - co as PasswordType, - lo as Post, - mn as PostStatusEnum, - il as SiteConfig, - el as UserBlog -}; diff --git a/public/libs/zhi-blog-api/lib/IBlogApi.d.ts b/public/libs/zhi-blog-api/lib/IBlogApi.d.ts deleted file mode 100644 index a2e64fef..00000000 --- a/public/libs/zhi-blog-api/lib/IBlogApi.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -import UserBlog from "./models/userBlog"; -import Post from "./models/post"; -import MediaObject from "./models/mediaObject"; -import CategoryInfo from "./models/categoryInfo"; -/** - * 通用博客接口 - * - * @public - * @author terwer - * @outline deep - * @version 1.0.0 - * @since 1.0.0 - */ -interface IBlogApi { - /** - * 博客配置列表 - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getUsersBlogs getUsersBlogs} - * @returns {Promise>} - */ - getUsersBlogs(): Promise>; - /** - * 最新文章数目 - * - * @param keyword - 关键字(可选,部分平台不支持搜索) - * @returns {Promise} - */ - getRecentPostsCount(keyword?: string): Promise; - /** - * 最新文章 - * - * @param numOfPosts - 文章数目 - * @param page - 页码(可选,从0开始,部分平台不支持分页) - * @param keyword - 关键字(可选,部分平台不支持搜索) - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getRecentPosts getRecentPosts} - * @returns {Promise>} - */ - getRecentPosts(numOfPosts: number, page?: number, keyword?: string): Promise>; - /** - * 发布文章 - * - * @param post - 文章 - * @param publish - 可选,是否发布 - * - * ```ts - * const post = { - * description: "自动发布的测试内容", - * title: "自动发布的测试标题", - * categories: ["标签1","标签2"], - * // dateCreated: new Date(), - * // link: "", - * // permalink: "", - * // postid: "", - * // source: { - * // name: "", - * // url: "" - * // }; - * // userid: "" - * } - * - * const result = newPost(post, false) - * ``` - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.newPost newPost} - * @returns {Promise} - */ - newPost(post: Post, publish?: boolean): Promise; - /** - * 文章详情 - * @param postid - postid - * @param useSlug - 是否使用的是别名(可选,部分平台不支持) - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getPost getPost} - * @returns {Promise} - */ - getPost(postid: string, useSlug?: boolean): Promise; - /** - * 更新文章 - * - * @param postid - 文章id - * @param post - 文章 - * @param publish - 可选,是否发布 - * - * ```ts - * // wordpress - * // const postid = 4115 - * // conf - * // const postid = 1540103 - * const postid = "2490384_1" - * const post = { - * description: "修改过的自动发布的测试内容2", - * title: "修改过的自动发布的测试标题2", - * categories: ["标签1", "标签2"], - * // dateCreated: new Date(), - * // link: "", - * // permalink: "", - * // postid: postid, - * // source: { - * // name: "", - * // url: "" - * // }; - * // userid: "" - * } - * - * const result = editPost(postid, post, false) - * ``` - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.editPost editPost} - * @returns {Promise} - */ - editPost(postid: string, post: Post, publish?: boolean): Promise; - /** - * 删除文章 - * - * @param postid - 文章ID - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.deletePost deletePost} - * @returns {Promise} - */ - deletePost(postid: string): Promise; - /** - * 获取分类列表 - * - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getCategories getCategories} - * @returns {Promise} - */ - getCategories(): Promise; - /** - * 获取预览链接 - * - * @param postid - 文章ID - * @returns {Promise} - */ - getPreviewUrl(postid: string): Promise; - /** - * 上传附件 - * - * @param mediaObject - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.newMediaObject newMediaObject} - * @returns {Promise} - */ - newMediaObject(mediaObject: MediaObject): Promise; -} -export type { IBlogApi }; diff --git a/public/libs/zhi-blog-api/lib/blogApi.d.ts b/public/libs/zhi-blog-api/lib/blogApi.d.ts deleted file mode 100644 index 9640fbdf..00000000 --- a/public/libs/zhi-blog-api/lib/blogApi.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import UserBlog from "./models/userBlog"; -import Post from "./models/post"; -import CategoryInfo from "./models/categoryInfo"; -import MediaObject from "./models/mediaObject"; -import type { IBlogApi } from "./IBlogApi"; -/** - * 博客API - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare class BlogApi implements IBlogApi { - private readonly logger; - private readonly apiAdaptor; - /** - * 博客API版本号 - */ - readonly VERSION: string; - /** - * 初始化博客 API - * - * @param apiAdaptor - 对应博客的适配器,例如:SiYuanApiAdaptor - */ - constructor(apiAdaptor: IBlogApi); - /** - * 博客配置列表 - */ - getUsersBlogs(): Promise>; - /** - * 最新文章数目 - * - * @param keyword - 关键字(可选,部分平台不支持搜索) - */ - getRecentPostsCount(keyword?: string): Promise; - /** - * 最新文章 - * - * @param numOfPosts - 文章数目 - * @param page - 页码(可选,从0开始,部分平台不支持分页) - * @param keyword - 关键字(可选,部分平台不支持搜索) - */ - getRecentPosts(numOfPosts: number, page?: number, keyword?: string): Promise>; - /** - * 发布文章 - * - * @param post - 文章 - * @param publish - 可选,是否发布 - */ - newPost(post: Post, publish?: boolean): Promise; - /** - * 文章详情 - * @param postid - postid - * @param useSlug - 是否使用的是别名(可选,部分平台不支持) - */ - getPost(postid: string, useSlug?: boolean): Promise; - /** - * 更新文章 - * - * @param postid - 文章id - * @param post - 文章 - * @param publish - 可选,是否发布 - */ - editPost(postid: string, post: Post, publish?: boolean): Promise; - /** - * 删除文章 - * - * @param postid - 文章ID - */ - deletePost(postid: string): Promise; - /** - * 获取分类列表 - */ - getCategories(): Promise; - /** - * 获取预览链接 - * - * @param postid - 文章ID - */ - getPreviewUrl(postid: string): Promise; - /** - * 上传附件 - * - * @param mediaObject - */ - newMediaObject(mediaObject: MediaObject): Promise; -} -export default BlogApi; diff --git a/public/libs/zhi-blog-api/lib/blogConfig.d.ts b/public/libs/zhi-blog-api/lib/blogConfig.d.ts deleted file mode 100644 index d01adfc5..00000000 --- a/public/libs/zhi-blog-api/lib/blogConfig.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -import BlogPlaceholder from "./blogPlaceholder"; -/** - * 页面类型 - */ -export declare enum PageType { - /** - * Markdown正文 - */ - Markdown = 0, - /** - * HTML - */ - Html = 1, - /** - * 属性 - */ - Formatter = 2, - /** - * Markdown和属性 - */ - Markdown_And_Formatter = 3, - /** - * MDX - * - * @see {@link https://mdxjs.com/ mdx} - */ - MDX = 4 -} -/** - * 密码类型 - */ -export declare enum PasswordType { - /** - * 密码 - */ - PasswordType_Password = 0, - /** - * token - */ - PasswordType_Token = 1 -} -/** - * 博客通用配置类 - */ -declare abstract class BlogConfig { - /** - * 首页 - */ - protected home: string; - /** - * API地址 - */ - protected apiUrl: string; - /** - * 用户名 - */ - protected username: string; - /** - * 密码类型 - */ - protected passwordType: PasswordType; - /** - * 密码 - */ - protected password: string; - /** - * 是否发布 - */ - protected apiStatus: boolean; - /** - * 博客名(API获取) - */ - protected blogName: string; - /** - * 文章别名key - */ - protected posidKey: string; - /** - * 文章预览链接 - */ - protected previewUrl: string; - /** - * 文章类型 - */ - protected pageType: PageType; - /** - * 操作提示 - */ - protected placeholder: BlogPlaceholder | undefined; - /** - * 是否处理标题 - * - * @protected - */ - protected fixTitle: boolean; - protected constructor(); -} -export default BlogConfig; diff --git a/public/libs/zhi-blog-api/lib/blogConstants.d.ts b/public/libs/zhi-blog-api/lib/blogConstants.d.ts deleted file mode 100644 index 1ef63fad..00000000 --- a/public/libs/zhi-blog-api/lib/blogConstants.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 博客通用常量定义 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class BlogConstants { - /** - * 博客类型 - */ - static DEFAULT_BLOG_TYPE_KEY: string; -} -export default BlogConstants; diff --git a/public/libs/zhi-blog-api/lib/blogPlaceholder.d.ts b/public/libs/zhi-blog-api/lib/blogPlaceholder.d.ts deleted file mode 100644 index 7b9e3141..00000000 --- a/public/libs/zhi-blog-api/lib/blogPlaceholder.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 配置提示 - * - * @author terwer - * @since 1.0.0 - */ -declare abstract class BlogPlaceholder { - /** - * 首页操作提示 - */ - protected homePlaceholder: string; - /** - * API 地址操作提示 - */ - protected apiUrlPlaceholder: string; - /** - * 用户名操作提示 - */ - protected usernamePlaceholder: string; - /** - * 密码类型操作提示 - */ - protected passwordTypePlaceholder: string; - /** - * 密码操作提示 - */ - protected passwordPlaceholder: string; - /** - * API状态是否正常操作提示 - */ - protected apiStatusPlaceholder: boolean; - /** - * 博客名(API获取)操作提示 - */ - protected blogNamePlaceholder: string; - /** - * 文章别名key操作提示 - */ - protected posidKeyPlaceholder: string; - /** - * 文章预览链接操作提示 - */ - protected previewUrlPlaceholder: string; - /** - * 文章类型操作提示 - */ - protected pageTypePlaceholder: string; - constructor(); -} -export default BlogPlaceholder; diff --git a/public/libs/zhi-blog-api/lib/enums/blogTypeEnum.d.ts b/public/libs/zhi-blog-api/lib/enums/blogTypeEnum.d.ts deleted file mode 100644 index 50f7fca8..00000000 --- a/public/libs/zhi-blog-api/lib/enums/blogTypeEnum.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 博客类型枚举 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare enum BlogTypeEnum { - /** - * 思源笔记 - */ - BlogTypeEnum_Siyuan = "siyuan", - /** - * Metaweblog - */ - BlogTypeEnum_Metaweblog = "metaweblog", - /** - * WordPress - */ - BlogTypeEnum_Wordpress = "wordpress" -} -export default BlogTypeEnum; diff --git a/public/libs/zhi-blog-api/lib/enums/postStatusEnum.d.ts b/public/libs/zhi-blog-api/lib/enums/postStatusEnum.d.ts deleted file mode 100644 index e027b6de..00000000 --- a/public/libs/zhi-blog-api/lib/enums/postStatusEnum.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 文章状态枚举 - */ -declare enum PostStatusEnum { - /** - * 已发布 - */ - PostStatusEnum_Publish = "publish", - /** - * 草稿 - */ - PostStatusEnum_Draft = "draft", - /** - * 继承 - */ - PostStatusEnum_Inherit = "inherit" -} -export default PostStatusEnum; diff --git a/public/libs/zhi-blog-api/lib/models/categoryInfo.d.ts b/public/libs/zhi-blog-api/lib/models/categoryInfo.d.ts deleted file mode 100644 index 5b25f129..00000000 --- a/public/libs/zhi-blog-api/lib/models/categoryInfo.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 通用分类模型定义 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class CategoryInfo { - /** - * 分类ID - */ - categoryId: string; - /** - * 父分类ID - */ - parentId: string; - /** - * 分类名称 - */ - description: string; - /** - * 分类英文名 - */ - categoryName: string; - /** - * 分类详情 - */ - categoryDescription: string; - /** - * 分类地址 - */ - htmlUrl: string; - /** - * 分类订阅地址 - */ - rssUrl: string; - constructor(); -} -export default CategoryInfo; diff --git a/public/libs/zhi-blog-api/lib/models/mediaObject.d.ts b/public/libs/zhi-blog-api/lib/models/mediaObject.d.ts deleted file mode 100644 index cbb47a5a..00000000 --- a/public/libs/zhi-blog-api/lib/models/mediaObject.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/// -/** - * 媒体文件 - * - * ```ts - * const url = "./testdata/photo.jpg"; - * const file = fs.readFileSync(url) - * const data = { - * name: "20220616-132401-001.jpg", - * type: "image/jpeg", - * bits: file, - * overwrite: true - * } - * - * // return - * { - * attachment_id: '4108', - * date_created_gmt: 2022-06-15T21:25:23.000Z, - * parent: 0, - * link: 'https://terwergreen.files.wordpress.com/2022/06/20220616-132401-001.jpg', - * title: '20220616-132401-001.jpg', - * caption: '', - * description: '', - * metadata: { filesize: 113032 }, - * type: 'image/jpeg', - * thumbnail: 'https://terwergreen.files.wordpress.com/2022/06/20220616-132401-001.jpg?w=150', - * id: '4108', - * file: '20220616-132401-001.jpg', - * url: 'http://terwergreen.files.wordpress.com/2022/06/20220616-132401-001.jpg' - * } - * ``` - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class MediaObject { - name: string; - type: string; - bits: Buffer; - constructor(name: string, type: string, bits: Buffer); -} -export default MediaObject; diff --git a/public/libs/zhi-blog-api/lib/models/post.d.ts b/public/libs/zhi-blog-api/lib/models/post.d.ts deleted file mode 100644 index 56c673df..00000000 --- a/public/libs/zhi-blog-api/lib/models/post.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import PostStatusEnum from "../enums/postStatusEnum"; -/** - * 通用文章模型定义 - * - * @public - */ -declare class Post { - /** - * 文章ID - */ - postid: string; - /** - * 标题 - */ - title: string; - /** - * 逗号分隔的标签 - */ - mt_keywords: string; - /** - * 链接 - */ - link?: string; - /** - * 永久链接 - */ - permalink: string; - /** - * 摘要 - */ - shortDesc?: string; - /** - * 描述 - */ - description: string; - /** - * 短评 - */ - mt_excerpt?: string; - /** - * 别名 - */ - wp_slug: string; - /** - * 创建时间 - */ - dateCreated: Date; - /** - * 分类 - */ - categories: Array; - /** - * 更多 - */ - mt_text_more?: string; - /** - * 发布状态 - */ - post_status?: PostStatusEnum; - /** - * 是否发布 - */ - isPublished: boolean; - /** - * 发布密码 - */ - wp_password: string; - constructor(); -} -export default Post; diff --git a/public/libs/zhi-blog-api/lib/models/siteConfig.d.ts b/public/libs/zhi-blog-api/lib/models/siteConfig.d.ts deleted file mode 100644 index 6132eaac..00000000 --- a/public/libs/zhi-blog-api/lib/models/siteConfig.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import UserBlog from "./userBlog"; -/** - * 站点信息定义 - */ -declare class SiteConfig { - /** - * 博客信息 - */ - userBlog: UserBlog; - /** - * 域名 - */ - domain: string; - /** - * 站点链接 - */ - weburl: string; - /** - * 站点主题 - */ - webtheme: string; - /** - * 站点名称 - */ - webname: string; - /** - * 站点口号 - */ - webslogen: string; - /** - * 关键字 - */ - keywords: string; - /** - * 描述 - */ - description: string; - /** - * 备案信息 - */ - beianinfo: string; - constructor(); -} -export default SiteConfig; diff --git a/public/libs/zhi-blog-api/lib/models/userBlog.d.ts b/public/libs/zhi-blog-api/lib/models/userBlog.d.ts deleted file mode 100644 index 7929c6e9..00000000 --- a/public/libs/zhi-blog-api/lib/models/userBlog.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 博客信息定义 - * - * @public - */ -declare class UserBlog { - /** - * 博客ID - */ - blogid: string; - /** - * 博客地址 - */ - url: string; - /** - * 博客名称 - */ - blogName: string; - /** - * 是否是管理员 - */ - isAdmin?: boolean; - /** - * xmlrpc地址 - */ - xmlrpc?: string; - constructor(); -} -export default UserBlog; diff --git a/public/libs/zhi-blog-api/lib/utils/ZhiBlogApiUtil.d.ts b/public/libs/zhi-blog-api/lib/utils/ZhiBlogApiUtil.d.ts deleted file mode 100644 index f6281706..00000000 --- a/public/libs/zhi-blog-api/lib/utils/ZhiBlogApiUtil.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ZhiUtil } from "zhi-common"; -import { Env } from "zhi-env"; -/** - * 工具类统一入口,每个应用自己实现 - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare class ZhiBlogApiUtil extends ZhiUtil { - static zhiEnv(): Env; -} -export default ZhiBlogApiUtil; diff --git a/public/libs/zhi-blog-api/lib/zhi-blog-api.d.ts b/public/libs/zhi-blog-api/lib/zhi-blog-api.d.ts deleted file mode 100644 index 556625c6..00000000 --- a/public/libs/zhi-blog-api/lib/zhi-blog-api.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import BlogApi from "./blogApi"; -export default BlogApi; diff --git a/public/libs/zhi-blog-api/package.json b/public/libs/zhi-blog-api/package.json deleted file mode 100644 index 0011b1db..00000000 --- a/public/libs/zhi-blog-api/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "zhi-blog-api", - "version": "1.1.1", - "type": "module", - "description": "a common blog interface", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "repository": "terwer/zhi", - "homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-blog-api", - "author": "terwer", - "license": "GPL", - "files": [ - "dist", - "README.md" - ], - "keywords": [ - "zhi", - "lib", - "blog", - "api" - ], - "scripts": { - "serve": "vite", - "dev": "vite build --watch", - "build": "vite build", - "start": "vite preview", - "test": "vitest --watch" - }, - "devDependencies": { - "@terwer/eslint-config-custom": "workspace:*", - "@terwer/tsconfig": "workspace:*", - "@terwer/vite-config-custom": "workspace:*" - }, - "dependencies": { - "zhi-env": "workspace:*", - "zhi-log": "workspace:*", - "zhi-common": "workspace:*" - } -} diff --git a/public/libs/zhi-common/README.md b/public/libs/zhi-common/README.md deleted file mode 100644 index 2d199610..00000000 --- a/public/libs/zhi-common/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# zhi-common - -a collection of util tools - -## Usage - -```ts -import { zhiCommon } from "zhi-common" - -const dateUtil = zhiCommon.dateUtil -const now = dateUtil.nowDateZh() -console.log("now=>", now) -``` - -## Deps - -``` -├── zhi-device -├── zhi-env -├── zhi-log -├── lute -├── showdown -├── compare-versions -├── ajv -``` - -## Dev - -```bash -pnpm dev -F zhi-common -``` - -## Build - -```bash -pnpm build -F zhi-common -``` - -## Test - -Execute the unit tests via [vitest](https://vitest.dev) - -```bash -pnpm test -F zhi-common -``` - -## Publish - -```bash -pnpm publish -F zhi-common --tag latest -``` \ No newline at end of file diff --git a/public/libs/zhi-common/index.d.ts b/public/libs/zhi-common/index.d.ts deleted file mode 100644 index c77721e7..00000000 --- a/public/libs/zhi-common/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import ZhiCommon from "./lib/zhi-common"; -import ZhiUtil from "./lib/ZhiUtil"; -export { ZhiCommon }; -export { ZhiUtil }; diff --git a/public/libs/zhi-common/index.js b/public/libs/zhi-common/index.js deleted file mode 100644 index e3b44d25..00000000 --- a/public/libs/zhi-common/index.js +++ /dev/null @@ -1,8908 +0,0 @@ -var Ts = Object.defineProperty; -var js = (e, r, n) => r in e ? Ts(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n; -var be = (e, r, n) => (js(e, typeof r != "symbol" ? r + "" : r, n), n); -var kn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function Pn(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var zt = { exports: {} }, Sn = {}, He = {}, Rr = {}, et = {}, se = {}, xr = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0; - class r { - } - e._CodeOrName = r, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; - class n extends r { - constructor(O) { - if (super(), !e.IDENTIFIER.test(O)) - throw new Error("CodeGen: name must be a valid identifier"); - this.str = O; - } - toString() { - return this.str; - } - emptyStr() { - return !1; - } - get names() { - return { [this.str]: 1 }; - } - } - e.Name = n; - class a extends r { - constructor(O) { - super(), this._items = typeof O == "string" ? [O] : O; - } - toString() { - return this.str; - } - emptyStr() { - if (this._items.length > 1) - return !1; - const O = this._items[0]; - return O === "" || O === '""'; - } - get str() { - var O; - return (O = this._str) !== null && O !== void 0 ? O : this._str = this._items.reduce((D, t) => `${D}${t}`, ""); - } - get names() { - var O; - return (O = this._names) !== null && O !== void 0 ? O : this._names = this._items.reduce((D, t) => (t instanceof n && (D[t.str] = (D[t.str] || 0) + 1), D), {}); - } - } - e._Code = a, e.nil = new a(""); - function u($, ...O) { - const D = [$[0]]; - let t = 0; - for (; t < O.length; ) - y(D, O[t]), D.push($[++t]); - return new a(D); - } - e._ = u; - const o = new a("+"); - function p($, ...O) { - const D = [L($[0])]; - let t = 0; - for (; t < O.length; ) - D.push(o), y(D, O[t]), D.push(o, L($[++t])); - return b(D), new a(D); - } - e.str = p; - function y($, O) { - O instanceof a ? $.push(...O._items) : O instanceof n ? $.push(O) : $.push(S(O)); - } - e.addCodeArg = y; - function b($) { - let O = 1; - for (; O < $.length - 1; ) { - if ($[O] === o) { - const D = v($[O - 1], $[O + 1]); - if (D !== void 0) { - $.splice(O - 1, 3, D); - continue; - } - $[O++] = "+"; - } - O++; - } - } - function v($, O) { - if (O === '""') - return $; - if ($ === '""') - return O; - if (typeof $ == "string") - return O instanceof n || $[$.length - 1] !== '"' ? void 0 : typeof O != "string" ? `${$.slice(0, -1)}${O}"` : O[0] === '"' ? $.slice(0, -1) + O.slice(1) : void 0; - if (typeof O == "string" && O[0] === '"' && !($ instanceof n)) - return `"${$}${O.slice(1)}`; - } - function g($, O) { - return O.emptyStr() ? $ : $.emptyStr() ? O : p`${$}${O}`; - } - e.strConcat = g; - function S($) { - return typeof $ == "number" || typeof $ == "boolean" || $ === null ? $ : L(Array.isArray($) ? $.join(",") : $); - } - function z($) { - return new a(L($)); - } - e.stringify = z; - function L($) { - return JSON.stringify($).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); - } - e.safeStringify = L; - function R($) { - return typeof $ == "string" && e.IDENTIFIER.test($) ? new a(`.${$}`) : u`[${$}]`; - } - e.getProperty = R; - function j($) { - if (typeof $ == "string" && e.IDENTIFIER.test($)) - return new a(`${$}`); - throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`); - } - e.getEsmExportName = j; - function T($) { - return new a($.toString()); - } - e.regexpCode = T; -})(xr); -var Vt = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0; - const r = xr; - class n extends Error { - constructor(v) { - super(`CodeGen: "code" for ${v} not defined`), this.value = v.value; - } - } - var a; - (function(b) { - b[b.Started = 0] = "Started", b[b.Completed = 1] = "Completed"; - })(a = e.UsedValueState || (e.UsedValueState = {})), e.varKinds = { - const: new r.Name("const"), - let: new r.Name("let"), - var: new r.Name("var") - }; - class u { - constructor({ prefixes: v, parent: g } = {}) { - this._names = {}, this._prefixes = v, this._parent = g; - } - toName(v) { - return v instanceof r.Name ? v : this.name(v); - } - name(v) { - return new r.Name(this._newName(v)); - } - _newName(v) { - const g = this._names[v] || this._nameGroup(v); - return `${v}${g.index++}`; - } - _nameGroup(v) { - var g, S; - if (!((S = (g = this._parent) === null || g === void 0 ? void 0 : g._prefixes) === null || S === void 0) && S.has(v) || this._prefixes && !this._prefixes.has(v)) - throw new Error(`CodeGen: prefix "${v}" is not allowed in this scope`); - return this._names[v] = { prefix: v, index: 0 }; - } - } - e.Scope = u; - class o extends r.Name { - constructor(v, g) { - super(g), this.prefix = v; - } - setValue(v, { property: g, itemIndex: S }) { - this.value = v, this.scopePath = (0, r._)`.${new r.Name(g)}[${S}]`; - } - } - e.ValueScopeName = o; - const p = (0, r._)`\n`; - class y extends u { - constructor(v) { - super(v), this._values = {}, this._scope = v.scope, this.opts = { ...v, _n: v.lines ? p : r.nil }; - } - get() { - return this._scope; - } - name(v) { - return new o(v, this._newName(v)); - } - value(v, g) { - var S; - if (g.ref === void 0) - throw new Error("CodeGen: ref must be passed in value"); - const z = this.toName(v), { prefix: L } = z, R = (S = g.key) !== null && S !== void 0 ? S : g.ref; - let j = this._values[L]; - if (j) { - const O = j.get(R); - if (O) - return O; - } else - j = this._values[L] = /* @__PURE__ */ new Map(); - j.set(R, z); - const T = this._scope[L] || (this._scope[L] = []), $ = T.length; - return T[$] = g.ref, z.setValue(g, { property: L, itemIndex: $ }), z; - } - getValue(v, g) { - const S = this._values[v]; - if (S) - return S.get(g); - } - scopeRefs(v, g = this._values) { - return this._reduceValues(g, (S) => { - if (S.scopePath === void 0) - throw new Error(`CodeGen: name "${S}" has no value`); - return (0, r._)`${v}${S.scopePath}`; - }); - } - scopeCode(v = this._values, g, S) { - return this._reduceValues(v, (z) => { - if (z.value === void 0) - throw new Error(`CodeGen: name "${z}" has no value`); - return z.value.code; - }, g, S); - } - _reduceValues(v, g, S = {}, z) { - let L = r.nil; - for (const R in v) { - const j = v[R]; - if (!j) - continue; - const T = S[R] = S[R] || /* @__PURE__ */ new Map(); - j.forEach(($) => { - if (T.has($)) - return; - T.set($, a.Started); - let O = g($); - if (O) { - const D = this.opts.es5 ? e.varKinds.var : e.varKinds.const; - L = (0, r._)`${L}${D} ${$} = ${O};${this.opts._n}`; - } else if (O = z == null ? void 0 : z($)) - L = (0, r._)`${L}${O}${this.opts._n}`; - else - throw new n($); - T.set($, a.Completed); - }); - } - return L; - } - } - e.ValueScope = y; -})(Vt); -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0; - const r = xr, n = Vt; - var a = xr; - Object.defineProperty(e, "_", { enumerable: !0, get: function() { - return a._; - } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() { - return a.str; - } }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() { - return a.strConcat; - } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() { - return a.nil; - } }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() { - return a.getProperty; - } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() { - return a.stringify; - } }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() { - return a.regexpCode; - } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() { - return a.Name; - } }); - var u = Vt; - Object.defineProperty(e, "Scope", { enumerable: !0, get: function() { - return u.Scope; - } }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() { - return u.ValueScope; - } }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() { - return u.ValueScopeName; - } }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() { - return u.varKinds; - } }), e.operators = { - GT: new r._Code(">"), - GTE: new r._Code(">="), - LT: new r._Code("<"), - LTE: new r._Code("<="), - EQ: new r._Code("==="), - NEQ: new r._Code("!=="), - NOT: new r._Code("!"), - OR: new r._Code("||"), - AND: new r._Code("&&"), - ADD: new r._Code("+") - }; - class o { - optimizeNodes() { - return this; - } - optimizeNames(l, w) { - return this; - } - } - class p extends o { - constructor(l, w, I) { - super(), this.varKind = l, this.name = w, this.rhs = I; - } - render({ es5: l, _n: w }) { - const I = l ? n.varKinds.var : this.varKind, K = this.rhs === void 0 ? "" : ` = ${this.rhs}`; - return `${I} ${this.name}${K};` + w; - } - optimizeNames(l, w) { - if (l[this.name.str]) - return this.rhs && (this.rhs = V(this.rhs, l, w)), this; - } - get names() { - return this.rhs instanceof r._CodeOrName ? this.rhs.names : {}; - } - } - class y extends o { - constructor(l, w, I) { - super(), this.lhs = l, this.rhs = w, this.sideEffects = I; - } - render({ _n: l }) { - return `${this.lhs} = ${this.rhs};` + l; - } - optimizeNames(l, w) { - if (!(this.lhs instanceof r.Name && !l[this.lhs.str] && !this.sideEffects)) - return this.rhs = V(this.rhs, l, w), this; - } - get names() { - const l = this.lhs instanceof r.Name ? {} : { ...this.lhs.names }; - return H(l, this.rhs); - } - } - class b extends y { - constructor(l, w, I, K) { - super(l, I, K), this.op = w; - } - render({ _n: l }) { - return `${this.lhs} ${this.op}= ${this.rhs};` + l; - } - } - class v extends o { - constructor(l) { - super(), this.label = l, this.names = {}; - } - render({ _n: l }) { - return `${this.label}:` + l; - } - } - class g extends o { - constructor(l) { - super(), this.label = l, this.names = {}; - } - render({ _n: l }) { - return `break${this.label ? ` ${this.label}` : ""};` + l; - } - } - class S extends o { - constructor(l) { - super(), this.error = l; - } - render({ _n: l }) { - return `throw ${this.error};` + l; - } - get names() { - return this.error.names; - } - } - class z extends o { - constructor(l) { - super(), this.code = l; - } - render({ _n: l }) { - return `${this.code};` + l; - } - optimizeNodes() { - return `${this.code}` ? this : void 0; - } - optimizeNames(l, w) { - return this.code = V(this.code, l, w), this; - } - get names() { - return this.code instanceof r._CodeOrName ? this.code.names : {}; - } - } - class L extends o { - constructor(l = []) { - super(), this.nodes = l; - } - render(l) { - return this.nodes.reduce((w, I) => w + I.render(l), ""); - } - optimizeNodes() { - const { nodes: l } = this; - let w = l.length; - for (; w--; ) { - const I = l[w].optimizeNodes(); - Array.isArray(I) ? l.splice(w, 1, ...I) : I ? l[w] = I : l.splice(w, 1); - } - return l.length > 0 ? this : void 0; - } - optimizeNames(l, w) { - const { nodes: I } = this; - let K = I.length; - for (; K--; ) { - const W = I[K]; - W.optimizeNames(l, w) || (G(l, W.names), I.splice(K, 1)); - } - return I.length > 0 ? this : void 0; - } - get names() { - return this.nodes.reduce((l, w) => U(l, w.names), {}); - } - } - class R extends L { - render(l) { - return "{" + l._n + super.render(l) + "}" + l._n; - } - } - class j extends L { - } - class T extends R { - } - T.kind = "else"; - class $ extends R { - constructor(l, w) { - super(w), this.condition = l; - } - render(l) { - let w = `if(${this.condition})` + super.render(l); - return this.else && (w += "else " + this.else.render(l)), w; - } - optimizeNodes() { - super.optimizeNodes(); - const l = this.condition; - if (l === !0) - return this.nodes; - let w = this.else; - if (w) { - const I = w.optimizeNodes(); - w = this.else = Array.isArray(I) ? new T(I) : I; - } - if (w) - return l === !1 ? w instanceof $ ? w : w.nodes : this.nodes.length ? this : new $(_(l), w instanceof $ ? [w] : w.nodes); - if (!(l === !1 || !this.nodes.length)) - return this; - } - optimizeNames(l, w) { - var I; - if (this.else = (I = this.else) === null || I === void 0 ? void 0 : I.optimizeNames(l, w), !!(super.optimizeNames(l, w) || this.else)) - return this.condition = V(this.condition, l, w), this; - } - get names() { - const l = super.names; - return H(l, this.condition), this.else && U(l, this.else.names), l; - } - } - $.kind = "if"; - class O extends R { - } - O.kind = "for"; - class D extends O { - constructor(l) { - super(), this.iteration = l; - } - render(l) { - return `for(${this.iteration})` + super.render(l); - } - optimizeNames(l, w) { - if (super.optimizeNames(l, w)) - return this.iteration = V(this.iteration, l, w), this; - } - get names() { - return U(super.names, this.iteration.names); - } - } - class t extends O { - constructor(l, w, I, K) { - super(), this.varKind = l, this.name = w, this.from = I, this.to = K; - } - render(l) { - const w = l.es5 ? n.varKinds.var : this.varKind, { name: I, from: K, to: W } = this; - return `for(${w} ${I}=${K}; ${I}<${W}; ${I}++)` + super.render(l); - } - get names() { - const l = H(super.names, this.from); - return H(l, this.to); - } - } - class d extends O { - constructor(l, w, I, K) { - super(), this.loop = l, this.varKind = w, this.name = I, this.iterable = K; - } - render(l) { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(l); - } - optimizeNames(l, w) { - if (super.optimizeNames(l, w)) - return this.iterable = V(this.iterable, l, w), this; - } - get names() { - return U(super.names, this.iterable.names); - } - } - class s extends R { - constructor(l, w, I) { - super(), this.name = l, this.args = w, this.async = I; - } - render(l) { - return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(l); - } - } - s.kind = "func"; - class i extends L { - render(l) { - return "return " + super.render(l); - } - } - i.kind = "return"; - class c extends R { - render(l) { - let w = "try" + super.render(l); - return this.catch && (w += this.catch.render(l)), this.finally && (w += this.finally.render(l)), w; - } - optimizeNodes() { - var l, w; - return super.optimizeNodes(), (l = this.catch) === null || l === void 0 || l.optimizeNodes(), (w = this.finally) === null || w === void 0 || w.optimizeNodes(), this; - } - optimizeNames(l, w) { - var I, K; - return super.optimizeNames(l, w), (I = this.catch) === null || I === void 0 || I.optimizeNames(l, w), (K = this.finally) === null || K === void 0 || K.optimizeNames(l, w), this; - } - get names() { - const l = super.names; - return this.catch && U(l, this.catch.names), this.finally && U(l, this.finally.names), l; - } - } - class m extends R { - constructor(l) { - super(), this.error = l; - } - render(l) { - return `catch(${this.error})` + super.render(l); - } - } - m.kind = "catch"; - class h extends R { - render(l) { - return "finally" + super.render(l); - } - } - h.kind = "finally"; - class C { - constructor(l, w = {}) { - this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...w, _n: w.lines ? ` -` : "" }, this._extScope = l, this._scope = new n.Scope({ parent: l }), this._nodes = [new j()]; - } - toString() { - return this._root.render(this.opts); - } - // returns unique name in the internal scope - name(l) { - return this._scope.name(l); - } - // reserves unique name in the external scope - scopeName(l) { - return this._extScope.name(l); - } - // reserves unique name in the external scope and assigns value to it - scopeValue(l, w) { - const I = this._extScope.value(l, w); - return (this._values[I.prefix] || (this._values[I.prefix] = /* @__PURE__ */ new Set())).add(I), I; - } - getScopeValue(l, w) { - return this._extScope.getValue(l, w); - } - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(l) { - return this._extScope.scopeRefs(l, this._values); - } - scopeCode() { - return this._extScope.scopeCode(this._values); - } - _def(l, w, I, K) { - const W = this._scope.toName(w); - return I !== void 0 && K && (this._constants[W.str] = I), this._leafNode(new p(l, W, I)), W; - } - // `const` declaration (`var` in es5 mode) - const(l, w, I) { - return this._def(n.varKinds.const, l, w, I); - } - // `let` declaration with optional assignment (`var` in es5 mode) - let(l, w, I) { - return this._def(n.varKinds.let, l, w, I); - } - // `var` declaration with optional assignment - var(l, w, I) { - return this._def(n.varKinds.var, l, w, I); - } - // assignment code - assign(l, w, I) { - return this._leafNode(new y(l, w, I)); - } - // `+=` code - add(l, w) { - return this._leafNode(new b(l, e.operators.ADD, w)); - } - // appends passed SafeExpr to code or executes Block - code(l) { - return typeof l == "function" ? l() : l !== r.nil && this._leafNode(new z(l)), this; - } - // returns code for object literal for the passed argument list of key-value pairs - object(...l) { - const w = ["{"]; - for (const [I, K] of l) - w.length > 1 && w.push(","), w.push(I), (I !== K || this.opts.es5) && (w.push(":"), (0, r.addCodeArg)(w, K)); - return w.push("}"), new r._Code(w); - } - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(l, w, I) { - if (this._blockNode(new $(l)), w && I) - this.code(w).else().code(I).endIf(); - else if (w) - this.code(w).endIf(); - else if (I) - throw new Error('CodeGen: "else" body without "then" body'); - return this; - } - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(l) { - return this._elseNode(new $(l)); - } - // `else` clause - only valid after `if` or `else if` clauses - else() { - return this._elseNode(new T()); - } - // end `if` statement (needed if gen.if was used only with condition) - endIf() { - return this._endBlockNode($, T); - } - _for(l, w) { - return this._blockNode(l), w && this.code(w).endFor(), this; - } - // a generic `for` clause (or statement if `forBody` is passed) - for(l, w) { - return this._for(new D(l), w); - } - // `for` statement for a range of values - forRange(l, w, I, K, W = this.opts.es5 ? n.varKinds.var : n.varKinds.let) { - const re = this._scope.toName(l); - return this._for(new t(W, re, w, I), () => K(re)); - } - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf(l, w, I, K = n.varKinds.const) { - const W = this._scope.toName(l); - if (this.opts.es5) { - const re = w instanceof r.Name ? w : this.var("_arr", w); - return this.forRange("_i", 0, (0, r._)`${re}.length`, (ae) => { - this.var(W, (0, r._)`${re}[${ae}]`), I(W); - }); - } - return this._for(new d("of", K, W, w), () => I(W)); - } - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn(l, w, I, K = this.opts.es5 ? n.varKinds.var : n.varKinds.const) { - if (this.opts.ownProperties) - return this.forOf(l, (0, r._)`Object.keys(${w})`, I); - const W = this._scope.toName(l); - return this._for(new d("in", K, W, w), () => I(W)); - } - // end `for` loop - endFor() { - return this._endBlockNode(O); - } - // `label` statement - label(l) { - return this._leafNode(new v(l)); - } - // `break` statement - break(l) { - return this._leafNode(new g(l)); - } - // `return` statement - return(l) { - const w = new i(); - if (this._blockNode(w), this.code(l), w.nodes.length !== 1) - throw new Error('CodeGen: "return" should have one node'); - return this._endBlockNode(i); - } - // `try` statement - try(l, w, I) { - if (!w && !I) - throw new Error('CodeGen: "try" without "catch" and "finally"'); - const K = new c(); - if (this._blockNode(K), this.code(l), w) { - const W = this.name("e"); - this._currNode = K.catch = new m(W), w(W); - } - return I && (this._currNode = K.finally = new h(), this.code(I)), this._endBlockNode(m, h); - } - // `throw` statement - throw(l) { - return this._leafNode(new S(l)); - } - // start self-balancing block - block(l, w) { - return this._blockStarts.push(this._nodes.length), l && this.code(l).endBlock(w), this; - } - // end the current self-balancing block - endBlock(l) { - const w = this._blockStarts.pop(); - if (w === void 0) - throw new Error("CodeGen: not in self-balancing block"); - const I = this._nodes.length - w; - if (I < 0 || l !== void 0 && I !== l) - throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${l} expected`); - return this._nodes.length = w, this; - } - // `function` heading (or definition if funcBody is passed) - func(l, w = r.nil, I, K) { - return this._blockNode(new s(l, w, I)), K && this.code(K).endFunc(), this; - } - // end function definition - endFunc() { - return this._endBlockNode(s); - } - optimize(l = 1) { - for (; l-- > 0; ) - this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants); - } - _leafNode(l) { - return this._currNode.nodes.push(l), this; - } - _blockNode(l) { - this._currNode.nodes.push(l), this._nodes.push(l); - } - _endBlockNode(l, w) { - const I = this._currNode; - if (I instanceof l || w && I instanceof w) - return this._nodes.pop(), this; - throw new Error(`CodeGen: not in block "${w ? `${l.kind}/${w.kind}` : l.kind}"`); - } - _elseNode(l) { - const w = this._currNode; - if (!(w instanceof $)) - throw new Error('CodeGen: "else" without "if"'); - return this._currNode = w.else = l, this; - } - get _root() { - return this._nodes[0]; - } - get _currNode() { - const l = this._nodes; - return l[l.length - 1]; - } - set _currNode(l) { - const w = this._nodes; - w[w.length - 1] = l; - } - } - e.CodeGen = C; - function U(N, l) { - for (const w in l) - N[w] = (N[w] || 0) + (l[w] || 0); - return N; - } - function H(N, l) { - return l instanceof r._CodeOrName ? U(N, l.names) : N; - } - function V(N, l, w) { - if (N instanceof r.Name) - return I(N); - if (!K(N)) - return N; - return new r._Code(N._items.reduce((W, re) => (re instanceof r.Name && (re = I(re)), re instanceof r._Code ? W.push(...re._items) : W.push(re), W), [])); - function I(W) { - const re = w[W.str]; - return re === void 0 || l[W.str] !== 1 ? W : (delete l[W.str], re); - } - function K(W) { - return W instanceof r._Code && W._items.some((re) => re instanceof r.Name && l[re.str] === 1 && w[re.str] !== void 0); - } - } - function G(N, l) { - for (const w in l) - N[w] = (N[w] || 0) - (l[w] || 0); - } - function _(N) { - return typeof N == "boolean" || typeof N == "number" || N === null ? !N : (0, r._)`!${F(N)}`; - } - e.not = _; - const q = k(e.operators.AND); - function J(...N) { - return N.reduce(q); - } - e.and = J; - const Z = k(e.operators.OR); - function B(...N) { - return N.reduce(Z); - } - e.or = B; - function k(N) { - return (l, w) => l === r.nil ? w : w === r.nil ? l : (0, r._)`${F(l)} ${N} ${F(w)}`; - } - function F(N) { - return N instanceof r.Name ? N : (0, r._)`(${N})`; - } -})(se); -var ie = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0; - const r = se, n = xr; - function a(s) { - const i = {}; - for (const c of s) - i[c] = !0; - return i; - } - e.toHash = a; - function u(s, i) { - return typeof i == "boolean" ? i : Object.keys(i).length === 0 ? !0 : (o(s, i), !p(i, s.self.RULES.all)); - } - e.alwaysValidSchema = u; - function o(s, i = s.schema) { - const { opts: c, self: m } = s; - if (!c.strictSchema || typeof i == "boolean") - return; - const h = m.RULES.keywords; - for (const C in i) - h[C] || d(s, `unknown keyword: "${C}"`); - } - e.checkUnknownRules = o; - function p(s, i) { - if (typeof s == "boolean") - return !s; - for (const c in s) - if (i[c]) - return !0; - return !1; - } - e.schemaHasRules = p; - function y(s, i) { - if (typeof s == "boolean") - return !s; - for (const c in s) - if (c !== "$ref" && i.all[c]) - return !0; - return !1; - } - e.schemaHasRulesButRef = y; - function b({ topSchemaRef: s, schemaPath: i }, c, m, h) { - if (!h) { - if (typeof c == "number" || typeof c == "boolean") - return c; - if (typeof c == "string") - return (0, r._)`${c}`; - } - return (0, r._)`${s}${i}${(0, r.getProperty)(m)}`; - } - e.schemaRefOrVal = b; - function v(s) { - return z(decodeURIComponent(s)); - } - e.unescapeFragment = v; - function g(s) { - return encodeURIComponent(S(s)); - } - e.escapeFragment = g; - function S(s) { - return typeof s == "number" ? `${s}` : s.replace(/~/g, "~0").replace(/\//g, "~1"); - } - e.escapeJsonPointer = S; - function z(s) { - return s.replace(/~1/g, "/").replace(/~0/g, "~"); - } - e.unescapeJsonPointer = z; - function L(s, i) { - if (Array.isArray(s)) - for (const c of s) - i(c); - else - i(s); - } - e.eachItem = L; - function R({ mergeNames: s, mergeToName: i, mergeValues: c, resultToName: m }) { - return (h, C, U, H) => { - const V = U === void 0 ? C : U instanceof r.Name ? (C instanceof r.Name ? s(h, C, U) : i(h, C, U), U) : C instanceof r.Name ? (i(h, U, C), C) : c(C, U); - return H === r.Name && !(V instanceof r.Name) ? m(h, V) : V; - }; - } - e.mergeEvaluated = { - props: R({ - mergeNames: (s, i, c) => s.if((0, r._)`${c} !== true && ${i} !== undefined`, () => { - s.if((0, r._)`${i} === true`, () => s.assign(c, !0), () => s.assign(c, (0, r._)`${c} || {}`).code((0, r._)`Object.assign(${c}, ${i})`)); - }), - mergeToName: (s, i, c) => s.if((0, r._)`${c} !== true`, () => { - i === !0 ? s.assign(c, !0) : (s.assign(c, (0, r._)`${c} || {}`), T(s, c, i)); - }), - mergeValues: (s, i) => s === !0 ? !0 : { ...s, ...i }, - resultToName: j - }), - items: R({ - mergeNames: (s, i, c) => s.if((0, r._)`${c} !== true && ${i} !== undefined`, () => s.assign(c, (0, r._)`${i} === true ? true : ${c} > ${i} ? ${c} : ${i}`)), - mergeToName: (s, i, c) => s.if((0, r._)`${c} !== true`, () => s.assign(c, i === !0 ? !0 : (0, r._)`${c} > ${i} ? ${c} : ${i}`)), - mergeValues: (s, i) => s === !0 ? !0 : Math.max(s, i), - resultToName: (s, i) => s.var("items", i) - }) - }; - function j(s, i) { - if (i === !0) - return s.var("props", !0); - const c = s.var("props", (0, r._)`{}`); - return i !== void 0 && T(s, c, i), c; - } - e.evaluatedPropsToName = j; - function T(s, i, c) { - Object.keys(c).forEach((m) => s.assign((0, r._)`${i}${(0, r.getProperty)(m)}`, !0)); - } - e.setEvaluated = T; - const $ = {}; - function O(s, i) { - return s.scopeValue("func", { - ref: i, - code: $[i.code] || ($[i.code] = new n._Code(i.code)) - }); - } - e.useFunc = O; - var D; - (function(s) { - s[s.Num = 0] = "Num", s[s.Str = 1] = "Str"; - })(D = e.Type || (e.Type = {})); - function t(s, i, c) { - if (s instanceof r.Name) { - const m = i === D.Num; - return c ? m ? (0, r._)`"[" + ${s} + "]"` : (0, r._)`"['" + ${s} + "']"` : m ? (0, r._)`"/" + ${s}` : (0, r._)`"/" + ${s}.replace(/~/g, "~0").replace(/\\//g, "~1")`; - } - return c ? (0, r.getProperty)(s).toString() : "/" + S(s); - } - e.getErrorPath = t; - function d(s, i, c = s.opts.strictSchema) { - if (c) { - if (i = `strict mode: ${i}`, c === !0) - throw new Error(i); - s.self.logger.warn(i); - } - } - e.checkStrictMode = d; -})(ie); -var Qe = {}; -Object.defineProperty(Qe, "__esModule", { value: !0 }); -const Pe = se, Os = { - // validation function arguments - data: new Pe.Name("data"), - // args passed from referencing schema - valCxt: new Pe.Name("valCxt"), - instancePath: new Pe.Name("instancePath"), - parentData: new Pe.Name("parentData"), - parentDataProperty: new Pe.Name("parentDataProperty"), - rootData: new Pe.Name("rootData"), - dynamicAnchors: new Pe.Name("dynamicAnchors"), - // function scoped variables - vErrors: new Pe.Name("vErrors"), - errors: new Pe.Name("errors"), - this: new Pe.Name("this"), - // "globals" - self: new Pe.Name("self"), - scope: new Pe.Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new Pe.Name("json"), - jsonPos: new Pe.Name("jsonPos"), - jsonLen: new Pe.Name("jsonLen"), - jsonPart: new Pe.Name("jsonPart") -}; -Qe.default = Os; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0; - const r = se, n = ie, a = Qe; - e.keywordError = { - message: ({ keyword: T }) => (0, r.str)`must pass "${T}" keyword validation` - }, e.keyword$DataError = { - message: ({ keyword: T, schemaType: $ }) => $ ? (0, r.str)`"${T}" keyword must be ${$} ($data)` : (0, r.str)`"${T}" keyword is invalid ($data)` - }; - function u(T, $ = e.keywordError, O, D) { - const { it: t } = T, { gen: d, compositeRule: s, allErrors: i } = t, c = S(T, $, O); - D ?? (s || i) ? b(d, c) : v(t, (0, r._)`[${c}]`); - } - e.reportError = u; - function o(T, $ = e.keywordError, O) { - const { it: D } = T, { gen: t, compositeRule: d, allErrors: s } = D, i = S(T, $, O); - b(t, i), d || s || v(D, a.default.vErrors); - } - e.reportExtraError = o; - function p(T, $) { - T.assign(a.default.errors, $), T.if((0, r._)`${a.default.vErrors} !== null`, () => T.if($, () => T.assign((0, r._)`${a.default.vErrors}.length`, $), () => T.assign(a.default.vErrors, null))); - } - e.resetErrorsCount = p; - function y({ gen: T, keyword: $, schemaValue: O, data: D, errsCount: t, it: d }) { - if (t === void 0) - throw new Error("ajv implementation error"); - const s = T.name("err"); - T.forRange("i", t, a.default.errors, (i) => { - T.const(s, (0, r._)`${a.default.vErrors}[${i}]`), T.if((0, r._)`${s}.instancePath === undefined`, () => T.assign((0, r._)`${s}.instancePath`, (0, r.strConcat)(a.default.instancePath, d.errorPath))), T.assign((0, r._)`${s}.schemaPath`, (0, r.str)`${d.errSchemaPath}/${$}`), d.opts.verbose && (T.assign((0, r._)`${s}.schema`, O), T.assign((0, r._)`${s}.data`, D)); - }); - } - e.extendErrors = y; - function b(T, $) { - const O = T.const("err", $); - T.if((0, r._)`${a.default.vErrors} === null`, () => T.assign(a.default.vErrors, (0, r._)`[${O}]`), (0, r._)`${a.default.vErrors}.push(${O})`), T.code((0, r._)`${a.default.errors}++`); - } - function v(T, $) { - const { gen: O, validateName: D, schemaEnv: t } = T; - t.$async ? O.throw((0, r._)`new ${T.ValidationError}(${$})`) : (O.assign((0, r._)`${D}.errors`, $), O.return(!1)); - } - const g = { - keyword: new r.Name("keyword"), - schemaPath: new r.Name("schemaPath"), - params: new r.Name("params"), - propertyName: new r.Name("propertyName"), - message: new r.Name("message"), - schema: new r.Name("schema"), - parentSchema: new r.Name("parentSchema") - }; - function S(T, $, O) { - const { createErrors: D } = T.it; - return D === !1 ? (0, r._)`{}` : z(T, $, O); - } - function z(T, $, O = {}) { - const { gen: D, it: t } = T, d = [ - L(t, O), - R(T, O) - ]; - return j(T, $, d), D.object(...d); - } - function L({ errorPath: T }, { instancePath: $ }) { - const O = $ ? (0, r.str)`${T}${(0, n.getErrorPath)($, n.Type.Str)}` : T; - return [a.default.instancePath, (0, r.strConcat)(a.default.instancePath, O)]; - } - function R({ keyword: T, it: { errSchemaPath: $ } }, { schemaPath: O, parentSchema: D }) { - let t = D ? $ : (0, r.str)`${$}/${T}`; - return O && (t = (0, r.str)`${t}${(0, n.getErrorPath)(O, n.Type.Str)}`), [g.schemaPath, t]; - } - function j(T, { params: $, message: O }, D) { - const { keyword: t, data: d, schemaValue: s, it: i } = T, { opts: c, propertyName: m, topSchemaRef: h, schemaPath: C } = i; - D.push([g.keyword, t], [g.params, typeof $ == "function" ? $(T) : $ || (0, r._)`{}`]), c.messages && D.push([g.message, typeof O == "function" ? O(T) : O]), c.verbose && D.push([g.schema, s], [g.parentSchema, (0, r._)`${h}${C}`], [a.default.data, d]), m && D.push([g.propertyName, m]); - } -})(et); -Object.defineProperty(Rr, "__esModule", { value: !0 }); -Rr.boolOrEmptySchema = Rr.topBoolOrEmptySchema = void 0; -const Ns = et, Rs = se, As = Qe, Is = { - message: "boolean schema is false" -}; -function Ms(e) { - const { gen: r, schema: n, validateName: a } = e; - n === !1 ? Cn(e, !1) : typeof n == "object" && n.$async === !0 ? r.return(As.default.data) : (r.assign((0, Rs._)`${a}.errors`, null), r.return(!0)); -} -Rr.topBoolOrEmptySchema = Ms; -function Ds(e, r) { - const { gen: n, schema: a } = e; - a === !1 ? (n.var(r, !1), Cn(e)) : n.var(r, !0); -} -Rr.boolOrEmptySchema = Ds; -function Cn(e, r) { - const { gen: n, data: a } = e, u = { - gen: n, - keyword: "false schema", - data: a, - schema: !1, - schemaCode: !1, - schemaValue: !1, - params: {}, - it: e - }; - (0, Ns.reportError)(u, Is, void 0, r); -} -var rt = {}, vr = {}; -Object.defineProperty(vr, "__esModule", { value: !0 }); -vr.getRules = vr.isJSONType = void 0; -const Ls = ["string", "number", "integer", "boolean", "null", "object", "array"], zs = new Set(Ls); -function Vs(e) { - return typeof e == "string" && zs.has(e); -} -vr.isJSONType = Vs; -function Fs() { - const e = { - number: { type: "number", rules: [] }, - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] } - }; - return { - types: { ...e, integer: !0, boolean: !0, null: !0 }, - rules: [{ rules: [] }, e.number, e.string, e.array, e.object], - post: { rules: [] }, - all: {}, - keywords: {} - }; -} -vr.getRules = Fs; -var rr = {}; -Object.defineProperty(rr, "__esModule", { value: !0 }); -rr.shouldUseRule = rr.shouldUseGroup = rr.schemaHasRulesForType = void 0; -function Us({ schema: e, self: r }, n) { - const a = r.RULES.types[n]; - return a && a !== !0 && Tn(e, a); -} -rr.schemaHasRulesForType = Us; -function Tn(e, r) { - return r.rules.some((n) => jn(e, n)); -} -rr.shouldUseGroup = Tn; -function jn(e, r) { - var n; - return e[r.keyword] !== void 0 || ((n = r.definition.implements) === null || n === void 0 ? void 0 : n.some((a) => e[a] !== void 0)); -} -rr.shouldUseRule = jn; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0; - const r = vr, n = rr, a = et, u = se, o = ie; - var p; - (function(D) { - D[D.Correct = 0] = "Correct", D[D.Wrong = 1] = "Wrong"; - })(p = e.DataType || (e.DataType = {})); - function y(D) { - const t = b(D.type); - if (t.includes("null")) { - if (D.nullable === !1) - throw new Error("type: null contradicts nullable: false"); - } else { - if (!t.length && D.nullable !== void 0) - throw new Error('"nullable" cannot be used without "type"'); - D.nullable === !0 && t.push("null"); - } - return t; - } - e.getSchemaTypes = y; - function b(D) { - const t = Array.isArray(D) ? D : D ? [D] : []; - if (t.every(r.isJSONType)) - return t; - throw new Error("type must be JSONType or JSONType[]: " + t.join(",")); - } - e.getJSONTypes = b; - function v(D, t) { - const { gen: d, data: s, opts: i } = D, c = S(t, i.coerceTypes), m = t.length > 0 && !(c.length === 0 && t.length === 1 && (0, n.schemaHasRulesForType)(D, t[0])); - if (m) { - const h = j(t, s, i.strictNumbers, p.Wrong); - d.if(h, () => { - c.length ? z(D, t, c) : $(D); - }); - } - return m; - } - e.coerceAndCheckDataType = v; - const g = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); - function S(D, t) { - return t ? D.filter((d) => g.has(d) || t === "array" && d === "array") : []; - } - function z(D, t, d) { - const { gen: s, data: i, opts: c } = D, m = s.let("dataType", (0, u._)`typeof ${i}`), h = s.let("coerced", (0, u._)`undefined`); - c.coerceTypes === "array" && s.if((0, u._)`${m} == 'object' && Array.isArray(${i}) && ${i}.length == 1`, () => s.assign(i, (0, u._)`${i}[0]`).assign(m, (0, u._)`typeof ${i}`).if(j(t, i, c.strictNumbers), () => s.assign(h, i))), s.if((0, u._)`${h} !== undefined`); - for (const U of d) - (g.has(U) || U === "array" && c.coerceTypes === "array") && C(U); - s.else(), $(D), s.endIf(), s.if((0, u._)`${h} !== undefined`, () => { - s.assign(i, h), L(D, h); - }); - function C(U) { - switch (U) { - case "string": - s.elseIf((0, u._)`${m} == "number" || ${m} == "boolean"`).assign(h, (0, u._)`"" + ${i}`).elseIf((0, u._)`${i} === null`).assign(h, (0, u._)`""`); - return; - case "number": - s.elseIf((0, u._)`${m} == "boolean" || ${i} === null - || (${m} == "string" && ${i} && ${i} == +${i})`).assign(h, (0, u._)`+${i}`); - return; - case "integer": - s.elseIf((0, u._)`${m} === "boolean" || ${i} === null - || (${m} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(h, (0, u._)`+${i}`); - return; - case "boolean": - s.elseIf((0, u._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(h, !1).elseIf((0, u._)`${i} === "true" || ${i} === 1`).assign(h, !0); - return; - case "null": - s.elseIf((0, u._)`${i} === "" || ${i} === 0 || ${i} === false`), s.assign(h, null); - return; - case "array": - s.elseIf((0, u._)`${m} === "string" || ${m} === "number" - || ${m} === "boolean" || ${i} === null`).assign(h, (0, u._)`[${i}]`); - } - } - } - function L({ gen: D, parentData: t, parentDataProperty: d }, s) { - D.if((0, u._)`${t} !== undefined`, () => D.assign((0, u._)`${t}[${d}]`, s)); - } - function R(D, t, d, s = p.Correct) { - const i = s === p.Correct ? u.operators.EQ : u.operators.NEQ; - let c; - switch (D) { - case "null": - return (0, u._)`${t} ${i} null`; - case "array": - c = (0, u._)`Array.isArray(${t})`; - break; - case "object": - c = (0, u._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`; - break; - case "integer": - c = m((0, u._)`!(${t} % 1) && !isNaN(${t})`); - break; - case "number": - c = m(); - break; - default: - return (0, u._)`typeof ${t} ${i} ${D}`; - } - return s === p.Correct ? c : (0, u.not)(c); - function m(h = u.nil) { - return (0, u.and)((0, u._)`typeof ${t} == "number"`, h, d ? (0, u._)`isFinite(${t})` : u.nil); - } - } - e.checkDataType = R; - function j(D, t, d, s) { - if (D.length === 1) - return R(D[0], t, d, s); - let i; - const c = (0, o.toHash)(D); - if (c.array && c.object) { - const m = (0, u._)`typeof ${t} != "object"`; - i = c.null ? m : (0, u._)`!${t} || ${m}`, delete c.null, delete c.array, delete c.object; - } else - i = u.nil; - c.number && delete c.integer; - for (const m in c) - i = (0, u.and)(i, R(m, t, d, s)); - return i; - } - e.checkDataTypes = j; - const T = { - message: ({ schema: D }) => `must be ${D}`, - params: ({ schema: D, schemaValue: t }) => typeof D == "string" ? (0, u._)`{type: ${D}}` : (0, u._)`{type: ${t}}` - }; - function $(D) { - const t = O(D); - (0, a.reportError)(t, T); - } - e.reportTypeError = $; - function O(D) { - const { gen: t, data: d, schema: s } = D, i = (0, o.schemaRefOrVal)(D, s, "type"); - return { - gen: t, - keyword: "type", - data: d, - schema: s.type, - schemaCode: i, - schemaValue: i, - parentSchema: s, - params: {}, - it: D - }; - } -})(rt); -var Ct = {}; -Object.defineProperty(Ct, "__esModule", { value: !0 }); -Ct.assignDefaults = void 0; -const Sr = se, Bs = ie; -function Hs(e, r) { - const { properties: n, items: a } = e.schema; - if (r === "object" && n) - for (const u in n) - Ka(e, u, n[u].default); - else - r === "array" && Array.isArray(a) && a.forEach((u, o) => Ka(e, o, u.default)); -} -Ct.assignDefaults = Hs; -function Ka(e, r, n) { - const { gen: a, compositeRule: u, data: o, opts: p } = e; - if (n === void 0) - return; - const y = (0, Sr._)`${o}${(0, Sr.getProperty)(r)}`; - if (u) { - (0, Bs.checkStrictMode)(e, `default is ignored for: ${y}`); - return; - } - let b = (0, Sr._)`${y} === undefined`; - p.useDefaults === "empty" && (b = (0, Sr._)`${b} || ${y} === null || ${y} === ""`), a.if(b, (0, Sr._)`${y} = ${(0, Sr.stringify)(n)}`); -} -var Xe = {}, ne = {}; -Object.defineProperty(ne, "__esModule", { value: !0 }); -ne.validateUnion = ne.validateArray = ne.usePattern = ne.callValidateCode = ne.schemaProperties = ne.allSchemaProperties = ne.noPropertyInData = ne.propertyInData = ne.isOwnProperty = ne.hasPropFunc = ne.reportMissingProp = ne.checkMissingProp = ne.checkReportMissingProp = void 0; -const pe = se, Kt = ie, nr = Qe, qs = ie; -function Gs(e, r) { - const { gen: n, data: a, it: u } = e; - n.if(Jt(n, a, r, u.opts.ownProperties), () => { - e.setParams({ missingProperty: (0, pe._)`${r}` }, !0), e.error(); - }); -} -ne.checkReportMissingProp = Gs; -function Ks({ gen: e, data: r, it: { opts: n } }, a, u) { - return (0, pe.or)(...a.map((o) => (0, pe.and)(Jt(e, r, o, n.ownProperties), (0, pe._)`${u} = ${o}`))); -} -ne.checkMissingProp = Ks; -function Ws(e, r) { - e.setParams({ missingProperty: r }, !0), e.error(); -} -ne.reportMissingProp = Ws; -function On(e) { - return e.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: (0, pe._)`Object.prototype.hasOwnProperty` - }); -} -ne.hasPropFunc = On; -function Wt(e, r, n) { - return (0, pe._)`${On(e)}.call(${r}, ${n})`; -} -ne.isOwnProperty = Wt; -function Js(e, r, n, a) { - const u = (0, pe._)`${r}${(0, pe.getProperty)(n)} !== undefined`; - return a ? (0, pe._)`${u} && ${Wt(e, r, n)}` : u; -} -ne.propertyInData = Js; -function Jt(e, r, n, a) { - const u = (0, pe._)`${r}${(0, pe.getProperty)(n)} === undefined`; - return a ? (0, pe.or)(u, (0, pe.not)(Wt(e, r, n))) : u; -} -ne.noPropertyInData = Jt; -function Nn(e) { - return e ? Object.keys(e).filter((r) => r !== "__proto__") : []; -} -ne.allSchemaProperties = Nn; -function Zs(e, r) { - return Nn(r).filter((n) => !(0, Kt.alwaysValidSchema)(e, r[n])); -} -ne.schemaProperties = Zs; -function Ys({ schemaCode: e, data: r, it: { gen: n, topSchemaRef: a, schemaPath: u, errorPath: o }, it: p }, y, b, v) { - const g = v ? (0, pe._)`${e}, ${r}, ${a}${u}` : r, S = [ - [nr.default.instancePath, (0, pe.strConcat)(nr.default.instancePath, o)], - [nr.default.parentData, p.parentData], - [nr.default.parentDataProperty, p.parentDataProperty], - [nr.default.rootData, nr.default.rootData] - ]; - p.opts.dynamicRef && S.push([nr.default.dynamicAnchors, nr.default.dynamicAnchors]); - const z = (0, pe._)`${g}, ${n.object(...S)}`; - return b !== pe.nil ? (0, pe._)`${y}.call(${b}, ${z})` : (0, pe._)`${y}(${z})`; -} -ne.callValidateCode = Ys; -const Xs = (0, pe._)`new RegExp`; -function Qs({ gen: e, it: { opts: r } }, n) { - const a = r.unicodeRegExp ? "u" : "", { regExp: u } = r.code, o = u(n, a); - return e.scopeValue("pattern", { - key: o.toString(), - ref: o, - code: (0, pe._)`${u.code === "new RegExp" ? Xs : (0, qs.useFunc)(e, u)}(${n}, ${a})` - }); -} -ne.usePattern = Qs; -function xs(e) { - const { gen: r, data: n, keyword: a, it: u } = e, o = r.name("valid"); - if (u.allErrors) { - const y = r.let("valid", !0); - return p(() => r.assign(y, !1)), y; - } - return r.var(o, !0), p(() => r.break()), o; - function p(y) { - const b = r.const("len", (0, pe._)`${n}.length`); - r.forRange("i", 0, b, (v) => { - e.subschema({ - keyword: a, - dataProp: v, - dataPropType: Kt.Type.Num - }, o), r.if((0, pe.not)(o), y); - }); - } -} -ne.validateArray = xs; -function ed(e) { - const { gen: r, schema: n, keyword: a, it: u } = e; - if (!Array.isArray(n)) - throw new Error("ajv implementation error"); - if (n.some((b) => (0, Kt.alwaysValidSchema)(u, b)) && !u.opts.unevaluated) - return; - const p = r.let("valid", !1), y = r.name("_valid"); - r.block(() => n.forEach((b, v) => { - const g = e.subschema({ - keyword: a, - schemaProp: v, - compositeRule: !0 - }, y); - r.assign(p, (0, pe._)`${p} || ${y}`), e.mergeValidEvaluated(g, y) || r.if((0, pe.not)(p)); - })), e.result(p, () => e.reset(), () => e.error(!0)); -} -ne.validateUnion = ed; -Object.defineProperty(Xe, "__esModule", { value: !0 }); -Xe.validateKeywordUsage = Xe.validSchemaType = Xe.funcKeywordCode = Xe.macroKeywordCode = void 0; -const Se = se, mr = Qe, rd = ne, td = et; -function ad(e, r) { - const { gen: n, keyword: a, schema: u, parentSchema: o, it: p } = e, y = r.macro.call(p.self, u, o, p), b = Rn(n, a, y); - p.opts.validateSchema !== !1 && p.self.validateSchema(y, !0); - const v = n.name("valid"); - e.subschema({ - schema: y, - schemaPath: Se.nil, - errSchemaPath: `${p.errSchemaPath}/${a}`, - topSchemaRef: b, - compositeRule: !0 - }, v), e.pass(v, () => e.error(!0)); -} -Xe.macroKeywordCode = ad; -function nd(e, r) { - var n; - const { gen: a, keyword: u, schema: o, parentSchema: p, $data: y, it: b } = e; - dd(b, r); - const v = !y && r.compile ? r.compile.call(b.self, o, p, b) : r.validate, g = Rn(a, u, v), S = a.let("valid"); - e.block$data(S, z), e.ok((n = r.valid) !== null && n !== void 0 ? n : S); - function z() { - if (r.errors === !1) - j(), r.modifying && Wa(e), T(() => e.error()); - else { - const $ = r.async ? L() : R(); - r.modifying && Wa(e), T(() => sd(e, $)); - } - } - function L() { - const $ = a.let("ruleErrs", null); - return a.try(() => j((0, Se._)`await `), (O) => a.assign(S, !1).if((0, Se._)`${O} instanceof ${b.ValidationError}`, () => a.assign($, (0, Se._)`${O}.errors`), () => a.throw(O))), $; - } - function R() { - const $ = (0, Se._)`${g}.errors`; - return a.assign($, null), j(Se.nil), $; - } - function j($ = r.async ? (0, Se._)`await ` : Se.nil) { - const O = b.opts.passContext ? mr.default.this : mr.default.self, D = !("compile" in r && !y || r.schema === !1); - a.assign(S, (0, Se._)`${$}${(0, rd.callValidateCode)(e, g, O, D)}`, r.modifying); - } - function T($) { - var O; - a.if((0, Se.not)((O = r.valid) !== null && O !== void 0 ? O : S), $); - } -} -Xe.funcKeywordCode = nd; -function Wa(e) { - const { gen: r, data: n, it: a } = e; - r.if(a.parentData, () => r.assign(n, (0, Se._)`${a.parentData}[${a.parentDataProperty}]`)); -} -function sd(e, r) { - const { gen: n } = e; - n.if((0, Se._)`Array.isArray(${r})`, () => { - n.assign(mr.default.vErrors, (0, Se._)`${mr.default.vErrors} === null ? ${r} : ${mr.default.vErrors}.concat(${r})`).assign(mr.default.errors, (0, Se._)`${mr.default.vErrors}.length`), (0, td.extendErrors)(e); - }, () => e.error()); -} -function dd({ schemaEnv: e }, r) { - if (r.async && !e.$async) - throw new Error("async keyword in sync schema"); -} -function Rn(e, r, n) { - if (n === void 0) - throw new Error(`keyword "${r}" failed to compile`); - return e.scopeValue("keyword", typeof n == "function" ? { ref: n } : { ref: n, code: (0, Se.stringify)(n) }); -} -function ud(e, r, n = !1) { - return !r.length || r.some((a) => a === "array" ? Array.isArray(e) : a === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == a || n && typeof e > "u"); -} -Xe.validSchemaType = ud; -function id({ schema: e, opts: r, self: n, errSchemaPath: a }, u, o) { - if (Array.isArray(u.keyword) ? !u.keyword.includes(o) : u.keyword !== o) - throw new Error("ajv implementation error"); - const p = u.dependencies; - if (p != null && p.some((y) => !Object.prototype.hasOwnProperty.call(e, y))) - throw new Error(`parent schema must have dependencies of ${o}: ${p.join(",")}`); - if (u.validateSchema && !u.validateSchema(e[o])) { - const b = `keyword "${o}" value is invalid at path "${a}": ` + n.errorsText(u.validateSchema.errors); - if (r.validateSchema === "log") - n.logger.error(b); - else - throw new Error(b); - } -} -Xe.validateKeywordUsage = id; -var ir = {}; -Object.defineProperty(ir, "__esModule", { value: !0 }); -ir.extendSubschemaMode = ir.extendSubschemaData = ir.getSubschema = void 0; -const Ye = se, An = ie; -function od(e, { keyword: r, schemaProp: n, schema: a, schemaPath: u, errSchemaPath: o, topSchemaRef: p }) { - if (r !== void 0 && a !== void 0) - throw new Error('both "keyword" and "schema" passed, only one allowed'); - if (r !== void 0) { - const y = e.schema[r]; - return n === void 0 ? { - schema: y, - schemaPath: (0, Ye._)`${e.schemaPath}${(0, Ye.getProperty)(r)}`, - errSchemaPath: `${e.errSchemaPath}/${r}` - } : { - schema: y[n], - schemaPath: (0, Ye._)`${e.schemaPath}${(0, Ye.getProperty)(r)}${(0, Ye.getProperty)(n)}`, - errSchemaPath: `${e.errSchemaPath}/${r}/${(0, An.escapeFragment)(n)}` - }; - } - if (a !== void 0) { - if (u === void 0 || o === void 0 || p === void 0) - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); - return { - schema: a, - schemaPath: u, - topSchemaRef: p, - errSchemaPath: o - }; - } - throw new Error('either "keyword" or "schema" must be passed'); -} -ir.getSubschema = od; -function cd(e, r, { dataProp: n, dataPropType: a, data: u, dataTypes: o, propertyName: p }) { - if (u !== void 0 && n !== void 0) - throw new Error('both "data" and "dataProp" passed, only one allowed'); - const { gen: y } = r; - if (n !== void 0) { - const { errorPath: v, dataPathArr: g, opts: S } = r, z = y.let("data", (0, Ye._)`${r.data}${(0, Ye.getProperty)(n)}`, !0); - b(z), e.errorPath = (0, Ye.str)`${v}${(0, An.getErrorPath)(n, a, S.jsPropertySyntax)}`, e.parentDataProperty = (0, Ye._)`${n}`, e.dataPathArr = [...g, e.parentDataProperty]; - } - if (u !== void 0) { - const v = u instanceof Ye.Name ? u : y.let("data", u, !0); - b(v), p !== void 0 && (e.propertyName = p); - } - o && (e.dataTypes = o); - function b(v) { - e.data = v, e.dataLevel = r.dataLevel + 1, e.dataTypes = [], r.definedProperties = /* @__PURE__ */ new Set(), e.parentData = r.data, e.dataNames = [...r.dataNames, v]; - } -} -ir.extendSubschemaData = cd; -function ld(e, { jtdDiscriminator: r, jtdMetadata: n, compositeRule: a, createErrors: u, allErrors: o }) { - a !== void 0 && (e.compositeRule = a), u !== void 0 && (e.createErrors = u), o !== void 0 && (e.allErrors = o), e.jtdDiscriminator = r, e.jtdMetadata = n; -} -ir.extendSubschemaMode = ld; -var ke = {}, In = function e(r, n) { - if (r === n) - return !0; - if (r && n && typeof r == "object" && typeof n == "object") { - if (r.constructor !== n.constructor) - return !1; - var a, u, o; - if (Array.isArray(r)) { - if (a = r.length, a != n.length) - return !1; - for (u = a; u-- !== 0; ) - if (!e(r[u], n[u])) - return !1; - return !0; - } - if (r.constructor === RegExp) - return r.source === n.source && r.flags === n.flags; - if (r.valueOf !== Object.prototype.valueOf) - return r.valueOf() === n.valueOf(); - if (r.toString !== Object.prototype.toString) - return r.toString() === n.toString(); - if (o = Object.keys(r), a = o.length, a !== Object.keys(n).length) - return !1; - for (u = a; u-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(n, o[u])) - return !1; - for (u = a; u-- !== 0; ) { - var p = o[u]; - if (!e(r[p], n[p])) - return !1; - } - return !0; - } - return r !== r && n !== n; -}, Mn = { exports: {} }, ur = Mn.exports = function(e, r, n) { - typeof r == "function" && (n = r, r = {}), n = r.cb || n; - var a = typeof n == "function" ? n : n.pre || function() { - }, u = n.post || function() { - }; - mt(r, a, u, e, "", e); -}; -ur.keywords = { - additionalItems: !0, - items: !0, - contains: !0, - additionalProperties: !0, - propertyNames: !0, - not: !0, - if: !0, - then: !0, - else: !0 -}; -ur.arrayKeywords = { - items: !0, - allOf: !0, - anyOf: !0, - oneOf: !0 -}; -ur.propsKeywords = { - $defs: !0, - definitions: !0, - properties: !0, - patternProperties: !0, - dependencies: !0 -}; -ur.skipKeywords = { - default: !0, - enum: !0, - const: !0, - required: !0, - maximum: !0, - minimum: !0, - exclusiveMaximum: !0, - exclusiveMinimum: !0, - multipleOf: !0, - maxLength: !0, - minLength: !0, - pattern: !0, - format: !0, - maxItems: !0, - minItems: !0, - uniqueItems: !0, - maxProperties: !0, - minProperties: !0 -}; -function mt(e, r, n, a, u, o, p, y, b, v) { - if (a && typeof a == "object" && !Array.isArray(a)) { - r(a, u, o, p, y, b, v); - for (var g in a) { - var S = a[g]; - if (Array.isArray(S)) { - if (g in ur.arrayKeywords) - for (var z = 0; z < S.length; z++) - mt(e, r, n, S[z], u + "/" + g + "/" + z, o, u, g, a, z); - } else if (g in ur.propsKeywords) { - if (S && typeof S == "object") - for (var L in S) - mt(e, r, n, S[L], u + "/" + g + "/" + fd(L), o, u, g, a, L); - } else - (g in ur.keywords || e.allKeys && !(g in ur.skipKeywords)) && mt(e, r, n, S, u + "/" + g, o, u, g, a); - } - n(a, u, o, p, y, b, v); - } -} -function fd(e) { - return e.replace(/~/g, "~0").replace(/\//g, "~1"); -} -var hd = Mn.exports; -Object.defineProperty(ke, "__esModule", { value: !0 }); -ke.getSchemaRefs = ke.resolveUrl = ke.normalizeId = ke._getFullPath = ke.getFullPath = ke.inlineRef = void 0; -const pd = ie, md = In, gd = hd, _d = /* @__PURE__ */ new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const" -]); -function vd(e, r = !0) { - return typeof e == "boolean" ? !0 : r === !0 ? !Ft(e) : r ? Dn(e) <= r : !1; -} -ke.inlineRef = vd; -const yd = /* @__PURE__ */ new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor" -]); -function Ft(e) { - for (const r in e) { - if (yd.has(r)) - return !0; - const n = e[r]; - if (Array.isArray(n) && n.some(Ft) || typeof n == "object" && Ft(n)) - return !0; - } - return !1; -} -function Dn(e) { - let r = 0; - for (const n in e) { - if (n === "$ref") - return 1 / 0; - if (r++, !_d.has(n) && (typeof e[n] == "object" && (0, pd.eachItem)(e[n], (a) => r += Dn(a)), r === 1 / 0)) - return 1 / 0; - } - return r; -} -function Ln(e, r = "", n) { - n !== !1 && (r = Or(r)); - const a = e.parse(r); - return zn(e, a); -} -ke.getFullPath = Ln; -function zn(e, r) { - return e.serialize(r).split("#")[0] + "#"; -} -ke._getFullPath = zn; -const wd = /#\/?$/; -function Or(e) { - return e ? e.replace(wd, "") : ""; -} -ke.normalizeId = Or; -function bd(e, r, n) { - return n = Or(n), e.resolve(r, n); -} -ke.resolveUrl = bd; -const $d = /^[a-z_][-a-z0-9._]*$/i; -function Ed(e, r) { - if (typeof e == "boolean") - return {}; - const { schemaId: n, uriResolver: a } = this.opts, u = Or(e[n] || r), o = { "": u }, p = Ln(a, u, !1), y = {}, b = /* @__PURE__ */ new Set(); - return gd(e, { allKeys: !0 }, (S, z, L, R) => { - if (R === void 0) - return; - const j = p + z; - let T = o[R]; - typeof S[n] == "string" && (T = $.call(this, S[n])), O.call(this, S.$anchor), O.call(this, S.$dynamicAnchor), o[z] = T; - function $(D) { - const t = this.opts.uriResolver.resolve; - if (D = Or(T ? t(T, D) : D), b.has(D)) - throw g(D); - b.add(D); - let d = this.refs[D]; - return typeof d == "string" && (d = this.refs[d]), typeof d == "object" ? v(S, d.schema, D) : D !== Or(j) && (D[0] === "#" ? (v(S, y[D], D), y[D] = S) : this.refs[D] = j), D; - } - function O(D) { - if (typeof D == "string") { - if (!$d.test(D)) - throw new Error(`invalid anchor "${D}"`); - $.call(this, `#${D}`); - } - } - }), y; - function v(S, z, L) { - if (z !== void 0 && !md(S, z)) - throw g(L); - } - function g(S) { - return new Error(`reference "${S}" resolves to more than one schema`); - } -} -ke.getSchemaRefs = Ed; -Object.defineProperty(He, "__esModule", { value: !0 }); -He.getData = He.KeywordCxt = He.validateFunctionCode = void 0; -const Vn = Rr, Ja = rt, Zt = rr, wt = rt, kd = Ct, Jr = Xe, Rt = ir, Y = se, x = Qe, Pd = ke, tr = ie, Gr = et; -function Sd(e) { - if (Bn(e) && (Hn(e), Un(e))) { - jd(e); - return; - } - Fn(e, () => (0, Vn.topBoolOrEmptySchema)(e)); -} -He.validateFunctionCode = Sd; -function Fn({ gen: e, validateName: r, schema: n, schemaEnv: a, opts: u }, o) { - u.code.es5 ? e.func(r, (0, Y._)`${x.default.data}, ${x.default.valCxt}`, a.$async, () => { - e.code((0, Y._)`"use strict"; ${Za(n, u)}`), Td(e, u), e.code(o); - }) : e.func(r, (0, Y._)`${x.default.data}, ${Cd(u)}`, a.$async, () => e.code(Za(n, u)).code(o)); -} -function Cd(e) { - return (0, Y._)`{${x.default.instancePath}="", ${x.default.parentData}, ${x.default.parentDataProperty}, ${x.default.rootData}=${x.default.data}${e.dynamicRef ? (0, Y._)`, ${x.default.dynamicAnchors}={}` : Y.nil}}={}`; -} -function Td(e, r) { - e.if(x.default.valCxt, () => { - e.var(x.default.instancePath, (0, Y._)`${x.default.valCxt}.${x.default.instancePath}`), e.var(x.default.parentData, (0, Y._)`${x.default.valCxt}.${x.default.parentData}`), e.var(x.default.parentDataProperty, (0, Y._)`${x.default.valCxt}.${x.default.parentDataProperty}`), e.var(x.default.rootData, (0, Y._)`${x.default.valCxt}.${x.default.rootData}`), r.dynamicRef && e.var(x.default.dynamicAnchors, (0, Y._)`${x.default.valCxt}.${x.default.dynamicAnchors}`); - }, () => { - e.var(x.default.instancePath, (0, Y._)`""`), e.var(x.default.parentData, (0, Y._)`undefined`), e.var(x.default.parentDataProperty, (0, Y._)`undefined`), e.var(x.default.rootData, x.default.data), r.dynamicRef && e.var(x.default.dynamicAnchors, (0, Y._)`{}`); - }); -} -function jd(e) { - const { schema: r, opts: n, gen: a } = e; - Fn(e, () => { - n.$comment && r.$comment && Gn(e), Id(e), a.let(x.default.vErrors, null), a.let(x.default.errors, 0), n.unevaluated && Od(e), qn(e), Ld(e); - }); -} -function Od(e) { - const { gen: r, validateName: n } = e; - e.evaluated = r.const("evaluated", (0, Y._)`${n}.evaluated`), r.if((0, Y._)`${e.evaluated}.dynamicProps`, () => r.assign((0, Y._)`${e.evaluated}.props`, (0, Y._)`undefined`)), r.if((0, Y._)`${e.evaluated}.dynamicItems`, () => r.assign((0, Y._)`${e.evaluated}.items`, (0, Y._)`undefined`)); -} -function Za(e, r) { - const n = typeof e == "object" && e[r.schemaId]; - return n && (r.code.source || r.code.process) ? (0, Y._)`/*# sourceURL=${n} */` : Y.nil; -} -function Nd(e, r) { - if (Bn(e) && (Hn(e), Un(e))) { - Rd(e, r); - return; - } - (0, Vn.boolOrEmptySchema)(e, r); -} -function Un({ schema: e, self: r }) { - if (typeof e == "boolean") - return !e; - for (const n in e) - if (r.RULES.all[n]) - return !0; - return !1; -} -function Bn(e) { - return typeof e.schema != "boolean"; -} -function Rd(e, r) { - const { schema: n, gen: a, opts: u } = e; - u.$comment && n.$comment && Gn(e), Md(e), Dd(e); - const o = a.const("_errs", x.default.errors); - qn(e, o), a.var(r, (0, Y._)`${o} === ${x.default.errors}`); -} -function Hn(e) { - (0, tr.checkUnknownRules)(e), Ad(e); -} -function qn(e, r) { - if (e.opts.jtd) - return Ya(e, [], !1, r); - const n = (0, Ja.getSchemaTypes)(e.schema), a = (0, Ja.coerceAndCheckDataType)(e, n); - Ya(e, n, !a, r); -} -function Ad(e) { - const { schema: r, errSchemaPath: n, opts: a, self: u } = e; - r.$ref && a.ignoreKeywordsWithRef && (0, tr.schemaHasRulesButRef)(r, u.RULES) && u.logger.warn(`$ref: keywords ignored in schema at path "${n}"`); -} -function Id(e) { - const { schema: r, opts: n } = e; - r.default !== void 0 && n.useDefaults && n.strictSchema && (0, tr.checkStrictMode)(e, "default is ignored in the schema root"); -} -function Md(e) { - const r = e.schema[e.opts.schemaId]; - r && (e.baseId = (0, Pd.resolveUrl)(e.opts.uriResolver, e.baseId, r)); -} -function Dd(e) { - if (e.schema.$async && !e.schemaEnv.$async) - throw new Error("async schema in sync schema"); -} -function Gn({ gen: e, schemaEnv: r, schema: n, errSchemaPath: a, opts: u }) { - const o = n.$comment; - if (u.$comment === !0) - e.code((0, Y._)`${x.default.self}.logger.log(${o})`); - else if (typeof u.$comment == "function") { - const p = (0, Y.str)`${a}/$comment`, y = e.scopeValue("root", { ref: r.root }); - e.code((0, Y._)`${x.default.self}.opts.$comment(${o}, ${p}, ${y}.schema)`); - } -} -function Ld(e) { - const { gen: r, schemaEnv: n, validateName: a, ValidationError: u, opts: o } = e; - n.$async ? r.if((0, Y._)`${x.default.errors} === 0`, () => r.return(x.default.data), () => r.throw((0, Y._)`new ${u}(${x.default.vErrors})`)) : (r.assign((0, Y._)`${a}.errors`, x.default.vErrors), o.unevaluated && zd(e), r.return((0, Y._)`${x.default.errors} === 0`)); -} -function zd({ gen: e, evaluated: r, props: n, items: a }) { - n instanceof Y.Name && e.assign((0, Y._)`${r}.props`, n), a instanceof Y.Name && e.assign((0, Y._)`${r}.items`, a); -} -function Ya(e, r, n, a) { - const { gen: u, schema: o, data: p, allErrors: y, opts: b, self: v } = e, { RULES: g } = v; - if (o.$ref && (b.ignoreKeywordsWithRef || !(0, tr.schemaHasRulesButRef)(o, g))) { - u.block(() => Jn(e, "$ref", g.all.$ref.definition)); - return; - } - b.jtd || Vd(e, r), u.block(() => { - for (const z of g.rules) - S(z); - S(g.post); - }); - function S(z) { - (0, Zt.shouldUseGroup)(o, z) && (z.type ? (u.if((0, wt.checkDataType)(z.type, p, b.strictNumbers)), Xa(e, z), r.length === 1 && r[0] === z.type && n && (u.else(), (0, wt.reportTypeError)(e)), u.endIf()) : Xa(e, z), y || u.if((0, Y._)`${x.default.errors} === ${a || 0}`)); - } -} -function Xa(e, r) { - const { gen: n, schema: a, opts: { useDefaults: u } } = e; - u && (0, kd.assignDefaults)(e, r.type), n.block(() => { - for (const o of r.rules) - (0, Zt.shouldUseRule)(a, o) && Jn(e, o.keyword, o.definition, r.type); - }); -} -function Vd(e, r) { - e.schemaEnv.meta || !e.opts.strictTypes || (Fd(e, r), e.opts.allowUnionTypes || Ud(e, r), Bd(e, e.dataTypes)); -} -function Fd(e, r) { - if (r.length) { - if (!e.dataTypes.length) { - e.dataTypes = r; - return; - } - r.forEach((n) => { - Kn(e.dataTypes, n) || Yt(e, `type "${n}" not allowed by context "${e.dataTypes.join(",")}"`); - }), qd(e, r); - } -} -function Ud(e, r) { - r.length > 1 && !(r.length === 2 && r.includes("null")) && Yt(e, "use allowUnionTypes to allow union type keyword"); -} -function Bd(e, r) { - const n = e.self.RULES.all; - for (const a in n) { - const u = n[a]; - if (typeof u == "object" && (0, Zt.shouldUseRule)(e.schema, u)) { - const { type: o } = u.definition; - o.length && !o.some((p) => Hd(r, p)) && Yt(e, `missing type "${o.join(",")}" for keyword "${a}"`); - } - } -} -function Hd(e, r) { - return e.includes(r) || r === "number" && e.includes("integer"); -} -function Kn(e, r) { - return e.includes(r) || r === "integer" && e.includes("number"); -} -function qd(e, r) { - const n = []; - for (const a of e.dataTypes) - Kn(r, a) ? n.push(a) : r.includes("integer") && a === "number" && n.push("integer"); - e.dataTypes = n; -} -function Yt(e, r) { - const n = e.schemaEnv.baseId + e.errSchemaPath; - r += ` at "${n}" (strictTypes)`, (0, tr.checkStrictMode)(e, r, e.opts.strictTypes); -} -class Wn { - constructor(r, n, a) { - if ((0, Jr.validateKeywordUsage)(r, n, a), this.gen = r.gen, this.allErrors = r.allErrors, this.keyword = a, this.data = r.data, this.schema = r.schema[a], this.$data = n.$data && r.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, tr.schemaRefOrVal)(r, this.schema, a, this.$data), this.schemaType = n.schemaType, this.parentSchema = r.schema, this.params = {}, this.it = r, this.def = n, this.$data) - this.schemaCode = r.gen.const("vSchema", Zn(this.$data, r)); - else if (this.schemaCode = this.schemaValue, !(0, Jr.validSchemaType)(this.schema, n.schemaType, n.allowUndefined)) - throw new Error(`${a} value must be ${JSON.stringify(n.schemaType)}`); - ("code" in n ? n.trackErrors : n.errors !== !1) && (this.errsCount = r.gen.const("_errs", x.default.errors)); - } - result(r, n, a) { - this.failResult((0, Y.not)(r), n, a); - } - failResult(r, n, a) { - this.gen.if(r), a ? a() : this.error(), n ? (this.gen.else(), n(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else(); - } - pass(r, n) { - this.failResult((0, Y.not)(r), void 0, n); - } - fail(r) { - if (r === void 0) { - this.error(), this.allErrors || this.gen.if(!1); - return; - } - this.gen.if(r), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else(); - } - fail$data(r) { - if (!this.$data) - return this.fail(r); - const { schemaCode: n } = this; - this.fail((0, Y._)`${n} !== undefined && (${(0, Y.or)(this.invalid$data(), r)})`); - } - error(r, n, a) { - if (n) { - this.setParams(n), this._error(r, a), this.setParams({}); - return; - } - this._error(r, a); - } - _error(r, n) { - (r ? Gr.reportExtraError : Gr.reportError)(this, this.def.error, n); - } - $dataError() { - (0, Gr.reportError)(this, this.def.$dataError || Gr.keyword$DataError); - } - reset() { - if (this.errsCount === void 0) - throw new Error('add "trackErrors" to keyword definition'); - (0, Gr.resetErrorsCount)(this.gen, this.errsCount); - } - ok(r) { - this.allErrors || this.gen.if(r); - } - setParams(r, n) { - n ? Object.assign(this.params, r) : this.params = r; - } - block$data(r, n, a = Y.nil) { - this.gen.block(() => { - this.check$data(r, a), n(); - }); - } - check$data(r = Y.nil, n = Y.nil) { - if (!this.$data) - return; - const { gen: a, schemaCode: u, schemaType: o, def: p } = this; - a.if((0, Y.or)((0, Y._)`${u} === undefined`, n)), r !== Y.nil && a.assign(r, !0), (o.length || p.validateSchema) && (a.elseIf(this.invalid$data()), this.$dataError(), r !== Y.nil && a.assign(r, !1)), a.else(); - } - invalid$data() { - const { gen: r, schemaCode: n, schemaType: a, def: u, it: o } = this; - return (0, Y.or)(p(), y()); - function p() { - if (a.length) { - if (!(n instanceof Y.Name)) - throw new Error("ajv implementation error"); - const b = Array.isArray(a) ? a : [a]; - return (0, Y._)`${(0, wt.checkDataTypes)(b, n, o.opts.strictNumbers, wt.DataType.Wrong)}`; - } - return Y.nil; - } - function y() { - if (u.validateSchema) { - const b = r.scopeValue("validate$data", { ref: u.validateSchema }); - return (0, Y._)`!${b}(${n})`; - } - return Y.nil; - } - } - subschema(r, n) { - const a = (0, Rt.getSubschema)(this.it, r); - (0, Rt.extendSubschemaData)(a, this.it, r), (0, Rt.extendSubschemaMode)(a, r); - const u = { ...this.it, ...a, items: void 0, props: void 0 }; - return Nd(u, n), u; - } - mergeEvaluated(r, n) { - const { it: a, gen: u } = this; - a.opts.unevaluated && (a.props !== !0 && r.props !== void 0 && (a.props = tr.mergeEvaluated.props(u, r.props, a.props, n)), a.items !== !0 && r.items !== void 0 && (a.items = tr.mergeEvaluated.items(u, r.items, a.items, n))); - } - mergeValidEvaluated(r, n) { - const { it: a, gen: u } = this; - if (a.opts.unevaluated && (a.props !== !0 || a.items !== !0)) - return u.if(n, () => this.mergeEvaluated(r, Y.Name)), !0; - } -} -He.KeywordCxt = Wn; -function Jn(e, r, n, a) { - const u = new Wn(e, n, r); - "code" in n ? n.code(u, a) : u.$data && n.validate ? (0, Jr.funcKeywordCode)(u, n) : "macro" in n ? (0, Jr.macroKeywordCode)(u, n) : (n.compile || n.validate) && (0, Jr.funcKeywordCode)(u, n); -} -const Gd = /^\/(?:[^~]|~0|~1)*$/, Kd = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; -function Zn(e, { dataLevel: r, dataNames: n, dataPathArr: a }) { - let u, o; - if (e === "") - return x.default.rootData; - if (e[0] === "/") { - if (!Gd.test(e)) - throw new Error(`Invalid JSON-pointer: ${e}`); - u = e, o = x.default.rootData; - } else { - const v = Kd.exec(e); - if (!v) - throw new Error(`Invalid JSON-pointer: ${e}`); - const g = +v[1]; - if (u = v[2], u === "#") { - if (g >= r) - throw new Error(b("property/index", g)); - return a[r - g]; - } - if (g > r) - throw new Error(b("data", g)); - if (o = n[r - g], !u) - return o; - } - let p = o; - const y = u.split("/"); - for (const v of y) - v && (o = (0, Y._)`${o}${(0, Y.getProperty)((0, tr.unescapeJsonPointer)(v))}`, p = (0, Y._)`${p} && ${o}`); - return p; - function b(v, g) { - return `Cannot access ${v} ${g} levels up, current level is ${r}`; - } -} -He.getData = Zn; -var tt = {}; -Object.defineProperty(tt, "__esModule", { value: !0 }); -class Wd extends Error { - constructor(r) { - super("validation failed"), this.errors = r, this.ajv = this.validation = !0; - } -} -tt.default = Wd; -var at = {}; -Object.defineProperty(at, "__esModule", { value: !0 }); -const At = ke; -class Jd extends Error { - constructor(r, n, a, u) { - super(u || `can't resolve reference ${a} from id ${n}`), this.missingRef = (0, At.resolveUrl)(r, n, a), this.missingSchema = (0, At.normalizeId)((0, At.getFullPath)(r, this.missingRef)); - } -} -at.default = Jd; -var Re = {}; -Object.defineProperty(Re, "__esModule", { value: !0 }); -Re.resolveSchema = Re.getCompilingSchema = Re.resolveRef = Re.compileSchema = Re.SchemaEnv = void 0; -const Ve = se, Zd = tt, hr = Qe, Be = ke, Qa = ie, Yd = He; -class Tt { - constructor(r) { - var n; - this.refs = {}, this.dynamicAnchors = {}; - let a; - typeof r.schema == "object" && (a = r.schema), this.schema = r.schema, this.schemaId = r.schemaId, this.root = r.root || this, this.baseId = (n = r.baseId) !== null && n !== void 0 ? n : (0, Be.normalizeId)(a == null ? void 0 : a[r.schemaId || "$id"]), this.schemaPath = r.schemaPath, this.localRefs = r.localRefs, this.meta = r.meta, this.$async = a == null ? void 0 : a.$async, this.refs = {}; - } -} -Re.SchemaEnv = Tt; -function Xt(e) { - const r = Yn.call(this, e); - if (r) - return r; - const n = (0, Be.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: a, lines: u } = this.opts.code, { ownProperties: o } = this.opts, p = new Ve.CodeGen(this.scope, { es5: a, lines: u, ownProperties: o }); - let y; - e.$async && (y = p.scopeValue("Error", { - ref: Zd.default, - code: (0, Ve._)`require("ajv/dist/runtime/validation_error").default` - })); - const b = p.scopeName("validate"); - e.validateName = b; - const v = { - gen: p, - allErrors: this.opts.allErrors, - data: hr.default.data, - parentData: hr.default.parentData, - parentDataProperty: hr.default.parentDataProperty, - dataNames: [hr.default.data], - dataPathArr: [Ve.nil], - dataLevel: 0, - dataTypes: [], - definedProperties: /* @__PURE__ */ new Set(), - topSchemaRef: p.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0, Ve.stringify)(e.schema) } : { ref: e.schema }), - validateName: b, - ValidationError: y, - schema: e.schema, - schemaEnv: e, - rootId: n, - baseId: e.baseId || n, - schemaPath: Ve.nil, - errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: (0, Ve._)`""`, - opts: this.opts, - self: this - }; - let g; - try { - this._compilations.add(e), (0, Yd.validateFunctionCode)(v), p.optimize(this.opts.code.optimize); - const S = p.toString(); - g = `${p.scopeRefs(hr.default.scope)}return ${S}`, this.opts.code.process && (g = this.opts.code.process(g, e)); - const L = new Function(`${hr.default.self}`, `${hr.default.scope}`, g)(this, this.scope.get()); - if (this.scope.value(b, { ref: L }), L.errors = null, L.schema = e.schema, L.schemaEnv = e, e.$async && (L.$async = !0), this.opts.code.source === !0 && (L.source = { validateName: b, validateCode: S, scopeValues: p._values }), this.opts.unevaluated) { - const { props: R, items: j } = v; - L.evaluated = { - props: R instanceof Ve.Name ? void 0 : R, - items: j instanceof Ve.Name ? void 0 : j, - dynamicProps: R instanceof Ve.Name, - dynamicItems: j instanceof Ve.Name - }, L.source && (L.source.evaluated = (0, Ve.stringify)(L.evaluated)); - } - return e.validate = L, e; - } catch (S) { - throw delete e.validate, delete e.validateName, g && this.logger.error("Error compiling schema, function code:", g), S; - } finally { - this._compilations.delete(e); - } -} -Re.compileSchema = Xt; -function Xd(e, r, n) { - var a; - n = (0, Be.resolveUrl)(this.opts.uriResolver, r, n); - const u = e.refs[n]; - if (u) - return u; - let o = eu.call(this, e, n); - if (o === void 0) { - const p = (a = e.localRefs) === null || a === void 0 ? void 0 : a[n], { schemaId: y } = this.opts; - p && (o = new Tt({ schema: p, schemaId: y, root: e, baseId: r })); - } - if (o !== void 0) - return e.refs[n] = Qd.call(this, o); -} -Re.resolveRef = Xd; -function Qd(e) { - return (0, Be.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : Xt.call(this, e); -} -function Yn(e) { - for (const r of this._compilations) - if (xd(r, e)) - return r; -} -Re.getCompilingSchema = Yn; -function xd(e, r) { - return e.schema === r.schema && e.root === r.root && e.baseId === r.baseId; -} -function eu(e, r) { - let n; - for (; typeof (n = this.refs[r]) == "string"; ) - r = n; - return n || this.schemas[r] || jt.call(this, e, r); -} -function jt(e, r) { - const n = this.opts.uriResolver.parse(r), a = (0, Be._getFullPath)(this.opts.uriResolver, n); - let u = (0, Be.getFullPath)(this.opts.uriResolver, e.baseId, void 0); - if (Object.keys(e.schema).length > 0 && a === u) - return It.call(this, n, e); - const o = (0, Be.normalizeId)(a), p = this.refs[o] || this.schemas[o]; - if (typeof p == "string") { - const y = jt.call(this, e, p); - return typeof (y == null ? void 0 : y.schema) != "object" ? void 0 : It.call(this, n, y); - } - if (typeof (p == null ? void 0 : p.schema) == "object") { - if (p.validate || Xt.call(this, p), o === (0, Be.normalizeId)(r)) { - const { schema: y } = p, { schemaId: b } = this.opts, v = y[b]; - return v && (u = (0, Be.resolveUrl)(this.opts.uriResolver, u, v)), new Tt({ schema: y, schemaId: b, root: e, baseId: u }); - } - return It.call(this, n, p); - } -} -Re.resolveSchema = jt; -const ru = /* @__PURE__ */ new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions" -]); -function It(e, { baseId: r, schema: n, root: a }) { - var u; - if (((u = e.fragment) === null || u === void 0 ? void 0 : u[0]) !== "/") - return; - for (const y of e.fragment.slice(1).split("/")) { - if (typeof n == "boolean") - return; - const b = n[(0, Qa.unescapeFragment)(y)]; - if (b === void 0) - return; - n = b; - const v = typeof n == "object" && n[this.opts.schemaId]; - !ru.has(y) && v && (r = (0, Be.resolveUrl)(this.opts.uriResolver, r, v)); - } - let o; - if (typeof n != "boolean" && n.$ref && !(0, Qa.schemaHasRulesButRef)(n, this.RULES)) { - const y = (0, Be.resolveUrl)(this.opts.uriResolver, r, n.$ref); - o = jt.call(this, a, y); - } - const { schemaId: p } = this.opts; - if (o = o || new Tt({ schema: n, schemaId: p, root: a, baseId: r }), o.schema !== o.root.schema) - return o; -} -const tu = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", au = "Meta-schema for $data reference (JSON AnySchema extension proposal)", nu = "object", su = [ - "$data" -], du = { - $data: { - type: "string", - anyOf: [ - { - format: "relative-json-pointer" - }, - { - format: "json-pointer" - } - ] - } -}, uu = !1, iu = { - $id: tu, - description: au, - type: nu, - required: su, - properties: du, - additionalProperties: uu -}; -var Qt = {}, Ut = { exports: {} }; -/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -(function(e, r) { - (function(n, a) { - a(r); - })(kn, function(n) { - function a() { - for (var E = arguments.length, f = Array(E), P = 0; P < E; P++) - f[P] = arguments[P]; - if (f.length > 1) { - f[0] = f[0].slice(0, -1); - for (var M = f.length - 1, A = 1; A < M; ++A) - f[A] = f[A].slice(1, -1); - return f[M] = f[M].slice(1), f.join(""); - } else - return f[0]; - } - function u(E) { - return "(?:" + E + ")"; - } - function o(E) { - return E === void 0 ? "undefined" : E === null ? "null" : Object.prototype.toString.call(E).split(" ").pop().split("]").shift().toLowerCase(); - } - function p(E) { - return E.toUpperCase(); - } - function y(E) { - return E != null ? E instanceof Array ? E : typeof E.length != "number" || E.split || E.setInterval || E.call ? [E] : Array.prototype.slice.call(E) : []; - } - function b(E, f) { - var P = E; - if (f) - for (var M in f) - P[M] = f[M]; - return P; - } - function v(E) { - var f = "[A-Za-z]", P = "[0-9]", M = a(P, "[A-Fa-f]"), A = u(u("%[EFef]" + M + "%" + M + M + "%" + M + M) + "|" + u("%[89A-Fa-f]" + M + "%" + M + M) + "|" + u("%" + M + M)), X = "[\\:\\/\\?\\#\\[\\]\\@]", Q = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", ue = a(X, Q), he = E ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", _e = E ? "[\\uE000-\\uF8FF]" : "[]", de = a(f, P, "[\\-\\.\\_\\~]", he); - u(f + a(f, P, "[\\+\\-\\.]") + "*"), u(u(A + "|" + a(de, Q, "[\\:]")) + "*"); - var ce = u(u("25[0-5]") + "|" + u("2[0-4]" + P) + "|" + u("1" + P + P) + "|" + u("0?[1-9]" + P) + "|0?0?" + P), ve = u(ce + "\\." + ce + "\\." + ce + "\\." + ce), ee = u(M + "{1,4}"), me = u(u(ee + "\\:" + ee) + "|" + ve), we = u(u(ee + "\\:") + "{6}" + me), ge = u("\\:\\:" + u(ee + "\\:") + "{5}" + me), ar = u(u(ee) + "?\\:\\:" + u(ee + "\\:") + "{4}" + me), Ke = u(u(u(ee + "\\:") + "{0,1}" + ee) + "?\\:\\:" + u(ee + "\\:") + "{3}" + me), We = u(u(u(ee + "\\:") + "{0,2}" + ee) + "?\\:\\:" + u(ee + "\\:") + "{2}" + me), Pr = u(u(u(ee + "\\:") + "{0,3}" + ee) + "?\\:\\:" + ee + "\\:" + me), lr = u(u(u(ee + "\\:") + "{0,4}" + ee) + "?\\:\\:" + me), Me = u(u(u(ee + "\\:") + "{0,5}" + ee) + "?\\:\\:" + ee), Je = u(u(u(ee + "\\:") + "{0,6}" + ee) + "?\\:\\:"), fr = u([we, ge, ar, Ke, We, Pr, lr, Me, Je].join("|")), er = u(u(de + "|" + A) + "+"); - u("[vV]" + M + "+\\." + a(de, Q, "[\\:]") + "+"), u(u(A + "|" + a(de, Q)) + "*"); - var Hr = u(A + "|" + a(de, Q, "[\\:\\@]")); - return u(u(A + "|" + a(de, Q, "[\\@]")) + "+"), u(u(Hr + "|" + a("[\\/\\?]", _e)) + "*"), { - NOT_SCHEME: new RegExp(a("[^]", f, P, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(a("[^\\%\\:]", de, Q), "g"), - NOT_HOST: new RegExp(a("[^\\%\\[\\]\\:]", de, Q), "g"), - NOT_PATH: new RegExp(a("[^\\%\\/\\:\\@]", de, Q), "g"), - NOT_PATH_NOSCHEME: new RegExp(a("[^\\%\\/\\@]", de, Q), "g"), - NOT_QUERY: new RegExp(a("[^\\%]", de, Q, "[\\:\\@\\/\\?]", _e), "g"), - NOT_FRAGMENT: new RegExp(a("[^\\%]", de, Q, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(a("[^]", de, Q), "g"), - UNRESERVED: new RegExp(de, "g"), - OTHER_CHARS: new RegExp(a("[^\\%]", de, ue), "g"), - PCT_ENCODED: new RegExp(A, "g"), - IPV4ADDRESS: new RegExp("^(" + ve + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + fr + ")" + u(u("\\%25|\\%(?!" + M + "{2})") + "(" + er + ")") + "?\\]?$") - //RFC 6874, with relaxed parsing rules - }; - } - var g = v(!1), S = v(!0), z = function() { - function E(f, P) { - var M = [], A = !0, X = !1, Q = void 0; - try { - for (var ue = f[Symbol.iterator](), he; !(A = (he = ue.next()).done) && (M.push(he.value), !(P && M.length === P)); A = !0) - ; - } catch (_e) { - X = !0, Q = _e; - } finally { - try { - !A && ue.return && ue.return(); - } finally { - if (X) - throw Q; - } - } - return M; - } - return function(f, P) { - if (Array.isArray(f)) - return f; - if (Symbol.iterator in Object(f)) - return E(f, P); - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - }; - }(), L = function(E) { - if (Array.isArray(E)) { - for (var f = 0, P = Array(E.length); f < E.length; f++) - P[f] = E[f]; - return P; - } else - return Array.from(E); - }, R = 2147483647, j = 36, T = 1, $ = 26, O = 38, D = 700, t = 72, d = 128, s = "-", i = /^xn--/, c = /[^\0-\x7E]/, m = /[\x2E\u3002\uFF0E\uFF61]/g, h = { - overflow: "Overflow: input needs wider integers to process", - "not-basic": "Illegal input >= 0x80 (not a basic code point)", - "invalid-input": "Invalid input" - }, C = j - T, U = Math.floor, H = String.fromCharCode; - function V(E) { - throw new RangeError(h[E]); - } - function G(E, f) { - for (var P = [], M = E.length; M--; ) - P[M] = f(E[M]); - return P; - } - function _(E, f) { - var P = E.split("@"), M = ""; - P.length > 1 && (M = P[0] + "@", E = P[1]), E = E.replace(m, "."); - var A = E.split("."), X = G(A, f).join("."); - return M + X; - } - function q(E) { - for (var f = [], P = 0, M = E.length; P < M; ) { - var A = E.charCodeAt(P++); - if (A >= 55296 && A <= 56319 && P < M) { - var X = E.charCodeAt(P++); - (X & 64512) == 56320 ? f.push(((A & 1023) << 10) + (X & 1023) + 65536) : (f.push(A), P--); - } else - f.push(A); - } - return f; - } - var J = function(f) { - return String.fromCodePoint.apply(String, L(f)); - }, Z = function(f) { - return f - 48 < 10 ? f - 22 : f - 65 < 26 ? f - 65 : f - 97 < 26 ? f - 97 : j; - }, B = function(f, P) { - return f + 22 + 75 * (f < 26) - ((P != 0) << 5); - }, k = function(f, P, M) { - var A = 0; - for ( - f = M ? U(f / D) : f >> 1, f += U(f / P); - /* no initialization */ - f > C * $ >> 1; - A += j - ) - f = U(f / C); - return U(A + (C + 1) * f / (f + O)); - }, F = function(f) { - var P = [], M = f.length, A = 0, X = d, Q = t, ue = f.lastIndexOf(s); - ue < 0 && (ue = 0); - for (var he = 0; he < ue; ++he) - f.charCodeAt(he) >= 128 && V("not-basic"), P.push(f.charCodeAt(he)); - for (var _e = ue > 0 ? ue + 1 : 0; _e < M; ) { - for ( - var de = A, ce = 1, ve = j; - ; - /* no condition */ - ve += j - ) { - _e >= M && V("invalid-input"); - var ee = Z(f.charCodeAt(_e++)); - (ee >= j || ee > U((R - A) / ce)) && V("overflow"), A += ee * ce; - var me = ve <= Q ? T : ve >= Q + $ ? $ : ve - Q; - if (ee < me) - break; - var we = j - me; - ce > U(R / we) && V("overflow"), ce *= we; - } - var ge = P.length + 1; - Q = k(A - de, ge, de == 0), U(A / ge) > R - X && V("overflow"), X += U(A / ge), A %= ge, P.splice(A++, 0, X); - } - return String.fromCodePoint.apply(String, P); - }, N = function(f) { - var P = []; - f = q(f); - var M = f.length, A = d, X = 0, Q = t, ue = !0, he = !1, _e = void 0; - try { - for (var de = f[Symbol.iterator](), ce; !(ue = (ce = de.next()).done); ue = !0) { - var ve = ce.value; - ve < 128 && P.push(H(ve)); - } - } catch (qr) { - he = !0, _e = qr; - } finally { - try { - !ue && de.return && de.return(); - } finally { - if (he) - throw _e; - } - } - var ee = P.length, me = ee; - for (ee && P.push(s); me < M; ) { - var we = R, ge = !0, ar = !1, Ke = void 0; - try { - for (var We = f[Symbol.iterator](), Pr; !(ge = (Pr = We.next()).done); ge = !0) { - var lr = Pr.value; - lr >= A && lr < we && (we = lr); - } - } catch (qr) { - ar = !0, Ke = qr; - } finally { - try { - !ge && We.return && We.return(); - } finally { - if (ar) - throw Ke; - } - } - var Me = me + 1; - we - A > U((R - X) / Me) && V("overflow"), X += (we - A) * Me, A = we; - var Je = !0, fr = !1, er = void 0; - try { - for (var Hr = f[Symbol.iterator](), Ba; !(Je = (Ba = Hr.next()).done); Je = !0) { - var Ha = Ba.value; - if (Ha < A && ++X > R && V("overflow"), Ha == A) { - for ( - var dt = X, ut = j; - ; - /* no condition */ - ut += j - ) { - var it = ut <= Q ? T : ut >= Q + $ ? $ : ut - Q; - if (dt < it) - break; - var qa = dt - it, Ga = j - it; - P.push(H(B(it + qa % Ga, 0))), dt = U(qa / Ga); - } - P.push(H(B(dt, 0))), Q = k(X, Me, me == ee), X = 0, ++me; - } - } - } catch (qr) { - fr = !0, er = qr; - } finally { - try { - !Je && Hr.return && Hr.return(); - } finally { - if (fr) - throw er; - } - } - ++X, ++A; - } - return P.join(""); - }, l = function(f) { - return _(f, function(P) { - return i.test(P) ? F(P.slice(4).toLowerCase()) : P; - }); - }, w = function(f) { - return _(f, function(P) { - return c.test(P) ? "xn--" + N(P) : P; - }); - }, I = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - version: "2.1.0", - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - ucs2: { - decode: q, - encode: J - }, - decode: F, - encode: N, - toASCII: w, - toUnicode: l - }, K = {}; - function W(E) { - var f = E.charCodeAt(0), P = void 0; - return f < 16 ? P = "%0" + f.toString(16).toUpperCase() : f < 128 ? P = "%" + f.toString(16).toUpperCase() : f < 2048 ? P = "%" + (f >> 6 | 192).toString(16).toUpperCase() + "%" + (f & 63 | 128).toString(16).toUpperCase() : P = "%" + (f >> 12 | 224).toString(16).toUpperCase() + "%" + (f >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (f & 63 | 128).toString(16).toUpperCase(), P; - } - function re(E) { - for (var f = "", P = 0, M = E.length; P < M; ) { - var A = parseInt(E.substr(P + 1, 2), 16); - if (A < 128) - f += String.fromCharCode(A), P += 3; - else if (A >= 194 && A < 224) { - if (M - P >= 6) { - var X = parseInt(E.substr(P + 4, 2), 16); - f += String.fromCharCode((A & 31) << 6 | X & 63); - } else - f += E.substr(P, 6); - P += 6; - } else if (A >= 224) { - if (M - P >= 9) { - var Q = parseInt(E.substr(P + 4, 2), 16), ue = parseInt(E.substr(P + 7, 2), 16); - f += String.fromCharCode((A & 15) << 12 | (Q & 63) << 6 | ue & 63); - } else - f += E.substr(P, 9); - P += 9; - } else - f += E.substr(P, 3), P += 3; - } - return f; - } - function ae(E, f) { - function P(M) { - var A = re(M); - return A.match(f.UNRESERVED) ? A : M; - } - return E.scheme && (E.scheme = String(E.scheme).replace(f.PCT_ENCODED, P).toLowerCase().replace(f.NOT_SCHEME, "")), E.userinfo !== void 0 && (E.userinfo = String(E.userinfo).replace(f.PCT_ENCODED, P).replace(f.NOT_USERINFO, W).replace(f.PCT_ENCODED, p)), E.host !== void 0 && (E.host = String(E.host).replace(f.PCT_ENCODED, P).toLowerCase().replace(f.NOT_HOST, W).replace(f.PCT_ENCODED, p)), E.path !== void 0 && (E.path = String(E.path).replace(f.PCT_ENCODED, P).replace(E.scheme ? f.NOT_PATH : f.NOT_PATH_NOSCHEME, W).replace(f.PCT_ENCODED, p)), E.query !== void 0 && (E.query = String(E.query).replace(f.PCT_ENCODED, P).replace(f.NOT_QUERY, W).replace(f.PCT_ENCODED, p)), E.fragment !== void 0 && (E.fragment = String(E.fragment).replace(f.PCT_ENCODED, P).replace(f.NOT_FRAGMENT, W).replace(f.PCT_ENCODED, p)), E; - } - function fe(E) { - return E.replace(/^0*(.*)/, "$1") || "0"; - } - function Te(E, f) { - var P = E.match(f.IPV4ADDRESS) || [], M = z(P, 2), A = M[1]; - return A ? A.split(".").map(fe).join(".") : E; - } - function xe(E, f) { - var P = E.match(f.IPV6ADDRESS) || [], M = z(P, 3), A = M[1], X = M[2]; - if (A) { - for (var Q = A.toLowerCase().split("::").reverse(), ue = z(Q, 2), he = ue[0], _e = ue[1], de = _e ? _e.split(":").map(fe) : [], ce = he.split(":").map(fe), ve = f.IPV4ADDRESS.test(ce[ce.length - 1]), ee = ve ? 7 : 8, me = ce.length - ee, we = Array(ee), ge = 0; ge < ee; ++ge) - we[ge] = de[ge] || ce[me + ge] || ""; - ve && (we[ee - 1] = Te(we[ee - 1], f)); - var ar = we.reduce(function(Me, Je, fr) { - if (!Je || Je === "0") { - var er = Me[Me.length - 1]; - er && er.index + er.length === fr ? er.length++ : Me.push({ index: fr, length: 1 }); - } - return Me; - }, []), Ke = ar.sort(function(Me, Je) { - return Je.length - Me.length; - })[0], We = void 0; - if (Ke && Ke.length > 1) { - var Pr = we.slice(0, Ke.index), lr = we.slice(Ke.index + Ke.length); - We = Pr.join(":") + "::" + lr.join(":"); - } else - We = we.join(":"); - return X && (We += "%" + X), We; - } else - return E; - } - var Dr = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, Lr = "".match(/(){0}/)[1] === void 0; - function Ae(E) { - var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, P = {}, M = f.iri !== !1 ? S : g; - f.reference === "suffix" && (E = (f.scheme ? f.scheme + ":" : "") + "//" + E); - var A = E.match(Dr); - if (A) { - Lr ? (P.scheme = A[1], P.userinfo = A[3], P.host = A[4], P.port = parseInt(A[5], 10), P.path = A[6] || "", P.query = A[7], P.fragment = A[8], isNaN(P.port) && (P.port = A[5])) : (P.scheme = A[1] || void 0, P.userinfo = E.indexOf("@") !== -1 ? A[3] : void 0, P.host = E.indexOf("//") !== -1 ? A[4] : void 0, P.port = parseInt(A[5], 10), P.path = A[6] || "", P.query = E.indexOf("?") !== -1 ? A[7] : void 0, P.fragment = E.indexOf("#") !== -1 ? A[8] : void 0, isNaN(P.port) && (P.port = E.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? A[4] : void 0)), P.host && (P.host = xe(Te(P.host, M), M)), P.scheme === void 0 && P.userinfo === void 0 && P.host === void 0 && P.port === void 0 && !P.path && P.query === void 0 ? P.reference = "same-document" : P.scheme === void 0 ? P.reference = "relative" : P.fragment === void 0 ? P.reference = "absolute" : P.reference = "uri", f.reference && f.reference !== "suffix" && f.reference !== P.reference && (P.error = P.error || "URI is not a " + f.reference + " reference."); - var X = K[(f.scheme || P.scheme || "").toLowerCase()]; - if (!f.unicodeSupport && (!X || !X.unicodeSupport)) { - if (P.host && (f.domainHost || X && X.domainHost)) - try { - P.host = I.toASCII(P.host.replace(M.PCT_ENCODED, re).toLowerCase()); - } catch (Q) { - P.error = P.error || "Host's domain name can not be converted to ASCII via punycode: " + Q; - } - ae(P, g); - } else - ae(P, M); - X && X.parse && X.parse(P, f); - } else - P.error = P.error || "URI can not be parsed."; - return P; - } - function zr(E, f) { - var P = f.iri !== !1 ? S : g, M = []; - return E.userinfo !== void 0 && (M.push(E.userinfo), M.push("@")), E.host !== void 0 && M.push(xe(Te(String(E.host), P), P).replace(P.IPV6ADDRESS, function(A, X, Q) { - return "[" + X + (Q ? "%25" + Q : "") + "]"; - })), (typeof E.port == "number" || typeof E.port == "string") && (M.push(":"), M.push(String(E.port))), M.length ? M.join("") : void 0; - } - var wr = /^\.\.?\//, br = /^\/\.(\/|$)/, $r = /^\/\.\.(\/|$)/, Vr = /^\/?(?:.|\n)*?(?=\/|$)/; - function qe(E) { - for (var f = []; E.length; ) - if (E.match(wr)) - E = E.replace(wr, ""); - else if (E.match(br)) - E = E.replace(br, "/"); - else if (E.match($r)) - E = E.replace($r, "/"), f.pop(); - else if (E === "." || E === "..") - E = ""; - else { - var P = E.match(Vr); - if (P) { - var M = P[0]; - E = E.slice(M.length), f.push(M); - } else - throw new Error("Unexpected dot segment condition"); - } - return f.join(""); - } - function je(E) { - var f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, P = f.iri ? S : g, M = [], A = K[(f.scheme || E.scheme || "").toLowerCase()]; - if (A && A.serialize && A.serialize(E, f), E.host && !P.IPV6ADDRESS.test(E.host)) { - if (f.domainHost || A && A.domainHost) - try { - E.host = f.iri ? I.toUnicode(E.host) : I.toASCII(E.host.replace(P.PCT_ENCODED, re).toLowerCase()); - } catch (ue) { - E.error = E.error || "Host's domain name can not be converted to " + (f.iri ? "Unicode" : "ASCII") + " via punycode: " + ue; - } - } - ae(E, P), f.reference !== "suffix" && E.scheme && (M.push(E.scheme), M.push(":")); - var X = zr(E, f); - if (X !== void 0 && (f.reference !== "suffix" && M.push("//"), M.push(X), E.path && E.path.charAt(0) !== "/" && M.push("/")), E.path !== void 0) { - var Q = E.path; - !f.absolutePath && (!A || !A.absolutePath) && (Q = qe(Q)), X === void 0 && (Q = Q.replace(/^\/\//, "/%2F")), M.push(Q); - } - return E.query !== void 0 && (M.push("?"), M.push(E.query)), E.fragment !== void 0 && (M.push("#"), M.push(E.fragment)), M.join(""); - } - function Er(E, f) { - var P = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, M = arguments[3], A = {}; - return M || (E = Ae(je(E, P), P), f = Ae(je(f, P), P)), P = P || {}, !P.tolerant && f.scheme ? (A.scheme = f.scheme, A.userinfo = f.userinfo, A.host = f.host, A.port = f.port, A.path = qe(f.path || ""), A.query = f.query) : (f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0 ? (A.userinfo = f.userinfo, A.host = f.host, A.port = f.port, A.path = qe(f.path || ""), A.query = f.query) : (f.path ? (f.path.charAt(0) === "/" ? A.path = qe(f.path) : ((E.userinfo !== void 0 || E.host !== void 0 || E.port !== void 0) && !E.path ? A.path = "/" + f.path : E.path ? A.path = E.path.slice(0, E.path.lastIndexOf("/") + 1) + f.path : A.path = f.path, A.path = qe(A.path)), A.query = f.query) : (A.path = E.path, f.query !== void 0 ? A.query = f.query : A.query = E.query), A.userinfo = E.userinfo, A.host = E.host, A.port = E.port), A.scheme = E.scheme), A.fragment = f.fragment, A; - } - function Fr(E, f, P) { - var M = b({ scheme: "null" }, P); - return je(Er(Ae(E, M), Ae(f, M), M, !0), M); - } - function or(E, f) { - return typeof E == "string" ? E = je(Ae(E, f), f) : o(E) === "object" && (E = Ae(je(E, f), f)), E; - } - function Ur(E, f, P) { - return typeof E == "string" ? E = je(Ae(E, P), P) : o(E) === "object" && (E = je(E, P)), typeof f == "string" ? f = je(Ae(f, P), P) : o(f) === "object" && (f = je(f, P)), E === f; - } - function st(E, f) { - return E && E.toString().replace(!f || !f.iri ? g.ESCAPE : S.ESCAPE, W); - } - function Ie(E, f) { - return E && E.toString().replace(!f || !f.iri ? g.PCT_ENCODED : S.PCT_ENCODED, re); - } - var cr = { - scheme: "http", - domainHost: !0, - parse: function(f, P) { - return f.host || (f.error = f.error || "HTTP URIs must have a host."), f; - }, - serialize: function(f, P) { - var M = String(f.scheme).toLowerCase() === "https"; - return (f.port === (M ? 443 : 80) || f.port === "") && (f.port = void 0), f.path || (f.path = "/"), f; - } - }, Ia = { - scheme: "https", - domainHost: cr.domainHost, - parse: cr.parse, - serialize: cr.serialize - }; - function Ma(E) { - return typeof E.secure == "boolean" ? E.secure : String(E.scheme).toLowerCase() === "wss"; - } - var Br = { - scheme: "ws", - domainHost: !0, - parse: function(f, P) { - var M = f; - return M.secure = Ma(M), M.resourceName = (M.path || "/") + (M.query ? "?" + M.query : ""), M.path = void 0, M.query = void 0, M; - }, - serialize: function(f, P) { - if ((f.port === (Ma(f) ? 443 : 80) || f.port === "") && (f.port = void 0), typeof f.secure == "boolean" && (f.scheme = f.secure ? "wss" : "ws", f.secure = void 0), f.resourceName) { - var M = f.resourceName.split("?"), A = z(M, 2), X = A[0], Q = A[1]; - f.path = X && X !== "/" ? X : void 0, f.query = Q, f.resourceName = void 0; - } - return f.fragment = void 0, f; - } - }, Da = { - scheme: "wss", - domainHost: Br.domainHost, - parse: Br.parse, - serialize: Br.serialize - }, _s = {}, La = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", Ge = "[0-9A-Fa-f]", vs = u(u("%[EFef]" + Ge + "%" + Ge + Ge + "%" + Ge + Ge) + "|" + u("%[89A-Fa-f]" + Ge + "%" + Ge + Ge) + "|" + u("%" + Ge + Ge)), ys = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", ws = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", bs = a(ws, '[\\"\\\\]'), $s = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", Es = new RegExp(La, "g"), kr = new RegExp(vs, "g"), ks = new RegExp(a("[^]", ys, "[\\.]", '[\\"]', bs), "g"), za = new RegExp(a("[^]", La, $s), "g"), Ps = za; - function Nt(E) { - var f = re(E); - return f.match(Es) ? f : E; - } - var Va = { - scheme: "mailto", - parse: function(f, P) { - var M = f, A = M.to = M.path ? M.path.split(",") : []; - if (M.path = void 0, M.query) { - for (var X = !1, Q = {}, ue = M.query.split("&"), he = 0, _e = ue.length; he < _e; ++he) { - var de = ue[he].split("="); - switch (de[0]) { - case "to": - for (var ce = de[1].split(","), ve = 0, ee = ce.length; ve < ee; ++ve) - A.push(ce[ve]); - break; - case "subject": - M.subject = Ie(de[1], P); - break; - case "body": - M.body = Ie(de[1], P); - break; - default: - X = !0, Q[Ie(de[0], P)] = Ie(de[1], P); - break; - } - } - X && (M.headers = Q); - } - M.query = void 0; - for (var me = 0, we = A.length; me < we; ++me) { - var ge = A[me].split("@"); - if (ge[0] = Ie(ge[0]), P.unicodeSupport) - ge[1] = Ie(ge[1], P).toLowerCase(); - else - try { - ge[1] = I.toASCII(Ie(ge[1], P).toLowerCase()); - } catch (ar) { - M.error = M.error || "Email address's domain name can not be converted to ASCII via punycode: " + ar; - } - A[me] = ge.join("@"); - } - return M; - }, - serialize: function(f, P) { - var M = f, A = y(f.to); - if (A) { - for (var X = 0, Q = A.length; X < Q; ++X) { - var ue = String(A[X]), he = ue.lastIndexOf("@"), _e = ue.slice(0, he).replace(kr, Nt).replace(kr, p).replace(ks, W), de = ue.slice(he + 1); - try { - de = P.iri ? I.toUnicode(de) : I.toASCII(Ie(de, P).toLowerCase()); - } catch (me) { - M.error = M.error || "Email address's domain name can not be converted to " + (P.iri ? "Unicode" : "ASCII") + " via punycode: " + me; - } - A[X] = _e + "@" + de; - } - M.path = A.join(","); - } - var ce = f.headers = f.headers || {}; - f.subject && (ce.subject = f.subject), f.body && (ce.body = f.body); - var ve = []; - for (var ee in ce) - ce[ee] !== _s[ee] && ve.push(ee.replace(kr, Nt).replace(kr, p).replace(za, W) + "=" + ce[ee].replace(kr, Nt).replace(kr, p).replace(Ps, W)); - return ve.length && (M.query = ve.join("&")), M; - } - }, Ss = /^([^\:]+)\:(.*)/, Fa = { - scheme: "urn", - parse: function(f, P) { - var M = f.path && f.path.match(Ss), A = f; - if (M) { - var X = P.scheme || A.scheme || "urn", Q = M[1].toLowerCase(), ue = M[2], he = X + ":" + (P.nid || Q), _e = K[he]; - A.nid = Q, A.nss = ue, A.path = void 0, _e && (A = _e.parse(A, P)); - } else - A.error = A.error || "URN can not be parsed."; - return A; - }, - serialize: function(f, P) { - var M = P.scheme || f.scheme || "urn", A = f.nid, X = M + ":" + (P.nid || A), Q = K[X]; - Q && (f = Q.serialize(f, P)); - var ue = f, he = f.nss; - return ue.path = (A || P.nid) + ":" + he, ue; - } - }, Cs = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Ua = { - scheme: "urn:uuid", - parse: function(f, P) { - var M = f; - return M.uuid = M.nss, M.nss = void 0, !P.tolerant && (!M.uuid || !M.uuid.match(Cs)) && (M.error = M.error || "UUID is not valid."), M; - }, - serialize: function(f, P) { - var M = f; - return M.nss = (f.uuid || "").toLowerCase(), M; - } - }; - K[cr.scheme] = cr, K[Ia.scheme] = Ia, K[Br.scheme] = Br, K[Da.scheme] = Da, K[Va.scheme] = Va, K[Fa.scheme] = Fa, K[Ua.scheme] = Ua, n.SCHEMES = K, n.pctEncChar = W, n.pctDecChars = re, n.parse = Ae, n.removeDotSegments = qe, n.serialize = je, n.resolveComponents = Er, n.resolve = Fr, n.normalize = or, n.equal = Ur, n.escapeComponent = st, n.unescapeComponent = Ie, Object.defineProperty(n, "__esModule", { value: !0 }); - }); -})(Ut, Ut.exports); -var ou = Ut.exports; -Object.defineProperty(Qt, "__esModule", { value: !0 }); -const Xn = ou; -Xn.code = 'require("ajv/dist/runtime/uri").default'; -Qt.default = Xn; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0; - var r = He; - Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() { - return r.KeywordCxt; - } }); - var n = se; - Object.defineProperty(e, "_", { enumerable: !0, get: function() { - return n._; - } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() { - return n.str; - } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() { - return n.stringify; - } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() { - return n.nil; - } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() { - return n.Name; - } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() { - return n.CodeGen; - } }); - const a = tt, u = at, o = vr, p = Re, y = se, b = ke, v = rt, g = ie, S = iu, z = Qt, L = (B, k) => new RegExp(B, k); - L.code = "new RegExp"; - const R = ["removeAdditional", "useDefaults", "coerceTypes"], j = /* @__PURE__ */ new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error" - ]), T = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", - ajvErrors: "It is default now." - }, $ = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.' - }, O = 200; - function D(B) { - var k, F, N, l, w, I, K, W, re, ae, fe, Te, xe, Dr, Lr, Ae, zr, wr, br, $r, Vr, qe, je, Er, Fr; - const or = B.strict, Ur = (k = B.code) === null || k === void 0 ? void 0 : k.optimize, st = Ur === !0 || Ur === void 0 ? 1 : Ur || 0, Ie = (N = (F = B.code) === null || F === void 0 ? void 0 : F.regExp) !== null && N !== void 0 ? N : L, cr = (l = B.uriResolver) !== null && l !== void 0 ? l : z.default; - return { - strictSchema: (I = (w = B.strictSchema) !== null && w !== void 0 ? w : or) !== null && I !== void 0 ? I : !0, - strictNumbers: (W = (K = B.strictNumbers) !== null && K !== void 0 ? K : or) !== null && W !== void 0 ? W : !0, - strictTypes: (ae = (re = B.strictTypes) !== null && re !== void 0 ? re : or) !== null && ae !== void 0 ? ae : "log", - strictTuples: (Te = (fe = B.strictTuples) !== null && fe !== void 0 ? fe : or) !== null && Te !== void 0 ? Te : "log", - strictRequired: (Dr = (xe = B.strictRequired) !== null && xe !== void 0 ? xe : or) !== null && Dr !== void 0 ? Dr : !1, - code: B.code ? { ...B.code, optimize: st, regExp: Ie } : { optimize: st, regExp: Ie }, - loopRequired: (Lr = B.loopRequired) !== null && Lr !== void 0 ? Lr : O, - loopEnum: (Ae = B.loopEnum) !== null && Ae !== void 0 ? Ae : O, - meta: (zr = B.meta) !== null && zr !== void 0 ? zr : !0, - messages: (wr = B.messages) !== null && wr !== void 0 ? wr : !0, - inlineRefs: (br = B.inlineRefs) !== null && br !== void 0 ? br : !0, - schemaId: ($r = B.schemaId) !== null && $r !== void 0 ? $r : "$id", - addUsedSchema: (Vr = B.addUsedSchema) !== null && Vr !== void 0 ? Vr : !0, - validateSchema: (qe = B.validateSchema) !== null && qe !== void 0 ? qe : !0, - validateFormats: (je = B.validateFormats) !== null && je !== void 0 ? je : !0, - unicodeRegExp: (Er = B.unicodeRegExp) !== null && Er !== void 0 ? Er : !0, - int32range: (Fr = B.int32range) !== null && Fr !== void 0 ? Fr : !0, - uriResolver: cr - }; - } - class t { - constructor(k = {}) { - this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), k = this.opts = { ...k, ...D(k) }; - const { es5: F, lines: N } = this.opts.code; - this.scope = new y.ValueScope({ scope: {}, prefixes: j, es5: F, lines: N }), this.logger = U(k.logger); - const l = k.validateFormats; - k.validateFormats = !1, this.RULES = (0, o.getRules)(), d.call(this, T, k, "NOT SUPPORTED"), d.call(this, $, k, "DEPRECATED", "warn"), this._metaOpts = h.call(this), k.formats && c.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), k.keywords && m.call(this, k.keywords), typeof k.meta == "object" && this.addMetaSchema(k.meta), i.call(this), k.validateFormats = l; - } - _addVocabularies() { - this.addKeyword("$async"); - } - _addDefaultMetaSchema() { - const { $data: k, meta: F, schemaId: N } = this.opts; - let l = S; - N === "id" && (l = { ...S }, l.id = l.$id, delete l.$id), F && k && this.addMetaSchema(l, l[N], !1); - } - defaultMeta() { - const { meta: k, schemaId: F } = this.opts; - return this.opts.defaultMeta = typeof k == "object" ? k[F] || k : void 0; - } - validate(k, F) { - let N; - if (typeof k == "string") { - if (N = this.getSchema(k), !N) - throw new Error(`no schema with key or ref "${k}"`); - } else - N = this.compile(k); - const l = N(F); - return "$async" in N || (this.errors = N.errors), l; - } - compile(k, F) { - const N = this._addSchema(k, F); - return N.validate || this._compileSchemaEnv(N); - } - compileAsync(k, F) { - if (typeof this.opts.loadSchema != "function") - throw new Error("options.loadSchema should be a function"); - const { loadSchema: N } = this.opts; - return l.call(this, k, F); - async function l(ae, fe) { - await w.call(this, ae.$schema); - const Te = this._addSchema(ae, fe); - return Te.validate || I.call(this, Te); - } - async function w(ae) { - ae && !this.getSchema(ae) && await l.call(this, { $ref: ae }, !0); - } - async function I(ae) { - try { - return this._compileSchemaEnv(ae); - } catch (fe) { - if (!(fe instanceof u.default)) - throw fe; - return K.call(this, fe), await W.call(this, fe.missingSchema), I.call(this, ae); - } - } - function K({ missingSchema: ae, missingRef: fe }) { - if (this.refs[ae]) - throw new Error(`AnySchema ${ae} is loaded but ${fe} cannot be resolved`); - } - async function W(ae) { - const fe = await re.call(this, ae); - this.refs[ae] || await w.call(this, fe.$schema), this.refs[ae] || this.addSchema(fe, ae, F); - } - async function re(ae) { - const fe = this._loading[ae]; - if (fe) - return fe; - try { - return await (this._loading[ae] = N(ae)); - } finally { - delete this._loading[ae]; - } - } - } - // Adds schema to the instance - addSchema(k, F, N, l = this.opts.validateSchema) { - if (Array.isArray(k)) { - for (const I of k) - this.addSchema(I, void 0, N, l); - return this; - } - let w; - if (typeof k == "object") { - const { schemaId: I } = this.opts; - if (w = k[I], w !== void 0 && typeof w != "string") - throw new Error(`schema ${I} must be string`); - } - return F = (0, b.normalizeId)(F || w), this._checkUnique(F), this.schemas[F] = this._addSchema(k, N, F, l, !0), this; - } - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema(k, F, N = this.opts.validateSchema) { - return this.addSchema(k, F, !0, N), this; - } - // Validate schema against its meta-schema - validateSchema(k, F) { - if (typeof k == "boolean") - return !0; - let N; - if (N = k.$schema, N !== void 0 && typeof N != "string") - throw new Error("$schema must be a string"); - if (N = N || this.opts.defaultMeta || this.defaultMeta(), !N) - return this.logger.warn("meta-schema not available"), this.errors = null, !0; - const l = this.validate(N, k); - if (!l && F) { - const w = "schema is invalid: " + this.errorsText(); - if (this.opts.validateSchema === "log") - this.logger.error(w); - else - throw new Error(w); - } - return l; - } - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(k) { - let F; - for (; typeof (F = s.call(this, k)) == "string"; ) - k = F; - if (F === void 0) { - const { schemaId: N } = this.opts, l = new p.SchemaEnv({ schema: {}, schemaId: N }); - if (F = p.resolveSchema.call(this, l, k), !F) - return; - this.refs[k] = F; - } - return F.validate || this._compileSchemaEnv(F); - } - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(k) { - if (k instanceof RegExp) - return this._removeAllSchemas(this.schemas, k), this._removeAllSchemas(this.refs, k), this; - switch (typeof k) { - case "undefined": - return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this; - case "string": { - const F = s.call(this, k); - return typeof F == "object" && this._cache.delete(F.schema), delete this.schemas[k], delete this.refs[k], this; - } - case "object": { - const F = k; - this._cache.delete(F); - let N = k[this.opts.schemaId]; - return N && (N = (0, b.normalizeId)(N), delete this.schemas[N], delete this.refs[N]), this; - } - default: - throw new Error("ajv.removeSchema: invalid parameter"); - } - } - // add "vocabulary" - a collection of keywords - addVocabulary(k) { - for (const F of k) - this.addKeyword(F); - return this; - } - addKeyword(k, F) { - let N; - if (typeof k == "string") - N = k, typeof F == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), F.keyword = N); - else if (typeof k == "object" && F === void 0) { - if (F = k, N = F.keyword, Array.isArray(N) && !N.length) - throw new Error("addKeywords: keyword must be string or non-empty array"); - } else - throw new Error("invalid addKeywords parameters"); - if (V.call(this, N, F), !F) - return (0, g.eachItem)(N, (w) => G.call(this, w)), this; - q.call(this, F); - const l = { - ...F, - type: (0, v.getJSONTypes)(F.type), - schemaType: (0, v.getJSONTypes)(F.schemaType) - }; - return (0, g.eachItem)(N, l.type.length === 0 ? (w) => G.call(this, w, l) : (w) => l.type.forEach((I) => G.call(this, w, l, I))), this; - } - getKeyword(k) { - const F = this.RULES.all[k]; - return typeof F == "object" ? F.definition : !!F; - } - // Remove keyword - removeKeyword(k) { - const { RULES: F } = this; - delete F.keywords[k], delete F.all[k]; - for (const N of F.rules) { - const l = N.rules.findIndex((w) => w.keyword === k); - l >= 0 && N.rules.splice(l, 1); - } - return this; - } - // Add format - addFormat(k, F) { - return typeof F == "string" && (F = new RegExp(F)), this.formats[k] = F, this; - } - errorsText(k = this.errors, { separator: F = ", ", dataVar: N = "data" } = {}) { - return !k || k.length === 0 ? "No errors" : k.map((l) => `${N}${l.instancePath} ${l.message}`).reduce((l, w) => l + F + w); - } - $dataMetaSchema(k, F) { - const N = this.RULES.all; - k = JSON.parse(JSON.stringify(k)); - for (const l of F) { - const w = l.split("/").slice(1); - let I = k; - for (const K of w) - I = I[K]; - for (const K in N) { - const W = N[K]; - if (typeof W != "object") - continue; - const { $data: re } = W.definition, ae = I[K]; - re && ae && (I[K] = Z(ae)); - } - } - return k; - } - _removeAllSchemas(k, F) { - for (const N in k) { - const l = k[N]; - (!F || F.test(N)) && (typeof l == "string" ? delete k[N] : l && !l.meta && (this._cache.delete(l.schema), delete k[N])); - } - } - _addSchema(k, F, N, l = this.opts.validateSchema, w = this.opts.addUsedSchema) { - let I; - const { schemaId: K } = this.opts; - if (typeof k == "object") - I = k[K]; - else { - if (this.opts.jtd) - throw new Error("schema must be object"); - if (typeof k != "boolean") - throw new Error("schema must be object or boolean"); - } - let W = this._cache.get(k); - if (W !== void 0) - return W; - N = (0, b.normalizeId)(I || N); - const re = b.getSchemaRefs.call(this, k, N); - return W = new p.SchemaEnv({ schema: k, schemaId: K, meta: F, baseId: N, localRefs: re }), this._cache.set(W.schema, W), w && !N.startsWith("#") && (N && this._checkUnique(N), this.refs[N] = W), l && this.validateSchema(k, !0), W; - } - _checkUnique(k) { - if (this.schemas[k] || this.refs[k]) - throw new Error(`schema with key or id "${k}" already exists`); - } - _compileSchemaEnv(k) { - if (k.meta ? this._compileMetaSchema(k) : p.compileSchema.call(this, k), !k.validate) - throw new Error("ajv implementation error"); - return k.validate; - } - _compileMetaSchema(k) { - const F = this.opts; - this.opts = this._metaOpts; - try { - p.compileSchema.call(this, k); - } finally { - this.opts = F; - } - } - } - e.default = t, t.ValidationError = a.default, t.MissingRefError = u.default; - function d(B, k, F, N = "error") { - for (const l in B) { - const w = l; - w in k && this.logger[N](`${F}: option ${l}. ${B[w]}`); - } - } - function s(B) { - return B = (0, b.normalizeId)(B), this.schemas[B] || this.refs[B]; - } - function i() { - const B = this.opts.schemas; - if (B) - if (Array.isArray(B)) - this.addSchema(B); - else - for (const k in B) - this.addSchema(B[k], k); - } - function c() { - for (const B in this.opts.formats) { - const k = this.opts.formats[B]; - k && this.addFormat(B, k); - } - } - function m(B) { - if (Array.isArray(B)) { - this.addVocabulary(B); - return; - } - this.logger.warn("keywords option as map is deprecated, pass array"); - for (const k in B) { - const F = B[k]; - F.keyword || (F.keyword = k), this.addKeyword(F); - } - } - function h() { - const B = { ...this.opts }; - for (const k of R) - delete B[k]; - return B; - } - const C = { log() { - }, warn() { - }, error() { - } }; - function U(B) { - if (B === !1) - return C; - if (B === void 0) - return console; - if (B.log && B.warn && B.error) - return B; - throw new Error("logger must implement log, warn and error methods"); - } - const H = /^[a-z_$][a-z0-9_$:-]*$/i; - function V(B, k) { - const { RULES: F } = this; - if ((0, g.eachItem)(B, (N) => { - if (F.keywords[N]) - throw new Error(`Keyword ${N} is already defined`); - if (!H.test(N)) - throw new Error(`Keyword ${N} has invalid name`); - }), !!k && k.$data && !("code" in k || "validate" in k)) - throw new Error('$data keyword must have "code" or "validate" function'); - } - function G(B, k, F) { - var N; - const l = k == null ? void 0 : k.post; - if (F && l) - throw new Error('keyword with "post" flag cannot have "type"'); - const { RULES: w } = this; - let I = l ? w.post : w.rules.find(({ type: W }) => W === F); - if (I || (I = { type: F, rules: [] }, w.rules.push(I)), w.keywords[B] = !0, !k) - return; - const K = { - keyword: B, - definition: { - ...k, - type: (0, v.getJSONTypes)(k.type), - schemaType: (0, v.getJSONTypes)(k.schemaType) - } - }; - k.before ? _.call(this, I, K, k.before) : I.rules.push(K), w.all[B] = K, (N = k.implements) === null || N === void 0 || N.forEach((W) => this.addKeyword(W)); - } - function _(B, k, F) { - const N = B.rules.findIndex((l) => l.keyword === F); - N >= 0 ? B.rules.splice(N, 0, k) : (B.rules.push(k), this.logger.warn(`rule ${F} is not defined`)); - } - function q(B) { - let { metaSchema: k } = B; - k !== void 0 && (B.$data && this.opts.$data && (k = Z(k)), B.validateSchema = this.compile(k, !0)); - } - const J = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" - }; - function Z(B) { - return { anyOf: [B, J] }; - } -})(Sn); -var xt = {}, ea = {}, ra = {}; -Object.defineProperty(ra, "__esModule", { value: !0 }); -const cu = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); - } -}; -ra.default = cu; -var yr = {}; -Object.defineProperty(yr, "__esModule", { value: !0 }); -yr.callRef = yr.getValidate = void 0; -const lu = at, xa = ne, Ne = se, Cr = Qe, en = Re, ot = ie, fu = { - keyword: "$ref", - schemaType: "string", - code(e) { - const { gen: r, schema: n, it: a } = e, { baseId: u, schemaEnv: o, validateName: p, opts: y, self: b } = a, { root: v } = o; - if ((n === "#" || n === "#/") && u === v.baseId) - return S(); - const g = en.resolveRef.call(b, v, u, n); - if (g === void 0) - throw new lu.default(a.opts.uriResolver, u, n); - if (g instanceof en.SchemaEnv) - return z(g); - return L(g); - function S() { - if (o === v) - return gt(e, p, o, o.$async); - const R = r.scopeValue("root", { ref: v }); - return gt(e, (0, Ne._)`${R}.validate`, v, v.$async); - } - function z(R) { - const j = Qn(e, R); - gt(e, j, R, R.$async); - } - function L(R) { - const j = r.scopeValue("schema", y.code.source === !0 ? { ref: R, code: (0, Ne.stringify)(R) } : { ref: R }), T = r.name("valid"), $ = e.subschema({ - schema: R, - dataTypes: [], - schemaPath: Ne.nil, - topSchemaRef: j, - errSchemaPath: n - }, T); - e.mergeEvaluated($), e.ok(T); - } - } -}; -function Qn(e, r) { - const { gen: n } = e; - return r.validate ? n.scopeValue("validate", { ref: r.validate }) : (0, Ne._)`${n.scopeValue("wrapper", { ref: r })}.validate`; -} -yr.getValidate = Qn; -function gt(e, r, n, a) { - const { gen: u, it: o } = e, { allErrors: p, schemaEnv: y, opts: b } = o, v = b.passContext ? Cr.default.this : Ne.nil; - a ? g() : S(); - function g() { - if (!y.$async) - throw new Error("async schema referenced by sync schema"); - const R = u.let("valid"); - u.try(() => { - u.code((0, Ne._)`await ${(0, xa.callValidateCode)(e, r, v)}`), L(r), p || u.assign(R, !0); - }, (j) => { - u.if((0, Ne._)`!(${j} instanceof ${o.ValidationError})`, () => u.throw(j)), z(j), p || u.assign(R, !1); - }), e.ok(R); - } - function S() { - e.result((0, xa.callValidateCode)(e, r, v), () => L(r), () => z(r)); - } - function z(R) { - const j = (0, Ne._)`${R}.errors`; - u.assign(Cr.default.vErrors, (0, Ne._)`${Cr.default.vErrors} === null ? ${j} : ${Cr.default.vErrors}.concat(${j})`), u.assign(Cr.default.errors, (0, Ne._)`${Cr.default.vErrors}.length`); - } - function L(R) { - var j; - if (!o.opts.unevaluated) - return; - const T = (j = n == null ? void 0 : n.validate) === null || j === void 0 ? void 0 : j.evaluated; - if (o.props !== !0) - if (T && !T.dynamicProps) - T.props !== void 0 && (o.props = ot.mergeEvaluated.props(u, T.props, o.props)); - else { - const $ = u.var("props", (0, Ne._)`${R}.evaluated.props`); - o.props = ot.mergeEvaluated.props(u, $, o.props, Ne.Name); - } - if (o.items !== !0) - if (T && !T.dynamicItems) - T.items !== void 0 && (o.items = ot.mergeEvaluated.items(u, T.items, o.items)); - else { - const $ = u.var("items", (0, Ne._)`${R}.evaluated.items`); - o.items = ot.mergeEvaluated.items(u, $, o.items, Ne.Name); - } - } -} -yr.callRef = gt; -yr.default = fu; -Object.defineProperty(ea, "__esModule", { value: !0 }); -const hu = ra, pu = yr, mu = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - { keyword: "$comment" }, - "definitions", - hu.default, - pu.default -]; -ea.default = mu; -var ta = {}, aa = {}; -Object.defineProperty(aa, "__esModule", { value: !0 }); -const bt = se, sr = bt.operators, $t = { - maximum: { okStr: "<=", ok: sr.LTE, fail: sr.GT }, - minimum: { okStr: ">=", ok: sr.GTE, fail: sr.LT }, - exclusiveMaximum: { okStr: "<", ok: sr.LT, fail: sr.GTE }, - exclusiveMinimum: { okStr: ">", ok: sr.GT, fail: sr.LTE } -}, gu = { - message: ({ keyword: e, schemaCode: r }) => (0, bt.str)`must be ${$t[e].okStr} ${r}`, - params: ({ keyword: e, schemaCode: r }) => (0, bt._)`{comparison: ${$t[e].okStr}, limit: ${r}}` -}, _u = { - keyword: Object.keys($t), - type: "number", - schemaType: "number", - $data: !0, - error: gu, - code(e) { - const { keyword: r, data: n, schemaCode: a } = e; - e.fail$data((0, bt._)`${n} ${$t[r].fail} ${a} || isNaN(${n})`); - } -}; -aa.default = _u; -var na = {}; -Object.defineProperty(na, "__esModule", { value: !0 }); -const Zr = se, vu = { - message: ({ schemaCode: e }) => (0, Zr.str)`must be multiple of ${e}`, - params: ({ schemaCode: e }) => (0, Zr._)`{multipleOf: ${e}}` -}, yu = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: !0, - error: vu, - code(e) { - const { gen: r, data: n, schemaCode: a, it: u } = e, o = u.opts.multipleOfPrecision, p = r.let("res"), y = o ? (0, Zr._)`Math.abs(Math.round(${p}) - ${p}) > 1e-${o}` : (0, Zr._)`${p} !== parseInt(${p})`; - e.fail$data((0, Zr._)`(${a} === 0 || (${p} = ${n}/${a}, ${y}))`); - } -}; -na.default = yu; -var sa = {}, da = {}; -Object.defineProperty(da, "__esModule", { value: !0 }); -function xn(e) { - const r = e.length; - let n = 0, a = 0, u; - for (; a < r; ) - n++, u = e.charCodeAt(a++), u >= 55296 && u <= 56319 && a < r && (u = e.charCodeAt(a), (u & 64512) === 56320 && a++); - return n; -} -da.default = xn; -xn.code = 'require("ajv/dist/runtime/ucs2length").default'; -Object.defineProperty(sa, "__esModule", { value: !0 }); -const gr = se, wu = ie, bu = da, $u = { - message({ keyword: e, schemaCode: r }) { - const n = e === "maxLength" ? "more" : "fewer"; - return (0, gr.str)`must NOT have ${n} than ${r} characters`; - }, - params: ({ schemaCode: e }) => (0, gr._)`{limit: ${e}}` -}, Eu = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: !0, - error: $u, - code(e) { - const { keyword: r, data: n, schemaCode: a, it: u } = e, o = r === "maxLength" ? gr.operators.GT : gr.operators.LT, p = u.opts.unicode === !1 ? (0, gr._)`${n}.length` : (0, gr._)`${(0, wu.useFunc)(e.gen, bu.default)}(${n})`; - e.fail$data((0, gr._)`${p} ${o} ${a}`); - } -}; -sa.default = Eu; -var ua = {}; -Object.defineProperty(ua, "__esModule", { value: !0 }); -const ku = ne, Et = se, Pu = { - message: ({ schemaCode: e }) => (0, Et.str)`must match pattern "${e}"`, - params: ({ schemaCode: e }) => (0, Et._)`{pattern: ${e}}` -}, Su = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: !0, - error: Pu, - code(e) { - const { data: r, $data: n, schema: a, schemaCode: u, it: o } = e, p = o.opts.unicodeRegExp ? "u" : "", y = n ? (0, Et._)`(new RegExp(${u}, ${p}))` : (0, ku.usePattern)(e, a); - e.fail$data((0, Et._)`!${y}.test(${r})`); - } -}; -ua.default = Su; -var ia = {}; -Object.defineProperty(ia, "__esModule", { value: !0 }); -const Yr = se, Cu = { - message({ keyword: e, schemaCode: r }) { - const n = e === "maxProperties" ? "more" : "fewer"; - return (0, Yr.str)`must NOT have ${n} than ${r} properties`; - }, - params: ({ schemaCode: e }) => (0, Yr._)`{limit: ${e}}` -}, Tu = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: !0, - error: Cu, - code(e) { - const { keyword: r, data: n, schemaCode: a } = e, u = r === "maxProperties" ? Yr.operators.GT : Yr.operators.LT; - e.fail$data((0, Yr._)`Object.keys(${n}).length ${u} ${a}`); - } -}; -ia.default = Tu; -var oa = {}; -Object.defineProperty(oa, "__esModule", { value: !0 }); -const Kr = ne, Xr = se, ju = ie, Ou = { - message: ({ params: { missingProperty: e } }) => (0, Xr.str)`must have required property '${e}'`, - params: ({ params: { missingProperty: e } }) => (0, Xr._)`{missingProperty: ${e}}` -}, Nu = { - keyword: "required", - type: "object", - schemaType: "array", - $data: !0, - error: Ou, - code(e) { - const { gen: r, schema: n, schemaCode: a, data: u, $data: o, it: p } = e, { opts: y } = p; - if (!o && n.length === 0) - return; - const b = n.length >= y.loopRequired; - if (p.allErrors ? v() : g(), y.strictRequired) { - const L = e.parentSchema.properties, { definedProperties: R } = e.it; - for (const j of n) - if ((L == null ? void 0 : L[j]) === void 0 && !R.has(j)) { - const T = p.schemaEnv.baseId + p.errSchemaPath, $ = `required property "${j}" is not defined at "${T}" (strictRequired)`; - (0, ju.checkStrictMode)(p, $, p.opts.strictRequired); - } - } - function v() { - if (b || o) - e.block$data(Xr.nil, S); - else - for (const L of n) - (0, Kr.checkReportMissingProp)(e, L); - } - function g() { - const L = r.let("missing"); - if (b || o) { - const R = r.let("valid", !0); - e.block$data(R, () => z(L, R)), e.ok(R); - } else - r.if((0, Kr.checkMissingProp)(e, n, L)), (0, Kr.reportMissingProp)(e, L), r.else(); - } - function S() { - r.forOf("prop", a, (L) => { - e.setParams({ missingProperty: L }), r.if((0, Kr.noPropertyInData)(r, u, L, y.ownProperties), () => e.error()); - }); - } - function z(L, R) { - e.setParams({ missingProperty: L }), r.forOf(L, a, () => { - r.assign(R, (0, Kr.propertyInData)(r, u, L, y.ownProperties)), r.if((0, Xr.not)(R), () => { - e.error(), r.break(); - }); - }, Xr.nil); - } - } -}; -oa.default = Nu; -var ca = {}; -Object.defineProperty(ca, "__esModule", { value: !0 }); -const Qr = se, Ru = { - message({ keyword: e, schemaCode: r }) { - const n = e === "maxItems" ? "more" : "fewer"; - return (0, Qr.str)`must NOT have ${n} than ${r} items`; - }, - params: ({ schemaCode: e }) => (0, Qr._)`{limit: ${e}}` -}, Au = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: !0, - error: Ru, - code(e) { - const { keyword: r, data: n, schemaCode: a } = e, u = r === "maxItems" ? Qr.operators.GT : Qr.operators.LT; - e.fail$data((0, Qr._)`${n}.length ${u} ${a}`); - } -}; -ca.default = Au; -var la = {}, nt = {}; -Object.defineProperty(nt, "__esModule", { value: !0 }); -const es = In; -es.code = 'require("ajv/dist/runtime/equal").default'; -nt.default = es; -Object.defineProperty(la, "__esModule", { value: !0 }); -const Mt = rt, Ee = se, Iu = ie, Mu = nt, Du = { - message: ({ params: { i: e, j: r } }) => (0, Ee.str)`must NOT have duplicate items (items ## ${r} and ${e} are identical)`, - params: ({ params: { i: e, j: r } }) => (0, Ee._)`{i: ${e}, j: ${r}}` -}, Lu = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: !0, - error: Du, - code(e) { - const { gen: r, data: n, $data: a, schema: u, parentSchema: o, schemaCode: p, it: y } = e; - if (!a && !u) - return; - const b = r.let("valid"), v = o.items ? (0, Mt.getSchemaTypes)(o.items) : []; - e.block$data(b, g, (0, Ee._)`${p} === false`), e.ok(b); - function g() { - const R = r.let("i", (0, Ee._)`${n}.length`), j = r.let("j"); - e.setParams({ i: R, j }), r.assign(b, !0), r.if((0, Ee._)`${R} > 1`, () => (S() ? z : L)(R, j)); - } - function S() { - return v.length > 0 && !v.some((R) => R === "object" || R === "array"); - } - function z(R, j) { - const T = r.name("item"), $ = (0, Mt.checkDataTypes)(v, T, y.opts.strictNumbers, Mt.DataType.Wrong), O = r.const("indices", (0, Ee._)`{}`); - r.for((0, Ee._)`;${R}--;`, () => { - r.let(T, (0, Ee._)`${n}[${R}]`), r.if($, (0, Ee._)`continue`), v.length > 1 && r.if((0, Ee._)`typeof ${T} == "string"`, (0, Ee._)`${T} += "_"`), r.if((0, Ee._)`typeof ${O}[${T}] == "number"`, () => { - r.assign(j, (0, Ee._)`${O}[${T}]`), e.error(), r.assign(b, !1).break(); - }).code((0, Ee._)`${O}[${T}] = ${R}`); - }); - } - function L(R, j) { - const T = (0, Iu.useFunc)(r, Mu.default), $ = r.name("outer"); - r.label($).for((0, Ee._)`;${R}--;`, () => r.for((0, Ee._)`${j} = ${R}; ${j}--;`, () => r.if((0, Ee._)`${T}(${n}[${R}], ${n}[${j}])`, () => { - e.error(), r.assign(b, !1).break($); - }))); - } - } -}; -la.default = Lu; -var fa = {}; -Object.defineProperty(fa, "__esModule", { value: !0 }); -const Bt = se, zu = ie, Vu = nt, Fu = { - message: "must be equal to constant", - params: ({ schemaCode: e }) => (0, Bt._)`{allowedValue: ${e}}` -}, Uu = { - keyword: "const", - $data: !0, - error: Fu, - code(e) { - const { gen: r, data: n, $data: a, schemaCode: u, schema: o } = e; - a || o && typeof o == "object" ? e.fail$data((0, Bt._)`!${(0, zu.useFunc)(r, Vu.default)}(${n}, ${u})`) : e.fail((0, Bt._)`${o} !== ${n}`); - } -}; -fa.default = Uu; -var ha = {}; -Object.defineProperty(ha, "__esModule", { value: !0 }); -const Wr = se, Bu = ie, Hu = nt, qu = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode: e }) => (0, Wr._)`{allowedValues: ${e}}` -}, Gu = { - keyword: "enum", - schemaType: "array", - $data: !0, - error: qu, - code(e) { - const { gen: r, data: n, $data: a, schema: u, schemaCode: o, it: p } = e; - if (!a && u.length === 0) - throw new Error("enum must have non-empty array"); - const y = u.length >= p.opts.loopEnum; - let b; - const v = () => b ?? (b = (0, Bu.useFunc)(r, Hu.default)); - let g; - if (y || a) - g = r.let("valid"), e.block$data(g, S); - else { - if (!Array.isArray(u)) - throw new Error("ajv implementation error"); - const L = r.const("vSchema", o); - g = (0, Wr.or)(...u.map((R, j) => z(L, j))); - } - e.pass(g); - function S() { - r.assign(g, !1), r.forOf("v", o, (L) => r.if((0, Wr._)`${v()}(${n}, ${L})`, () => r.assign(g, !0).break())); - } - function z(L, R) { - const j = u[R]; - return typeof j == "object" && j !== null ? (0, Wr._)`${v()}(${n}, ${L}[${R}])` : (0, Wr._)`${n} === ${j}`; - } - } -}; -ha.default = Gu; -Object.defineProperty(ta, "__esModule", { value: !0 }); -const Ku = aa, Wu = na, Ju = sa, Zu = ua, Yu = ia, Xu = oa, Qu = ca, xu = la, ei = fa, ri = ha, ti = [ - // number - Ku.default, - Wu.default, - // string - Ju.default, - Zu.default, - // object - Yu.default, - Xu.default, - // array - Qu.default, - xu.default, - // any - { keyword: "type", schemaType: ["string", "array"] }, - { keyword: "nullable", schemaType: "boolean" }, - ei.default, - ri.default -]; -ta.default = ti; -var pa = {}, Ir = {}; -Object.defineProperty(Ir, "__esModule", { value: !0 }); -Ir.validateAdditionalItems = void 0; -const _r = se, Ht = ie, ai = { - message: ({ params: { len: e } }) => (0, _r.str)`must NOT have more than ${e} items`, - params: ({ params: { len: e } }) => (0, _r._)`{limit: ${e}}` -}, ni = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error: ai, - code(e) { - const { parentSchema: r, it: n } = e, { items: a } = r; - if (!Array.isArray(a)) { - (0, Ht.checkStrictMode)(n, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - rs(e, a); - } -}; -function rs(e, r) { - const { gen: n, schema: a, data: u, keyword: o, it: p } = e; - p.items = !0; - const y = n.const("len", (0, _r._)`${u}.length`); - if (a === !1) - e.setParams({ len: r.length }), e.pass((0, _r._)`${y} <= ${r.length}`); - else if (typeof a == "object" && !(0, Ht.alwaysValidSchema)(p, a)) { - const v = n.var("valid", (0, _r._)`${y} <= ${r.length}`); - n.if((0, _r.not)(v), () => b(v)), e.ok(v); - } - function b(v) { - n.forRange("i", r.length, y, (g) => { - e.subschema({ keyword: o, dataProp: g, dataPropType: Ht.Type.Num }, v), p.allErrors || n.if((0, _r.not)(v), () => n.break()); - }); - } -} -Ir.validateAdditionalItems = rs; -Ir.default = ni; -var ma = {}, Mr = {}; -Object.defineProperty(Mr, "__esModule", { value: !0 }); -Mr.validateTuple = void 0; -const rn = se, _t = ie, si = ne, di = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(e) { - const { schema: r, it: n } = e; - if (Array.isArray(r)) - return ts(e, "additionalItems", r); - n.items = !0, !(0, _t.alwaysValidSchema)(n, r) && e.ok((0, si.validateArray)(e)); - } -}; -function ts(e, r, n = e.schema) { - const { gen: a, parentSchema: u, data: o, keyword: p, it: y } = e; - g(u), y.opts.unevaluated && n.length && y.items !== !0 && (y.items = _t.mergeEvaluated.items(a, n.length, y.items)); - const b = a.name("valid"), v = a.const("len", (0, rn._)`${o}.length`); - n.forEach((S, z) => { - (0, _t.alwaysValidSchema)(y, S) || (a.if((0, rn._)`${v} > ${z}`, () => e.subschema({ - keyword: p, - schemaProp: z, - dataProp: z - }, b)), e.ok(b)); - }); - function g(S) { - const { opts: z, errSchemaPath: L } = y, R = n.length, j = R === S.minItems && (R === S.maxItems || S[r] === !1); - if (z.strictTuples && !j) { - const T = `"${p}" is ${R}-tuple, but minItems or maxItems/${r} are not specified or different at path "${L}"`; - (0, _t.checkStrictMode)(y, T, z.strictTuples); - } - } -} -Mr.validateTuple = ts; -Mr.default = di; -Object.defineProperty(ma, "__esModule", { value: !0 }); -const ui = Mr, ii = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (e) => (0, ui.validateTuple)(e, "items") -}; -ma.default = ii; -var ga = {}; -Object.defineProperty(ga, "__esModule", { value: !0 }); -const tn = se, oi = ie, ci = ne, li = Ir, fi = { - message: ({ params: { len: e } }) => (0, tn.str)`must NOT have more than ${e} items`, - params: ({ params: { len: e } }) => (0, tn._)`{limit: ${e}}` -}, hi = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error: fi, - code(e) { - const { schema: r, parentSchema: n, it: a } = e, { prefixItems: u } = n; - a.items = !0, !(0, oi.alwaysValidSchema)(a, r) && (u ? (0, li.validateAdditionalItems)(e, u) : e.ok((0, ci.validateArray)(e))); - } -}; -ga.default = hi; -var _a = {}; -Object.defineProperty(_a, "__esModule", { value: !0 }); -const ze = se, ct = ie, pi = { - message: ({ params: { min: e, max: r } }) => r === void 0 ? (0, ze.str)`must contain at least ${e} valid item(s)` : (0, ze.str)`must contain at least ${e} and no more than ${r} valid item(s)`, - params: ({ params: { min: e, max: r } }) => r === void 0 ? (0, ze._)`{minContains: ${e}}` : (0, ze._)`{minContains: ${e}, maxContains: ${r}}` -}, mi = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: !0, - error: pi, - code(e) { - const { gen: r, schema: n, parentSchema: a, data: u, it: o } = e; - let p, y; - const { minContains: b, maxContains: v } = a; - o.opts.next ? (p = b === void 0 ? 1 : b, y = v) : p = 1; - const g = r.const("len", (0, ze._)`${u}.length`); - if (e.setParams({ min: p, max: y }), y === void 0 && p === 0) { - (0, ct.checkStrictMode)(o, '"minContains" == 0 without "maxContains": "contains" keyword ignored'); - return; - } - if (y !== void 0 && p > y) { - (0, ct.checkStrictMode)(o, '"minContains" > "maxContains" is always invalid'), e.fail(); - return; - } - if ((0, ct.alwaysValidSchema)(o, n)) { - let j = (0, ze._)`${g} >= ${p}`; - y !== void 0 && (j = (0, ze._)`${j} && ${g} <= ${y}`), e.pass(j); - return; - } - o.items = !0; - const S = r.name("valid"); - y === void 0 && p === 1 ? L(S, () => r.if(S, () => r.break())) : p === 0 ? (r.let(S, !0), y !== void 0 && r.if((0, ze._)`${u}.length > 0`, z)) : (r.let(S, !1), z()), e.result(S, () => e.reset()); - function z() { - const j = r.name("_valid"), T = r.let("count", 0); - L(j, () => r.if(j, () => R(T))); - } - function L(j, T) { - r.forRange("i", 0, g, ($) => { - e.subschema({ - keyword: "contains", - dataProp: $, - dataPropType: ct.Type.Num, - compositeRule: !0 - }, j), T(); - }); - } - function R(j) { - r.code((0, ze._)`${j}++`), y === void 0 ? r.if((0, ze._)`${j} >= ${p}`, () => r.assign(S, !0).break()) : (r.if((0, ze._)`${j} > ${y}`, () => r.assign(S, !1).break()), p === 1 ? r.assign(S, !0) : r.if((0, ze._)`${j} >= ${p}`, () => r.assign(S, !0))); - } - } -}; -_a.default = mi; -var as = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0; - const r = se, n = ie, a = ne; - e.error = { - message: ({ params: { property: b, depsCount: v, deps: g } }) => { - const S = v === 1 ? "property" : "properties"; - return (0, r.str)`must have ${S} ${g} when property ${b} is present`; - }, - params: ({ params: { property: b, depsCount: v, deps: g, missingProperty: S } }) => (0, r._)`{property: ${b}, - missingProperty: ${S}, - depsCount: ${v}, - deps: ${g}}` - // TODO change to reference - }; - const u = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error: e.error, - code(b) { - const [v, g] = o(b); - p(b, v), y(b, g); - } - }; - function o({ schema: b }) { - const v = {}, g = {}; - for (const S in b) { - if (S === "__proto__") - continue; - const z = Array.isArray(b[S]) ? v : g; - z[S] = b[S]; - } - return [v, g]; - } - function p(b, v = b.schema) { - const { gen: g, data: S, it: z } = b; - if (Object.keys(v).length === 0) - return; - const L = g.let("missing"); - for (const R in v) { - const j = v[R]; - if (j.length === 0) - continue; - const T = (0, a.propertyInData)(g, S, R, z.opts.ownProperties); - b.setParams({ - property: R, - depsCount: j.length, - deps: j.join(", ") - }), z.allErrors ? g.if(T, () => { - for (const $ of j) - (0, a.checkReportMissingProp)(b, $); - }) : (g.if((0, r._)`${T} && (${(0, a.checkMissingProp)(b, j, L)})`), (0, a.reportMissingProp)(b, L), g.else()); - } - } - e.validatePropertyDeps = p; - function y(b, v = b.schema) { - const { gen: g, data: S, keyword: z, it: L } = b, R = g.name("valid"); - for (const j in v) - (0, n.alwaysValidSchema)(L, v[j]) || (g.if( - (0, a.propertyInData)(g, S, j, L.opts.ownProperties), - () => { - const T = b.subschema({ keyword: z, schemaProp: j }, R); - b.mergeValidEvaluated(T, R); - }, - () => g.var(R, !0) - // TODO var - ), b.ok(R)); - } - e.validateSchemaDeps = y, e.default = u; -})(as); -var va = {}; -Object.defineProperty(va, "__esModule", { value: !0 }); -const ns = se, gi = ie, _i = { - message: "property name must be valid", - params: ({ params: e }) => (0, ns._)`{propertyName: ${e.propertyName}}` -}, vi = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error: _i, - code(e) { - const { gen: r, schema: n, data: a, it: u } = e; - if ((0, gi.alwaysValidSchema)(u, n)) - return; - const o = r.name("valid"); - r.forIn("key", a, (p) => { - e.setParams({ propertyName: p }), e.subschema({ - keyword: "propertyNames", - data: p, - dataTypes: ["string"], - propertyName: p, - compositeRule: !0 - }, o), r.if((0, ns.not)(o), () => { - e.error(!0), u.allErrors || r.break(); - }); - }), e.ok(o); - } -}; -va.default = vi; -var Ot = {}; -Object.defineProperty(Ot, "__esModule", { value: !0 }); -const lt = ne, Fe = se, yi = Qe, ft = ie, wi = { - message: "must NOT have additional properties", - params: ({ params: e }) => (0, Fe._)`{additionalProperty: ${e.additionalProperty}}` -}, bi = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: !0, - trackErrors: !0, - error: wi, - code(e) { - const { gen: r, schema: n, parentSchema: a, data: u, errsCount: o, it: p } = e; - if (!o) - throw new Error("ajv implementation error"); - const { allErrors: y, opts: b } = p; - if (p.props = !0, b.removeAdditional !== "all" && (0, ft.alwaysValidSchema)(p, n)) - return; - const v = (0, lt.allSchemaProperties)(a.properties), g = (0, lt.allSchemaProperties)(a.patternProperties); - S(), e.ok((0, Fe._)`${o} === ${yi.default.errors}`); - function S() { - r.forIn("key", u, (T) => { - !v.length && !g.length ? R(T) : r.if(z(T), () => R(T)); - }); - } - function z(T) { - let $; - if (v.length > 8) { - const O = (0, ft.schemaRefOrVal)(p, a.properties, "properties"); - $ = (0, lt.isOwnProperty)(r, O, T); - } else - v.length ? $ = (0, Fe.or)(...v.map((O) => (0, Fe._)`${T} === ${O}`)) : $ = Fe.nil; - return g.length && ($ = (0, Fe.or)($, ...g.map((O) => (0, Fe._)`${(0, lt.usePattern)(e, O)}.test(${T})`))), (0, Fe.not)($); - } - function L(T) { - r.code((0, Fe._)`delete ${u}[${T}]`); - } - function R(T) { - if (b.removeAdditional === "all" || b.removeAdditional && n === !1) { - L(T); - return; - } - if (n === !1) { - e.setParams({ additionalProperty: T }), e.error(), y || r.break(); - return; - } - if (typeof n == "object" && !(0, ft.alwaysValidSchema)(p, n)) { - const $ = r.name("valid"); - b.removeAdditional === "failing" ? (j(T, $, !1), r.if((0, Fe.not)($), () => { - e.reset(), L(T); - })) : (j(T, $), y || r.if((0, Fe.not)($), () => r.break())); - } - } - function j(T, $, O) { - const D = { - keyword: "additionalProperties", - dataProp: T, - dataPropType: ft.Type.Str - }; - O === !1 && Object.assign(D, { - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }), e.subschema(D, $); - } - } -}; -Ot.default = bi; -var ya = {}; -Object.defineProperty(ya, "__esModule", { value: !0 }); -const $i = He, an = ne, Dt = ie, nn = Ot, Ei = { - keyword: "properties", - type: "object", - schemaType: "object", - code(e) { - const { gen: r, schema: n, parentSchema: a, data: u, it: o } = e; - o.opts.removeAdditional === "all" && a.additionalProperties === void 0 && nn.default.code(new $i.KeywordCxt(o, nn.default, "additionalProperties")); - const p = (0, an.allSchemaProperties)(n); - for (const S of p) - o.definedProperties.add(S); - o.opts.unevaluated && p.length && o.props !== !0 && (o.props = Dt.mergeEvaluated.props(r, (0, Dt.toHash)(p), o.props)); - const y = p.filter((S) => !(0, Dt.alwaysValidSchema)(o, n[S])); - if (y.length === 0) - return; - const b = r.name("valid"); - for (const S of y) - v(S) ? g(S) : (r.if((0, an.propertyInData)(r, u, S, o.opts.ownProperties)), g(S), o.allErrors || r.else().var(b, !0), r.endIf()), e.it.definedProperties.add(S), e.ok(b); - function v(S) { - return o.opts.useDefaults && !o.compositeRule && n[S].default !== void 0; - } - function g(S) { - e.subschema({ - keyword: "properties", - schemaProp: S, - dataProp: S - }, b); - } - } -}; -ya.default = Ei; -var wa = {}; -Object.defineProperty(wa, "__esModule", { value: !0 }); -const sn = ne, ht = se, dn = ie, un = ie, ki = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(e) { - const { gen: r, schema: n, data: a, parentSchema: u, it: o } = e, { opts: p } = o, y = (0, sn.allSchemaProperties)(n), b = y.filter((j) => (0, dn.alwaysValidSchema)(o, n[j])); - if (y.length === 0 || b.length === y.length && (!o.opts.unevaluated || o.props === !0)) - return; - const v = p.strictSchema && !p.allowMatchingProperties && u.properties, g = r.name("valid"); - o.props !== !0 && !(o.props instanceof ht.Name) && (o.props = (0, un.evaluatedPropsToName)(r, o.props)); - const { props: S } = o; - z(); - function z() { - for (const j of y) - v && L(j), o.allErrors ? R(j) : (r.var(g, !0), R(j), r.if(g)); - } - function L(j) { - for (const T in v) - new RegExp(j).test(T) && (0, dn.checkStrictMode)(o, `property ${T} matches pattern ${j} (use allowMatchingProperties)`); - } - function R(j) { - r.forIn("key", a, (T) => { - r.if((0, ht._)`${(0, sn.usePattern)(e, j)}.test(${T})`, () => { - const $ = b.includes(j); - $ || e.subschema({ - keyword: "patternProperties", - schemaProp: j, - dataProp: T, - dataPropType: un.Type.Str - }, g), o.opts.unevaluated && S !== !0 ? r.assign((0, ht._)`${S}[${T}]`, !0) : !$ && !o.allErrors && r.if((0, ht.not)(g), () => r.break()); - }); - }); - } - } -}; -wa.default = ki; -var ba = {}; -Object.defineProperty(ba, "__esModule", { value: !0 }); -const Pi = ie, Si = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: !0, - code(e) { - const { gen: r, schema: n, it: a } = e; - if ((0, Pi.alwaysValidSchema)(a, n)) { - e.fail(); - return; - } - const u = r.name("valid"); - e.subschema({ - keyword: "not", - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }, u), e.failResult(u, () => e.reset(), () => e.error()); - }, - error: { message: "must NOT be valid" } -}; -ba.default = Si; -var $a = {}; -Object.defineProperty($a, "__esModule", { value: !0 }); -const Ci = ne, Ti = { - keyword: "anyOf", - schemaType: "array", - trackErrors: !0, - code: Ci.validateUnion, - error: { message: "must match a schema in anyOf" } -}; -$a.default = Ti; -var Ea = {}; -Object.defineProperty(Ea, "__esModule", { value: !0 }); -const vt = se, ji = ie, Oi = { - message: "must match exactly one schema in oneOf", - params: ({ params: e }) => (0, vt._)`{passingSchemas: ${e.passing}}` -}, Ni = { - keyword: "oneOf", - schemaType: "array", - trackErrors: !0, - error: Oi, - code(e) { - const { gen: r, schema: n, parentSchema: a, it: u } = e; - if (!Array.isArray(n)) - throw new Error("ajv implementation error"); - if (u.opts.discriminator && a.discriminator) - return; - const o = n, p = r.let("valid", !1), y = r.let("passing", null), b = r.name("_valid"); - e.setParams({ passing: y }), r.block(v), e.result(p, () => e.reset(), () => e.error(!0)); - function v() { - o.forEach((g, S) => { - let z; - (0, ji.alwaysValidSchema)(u, g) ? r.var(b, !0) : z = e.subschema({ - keyword: "oneOf", - schemaProp: S, - compositeRule: !0 - }, b), S > 0 && r.if((0, vt._)`${b} && ${p}`).assign(p, !1).assign(y, (0, vt._)`[${y}, ${S}]`).else(), r.if(b, () => { - r.assign(p, !0), r.assign(y, S), z && e.mergeEvaluated(z, vt.Name); - }); - }); - } - } -}; -Ea.default = Ni; -var ka = {}; -Object.defineProperty(ka, "__esModule", { value: !0 }); -const Ri = ie, Ai = { - keyword: "allOf", - schemaType: "array", - code(e) { - const { gen: r, schema: n, it: a } = e; - if (!Array.isArray(n)) - throw new Error("ajv implementation error"); - const u = r.name("valid"); - n.forEach((o, p) => { - if ((0, Ri.alwaysValidSchema)(a, o)) - return; - const y = e.subschema({ keyword: "allOf", schemaProp: p }, u); - e.ok(u), e.mergeEvaluated(y); - }); - } -}; -ka.default = Ai; -var Pa = {}; -Object.defineProperty(Pa, "__esModule", { value: !0 }); -const kt = se, ss = ie, Ii = { - message: ({ params: e }) => (0, kt.str)`must match "${e.ifClause}" schema`, - params: ({ params: e }) => (0, kt._)`{failingKeyword: ${e.ifClause}}` -}, Mi = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: !0, - error: Ii, - code(e) { - const { gen: r, parentSchema: n, it: a } = e; - n.then === void 0 && n.else === void 0 && (0, ss.checkStrictMode)(a, '"if" without "then" and "else" is ignored'); - const u = on(a, "then"), o = on(a, "else"); - if (!u && !o) - return; - const p = r.let("valid", !0), y = r.name("_valid"); - if (b(), e.reset(), u && o) { - const g = r.let("ifClause"); - e.setParams({ ifClause: g }), r.if(y, v("then", g), v("else", g)); - } else - u ? r.if(y, v("then")) : r.if((0, kt.not)(y), v("else")); - e.pass(p, () => e.error(!0)); - function b() { - const g = e.subschema({ - keyword: "if", - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }, y); - e.mergeEvaluated(g); - } - function v(g, S) { - return () => { - const z = e.subschema({ keyword: g }, y); - r.assign(p, y), e.mergeValidEvaluated(z, p), S ? r.assign(S, (0, kt._)`${g}`) : e.setParams({ ifClause: g }); - }; - } - } -}; -function on(e, r) { - const n = e.schema[r]; - return n !== void 0 && !(0, ss.alwaysValidSchema)(e, n); -} -Pa.default = Mi; -var Sa = {}; -Object.defineProperty(Sa, "__esModule", { value: !0 }); -const Di = ie, Li = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword: e, parentSchema: r, it: n }) { - r.if === void 0 && (0, Di.checkStrictMode)(n, `"${e}" without "if" is ignored`); - } -}; -Sa.default = Li; -Object.defineProperty(pa, "__esModule", { value: !0 }); -const zi = Ir, Vi = ma, Fi = Mr, Ui = ga, Bi = _a, Hi = as, qi = va, Gi = Ot, Ki = ya, Wi = wa, Ji = ba, Zi = $a, Yi = Ea, Xi = ka, Qi = Pa, xi = Sa; -function eo(e = !1) { - const r = [ - // any - Ji.default, - Zi.default, - Yi.default, - Xi.default, - Qi.default, - xi.default, - // object - qi.default, - Gi.default, - Hi.default, - Ki.default, - Wi.default - ]; - return e ? r.push(Vi.default, Ui.default) : r.push(zi.default, Fi.default), r.push(Bi.default), r; -} -pa.default = eo; -var Ca = {}, Ta = {}; -Object.defineProperty(Ta, "__esModule", { value: !0 }); -const ye = se, ro = { - message: ({ schemaCode: e }) => (0, ye.str)`must match format "${e}"`, - params: ({ schemaCode: e }) => (0, ye._)`{format: ${e}}` -}, to = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: !0, - error: ro, - code(e, r) { - const { gen: n, data: a, $data: u, schema: o, schemaCode: p, it: y } = e, { opts: b, errSchemaPath: v, schemaEnv: g, self: S } = y; - if (!b.validateFormats) - return; - u ? z() : L(); - function z() { - const R = n.scopeValue("formats", { - ref: S.formats, - code: b.code.formats - }), j = n.const("fDef", (0, ye._)`${R}[${p}]`), T = n.let("fType"), $ = n.let("format"); - n.if((0, ye._)`typeof ${j} == "object" && !(${j} instanceof RegExp)`, () => n.assign(T, (0, ye._)`${j}.type || "string"`).assign($, (0, ye._)`${j}.validate`), () => n.assign(T, (0, ye._)`"string"`).assign($, j)), e.fail$data((0, ye.or)(O(), D())); - function O() { - return b.strictSchema === !1 ? ye.nil : (0, ye._)`${p} && !${$}`; - } - function D() { - const t = g.$async ? (0, ye._)`(${j}.async ? await ${$}(${a}) : ${$}(${a}))` : (0, ye._)`${$}(${a})`, d = (0, ye._)`(typeof ${$} == "function" ? ${t} : ${$}.test(${a}))`; - return (0, ye._)`${$} && ${$} !== true && ${T} === ${r} && !${d}`; - } - } - function L() { - const R = S.formats[o]; - if (!R) { - O(); - return; - } - if (R === !0) - return; - const [j, T, $] = D(R); - j === r && e.pass(t()); - function O() { - if (b.strictSchema === !1) { - S.logger.warn(d()); - return; - } - throw new Error(d()); - function d() { - return `unknown format "${o}" ignored in schema at path "${v}"`; - } - } - function D(d) { - const s = d instanceof RegExp ? (0, ye.regexpCode)(d) : b.code.formats ? (0, ye._)`${b.code.formats}${(0, ye.getProperty)(o)}` : void 0, i = n.scopeValue("formats", { key: o, ref: d, code: s }); - return typeof d == "object" && !(d instanceof RegExp) ? [d.type || "string", d.validate, (0, ye._)`${i}.validate`] : ["string", d, i]; - } - function t() { - if (typeof R == "object" && !(R instanceof RegExp) && R.async) { - if (!g.$async) - throw new Error("async format in sync schema"); - return (0, ye._)`await ${$}(${a})`; - } - return typeof T == "function" ? (0, ye._)`${$}(${a})` : (0, ye._)`${$}.test(${a})`; - } - } - } -}; -Ta.default = to; -Object.defineProperty(Ca, "__esModule", { value: !0 }); -const ao = Ta, no = [ao.default]; -Ca.default = no; -var Ar = {}; -Object.defineProperty(Ar, "__esModule", { value: !0 }); -Ar.contentVocabulary = Ar.metadataVocabulary = void 0; -Ar.metadataVocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples" -]; -Ar.contentVocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema" -]; -Object.defineProperty(xt, "__esModule", { value: !0 }); -const so = ea, uo = ta, io = pa, oo = Ca, cn = Ar, co = [ - so.default, - uo.default, - (0, io.default)(), - oo.default, - cn.metadataVocabulary, - cn.contentVocabulary -]; -xt.default = co; -var ja = {}, ds = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.DiscrError = void 0, function(r) { - r.Tag = "tag", r.Mapping = "mapping"; - }(e.DiscrError || (e.DiscrError = {})); -})(ds); -Object.defineProperty(ja, "__esModule", { value: !0 }); -const Tr = se, qt = ds, ln = Re, lo = ie, fo = { - message: ({ params: { discrError: e, tagName: r } }) => e === qt.DiscrError.Tag ? `tag "${r}" must be string` : `value of tag "${r}" must be in oneOf`, - params: ({ params: { discrError: e, tag: r, tagName: n } }) => (0, Tr._)`{error: ${e}, tag: ${n}, tagValue: ${r}}` -}, ho = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error: fo, - code(e) { - const { gen: r, data: n, schema: a, parentSchema: u, it: o } = e, { oneOf: p } = u; - if (!o.opts.discriminator) - throw new Error("discriminator: requires discriminator option"); - const y = a.propertyName; - if (typeof y != "string") - throw new Error("discriminator: requires propertyName"); - if (a.mapping) - throw new Error("discriminator: mapping is not supported"); - if (!p) - throw new Error("discriminator: requires oneOf keyword"); - const b = r.let("valid", !1), v = r.const("tag", (0, Tr._)`${n}${(0, Tr.getProperty)(y)}`); - r.if((0, Tr._)`typeof ${v} == "string"`, () => g(), () => e.error(!1, { discrError: qt.DiscrError.Tag, tag: v, tagName: y })), e.ok(b); - function g() { - const L = z(); - r.if(!1); - for (const R in L) - r.elseIf((0, Tr._)`${v} === ${R}`), r.assign(b, S(L[R])); - r.else(), e.error(!1, { discrError: qt.DiscrError.Mapping, tag: v, tagName: y }), r.endIf(); - } - function S(L) { - const R = r.name("valid"), j = e.subschema({ keyword: "oneOf", schemaProp: L }, R); - return e.mergeEvaluated(j, Tr.Name), R; - } - function z() { - var L; - const R = {}, j = $(u); - let T = !0; - for (let t = 0; t < p.length; t++) { - let d = p[t]; - d != null && d.$ref && !(0, lo.schemaHasRulesButRef)(d, o.self.RULES) && (d = ln.resolveRef.call(o.self, o.schemaEnv.root, o.baseId, d == null ? void 0 : d.$ref), d instanceof ln.SchemaEnv && (d = d.schema)); - const s = (L = d == null ? void 0 : d.properties) === null || L === void 0 ? void 0 : L[y]; - if (typeof s != "object") - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${y}"`); - T = T && (j || $(d)), O(s, t); - } - if (!T) - throw new Error(`discriminator: "${y}" must be required`); - return R; - function $({ required: t }) { - return Array.isArray(t) && t.includes(y); - } - function O(t, d) { - if (t.const) - D(t.const, d); - else if (t.enum) - for (const s of t.enum) - D(s, d); - else - throw new Error(`discriminator: "properties/${y}" must have "const" or "enum"`); - } - function D(t, d) { - if (typeof t != "string" || t in R) - throw new Error(`discriminator: "${y}" values must be unique strings`); - R[t] = d; - } - } - } -}; -ja.default = ho; -const po = "http://json-schema.org/draft-07/schema#", mo = "http://json-schema.org/draft-07/schema#", go = "Core schema meta-schema", _o = { - schemaArray: { - type: "array", - minItems: 1, - items: { - $ref: "#" - } - }, - nonNegativeInteger: { - type: "integer", - minimum: 0 - }, - nonNegativeIntegerDefault0: { - allOf: [ - { - $ref: "#/definitions/nonNegativeInteger" - }, - { - default: 0 - } - ] - }, - simpleTypes: { - enum: [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - stringArray: { - type: "array", - items: { - type: "string" - }, - uniqueItems: !0, - default: [] - } -}, vo = [ - "object", - "boolean" -], yo = { - $id: { - type: "string", - format: "uri-reference" - }, - $schema: { - type: "string", - format: "uri" - }, - $ref: { - type: "string", - format: "uri-reference" - }, - $comment: { - type: "string" - }, - title: { - type: "string" - }, - description: { - type: "string" - }, - default: !0, - readOnly: { - type: "boolean", - default: !1 - }, - examples: { - type: "array", - items: !0 - }, - multipleOf: { - type: "number", - exclusiveMinimum: 0 - }, - maximum: { - type: "number" - }, - exclusiveMaximum: { - type: "number" - }, - minimum: { - type: "number" - }, - exclusiveMinimum: { - type: "number" - }, - maxLength: { - $ref: "#/definitions/nonNegativeInteger" - }, - minLength: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - pattern: { - type: "string", - format: "regex" - }, - additionalItems: { - $ref: "#" - }, - items: { - anyOf: [ - { - $ref: "#" - }, - { - $ref: "#/definitions/schemaArray" - } - ], - default: !0 - }, - maxItems: { - $ref: "#/definitions/nonNegativeInteger" - }, - minItems: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - uniqueItems: { - type: "boolean", - default: !1 - }, - contains: { - $ref: "#" - }, - maxProperties: { - $ref: "#/definitions/nonNegativeInteger" - }, - minProperties: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - required: { - $ref: "#/definitions/stringArray" - }, - additionalProperties: { - $ref: "#" - }, - definitions: { - type: "object", - additionalProperties: { - $ref: "#" - }, - default: {} - }, - properties: { - type: "object", - additionalProperties: { - $ref: "#" - }, - default: {} - }, - patternProperties: { - type: "object", - additionalProperties: { - $ref: "#" - }, - propertyNames: { - format: "regex" - }, - default: {} - }, - dependencies: { - type: "object", - additionalProperties: { - anyOf: [ - { - $ref: "#" - }, - { - $ref: "#/definitions/stringArray" - } - ] - } - }, - propertyNames: { - $ref: "#" - }, - const: !0, - enum: { - type: "array", - items: !0, - minItems: 1, - uniqueItems: !0 - }, - type: { - anyOf: [ - { - $ref: "#/definitions/simpleTypes" - }, - { - type: "array", - items: { - $ref: "#/definitions/simpleTypes" - }, - minItems: 1, - uniqueItems: !0 - } - ] - }, - format: { - type: "string" - }, - contentMediaType: { - type: "string" - }, - contentEncoding: { - type: "string" - }, - if: { - $ref: "#" - }, - then: { - $ref: "#" - }, - else: { - $ref: "#" - }, - allOf: { - $ref: "#/definitions/schemaArray" - }, - anyOf: { - $ref: "#/definitions/schemaArray" - }, - oneOf: { - $ref: "#/definitions/schemaArray" - }, - not: { - $ref: "#" - } -}, wo = { - $schema: po, - $id: mo, - title: go, - definitions: _o, - type: vo, - properties: yo, - default: !0 -}; -(function(e, r) { - Object.defineProperty(r, "__esModule", { value: !0 }), r.MissingRefError = r.ValidationError = r.CodeGen = r.Name = r.nil = r.stringify = r.str = r._ = r.KeywordCxt = void 0; - const n = Sn, a = xt, u = ja, o = wo, p = ["/properties"], y = "http://json-schema.org/draft-07/schema"; - class b extends n.default { - _addVocabularies() { - super._addVocabularies(), a.default.forEach((R) => this.addVocabulary(R)), this.opts.discriminator && this.addKeyword(u.default); - } - _addDefaultMetaSchema() { - if (super._addDefaultMetaSchema(), !this.opts.meta) - return; - const R = this.opts.$data ? this.$dataMetaSchema(o, p) : o; - this.addMetaSchema(R, y, !1), this.refs["http://json-schema.org/schema"] = y; - } - defaultMeta() { - return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(y) ? y : void 0); - } - } - e.exports = r = b, Object.defineProperty(r, "__esModule", { value: !0 }), r.default = b; - var v = He; - Object.defineProperty(r, "KeywordCxt", { enumerable: !0, get: function() { - return v.KeywordCxt; - } }); - var g = se; - Object.defineProperty(r, "_", { enumerable: !0, get: function() { - return g._; - } }), Object.defineProperty(r, "str", { enumerable: !0, get: function() { - return g.str; - } }), Object.defineProperty(r, "stringify", { enumerable: !0, get: function() { - return g.stringify; - } }), Object.defineProperty(r, "nil", { enumerable: !0, get: function() { - return g.nil; - } }), Object.defineProperty(r, "Name", { enumerable: !0, get: function() { - return g.Name; - } }), Object.defineProperty(r, "CodeGen", { enumerable: !0, get: function() { - return g.CodeGen; - } }); - var S = tt; - Object.defineProperty(r, "ValidationError", { enumerable: !0, get: function() { - return S.default; - } }); - var z = at; - Object.defineProperty(r, "MissingRefError", { enumerable: !0, get: function() { - return z.default; - } }); -})(zt, zt.exports); -var bo = zt.exports; -const $o = /* @__PURE__ */ Pn(bo); -class Eo { - constructor() { - be(this, "ajv"); - this.ajv = new $o(); - } - validateJson(r, n) { - const a = this.ajv.validate(r, n); - return a ? { valid: a } : { valid: a, error: this.ajv.errorsText() }; - } - validateObjectSchema(r, n) { - const a = this.ajv.validate(r, n); - return a ? { valid: a } : { valid: a, error: this.ajv.errorsText() }; - } -} -class ko { - constructor() { - be(this, "TIME_SPLIT", " "); - } - /** - * 给日期添加小时 - * - * @param date - Date - * @param numOfHours - 数字 - * @author terwer - * @since 1.0.0 - */ - addHoursToDate(r, n) { - return r.setTime(r.getTime() + n * 60 * 60 * 1e3), r; - } - /** - * 转换ISO日期为中文日期的通用转换方法 - * - * @param str - '2022-07-18T06:25:48.000Z - * @param isAddTimeZone - 是否增加时区(默认不增加) - * @param isShort - 是否只返回日期 - * @author terwer - * @since 1.0.0 - */ - formatIsoToZhDateFormat(r, n, a) { - if (!r) - return ""; - let u = r; - const o = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(.\d{3})Z$/gm, p = u.match(o); - if (p == null) - return r; - for (let y = 0; y < p.length; y++) { - const b = p[y]; - let v = b; - n && (v = this.addHoursToDate(new Date(b), 8).toISOString()); - const g = v.split("T"), S = g[0], z = g[1].split(".")[0]; - let L = S + this.TIME_SPLIT + z; - a && (L = S), u = u.replace(b, L); - } - return u; - } - /** - * 转换ISO日期为中文完整时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZh(r) { - return this.formatIsoToZhDateFormat(r, !1, !1); - } - /** - * 转换ISO日期为中文日期 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhDate(r) { - return this.formatIsoToZhDateFormat(r, !1, !0); - } - /** - * 转换ISO日期为中文时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhTime(r) { - return this.formatIsoToZhDateFormat(r, !1).split(this.TIME_SPLIT)[1]; - } - /** - * 当前日期时间完整格式,格式:2023-03-10 02:03:43 - */ - nowZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0); - } - /** - * 当前日期,格式:2023-03-10 - */ - nowDateZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0, !0); - } - /** - * 当前时间,格式:02:03:43 - */ - nowTimeZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0).split(this.TIME_SPLIT)[1]; - } -} -class Po { - /** - * 格式化字符串 - * - * @param str - 字符串,可用占位符,例如:test \{0\} str - * @param args - 按占位符顺序排列的参数 - * @author terwer - * @since 0.0.1 - */ - f(r, ...n) { - let a = r; - for (let u = 0; u < n.length; u++) { - const o = n[u]; - typeof o == "string" ? a = a.replace(`{${u}}`, o) : a = a.replace(`{${u}}`, o.toString()); - } - return a; - } - /** - * 字符串拼接 - * - * @param str - 字符串数组 - */ - appendStr(...r) { - return r.join(""); - } - /** - * 判断字符串中,是否包含数组中任何一个元素 - * - * @param str - 字符串 - * @param arr - 字符串数组 - */ - includeInArray(r, n) { - let a = !1; - for (let u = 0; u < n.length; u++) { - const o = n[u]; - r.includes(o) && (a = !0); - } - return a; - } - /** - * 截取指定长度的字符串 - * - * @param str - str - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - getByLength(r, n, a) { - const u = r; - return u.length < n ? u : a ? u.substring(0, n) : u.substring(0, n) + "..."; - } - /** - * 字符串空值检测 - * - * @param str - 待检测的字符串 - */ - isEmptyString(r) { - return !r || typeof r != "string" ? !0 : r.trim().length === 0; - } - /** - * 路径组合,解决多出来/的问题 - * - * @param path1 - 路径1 - * @param path2 - 路径2 - */ - pathJoin(r, n) { - let a = r; - const u = r.lastIndexOf("/"); - return u + 1 === r.length && (a = r.substring(0, u)), n.indexOf("/") > 0 ? a = a + "/" + n : a = a + n, a; - } - /** - * 强转boolean - * - * @param val - val - */ - parseBoolean(r) { - return r || (r = "false"), r.toString().toLowerCase() === "true"; - } -} -const Lt = (e, r) => { - const n = fn(e), a = fn(r), u = n.pop(), o = a.pop(), p = mn(n, a); - return p !== 0 ? p : u && o ? mn(u.split("."), o.split(".")) : u || o ? u ? -1 : 1 : 0; -}, So = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, fn = (e) => { - if (typeof e != "string") - throw new TypeError("Invalid argument expected string"); - const r = e.match(So); - if (!r) - throw new Error(`Invalid argument not valid semver ('${e}' received)`); - return r.shift(), r; -}, hn = (e) => e === "*" || e === "x" || e === "X", pn = (e) => { - const r = parseInt(e, 10); - return isNaN(r) ? e : r; -}, Co = (e, r) => typeof e != typeof r ? [String(e), String(r)] : [e, r], To = (e, r) => { - if (hn(e) || hn(r)) - return 0; - const [n, a] = Co(pn(e), pn(r)); - return n > a ? 1 : n < a ? -1 : 0; -}, mn = (e, r) => { - for (let n = 0; n < Math.max(e.length, r.length); n++) { - const a = To(e[n] || "0", r[n] || "0"); - if (a !== 0) - return a; - } - return 0; -}; -class jo { - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is higher than v2 - */ - greater(r, n) { - return Lt(r, n) > 0; - } - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is equal to v2 - */ - equal(r, n) { - return Lt(r, n) === 0; - } - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is lesser than v2 - */ - lesser(r, n) { - return Lt(r, n) < 0; - } -} -var Oo = Object.defineProperty, No = (e, r, n) => r in e ? Oo(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, jr = (e, r, n) => (No(e, typeof r != "symbol" ? r + "" : r, n), n); -let dr = class { -}; -jr(dr, "NODE_ENV_KEY", "NODE_ENV"), /** -* 开发环境 -*/ -jr(dr, "NODE_ENV_DEVELOPMENT", "development"), /** -* 生产环境 -*/ -jr(dr, "NODE_ENV_PRODUCTION", "production"), /** -* 测试环境 -*/ -jr(dr, "NODE_ENV_TEST", "test"), /** -* 是否处于调试模式 -*/ -jr(dr, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -class Ro { - /** - * 环境初始化 - * - * @param envMeta - 需要传入 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false} 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(r) { - jr(this, "envMeta"), this.envMeta = r; - } - /** - * 是否是开发阶段调试 - */ - isNodeDev() { - return this.getEnv(dr.NODE_ENV_KEY) === dr.NODE_ENV_DEVELOPMENT; - } - /** - * 是否是调试阶段 - */ - isDev() { - return this.isNodeDev() || this.getBooleanEnv(dr.VITE_DEBUG_MODE_KEY); - } - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(r) { - let n; - try { - this.envMeta[r] && (n = this.envMeta[r]); - } catch { - } - return n; - } - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(r) { - return this.getEnv(r) ?? ""; - } - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(r) { - let n = !1; - return this.getEnv(r) && (n = this.getStringEnv(r).toLowerCase() === "true"), n; - } - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(r, n) { - const a = this.getStringEnv(r); - return a.trim().length == 0 ? n : a; - } -} -var Ao = Object.defineProperty, Io = (e, r, n) => r in e ? Ao(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, Nr = (e, r, n) => (Io(e, typeof r != "symbol" ? r + "" : r, n), n); -class Pt { -} -Nr(Pt, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), Nr(Pt, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX"); -var Ze = /* @__PURE__ */ ((e) => (e.LOG_LEVEL_TRACE = "TRACE", e.LOG_LEVEL_DEBUG = "DEBUG", e.LOG_LEVEL_INFO = "INFO", e.LOG_LEVEL_WARN = "WARN", e.LOG_LEVEL_ERROR = "ERROR", e))(Ze || {}), us = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function Oa(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var is = { exports: {} }; -(function(e) { - (function(r, n) { - e.exports ? e.exports = n() : r.log = n(); - })(us, function() { - var r = function() { - }, n = "undefined", a = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), u = [ - "trace", - "debug", - "info", - "warn", - "error" - ]; - function o(j, T) { - var $ = j[T]; - if (typeof $.bind == "function") - return $.bind(j); - try { - return Function.prototype.bind.call($, j); - } catch { - return function() { - return Function.prototype.apply.apply($, [j, arguments]); - }; - } - } - function p() { - console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace(); - } - function y(j) { - return j === "debug" && (j = "log"), typeof console === n ? !1 : j === "trace" && a ? p : console[j] !== void 0 ? o(console, j) : console.log !== void 0 ? o(console, "log") : r; - } - function b(j, T) { - for (var $ = 0; $ < u.length; $++) { - var O = u[$]; - this[O] = $ < j ? r : this.methodFactory(O, j, T); - } - this.log = this.debug; - } - function v(j, T, $) { - return function() { - typeof console !== n && (b.call(this, T, $), this[j].apply(this, arguments)); - }; - } - function g(j, T, $) { - return y(j) || v.apply(this, arguments); - } - function S(j, T, $) { - var O = this, D; - T = T ?? "WARN"; - var t = "loglevel"; - typeof j == "string" ? t += ":" + j : typeof j == "symbol" && (t = void 0); - function d(m) { - var h = (u[m] || "silent").toUpperCase(); - if (!(typeof window === n || !t)) { - try { - window.localStorage[t] = h; - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(t) + "=" + h + ";"; - } catch { - } - } - } - function s() { - var m; - if (!(typeof window === n || !t)) { - try { - m = window.localStorage[t]; - } catch { - } - if (typeof m === n) - try { - var h = window.document.cookie, C = h.indexOf( - encodeURIComponent(t) + "=" - ); - C !== -1 && (m = /^([^;]+)/.exec(h.slice(C))[1]); - } catch { - } - return O.levels[m] === void 0 && (m = void 0), m; - } - } - function i() { - if (!(typeof window === n || !t)) { - try { - window.localStorage.removeItem(t); - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(t) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; - } catch { - } - } - } - O.name = j, O.levels = { - TRACE: 0, - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - SILENT: 5 - }, O.methodFactory = $ || g, O.getLevel = function() { - return D; - }, O.setLevel = function(m, h) { - if (typeof m == "string" && O.levels[m.toUpperCase()] !== void 0 && (m = O.levels[m.toUpperCase()]), typeof m == "number" && m >= 0 && m <= O.levels.SILENT) { - if (D = m, h !== !1 && d(m), b.call(O, m, j), typeof console === n && m < O.levels.SILENT) - return "No console available for logging"; - } else - throw "log.setLevel() called with invalid level: " + m; - }, O.setDefaultLevel = function(m) { - T = m, s() || O.setLevel(m, !1); - }, O.resetLevel = function() { - O.setLevel(T, !1), i(); - }, O.enableAll = function(m) { - O.setLevel(O.levels.TRACE, m); - }, O.disableAll = function(m) { - O.setLevel(O.levels.SILENT, m); - }; - var c = s(); - c == null && (c = T), O.setLevel(c, !1); - } - var z = new S(), L = {}; - z.getLogger = function(j) { - if (typeof j != "symbol" && typeof j != "string" || j === "") - throw new TypeError("You must supply a name when creating a logger."); - var T = L[j]; - return T || (T = L[j] = new S( - j, - z.getLevel(), - z.methodFactory - )), T; - }; - var R = typeof window !== n ? window.log : void 0; - return z.noConflict = function() { - return typeof window !== n && window.log === z && (window.log = R), z; - }, z.getLoggers = function() { - return L; - }, z.default = z, z; - }); -})(is); -var Mo = is.exports; -const pt = /* @__PURE__ */ Oa(Mo); -var os = { exports: {} }; -(function(e) { - (function(r, n) { - e.exports ? e.exports = n() : r.prefix = n(r); - })(us, function(r) { - var n = function(g) { - for (var S = 1, z = arguments.length, L; S < z; S++) - for (L in arguments[S]) - Object.prototype.hasOwnProperty.call(arguments[S], L) && (g[L] = arguments[S][L]); - return g; - }, a = { - template: "[%t] %l:", - levelFormatter: function(g) { - return g.toUpperCase(); - }, - nameFormatter: function(g) { - return g || "root"; - }, - timestampFormatter: function(g) { - return g.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); - }, - format: void 0 - }, u, o = {}, p = function(g) { - if (!g || !g.getLogger) - throw new TypeError("Argument is not a root logger"); - u = g; - }, y = function(g, S) { - if (!g || !g.setLevel) - throw new TypeError("Argument is not a logger"); - var z = g.methodFactory, L = g.name || "", R = o[L] || o[""] || a; - function j(T, $, O) { - var D = z(T, $, O), t = o[O] || o[""], d = t.template.indexOf("%t") !== -1, s = t.template.indexOf("%l") !== -1, i = t.template.indexOf("%n") !== -1; - return function() { - for (var c = "", m = arguments.length, h = Array(m), C = 0; C < m; C++) - h[C] = arguments[C]; - if (L || !o[O]) { - var U = t.timestampFormatter(/* @__PURE__ */ new Date()), H = t.levelFormatter(T), V = t.nameFormatter(O); - t.format ? c += t.format(H, V, U) : (c += t.template, d && (c = c.replace(/%t/, U)), s && (c = c.replace(/%l/, H)), i && (c = c.replace(/%n/, V))), h.length && typeof h[0] == "string" ? h[0] = c + " " + h[0] : h.unshift(c); - } - D.apply(void 0, h); - }; - } - return o[L] || (g.methodFactory = j), S = S || {}, S.template && (S.format = void 0), o[L] = n({}, R, S), g.setLevel(g.getLevel()), u || g.warn( - "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md" - ), g; - }, b = { - reg: p, - apply: y - }, v; - return r && (v = r.prefix, b.noConflict = function() { - return r.prefix === b && (r.prefix = v), b; - }), b; - }); -})(os); -var Do = os.exports; -const gn = /* @__PURE__ */ Oa(Do); -function Lo() { - const e = Error.prepareStackTrace; - Error.prepareStackTrace = (n, a) => a; - const r = new Error().stack.slice(1); - return Error.prepareStackTrace = e, r; -} -class St { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - static stringToEnumValue(r, n) { - return r[Object.keys(r).filter((a) => r[a].toString() === n)[0]]; - } - /** - * 获取配置的日志级别 - */ - static getEnvLevel(r) { - if (!r) - return; - const n = r.getEnvOrDefault(Pt.LOG_LEVEL_KEY, Ze.LOG_LEVEL_INFO), a = St.stringToEnumValue(Ze, n.toUpperCase()); - return a || console.warn( - "[zhi-log] LOG_LEVEL is invalid in you .env file.It must be either debug, info, warn or error, fallback to default info level" - ), a; - } - /** - * 获取默认日志 - */ - static getEnvLogger(r) { - return r ? r.getEnv(Pt.LOG_PREFIX_KEY) : void 0; - } -} -var Na = { exports: {} }, _n = { exports: {} }, vn; -function zo() { - return vn || (vn = 1, function(e) { - const r = typeof process < "u" && process.env.TERM_PROGRAM === "Hyper", n = typeof process < "u" && process.platform === "win32", a = typeof process < "u" && process.platform === "linux", u = { - ballotDisabled: "☒", - ballotOff: "☐", - ballotOn: "☑", - bullet: "•", - bulletWhite: "◦", - fullBlock: "█", - heart: "❤", - identicalTo: "≡", - line: "─", - mark: "※", - middot: "·", - minus: "-", - multiplication: "×", - obelus: "÷", - pencilDownRight: "✎", - pencilRight: "✏", - pencilUpRight: "✐", - percent: "%", - pilcrow2: "❡", - pilcrow: "¶", - plusMinus: "±", - question: "?", - section: "§", - starsOff: "☆", - starsOn: "★", - upDownArrow: "↕" - }, o = Object.assign({}, u, { - check: "√", - cross: "×", - ellipsisLarge: "...", - ellipsis: "...", - info: "i", - questionSmall: "?", - pointer: ">", - pointerSmall: "»", - radioOff: "( )", - radioOn: "(*)", - warning: "‼" - }), p = Object.assign({}, u, { - ballotCross: "✘", - check: "✔", - cross: "✖", - ellipsisLarge: "⋯", - ellipsis: "…", - info: "ℹ", - questionFull: "?", - questionSmall: "﹖", - pointer: a ? "▸" : "❯", - pointerSmall: a ? "‣" : "›", - radioOff: "◯", - radioOn: "◉", - warning: "⚠" - }); - e.exports = n && !r ? o : p, Reflect.defineProperty(e.exports, "common", { enumerable: !1, value: u }), Reflect.defineProperty(e.exports, "windows", { enumerable: !1, value: o }), Reflect.defineProperty(e.exports, "other", { enumerable: !1, value: p }); - }(_n)), _n.exports; -} -const Vo = (e) => e !== null && typeof e == "object" && !Array.isArray(e), Fo = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, Uo = () => typeof process < "u" ? process.env.FORCE_COLOR !== "0" : !1, cs = () => { - const e = { - enabled: Uo(), - visible: !0, - styles: {}, - keys: {} - }, r = (o) => { - let p = o.open = `\x1B[${o.codes[0]}m`, y = o.close = `\x1B[${o.codes[1]}m`, b = o.regex = new RegExp(`\\u001b\\[${o.codes[1]}m`, "g"); - return o.wrap = (v, g) => { - v.includes(y) && (v = v.replace(b, y + p)); - let S = p + v + y; - return g ? S.replace(/\r*\n/g, `${y}$&${p}`) : S; - }, o; - }, n = (o, p, y) => typeof o == "function" ? o(p) : o.wrap(p, y), a = (o, p) => { - if (o === "" || o == null) - return ""; - if (e.enabled === !1) - return o; - if (e.visible === !1) - return ""; - let y = "" + o, b = y.includes(` -`), v = p.length; - for (v > 0 && p.includes("unstyle") && (p = [.../* @__PURE__ */ new Set(["unstyle", ...p])].reverse()); v-- > 0; ) - y = n(e.styles[p[v]], y, b); - return y; - }, u = (o, p, y) => { - e.styles[o] = r({ name: o, codes: p }), (e.keys[y] || (e.keys[y] = [])).push(o), Reflect.defineProperty(e, o, { - configurable: !0, - enumerable: !0, - set(b) { - e.alias(o, b); - }, - get() { - let b = (v) => a(v, b.stack); - return Reflect.setPrototypeOf(b, e), b.stack = this.stack ? this.stack.concat(o) : [o], b; - } - }); - }; - return u("reset", [0, 0], "modifier"), u("bold", [1, 22], "modifier"), u("dim", [2, 22], "modifier"), u("italic", [3, 23], "modifier"), u("underline", [4, 24], "modifier"), u("inverse", [7, 27], "modifier"), u("hidden", [8, 28], "modifier"), u("strikethrough", [9, 29], "modifier"), u("black", [30, 39], "color"), u("red", [31, 39], "color"), u("green", [32, 39], "color"), u("yellow", [33, 39], "color"), u("blue", [34, 39], "color"), u("magenta", [35, 39], "color"), u("cyan", [36, 39], "color"), u("white", [37, 39], "color"), u("gray", [90, 39], "color"), u("grey", [90, 39], "color"), u("bgBlack", [40, 49], "bg"), u("bgRed", [41, 49], "bg"), u("bgGreen", [42, 49], "bg"), u("bgYellow", [43, 49], "bg"), u("bgBlue", [44, 49], "bg"), u("bgMagenta", [45, 49], "bg"), u("bgCyan", [46, 49], "bg"), u("bgWhite", [47, 49], "bg"), u("blackBright", [90, 39], "bright"), u("redBright", [91, 39], "bright"), u("greenBright", [92, 39], "bright"), u("yellowBright", [93, 39], "bright"), u("blueBright", [94, 39], "bright"), u("magentaBright", [95, 39], "bright"), u("cyanBright", [96, 39], "bright"), u("whiteBright", [97, 39], "bright"), u("bgBlackBright", [100, 49], "bgBright"), u("bgRedBright", [101, 49], "bgBright"), u("bgGreenBright", [102, 49], "bgBright"), u("bgYellowBright", [103, 49], "bgBright"), u("bgBlueBright", [104, 49], "bgBright"), u("bgMagentaBright", [105, 49], "bgBright"), u("bgCyanBright", [106, 49], "bgBright"), u("bgWhiteBright", [107, 49], "bgBright"), e.ansiRegex = Fo, e.hasColor = e.hasAnsi = (o) => (e.ansiRegex.lastIndex = 0, typeof o == "string" && o !== "" && e.ansiRegex.test(o)), e.alias = (o, p) => { - let y = typeof p == "string" ? e[p] : p; - if (typeof y != "function") - throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); - y.stack || (Reflect.defineProperty(y, "name", { value: o }), e.styles[o] = y, y.stack = [o]), Reflect.defineProperty(e, o, { - configurable: !0, - enumerable: !0, - set(b) { - e.alias(o, b); - }, - get() { - let b = (v) => a(v, b.stack); - return Reflect.setPrototypeOf(b, e), b.stack = this.stack ? this.stack.concat(y.stack) : y.stack, b; - } - }); - }, e.theme = (o) => { - if (!Vo(o)) - throw new TypeError("Expected theme to be an object"); - for (let p of Object.keys(o)) - e.alias(p, o[p]); - return e; - }, e.alias("unstyle", (o) => typeof o == "string" && o !== "" ? (e.ansiRegex.lastIndex = 0, o.replace(e.ansiRegex, "")) : ""), e.alias("noop", (o) => o), e.none = e.clear = e.noop, e.stripColor = e.unstyle, e.symbols = zo(), e.define = u, e; -}; -Na.exports = cs(); -Na.exports.create = cs; -var Bo = Na.exports; -const De = /* @__PURE__ */ Oa(Bo); -let Gt, ls, fs, hs, ps = !0; -typeof process < "u" && ({ FORCE_COLOR: Gt, NODE_DISABLE_COLORS: ls, NO_COLOR: fs, TERM: hs } = process.env || {}, ps = process.stdout && process.stdout.isTTY); -const te = { - enabled: !ls && fs == null && hs !== "dumb" && (Gt != null && Gt !== "0" || ps), - // modifiers - reset: le(0, 0), - bold: le(1, 22), - dim: le(2, 22), - italic: le(3, 23), - underline: le(4, 24), - inverse: le(7, 27), - hidden: le(8, 28), - strikethrough: le(9, 29), - // colors - black: le(30, 39), - red: le(31, 39), - green: le(32, 39), - yellow: le(33, 39), - blue: le(34, 39), - magenta: le(35, 39), - cyan: le(36, 39), - white: le(37, 39), - gray: le(90, 39), - grey: le(90, 39), - // background colors - bgBlack: le(40, 49), - bgRed: le(41, 49), - bgGreen: le(42, 49), - bgYellow: le(43, 49), - bgBlue: le(44, 49), - bgMagenta: le(45, 49), - bgCyan: le(46, 49), - bgWhite: le(47, 49) -}; -function yn(e, r) { - let n = 0, a, u = "", o = ""; - for (; n < e.length; n++) - a = e[n], u += a.open, o += a.close, ~r.indexOf(a.close) && (r = r.replace(a.rgx, a.close + a.open)); - return u + r + o; -} -function Ho(e, r) { - let n = { has: e, keys: r }; - return n.reset = te.reset.bind(n), n.bold = te.bold.bind(n), n.dim = te.dim.bind(n), n.italic = te.italic.bind(n), n.underline = te.underline.bind(n), n.inverse = te.inverse.bind(n), n.hidden = te.hidden.bind(n), n.strikethrough = te.strikethrough.bind(n), n.black = te.black.bind(n), n.red = te.red.bind(n), n.green = te.green.bind(n), n.yellow = te.yellow.bind(n), n.blue = te.blue.bind(n), n.magenta = te.magenta.bind(n), n.cyan = te.cyan.bind(n), n.white = te.white.bind(n), n.gray = te.gray.bind(n), n.grey = te.grey.bind(n), n.bgBlack = te.bgBlack.bind(n), n.bgRed = te.bgRed.bind(n), n.bgGreen = te.bgGreen.bind(n), n.bgYellow = te.bgYellow.bind(n), n.bgBlue = te.bgBlue.bind(n), n.bgMagenta = te.bgMagenta.bind(n), n.bgCyan = te.bgCyan.bind(n), n.bgWhite = te.bgWhite.bind(n), n; -} -function le(e, r) { - let n = { - open: `\x1B[${e}m`, - close: `\x1B[${r}m`, - rgx: new RegExp(`\\x1b\\[${r}m`, "g") - }; - return function(a) { - return this !== void 0 && this.has !== void 0 ? (~this.has.indexOf(e) || (this.has.push(e), this.keys.push(n)), a === void 0 ? this : te.enabled ? yn(this.keys, a + "") : a + "") : a === void 0 ? Ho([e], [n]) : te.enabled ? yn([n], a + "") : a + ""; - }; -} -var qo = Object.defineProperty, Go = (e, r, n) => r in e ? qo(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, $e = (e, r, n) => (Go(e, typeof r != "symbol" ? r + "" : r, n), n); -const Ue = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return Ue.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let oe = Ue; -$e(oe, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -$e(oe, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -$e(oe, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -$e(oe, "isElectron", () => !Ue.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -$e(oe, "hasNodeEnv", () => Ue.isElectron() || Ue.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -$e(oe, "getQueryString", (e) => { - if (!Ue.isInBrowser) - return ""; - const r = window.location.search.substring(1).split("&"); - for (let n = 0; n < r.length; n++) { - const a = r[n].split("="); - if (a[0] === e) - return a[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -$e(oe, "replaceUrlParam", (e, r, n) => { - n == null && (n = ""); - const a = new RegExp("\\b(" + r + "=).*?(&|#|$)"); - if (e.search(a) >= 0) - return e.replace(a, "$1" + n + "$2"); - const [u, o] = e.split("#"), [p, y] = u.split("?"), b = new URLSearchParams(y); - b.set(r, n); - const v = b.toString(), g = p + (v ? "?" + v : ""); - return o ? g + "#" + o : g; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -$e(oe, "setUrlParameter", (e, r, n) => { - if (e.includes(r)) - return Ue.replaceUrlParam(e, r, n); - const a = e.split("#"); - let u = a[0]; - const o = a[1]; - return u.includes("?") ? u += `&${r}=${n}` : u += `?${r}=${n}`, o && (u += "#" + o), u; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -$e(oe, "reloadTabPage", (e, r = 200) => { - setTimeout(function() { - if (Ue.isInBrowser) { - const n = window.location.href; - window.location.href = Ue.setUrlParameter(n, "tab", e); - } - }, r); -}), /** -* 刷新当前tab页面 -*/ -$e(oe, "reloadPage", () => { - setTimeout(function() { - Ue.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -$e(oe, "reloadPageWithMessageCallback", (e, r) => { - r && r(e), setTimeout(function() { - Ue.isInBrowser && window.location.reload(); - }, 200); -}); -var Ce = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(Ce || {}); -const Oe = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return oe.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, r) { - let n = e; - switch (r) { - case Ce.BasePathType_Appearance: - n = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case Ce.BasePathType_Data: - n = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case Ce.BasePathType_Themes: - n = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case Ce.BasePathType_ZhiTheme: - n = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: a } = await import( - /* @vite-ignore */ - n - ); - return a; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, Ce.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (oe.hasNodeEnv()) { - const r = this.requireLib("path"); - if (r) - return r.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(oe.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (oe.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let pr = Oe; -$e(pr, "isInSiyuanWidget", () => oe.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -$e(pr, "isInSiyuanNewWin", () => !oe.isInBrowser || !oe.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -$e(pr, "requireLib", (e, r = !0, n = Ce.BasePathType_None) => { - if (!oe.hasNodeEnv()) - throw new Error("require ony works on node env"); - let a = e; - if (!r) - switch (n) { - case Ce.BasePathType_Appearance: - a = Oe.joinPath(Oe.siyuanAppearancePath(), e); - break; - case Ce.BasePathType_Data: - a = Oe.joinPath(Oe.siyuanDataPath(), e); - break; - case Ce.BasePathType_Themes: - a = Oe.joinPath(Oe.siyuanAppearancePath(), "themes", e); - break; - case Ce.BasePathType_ZhiTheme: - a = Oe.joinPath(Oe.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const u = Oe.siyuanWindow(); - if (!u) - return require(a); - if (typeof u.require < "u") - return u.require(a); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -$e(pr, "requireAppearanceLib", (e) => Oe.requireLib(e, !1, Ce.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -$e(pr, "requireDataLib", (e) => Oe.requireLib(e, !1, Ce.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -$e(pr, "requireThemesLib", (e) => Oe.requireLib(e, !1, Ce.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -$e(pr, "requireZhiThemeLib", (e) => Oe.requireLib(e, !1, Ce.BasePathType_ZhiTheme)); -const Le = { - white: (e) => oe.isElectron() ? De.whiteBright(e) : te.white(e), - gray: (e) => oe.isElectron() ? De.gray(e) : te.gray(e), - blue: (e) => oe.isElectron() ? De.blue(e) : te.blue(e), - green: (e) => oe.isElectron() ? De.green(e) : te.green(e), - yellow: (e) => oe.isElectron() ? De.yellow(e) : te.yellow(e), - red: (e) => oe.isElectron() ? De.red(e) : te.red(e), - bgWhite: (e) => oe.isElectron() ? De.bgWhiteBright(e) : te.bgWhite(e), - bgGrey: (e) => oe.isElectron() ? De.bgCyanBright(e) : te.bgCyan(e), - bgBlue: (e) => oe.isElectron() ? De.bgBlueBright(e) : te.bgBlue(e), - bgGreen: (e) => oe.isElectron() ? De.bgGreenBright(e) : te.bgGreen(e), - bgYellow: (e) => oe.isElectron() ? De.bgYellowBright(e) : te.bgYellow(e), - bgRed: (e) => oe.isElectron() ? De.bgRedBright(e) : te.bgRed(e) -}; -class Ko { - constructor(r, n, a) { - Nr(this, "consoleLogger", "console"), Nr(this, "stackSize", 1), Nr(this, "getLogger", (p) => { - let y; - if (p) - y = p; - else { - const b = this.getCallStack(), v = [], g = []; - for (let S = 0; S < b.length; S++) { - const z = b[S], L = z.getFileName() ?? "none"; - if (S > this.stackSize - 1) - break; - const R = L + "-" + z.getLineNumber() + ":" + z.getColumnNumber(); - v.push(R); - } - g.length > 0 && (y = v.join(" -> ")); - } - return (!y || y.trim().length === 0) && (y = this.consoleLogger), pt.getLogger(y); - }), this.stackSize = 1; - let u; - r ? u = r : u = St.getEnvLevel(a), u = u ?? Ze.LOG_LEVEL_INFO, pt.setLevel(u); - const o = (p, y, b, v) => { - const g = [], S = n ?? St.getEnvLogger(a) ?? "zhi"; - return g.push(Le.gray("[") + v(S) + Le.gray("]")), g.push(Le.gray("[") + Le.gray(b.toString()) + Le.gray("]")), g.push(v(p.toUpperCase().toString())), g.push(v(y)), g.push(Le.gray(":")), g; - }; - gn.reg(pt), gn.apply(pt, { - format(p, y, b) { - let v = []; - const g = y ?? ""; - switch (p) { - case Ze.LOG_LEVEL_TRACE: - v = o(p, g, b, Le.gray); - break; - case Ze.LOG_LEVEL_DEBUG: - v = o(p, g, b, Le.blue); - break; - case Ze.LOG_LEVEL_INFO: - v = o(p, g, b, Le.green); - break; - case Ze.LOG_LEVEL_WARN: - v = o(p, g, b, Le.yellow); - break; - case Ze.LOG_LEVEL_ERROR: - v = o(p, g, b, Le.red); - break; - default: - v = o(Ze.LOG_LEVEL_INFO, g, b, Le.green); - break; - } - return v.join(" "); - } - }); - } - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(r) { - this.stackSize = r ?? 1; - } - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack() { - let r; - try { - r = Lo(); - } catch { - r = []; - } - return r; - } -} -class Wo { - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - constructor(r, n, a) { - Nr(this, "logger"), this.logger = new Ko(r, n, a); - } - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - getLogger(r, n) { - return this.logger.setStackSize(n), this.logger.getLogger(r); - } -} -class wn extends Wo { - constructor(r, n, a) { - super(r, n, a); - } - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(r, n) { - return super.getLogger(r, n); - } -} -class Ra { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(r, n) { - return Ra.customLogFactory(void 0, void 0, r).getLogger(void 0, n); - } - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(r, n, a) { - return new wn(r, n, a); - } - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(r, n) { - return new wn(void 0, r, n); - } -} -const Jo = "zhi"; -class yt { - /** - * 某些情况下,可能需要手动 init 之后才能用 - */ - static initEnv(r) { - this.env = r; - } - /** - * 获取 zhi-env 实例 - 必须在使用的时候重写此方法 - * - * ``` - * if (!this.env) { - * this.env = new Env({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false}) - * } - * return this.env - * ``` - * - * @see {@link https://github.com/terwer/zhi/tree/main/apps/zhi-env#usage docs for zhi-env usage} - */ - static zhiEnv() { - throw new Error("Method 'zhiEnv' must be implemented"); - } - /** - * 获取 zhi-log 实例 - * - * @param sign - 标志 - * @param loggerName - 日志名称 - */ - static zhiLogWithSign(r, n) { - if (this.loggerMap[n]) - return this.loggerMap[n].debug("Zhi-log use cache"), this.loggerMap[n]; - const a = this.env, u = Ra.customSignLogFactory(r, a).getLogger(n); - return this.loggerMap[n] = u, u.debug("Zhi-log add new logger"), u; - } - /** - * 获取 zhi-log 实例 - * - * @param loggerName - 日志名称 - */ - static zhiLog(r) { - return this.zhiLogWithSign(Jo, r); - } - /** - * 获取 zhi-common 实例 - */ - static zhiCommon() { - return this.common || (this.common = new xo()), this.common; - } -} -/** - * zhi-util 的运行时环境 - */ -be(yt, "env"), /** - * zhi-util 的日志器缓存 - */ -be(yt, "loggerMap", {}), /** - * zhi-util 的通用工具类 - */ -be(yt, "common"); -class Aa extends yt { - static zhiEnv() { - return this.env || (this.env = new Ro({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 })), this.env; - } -} -class bn { - constructor() { - be(this, "logger"); - this.logger = Aa.zhiLog("lute-adaptor"), Lute ? this.logger.debug("Detected Lute is bundled, will use!") : this.logger.debug("Lute is not available!"); - } - isAvailable() { - return typeof Lute < "u"; - } - /** - * 高亮关键字 - * - * @param str - 字符串 - * @private - */ - highlightWords(r) { - const n = new RegExp("(?<=^|[\\s\\S])==([^\\n]+?)==(?=($|[\\s\\S]))", "g"); - return r.replace(n, '$1'); - } - /** - * 渲染Markdown - * - * @param md - Markdown - */ - async renderMarkdownStr(r) { - if (!this.isAvailable()) - return this.logger.error("Lute is not available, will return original md"), r; - const n = Lute, a = n.New(), u = { - renderText: (o, p) => p ? [this.highlightWords(o.Text()), n.WalkContinue] : ["", n.WalkContinue] - // renderStrong: (node: any, entering: any) => { - // return ["", luteObj.WalkContinue] - // }, - // renderParagraph: (node: any, entering: any) => { - // return ["", luteObj.WalkContinue] - // } - }; - return a.SetJSRenderers({ - renderers: { - Md2HTML: u - } - }), this.logger.info("Lute is rendering md to HTML..."), a.MarkdownStr("", r); - } -} -var ms = { exports: {} }; -(function(e) { - (function() { - function r(t) { - var d = { - omitExtraWLInCodeBlocks: { - defaultValue: !1, - describe: "Omit the default extra whiteline added to code blocks", - type: "boolean" - }, - noHeaderId: { - defaultValue: !1, - describe: "Turn on/off generated header id", - type: "boolean" - }, - prefixHeaderId: { - defaultValue: !1, - describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix", - type: "string" - }, - rawPrefixHeaderId: { - defaultValue: !1, - describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)', - type: "boolean" - }, - ghCompatibleHeaderId: { - defaultValue: !1, - describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)", - type: "boolean" - }, - rawHeaderId: { - defaultValue: !1, - describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`, - type: "boolean" - }, - headerLevelStart: { - defaultValue: !1, - describe: "The header blocks level start", - type: "integer" - }, - parseImgDimensions: { - defaultValue: !1, - describe: "Turn on/off image dimension parsing", - type: "boolean" - }, - simplifiedAutoLink: { - defaultValue: !1, - describe: "Turn on/off GFM autolink style", - type: "boolean" - }, - excludeTrailingPunctuationFromURLs: { - defaultValue: !1, - describe: "Excludes trailing punctuation from links generated with autoLinking", - type: "boolean" - }, - literalMidWordUnderscores: { - defaultValue: !1, - describe: "Parse midword underscores as literal underscores", - type: "boolean" - }, - literalMidWordAsterisks: { - defaultValue: !1, - describe: "Parse midword asterisks as literal asterisks", - type: "boolean" - }, - strikethrough: { - defaultValue: !1, - describe: "Turn on/off strikethrough support", - type: "boolean" - }, - tables: { - defaultValue: !1, - describe: "Turn on/off tables support", - type: "boolean" - }, - tablesHeaderId: { - defaultValue: !1, - describe: "Add an id to table headers", - type: "boolean" - }, - ghCodeBlocks: { - defaultValue: !0, - describe: "Turn on/off GFM fenced code blocks support", - type: "boolean" - }, - tasklists: { - defaultValue: !1, - describe: "Turn on/off GFM tasklist support", - type: "boolean" - }, - smoothLivePreview: { - defaultValue: !1, - describe: "Prevents weird effects in live previews due to incomplete input", - type: "boolean" - }, - smartIndentationFix: { - defaultValue: !1, - describe: "Tries to smartly fix indentation in es6 strings", - type: "boolean" - }, - disableForced4SpacesIndentedSublists: { - defaultValue: !1, - describe: "Disables the requirement of indenting nested sublists by 4 spaces", - type: "boolean" - }, - simpleLineBreaks: { - defaultValue: !1, - describe: "Parses simple line breaks as
(GFM Style)", - type: "boolean" - }, - requireSpaceBeforeHeadingText: { - defaultValue: !1, - describe: "Makes adding a space between `#` and the header text mandatory (GFM Style)", - type: "boolean" - }, - ghMentions: { - defaultValue: !1, - describe: "Enables github @mentions", - type: "boolean" - }, - ghMentionsLink: { - defaultValue: "https://github.com/{u}", - describe: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.", - type: "string" - }, - encodeEmails: { - defaultValue: !0, - describe: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities", - type: "boolean" - }, - openLinksInNewWindow: { - defaultValue: !1, - describe: "Open all links in new windows", - type: "boolean" - }, - backslashEscapesHTMLTags: { - defaultValue: !1, - describe: "Support for HTML Tag escaping. ex:
foo
", - type: "boolean" - }, - emoji: { - defaultValue: !1, - describe: "Enable emoji support. Ex: `this is a :smile: emoji`", - type: "boolean" - }, - underline: { - defaultValue: !1, - describe: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``", - type: "boolean" - }, - ellipsis: { - defaultValue: !0, - describe: "Replaces three dots with the ellipsis unicode character", - type: "boolean" - }, - completeHTMLDocument: { - defaultValue: !1, - describe: "Outputs a complete html document, including ``, `` and `` tags", - type: "boolean" - }, - metadata: { - defaultValue: !1, - describe: "Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).", - type: "boolean" - }, - splitAdjacentBlockquotes: { - defaultValue: !1, - describe: "Split adjacent blockquote blocks", - type: "boolean" - } - }; - if (t === !1) - return JSON.parse(JSON.stringify(d)); - var s = {}; - for (var i in d) - d.hasOwnProperty(i) && (s[i] = d[i].defaultValue); - return s; - } - function n() { - var t = r(!0), d = {}; - for (var s in t) - t.hasOwnProperty(s) && (d[s] = !0); - return d; - } - var a = {}, u = {}, o = {}, p = r(!0), y = "vanilla", b = { - github: { - omitExtraWLInCodeBlocks: !0, - simplifiedAutoLink: !0, - excludeTrailingPunctuationFromURLs: !0, - literalMidWordUnderscores: !0, - strikethrough: !0, - tables: !0, - tablesHeaderId: !0, - ghCodeBlocks: !0, - tasklists: !0, - disableForced4SpacesIndentedSublists: !0, - simpleLineBreaks: !0, - requireSpaceBeforeHeadingText: !0, - ghCompatibleHeaderId: !0, - ghMentions: !0, - backslashEscapesHTMLTags: !0, - emoji: !0, - splitAdjacentBlockquotes: !0 - }, - original: { - noHeaderId: !0, - ghCodeBlocks: !1 - }, - ghost: { - omitExtraWLInCodeBlocks: !0, - parseImgDimensions: !0, - simplifiedAutoLink: !0, - excludeTrailingPunctuationFromURLs: !0, - literalMidWordUnderscores: !0, - strikethrough: !0, - tables: !0, - tablesHeaderId: !0, - ghCodeBlocks: !0, - tasklists: !0, - smoothLivePreview: !0, - simpleLineBreaks: !0, - requireSpaceBeforeHeadingText: !0, - ghMentions: !1, - encodeEmails: !0 - }, - vanilla: r(!0), - allOn: n() - }; - a.helper = {}, a.extensions = {}, a.setOption = function(t, d) { - return p[t] = d, this; - }, a.getOption = function(t) { - return p[t]; - }, a.getOptions = function() { - return p; - }, a.resetOptions = function() { - p = r(!0); - }, a.setFlavor = function(t) { - if (!b.hasOwnProperty(t)) - throw Error(t + " flavor was not found"); - a.resetOptions(); - var d = b[t]; - y = t; - for (var s in d) - d.hasOwnProperty(s) && (p[s] = d[s]); - }, a.getFlavor = function() { - return y; - }, a.getFlavorOptions = function(t) { - if (b.hasOwnProperty(t)) - return b[t]; - }, a.getDefaultOptions = function(t) { - return r(t); - }, a.subParser = function(t, d) { - if (a.helper.isString(t)) - if (typeof d < "u") - u[t] = d; - else { - if (u.hasOwnProperty(t)) - return u[t]; - throw Error("SubParser named " + t + " not registered!"); - } - }, a.extension = function(t, d) { - if (!a.helper.isString(t)) - throw Error("Extension 'name' must be a string"); - if (t = a.helper.stdExtName(t), a.helper.isUndefined(d)) { - if (!o.hasOwnProperty(t)) - throw Error("Extension named " + t + " is not registered!"); - return o[t]; - } else { - typeof d == "function" && (d = d()), a.helper.isArray(d) || (d = [d]); - var s = v(d, t); - if (s.valid) - o[t] = d; - else - throw Error(s.error); - } - }, a.getAllExtensions = function() { - return o; - }, a.removeExtension = function(t) { - delete o[t]; - }, a.resetExtensions = function() { - o = {}; - }; - function v(t, d) { - var s = d ? "Error in " + d + " extension->" : "Error in unnamed extension", i = { - valid: !0, - error: "" - }; - a.helper.isArray(t) || (t = [t]); - for (var c = 0; c < t.length; ++c) { - var m = s + " sub-extension " + c + ": ", h = t[c]; - if (typeof h != "object") - return i.valid = !1, i.error = m + "must be an object, but " + typeof h + " given", i; - if (!a.helper.isString(h.type)) - return i.valid = !1, i.error = m + 'property "type" must be a string, but ' + typeof h.type + " given", i; - var C = h.type = h.type.toLowerCase(); - if (C === "language" && (C = h.type = "lang"), C === "html" && (C = h.type = "output"), C !== "lang" && C !== "output" && C !== "listener") - return i.valid = !1, i.error = m + "type " + C + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"', i; - if (C === "listener") { - if (a.helper.isUndefined(h.listeners)) - return i.valid = !1, i.error = m + '. Extensions of type "listener" must have a property called "listeners"', i; - } else if (a.helper.isUndefined(h.filter) && a.helper.isUndefined(h.regex)) - return i.valid = !1, i.error = m + C + ' extensions must define either a "regex" property or a "filter" method', i; - if (h.listeners) { - if (typeof h.listeners != "object") - return i.valid = !1, i.error = m + '"listeners" property must be an object but ' + typeof h.listeners + " given", i; - for (var U in h.listeners) - if (h.listeners.hasOwnProperty(U) && typeof h.listeners[U] != "function") - return i.valid = !1, i.error = m + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + U + " must be a function but " + typeof h.listeners[U] + " given", i; - } - if (h.filter) { - if (typeof h.filter != "function") - return i.valid = !1, i.error = m + '"filter" must be a function, but ' + typeof h.filter + " given", i; - } else if (h.regex) { - if (a.helper.isString(h.regex) && (h.regex = new RegExp(h.regex, "g")), !(h.regex instanceof RegExp)) - return i.valid = !1, i.error = m + '"regex" property must either be a string or a RegExp object, but ' + typeof h.regex + " given", i; - if (a.helper.isUndefined(h.replace)) - return i.valid = !1, i.error = m + '"regex" extensions must implement a replace string or function', i; - } - } - return i; - } - a.validateExtension = function(t) { - var d = v(t, null); - return d.valid ? !0 : (console.warn(d.error), !1); - }, a.hasOwnProperty("helper") || (a.helper = {}), a.helper.isString = function(t) { - return typeof t == "string" || t instanceof String; - }, a.helper.isFunction = function(t) { - var d = {}; - return t && d.toString.call(t) === "[object Function]"; - }, a.helper.isArray = function(t) { - return Array.isArray(t); - }, a.helper.isUndefined = function(t) { - return typeof t > "u"; - }, a.helper.forEach = function(t, d) { - if (a.helper.isUndefined(t)) - throw new Error("obj param is required"); - if (a.helper.isUndefined(d)) - throw new Error("callback param is required"); - if (!a.helper.isFunction(d)) - throw new Error("callback param must be a function/closure"); - if (typeof t.forEach == "function") - t.forEach(d); - else if (a.helper.isArray(t)) - for (var s = 0; s < t.length; s++) - d(t[s], s, t); - else if (typeof t == "object") - for (var i in t) - t.hasOwnProperty(i) && d(t[i], i, t); - else - throw new Error("obj does not seem to be an array or an iterable object"); - }, a.helper.stdExtName = function(t) { - return t.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase(); - }; - function g(t, d) { - var s = d.charCodeAt(0); - return "¨E" + s + "E"; - } - a.helper.escapeCharactersCallback = g, a.helper.escapeCharacters = function(t, d, s) { - var i = "([" + d.replace(/([\[\]\\])/g, "\\$1") + "])"; - s && (i = "\\\\" + i); - var c = new RegExp(i, "g"); - return t = t.replace(c, g), t; - }, a.helper.unescapeHTMLEntities = function(t) { - return t.replace(/"/g, '"').replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"); - }; - var S = function(t, d, s, i) { - var c = i || "", m = c.indexOf("g") > -1, h = new RegExp(d + "|" + s, "g" + c.replace(/g/g, "")), C = new RegExp(d, c.replace(/g/g, "")), U = [], H, V, G, _, q; - do - for (H = 0; G = h.exec(t); ) - if (C.test(G[0])) - H++ || (V = h.lastIndex, _ = V - G[0].length); - else if (H && !--H) { - q = G.index + G[0].length; - var J = { - left: { start: _, end: V }, - match: { start: V, end: G.index }, - right: { start: G.index, end: q }, - wholeMatch: { start: _, end: q } - }; - if (U.push(J), !m) - return U; - } - while (H && (h.lastIndex = V)); - return U; - }; - a.helper.matchRecursiveRegExp = function(t, d, s, i) { - for (var c = S(t, d, s, i), m = [], h = 0; h < c.length; ++h) - m.push([ - t.slice(c[h].wholeMatch.start, c[h].wholeMatch.end), - t.slice(c[h].match.start, c[h].match.end), - t.slice(c[h].left.start, c[h].left.end), - t.slice(c[h].right.start, c[h].right.end) - ]); - return m; - }, a.helper.replaceRecursiveRegExp = function(t, d, s, i, c) { - if (!a.helper.isFunction(d)) { - var m = d; - d = function() { - return m; - }; - } - var h = S(t, s, i, c), C = t, U = h.length; - if (U > 0) { - var H = []; - h[0].wholeMatch.start !== 0 && H.push(t.slice(0, h[0].wholeMatch.start)); - for (var V = 0; V < U; ++V) - H.push( - d( - t.slice(h[V].wholeMatch.start, h[V].wholeMatch.end), - t.slice(h[V].match.start, h[V].match.end), - t.slice(h[V].left.start, h[V].left.end), - t.slice(h[V].right.start, h[V].right.end) - ) - ), V < U - 1 && H.push(t.slice(h[V].wholeMatch.end, h[V + 1].wholeMatch.start)); - h[U - 1].wholeMatch.end < t.length && H.push(t.slice(h[U - 1].wholeMatch.end)), C = H.join(""); - } - return C; - }, a.helper.regexIndexOf = function(t, d, s) { - if (!a.helper.isString(t)) - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; - if (!(d instanceof RegExp)) - throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp"; - var i = t.substring(s || 0).search(d); - return i >= 0 ? i + (s || 0) : i; - }, a.helper.splitAtIndex = function(t, d) { - if (!a.helper.isString(t)) - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; - return [t.substring(0, d), t.substring(d)]; - }, a.helper.encodeEmailAddress = function(t) { - var d = [ - function(s) { - return "&#" + s.charCodeAt(0) + ";"; - }, - function(s) { - return "&#x" + s.charCodeAt(0).toString(16) + ";"; - }, - function(s) { - return s; - } - ]; - return t = t.replace(/./g, function(s) { - if (s === "@") - s = d[Math.floor(Math.random() * 2)](s); - else { - var i = Math.random(); - s = i > 0.9 ? d[2](s) : i > 0.45 ? d[1](s) : d[0](s); - } - return s; - }), t; - }, a.helper.padEnd = function(d, s, i) { - return s = s >> 0, i = String(i || " "), d.length > s ? String(d) : (s = s - d.length, s > i.length && (i += i.repeat(s / i.length)), String(d) + i.slice(0, s)); - }, typeof console > "u" && (console = { - warn: function(t) { - alert(t); - }, - log: function(t) { - alert(t); - }, - error: function(t) { - throw t; - } - }), a.helper.regexes = { - asteriskDashAndColon: /([*_:~])/g - }, a.helper.emojis = { - "+1": "👍", - "-1": "👎", - 100: "💯", - 1234: "🔢", - "1st_place_medal": "🥇", - "2nd_place_medal": "🥈", - "3rd_place_medal": "🥉", - "8ball": "🎱", - a: "🅰️", - ab: "🆎", - abc: "🔤", - abcd: "🔡", - accept: "🉑", - aerial_tramway: "🚡", - airplane: "✈️", - alarm_clock: "⏰", - alembic: "⚗️", - alien: "👽", - ambulance: "🚑", - amphora: "🏺", - anchor: "⚓️", - angel: "👼", - anger: "💢", - angry: "😠", - anguished: "😧", - ant: "🐜", - apple: "🍎", - aquarius: "♒️", - aries: "♈️", - arrow_backward: "◀️", - arrow_double_down: "⏬", - arrow_double_up: "⏫", - arrow_down: "⬇️", - arrow_down_small: "🔽", - arrow_forward: "▶️", - arrow_heading_down: "⤵️", - arrow_heading_up: "⤴️", - arrow_left: "⬅️", - arrow_lower_left: "↙️", - arrow_lower_right: "↘️", - arrow_right: "➡️", - arrow_right_hook: "↪️", - arrow_up: "⬆️", - arrow_up_down: "↕️", - arrow_up_small: "🔼", - arrow_upper_left: "↖️", - arrow_upper_right: "↗️", - arrows_clockwise: "🔃", - arrows_counterclockwise: "🔄", - art: "🎨", - articulated_lorry: "🚛", - artificial_satellite: "🛰", - astonished: "😲", - athletic_shoe: "👟", - atm: "🏧", - atom_symbol: "⚛️", - avocado: "🥑", - b: "🅱️", - baby: "👶", - baby_bottle: "🍼", - baby_chick: "🐤", - baby_symbol: "🚼", - back: "🔙", - bacon: "🥓", - badminton: "🏸", - baggage_claim: "🛄", - baguette_bread: "🥖", - balance_scale: "⚖️", - balloon: "🎈", - ballot_box: "🗳", - ballot_box_with_check: "☑️", - bamboo: "🎍", - banana: "🍌", - bangbang: "‼️", - bank: "🏦", - bar_chart: "📊", - barber: "💈", - baseball: "⚾️", - basketball: "🏀", - basketball_man: "⛹️", - basketball_woman: "⛹️‍♀️", - bat: "🦇", - bath: "🛀", - bathtub: "🛁", - battery: "🔋", - beach_umbrella: "🏖", - bear: "🐻", - bed: "🛏", - bee: "🐝", - beer: "🍺", - beers: "🍻", - beetle: "🐞", - beginner: "🔰", - bell: "🔔", - bellhop_bell: "🛎", - bento: "🍱", - biking_man: "🚴", - bike: "🚲", - biking_woman: "🚴‍♀️", - bikini: "👙", - biohazard: "☣️", - bird: "🐦", - birthday: "🎂", - black_circle: "⚫️", - black_flag: "🏴", - black_heart: "🖤", - black_joker: "🃏", - black_large_square: "⬛️", - black_medium_small_square: "◾️", - black_medium_square: "◼️", - black_nib: "✒️", - black_small_square: "▪️", - black_square_button: "🔲", - blonde_man: "👱", - blonde_woman: "👱‍♀️", - blossom: "🌼", - blowfish: "🐡", - blue_book: "📘", - blue_car: "🚙", - blue_heart: "💙", - blush: "😊", - boar: "🐗", - boat: "⛵️", - bomb: "💣", - book: "📖", - bookmark: "🔖", - bookmark_tabs: "📑", - books: "📚", - boom: "💥", - boot: "👢", - bouquet: "💐", - bowing_man: "🙇", - bow_and_arrow: "🏹", - bowing_woman: "🙇‍♀️", - bowling: "🎳", - boxing_glove: "🥊", - boy: "👦", - bread: "🍞", - bride_with_veil: "👰", - bridge_at_night: "🌉", - briefcase: "💼", - broken_heart: "💔", - bug: "🐛", - building_construction: "🏗", - bulb: "💡", - bullettrain_front: "🚅", - bullettrain_side: "🚄", - burrito: "🌯", - bus: "🚌", - business_suit_levitating: "🕴", - busstop: "🚏", - bust_in_silhouette: "👤", - busts_in_silhouette: "👥", - butterfly: "🦋", - cactus: "🌵", - cake: "🍰", - calendar: "📆", - call_me_hand: "🤙", - calling: "📲", - camel: "🐫", - camera: "📷", - camera_flash: "📸", - camping: "🏕", - cancer: "♋️", - candle: "🕯", - candy: "🍬", - canoe: "🛶", - capital_abcd: "🔠", - capricorn: "♑️", - car: "🚗", - card_file_box: "🗃", - card_index: "📇", - card_index_dividers: "🗂", - carousel_horse: "🎠", - carrot: "🥕", - cat: "🐱", - cat2: "🐈", - cd: "💿", - chains: "⛓", - champagne: "🍾", - chart: "💹", - chart_with_downwards_trend: "📉", - chart_with_upwards_trend: "📈", - checkered_flag: "🏁", - cheese: "🧀", - cherries: "🍒", - cherry_blossom: "🌸", - chestnut: "🌰", - chicken: "🐔", - children_crossing: "🚸", - chipmunk: "🐿", - chocolate_bar: "🍫", - christmas_tree: "🎄", - church: "⛪️", - cinema: "🎦", - circus_tent: "🎪", - city_sunrise: "🌇", - city_sunset: "🌆", - cityscape: "🏙", - cl: "🆑", - clamp: "🗜", - clap: "👏", - clapper: "🎬", - classical_building: "🏛", - clinking_glasses: "🥂", - clipboard: "📋", - clock1: "🕐", - clock10: "🕙", - clock1030: "🕥", - clock11: "🕚", - clock1130: "🕦", - clock12: "🕛", - clock1230: "🕧", - clock130: "🕜", - clock2: "🕑", - clock230: "🕝", - clock3: "🕒", - clock330: "🕞", - clock4: "🕓", - clock430: "🕟", - clock5: "🕔", - clock530: "🕠", - clock6: "🕕", - clock630: "🕡", - clock7: "🕖", - clock730: "🕢", - clock8: "🕗", - clock830: "🕣", - clock9: "🕘", - clock930: "🕤", - closed_book: "📕", - closed_lock_with_key: "🔐", - closed_umbrella: "🌂", - cloud: "☁️", - cloud_with_lightning: "🌩", - cloud_with_lightning_and_rain: "⛈", - cloud_with_rain: "🌧", - cloud_with_snow: "🌨", - clown_face: "🤡", - clubs: "♣️", - cocktail: "🍸", - coffee: "☕️", - coffin: "⚰️", - cold_sweat: "😰", - comet: "☄️", - computer: "💻", - computer_mouse: "🖱", - confetti_ball: "🎊", - confounded: "😖", - confused: "😕", - congratulations: "㊗️", - construction: "🚧", - construction_worker_man: "👷", - construction_worker_woman: "👷‍♀️", - control_knobs: "🎛", - convenience_store: "🏪", - cookie: "🍪", - cool: "🆒", - policeman: "👮", - copyright: "©️", - corn: "🌽", - couch_and_lamp: "🛋", - couple: "👫", - couple_with_heart_woman_man: "💑", - couple_with_heart_man_man: "👨‍❤️‍👨", - couple_with_heart_woman_woman: "👩‍❤️‍👩", - couplekiss_man_man: "👨‍❤️‍💋‍👨", - couplekiss_man_woman: "💏", - couplekiss_woman_woman: "👩‍❤️‍💋‍👩", - cow: "🐮", - cow2: "🐄", - cowboy_hat_face: "🤠", - crab: "🦀", - crayon: "🖍", - credit_card: "💳", - crescent_moon: "🌙", - cricket: "🏏", - crocodile: "🐊", - croissant: "🥐", - crossed_fingers: "🤞", - crossed_flags: "🎌", - crossed_swords: "⚔️", - crown: "👑", - cry: "😢", - crying_cat_face: "😿", - crystal_ball: "🔮", - cucumber: "🥒", - cupid: "💘", - curly_loop: "➰", - currency_exchange: "💱", - curry: "🍛", - custard: "🍮", - customs: "🛃", - cyclone: "🌀", - dagger: "🗡", - dancer: "💃", - dancing_women: "👯", - dancing_men: "👯‍♂️", - dango: "🍡", - dark_sunglasses: "🕶", - dart: "🎯", - dash: "💨", - date: "📅", - deciduous_tree: "🌳", - deer: "🦌", - department_store: "🏬", - derelict_house: "🏚", - desert: "🏜", - desert_island: "🏝", - desktop_computer: "🖥", - male_detective: "🕵️", - diamond_shape_with_a_dot_inside: "💠", - diamonds: "♦️", - disappointed: "😞", - disappointed_relieved: "😥", - dizzy: "💫", - dizzy_face: "😵", - do_not_litter: "🚯", - dog: "🐶", - dog2: "🐕", - dollar: "💵", - dolls: "🎎", - dolphin: "🐬", - door: "🚪", - doughnut: "🍩", - dove: "🕊", - dragon: "🐉", - dragon_face: "🐲", - dress: "👗", - dromedary_camel: "🐪", - drooling_face: "🤤", - droplet: "💧", - drum: "🥁", - duck: "🦆", - dvd: "📀", - "e-mail": "📧", - eagle: "🦅", - ear: "👂", - ear_of_rice: "🌾", - earth_africa: "🌍", - earth_americas: "🌎", - earth_asia: "🌏", - egg: "🥚", - eggplant: "🍆", - eight_pointed_black_star: "✴️", - eight_spoked_asterisk: "✳️", - electric_plug: "🔌", - elephant: "🐘", - email: "✉️", - end: "🔚", - envelope_with_arrow: "📩", - euro: "💶", - european_castle: "🏰", - european_post_office: "🏤", - evergreen_tree: "🌲", - exclamation: "❗️", - expressionless: "😑", - eye: "👁", - eye_speech_bubble: "👁‍🗨", - eyeglasses: "👓", - eyes: "👀", - face_with_head_bandage: "🤕", - face_with_thermometer: "🤒", - fist_oncoming: "👊", - factory: "🏭", - fallen_leaf: "🍂", - family_man_woman_boy: "👪", - family_man_boy: "👨‍👦", - family_man_boy_boy: "👨‍👦‍👦", - family_man_girl: "👨‍👧", - family_man_girl_boy: "👨‍👧‍👦", - family_man_girl_girl: "👨‍👧‍👧", - family_man_man_boy: "👨‍👨‍👦", - family_man_man_boy_boy: "👨‍👨‍👦‍👦", - family_man_man_girl: "👨‍👨‍👧", - family_man_man_girl_boy: "👨‍👨‍👧‍👦", - family_man_man_girl_girl: "👨‍👨‍👧‍👧", - family_man_woman_boy_boy: "👨‍👩‍👦‍👦", - family_man_woman_girl: "👨‍👩‍👧", - family_man_woman_girl_boy: "👨‍👩‍👧‍👦", - family_man_woman_girl_girl: "👨‍👩‍👧‍👧", - family_woman_boy: "👩‍👦", - family_woman_boy_boy: "👩‍👦‍👦", - family_woman_girl: "👩‍👧", - family_woman_girl_boy: "👩‍👧‍👦", - family_woman_girl_girl: "👩‍👧‍👧", - family_woman_woman_boy: "👩‍👩‍👦", - family_woman_woman_boy_boy: "👩‍👩‍👦‍👦", - family_woman_woman_girl: "👩‍👩‍👧", - family_woman_woman_girl_boy: "👩‍👩‍👧‍👦", - family_woman_woman_girl_girl: "👩‍👩‍👧‍👧", - fast_forward: "⏩", - fax: "📠", - fearful: "😨", - feet: "🐾", - female_detective: "🕵️‍♀️", - ferris_wheel: "🎡", - ferry: "⛴", - field_hockey: "🏑", - file_cabinet: "🗄", - file_folder: "📁", - film_projector: "📽", - film_strip: "🎞", - fire: "🔥", - fire_engine: "🚒", - fireworks: "🎆", - first_quarter_moon: "🌓", - first_quarter_moon_with_face: "🌛", - fish: "🐟", - fish_cake: "🍥", - fishing_pole_and_fish: "🎣", - fist_raised: "✊", - fist_left: "🤛", - fist_right: "🤜", - flags: "🎏", - flashlight: "🔦", - fleur_de_lis: "⚜️", - flight_arrival: "🛬", - flight_departure: "🛫", - floppy_disk: "💾", - flower_playing_cards: "🎴", - flushed: "😳", - fog: "🌫", - foggy: "🌁", - football: "🏈", - footprints: "👣", - fork_and_knife: "🍴", - fountain: "⛲️", - fountain_pen: "🖋", - four_leaf_clover: "🍀", - fox_face: "🦊", - framed_picture: "🖼", - free: "🆓", - fried_egg: "🍳", - fried_shrimp: "🍤", - fries: "🍟", - frog: "🐸", - frowning: "😦", - frowning_face: "☹️", - frowning_man: "🙍‍♂️", - frowning_woman: "🙍", - middle_finger: "🖕", - fuelpump: "⛽️", - full_moon: "🌕", - full_moon_with_face: "🌝", - funeral_urn: "⚱️", - game_die: "🎲", - gear: "⚙️", - gem: "💎", - gemini: "♊️", - ghost: "👻", - gift: "🎁", - gift_heart: "💝", - girl: "👧", - globe_with_meridians: "🌐", - goal_net: "🥅", - goat: "🐐", - golf: "⛳️", - golfing_man: "🏌️", - golfing_woman: "🏌️‍♀️", - gorilla: "🦍", - grapes: "🍇", - green_apple: "🍏", - green_book: "📗", - green_heart: "💚", - green_salad: "🥗", - grey_exclamation: "❕", - grey_question: "❔", - grimacing: "😬", - grin: "😁", - grinning: "😀", - guardsman: "💂", - guardswoman: "💂‍♀️", - guitar: "🎸", - gun: "🔫", - haircut_woman: "💇", - haircut_man: "💇‍♂️", - hamburger: "🍔", - hammer: "🔨", - hammer_and_pick: "⚒", - hammer_and_wrench: "🛠", - hamster: "🐹", - hand: "✋", - handbag: "👜", - handshake: "🤝", - hankey: "💩", - hatched_chick: "🐥", - hatching_chick: "🐣", - headphones: "🎧", - hear_no_evil: "🙉", - heart: "❤️", - heart_decoration: "💟", - heart_eyes: "😍", - heart_eyes_cat: "😻", - heartbeat: "💓", - heartpulse: "💗", - hearts: "♥️", - heavy_check_mark: "✔️", - heavy_division_sign: "➗", - heavy_dollar_sign: "💲", - heavy_heart_exclamation: "❣️", - heavy_minus_sign: "➖", - heavy_multiplication_x: "✖️", - heavy_plus_sign: "➕", - helicopter: "🚁", - herb: "🌿", - hibiscus: "🌺", - high_brightness: "🔆", - high_heel: "👠", - hocho: "🔪", - hole: "🕳", - honey_pot: "🍯", - horse: "🐴", - horse_racing: "🏇", - hospital: "🏥", - hot_pepper: "🌶", - hotdog: "🌭", - hotel: "🏨", - hotsprings: "♨️", - hourglass: "⌛️", - hourglass_flowing_sand: "⏳", - house: "🏠", - house_with_garden: "🏡", - houses: "🏘", - hugs: "🤗", - hushed: "😯", - ice_cream: "🍨", - ice_hockey: "🏒", - ice_skate: "⛸", - icecream: "🍦", - id: "🆔", - ideograph_advantage: "🉐", - imp: "👿", - inbox_tray: "📥", - incoming_envelope: "📨", - tipping_hand_woman: "💁", - information_source: "ℹ️", - innocent: "😇", - interrobang: "⁉️", - iphone: "📱", - izakaya_lantern: "🏮", - jack_o_lantern: "🎃", - japan: "🗾", - japanese_castle: "🏯", - japanese_goblin: "👺", - japanese_ogre: "👹", - jeans: "👖", - joy: "😂", - joy_cat: "😹", - joystick: "🕹", - kaaba: "🕋", - key: "🔑", - keyboard: "⌨️", - keycap_ten: "🔟", - kick_scooter: "🛴", - kimono: "👘", - kiss: "💋", - kissing: "😗", - kissing_cat: "😽", - kissing_closed_eyes: "😚", - kissing_heart: "😘", - kissing_smiling_eyes: "😙", - kiwi_fruit: "🥝", - koala: "🐨", - koko: "🈁", - label: "🏷", - large_blue_circle: "🔵", - large_blue_diamond: "🔷", - large_orange_diamond: "🔶", - last_quarter_moon: "🌗", - last_quarter_moon_with_face: "🌜", - latin_cross: "✝️", - laughing: "😆", - leaves: "🍃", - ledger: "📒", - left_luggage: "🛅", - left_right_arrow: "↔️", - leftwards_arrow_with_hook: "↩️", - lemon: "🍋", - leo: "♌️", - leopard: "🐆", - level_slider: "🎚", - libra: "♎️", - light_rail: "🚈", - link: "🔗", - lion: "🦁", - lips: "👄", - lipstick: "💄", - lizard: "🦎", - lock: "🔒", - lock_with_ink_pen: "🔏", - lollipop: "🍭", - loop: "➿", - loud_sound: "🔊", - loudspeaker: "📢", - love_hotel: "🏩", - love_letter: "💌", - low_brightness: "🔅", - lying_face: "🤥", - m: "Ⓜ️", - mag: "🔍", - mag_right: "🔎", - mahjong: "🀄️", - mailbox: "📫", - mailbox_closed: "📪", - mailbox_with_mail: "📬", - mailbox_with_no_mail: "📭", - man: "👨", - man_artist: "👨‍🎨", - man_astronaut: "👨‍🚀", - man_cartwheeling: "🤸‍♂️", - man_cook: "👨‍🍳", - man_dancing: "🕺", - man_facepalming: "🤦‍♂️", - man_factory_worker: "👨‍🏭", - man_farmer: "👨‍🌾", - man_firefighter: "👨‍🚒", - man_health_worker: "👨‍⚕️", - man_in_tuxedo: "🤵", - man_judge: "👨‍⚖️", - man_juggling: "🤹‍♂️", - man_mechanic: "👨‍🔧", - man_office_worker: "👨‍💼", - man_pilot: "👨‍✈️", - man_playing_handball: "🤾‍♂️", - man_playing_water_polo: "🤽‍♂️", - man_scientist: "👨‍🔬", - man_shrugging: "🤷‍♂️", - man_singer: "👨‍🎤", - man_student: "👨‍🎓", - man_teacher: "👨‍🏫", - man_technologist: "👨‍💻", - man_with_gua_pi_mao: "👲", - man_with_turban: "👳", - tangerine: "🍊", - mans_shoe: "👞", - mantelpiece_clock: "🕰", - maple_leaf: "🍁", - martial_arts_uniform: "🥋", - mask: "😷", - massage_woman: "💆", - massage_man: "💆‍♂️", - meat_on_bone: "🍖", - medal_military: "🎖", - medal_sports: "🏅", - mega: "📣", - melon: "🍈", - memo: "📝", - men_wrestling: "🤼‍♂️", - menorah: "🕎", - mens: "🚹", - metal: "🤘", - metro: "🚇", - microphone: "🎤", - microscope: "🔬", - milk_glass: "🥛", - milky_way: "🌌", - minibus: "🚐", - minidisc: "💽", - mobile_phone_off: "📴", - money_mouth_face: "🤑", - money_with_wings: "💸", - moneybag: "💰", - monkey: "🐒", - monkey_face: "🐵", - monorail: "🚝", - moon: "🌔", - mortar_board: "🎓", - mosque: "🕌", - motor_boat: "🛥", - motor_scooter: "🛵", - motorcycle: "🏍", - motorway: "🛣", - mount_fuji: "🗻", - mountain: "⛰", - mountain_biking_man: "🚵", - mountain_biking_woman: "🚵‍♀️", - mountain_cableway: "🚠", - mountain_railway: "🚞", - mountain_snow: "🏔", - mouse: "🐭", - mouse2: "🐁", - movie_camera: "🎥", - moyai: "🗿", - mrs_claus: "🤶", - muscle: "💪", - mushroom: "🍄", - musical_keyboard: "🎹", - musical_note: "🎵", - musical_score: "🎼", - mute: "🔇", - nail_care: "💅", - name_badge: "📛", - national_park: "🏞", - nauseated_face: "🤢", - necktie: "👔", - negative_squared_cross_mark: "❎", - nerd_face: "🤓", - neutral_face: "😐", - new: "🆕", - new_moon: "🌑", - new_moon_with_face: "🌚", - newspaper: "📰", - newspaper_roll: "🗞", - next_track_button: "⏭", - ng: "🆖", - no_good_man: "🙅‍♂️", - no_good_woman: "🙅", - night_with_stars: "🌃", - no_bell: "🔕", - no_bicycles: "🚳", - no_entry: "⛔️", - no_entry_sign: "🚫", - no_mobile_phones: "📵", - no_mouth: "😶", - no_pedestrians: "🚷", - no_smoking: "🚭", - "non-potable_water": "🚱", - nose: "👃", - notebook: "📓", - notebook_with_decorative_cover: "📔", - notes: "🎶", - nut_and_bolt: "🔩", - o: "⭕️", - o2: "🅾️", - ocean: "🌊", - octopus: "🐙", - oden: "🍢", - office: "🏢", - oil_drum: "🛢", - ok: "🆗", - ok_hand: "👌", - ok_man: "🙆‍♂️", - ok_woman: "🙆", - old_key: "🗝", - older_man: "👴", - older_woman: "👵", - om: "🕉", - on: "🔛", - oncoming_automobile: "🚘", - oncoming_bus: "🚍", - oncoming_police_car: "🚔", - oncoming_taxi: "🚖", - open_file_folder: "📂", - open_hands: "👐", - open_mouth: "😮", - open_umbrella: "☂️", - ophiuchus: "⛎", - orange_book: "📙", - orthodox_cross: "☦️", - outbox_tray: "📤", - owl: "🦉", - ox: "🐂", - package: "📦", - page_facing_up: "📄", - page_with_curl: "📃", - pager: "📟", - paintbrush: "🖌", - palm_tree: "🌴", - pancakes: "🥞", - panda_face: "🐼", - paperclip: "📎", - paperclips: "🖇", - parasol_on_ground: "⛱", - parking: "🅿️", - part_alternation_mark: "〽️", - partly_sunny: "⛅️", - passenger_ship: "🛳", - passport_control: "🛂", - pause_button: "⏸", - peace_symbol: "☮️", - peach: "🍑", - peanuts: "🥜", - pear: "🍐", - pen: "🖊", - pencil2: "✏️", - penguin: "🐧", - pensive: "😔", - performing_arts: "🎭", - persevere: "😣", - person_fencing: "🤺", - pouting_woman: "🙎", - phone: "☎️", - pick: "⛏", - pig: "🐷", - pig2: "🐖", - pig_nose: "🐽", - pill: "💊", - pineapple: "🍍", - ping_pong: "🏓", - pisces: "♓️", - pizza: "🍕", - place_of_worship: "🛐", - plate_with_cutlery: "🍽", - play_or_pause_button: "⏯", - point_down: "👇", - point_left: "👈", - point_right: "👉", - point_up: "☝️", - point_up_2: "👆", - police_car: "🚓", - policewoman: "👮‍♀️", - poodle: "🐩", - popcorn: "🍿", - post_office: "🏣", - postal_horn: "📯", - postbox: "📮", - potable_water: "🚰", - potato: "🥔", - pouch: "👝", - poultry_leg: "🍗", - pound: "💷", - rage: "😡", - pouting_cat: "😾", - pouting_man: "🙎‍♂️", - pray: "🙏", - prayer_beads: "📿", - pregnant_woman: "🤰", - previous_track_button: "⏮", - prince: "🤴", - princess: "👸", - printer: "🖨", - purple_heart: "💜", - purse: "👛", - pushpin: "📌", - put_litter_in_its_place: "🚮", - question: "❓", - rabbit: "🐰", - rabbit2: "🐇", - racehorse: "🐎", - racing_car: "🏎", - radio: "📻", - radio_button: "🔘", - radioactive: "☢️", - railway_car: "🚃", - railway_track: "🛤", - rainbow: "🌈", - rainbow_flag: "🏳️‍🌈", - raised_back_of_hand: "🤚", - raised_hand_with_fingers_splayed: "🖐", - raised_hands: "🙌", - raising_hand_woman: "🙋", - raising_hand_man: "🙋‍♂️", - ram: "🐏", - ramen: "🍜", - rat: "🐀", - record_button: "⏺", - recycle: "♻️", - red_circle: "🔴", - registered: "®️", - relaxed: "☺️", - relieved: "😌", - reminder_ribbon: "🎗", - repeat: "🔁", - repeat_one: "🔂", - rescue_worker_helmet: "⛑", - restroom: "🚻", - revolving_hearts: "💞", - rewind: "⏪", - rhinoceros: "🦏", - ribbon: "🎀", - rice: "🍚", - rice_ball: "🍙", - rice_cracker: "🍘", - rice_scene: "🎑", - right_anger_bubble: "🗯", - ring: "💍", - robot: "🤖", - rocket: "🚀", - rofl: "🤣", - roll_eyes: "🙄", - roller_coaster: "🎢", - rooster: "🐓", - rose: "🌹", - rosette: "🏵", - rotating_light: "🚨", - round_pushpin: "📍", - rowing_man: "🚣", - rowing_woman: "🚣‍♀️", - rugby_football: "🏉", - running_man: "🏃", - running_shirt_with_sash: "🎽", - running_woman: "🏃‍♀️", - sa: "🈂️", - sagittarius: "♐️", - sake: "🍶", - sandal: "👡", - santa: "🎅", - satellite: "📡", - saxophone: "🎷", - school: "🏫", - school_satchel: "🎒", - scissors: "✂️", - scorpion: "🦂", - scorpius: "♏️", - scream: "😱", - scream_cat: "🙀", - scroll: "📜", - seat: "💺", - secret: "㊙️", - see_no_evil: "🙈", - seedling: "🌱", - selfie: "🤳", - shallow_pan_of_food: "🥘", - shamrock: "☘️", - shark: "🦈", - shaved_ice: "🍧", - sheep: "🐑", - shell: "🐚", - shield: "🛡", - shinto_shrine: "⛩", - ship: "🚢", - shirt: "👕", - shopping: "🛍", - shopping_cart: "🛒", - shower: "🚿", - shrimp: "🦐", - signal_strength: "📶", - six_pointed_star: "🔯", - ski: "🎿", - skier: "⛷", - skull: "💀", - skull_and_crossbones: "☠️", - sleeping: "😴", - sleeping_bed: "🛌", - sleepy: "😪", - slightly_frowning_face: "🙁", - slightly_smiling_face: "🙂", - slot_machine: "🎰", - small_airplane: "🛩", - small_blue_diamond: "🔹", - small_orange_diamond: "🔸", - small_red_triangle: "🔺", - small_red_triangle_down: "🔻", - smile: "😄", - smile_cat: "😸", - smiley: "😃", - smiley_cat: "😺", - smiling_imp: "😈", - smirk: "😏", - smirk_cat: "😼", - smoking: "🚬", - snail: "🐌", - snake: "🐍", - sneezing_face: "🤧", - snowboarder: "🏂", - snowflake: "❄️", - snowman: "⛄️", - snowman_with_snow: "☃️", - sob: "😭", - soccer: "⚽️", - soon: "🔜", - sos: "🆘", - sound: "🔉", - space_invader: "👾", - spades: "♠️", - spaghetti: "🍝", - sparkle: "❇️", - sparkler: "🎇", - sparkles: "✨", - sparkling_heart: "💖", - speak_no_evil: "🙊", - speaker: "🔈", - speaking_head: "🗣", - speech_balloon: "💬", - speedboat: "🚤", - spider: "🕷", - spider_web: "🕸", - spiral_calendar: "🗓", - spiral_notepad: "🗒", - spoon: "🥄", - squid: "🦑", - stadium: "🏟", - star: "⭐️", - star2: "🌟", - star_and_crescent: "☪️", - star_of_david: "✡️", - stars: "🌠", - station: "🚉", - statue_of_liberty: "🗽", - steam_locomotive: "🚂", - stew: "🍲", - stop_button: "⏹", - stop_sign: "🛑", - stopwatch: "⏱", - straight_ruler: "📏", - strawberry: "🍓", - stuck_out_tongue: "😛", - stuck_out_tongue_closed_eyes: "😝", - stuck_out_tongue_winking_eye: "😜", - studio_microphone: "🎙", - stuffed_flatbread: "🥙", - sun_behind_large_cloud: "🌥", - sun_behind_rain_cloud: "🌦", - sun_behind_small_cloud: "🌤", - sun_with_face: "🌞", - sunflower: "🌻", - sunglasses: "😎", - sunny: "☀️", - sunrise: "🌅", - sunrise_over_mountains: "🌄", - surfing_man: "🏄", - surfing_woman: "🏄‍♀️", - sushi: "🍣", - suspension_railway: "🚟", - sweat: "😓", - sweat_drops: "💦", - sweat_smile: "😅", - sweet_potato: "🍠", - swimming_man: "🏊", - swimming_woman: "🏊‍♀️", - symbols: "🔣", - synagogue: "🕍", - syringe: "💉", - taco: "🌮", - tada: "🎉", - tanabata_tree: "🎋", - taurus: "♉️", - taxi: "🚕", - tea: "🍵", - telephone_receiver: "📞", - telescope: "🔭", - tennis: "🎾", - tent: "⛺️", - thermometer: "🌡", - thinking: "🤔", - thought_balloon: "💭", - ticket: "🎫", - tickets: "🎟", - tiger: "🐯", - tiger2: "🐅", - timer_clock: "⏲", - tipping_hand_man: "💁‍♂️", - tired_face: "😫", - tm: "™️", - toilet: "🚽", - tokyo_tower: "🗼", - tomato: "🍅", - tongue: "👅", - top: "🔝", - tophat: "🎩", - tornado: "🌪", - trackball: "🖲", - tractor: "🚜", - traffic_light: "🚥", - train: "🚋", - train2: "🚆", - tram: "🚊", - triangular_flag_on_post: "🚩", - triangular_ruler: "📐", - trident: "🔱", - triumph: "😤", - trolleybus: "🚎", - trophy: "🏆", - tropical_drink: "🍹", - tropical_fish: "🐠", - truck: "🚚", - trumpet: "🎺", - tulip: "🌷", - tumbler_glass: "🥃", - turkey: "🦃", - turtle: "🐢", - tv: "📺", - twisted_rightwards_arrows: "🔀", - two_hearts: "💕", - two_men_holding_hands: "👬", - two_women_holding_hands: "👭", - u5272: "🈹", - u5408: "🈴", - u55b6: "🈺", - u6307: "🈯️", - u6708: "🈷️", - u6709: "🈶", - u6e80: "🈵", - u7121: "🈚️", - u7533: "🈸", - u7981: "🈲", - u7a7a: "🈳", - umbrella: "☔️", - unamused: "😒", - underage: "🔞", - unicorn: "🦄", - unlock: "🔓", - up: "🆙", - upside_down_face: "🙃", - v: "✌️", - vertical_traffic_light: "🚦", - vhs: "📼", - vibration_mode: "📳", - video_camera: "📹", - video_game: "🎮", - violin: "🎻", - virgo: "♍️", - volcano: "🌋", - volleyball: "🏐", - vs: "🆚", - vulcan_salute: "🖖", - walking_man: "🚶", - walking_woman: "🚶‍♀️", - waning_crescent_moon: "🌘", - waning_gibbous_moon: "🌖", - warning: "⚠️", - wastebasket: "🗑", - watch: "⌚️", - water_buffalo: "🐃", - watermelon: "🍉", - wave: "👋", - wavy_dash: "〰️", - waxing_crescent_moon: "🌒", - wc: "🚾", - weary: "😩", - wedding: "💒", - weight_lifting_man: "🏋️", - weight_lifting_woman: "🏋️‍♀️", - whale: "🐳", - whale2: "🐋", - wheel_of_dharma: "☸️", - wheelchair: "♿️", - white_check_mark: "✅", - white_circle: "⚪️", - white_flag: "🏳️", - white_flower: "💮", - white_large_square: "⬜️", - white_medium_small_square: "◽️", - white_medium_square: "◻️", - white_small_square: "▫️", - white_square_button: "🔳", - wilted_flower: "🥀", - wind_chime: "🎐", - wind_face: "🌬", - wine_glass: "🍷", - wink: "😉", - wolf: "🐺", - woman: "👩", - woman_artist: "👩‍🎨", - woman_astronaut: "👩‍🚀", - woman_cartwheeling: "🤸‍♀️", - woman_cook: "👩‍🍳", - woman_facepalming: "🤦‍♀️", - woman_factory_worker: "👩‍🏭", - woman_farmer: "👩‍🌾", - woman_firefighter: "👩‍🚒", - woman_health_worker: "👩‍⚕️", - woman_judge: "👩‍⚖️", - woman_juggling: "🤹‍♀️", - woman_mechanic: "👩‍🔧", - woman_office_worker: "👩‍💼", - woman_pilot: "👩‍✈️", - woman_playing_handball: "🤾‍♀️", - woman_playing_water_polo: "🤽‍♀️", - woman_scientist: "👩‍🔬", - woman_shrugging: "🤷‍♀️", - woman_singer: "👩‍🎤", - woman_student: "👩‍🎓", - woman_teacher: "👩‍🏫", - woman_technologist: "👩‍💻", - woman_with_turban: "👳‍♀️", - womans_clothes: "👚", - womans_hat: "👒", - women_wrestling: "🤼‍♀️", - womens: "🚺", - world_map: "🗺", - worried: "😟", - wrench: "🔧", - writing_hand: "✍️", - x: "❌", - yellow_heart: "💛", - yen: "💴", - yin_yang: "☯️", - yum: "😋", - zap: "⚡️", - zipper_mouth_face: "🤐", - zzz: "💤", - /* special emojis :P */ - octocat: ':octocat:', - showdown: `S` - }, a.Converter = function(t) { - var d = {}, s = [], i = [], c = {}, m = y, h = { - parsed: {}, - raw: "", - format: "" - }; - C(); - function C() { - t = t || {}; - for (var _ in p) - p.hasOwnProperty(_) && (d[_] = p[_]); - if (typeof t == "object") - for (var q in t) - t.hasOwnProperty(q) && (d[q] = t[q]); - else - throw Error("Converter expects the passed parameter to be an object, but " + typeof t + " was passed instead."); - d.extensions && a.helper.forEach(d.extensions, U); - } - function U(_, q) { - if (q = q || null, a.helper.isString(_)) - if (_ = a.helper.stdExtName(_), q = _, a.extensions[_]) { - console.warn("DEPRECATION WARNING: " + _ + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"), H(a.extensions[_], _); - return; - } else if (!a.helper.isUndefined(o[_])) - _ = o[_]; - else - throw Error('Extension "' + _ + '" could not be loaded. It was either not found or is not a valid extension.'); - typeof _ == "function" && (_ = _()), a.helper.isArray(_) || (_ = [_]); - var J = v(_, q); - if (!J.valid) - throw Error(J.error); - for (var Z = 0; Z < _.length; ++Z) { - switch (_[Z].type) { - case "lang": - s.push(_[Z]); - break; - case "output": - i.push(_[Z]); - break; - } - if (_[Z].hasOwnProperty("listeners")) - for (var B in _[Z].listeners) - _[Z].listeners.hasOwnProperty(B) && V(B, _[Z].listeners[B]); - } - } - function H(_, q) { - typeof _ == "function" && (_ = _(new a.Converter())), a.helper.isArray(_) || (_ = [_]); - var J = v(_, q); - if (!J.valid) - throw Error(J.error); - for (var Z = 0; Z < _.length; ++Z) - switch (_[Z].type) { - case "lang": - s.push(_[Z]); - break; - case "output": - i.push(_[Z]); - break; - default: - throw Error("Extension loader error: Type unrecognized!!!"); - } - } - function V(_, q) { - if (!a.helper.isString(_)) - throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof _ + " given"); - if (typeof q != "function") - throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof q + " given"); - c.hasOwnProperty(_) || (c[_] = []), c[_].push(q); - } - function G(_) { - var q = _.match(/^\s*/)[0].length, J = new RegExp("^\\s{0," + q + "}", "gm"); - return _.replace(J, ""); - } - this._dispatch = function(q, J, Z, B) { - if (c.hasOwnProperty(q)) - for (var k = 0; k < c[q].length; ++k) { - var F = c[q][k](q, J, this, Z, B); - F && typeof F < "u" && (J = F); - } - return J; - }, this.listen = function(_, q) { - return V(_, q), this; - }, this.makeHtml = function(_) { - if (!_) - return _; - var q = { - gHtmlBlocks: [], - gHtmlMdBlocks: [], - gHtmlSpans: [], - gUrls: {}, - gTitles: {}, - gDimensions: {}, - gListLevel: 0, - hashLinkCounts: {}, - langExtensions: s, - outputModifiers: i, - converter: this, - ghCodeBlocks: [], - metadata: { - parsed: {}, - raw: "", - format: "" - } - }; - return _ = _.replace(/¨/g, "¨T"), _ = _.replace(/\$/g, "¨D"), _ = _.replace(/\r\n/g, ` -`), _ = _.replace(/\r/g, ` -`), _ = _.replace(/\u00A0/g, " "), d.smartIndentationFix && (_ = G(_)), _ = ` - -` + _ + ` - -`, _ = a.subParser("detab")(_, d, q), _ = _.replace(/^[ \t]+$/mg, ""), a.helper.forEach(s, function(J) { - _ = a.subParser("runExtension")(J, _, d, q); - }), _ = a.subParser("metadata")(_, d, q), _ = a.subParser("hashPreCodeTags")(_, d, q), _ = a.subParser("githubCodeBlocks")(_, d, q), _ = a.subParser("hashHTMLBlocks")(_, d, q), _ = a.subParser("hashCodeTags")(_, d, q), _ = a.subParser("stripLinkDefinitions")(_, d, q), _ = a.subParser("blockGamut")(_, d, q), _ = a.subParser("unhashHTMLSpans")(_, d, q), _ = a.subParser("unescapeSpecialChars")(_, d, q), _ = _.replace(/¨D/g, "$$"), _ = _.replace(/¨T/g, "¨"), _ = a.subParser("completeHTMLDocument")(_, d, q), a.helper.forEach(i, function(J) { - _ = a.subParser("runExtension")(J, _, d, q); - }), h = q.metadata, _; - }, this.makeMarkdown = this.makeMd = function(_, q) { - if (_ = _.replace(/\r\n/g, ` -`), _ = _.replace(/\r/g, ` -`), _ = _.replace(/>[ \t]+¨NBSP;<"), !q) - if (window && window.document) - q = window.document; - else - throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM"); - var J = q.createElement("div"); - J.innerHTML = _; - var Z = { - preList: l(J) - }; - N(J); - for (var B = J.childNodes, k = "", F = 0; F < B.length; F++) - k += a.subParser("makeMarkdown.node")(B[F], Z); - function N(w) { - for (var I = 0; I < w.childNodes.length; ++I) { - var K = w.childNodes[I]; - K.nodeType === 3 ? !/\S/.test(K.nodeValue) && !/^[ ]+$/.test(K.nodeValue) ? (w.removeChild(K), --I) : (K.nodeValue = K.nodeValue.split(` -`).join(" "), K.nodeValue = K.nodeValue.replace(/(\s)+/g, "$1")) : K.nodeType === 1 && N(K); - } - } - function l(w) { - for (var I = w.querySelectorAll("pre"), K = [], W = 0; W < I.length; ++W) - if (I[W].childElementCount === 1 && I[W].firstChild.tagName.toLowerCase() === "code") { - var re = I[W].firstChild.innerHTML.trim(), ae = I[W].firstChild.getAttribute("data-language") || ""; - if (ae === "") - for (var fe = I[W].firstChild.className.split(" "), Te = 0; Te < fe.length; ++Te) { - var xe = fe[Te].match(/^language-(.+)$/); - if (xe !== null) { - ae = xe[1]; - break; - } - } - re = a.helper.unescapeHTMLEntities(re), K.push(re), I[W].outerHTML = ''; - } else - K.push(I[W].innerHTML), I[W].innerHTML = "", I[W].setAttribute("prenum", W.toString()); - return K; - } - return k; - }, this.setOption = function(_, q) { - d[_] = q; - }, this.getOption = function(_) { - return d[_]; - }, this.getOptions = function() { - return d; - }, this.addExtension = function(_, q) { - q = q || null, U(_, q); - }, this.useExtension = function(_) { - U(_); - }, this.setFlavor = function(_) { - if (!b.hasOwnProperty(_)) - throw Error(_ + " flavor was not found"); - var q = b[_]; - m = _; - for (var J in q) - q.hasOwnProperty(J) && (d[J] = q[J]); - }, this.getFlavor = function() { - return m; - }, this.removeExtension = function(_) { - a.helper.isArray(_) || (_ = [_]); - for (var q = 0; q < _.length; ++q) { - for (var J = _[q], Z = 0; Z < s.length; ++Z) - s[Z] === J && s.splice(Z, 1); - for (var B = 0; B < i.length; ++B) - i[B] === J && i.splice(B, 1); - } - }, this.getAllExtensions = function() { - return { - language: s, - output: i - }; - }, this.getMetadata = function(_) { - return _ ? h.raw : h.parsed; - }, this.getMetadataFormat = function() { - return h.format; - }, this._setMetadataPair = function(_, q) { - h.parsed[_] = q; - }, this._setMetadataFormat = function(_) { - h.format = _; - }, this._setMetadataRaw = function(_) { - h.raw = _; - }; - }, a.subParser("anchors", function(t, d, s) { - t = s.converter._dispatch("anchors.before", t, d, s); - var i = function(c, m, h, C, U, H, V) { - if (a.helper.isUndefined(V) && (V = ""), h = h.toLowerCase(), c.search(/\(? ?(['"].*['"])?\)$/m) > -1) - C = ""; - else if (!C) - if (h || (h = m.toLowerCase().replace(/ ?\n/g, " ")), C = "#" + h, !a.helper.isUndefined(s.gUrls[h])) - C = s.gUrls[h], a.helper.isUndefined(s.gTitles[h]) || (V = s.gTitles[h]); - else - return c; - C = C.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var G = '", G; - }; - return t = t.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, i), t = t.replace( - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, - i - ), t = t.replace( - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, - i - ), t = t.replace(/\[([^\[\]]+)]()()()()()/g, i), d.ghMentions && (t = t.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function(c, m, h, C, U) { - if (h === "\\") - return m + C; - if (!a.helper.isString(d.ghMentionsLink)) - throw new Error("ghMentionsLink option must be a string"); - var H = d.ghMentionsLink.replace(/\{u}/g, U), V = ""; - return d.openLinksInNewWindow && (V = ' rel="noopener noreferrer" target="¨E95Eblank"'), m + '" + C + ""; - })), t = s.converter._dispatch("anchors.after", t, d, s), t; - }); - var z = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, L = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, R = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, j = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, T = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, $ = function(t) { - return function(d, s, i, c, m, h, C) { - i = i.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var U = i, H = "", V = "", G = s || "", _ = C || ""; - return /^www\./i.test(i) && (i = i.replace(/^www\./i, "http://www.")), t.excludeTrailingPunctuationFromURLs && h && (H = h), t.openLinksInNewWindow && (V = ' rel="noopener noreferrer" target="¨E95Eblank"'), G + '" + U + "" + H + _; - }; - }, O = function(t, d) { - return function(s, i, c) { - var m = "mailto:"; - return i = i || "", c = a.subParser("unescapeSpecialChars")(c, t, d), t.encodeEmails ? (m = a.helper.encodeEmailAddress(m + c), c = a.helper.encodeEmailAddress(c)) : m = m + c, i + '' + c + ""; - }; - }; - a.subParser("autoLinks", function(t, d, s) { - return t = s.converter._dispatch("autoLinks.before", t, d, s), t = t.replace(R, $(d)), t = t.replace(T, O(d, s)), t = s.converter._dispatch("autoLinks.after", t, d, s), t; - }), a.subParser("simplifiedAutoLinks", function(t, d, s) { - return d.simplifiedAutoLink && (t = s.converter._dispatch("simplifiedAutoLinks.before", t, d, s), d.excludeTrailingPunctuationFromURLs ? t = t.replace(L, $(d)) : t = t.replace(z, $(d)), t = t.replace(j, O(d, s)), t = s.converter._dispatch("simplifiedAutoLinks.after", t, d, s)), t; - }), a.subParser("blockGamut", function(t, d, s) { - return t = s.converter._dispatch("blockGamut.before", t, d, s), t = a.subParser("blockQuotes")(t, d, s), t = a.subParser("headers")(t, d, s), t = a.subParser("horizontalRule")(t, d, s), t = a.subParser("lists")(t, d, s), t = a.subParser("codeBlocks")(t, d, s), t = a.subParser("tables")(t, d, s), t = a.subParser("hashHTMLBlocks")(t, d, s), t = a.subParser("paragraphs")(t, d, s), t = s.converter._dispatch("blockGamut.after", t, d, s), t; - }), a.subParser("blockQuotes", function(t, d, s) { - t = s.converter._dispatch("blockQuotes.before", t, d, s), t = t + ` - -`; - var i = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm; - return d.splitAdjacentBlockquotes && (i = /^ {0,3}>[\s\S]*?(?:\n\n)/gm), t = t.replace(i, function(c) { - return c = c.replace(/^[ \t]*>[ \t]?/gm, ""), c = c.replace(/¨0/g, ""), c = c.replace(/^[ \t]+$/gm, ""), c = a.subParser("githubCodeBlocks")(c, d, s), c = a.subParser("blockGamut")(c, d, s), c = c.replace(/(^|\n)/g, "$1 "), c = c.replace(/(\s*
[^\r]+?<\/pre>)/gm, function(m, h) {
-          var C = h;
-          return C = C.replace(/^  /mg, "¨0"), C = C.replace(/¨0/g, ""), C;
-        }), a.subParser("hashBlock")(`
-` + c + ` -
`, d, s); - }), t = s.converter._dispatch("blockQuotes.after", t, d, s), t; - }), a.subParser("codeBlocks", function(t, d, s) { - t = s.converter._dispatch("codeBlocks.before", t, d, s), t += "¨0"; - var i = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g; - return t = t.replace(i, function(c, m, h) { - var C = m, U = h, H = ` -`; - return C = a.subParser("outdent")(C, d, s), C = a.subParser("encodeCode")(C, d, s), C = a.subParser("detab")(C, d, s), C = C.replace(/^\n+/g, ""), C = C.replace(/\n+$/g, ""), d.omitExtraWLInCodeBlocks && (H = ""), C = "
" + C + H + "
", a.subParser("hashBlock")(C, d, s) + U; - }), t = t.replace(/¨0/, ""), t = s.converter._dispatch("codeBlocks.after", t, d, s), t; - }), a.subParser("codeSpans", function(t, d, s) { - return t = s.converter._dispatch("codeSpans.before", t, d, s), typeof t > "u" && (t = ""), t = t.replace( - /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, - function(i, c, m, h) { - var C = h; - return C = C.replace(/^([ \t]*)/g, ""), C = C.replace(/[ \t]*$/g, ""), C = a.subParser("encodeCode")(C, d, s), C = c + "" + C + "", C = a.subParser("hashHTMLSpans")(C, d, s), C; - } - ), t = s.converter._dispatch("codeSpans.after", t, d, s), t; - }), a.subParser("completeHTMLDocument", function(t, d, s) { - if (!d.completeHTMLDocument) - return t; - t = s.converter._dispatch("completeHTMLDocument.before", t, d, s); - var i = "html", c = ` -`, m = "", h = ` -`, C = "", U = ""; - typeof s.metadata.parsed.doctype < "u" && (c = " -`, i = s.metadata.parsed.doctype.toString().toLowerCase(), (i === "html" || i === "html5") && (h = '')); - for (var H in s.metadata.parsed) - if (s.metadata.parsed.hasOwnProperty(H)) - switch (H.toLowerCase()) { - case "doctype": - break; - case "title": - m = "" + s.metadata.parsed.title + ` -`; - break; - case "charset": - i === "html" || i === "html5" ? h = ' -` : h = ' -`; - break; - case "language": - case "lang": - C = ' lang="' + s.metadata.parsed[H] + '"', U += ' -`; - break; - default: - U += ' -`; - } - return t = c + " - -` + m + h + U + ` - -` + t.trim() + ` - -`, t = s.converter._dispatch("completeHTMLDocument.after", t, d, s), t; - }), a.subParser("detab", function(t, d, s) { - return t = s.converter._dispatch("detab.before", t, d, s), t = t.replace(/\t(?=\t)/g, " "), t = t.replace(/\t/g, "¨A¨B"), t = t.replace(/¨B(.+?)¨A/g, function(i, c) { - for (var m = c, h = 4 - m.length % 4, C = 0; C < h; C++) - m += " "; - return m; - }), t = t.replace(/¨A/g, " "), t = t.replace(/¨B/g, ""), t = s.converter._dispatch("detab.after", t, d, s), t; - }), a.subParser("ellipsis", function(t, d, s) { - return d.ellipsis && (t = s.converter._dispatch("ellipsis.before", t, d, s), t = t.replace(/\.\.\./g, "…"), t = s.converter._dispatch("ellipsis.after", t, d, s)), t; - }), a.subParser("emoji", function(t, d, s) { - if (!d.emoji) - return t; - t = s.converter._dispatch("emoji.before", t, d, s); - var i = /:([\S]+?):/g; - return t = t.replace(i, function(c, m) { - return a.helper.emojis.hasOwnProperty(m) ? a.helper.emojis[m] : c; - }), t = s.converter._dispatch("emoji.after", t, d, s), t; - }), a.subParser("encodeAmpsAndAngles", function(t, d, s) { - return t = s.converter._dispatch("encodeAmpsAndAngles.before", t, d, s), t = t.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"), t = t.replace(/<(?![a-z\/?$!])/gi, "<"), t = t.replace(//g, ">"), t = s.converter._dispatch("encodeAmpsAndAngles.after", t, d, s), t; - }), a.subParser("encodeBackslashEscapes", function(t, d, s) { - return t = s.converter._dispatch("encodeBackslashEscapes.before", t, d, s), t = t.replace(/\\(\\)/g, a.helper.escapeCharactersCallback), t = t.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g, a.helper.escapeCharactersCallback), t = s.converter._dispatch("encodeBackslashEscapes.after", t, d, s), t; - }), a.subParser("encodeCode", function(t, d, s) { - return t = s.converter._dispatch("encodeCode.before", t, d, s), t = t.replace(/&/g, "&").replace(//g, ">").replace(/([*_{}\[\]\\=~-])/g, a.helper.escapeCharactersCallback), t = s.converter._dispatch("encodeCode.after", t, d, s), t; - }), a.subParser("escapeSpecialCharsWithinTagAttributes", function(t, d, s) { - t = s.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", t, d, s); - var i = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, c = /-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; - return t = t.replace(i, function(m) { - return m.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, a.helper.escapeCharactersCallback); - }), t = t.replace(c, function(m) { - return m.replace(/([\\`*_~=|])/g, a.helper.escapeCharactersCallback); - }), t = s.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", t, d, s), t; - }), a.subParser("githubCodeBlocks", function(t, d, s) { - return d.ghCodeBlocks ? (t = s.converter._dispatch("githubCodeBlocks.before", t, d, s), t += "¨0", t = t.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(i, c, m, h) { - var C = d.omitExtraWLInCodeBlocks ? "" : ` -`; - return h = a.subParser("encodeCode")(h, d, s), h = a.subParser("detab")(h, d, s), h = h.replace(/^\n+/g, ""), h = h.replace(/\n+$/g, ""), h = "
" + h + C + "
", h = a.subParser("hashBlock")(h, d, s), ` - -¨G` + (s.ghCodeBlocks.push({ text: i, codeblock: h }) - 1) + `G - -`; - }), t = t.replace(/¨0/, ""), s.converter._dispatch("githubCodeBlocks.after", t, d, s)) : t; - }), a.subParser("hashBlock", function(t, d, s) { - return t = s.converter._dispatch("hashBlock.before", t, d, s), t = t.replace(/(^\n+|\n+$)/g, ""), t = ` - -¨K` + (s.gHtmlBlocks.push(t) - 1) + `K - -`, t = s.converter._dispatch("hashBlock.after", t, d, s), t; - }), a.subParser("hashCodeTags", function(t, d, s) { - t = s.converter._dispatch("hashCodeTags.before", t, d, s); - var i = function(c, m, h, C) { - var U = h + a.subParser("encodeCode")(m, d, s) + C; - return "¨C" + (s.gHtmlSpans.push(U) - 1) + "C"; - }; - return t = a.helper.replaceRecursiveRegExp(t, i, "]*>", "", "gim"), t = s.converter._dispatch("hashCodeTags.after", t, d, s), t; - }), a.subParser("hashElement", function(t, d, s) { - return function(i, c) { - var m = c; - return m = m.replace(/\n\n/g, ` -`), m = m.replace(/^\n/, ""), m = m.replace(/\n+$/g, ""), m = ` - -¨K` + (s.gHtmlBlocks.push(m) - 1) + `K - -`, m; - }; - }), a.subParser("hashHTMLBlocks", function(t, d, s) { - t = s.converter._dispatch("hashHTMLBlocks.before", t, d, s); - var i = [ - "pre", - "div", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "blockquote", - "table", - "dl", - "ol", - "ul", - "script", - "noscript", - "form", - "fieldset", - "iframe", - "math", - "style", - "section", - "header", - "footer", - "nav", - "article", - "aside", - "address", - "audio", - "canvas", - "figure", - "hgroup", - "output", - "video", - "p" - ], c = function(_, q, J, Z) { - var B = _; - return J.search(/\bmarkdown\b/) !== -1 && (B = J + s.converter.makeHtml(q) + Z), ` - -¨K` + (s.gHtmlBlocks.push(B) - 1) + `K - -`; - }; - d.backslashEscapesHTMLTags && (t = t.replace(/\\<(\/?[^>]+?)>/g, function(_, q) { - return "<" + q + ">"; - })); - for (var m = 0; m < i.length; ++m) - for (var h, C = new RegExp("^ {0,3}(<" + i[m] + "\\b[^>]*>)", "im"), U = "<" + i[m] + "\\b[^>]*>", H = ""; (h = a.helper.regexIndexOf(t, C)) !== -1; ) { - var V = a.helper.splitAtIndex(t, h), G = a.helper.replaceRecursiveRegExp(V[1], c, U, H, "im"); - if (G === V[1]) - break; - t = V[0].concat(G); - } - return t = t.replace( - /(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, - a.subParser("hashElement")(t, d, s) - ), t = a.helper.replaceRecursiveRegExp(t, function(_) { - return ` - -¨K` + (s.gHtmlBlocks.push(_) - 1) + `K - -`; - }, "^ {0,3}", "gm"), t = t.replace( - /(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, - a.subParser("hashElement")(t, d, s) - ), t = s.converter._dispatch("hashHTMLBlocks.after", t, d, s), t; - }), a.subParser("hashHTMLSpans", function(t, d, s) { - t = s.converter._dispatch("hashHTMLSpans.before", t, d, s); - function i(c) { - return "¨C" + (s.gHtmlSpans.push(c) - 1) + "C"; - } - return t = t.replace(/<[^>]+?\/>/gi, function(c) { - return i(c); - }), t = t.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function(c) { - return i(c); - }), t = t.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function(c) { - return i(c); - }), t = t.replace(/<[^>]+?>/gi, function(c) { - return i(c); - }), t = s.converter._dispatch("hashHTMLSpans.after", t, d, s), t; - }), a.subParser("unhashHTMLSpans", function(t, d, s) { - t = s.converter._dispatch("unhashHTMLSpans.before", t, d, s); - for (var i = 0; i < s.gHtmlSpans.length; ++i) { - for (var c = s.gHtmlSpans[i], m = 0; /¨C(\d+)C/.test(c); ) { - var h = RegExp.$1; - if (c = c.replace("¨C" + h + "C", s.gHtmlSpans[h]), m === 10) { - console.error("maximum nesting of 10 spans reached!!!"); - break; - } - ++m; - } - t = t.replace("¨C" + i + "C", c); - } - return t = s.converter._dispatch("unhashHTMLSpans.after", t, d, s), t; - }), a.subParser("hashPreCodeTags", function(t, d, s) { - t = s.converter._dispatch("hashPreCodeTags.before", t, d, s); - var i = function(c, m, h, C) { - var U = h + a.subParser("encodeCode")(m, d, s) + C; - return ` - -¨G` + (s.ghCodeBlocks.push({ text: c, codeblock: U }) - 1) + `G - -`; - }; - return t = a.helper.replaceRecursiveRegExp(t, i, "^ {0,3}]*>\\s*]*>", "^ {0,3}\\s*
", "gim"), t = s.converter._dispatch("hashPreCodeTags.after", t, d, s), t; - }), a.subParser("headers", function(t, d, s) { - t = s.converter._dispatch("headers.before", t, d, s); - var i = isNaN(parseInt(d.headerLevelStart)) ? 1 : parseInt(d.headerLevelStart), c = d.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, m = d.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm; - t = t.replace(c, function(U, H) { - var V = a.subParser("spanGamut")(H, d, s), G = d.noHeaderId ? "" : ' id="' + C(H) + '"', _ = i, q = "" + V + ""; - return a.subParser("hashBlock")(q, d, s); - }), t = t.replace(m, function(U, H) { - var V = a.subParser("spanGamut")(H, d, s), G = d.noHeaderId ? "" : ' id="' + C(H) + '"', _ = i + 1, q = "" + V + ""; - return a.subParser("hashBlock")(q, d, s); - }); - var h = d.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm; - t = t.replace(h, function(U, H, V) { - var G = V; - d.customizedHeaderId && (G = V.replace(/\s?\{([^{]+?)}\s*$/, "")); - var _ = a.subParser("spanGamut")(G, d, s), q = d.noHeaderId ? "" : ' id="' + C(V) + '"', J = i - 1 + H.length, Z = "" + _ + ""; - return a.subParser("hashBlock")(Z, d, s); - }); - function C(U) { - var H, V; - if (d.customizedHeaderId) { - var G = U.match(/\{([^{]+?)}\s*$/); - G && G[1] && (U = G[1]); - } - return H = U, a.helper.isString(d.prefixHeaderId) ? V = d.prefixHeaderId : d.prefixHeaderId === !0 ? V = "section-" : V = "", d.rawPrefixHeaderId || (H = V + H), d.ghCompatibleHeaderId ? H = H.replace(/ /g, "-").replace(/&/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase() : d.rawHeaderId ? H = H.replace(/ /g, "-").replace(/&/g, "&").replace(/¨T/g, "¨").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase() : H = H.replace(/[^\w]/g, "").toLowerCase(), d.rawPrefixHeaderId && (H = V + H), s.hashLinkCounts[H] ? H = H + "-" + s.hashLinkCounts[H]++ : s.hashLinkCounts[H] = 1, H; - } - return t = s.converter._dispatch("headers.after", t, d, s), t; - }), a.subParser("horizontalRule", function(t, d, s) { - t = s.converter._dispatch("horizontalRule.before", t, d, s); - var i = a.subParser("hashBlock")("
", d, s); - return t = t.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, i), t = t.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, i), t = t.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, i), t = s.converter._dispatch("horizontalRule.after", t, d, s), t; - }), a.subParser("images", function(t, d, s) { - t = s.converter._dispatch("images.before", t, d, s); - var i = /!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, c = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, m = /!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, h = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, C = /!\[([^\[\]]+)]()()()()()/g; - function U(V, G, _, q, J, Z, B, k) { - return q = q.replace(/\s/g, ""), H(V, G, _, q, J, Z, B, k); - } - function H(V, G, _, q, J, Z, B, k) { - var F = s.gUrls, N = s.gTitles, l = s.gDimensions; - if (_ = _.toLowerCase(), k || (k = ""), V.search(/\(? ?(['"].*['"])?\)$/m) > -1) - q = ""; - else if (q === "" || q === null) - if ((_ === "" || _ === null) && (_ = G.toLowerCase().replace(/ ?\n/g, " ")), q = "#" + _, !a.helper.isUndefined(F[_])) - q = F[_], a.helper.isUndefined(N[_]) || (k = N[_]), a.helper.isUndefined(l[_]) || (J = l[_].width, Z = l[_].height); - else - return V; - G = G.replace(/"/g, """).replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback), q = q.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var w = '' + G + '", "
"); - }), t = t.replace(/\b__(\S[\s\S]*?)__\b/g, function(c, m) { - return i(m, "", ""); - }), t = t.replace(/\b_(\S[\s\S]*?)_\b/g, function(c, m) { - return i(m, "", ""); - })) : (t = t.replace(/___(\S[\s\S]*?)___/g, function(c, m) { - return /\S$/.test(m) ? i(m, "", "") : c; - }), t = t.replace(/__(\S[\s\S]*?)__/g, function(c, m) { - return /\S$/.test(m) ? i(m, "", "") : c; - }), t = t.replace(/_([^\s_][\s\S]*?)_/g, function(c, m) { - return /\S$/.test(m) ? i(m, "", "") : c; - })), d.literalMidWordAsterisks ? (t = t.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(c, m, h) { - return i(h, m + "", ""); - }), t = t.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(c, m, h) { - return i(h, m + "", ""); - }), t = t.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(c, m, h) { - return i(h, m + "", ""); - })) : (t = t.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(c, m) { - return /\S$/.test(m) ? i(m, "", "") : c; - }), t = t.replace(/\*\*(\S[\s\S]*?)\*\*/g, function(c, m) { - return /\S$/.test(m) ? i(m, "", "") : c; - }), t = t.replace(/\*([^\s*][\s\S]*?)\*/g, function(c, m) { - return /\S$/.test(m) ? i(m, "", "") : c; - })), t = s.converter._dispatch("italicsAndBold.after", t, d, s), t; - }), a.subParser("lists", function(t, d, s) { - function i(h, C) { - s.gListLevel++, h = h.replace(/\n{2,}$/, ` -`), h += "¨0"; - var U = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, H = /\n[ \t]*\n(?!¨0)/.test(h); - return d.disableForced4SpacesIndentedSublists && (U = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm), h = h.replace(U, function(V, G, _, q, J, Z, B) { - B = B && B.trim() !== ""; - var k = a.subParser("outdent")(J, d, s), F = ""; - return Z && d.tasklists && (F = ' class="task-list-item" style="list-style-type: none;"', k = k.replace(/^[ \t]*\[(x|X| )?]/m, function() { - var N = ' -1 ? (k = a.subParser("githubCodeBlocks")(k, d, s), k = a.subParser("blockGamut")(k, d, s)) : (k = a.subParser("lists")(k, d, s), k = k.replace(/\n$/, ""), k = a.subParser("hashHTMLBlocks")(k, d, s), k = k.replace(/\n\n+/g, ` - -`), H ? k = a.subParser("paragraphs")(k, d, s) : k = a.subParser("spanGamut")(k, d, s)), k = k.replace("¨A", ""), k = "" + k + ` -`, k; - }), h = h.replace(/¨0/g, ""), s.gListLevel--, C && (h = h.replace(/\s+$/, "")), h; - } - function c(h, C) { - if (C === "ol") { - var U = h.match(/^ *(\d+)\./); - if (U && U[1] !== "1") - return ' start="' + U[1] + '"'; - } - return ""; - } - function m(h, C, U) { - var H = d.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, V = d.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, G = C === "ul" ? H : V, _ = ""; - if (h.search(G) !== -1) - (function J(Z) { - var B = Z.search(G), k = c(h, C); - B !== -1 ? (_ += ` - -<` + C + k + `> -` + i(Z.slice(0, B), !!U) + " -`, C = C === "ul" ? "ol" : "ul", G = C === "ul" ? H : V, J(Z.slice(B))) : _ += ` - -<` + C + k + `> -` + i(Z, !!U) + " -`; - })(h); - else { - var q = c(h, C); - _ = ` - -<` + C + q + `> -` + i(h, !!U) + " -`; - } - return _; - } - return t = s.converter._dispatch("lists.before", t, d, s), t += "¨0", s.gListLevel ? t = t.replace( - /^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, - function(h, C, U) { - var H = U.search(/[*+-]/g) > -1 ? "ul" : "ol"; - return m(C, H, !0); - } - ) : t = t.replace( - /(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, - function(h, C, U, H) { - var V = H.search(/[*+-]/g) > -1 ? "ul" : "ol"; - return m(U, V, !1); - } - ), t = t.replace(/¨0/, ""), t = s.converter._dispatch("lists.after", t, d, s), t; - }), a.subParser("metadata", function(t, d, s) { - if (!d.metadata) - return t; - t = s.converter._dispatch("metadata.before", t, d, s); - function i(c) { - s.metadata.raw = c, c = c.replace(/&/g, "&").replace(/"/g, """), c = c.replace(/\n {4}/g, " "), c.replace(/^([\S ]+): +([\s\S]+?)$/gm, function(m, h, C) { - return s.metadata.parsed[h] = C, ""; - }); - } - return t = t.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(c, m, h) { - return i(h), "¨M"; - }), t = t.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(c, m, h) { - return m && (s.metadata.format = m), i(h), "¨M"; - }), t = t.replace(/¨M/g, ""), t = s.converter._dispatch("metadata.after", t, d, s), t; - }), a.subParser("outdent", function(t, d, s) { - return t = s.converter._dispatch("outdent.before", t, d, s), t = t.replace(/^(\t|[ ]{1,4})/gm, "¨0"), t = t.replace(/¨0/g, ""), t = s.converter._dispatch("outdent.after", t, d, s), t; - }), a.subParser("paragraphs", function(t, d, s) { - t = s.converter._dispatch("paragraphs.before", t, d, s), t = t.replace(/^\n+/g, ""), t = t.replace(/\n+$/g, ""); - for (var i = t.split(/\n{2,}/g), c = [], m = i.length, h = 0; h < m; h++) { - var C = i[h]; - C.search(/¨(K|G)(\d+)\1/g) >= 0 ? c.push(C) : C.search(/\S/) >= 0 && (C = a.subParser("spanGamut")(C, d, s), C = C.replace(/^([ \t]*)/g, "

"), C += "

", c.push(C)); - } - for (m = c.length, h = 0; h < m; h++) { - for (var U = "", H = c[h], V = !1; /¨(K|G)(\d+)\1/.test(H); ) { - var G = RegExp.$1, _ = RegExp.$2; - G === "K" ? U = s.gHtmlBlocks[_] : V ? U = a.subParser("encodeCode")(s.ghCodeBlocks[_].text, d, s) : U = s.ghCodeBlocks[_].codeblock, U = U.replace(/\$/g, "$$$$"), H = H.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, U), /^]*>\s*]*>/.test(H) && (V = !0); - } - c[h] = H; - } - return t = c.join(` -`), t = t.replace(/^\n+/g, ""), t = t.replace(/\n+$/g, ""), s.converter._dispatch("paragraphs.after", t, d, s); - }), a.subParser("runExtension", function(t, d, s, i) { - if (t.filter) - d = t.filter(d, i.converter, s); - else if (t.regex) { - var c = t.regex; - c instanceof RegExp || (c = new RegExp(c, "g")), d = d.replace(c, t.replace); - } - return d; - }), a.subParser("spanGamut", function(t, d, s) { - return t = s.converter._dispatch("spanGamut.before", t, d, s), t = a.subParser("codeSpans")(t, d, s), t = a.subParser("escapeSpecialCharsWithinTagAttributes")(t, d, s), t = a.subParser("encodeBackslashEscapes")(t, d, s), t = a.subParser("images")(t, d, s), t = a.subParser("anchors")(t, d, s), t = a.subParser("autoLinks")(t, d, s), t = a.subParser("simplifiedAutoLinks")(t, d, s), t = a.subParser("emoji")(t, d, s), t = a.subParser("underline")(t, d, s), t = a.subParser("italicsAndBold")(t, d, s), t = a.subParser("strikethrough")(t, d, s), t = a.subParser("ellipsis")(t, d, s), t = a.subParser("hashHTMLSpans")(t, d, s), t = a.subParser("encodeAmpsAndAngles")(t, d, s), d.simpleLineBreaks ? /\n\n¨K/.test(t) || (t = t.replace(/\n+/g, `
-`)) : t = t.replace(/ +\n/g, `
-`), t = s.converter._dispatch("spanGamut.after", t, d, s), t; - }), a.subParser("strikethrough", function(t, d, s) { - function i(c) { - return d.simplifiedAutoLink && (c = a.subParser("simplifiedAutoLinks")(c, d, s)), "" + c + ""; - } - return d.strikethrough && (t = s.converter._dispatch("strikethrough.before", t, d, s), t = t.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(c, m) { - return i(m); - }), t = s.converter._dispatch("strikethrough.after", t, d, s)), t; - }), a.subParser("stripLinkDefinitions", function(t, d, s) { - var i = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, c = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm; - t += "¨0"; - var m = function(h, C, U, H, V, G, _) { - return C = C.toLowerCase(), t.toLowerCase().split(C).length - 1 < 2 ? h : (U.match(/^data:.+?\/.+?;base64,/) ? s.gUrls[C] = U.replace(/\s/g, "") : s.gUrls[C] = a.subParser("encodeAmpsAndAngles")(U, d, s), G ? G + _ : (_ && (s.gTitles[C] = _.replace(/"|'/g, """)), d.parseImgDimensions && H && V && (s.gDimensions[C] = { - width: H, - height: V - }), "")); - }; - return t = t.replace(c, m), t = t.replace(i, m), t = t.replace(/¨0/, ""), t; - }), a.subParser("tables", function(t, d, s) { - if (!d.tables) - return t; - var i = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, c = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm; - function m(V) { - return /^:[ \t]*--*$/.test(V) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(V) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(V) ? ' style="text-align:center;"' : ""; - } - function h(V, G) { - var _ = ""; - return V = V.trim(), (d.tablesHeaderId || d.tableHeaderId) && (_ = ' id="' + V.replace(/ /g, "_").toLowerCase() + '"'), V = a.subParser("spanGamut")(V, d, s), "" + V + ` -`; - } - function C(V, G) { - var _ = a.subParser("spanGamut")(V, d, s); - return "" + _ + ` -`; - } - function U(V, G) { - for (var _ = ` - - -`, q = V.length, J = 0; J < q; ++J) - _ += V[J]; - for (_ += ` - - -`, J = 0; J < G.length; ++J) { - _ += ` -`; - for (var Z = 0; Z < q; ++Z) - _ += G[J][Z]; - _ += ` -`; - } - return _ += ` -
-`, _; - } - function H(V) { - var G, _ = V.split(` -`); - for (G = 0; G < _.length; ++G) - /^ {0,3}\|/.test(_[G]) && (_[G] = _[G].replace(/^ {0,3}\|/, "")), /\|[ \t]*$/.test(_[G]) && (_[G] = _[G].replace(/\|[ \t]*$/, "")), _[G] = a.subParser("codeSpans")(_[G], d, s); - var q = _[0].split("|").map(function(w) { - return w.trim(); - }), J = _[1].split("|").map(function(w) { - return w.trim(); - }), Z = [], B = [], k = [], F = []; - for (_.shift(), _.shift(), G = 0; G < _.length; ++G) - _[G].trim() !== "" && Z.push( - _[G].split("|").map(function(w) { - return w.trim(); - }) - ); - if (q.length < J.length) - return V; - for (G = 0; G < J.length; ++G) - k.push(m(J[G])); - for (G = 0; G < q.length; ++G) - a.helper.isUndefined(k[G]) && (k[G] = ""), B.push(h(q[G], k[G])); - for (G = 0; G < Z.length; ++G) { - for (var N = [], l = 0; l < B.length; ++l) - a.helper.isUndefined(Z[G][l]), N.push(C(Z[G][l], k[l])); - F.push(N); - } - return U(B, F); - } - return t = s.converter._dispatch("tables.before", t, d, s), t = t.replace(/\\(\|)/g, a.helper.escapeCharactersCallback), t = t.replace(i, H), t = t.replace(c, H), t = s.converter._dispatch("tables.after", t, d, s), t; - }), a.subParser("underline", function(t, d, s) { - return d.underline && (t = s.converter._dispatch("underline.before", t, d, s), d.literalMidWordUnderscores ? (t = t.replace(/\b___(\S[\s\S]*?)___\b/g, function(i, c) { - return "" + c + ""; - }), t = t.replace(/\b__(\S[\s\S]*?)__\b/g, function(i, c) { - return "" + c + ""; - })) : (t = t.replace(/___(\S[\s\S]*?)___/g, function(i, c) { - return /\S$/.test(c) ? "" + c + "" : i; - }), t = t.replace(/__(\S[\s\S]*?)__/g, function(i, c) { - return /\S$/.test(c) ? "" + c + "" : i; - })), t = t.replace(/(_)/g, a.helper.escapeCharactersCallback), t = s.converter._dispatch("underline.after", t, d, s)), t; - }), a.subParser("unescapeSpecialChars", function(t, d, s) { - return t = s.converter._dispatch("unescapeSpecialChars.before", t, d, s), t = t.replace(/¨E(\d+)E/g, function(i, c) { - var m = parseInt(c); - return String.fromCharCode(m); - }), t = s.converter._dispatch("unescapeSpecialChars.after", t, d, s), t; - }), a.subParser("makeMarkdown.blockquote", function(t, d) { - var s = ""; - if (t.hasChildNodes()) - for (var i = t.childNodes, c = i.length, m = 0; m < c; ++m) { - var h = a.subParser("makeMarkdown.node")(i[m], d); - h !== "" && (s += h); - } - return s = s.trim(), s = "> " + s.split(` -`).join(` -> `), s; - }), a.subParser("makeMarkdown.codeBlock", function(t, d) { - var s = t.getAttribute("language"), i = t.getAttribute("precodenum"); - return "```" + s + ` -` + d.preList[i] + "\n```"; - }), a.subParser("makeMarkdown.codeSpan", function(t) { - return "`" + t.innerHTML + "`"; - }), a.subParser("makeMarkdown.emphasis", function(t, d) { - var s = ""; - if (t.hasChildNodes()) { - s += "*"; - for (var i = t.childNodes, c = i.length, m = 0; m < c; ++m) - s += a.subParser("makeMarkdown.node")(i[m], d); - s += "*"; - } - return s; - }), a.subParser("makeMarkdown.header", function(t, d, s) { - var i = new Array(s + 1).join("#"), c = ""; - if (t.hasChildNodes()) { - c = i + " "; - for (var m = t.childNodes, h = m.length, C = 0; C < h; ++C) - c += a.subParser("makeMarkdown.node")(m[C], d); - } - return c; - }), a.subParser("makeMarkdown.hr", function() { - return "---"; - }), a.subParser("makeMarkdown.image", function(t) { - var d = ""; - return t.hasAttribute("src") && (d += "![" + t.getAttribute("alt") + "](", d += "<" + t.getAttribute("src") + ">", t.hasAttribute("width") && t.hasAttribute("height") && (d += " =" + t.getAttribute("width") + "x" + t.getAttribute("height")), t.hasAttribute("title") && (d += ' "' + t.getAttribute("title") + '"'), d += ")"), d; - }), a.subParser("makeMarkdown.links", function(t, d) { - var s = ""; - if (t.hasChildNodes() && t.hasAttribute("href")) { - var i = t.childNodes, c = i.length; - s = "["; - for (var m = 0; m < c; ++m) - s += a.subParser("makeMarkdown.node")(i[m], d); - s += "](", s += "<" + t.getAttribute("href") + ">", t.hasAttribute("title") && (s += ' "' + t.getAttribute("title") + '"'), s += ")"; - } - return s; - }), a.subParser("makeMarkdown.list", function(t, d, s) { - var i = ""; - if (!t.hasChildNodes()) - return ""; - for (var c = t.childNodes, m = c.length, h = t.getAttribute("start") || 1, C = 0; C < m; ++C) - if (!(typeof c[C].tagName > "u" || c[C].tagName.toLowerCase() !== "li")) { - var U = ""; - s === "ol" ? U = h.toString() + ". " : U = "- ", i += U + a.subParser("makeMarkdown.listItem")(c[C], d), ++h; - } - return i += ` - -`, i.trim(); - }), a.subParser("makeMarkdown.listItem", function(t, d) { - for (var s = "", i = t.childNodes, c = i.length, m = 0; m < c; ++m) - s += a.subParser("makeMarkdown.node")(i[m], d); - return /\n$/.test(s) ? s = s.split(` -`).join(` - `).replace(/^ {4}$/gm, "").replace(/\n\n+/g, ` - -`) : s += ` -`, s; - }), a.subParser("makeMarkdown.node", function(t, d, s) { - s = s || !1; - var i = ""; - if (t.nodeType === 3) - return a.subParser("makeMarkdown.txt")(t, d); - if (t.nodeType === 8) - return " - -`; - if (t.nodeType !== 1) - return ""; - var c = t.tagName.toLowerCase(); - switch (c) { - case "h1": - s || (i = a.subParser("makeMarkdown.header")(t, d, 1) + ` - -`); - break; - case "h2": - s || (i = a.subParser("makeMarkdown.header")(t, d, 2) + ` - -`); - break; - case "h3": - s || (i = a.subParser("makeMarkdown.header")(t, d, 3) + ` - -`); - break; - case "h4": - s || (i = a.subParser("makeMarkdown.header")(t, d, 4) + ` - -`); - break; - case "h5": - s || (i = a.subParser("makeMarkdown.header")(t, d, 5) + ` - -`); - break; - case "h6": - s || (i = a.subParser("makeMarkdown.header")(t, d, 6) + ` - -`); - break; - case "p": - s || (i = a.subParser("makeMarkdown.paragraph")(t, d) + ` - -`); - break; - case "blockquote": - s || (i = a.subParser("makeMarkdown.blockquote")(t, d) + ` - -`); - break; - case "hr": - s || (i = a.subParser("makeMarkdown.hr")(t, d) + ` - -`); - break; - case "ol": - s || (i = a.subParser("makeMarkdown.list")(t, d, "ol") + ` - -`); - break; - case "ul": - s || (i = a.subParser("makeMarkdown.list")(t, d, "ul") + ` - -`); - break; - case "precode": - s || (i = a.subParser("makeMarkdown.codeBlock")(t, d) + ` - -`); - break; - case "pre": - s || (i = a.subParser("makeMarkdown.pre")(t, d) + ` - -`); - break; - case "table": - s || (i = a.subParser("makeMarkdown.table")(t, d) + ` - -`); - break; - case "code": - i = a.subParser("makeMarkdown.codeSpan")(t, d); - break; - case "em": - case "i": - i = a.subParser("makeMarkdown.emphasis")(t, d); - break; - case "strong": - case "b": - i = a.subParser("makeMarkdown.strong")(t, d); - break; - case "del": - i = a.subParser("makeMarkdown.strikethrough")(t, d); - break; - case "a": - i = a.subParser("makeMarkdown.links")(t, d); - break; - case "img": - i = a.subParser("makeMarkdown.image")(t, d); - break; - default: - i = t.outerHTML + ` - -`; - } - return i; - }), a.subParser("makeMarkdown.paragraph", function(t, d) { - var s = ""; - if (t.hasChildNodes()) - for (var i = t.childNodes, c = i.length, m = 0; m < c; ++m) - s += a.subParser("makeMarkdown.node")(i[m], d); - return s = s.trim(), s; - }), a.subParser("makeMarkdown.pre", function(t, d) { - var s = t.getAttribute("prenum"); - return "
" + d.preList[s] + "
"; - }), a.subParser("makeMarkdown.strikethrough", function(t, d) { - var s = ""; - if (t.hasChildNodes()) { - s += "~~"; - for (var i = t.childNodes, c = i.length, m = 0; m < c; ++m) - s += a.subParser("makeMarkdown.node")(i[m], d); - s += "~~"; - } - return s; - }), a.subParser("makeMarkdown.strong", function(t, d) { - var s = ""; - if (t.hasChildNodes()) { - s += "**"; - for (var i = t.childNodes, c = i.length, m = 0; m < c; ++m) - s += a.subParser("makeMarkdown.node")(i[m], d); - s += "**"; - } - return s; - }), a.subParser("makeMarkdown.table", function(t, d) { - var s = "", i = [[], []], c = t.querySelectorAll("thead>tr>th"), m = t.querySelectorAll("tbody>tr"), h, C; - for (h = 0; h < c.length; ++h) { - var U = a.subParser("makeMarkdown.tableCell")(c[h], d), H = "---"; - if (c[h].hasAttribute("style")) { - var V = c[h].getAttribute("style").toLowerCase().replace(/\s/g, ""); - switch (V) { - case "text-align:left;": - H = ":---"; - break; - case "text-align:right;": - H = "---:"; - break; - case "text-align:center;": - H = ":---:"; - break; - } - } - i[0][h] = U.trim(), i[1][h] = H; - } - for (h = 0; h < m.length; ++h) { - var G = i.push([]) - 1, _ = m[h].getElementsByTagName("td"); - for (C = 0; C < c.length; ++C) { - var q = " "; - typeof _[C] < "u" && (q = a.subParser("makeMarkdown.tableCell")(_[C], d)), i[G].push(q); - } - } - var J = 3; - for (h = 0; h < i.length; ++h) - for (C = 0; C < i[h].length; ++C) { - var Z = i[h][C].length; - Z > J && (J = Z); - } - for (h = 0; h < i.length; ++h) { - for (C = 0; C < i[h].length; ++C) - h === 1 ? i[h][C].slice(-1) === ":" ? i[h][C] = a.helper.padEnd(i[h][C].slice(-1), J - 1, "-") + ":" : i[h][C] = a.helper.padEnd(i[h][C], J, "-") : i[h][C] = a.helper.padEnd(i[h][C], J); - s += "| " + i[h].join(" | ") + ` | -`; - } - return s.trim(); - }), a.subParser("makeMarkdown.tableCell", function(t, d) { - var s = ""; - if (!t.hasChildNodes()) - return ""; - for (var i = t.childNodes, c = i.length, m = 0; m < c; ++m) - s += a.subParser("makeMarkdown.node")(i[m], d, !0); - return s.trim(); - }), a.subParser("makeMarkdown.txt", function(t) { - var d = t.nodeValue; - return d = d.replace(/ +/g, " "), d = d.replace(/¨NBSP;/g, " "), d = a.helper.unescapeHTMLEntities(d), d = d.replace(/([*_~|`])/g, "\\$1"), d = d.replace(/^(\s*)>/g, "\\$1>"), d = d.replace(/^#/gm, "\\#"), d = d.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3"), d = d.replace(/^( {0,3}\d+)\./gm, "$1\\."), d = d.replace(/^( {0,3})([+-])/gm, "$1\\$2"), d = d.replace(/]([\s]*)\(/g, "\\]$1\\("), d = d.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:"), d; - }); - var D = this; - e.exports ? e.exports = a : D.showdown = a; - }).call(kn); -})(ms); -var Zo = ms.exports; -const $n = /* @__PURE__ */ Pn(Zo); -class En { - constructor() { - be(this, "logger"); - be(this, "converter"); - this.logger = Aa.zhiLog("showdown-adaptor"), this.converter = new $n.Converter(); - } - isAvailable() { - return typeof $n < "u"; - } - renderMarkdownStr(r) { - if (!this.isAvailable()) - throw new Error("Showdown is not available"); - return this.logger.info("Showdown is rendering md to HTML..."), Promise.resolve(this.converter.makeHtml(r)); - } -} -class gs { - constructor() { - be(this, "logger"); - be(this, "mdAdaptor", new En()); - this.logger = Aa.zhiLog("markdown-util"); - } - /** - * 获取当前 MD 解析器名称 - */ - getCurrentAdaptorName() { - return this.mdAdaptor instanceof bn ? "Lute" : this.mdAdaptor instanceof En ? "Showdown" : "None"; - } - /** - * 渲染Markdown - * - * @param md - Markdown文本 - */ - async renderHTML(r) { - const n = new bn(); - return this.logger.debug("Lute status =>", n.isAvailable()), n.isAvailable() && (this.mdAdaptor = n), this.logger.info(`Using ${this.getCurrentAdaptorName()} as markdown renderer`), await this.mdAdaptor.renderMarkdownStr(r); - } -} -class Yo { - constructor() { - be(this, "mdUtil"); - this.mdUtil = new gs(); - } - /** - * 移除标题数字 - * - * @param str - 字符串 - */ - removeTitleNumber(r) { - let n = r; - const a = /([0-9]*)\./; - return n = n.replace(a, ""), n; - } - /** - * 删除挂件的HTML - * - * @param str - 原字符 - */ - removeWidgetTag(r) { - let n = r.toString(); - const a = //g; - n = n.replace(a, ""); - const u = //g; - n = n.replace(u, ""); - const o = //g; - return n = n.replace(o, ""), n; - } - /** - * 删除Markdown文本的挂件的HTML - * - * @param str - 原字符 - */ - removeMdWidgetTag(r) { - let n = r.toString(); - return n = this.removeWidgetTag(n), n; - } - /** - * 去除html标签,残缺不全也可以 - * - * @param str - 字符串 - */ - filterHtml(r) { - r = r.replace(//g, ""), r = r.replace(//g, ""), r = r.replace(/<[^>]*>/g, ""), r = r.replace(/&.*;/g, ""), r = r.replace(/(^\s*)|(\s*$)/g, ""), r = r.replace(//g, ""), r = r.replace(/"/g, "").replace(/'/g, ""), r = r.replace(/\*/g, ""), r = r.replace(/\$/g, ""), r = r.replace(/\./g, ""), r = r.replace(/\+/g, ""), r = r.replace(/\s+/g, ""), r = r.replace(/[:|:]/g, "_"), r = r.replace(/[;|;]/g, "_"), r = r.replace(/\^/g, "_"), r = r.replace(/!/g, "_"), r = r.replace(/@/g, "at_"); - const n = ["\\d*/\\d/\\d*", "[、|\\\\]", "[,|,]", "\\d", "/", "-"]; - for (let a = 0; a < n.length; a++) { - const u = new RegExp(n[a], "g"); - r = r.replace(u, ""); - } - return r = r.toLowerCase(), r; - } - /** - * 截取指定长度html - * - * @param html - html - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - parseHtml(r, n, a) { - const u = this.filterHtml(r); - return u.length < n ? u : a === !0 ? u.substring(0, n) : u.substring(0, n) + "..."; - } - /** - * 将Markdown转换为HTML - * - * @param md - Markdown - */ - async mdToHtml(r) { - const n = await this.mdUtil.renderHTML(r); - return this.removeWidgetTag(n); - } - /** - * 将Markdown转换为纯文本 - * - * @param md - Markdown - */ - async mdToPlainText(r) { - const n = await this.mdToHtml(r); - return this.filterHtml(n); - } - /** - * 移除H1标签 - * - * @param html - html - */ - removeH1(r) { - let n = r; - const a = //g; - return n = n.replace(a, ""), n; - } - /** - * 移除Markdown里面的H1标签 - * - * JavaScript 正则表达式可以用来删除所有 Markdown 中的 h1 标签。下面是一个示例代码: - * - * const str = "# This is an H1\n## This is an H2\n### This is an H3"; - * - * const regex = /^# .*$/gm; - * const result = str.replace(regex, ''); - * - * console.log(result); - * 在这个例子中,我们使用正则表达式 /^# .*$/gm 来匹配所有的 h1 标签。 - * 在 JavaScript 中,^ 匹配行首,# 匹配 # 字符,.* 匹配任意字符,$ 匹配行尾,m 标记表示多行模式。 - */ - removeMdH1(r) { - let n = r; - const a = /^# .*$/gm; - return n = n.replace(a, ""), n; - } -} -class Xo { - /** - * 检测是否是空对象 - * - * @param obj - 对象 - */ - isEmptyObject(r) { - return r ? Object.getPrototypeOf(r) === Object.prototype && Object.getOwnPropertyNames(r).length === 0 && Object.getOwnPropertySymbols(r).length === 0 : !0; - } -} -class Qo { - constructor() { - be(this, "dateUtil"); - be(this, "strUtil"); - be(this, "versionUtil"); - be(this, "htmlUtil"); - be(this, "markdownUtil"); - be(this, "jsonUtil"); - be(this, "objectUtil"); - this.dateUtil = new ko(), this.strUtil = new Po(), this.versionUtil = new jo(), this.htmlUtil = new Yo(), this.markdownUtil = new gs(), this.jsonUtil = new Eo(), this.objectUtil = new Xo(); - } -} -const xo = Qo; -export { - xo as ZhiCommon, - yt as ZhiUtil -}; diff --git a/public/libs/zhi-common/lib/IBlogApi.d.ts b/public/libs/zhi-common/lib/IBlogApi.d.ts deleted file mode 100644 index a2e64fef..00000000 --- a/public/libs/zhi-common/lib/IBlogApi.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -import UserBlog from "./models/userBlog"; -import Post from "./models/post"; -import MediaObject from "./models/mediaObject"; -import CategoryInfo from "./models/categoryInfo"; -/** - * 通用博客接口 - * - * @public - * @author terwer - * @outline deep - * @version 1.0.0 - * @since 1.0.0 - */ -interface IBlogApi { - /** - * 博客配置列表 - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getUsersBlogs getUsersBlogs} - * @returns {Promise>} - */ - getUsersBlogs(): Promise>; - /** - * 最新文章数目 - * - * @param keyword - 关键字(可选,部分平台不支持搜索) - * @returns {Promise} - */ - getRecentPostsCount(keyword?: string): Promise; - /** - * 最新文章 - * - * @param numOfPosts - 文章数目 - * @param page - 页码(可选,从0开始,部分平台不支持分页) - * @param keyword - 关键字(可选,部分平台不支持搜索) - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getRecentPosts getRecentPosts} - * @returns {Promise>} - */ - getRecentPosts(numOfPosts: number, page?: number, keyword?: string): Promise>; - /** - * 发布文章 - * - * @param post - 文章 - * @param publish - 可选,是否发布 - * - * ```ts - * const post = { - * description: "自动发布的测试内容", - * title: "自动发布的测试标题", - * categories: ["标签1","标签2"], - * // dateCreated: new Date(), - * // link: "", - * // permalink: "", - * // postid: "", - * // source: { - * // name: "", - * // url: "" - * // }; - * // userid: "" - * } - * - * const result = newPost(post, false) - * ``` - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.newPost newPost} - * @returns {Promise} - */ - newPost(post: Post, publish?: boolean): Promise; - /** - * 文章详情 - * @param postid - postid - * @param useSlug - 是否使用的是别名(可选,部分平台不支持) - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getPost getPost} - * @returns {Promise} - */ - getPost(postid: string, useSlug?: boolean): Promise; - /** - * 更新文章 - * - * @param postid - 文章id - * @param post - 文章 - * @param publish - 可选,是否发布 - * - * ```ts - * // wordpress - * // const postid = 4115 - * // conf - * // const postid = 1540103 - * const postid = "2490384_1" - * const post = { - * description: "修改过的自动发布的测试内容2", - * title: "修改过的自动发布的测试标题2", - * categories: ["标签1", "标签2"], - * // dateCreated: new Date(), - * // link: "", - * // permalink: "", - * // postid: postid, - * // source: { - * // name: "", - * // url: "" - * // }; - * // userid: "" - * } - * - * const result = editPost(postid, post, false) - * ``` - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.editPost editPost} - * @returns {Promise} - */ - editPost(postid: string, post: Post, publish?: boolean): Promise; - /** - * 删除文章 - * - * @param postid - 文章ID - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.deletePost deletePost} - * @returns {Promise} - */ - deletePost(postid: string): Promise; - /** - * 获取分类列表 - * - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.getCategories getCategories} - * @returns {Promise} - */ - getCategories(): Promise; - /** - * 获取预览链接 - * - * @param postid - 文章ID - * @returns {Promise} - */ - getPreviewUrl(postid: string): Promise; - /** - * 上传附件 - * - * @param mediaObject - * @see {@link https://codex.wordpress.org/XML-RPC_MetaWeblog_API#metaWeblog.newMediaObject newMediaObject} - * @returns {Promise} - */ - newMediaObject(mediaObject: MediaObject): Promise; -} -export type { IBlogApi }; diff --git a/public/libs/zhi-common/lib/ZhiCommonUtil.d.ts b/public/libs/zhi-common/lib/ZhiCommonUtil.d.ts deleted file mode 100644 index 95d20160..00000000 --- a/public/libs/zhi-common/lib/ZhiCommonUtil.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Env } from "zhi-env"; -import ZhiUtil from "./ZhiUtil"; -/** - * Common 模块工具类 - * - * @author terwer - * @version 1.4.0 - * @since 1.4.0 - */ -declare class ZhiCommonUtil extends ZhiUtil { - static zhiEnv(): Env; -} -export default ZhiCommonUtil; diff --git a/public/libs/zhi-common/lib/ZhiUtil.d.ts b/public/libs/zhi-common/lib/ZhiUtil.d.ts deleted file mode 100644 index f300debf..00000000 --- a/public/libs/zhi-common/lib/ZhiUtil.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { DefaultLogger } from "zhi-log"; -import { Env } from "zhi-env"; -import ZhiCommon from "./zhi-common"; -/** - * 工具类统一入口,每个应用自己实现,可继承 zhi-common 然后扩展 - * - * ``` - * zhiEnv 方法必须重写,zhiLog 方法可不用 - * ``` - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare abstract class ZhiUtil { - /** - * zhi-util 的运行时环境 - */ - protected static env: Env | undefined; - /** - * zhi-util 的日志器缓存 - */ - protected static loggerMap: { - [key: string]: DefaultLogger; - }; - /** - * zhi-util 的通用工具类 - */ - protected static common: ZhiCommon | undefined; - /** - * 某些情况下,可能需要手动 init 之后才能用 - */ - static initEnv(env: Env): void; - /** - * 获取 zhi-env 实例 - 必须在使用的时候重写此方法 - * - * ``` - * if (!this.env) { - * this.env = new Env(import.meta.env) - * } - * return this.env - * ``` - * - * @see {@link https://github.com/terwer/zhi/tree/main/apps/zhi-env#usage docs for zhi-env usage} - */ - static zhiEnv(): Env; - /** - * 获取 zhi-log 实例 - * - * @param sign - 标志 - * @param loggerName - 日志名称 - */ - static zhiLogWithSign(sign: string, loggerName: string): DefaultLogger; - /** - * 获取 zhi-log 实例 - * - * @param loggerName - 日志名称 - */ - static zhiLog(loggerName: string): DefaultLogger; - /** - * 获取 zhi-common 实例 - */ - static zhiCommon(): ZhiCommon; -} -export default ZhiUtil; diff --git a/public/libs/zhi-common/lib/blogApi.d.ts b/public/libs/zhi-common/lib/blogApi.d.ts deleted file mode 100644 index 9640fbdf..00000000 --- a/public/libs/zhi-common/lib/blogApi.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import UserBlog from "./models/userBlog"; -import Post from "./models/post"; -import CategoryInfo from "./models/categoryInfo"; -import MediaObject from "./models/mediaObject"; -import type { IBlogApi } from "./IBlogApi"; -/** - * 博客API - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare class BlogApi implements IBlogApi { - private readonly logger; - private readonly apiAdaptor; - /** - * 博客API版本号 - */ - readonly VERSION: string; - /** - * 初始化博客 API - * - * @param apiAdaptor - 对应博客的适配器,例如:SiYuanApiAdaptor - */ - constructor(apiAdaptor: IBlogApi); - /** - * 博客配置列表 - */ - getUsersBlogs(): Promise>; - /** - * 最新文章数目 - * - * @param keyword - 关键字(可选,部分平台不支持搜索) - */ - getRecentPostsCount(keyword?: string): Promise; - /** - * 最新文章 - * - * @param numOfPosts - 文章数目 - * @param page - 页码(可选,从0开始,部分平台不支持分页) - * @param keyword - 关键字(可选,部分平台不支持搜索) - */ - getRecentPosts(numOfPosts: number, page?: number, keyword?: string): Promise>; - /** - * 发布文章 - * - * @param post - 文章 - * @param publish - 可选,是否发布 - */ - newPost(post: Post, publish?: boolean): Promise; - /** - * 文章详情 - * @param postid - postid - * @param useSlug - 是否使用的是别名(可选,部分平台不支持) - */ - getPost(postid: string, useSlug?: boolean): Promise; - /** - * 更新文章 - * - * @param postid - 文章id - * @param post - 文章 - * @param publish - 可选,是否发布 - */ - editPost(postid: string, post: Post, publish?: boolean): Promise; - /** - * 删除文章 - * - * @param postid - 文章ID - */ - deletePost(postid: string): Promise; - /** - * 获取分类列表 - */ - getCategories(): Promise; - /** - * 获取预览链接 - * - * @param postid - 文章ID - */ - getPreviewUrl(postid: string): Promise; - /** - * 上传附件 - * - * @param mediaObject - */ - newMediaObject(mediaObject: MediaObject): Promise; -} -export default BlogApi; diff --git a/public/libs/zhi-common/lib/blogConfig.d.ts b/public/libs/zhi-common/lib/blogConfig.d.ts deleted file mode 100644 index d01adfc5..00000000 --- a/public/libs/zhi-common/lib/blogConfig.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -import BlogPlaceholder from "./blogPlaceholder"; -/** - * 页面类型 - */ -export declare enum PageType { - /** - * Markdown正文 - */ - Markdown = 0, - /** - * HTML - */ - Html = 1, - /** - * 属性 - */ - Formatter = 2, - /** - * Markdown和属性 - */ - Markdown_And_Formatter = 3, - /** - * MDX - * - * @see {@link https://mdxjs.com/ mdx} - */ - MDX = 4 -} -/** - * 密码类型 - */ -export declare enum PasswordType { - /** - * 密码 - */ - PasswordType_Password = 0, - /** - * token - */ - PasswordType_Token = 1 -} -/** - * 博客通用配置类 - */ -declare abstract class BlogConfig { - /** - * 首页 - */ - protected home: string; - /** - * API地址 - */ - protected apiUrl: string; - /** - * 用户名 - */ - protected username: string; - /** - * 密码类型 - */ - protected passwordType: PasswordType; - /** - * 密码 - */ - protected password: string; - /** - * 是否发布 - */ - protected apiStatus: boolean; - /** - * 博客名(API获取) - */ - protected blogName: string; - /** - * 文章别名key - */ - protected posidKey: string; - /** - * 文章预览链接 - */ - protected previewUrl: string; - /** - * 文章类型 - */ - protected pageType: PageType; - /** - * 操作提示 - */ - protected placeholder: BlogPlaceholder | undefined; - /** - * 是否处理标题 - * - * @protected - */ - protected fixTitle: boolean; - protected constructor(); -} -export default BlogConfig; diff --git a/public/libs/zhi-common/lib/blogConstants.d.ts b/public/libs/zhi-common/lib/blogConstants.d.ts deleted file mode 100644 index 1ef63fad..00000000 --- a/public/libs/zhi-common/lib/blogConstants.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 博客通用常量定义 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class BlogConstants { - /** - * 博客类型 - */ - static DEFAULT_BLOG_TYPE_KEY: string; -} -export default BlogConstants; diff --git a/public/libs/zhi-common/lib/blogPlaceholder.d.ts b/public/libs/zhi-common/lib/blogPlaceholder.d.ts deleted file mode 100644 index 7b9e3141..00000000 --- a/public/libs/zhi-common/lib/blogPlaceholder.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 配置提示 - * - * @author terwer - * @since 1.0.0 - */ -declare abstract class BlogPlaceholder { - /** - * 首页操作提示 - */ - protected homePlaceholder: string; - /** - * API 地址操作提示 - */ - protected apiUrlPlaceholder: string; - /** - * 用户名操作提示 - */ - protected usernamePlaceholder: string; - /** - * 密码类型操作提示 - */ - protected passwordTypePlaceholder: string; - /** - * 密码操作提示 - */ - protected passwordPlaceholder: string; - /** - * API状态是否正常操作提示 - */ - protected apiStatusPlaceholder: boolean; - /** - * 博客名(API获取)操作提示 - */ - protected blogNamePlaceholder: string; - /** - * 文章别名key操作提示 - */ - protected posidKeyPlaceholder: string; - /** - * 文章预览链接操作提示 - */ - protected previewUrlPlaceholder: string; - /** - * 文章类型操作提示 - */ - protected pageTypePlaceholder: string; - constructor(); -} -export default BlogPlaceholder; diff --git a/public/libs/zhi-common/lib/dateUtil.d.ts b/public/libs/zhi-common/lib/dateUtil.d.ts deleted file mode 100644 index 9c3ded56..00000000 --- a/public/libs/zhi-common/lib/dateUtil.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 时间处理工具类 - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare class DateUtil { - private readonly TIME_SPLIT; - /** - * 给日期添加小时 - * - * @param date - Date - * @param numOfHours - 数字 - * @author terwer - * @since 1.0.0 - */ - private addHoursToDate; - /** - * 转换ISO日期为中文日期的通用转换方法 - * - * @param str - '2022-07-18T06:25:48.000Z - * @param isAddTimeZone - 是否增加时区(默认不增加) - * @param isShort - 是否只返回日期 - * @author terwer - * @since 1.0.0 - */ - private formatIsoToZhDateFormat; - /** - * 转换ISO日期为中文完整时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZh(str: string): string; - /** - * 转换ISO日期为中文日期 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhDate(str: string): string; - /** - * 转换ISO日期为中文时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhTime(str: string): string; - /** - * 当前日期时间完整格式,格式:2023-03-10 02:03:43 - */ - nowZh(): string; - /** - * 当前日期,格式:2023-03-10 - */ - nowDateZh(): string; - /** - * 当前时间,格式:02:03:43 - */ - nowTimeZh(): string; -} -export default DateUtil; diff --git a/public/libs/zhi-common/lib/enums/blogTypeEnum.d.ts b/public/libs/zhi-common/lib/enums/blogTypeEnum.d.ts deleted file mode 100644 index 50f7fca8..00000000 --- a/public/libs/zhi-common/lib/enums/blogTypeEnum.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 博客类型枚举 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare enum BlogTypeEnum { - /** - * 思源笔记 - */ - BlogTypeEnum_Siyuan = "siyuan", - /** - * Metaweblog - */ - BlogTypeEnum_Metaweblog = "metaweblog", - /** - * WordPress - */ - BlogTypeEnum_Wordpress = "wordpress" -} -export default BlogTypeEnum; diff --git a/public/libs/zhi-common/lib/enums/postStatusEnum.d.ts b/public/libs/zhi-common/lib/enums/postStatusEnum.d.ts deleted file mode 100644 index e027b6de..00000000 --- a/public/libs/zhi-common/lib/enums/postStatusEnum.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 文章状态枚举 - */ -declare enum PostStatusEnum { - /** - * 已发布 - */ - PostStatusEnum_Publish = "publish", - /** - * 草稿 - */ - PostStatusEnum_Draft = "draft", - /** - * 继承 - */ - PostStatusEnum_Inherit = "inherit" -} -export default PostStatusEnum; diff --git a/public/libs/zhi-common/lib/htmlUtil.d.ts b/public/libs/zhi-common/lib/htmlUtil.d.ts deleted file mode 100644 index 178d08ed..00000000 --- a/public/libs/zhi-common/lib/htmlUtil.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -/** - * HTML 处理工具类 - */ -declare class HtmlUtil { - private readonly mdUtil; - constructor(); - /** - * 移除标题数字 - * - * @param str - 字符串 - */ - removeTitleNumber(str: string): string; - /** - * 删除挂件的HTML - * - * @param str - 原字符 - */ - removeWidgetTag(str: string): string; - /** - * 删除Markdown文本的挂件的HTML - * - * @param str - 原字符 - */ - removeMdWidgetTag(str: string): string; - /** - * 去除html标签,残缺不全也可以 - * - * @param str - 字符串 - */ - filterHtml(str: string): string; - /** - * 截取指定长度html - * - * @param html - html - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - parseHtml(html: string, length: number, ignore?: boolean): string; - /** - * 将Markdown转换为HTML - * - * @param md - Markdown - */ - mdToHtml(md: string): Promise; - /** - * 将Markdown转换为纯文本 - * - * @param md - Markdown - */ - mdToPlainText(md: string): Promise; - /** - * 移除H1标签 - * - * @param html - html - */ - removeH1(html: string): string; - /** - * 移除Markdown里面的H1标签 - * - * JavaScript 正则表达式可以用来删除所有 Markdown 中的 h1 标签。下面是一个示例代码: - * - * const str = "# This is an H1\n## This is an H2\n### This is an H3"; - * - * const regex = /^# .*$/gm; - * const result = str.replace(regex, ''); - * - * console.log(result); - * 在这个例子中,我们使用正则表达式 /^# .*$/gm 来匹配所有的 h1 标签。 - * 在 JavaScript 中,^ 匹配行首,# 匹配 # 字符,.* 匹配任意字符,$ 匹配行尾,m 标记表示多行模式。 - */ - removeMdH1(md: string): string; -} -export default HtmlUtil; diff --git a/public/libs/zhi-common/lib/jsonUtil.d.ts b/public/libs/zhi-common/lib/jsonUtil.d.ts deleted file mode 100644 index 83598026..00000000 --- a/public/libs/zhi-common/lib/jsonUtil.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { JSONSchemaType } from "ajv"; -/** - * 校验 JSON schema - * - * @author terwer - * @version 1.5.0 - * @since 1.5.0 - */ -declare class JsonUtil { - private ajv; - constructor(); - validateJson(schema: JSONSchemaType, data: T): { - valid: boolean; - error?: string; - }; - validateObjectSchema(schemaObject: object, dataObject: object): { - valid: boolean; - error?: string; - }; -} -export default JsonUtil; diff --git a/public/libs/zhi-common/lib/markdownUtil.d.ts b/public/libs/zhi-common/lib/markdownUtil.d.ts deleted file mode 100644 index 0152d5c0..00000000 --- a/public/libs/zhi-common/lib/markdownUtil.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Markdown 处理工具类 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class MarkdownUtil { - private readonly logger; - private mdAdaptor; - constructor(); - /** - * 获取当前 MD 解析器名称 - */ - private getCurrentAdaptorName; - /** - * 渲染Markdown - * - * @param md - Markdown文本 - */ - renderHTML(md: string): Promise; -} -export default MarkdownUtil; diff --git a/public/libs/zhi-common/lib/md-adaptor/LuteAdaptor.d.ts b/public/libs/zhi-common/lib/md-adaptor/LuteAdaptor.d.ts deleted file mode 100644 index 405ee589..00000000 --- a/public/libs/zhi-common/lib/md-adaptor/LuteAdaptor.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import MarkdownAdaptor from "./MarkdownAdaptor"; -/** - * Lute 适配器 - * - * 引用 lute 库的方法 - * - * 1 dev/prod 环境 - * 在 index.html 直接引用 - * - * 2 test 环境 - * 在 setup.ts 引用 require("../public/lib/lute/lute.min.js") - * - * 3 es 环境(不推荐) - * - * ``` - * // https://stackoverflow.com/a/73702082/4037224 - * const require = createRequire(import.meta.url) - * global.require = require //this will make require at the global scobe and treat it like the original require - * require("./lute.min.cjs") - * ``` - * - * 更好的方法 - * - * ``` - * import Module from "node:module" - * - * const require = Module.createRequire(import.meta.url) - * require("./lute.min.cjs") - * ``` - * - * 2023-04-09 - lute version 2.7.5 - update at April 9, 2023 09:32 - * - * 4 Nuxt3 环境 - * 参考:https://github.com/88250/lute/issues/191 - * - * @see {@link https://github.com/88250/lute/tree/master/javascript lute} - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class LuteAdaptor implements MarkdownAdaptor { - private readonly logger; - constructor(); - isAvailable(): boolean; - /** - * 高亮关键字 - * - * @param str - 字符串 - * @private - */ - private highlightWords; - /** - * 渲染Markdown - * - * @param md - Markdown - */ - renderMarkdownStr(md: string): Promise; -} -export default LuteAdaptor; diff --git a/public/libs/zhi-common/lib/md-adaptor/MarkdownAdaptor.d.ts b/public/libs/zhi-common/lib/md-adaptor/MarkdownAdaptor.d.ts deleted file mode 100644 index df5e5bff..00000000 --- a/public/libs/zhi-common/lib/md-adaptor/MarkdownAdaptor.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Markdown适配器接口 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -interface MarkdownAdaptor { - /** - * 是否可用 - */ - isAvailable(): boolean; - /** - * 渲染MD - * - * @param md - Markdown - */ - renderMarkdownStr(md: string): Promise; -} -export default MarkdownAdaptor; diff --git a/public/libs/zhi-common/lib/md-adaptor/ShowdownAdaptor.d.ts b/public/libs/zhi-common/lib/md-adaptor/ShowdownAdaptor.d.ts deleted file mode 100644 index 5203c1c7..00000000 --- a/public/libs/zhi-common/lib/md-adaptor/ShowdownAdaptor.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import MarkdownAdaptor from "./MarkdownAdaptor"; -/** - * showdown 适配器 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class ShowdownAdaptor implements MarkdownAdaptor { - private readonly logger; - private readonly converter; - constructor(); - isAvailable(): boolean; - renderMarkdownStr(md: string): Promise; -} -export default ShowdownAdaptor; diff --git a/public/libs/zhi-common/lib/models/categoryInfo.d.ts b/public/libs/zhi-common/lib/models/categoryInfo.d.ts deleted file mode 100644 index 5b25f129..00000000 --- a/public/libs/zhi-common/lib/models/categoryInfo.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 通用分类模型定义 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class CategoryInfo { - /** - * 分类ID - */ - categoryId: string; - /** - * 父分类ID - */ - parentId: string; - /** - * 分类名称 - */ - description: string; - /** - * 分类英文名 - */ - categoryName: string; - /** - * 分类详情 - */ - categoryDescription: string; - /** - * 分类地址 - */ - htmlUrl: string; - /** - * 分类订阅地址 - */ - rssUrl: string; - constructor(); -} -export default CategoryInfo; diff --git a/public/libs/zhi-common/lib/models/mediaObject.d.ts b/public/libs/zhi-common/lib/models/mediaObject.d.ts deleted file mode 100644 index cbb47a5a..00000000 --- a/public/libs/zhi-common/lib/models/mediaObject.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/// -/** - * 媒体文件 - * - * ```ts - * const url = "./testdata/photo.jpg"; - * const file = fs.readFileSync(url) - * const data = { - * name: "20220616-132401-001.jpg", - * type: "image/jpeg", - * bits: file, - * overwrite: true - * } - * - * // return - * { - * attachment_id: '4108', - * date_created_gmt: 2022-06-15T21:25:23.000Z, - * parent: 0, - * link: 'https://terwergreen.files.wordpress.com/2022/06/20220616-132401-001.jpg', - * title: '20220616-132401-001.jpg', - * caption: '', - * description: '', - * metadata: { filesize: 113032 }, - * type: 'image/jpeg', - * thumbnail: 'https://terwergreen.files.wordpress.com/2022/06/20220616-132401-001.jpg?w=150', - * id: '4108', - * file: '20220616-132401-001.jpg', - * url: 'http://terwergreen.files.wordpress.com/2022/06/20220616-132401-001.jpg' - * } - * ``` - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class MediaObject { - name: string; - type: string; - bits: Buffer; - constructor(name: string, type: string, bits: Buffer); -} -export default MediaObject; diff --git a/public/libs/zhi-common/lib/models/post.d.ts b/public/libs/zhi-common/lib/models/post.d.ts deleted file mode 100644 index 56c673df..00000000 --- a/public/libs/zhi-common/lib/models/post.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import PostStatusEnum from "../enums/postStatusEnum"; -/** - * 通用文章模型定义 - * - * @public - */ -declare class Post { - /** - * 文章ID - */ - postid: string; - /** - * 标题 - */ - title: string; - /** - * 逗号分隔的标签 - */ - mt_keywords: string; - /** - * 链接 - */ - link?: string; - /** - * 永久链接 - */ - permalink: string; - /** - * 摘要 - */ - shortDesc?: string; - /** - * 描述 - */ - description: string; - /** - * 短评 - */ - mt_excerpt?: string; - /** - * 别名 - */ - wp_slug: string; - /** - * 创建时间 - */ - dateCreated: Date; - /** - * 分类 - */ - categories: Array; - /** - * 更多 - */ - mt_text_more?: string; - /** - * 发布状态 - */ - post_status?: PostStatusEnum; - /** - * 是否发布 - */ - isPublished: boolean; - /** - * 发布密码 - */ - wp_password: string; - constructor(); -} -export default Post; diff --git a/public/libs/zhi-common/lib/models/siteConfig.d.ts b/public/libs/zhi-common/lib/models/siteConfig.d.ts deleted file mode 100644 index 6132eaac..00000000 --- a/public/libs/zhi-common/lib/models/siteConfig.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import UserBlog from "./userBlog"; -/** - * 站点信息定义 - */ -declare class SiteConfig { - /** - * 博客信息 - */ - userBlog: UserBlog; - /** - * 域名 - */ - domain: string; - /** - * 站点链接 - */ - weburl: string; - /** - * 站点主题 - */ - webtheme: string; - /** - * 站点名称 - */ - webname: string; - /** - * 站点口号 - */ - webslogen: string; - /** - * 关键字 - */ - keywords: string; - /** - * 描述 - */ - description: string; - /** - * 备案信息 - */ - beianinfo: string; - constructor(); -} -export default SiteConfig; diff --git a/public/libs/zhi-common/lib/models/userBlog.d.ts b/public/libs/zhi-common/lib/models/userBlog.d.ts deleted file mode 100644 index 7929c6e9..00000000 --- a/public/libs/zhi-common/lib/models/userBlog.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 博客信息定义 - * - * @public - */ -declare class UserBlog { - /** - * 博客ID - */ - blogid: string; - /** - * 博客地址 - */ - url: string; - /** - * 博客名称 - */ - blogName: string; - /** - * 是否是管理员 - */ - isAdmin?: boolean; - /** - * xmlrpc地址 - */ - xmlrpc?: string; - constructor(); -} -export default UserBlog; diff --git a/public/libs/zhi-common/lib/objectUtil.d.ts b/public/libs/zhi-common/lib/objectUtil.d.ts deleted file mode 100644 index ba76433b..00000000 --- a/public/libs/zhi-common/lib/objectUtil.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Object 工具类 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class ObjectUtil { - /** - * 检测是否是空对象 - * - * @param obj - 对象 - */ - isEmptyObject(obj: any): boolean; -} -export default ObjectUtil; diff --git a/public/libs/zhi-common/lib/strUtil.d.ts b/public/libs/zhi-common/lib/strUtil.d.ts deleted file mode 100644 index 4d218555..00000000 --- a/public/libs/zhi-common/lib/strUtil.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 字符串工具类 - * - * @public - * @author terwer - * @since 0.0.1 - */ -declare class StrUtil { - /** - * 格式化字符串 - * - * @param str - 字符串,可用占位符,例如:test \{0\} str - * @param args - 按占位符顺序排列的参数 - * @author terwer - * @since 0.0.1 - */ - f(str: string, ...args: (string | number | boolean | object)[]): string; - /** - * 字符串拼接 - * - * @param str - 字符串数组 - */ - appendStr(...str: string[]): string; - /** - * 判断字符串中,是否包含数组中任何一个元素 - * - * @param str - 字符串 - * @param arr - 字符串数组 - */ - includeInArray(str: string, arr: string[]): boolean; - /** - * 截取指定长度的字符串 - * - * @param str - str - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - getByLength(str: string, length: number, ignore?: boolean): string; - /** - * 字符串空值检测 - * - * @param str - 待检测的字符串 - */ - isEmptyString(str: any): boolean; - /** - * 路径组合,解决多出来/的问题 - * - * @param path1 - 路径1 - * @param path2 - 路径2 - */ - pathJoin(path1: string, path2: string): string; - /** - * 强转boolean - * - * @param val - val - */ - parseBoolean(val: any): boolean; -} -export default StrUtil; diff --git a/public/libs/zhi-common/lib/utils/ZhiBlogApiUtil.d.ts b/public/libs/zhi-common/lib/utils/ZhiBlogApiUtil.d.ts deleted file mode 100644 index f6281706..00000000 --- a/public/libs/zhi-common/lib/utils/ZhiBlogApiUtil.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ZhiUtil } from "zhi-common"; -import { Env } from "zhi-env"; -/** - * 工具类统一入口,每个应用自己实现 - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare class ZhiBlogApiUtil extends ZhiUtil { - static zhiEnv(): Env; -} -export default ZhiBlogApiUtil; diff --git a/public/libs/zhi-common/lib/versionUtil.d.ts b/public/libs/zhi-common/lib/versionUtil.d.ts deleted file mode 100644 index 680eae3d..00000000 --- a/public/libs/zhi-common/lib/versionUtil.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 版本号比较 - * - * @public - * @author terwer - * @since 1.0.2 - */ -declare class VersionUtil { - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is higher than v2 - */ - greater(v1: string, v2: string): boolean; - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is equal to v2 - */ - equal(v1: string, v2: string): boolean; - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is lesser than v2 - */ - lesser(v1: string, v2: string): boolean; -} -export default VersionUtil; diff --git a/public/libs/zhi-common/lib/zhi-blog-api.d.ts b/public/libs/zhi-common/lib/zhi-blog-api.d.ts deleted file mode 100644 index 556625c6..00000000 --- a/public/libs/zhi-common/lib/zhi-blog-api.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import BlogApi from "./blogApi"; -export default BlogApi; diff --git a/public/libs/zhi-common/lib/zhi-common.d.ts b/public/libs/zhi-common/lib/zhi-common.d.ts deleted file mode 100644 index 0280738d..00000000 --- a/public/libs/zhi-common/lib/zhi-common.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import JsonUtil from "./jsonUtil"; -import DateUtil from "./dateUtil"; -import StrUtil from "./strUtil"; -import VersionUtil from "./versionUtil"; -import HtmlUtil from "./htmlUtil"; -import MarkdownUtil from "./markdownUtil"; -import ObjectUtil from "./objectUtil"; -/** - * 平台无关的通用工具类 - * - * @author terwer - * @version 1.4.0 - * @since 1.3.0 - */ -declare class ZhiCommon { - readonly dateUtil: DateUtil; - readonly strUtil: StrUtil; - readonly versionUtil: VersionUtil; - readonly htmlUtil: HtmlUtil; - readonly markdownUtil: MarkdownUtil; - readonly jsonUtil: JsonUtil; - readonly objectUtil: ObjectUtil; - constructor(); -} -export default ZhiCommon; diff --git a/public/libs/zhi-common/package.json b/public/libs/zhi-common/package.json deleted file mode 100644 index 13760681..00000000 --- a/public/libs/zhi-common/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "zhi-common", - "version": "1.5.3", - "type": "module", - "description": "a collection of util tools", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "repository": "terwer/zhi", - "homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-common", - "author": "terwer", - "license": "GPL", - "files": [ - "dist", - "README.md" - ], - "keywords": [ - "zhi", - "lib" - ], - "scripts": { - "serve": "vite", - "dev": "vite build --watch", - "build": "vite build", - "start": "vite preview", - "test": "vitest --watch" - }, - "devDependencies": { - "@terwer/eslint-config-custom": "workspace:*", - "@terwer/tsconfig": "workspace:*", - "@terwer/vite-config-custom": "workspace:*", - "@types/showdown": "^2.0.1" - }, - "dependencies": { - "ajv": "^8.12.0", - "compare-versions": "5.0.3", - "showdown": "^2.1.0", - "zhi-device": "workspace:*", - "zhi-env": "workspace:*", - "zhi-log": "workspace:*" - } -} diff --git a/public/libs/zhi-device/README.md b/public/libs/zhi-device/README.md deleted file mode 100644 index 4819366d..00000000 --- a/public/libs/zhi-device/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# zhi-device - -auto check environment whether in browser, browser extension, electron, node and more - -## Usage - -```ts -import { DeviceDetection, BrowserUtil, DeviceTypeEnum } from "zhi-device" - -console.log("isInBrowser=>", BrowserUtil.isInBrowser) - -const deviceType: DeviceTypeEnum = DeviceDetection.getDevice() -console.log("deviceType=>", deviceType) - -// supported platforms -// Mobile -// Siyuan_Widget -// Siyuan_NewWindow -// Siyuan_MainWindow -// Chrome_Extension -// Chrome_Browser -// Node -``` - -## Deps - -``` -## Congregations! zhi-device need no deps, it is just pure js code 🎉 -``` - -## Dev - -```bash -pnpm dev -F zhi-device -``` - -## Build - -```bash -pnpm build -F zhi-device -``` - -## Api - -```bash -pnpm doc -F zhi-device -pnpm md -F zhi-device -``` - -## Test - -Execute the unit tests via [vitest](https://vitest.dev) - -```bash -pnpm test -F zhi-device -``` - -## Publish - -```bash -pnpm publish -F zhi-device --tag=latest -``` \ No newline at end of file diff --git a/public/libs/zhi-device/deviceDetection.d.ts b/public/libs/zhi-device/deviceDetection.d.ts deleted file mode 100644 index e19e5b22..00000000 --- a/public/libs/zhi-device/deviceDetection.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import DeviceTypeEnum from "./lib/deviceTypeEnum"; -/** - * 设备检测 - * - * @public - * @author terwer - * @version 0.1.0 - * @since 0.1.0 - */ -declare class DeviceDetection { - /** - * 获取当前设备 - */ - static getDevice(): DeviceTypeEnum; - /** - * 检测移动端 - * @private - */ - private static detectMobileDevice; -} -export default DeviceDetection; diff --git a/public/libs/zhi-device/index.d.ts b/public/libs/zhi-device/index.d.ts deleted file mode 100644 index fe5b18d0..00000000 --- a/public/libs/zhi-device/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import DeviceDetection from "./deviceDetection"; -import DeviceTypeEnum from "./lib/deviceTypeEnum"; -import BasePathTypeEnum from "./lib/basePathTypeEnum"; -import BrowserUtil from "./lib/browserUtil"; -import SiyuanDevice from "./lib/siyuanDevice"; -/** - * zhi-device 入口 - */ -export { DeviceDetection }; -export { BrowserUtil, SiyuanDevice }; -export { DeviceTypeEnum, BasePathTypeEnum }; diff --git a/public/libs/zhi-device/index.js b/public/libs/zhi-device/index.js deleted file mode 100644 index 32f33b87..00000000 --- a/public/libs/zhi-device/index.js +++ /dev/null @@ -1,430 +0,0 @@ -var g = Object.defineProperty; -var P = (a, e, t) => e in a ? g(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t; -var r = (a, e, t) => (P(a, typeof e != "symbol" ? e + "" : e, t), t); -const u = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return u.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let i = u; -/** - * 是否在浏览器环境 - */ -r(i, "isNode", typeof process < "u"), /** - * 是否在浏览器环境 - */ -r(i, "isInBrowser", typeof window < "u"), /** - * 浏览器路径分隔符 - */ -r(i, "BrowserSeperator", "/"), /** - * 是否是Electron环境 - */ -r(i, "isElectron", () => !u.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** - * 是否有Node环境,目前包括 Electron 和 Node - */ -r(i, "hasNodeEnv", () => u.isElectron() || u.isNode), /** - * 获取url参数 - * - * @param sParam - 参数 - */ -r(i, "getQueryString", (e) => { - if (!u.isInBrowser) - return ""; - const n = window.location.search.substring(1).split("&"); - for (let s = 0; s < n.length; s++) { - const c = n[s].split("="); - if (c[0] === e) - return c[1]; - } - return ""; -}), /** - * 替换 URL 的参数 - * 思路: - * 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 - * - * 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 - * - * 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 - * - * 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 - * - * 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 - * - * @param url - 链接地址 - * @param paramName - 参数名 - * @param paramValue - 参数值 - */ -r(i, "replaceUrlParam", (e, t, n) => { - n == null && (n = ""); - const s = new RegExp("\\b(" + t + "=).*?(&|#|$)"); - if (e.search(s) >= 0) - return e.replace(s, "$1" + n + "$2"); - const [c, d] = e.split("#"), [y, b] = c.split("?"), l = new URLSearchParams(b); - l.set(t, n); - const m = l.toString(), f = y + (m ? "?" + m : ""); - return d ? f + "#" + d : f; -}), /** - * 设置url参数 - * - * @param urlstring - url - * @param key - key - * @param value - value - */ -r(i, "setUrlParameter", (e, t, n) => { - if (e.includes(t)) - return u.replaceUrlParam(e, t, n); - const s = e.split("#"); - let c = s[0]; - const d = s[1]; - return c.includes("?") ? c += `&${t}=${n}` : c += `?${t}=${n}`, d && (c += "#" + d), c; -}), /** - * 重新加载指定tab - * - * @param tabname - tabname - * @param t - 延迟时间 - */ -r(i, "reloadTabPage", (e, t = 200) => { - setTimeout(function() { - if (u.isInBrowser) { - const n = window.location.href; - window.location.href = u.setUrlParameter(n, "tab", e); - } - }, t); -}), /** - * 刷新当前tab页面 - */ -r(i, "reloadPage", () => { - setTimeout(function() { - u.isInBrowser && window.location.reload(); - }, 200); -}), /** - * 刷新当前tab页面 - * - * @param msg - 消息提示 - * @param cb - 回调 - */ -r(i, "reloadPageWithMessageCallback", (e, t) => { - t && t(e), setTimeout(function() { - u.isInBrowser && window.location.reload(); - }, 200); -}); -var o = /* @__PURE__ */ ((a) => (a.BasePathType_Appearance = "Appearance", a.BasePathType_Data = "Data", a.BasePathType_Themes = "Themes", a.BasePathType_ZhiTheme = "ZhiTheme", a.BasePathType_None = "None", a))(o || {}); -const h = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return i.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, t) { - let n = e; - switch (t) { - case o.BasePathType_Appearance: - n = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case o.BasePathType_Data: - n = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case o.BasePathType_Themes: - n = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case o.BasePathType_ZhiTheme: - n = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: s } = await import( - /* @vite-ignore */ - n - ); - return s; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, o.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (i.hasNodeEnv()) { - const t = this.requireLib("path"); - if (t) - return t.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(i.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (i.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let w = h; -/** - * 思源笔记iframe挂件环境 - */ -r(w, "isInSiyuanWidget", () => i.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** - * 思源笔记新窗口 - * - * @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 - * @author terwer - * @version 0.1.0 - * @since 0.0.1 - */ -r(w, "isInSiyuanNewWin", () => !i.isInBrowser || !i.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -r(w, "requireLib", (e, t = !0, n = o.BasePathType_None) => { - if (!i.hasNodeEnv()) - throw new Error("require ony works on node env"); - let s = e; - if (!t) - switch (n) { - case o.BasePathType_Appearance: - s = h.joinPath(h.siyuanAppearancePath(), e); - break; - case o.BasePathType_Data: - s = h.joinPath(h.siyuanDataPath(), e); - break; - case o.BasePathType_Themes: - s = h.joinPath(h.siyuanAppearancePath(), "themes", e); - break; - case o.BasePathType_ZhiTheme: - s = h.joinPath(h.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const c = h.siyuanWindow(); - if (!c) - return require(s); - if (typeof c.require < "u") - return c.require(s); -}), /** - * 引入依赖,以 data 的基本路径为准 - * - * @param libpath - 相对于 appearance 的相对路径 - */ -r(w, "requireAppearanceLib", (e) => h.requireLib(e, !1, o.BasePathType_Appearance)), /** - * 引入依赖,以 data 的基本路径为准 - * - * @param libpath - 相对于 data 的相对路径 - */ -r(w, "requireDataLib", (e) => h.requireLib(e, !1, o.BasePathType_Data)), /** - * 引入依赖,以 theme 的基本路径为准 - * - * @param libpath - 相对于 theme 的相对路径 - */ -r(w, "requireThemesLib", (e) => h.requireLib(e, !1, o.BasePathType_Themes)), /** - * 引入依赖,以 ZhiTheme 的基本路径为准 - * - * @param libpath - 相对于 ZhiTheme 的相对路径 - */ -r(w, "requireZhiThemeLib", (e) => h.requireLib(e, !1, o.BasePathType_ZhiTheme)); -var p = /* @__PURE__ */ ((a) => (a.DeviceType_Mobile_Device = "Mobile", a.DeviceType_Siyuan_Widget = "Siyuan_Widget", a.DeviceType_Siyuan_NewWin = "Siyuan_NewWindow", a.DeviceType_Siyuan_MainWin = "Siyuan_MainWindow", a.DeviceType_Siyuan_Browser = "Siyuan_Browser", a.DeviceType_Chrome_Extension = "Chrome_Extension", a.DeviceType_Chrome_Browser = "Chrome_Browser", a.DeviceType_Node = "Node", a))(p || {}); -class v { - /** - * 获取当前设备 - */ - static getDevice() { - return this.detectMobileDevice() ? p.DeviceType_Mobile_Device : w.isInSiyuanWidget() ? p.DeviceType_Siyuan_Widget : w.isInSiyuanNewWin() ? p.DeviceType_Siyuan_NewWin : i.isElectron() ? p.DeviceType_Siyuan_MainWin : w.isInSiyuanBrowser() ? p.DeviceType_Siyuan_Browser : i.isInChromeExtension() ? p.DeviceType_Chrome_Extension : i.isNode ? p.DeviceType_Node : p.DeviceType_Chrome_Browser; - } - /** - * 检测移动端 - * @private - */ - static detectMobileDevice() { - let e = !1; - return i.isInBrowser && function(t) { - (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( - t - ) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test( - t.substr(0, 4) - )) && (e = !0); - }(navigator.userAgent || navigator.vendor || window.opera), e; - } -} -export { - o as BasePathTypeEnum, - i as BrowserUtil, - v as DeviceDetection, - p as DeviceTypeEnum, - w as SiyuanDevice -}; diff --git a/public/libs/zhi-device/lib/basePathTypeEnum.d.ts b/public/libs/zhi-device/lib/basePathTypeEnum.d.ts deleted file mode 100644 index 1dadc09b..00000000 --- a/public/libs/zhi-device/lib/basePathTypeEnum.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 基本路径枚举 - * - * @public - * @author terwer - * @version 0.1.0 - * @since 0.1.0 - */ -declare enum BasePathTypeEnum { - /** - * Appearance - */ - BasePathType_Appearance = "Appearance", - /** - * Data - */ - BasePathType_Data = "Data", - /** - * Themes - */ - BasePathType_Themes = "Themes", - /** - * Zhi 主题目录 - */ - BasePathType_ZhiTheme = "ZhiTheme", - /** - * 未设置 - */ - BasePathType_None = "None" -} -export default BasePathTypeEnum; diff --git a/public/libs/zhi-device/lib/browserUtil.d.ts b/public/libs/zhi-device/lib/browserUtil.d.ts deleted file mode 100644 index e268f3b0..00000000 --- a/public/libs/zhi-device/lib/browserUtil.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * 浏览器工具类 - * - * @public - * @author terwer - * @since 1.0.2 - */ -declare class BrowserUtil { - /** - * 是否在浏览器环境 - */ - static isNode: boolean; - /** - * 是否在浏览器环境 - */ - static isInBrowser: boolean; - /** - * 浏览器路径分隔符 - */ - static BrowserSeperator: string; - /** - * 是否是Electron环境 - */ - static isElectron: () => boolean; - /** - * 是否有Node环境,目前包括 Electron 和 Node - */ - static hasNodeEnv: () => boolean; - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension(): boolean; - /** - * 获取url参数 - * - * @param sParam - 参数 - */ - static getQueryString: (sParam: string) => string; - /** - * 替换 URL 的参数 - * 思路: - * 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 - * - * 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 - * - * 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 - * - * 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 - * - * 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 - * - * @param url - 链接地址 - * @param paramName - 参数名 - * @param paramValue - 参数值 - */ - static replaceUrlParam: (url: string, paramName: string, paramValue: string) => string; - /** - * 设置url参数 - * - * @param urlstring - url - * @param key - key - * @param value - value - */ - static setUrlParameter: (urlstring: string, key: string, value: string) => string; - /** - * 重新加载指定tab - * - * @param tabname - tabname - * @param t - 延迟时间 - */ - static reloadTabPage: (tabname: string, t?: number) => void; - /** - * 刷新当前tab页面 - */ - static reloadPage: () => void; - /** - * 刷新当前tab页面 - * - * @param msg - 消息提示 - * @param cb - 回调 - */ - static reloadPageWithMessageCallback: (msg: string, cb: any) => void; -} -export default BrowserUtil; diff --git a/public/libs/zhi-device/lib/deviceTypeEnum.d.ts b/public/libs/zhi-device/lib/deviceTypeEnum.d.ts deleted file mode 100644 index ffdc9c3c..00000000 --- a/public/libs/zhi-device/lib/deviceTypeEnum.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 设备类型枚举 - * - * @public - * @author terwer - * @since 1.0.8 - */ -declare enum DeviceTypeEnum { - /** - * 移动端 - */ - DeviceType_Mobile_Device = "Mobile", - /** - * 思源笔记挂件 - */ - DeviceType_Siyuan_Widget = "Siyuan_Widget", - /** - * 思源笔记新窗口 - */ - DeviceType_Siyuan_NewWin = "Siyuan_NewWindow", - /** - * 思源笔记主窗口 - */ - DeviceType_Siyuan_MainWin = "Siyuan_MainWindow", - /** - * 思源打开的浏览器 - */ - DeviceType_Siyuan_Browser = "Siyuan_Browser", - /** - * Google Chrome浏览器插件 - */ - DeviceType_Chrome_Extension = "Chrome_Extension", - /** - * Google Chrome浏览器(Docker浏览器共用) - */ - DeviceType_Chrome_Browser = "Chrome_Browser", - /** - * Node环境 - */ - DeviceType_Node = "Node" -} -export default DeviceTypeEnum; diff --git a/public/libs/zhi-device/lib/siyuanDevice.d.ts b/public/libs/zhi-device/lib/siyuanDevice.d.ts deleted file mode 100644 index c4e7ea56..00000000 --- a/public/libs/zhi-device/lib/siyuanDevice.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -import BasePathTypeEnum from "./basePathTypeEnum"; -/** - * 思源笔记设备相关 - * - * @public - * @author terwer - * @version 0.1.0 - * @since 0.1.0 - */ -declare class SiyuanDevice { - /** - * 思源笔记iframe挂件环境 - */ - static isInSiyuanWidget: () => boolean; - /** - * 思源笔记新窗口 - * - * @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 - * @author terwer - * @version 0.1.0 - * @since 0.0.1 - */ - static isInSiyuanNewWin: () => boolean; - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser(): boolean; - /** - * 思源笔记 window 对象 - */ - static siyuanWindow(): any; - /** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ - static requireLib: (libpath: string, abs?: boolean, type?: BasePathTypeEnum) => any; - /** - * 引入依赖,以 data 的基本路径为准 - * - * @param libpath - 相对于 appearance 的相对路径 - */ - static requireAppearanceLib: (libpath: string) => any; - /** - * 引入依赖,以 data 的基本路径为准 - * - * @param libpath - 相对于 data 的相对路径 - */ - static requireDataLib: (libpath: string) => any; - /** - * 引入依赖,以 theme 的基本路径为准 - * - * @param libpath - 相对于 theme 的相对路径 - */ - static requireThemesLib: (libpath: string) => any; - /** - * 引入依赖,以 ZhiTheme 的基本路径为准 - * - * @param libpath - 相对于 ZhiTheme 的相对路径 - */ - static requireZhiThemeLib: (libpath: string) => any; - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static importJs(jsPath: string, type: BasePathTypeEnum): Promise; - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static importZhiThemeJs(jsPath: string): Promise; - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...paths: string[]): string; - static browserJoinPath(...paths: string[]): string; - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath(): any; - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath(): any; - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath(): string; - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath(): string; - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath(): string; - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath(): string; - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath(): string; - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath(): string; - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath(): string; -} -export default SiyuanDevice; diff --git a/public/libs/zhi-device/package.json b/public/libs/zhi-device/package.json deleted file mode 100644 index de8a42c1..00000000 --- a/public/libs/zhi-device/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "zhi-device", - "version": "0.7.2", - "type": "module", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "description": "auto check environment whether in browser, browser extension, electron, node and more", - "repository": "terwer/zhi", - "homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-device", - "author": "terwer", - "license": "GPL", - "files": [ - "dist", - "README.md" - ], - "keywords": [ - "zhi", - "device", - "browser", - "node", - "electron" - ], - "scripts": { - "serve": "vite", - "dev": "vite build --watch", - "build": "vite build", - "start": "vite preview", - "test": "vitest --watch" - }, - "devDependencies": { - "@terwer/eslint-config-custom": "workspace:*", - "@terwer/tsconfig": "workspace:*", - "@terwer/vite-config-custom": "workspace:*" - } -} diff --git a/public/libs/zhi-electron/README.md b/public/libs/zhi-electron/README.md deleted file mode 100644 index d306e04b..00000000 --- a/public/libs/zhi-electron/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# zhi-electron -a simple api for electron - -## Usage - -```js -// siyuan condole -zhiWindow.openBrowserWindow("https://www.baidu.com") -``` \ No newline at end of file diff --git a/public/libs/zhi-electron/index.js b/public/libs/zhi-electron/index.js deleted file mode 100644 index e69792cb..00000000 --- a/public/libs/zhi-electron/index.js +++ /dev/null @@ -1,516 +0,0 @@ -var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { - get: (a, b) => (typeof require !== "undefined" ? require : a)[b] -}) : x)(function(x) { - if (typeof require !== "undefined") - return require.apply(this, arguments); - throw new Error('Dynamic require of "' + x + '" is not supported'); -}); - -// ../zhi-device/dist/index.js -var g = Object.defineProperty; -var P = (a, e, t) => e in a ? g(a, e, { enumerable: true, configurable: true, writable: true, value: t }) : a[e] = t; -var r = (a, e, t) => (P(a, typeof e != "symbol" ? e + "" : e, t), t); -var u = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return u.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : false; - } -}; -var i = u; -r(i, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -r(i, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -r(i, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -r(i, "isElectron", () => !u.isInBrowser || !window.navigator || !window.navigator.userAgent ? false : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -r(i, "hasNodeEnv", () => u.isElectron() || u.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -r(i, "getQueryString", (e) => { - if (!u.isInBrowser) - return ""; - const n = window.location.search.substring(1).split("&"); - for (let s = 0; s < n.length; s++) { - const c = n[s].split("="); - if (c[0] === e) - return c[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -r(i, "replaceUrlParam", (e, t, n) => { - n == null && (n = ""); - const s = new RegExp("\\b(" + t + "=).*?(&|#|$)"); - if (e.search(s) >= 0) - return e.replace(s, "$1" + n + "$2"); - const [c, d] = e.split("#"), [y, b] = c.split("?"), l = new URLSearchParams(b); - l.set(t, n); - const m = l.toString(), f = y + (m ? "?" + m : ""); - return d ? f + "#" + d : f; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -r(i, "setUrlParameter", (e, t, n) => { - if (e.includes(t)) - return u.replaceUrlParam(e, t, n); - const s = e.split("#"); - let c = s[0]; - const d = s[1]; - return c.includes("?") ? c += `&${t}=${n}` : c += `?${t}=${n}`, d && (c += "#" + d), c; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -r(i, "reloadTabPage", (e, t = 200) => { - setTimeout(function() { - if (u.isInBrowser) { - const n = window.location.href; - window.location.href = u.setUrlParameter(n, "tab", e); - } - }, t); -}), /** -* 刷新当前tab页面 -*/ -r(i, "reloadPage", () => { - setTimeout(function() { - u.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -r(i, "reloadPageWithMessageCallback", (e, t) => { - t && t(e), setTimeout(function() { - u.isInBrowser && window.location.reload(); - }, 200); -}); -var o = /* @__PURE__ */ ((a) => (a.BasePathType_Appearance = "Appearance", a.BasePathType_Data = "Data", a.BasePathType_Themes = "Themes", a.BasePathType_ZhiTheme = "ZhiTheme", a.BasePathType_None = "None", a))(o || {}); -var h = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return i.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : false; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, t) { - let n = e; - switch (t) { - case o.BasePathType_Appearance: - n = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case o.BasePathType_Data: - n = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case o.BasePathType_Themes: - n = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case o.BasePathType_ZhiTheme: - n = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: s } = await import( - /* @vite-ignore */ - n - ); - return s; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, o.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (i.hasNodeEnv()) { - const t = this.requireLib("path"); - if (t) - return t.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(i.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (i.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -var w = h; -r(w, "isInSiyuanWidget", () => i.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : false), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -r(w, "isInSiyuanNewWin", () => !i.isInBrowser || !i.isElectron() ? false : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -r(w, "requireLib", (e, t = true, n = o.BasePathType_None) => { - if (!i.hasNodeEnv()) - throw new Error("require ony works on node env"); - let s = e; - if (!t) - switch (n) { - case o.BasePathType_Appearance: - s = h.joinPath(h.siyuanAppearancePath(), e); - break; - case o.BasePathType_Data: - s = h.joinPath(h.siyuanDataPath(), e); - break; - case o.BasePathType_Themes: - s = h.joinPath(h.siyuanAppearancePath(), "themes", e); - break; - case o.BasePathType_ZhiTheme: - s = h.joinPath(h.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const c = h.siyuanWindow(); - if (!c) - return __require(s); - if (typeof c.require < "u") - return c.require(s); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -r(w, "requireAppearanceLib", (e) => h.requireLib(e, false, o.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -r(w, "requireDataLib", (e) => h.requireLib(e, false, o.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -r(w, "requireThemesLib", (e) => h.requireLib(e, false, o.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -r(w, "requireZhiThemeLib", (e) => h.requireLib(e, false, o.BasePathType_ZhiTheme)); - -// src/lib/browser-window/WindowManager.ts -var WindowManager = class { - logger; - common; - init(logger, common) { - this.logger = logger; - this.common = common; - } - /** - * 打开新窗口 - * - * 示例: - * - * ``` - * ## development - * windowManager.openBrowserWindow("https://www.baidu.com", undefined, undefined, true, false) - * windowManager.openBrowserWindow("https://www.baidu.com", { "key1": "value1", "key2": "value2" }, undefined, true, false) - * - * ## production - * windowManager.openBrowserWindow("https://www.baidu.com") - * ``` - * - * @param url - url - * @param params - 参数 - * @param win - 父窗口 - * @param isDev - 是否打开开发者工具 - * @param modal - 是否模态 - */ - openBrowserWindow(url, params, win, isDev = false, modal = false) { - try { - if (this.common.strUtil.isEmptyString(url)) { - this.logger.error("Url cannot be empty"); - return; - } - if (!i.isElectron()) { - this.logger.info("BrowserWindow can ony be available in siyuan Electron environment"); - return; - } - if (params) { - Object.keys(params).forEach((key) => { - const value = params[key]; - url = i.setUrlParameter(url, key, value); - }); - } - this.logger.info(this.common.strUtil.f("Opening a new BrowserWindow from url => {0}", url)); - const mainWin = win ?? w.siyuanWindow(); - const { app, BrowserWindow, getCurrentWindow } = mainWin.require("@electron/remote"); - const remote = mainWin.require("@electron/remote").require("@electron/remote/main"); - const mainWindow = getCurrentWindow(); - const newWindow = new BrowserWindow({ - parent: mainWindow, - width: 900, - height: 750, - resizable: true, - modal, - icon: w.browserJoinPath( - w.siyuanWindow().siyuan.config.system.appDir, - "stage", - "icon-large.png" - ), - titleBarOverlay: { - color: "#cccccca5", - symbolColor: "black" - }, - webPreferences: { - nativeWindowOpen: true, - nodeIntegration: true, - webviewTag: true, - webSecurity: false, - contextIsolation: false - } - }); - newWindow.webContents.userAgent = `SiYuan/${app.getVersion()} https://b3log.org/siyuan Electron`; - remote.enable(newWindow.webContents); - if (isDev) { - newWindow.webContents.openDevTools(); - } - newWindow.loadURL(url); - } catch (e) { - this.logger.error("Open browser window failed", e); - } - } -}; -var WindowManager_default = WindowManager; - -// src/lib/browser-window/index.ts -var ZhiBrowserWindow = class { - logger; - windowManager; - constructor() { - this.windowManager = new WindowManager_default(); - } - init(logger, common) { - this.logger = logger; - this.windowManager.init(logger, common); - } - /** - * 挂载 BrowserWindow - * - * @author terwer - * @since 1.0.0 - */ - initBrowserWindow() { - w.siyuanWindow().zhiWindow = this.windowManager; - this.logger.info("zhiWindow mounted"); - } -}; -var browser_window_default = ZhiBrowserWindow; -export { - browser_window_default as ZhiBrowserWindow -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vemhpLWZyYW1ld29yay96aGkvbGlicy96aGktZGV2aWNlL2Rpc3QvaW5kZXguanMiLCAiLi4vLi4vLi4vLi4vLi4vemhpLWZyYW1ld29yay96aGkvbGlicy96aGktZWxlY3Ryb24vc3JjL2xpYi9icm93c2VyLXdpbmRvdy9XaW5kb3dNYW5hZ2VyLnRzIiwgIi4uLy4uLy4uLy4uLy4uL3poaS1mcmFtZXdvcmsvemhpL2xpYnMvemhpLWVsZWN0cm9uL3NyYy9saWIvYnJvd3Nlci13aW5kb3cvaW5kZXgudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbInZhciBnID0gT2JqZWN0LmRlZmluZVByb3BlcnR5O1xudmFyIFAgPSAoYSwgZSwgdCkgPT4gZSBpbiBhID8gZyhhLCBlLCB7IGVudW1lcmFibGU6ICEwLCBjb25maWd1cmFibGU6ICEwLCB3cml0YWJsZTogITAsIHZhbHVlOiB0IH0pIDogYVtlXSA9IHQ7XG52YXIgciA9IChhLCBlLCB0KSA9PiAoUChhLCB0eXBlb2YgZSAhPSBcInN5bWJvbFwiID8gZSArIFwiXCIgOiBlLCB0KSwgdCk7XG5jb25zdCB1ID0gY2xhc3Mge1xuICAvKipcbiAgICogXHU2OEMwXHU2RDRCXHU2NjJGXHU1NDI2XHU4RkQwXHU4ODRDXHU1NzI4Q2hyb21lXHU2M0QyXHU0RUY2XHU0RTJEXG4gICAqL1xuICBzdGF0aWMgaXNJbkNocm9tZUV4dGVuc2lvbigpIHtcbiAgICByZXR1cm4gdS5pc0luQnJvd3NlciA/IHdpbmRvdy5sb2NhdGlvbi5ocmVmLmluZGV4T2YoXCJjaHJvbWUtZXh0ZW5zaW9uOi8vXCIpID4gLTEgOiAhMTtcbiAgfVxufTtcbmxldCBpID0gdTtcbi8qKlxuICogXHU2NjJGXHU1NDI2XHU1NzI4XHU2RDRGXHU4OUM4XHU1NjY4XHU3M0FGXHU1ODgzXG4gKi9cbnIoaSwgXCJpc05vZGVcIiwgdHlwZW9mIHByb2Nlc3MgPCBcInVcIiksIC8qKlxuICogXHU2NjJGXHU1NDI2XHU1NzI4XHU2RDRGXHU4OUM4XHU1NjY4XHU3M0FGXHU1ODgzXG4gKi9cbnIoaSwgXCJpc0luQnJvd3NlclwiLCB0eXBlb2Ygd2luZG93IDwgXCJ1XCIpLCAvKipcbiAqIFx1NkQ0Rlx1ODlDOFx1NTY2OFx1OERFRlx1NUY4NFx1NTIwNlx1OTY5NFx1N0IyNlxuICovXG5yKGksIFwiQnJvd3NlclNlcGVyYXRvclwiLCBcIi9cIiksIC8qKlxuICogXHU2NjJGXHU1NDI2XHU2NjJGRWxlY3Ryb25cdTczQUZcdTU4ODNcbiAqL1xucihpLCBcImlzRWxlY3Ryb25cIiwgKCkgPT4gIXUuaXNJbkJyb3dzZXIgfHwgIXdpbmRvdy5uYXZpZ2F0b3IgfHwgIXdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50ID8gITEgOiAvRWxlY3Ryb24vLnRlc3Qod2luZG93Lm5hdmlnYXRvci51c2VyQWdlbnQpKSwgLyoqXG4gKiBcdTY2MkZcdTU0MjZcdTY3MDlOb2RlXHU3M0FGXHU1ODgzXHVGRjBDXHU3NkVFXHU1MjREXHU1MzA1XHU2MkVDIEVsZWN0cm9uIFx1NTQ4QyBOb2RlXG4gKi9cbnIoaSwgXCJoYXNOb2RlRW52XCIsICgpID0+IHUuaXNFbGVjdHJvbigpIHx8IHUuaXNOb2RlKSwgLyoqXG4gKiBcdTgzQjdcdTUzRDZ1cmxcdTUzQzJcdTY1NzBcbiAqXG4gKiBAcGFyYW0gc1BhcmFtIC0gXHU1M0MyXHU2NTcwXG4gKi9cbnIoaSwgXCJnZXRRdWVyeVN0cmluZ1wiLCAoZSkgPT4ge1xuICBpZiAoIXUuaXNJbkJyb3dzZXIpXG4gICAgcmV0dXJuIFwiXCI7XG4gIGNvbnN0IG4gPSB3aW5kb3cubG9jYXRpb24uc2VhcmNoLnN1YnN0cmluZygxKS5zcGxpdChcIiZcIik7XG4gIGZvciAobGV0IHMgPSAwOyBzIDwgbi5sZW5ndGg7IHMrKykge1xuICAgIGNvbnN0IGMgPSBuW3NdLnNwbGl0KFwiPVwiKTtcbiAgICBpZiAoY1swXSA9PT0gZSlcbiAgICAgIHJldHVybiBjWzFdO1xuICB9XG4gIHJldHVybiBcIlwiO1xufSksIC8qKlxuICogXHU2NkZGXHU2MzYyIFVSTCBcdTc2ODRcdTUzQzJcdTY1NzBcbiAqIFx1NjAxRFx1OERFRlx1RkYxQVxuICogMS4gXHU0RjdGXHU3NTI4XHU0RTg2IFVSTFNlYXJjaFBhcmFtcyBcdTVCRjlcdThDNjFcdTY3NjVcdTg5RTNcdTY3OTBcdTU0OENcdTY3ODRcdTVFRkEgVVJMIFx1NjdFNVx1OEJFMlx1NTNDMlx1NjU3MFx1MzAwMlxuICpcbiAqIDIuIFx1NTcyOFx1NTkwNFx1NzQwNlx1NTMwNVx1NTQyQiBoYXNoIFx1NzI0N1x1NkJCNVx1NzY4NCBVUkwgXHU2NUY2XHU0RjdGXHU3NTI4XHU0RTg2IHNwbGl0IFx1NTFGRFx1NjU3MFx1NUMwNiBVUkwgXHU1MjA2XHU2MjEwXHU0RTI0XHU5MEU4XHU1MjA2XHVGRjFBXHU1N0ZBXHU2NzJDIFVSTCBcdTU0OEMgaGFzaCBcdTcyNDdcdTZCQjVcdTMwMDJcbiAqXG4gKiAzLiBcdTcxMzZcdTU0MEVcdUZGMENcdTUxOERcdTZCMjFcdTRGN0ZcdTc1Mjggc3BsaXQgXHU1MUZEXHU2NTcwXHU1QzA2XHU1N0ZBXHU2NzJDIFVSTCBcdTUyMDZcdTYyMTBcdTRFMjRcdTkwRThcdTUyMDZcdUZGMUFcdThERUZcdTVGODRcdTU0OENcdTY3RTVcdThCRTJcdTUzQzJcdTY1NzBcdTMwMDJcbiAqXG4gKiA0LiBcdTVDMDZcdTY3RTVcdThCRTJcdTUzQzJcdTY1NzBcdThGNkNcdTYzNjJcdTRFM0EgVVJMU2VhcmNoUGFyYW1zIFx1NUJGOVx1OEM2MVx1RkYwQ1x1NzEzNlx1NTQwRVx1OEJCRVx1N0Y2RVx1NjMwN1x1NUI5QVx1NzY4NFx1NTNDMlx1NjU3MFx1NTQwRFx1NTQ4Q1x1NTAzQ1x1MzAwMlxuICpcbiAqIDUuIFx1NjcwMFx1NTQwRVx1RkYwQ1x1NEY3Rlx1NzUyOCB0b1N0cmluZyBcdTUxRkRcdTY1NzBcdTVDMDZcdTY3RTVcdThCRTJcdTUzQzJcdTY1NzBcdThGNkNcdTYzNjJcdTRFM0FcdTVCNTdcdTdCMjZcdTRFMzJcdUZGMENcdTVFNzZcdTVDMDZcdTUxNzZcdTRFMEVcdThERUZcdTVGODRcdTdFQzRcdTU0MDhcdTYyMTBcdTY1QjBcdTc2ODRcdTU3RkFcdTY3MkMgVVJMXHUzMDAyXHU1OTgyXHU2NzlDIFVSTCBcdTUzMDVcdTU0MkIgaGFzaCBcdTcyNDdcdTZCQjVcdUZGMENcdTUyMTlcdTVDMDZcdTUxNzZcdTZERkJcdTUyQTBcdTUyMzBcdTY1QjBcdTc2ODRcdTU3RkFcdTY3MkMgVVJMIFx1NEUyRFx1MzAwMlxuICpcbiAqIEBwYXJhbSB1cmwgLSBcdTk0RkVcdTYzQTVcdTU3MzBcdTU3NDBcbiAqIEBwYXJhbSBwYXJhbU5hbWUgLSBcdTUzQzJcdTY1NzBcdTU0MERcbiAqIEBwYXJhbSBwYXJhbVZhbHVlIC0gXHU1M0MyXHU2NTcwXHU1MDNDXG4gKi9cbnIoaSwgXCJyZXBsYWNlVXJsUGFyYW1cIiwgKGUsIHQsIG4pID0+IHtcbiAgbiA9PSBudWxsICYmIChuID0gXCJcIik7XG4gIGNvbnN0IHMgPSBuZXcgUmVnRXhwKFwiXFxcXGIoXCIgKyB0ICsgXCI9KS4qPygmfCN8JClcIik7XG4gIGlmIChlLnNlYXJjaChzKSA+PSAwKVxuICAgIHJldHVybiBlLnJlcGxhY2UocywgXCIkMVwiICsgbiArIFwiJDJcIik7XG4gIGNvbnN0IFtjLCBkXSA9IGUuc3BsaXQoXCIjXCIpLCBbeSwgYl0gPSBjLnNwbGl0KFwiP1wiKSwgbCA9IG5ldyBVUkxTZWFyY2hQYXJhbXMoYik7XG4gIGwuc2V0KHQsIG4pO1xuICBjb25zdCBtID0gbC50b1N0cmluZygpLCBmID0geSArIChtID8gXCI/XCIgKyBtIDogXCJcIik7XG4gIHJldHVybiBkID8gZiArIFwiI1wiICsgZCA6IGY7XG59KSwgLyoqXG4gKiBcdThCQkVcdTdGNkV1cmxcdTUzQzJcdTY1NzBcbiAqXG4gKiBAcGFyYW0gdXJsc3RyaW5nIC0gdXJsXG4gKiBAcGFyYW0ga2V5IC0ga2V5XG4gKiBAcGFyYW0gdmFsdWUgLSB2YWx1ZVxuICovXG5yKGksIFwic2V0VXJsUGFyYW1ldGVyXCIsIChlLCB0LCBuKSA9PiB7XG4gIGlmIChlLmluY2x1ZGVzKHQpKVxuICAgIHJldHVybiB1LnJlcGxhY2VVcmxQYXJhbShlLCB0LCBuKTtcbiAgY29uc3QgcyA9IGUuc3BsaXQoXCIjXCIpO1xuICBsZXQgYyA9IHNbMF07XG4gIGNvbnN0IGQgPSBzWzFdO1xuICByZXR1cm4gYy5pbmNsdWRlcyhcIj9cIikgPyBjICs9IGAmJHt0fT0ke259YCA6IGMgKz0gYD8ke3R9PSR7bn1gLCBkICYmIChjICs9IFwiI1wiICsgZCksIGM7XG59KSwgLyoqXG4gKiBcdTkxQ0RcdTY1QjBcdTUyQTBcdThGN0RcdTYzMDdcdTVCOUF0YWJcbiAqXG4gKiBAcGFyYW0gdGFibmFtZSAtIHRhYm5hbWVcbiAqIEBwYXJhbSB0IC0gXHU1RUY2XHU4RkRGXHU2NUY2XHU5NUY0XG4gKi9cbnIoaSwgXCJyZWxvYWRUYWJQYWdlXCIsIChlLCB0ID0gMjAwKSA9PiB7XG4gIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgaWYgKHUuaXNJbkJyb3dzZXIpIHtcbiAgICAgIGNvbnN0IG4gPSB3aW5kb3cubG9jYXRpb24uaHJlZjtcbiAgICAgIHdpbmRvdy5sb2NhdGlvbi5ocmVmID0gdS5zZXRVcmxQYXJhbWV0ZXIobiwgXCJ0YWJcIiwgZSk7XG4gICAgfVxuICB9LCB0KTtcbn0pLCAvKipcbiAqIFx1NTIzN1x1NjVCMFx1NUY1M1x1NTI0RHRhYlx1OTg3NVx1OTc2MlxuICovXG5yKGksIFwicmVsb2FkUGFnZVwiLCAoKSA9PiB7XG4gIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgdS5pc0luQnJvd3NlciAmJiB3aW5kb3cubG9jYXRpb24ucmVsb2FkKCk7XG4gIH0sIDIwMCk7XG59KSwgLyoqXG4gKiBcdTUyMzdcdTY1QjBcdTVGNTNcdTUyNER0YWJcdTk4NzVcdTk3NjJcbiAqXG4gKiBAcGFyYW0gbXNnIC0gXHU2RDg4XHU2MDZGXHU2M0QwXHU3OTNBXG4gKiBAcGFyYW0gY2IgLSBcdTU2REVcdThDMDNcbiAqL1xucihpLCBcInJlbG9hZFBhZ2VXaXRoTWVzc2FnZUNhbGxiYWNrXCIsIChlLCB0KSA9PiB7XG4gIHQgJiYgdChlKSwgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICB1LmlzSW5Ccm93c2VyICYmIHdpbmRvdy5sb2NhdGlvbi5yZWxvYWQoKTtcbiAgfSwgMjAwKTtcbn0pO1xudmFyIG8gPSAvKiBAX19QVVJFX18gKi8gKChhKSA9PiAoYS5CYXNlUGF0aFR5cGVfQXBwZWFyYW5jZSA9IFwiQXBwZWFyYW5jZVwiLCBhLkJhc2VQYXRoVHlwZV9EYXRhID0gXCJEYXRhXCIsIGEuQmFzZVBhdGhUeXBlX1RoZW1lcyA9IFwiVGhlbWVzXCIsIGEuQmFzZVBhdGhUeXBlX1poaVRoZW1lID0gXCJaaGlUaGVtZVwiLCBhLkJhc2VQYXRoVHlwZV9Ob25lID0gXCJOb25lXCIsIGEpKShvIHx8IHt9KTtcbmNvbnN0IGggPSBjbGFzcyB7XG4gIC8qKlxuICAgKiBcdTY4QzBcdTZENEJcdTY2MkZcdTU0MjZcdThGRDBcdTg4NENcdTU3MjhcdTYwMURcdTZFOTBcdTYyNTNcdTVGMDBcdTc2ODRcdTZENEZcdTg5QzhcdTU2NjhcdTRFMkRcbiAgICovXG4gIHN0YXRpYyBpc0luU2l5dWFuQnJvd3NlcigpIHtcbiAgICByZXR1cm4gaS5pc0luQnJvd3NlciA/IHR5cGVvZiB3aW5kb3cuc2l5dWFuIDwgXCJ1XCIgJiYgdHlwZW9mIHdpbmRvdy5MdXRlIDwgXCJ1XCIgOiAhMTtcbiAgfVxuICAvKipcbiAgICogXHU2MDFEXHU2RTkwXHU3QjE0XHU4QkIwIHdpbmRvdyBcdTVCRjlcdThDNjFcbiAgICovXG4gIHN0YXRpYyBzaXl1YW5XaW5kb3coKSB7XG4gICAgbGV0IGU7XG4gICAgcmV0dXJuIHRoaXMuaXNJblNpeXVhbldpZGdldCgpID8gZSA9IHBhcmVudC53aW5kb3cgOiB0aGlzLmlzSW5TaXl1YW5OZXdXaW4oKSB8fCB0aGlzLmlzSW5TaXl1YW5Ccm93c2VyKCkgfHwgdHlwZW9mIHdpbmRvdyA8IFwidVwiID8gZSA9IHdpbmRvdyA6IGUgPSB2b2lkIDAsIGU7XG4gIH1cbiAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PVxuICAvLyByZXF1aXJlIGVuZFxuICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09XG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgLy8gaW1wb3J0IHN0YXJ0XG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgLyoqXG4gICAqIFx1NUYxNVx1NTE2NWpzb25cbiAgICpcbiAgICogQHBhcmFtIGpzUGF0aCAtIGpzXHU3NkY4XHU1QkY5XHU4REVGXHU1Rjg0XHU1MTY4XHU4REVGXHU1Rjg0XG4gICAqIEBwYXJhbSB0eXBlIC0gXHU3QzdCXHU1NzhCXG4gICAqL1xuICBzdGF0aWMgYXN5bmMgaW1wb3J0SnMoZSwgdCkge1xuICAgIGxldCBuID0gZTtcbiAgICBzd2l0Y2ggKHQpIHtcbiAgICAgIGNhc2Ugby5CYXNlUGF0aFR5cGVfQXBwZWFyYW5jZTpcbiAgICAgICAgbiA9IHRoaXMuYnJvd3NlckpvaW5QYXRoKHRoaXMuc2l5dWFuQXBwZWFyYW5jZVJlbGF0aXZlUGF0aCgpLCBlKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIG8uQmFzZVBhdGhUeXBlX0RhdGE6XG4gICAgICAgIG4gPSB0aGlzLmJyb3dzZXJKb2luUGF0aCh0aGlzLnNpeXVhbkRhdGFSZWxhdGl2ZVBhdGgoKSwgZSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvLkJhc2VQYXRoVHlwZV9UaGVtZXM6XG4gICAgICAgIG4gPSB0aGlzLmJyb3dzZXJKb2luUGF0aCh0aGlzLnNpeXVhblRoZW1lUmVsYXRpdmVQYXRoKCksIGUpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2Ugby5CYXNlUGF0aFR5cGVfWmhpVGhlbWU6XG4gICAgICAgIG4gPSB0aGlzLmJyb3dzZXJKb2luUGF0aCh0aGlzLnpoaVRoZW1lUmVsYXRpdmVQYXRoKCksIGUpO1xuICAgICAgICBicmVhaztcbiAgICAgIGRlZmF1bHQ6XG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcInR5cGUgbXVzdCBiZSBwcm92aWRlZFwiKTtcbiAgICB9XG4gICAgY29uc3QgeyBkZWZhdWx0OiBzIH0gPSBhd2FpdCBpbXBvcnQoXG4gICAgICAvKiBAdml0ZS1pZ25vcmUgKi9cbiAgICAgIG5cbiAgICApO1xuICAgIHJldHVybiBzO1xuICB9XG4gIC8qKlxuICAgKiBcdTVGMTVcdTUxNjVqc29uXG4gICAqXG4gICAqIEBwYXJhbSBqc29uUGF0aCAtIGpzb25cdTc2RjhcdTVCRjlcdThERUZcdTVGODRcdTUxNjhcdThERUZcdTVGODRcbiAgICogQHBhcmFtIHR5cGUgLSBcdTdDN0JcdTU3OEJcbiAgICovXG4gIC8vIHB1YmxpYyBzdGF0aWMgYXN5bmMgaW1wb3J0SnNvbihqc29uUGF0aDogc3RyaW5nLCB0eXBlOiBCYXNlUGF0aFR5cGVFbnVtKSB7XG4gIC8vICAgbGV0IGZ1bGxKc29uUGF0aCA9IGpzb25QYXRoXG4gIC8vICAgc3dpdGNoICh0eXBlKSB7XG4gIC8vICAgICBjYXNlIEJhc2VQYXRoVHlwZUVudW0uQmFzZVBhdGhUeXBlX0FwcGVhcmFuY2U6XG4gIC8vICAgICAgIGZ1bGxKc29uUGF0aCA9IHRoaXMuYnJvd3NlckpvaW5QYXRoKHRoaXMuc2l5dWFuQXBwZWFyYW5jZVJlbGF0aXZlUGF0aCgpLCBqc29uUGF0aClcbiAgLy8gICAgICAgYnJlYWtcbiAgLy8gICAgIGNhc2UgQmFzZVBhdGhUeXBlRW51bS5CYXNlUGF0aFR5cGVfRGF0YTpcbiAgLy8gICAgICAgZnVsbEpzb25QYXRoID0gdGhpcy5icm93c2VySm9pblBhdGgodGhpcy5zaXl1YW5EYXRhUmVsYXRpdmVQYXRoKCksIGpzb25QYXRoKVxuICAvLyAgICAgICBicmVha1xuICAvLyAgICAgY2FzZSBCYXNlUGF0aFR5cGVFbnVtLkJhc2VQYXRoVHlwZV9UaGVtZXM6XG4gIC8vICAgICAgIGZ1bGxKc29uUGF0aCA9IHRoaXMuYnJvd3NlckpvaW5QYXRoKHRoaXMuc2l5dWFuVGhlbWVSZWxhdGl2ZVBhdGgoKSwganNvblBhdGgpXG4gIC8vICAgICAgIGJyZWFrXG4gIC8vICAgICBjYXNlIEJhc2VQYXRoVHlwZUVudW0uQmFzZVBhdGhUeXBlX1poaVRoZW1lOlxuICAvLyAgICAgICBmdWxsSnNvblBhdGggPSB0aGlzLmJyb3dzZXJKb2luUGF0aCh0aGlzLnpoaVRoZW1lUmVsYXRpdmVQYXRoKCksIGpzb25QYXRoKVxuICAvLyAgICAgICBicmVha1xuICAvLyAgICAgZGVmYXVsdDpcbiAgLy8gICAgICAgdGhyb3cgbmV3IEVycm9yKFwidHlwZSBtdXN0IGJlIHByb3ZpZGVkXCIpXG4gIC8vICAgfVxuICAvL1xuICAvLyAgIGNvbnN0IHsgZGVmYXVsdDogZGF0YSB9ID0gYXdhaXQgaW1wb3J0KC8qIEB2aXRlLWlnbm9yZSAqLyBmdWxsSnNvblBhdGgsIHsgYXNzZXJ0OiB7IHR5cGU6IFwianNvblwiIH0gfSlcbiAgLy8gICByZXR1cm4gZGF0YVxuICAvLyB9XG4gIC8qKlxuICAgKiBcdTVGMTVcdTUxNjUganNvbiAtIFx1NEVFNSBkYXRhIFx1NEUzQVx1NTdGQVx1NjcyQ1x1OERFRlx1NUY4NFxuICAgKlxuICAgKiBAcGFyYW0ganNvblBhdGggLSBcdTc2RjhcdTVCRjlcdTRFOEUgZGF0YSBcdTc2ODRcdTc2RjhcdTVCRjlcdThERUZcdTVGODRcbiAgICovXG4gIC8vIHB1YmxpYyBzdGF0aWMgYXN5bmMgaW1wb3J0RGF0YUpzb24oanNvblBhdGg6IHN0cmluZykge1xuICAvLyAgIHJldHVybiBhd2FpdCB0aGlzLmltcG9ydEpzb24oanNvblBhdGgsIEJhc2VQYXRoVHlwZUVudW0uQmFzZVBhdGhUeXBlX0RhdGEpXG4gIC8vIH1cbiAgLyoqXG4gICAqIFx1NUYxNVx1NTE2NSBqc29uIC0gXHU0RUU1IGFwcGVhcmFuY2UgXHU0RTNBXHU1N0ZBXHU2NzJDXHU4REVGXHU1Rjg0XG4gICAqXG4gICAqIEBwYXJhbSBqc29uUGF0aCAtIFx1NzZGOFx1NUJGOVx1NEU4RSBhcHBlYXJhbmNlIFx1NzY4NFx1NzZGOFx1NUJGOVx1OERFRlx1NUY4NFxuICAgKi9cbiAgLy8gcHVibGljIHN0YXRpYyBhc3luYyBpbXBvcnRBcHBlYXJhbmNlSnNvbihqc29uUGF0aDogc3RyaW5nKSB7XG4gIC8vICAgcmV0dXJuIGF3YWl0IHRoaXMuaW1wb3J0SnNvbihqc29uUGF0aCwgQmFzZVBhdGhUeXBlRW51bS5CYXNlUGF0aFR5cGVfQXBwZWFyYW5jZSlcbiAgLy8gfVxuICAvKipcbiAgICogXHU1RjE1XHU1MTY1IGpzb24gLSBcdTRFRTUgdGhlbWVzIFx1NEUzQVx1NTdGQVx1NjcyQ1x1OERFRlx1NUY4NFxuICAgKlxuICAgKiBAcGFyYW0ganNvblBhdGggLSBcdTc2RjhcdTVCRjlcdTRFOEUgdGhlbWVzIFx1NzY4NFx1NzZGOFx1NUJGOVx1OERFRlx1NUY4NFxuICAgKi9cbiAgLy8gcHVibGljIHN0YXRpYyBhc3luYyBpbXBvcnRUaGVtZXNKc29uKGpzb25QYXRoOiBzdHJpbmcpIHtcbiAgLy8gICByZXR1cm4gYXdhaXQgdGhpcy5pbXBvcnRKc29uKGpzb25QYXRoLCBCYXNlUGF0aFR5cGVFbnVtLkJhc2VQYXRoVHlwZV9UaGVtZXMpXG4gIC8vIH1cbiAgLyoqXG4gICAqIFx1NUYxNVx1NTE2NSB6aGkgXHU0RTNCXHU5ODk4XHU3Njg0IGpzb24gLSBcdTRFRTUgemhpIFx1NEUzQlx1OTg5OCBcdTc2ODRcdTY4MzlcdThERUZcdTVGODRcdTRFM0FcdTU3RkFcdTY3MkNcdThERUZcdTVGODRcbiAgICpcbiAgICogQHBhcmFtIGpzb25QYXRoIC0gXHU3NkY4XHU1QkY5XHU0RThFIHpoaSBcdTRFM0JcdTk4OThcdTY4MzlcdThERUZcdTVGODRcdTc2ODRcdTc2RjhcdTVCRjlcdThERUZcdTVGODRcbiAgICovXG4gIC8vIHB1YmxpYyBzdGF0aWMgYXN5bmMgaW1wb3J0WmhpVGhlbWVKc29uKGpzb25QYXRoOiBzdHJpbmcpIHtcbiAgLy8gICByZXR1cm4gYXdhaXQgdGhpcy5pbXBvcnRKc29uKGpzb25QYXRoLCBCYXNlUGF0aFR5cGVFbnVtLkJhc2VQYXRoVHlwZV9aaGlUaGVtZSlcbiAgLy8gfVxuICAvKipcbiAgICogXHU1RjE1XHU1MTY1IHpoaSBcdTRFM0JcdTk4OThcdTc2ODQganMgLSBcdTRFRTUgemhpIFx1NEUzQlx1OTg5OCBcdTc2ODRcdTY4MzlcdThERUZcdTVGODRcdTRFM0FcdTU3RkFcdTY3MkNcdThERUZcdTVGODRcbiAgICpcbiAgICogQHBhcmFtIGpzUGF0aCAtIFx1NzZGOFx1NUJGOVx1NEU4RSB6aGkgXHU0RTNCXHU5ODk4XHU2ODM5XHU4REVGXHU1Rjg0XHU3Njg0XHU3NkY4XHU1QkY5XHU4REVGXHU1Rjg0XG4gICAqL1xuICBzdGF0aWMgYXN5bmMgaW1wb3J0WmhpVGhlbWVKcyhlKSB7XG4gICAgcmV0dXJuIGF3YWl0IHRoaXMuaW1wb3J0SnMoZSwgby5CYXNlUGF0aFR5cGVfWmhpVGhlbWUpO1xuICB9XG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgLy8gaW1wb3J0IHN0YXJ0XG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgLyoqXG4gICAqIFx1OERFRlx1NUY4NFx1NjJGQ1x1NjNBNVxuICAgKlxuICAgKiBAcGFyYW0gcGF0aHMgLSBcdThERUZcdTVGODRcdTY1NzBcdTdFQzRcbiAgICovXG4gIHN0YXRpYyBqb2luUGF0aCguLi5lKSB7XG4gICAgaWYgKGkuaGFzTm9kZUVudigpKSB7XG4gICAgICBjb25zdCB0ID0gdGhpcy5yZXF1aXJlTGliKFwicGF0aFwiKTtcbiAgICAgIGlmICh0KVxuICAgICAgICByZXR1cm4gdC5qb2luKC4uLmUpO1xuICAgIH1cbiAgICByZXR1cm4gdGhpcy5icm93c2VySm9pblBhdGgoLi4uZSk7XG4gIH1cbiAgc3RhdGljIGJyb3dzZXJKb2luUGF0aCguLi5lKSB7XG4gICAgcmV0dXJuIGUuam9pbihpLkJyb3dzZXJTZXBlcmF0b3IpO1xuICB9XG4gIC8qKlxuICAgKiBcdTYwMURcdTZFOTBcdTdCMTRcdThCQjAgY29uZiBcdTc2RUVcdTVGNTVcbiAgICovXG4gIHN0YXRpYyBzaXl1YW5Db25mUGF0aCgpIHtcbiAgICBjb25zdCBlID0gdGhpcy5zaXl1YW5XaW5kb3coKTtcbiAgICBpZiAoIWUpXG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXCJOb3QgaW4gc2l5dWFuIGVudlwiKTtcbiAgICByZXR1cm4gZS5zaXl1YW4uY29uZmlnLnN5c3RlbS5jb25mRGlyO1xuICB9XG4gIC8qKlxuICAgKiBcdTYwMURcdTZFOTBcdTdCMTRcdThCQjAgZGF0YSBcdTc2RUVcdTVGNTVcbiAgICovXG4gIHN0YXRpYyBzaXl1YW5EYXRhUGF0aCgpIHtcbiAgICBjb25zdCBlID0gdGhpcy5zaXl1YW5XaW5kb3coKTtcbiAgICBpZiAoIWUpXG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXCJOb3QgaW4gc2l5dWFuIGVudlwiKTtcbiAgICByZXR1cm4gZS5zaXl1YW4uY29uZmlnLnN5c3RlbS5kYXRhRGlyO1xuICB9XG4gIC8qKlxuICAgKiBcdTYwMURcdTZFOTBcdTdCMTRcdThCQjAgZGF0YSBcdTc2RUVcdTVGNTUtXHU3NkY4XHU1QkY5XHU4REVGXHU1Rjg0XG4gICAqL1xuICBzdGF0aWMgc2l5dWFuRGF0YVJlbGF0aXZlUGF0aCgpIHtcbiAgICBpZiAoIXRoaXMuc2l5dWFuV2luZG93KCkpXG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXCJOb3QgaW4gc2l5dWFuIGVudlwiKTtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxuICAvKipcbiAgICogXHU2MDFEXHU2RTkwXHU3QjE0XHU4QkIwIGFwcGVhcmFuY2UgXHU3NkVFXHU1RjU1XG4gICAqL1xuICBzdGF0aWMgc2l5dWFuQXBwZWFyYW5jZVBhdGgoKSB7XG4gICAgcmV0dXJuIHRoaXMuam9pblBhdGgodGhpcy5zaXl1YW5Db25mUGF0aCgpLCBcImFwcGVhcmFuY2VcIik7XG4gIH1cbiAgLyoqXG4gICAqIFx1NjAxRFx1NkU5MFx1N0IxNFx1OEJCMCBhcHBlYXJhbmNlIFx1NzZFRVx1NUY1NS1cdTc2RjhcdTVCRjlcdThERUZcdTVGODRcbiAgICovXG4gIHN0YXRpYyBzaXl1YW5BcHBlYXJhbmNlUmVsYXRpdmVQYXRoKCkge1xuICAgIGlmICghdGhpcy5zaXl1YW5XaW5kb3coKSlcbiAgICAgIHRocm93IG5ldyBFcnJvcihcIk5vdCBpbiBzaXl1YW4gZW52XCIpO1xuICAgIHJldHVybiB0aGlzLmJyb3dzZXJKb2luUGF0aChcIlwiLCBcImFwcGVhcmFuY2VcIik7XG4gIH1cbiAgLyoqXG4gICAqIFx1NjAxRFx1NkU5MFx1N0IxNFx1OEJCMCB0aGVtZXMgXHU3NkVFXHU1RjU1LVx1N0VERFx1NUJGOVx1OERFRlx1NUY4NFxuICAgKlxuICAgKiBcdTZDRThcdTYxMEY6IFx1NTk4Mlx1Njc5Q1x1NjYyRlx1OTc1RSBlbGVjdHJvbiBcdTU0OEMgTm9kZSBcdTczQUZcdTU4ODNcdUZGMENcdThGRDlcdTkxQ0NcdThGRDRcdTU2REVcdTc2ODRcdTY2MkZcdTZENEZcdTg5QzhcdTU2NjhcdTc2ODRcdThERUZcdTVGODRcdUZGMENcdTRFMERcdTY2MkZcdTcyNjlcdTc0MDZcdThERUZcdTVGODRcbiAgICogXHU1OTgyXHU2NzlDXHU0RjdGXHU3NTI4XHU3MjY5XHU3NDA2XHU4REVGXHU1Rjg0XHVGRjBDXHU4QkY3XHU4QzAzXHU3NTI4IHNpeXVhbkFwcGVhcmFuY2VQYXRoIFx1NjIxNlx1ODAwNSBzaXl1YW5EYXRhUGF0aFxuICAgKlxuICAgKiBAYXV0aG9yIHRlcndlclxuICAgKiBAc2luY2UgMC4xLjBcbiAgICovXG4gIHN0YXRpYyBzaXl1YW5UaGVtZVBhdGgoKSB7XG4gICAgaWYgKGkuaGFzTm9kZUVudigpKVxuICAgICAgcmV0dXJuIHRoaXMuam9pblBhdGgodGhpcy5zaXl1YW5BcHBlYXJhbmNlUGF0aCgpLCBcInRoZW1lc1wiKTtcbiAgICB7XG4gICAgICBjb25zdCBlID0gdGhpcy5zaXl1YW5XaW5kb3coKTtcbiAgICAgIGlmICghZSlcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTm90IGluIHNpeXVhbiBlbnZcIik7XG4gICAgICByZXR1cm4gdGhpcy5qb2luUGF0aChlLmxvY2F0aW9uLm9yaWdpbiwgXCJhcHBlYXJhbmNlXCIsIFwidGhlbWVzXCIpO1xuICAgIH1cbiAgfVxuICAvKipcbiAgICogXHU2MDFEXHU2RTkwXHU3QjE0XHU4QkIwIHRoZW1lcyBcdTc2RUVcdTVGNTUtXHU3NkY4XHU1QkY5XHU4REVGXHU1Rjg0XG4gICAqL1xuICBzdGF0aWMgc2l5dWFuVGhlbWVSZWxhdGl2ZVBhdGgoKSB7XG4gICAgaWYgKCF0aGlzLnNpeXVhbldpbmRvdygpKVxuICAgICAgdGhyb3cgbmV3IEVycm9yKFwiTm90IGluIHNpeXVhbiBlbnZcIik7XG4gICAgcmV0dXJuIHRoaXMuYnJvd3NlckpvaW5QYXRoKFwiXCIsIFwiYXBwZWFyYW5jZVwiLCBcInRoZW1lc1wiKTtcbiAgfVxuICAvKipcbiAgICogemhpIFx1NEUzQlx1OTg5OFx1NzZFRVx1NUY1NSAtIFx1N0VERFx1NUJGOVx1OERFRlx1NUY4NFxuICAgKi9cbiAgc3RhdGljIHpoaVRoZW1lUGF0aCgpIHtcbiAgICByZXR1cm4gdGhpcy5qb2luUGF0aCh0aGlzLnNpeXVhblRoZW1lUGF0aCgpLCBcInpoaVwiKTtcbiAgfVxuICAvKipcbiAgICogemhpIFx1NEUzQlx1OTg5OFx1NzZFRVx1NUY1NSAtIFx1NzZGOFx1NUJGOVx1OERFRlx1NUY4NFxuICAgKi9cbiAgc3RhdGljIHpoaVRoZW1lUmVsYXRpdmVQYXRoKCkge1xuICAgIHJldHVybiB0aGlzLmJyb3dzZXJKb2luUGF0aCh0aGlzLnNpeXVhblRoZW1lUmVsYXRpdmVQYXRoKCksIFwiemhpXCIpO1xuICB9XG59O1xubGV0IHcgPSBoO1xuLyoqXG4gKiBcdTYwMURcdTZFOTBcdTdCMTRcdThCQjBpZnJhbWVcdTYzMDJcdTRFRjZcdTczQUZcdTU4ODNcbiAqL1xucih3LCBcImlzSW5TaXl1YW5XaWRnZXRcIiwgKCkgPT4gaS5pc0luQnJvd3NlciA/IHdpbmRvdy5mcmFtZUVsZW1lbnQgIT0gbnVsbCAmJiB3aW5kb3cuZnJhbWVFbGVtZW50LnBhcmVudEVsZW1lbnQgIT0gbnVsbCAmJiB3aW5kb3cuZnJhbWVFbGVtZW50LnBhcmVudEVsZW1lbnQucGFyZW50RWxlbWVudCAhPSBudWxsICYmIHdpbmRvdy5mcmFtZUVsZW1lbnQucGFyZW50RWxlbWVudC5wYXJlbnRFbGVtZW50LmdldEF0dHJpYnV0ZShcImRhdGEtbm9kZS1pZFwiKSAhPT0gXCJcIiA6ICExKSwgLyoqXG4gKiBcdTYwMURcdTZFOTBcdTdCMTRcdThCQjBcdTY1QjBcdTdBOTdcdTUzRTNcbiAqXG4gKiBAZGVwcmVjYXRlZCB3aW5kb3cudGVyd2VyIFx1NTIyNFx1NjVBRFx1NjVCOVx1NUYwRlx1NURGMlx1NUU5Rlx1NUYwM1x1RkYwQ1x1NUVGQVx1OEJBRVx1NEVFNVx1NTQwRVx1NjI1M1x1NUYwMFx1NjVCMFx1N0E5N1x1NTNFM1x1NkNFOFx1NTE2NSB3aW5kb3cuc2l5dWFuTmV3V2luIFx1RkYwQ1x1OEZEOVx1NjgzN1x1OEJFRFx1NEU0OVx1NEYxQVx1NjZGNFx1NUJCOVx1NjYxM1x1NzQwNlx1ODlFM1xuICogQGF1dGhvciB0ZXJ3ZXJcbiAqIEB2ZXJzaW9uIDAuMS4wXG4gKiBAc2luY2UgMC4wLjFcbiAqL1xucih3LCBcImlzSW5TaXl1YW5OZXdXaW5cIiwgKCkgPT4gIWkuaXNJbkJyb3dzZXIgfHwgIWkuaXNFbGVjdHJvbigpID8gITEgOiB0eXBlb2Ygd2luZG93LnRlcndlciA8IFwidVwiIHx8IHR5cGVvZiB3aW5kb3cuc2l5dWFuTmV3V2luIDwgXCJ1XCIpLCAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyByZXF1aXJlIHN0YXJ0XG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09XG4vKipcbiAqIFx1NUYxNVx1NTE2NVx1NEY5RFx1OEQ1NlxuICpcbiAqIEBwYXJhbSBsaWJwYXRoIC0gXHU0RjlEXHU4RDU2XHU1MTY4XHU4REVGXHU1Rjg0XG4gKiBAcGFyYW0gYWJzIC0gXHU1M0VGXHU5MDA5XHVGRjBDXHU2NjJGXHU1NDI2XHU0RjdGXHU3NTI4XHU4OUM5XHU1Rjk3XHU4REVGXHU1Rjg0XHVGRjBDXHU5RUQ4XHU4QkE0XHU2NjJGIHRydWUgXHVGRjBDIFx1NTQyRlx1NzUyOFx1NEU0Qlx1NTQwRSB0eXBlXHU1M0MyXHU2NTcwXHU2NUUwXHU2NTQ4XG4gKiBAcGFyYW0gdHlwZSAtIFx1NTNFRlx1OTAwOVx1RkYwQ1x1NEVFNVx1OEMwMVx1NzY4NFx1NTdGQVx1NjcyQ1x1OERFRlx1NUY4NFx1NEUzQVx1NTFDNlxuICovXG5yKHcsIFwicmVxdWlyZUxpYlwiLCAoZSwgdCA9ICEwLCBuID0gby5CYXNlUGF0aFR5cGVfTm9uZSkgPT4ge1xuICBpZiAoIWkuaGFzTm9kZUVudigpKVxuICAgIHRocm93IG5ldyBFcnJvcihcInJlcXVpcmUgb255IHdvcmtzIG9uIG5vZGUgZW52XCIpO1xuICBsZXQgcyA9IGU7XG4gIGlmICghdClcbiAgICBzd2l0Y2ggKG4pIHtcbiAgICAgIGNhc2Ugby5CYXNlUGF0aFR5cGVfQXBwZWFyYW5jZTpcbiAgICAgICAgcyA9IGguam9pblBhdGgoaC5zaXl1YW5BcHBlYXJhbmNlUGF0aCgpLCBlKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIG8uQmFzZVBhdGhUeXBlX0RhdGE6XG4gICAgICAgIHMgPSBoLmpvaW5QYXRoKGguc2l5dWFuRGF0YVBhdGgoKSwgZSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvLkJhc2VQYXRoVHlwZV9UaGVtZXM6XG4gICAgICAgIHMgPSBoLmpvaW5QYXRoKGguc2l5dWFuQXBwZWFyYW5jZVBhdGgoKSwgXCJ0aGVtZXNcIiwgZSk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvLkJhc2VQYXRoVHlwZV9aaGlUaGVtZTpcbiAgICAgICAgcyA9IGguam9pblBhdGgoaC5zaXl1YW5BcHBlYXJhbmNlUGF0aCgpLCBcInRoZW1lc1wiLCBcInpoaVwiLCBlKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJ0eXBlIG11c3QgYmUgcHJvdmlkZWQgd2hlbiBub3QgdXNlIGFic29sdXRlIHBhdGhcIik7XG4gICAgfVxuICBjb25zdCBjID0gaC5zaXl1YW5XaW5kb3coKTtcbiAgaWYgKCFjKVxuICAgIHJldHVybiByZXF1aXJlKHMpO1xuICBpZiAodHlwZW9mIGMucmVxdWlyZSA8IFwidVwiKVxuICAgIHJldHVybiBjLnJlcXVpcmUocyk7XG59KSwgLyoqXG4gKiBcdTVGMTVcdTUxNjVcdTRGOURcdThENTZcdUZGMENcdTRFRTUgZGF0YSBcdTc2ODRcdTU3RkFcdTY3MkNcdThERUZcdTVGODRcdTRFM0FcdTUxQzZcbiAqXG4gKiBAcGFyYW0gbGlicGF0aCAtIFx1NzZGOFx1NUJGOVx1NEU4RSBhcHBlYXJhbmNlIFx1NzY4NFx1NzZGOFx1NUJGOVx1OERFRlx1NUY4NFxuICovXG5yKHcsIFwicmVxdWlyZUFwcGVhcmFuY2VMaWJcIiwgKGUpID0+IGgucmVxdWlyZUxpYihlLCAhMSwgby5CYXNlUGF0aFR5cGVfQXBwZWFyYW5jZSkpLCAvKipcbiAqIFx1NUYxNVx1NTE2NVx1NEY5RFx1OEQ1Nlx1RkYwQ1x1NEVFNSBkYXRhIFx1NzY4NFx1NTdGQVx1NjcyQ1x1OERFRlx1NUY4NFx1NEUzQVx1NTFDNlxuICpcbiAqIEBwYXJhbSBsaWJwYXRoIC0gXHU3NkY4XHU1QkY5XHU0RThFIGRhdGEgXHU3Njg0XHU3NkY4XHU1QkY5XHU4REVGXHU1Rjg0XG4gKi9cbnIodywgXCJyZXF1aXJlRGF0YUxpYlwiLCAoZSkgPT4gaC5yZXF1aXJlTGliKGUsICExLCBvLkJhc2VQYXRoVHlwZV9EYXRhKSksIC8qKlxuICogXHU1RjE1XHU1MTY1XHU0RjlEXHU4RDU2XHVGRjBDXHU0RUU1IHRoZW1lIFx1NzY4NFx1NTdGQVx1NjcyQ1x1OERFRlx1NUY4NFx1NEUzQVx1NTFDNlxuICpcbiAqIEBwYXJhbSBsaWJwYXRoIC0gXHU3NkY4XHU1QkY5XHU0RThFIHRoZW1lIFx1NzY4NFx1NzZGOFx1NUJGOVx1OERFRlx1NUY4NFxuICovXG5yKHcsIFwicmVxdWlyZVRoZW1lc0xpYlwiLCAoZSkgPT4gaC5yZXF1aXJlTGliKGUsICExLCBvLkJhc2VQYXRoVHlwZV9UaGVtZXMpKSwgLyoqXG4gKiBcdTVGMTVcdTUxNjVcdTRGOURcdThENTZcdUZGMENcdTRFRTUgWmhpVGhlbWUgXHU3Njg0XHU1N0ZBXHU2NzJDXHU4REVGXHU1Rjg0XHU0RTNBXHU1MUM2XG4gKlxuICogQHBhcmFtIGxpYnBhdGggLSBcdTc2RjhcdTVCRjlcdTRFOEUgWmhpVGhlbWUgXHU3Njg0XHU3NkY4XHU1QkY5XHU4REVGXHU1Rjg0XG4gKi9cbnIodywgXCJyZXF1aXJlWmhpVGhlbWVMaWJcIiwgKGUpID0+IGgucmVxdWlyZUxpYihlLCAhMSwgby5CYXNlUGF0aFR5cGVfWmhpVGhlbWUpKTtcbnZhciBwID0gLyogQF9fUFVSRV9fICovICgoYSkgPT4gKGEuRGV2aWNlVHlwZV9Nb2JpbGVfRGV2aWNlID0gXCJNb2JpbGVcIiwgYS5EZXZpY2VUeXBlX1NpeXVhbl9XaWRnZXQgPSBcIlNpeXVhbl9XaWRnZXRcIiwgYS5EZXZpY2VUeXBlX1NpeXVhbl9OZXdXaW4gPSBcIlNpeXVhbl9OZXdXaW5kb3dcIiwgYS5EZXZpY2VUeXBlX1NpeXVhbl9NYWluV2luID0gXCJTaXl1YW5fTWFpbldpbmRvd1wiLCBhLkRldmljZVR5cGVfU2l5dWFuX0Jyb3dzZXIgPSBcIlNpeXVhbl9Ccm93c2VyXCIsIGEuRGV2aWNlVHlwZV9DaHJvbWVfRXh0ZW5zaW9uID0gXCJDaHJvbWVfRXh0ZW5zaW9uXCIsIGEuRGV2aWNlVHlwZV9DaHJvbWVfQnJvd3NlciA9IFwiQ2hyb21lX0Jyb3dzZXJcIiwgYS5EZXZpY2VUeXBlX05vZGUgPSBcIk5vZGVcIiwgYSkpKHAgfHwge30pO1xuY2xhc3MgdiB7XG4gIC8qKlxuICAgKiBcdTgzQjdcdTUzRDZcdTVGNTNcdTUyNERcdThCQkVcdTU5MDdcbiAgICovXG4gIHN0YXRpYyBnZXREZXZpY2UoKSB7XG4gICAgcmV0dXJuIHRoaXMuZGV0ZWN0TW9iaWxlRGV2aWNlKCkgPyBwLkRldmljZVR5cGVfTW9iaWxlX0RldmljZSA6IHcuaXNJblNpeXVhbldpZGdldCgpID8gcC5EZXZpY2VUeXBlX1NpeXVhbl9XaWRnZXQgOiB3LmlzSW5TaXl1YW5OZXdXaW4oKSA/IHAuRGV2aWNlVHlwZV9TaXl1YW5fTmV3V2luIDogaS5pc0VsZWN0cm9uKCkgPyBwLkRldmljZVR5cGVfU2l5dWFuX01haW5XaW4gOiB3LmlzSW5TaXl1YW5Ccm93c2VyKCkgPyBwLkRldmljZVR5cGVfU2l5dWFuX0Jyb3dzZXIgOiBpLmlzSW5DaHJvbWVFeHRlbnNpb24oKSA/IHAuRGV2aWNlVHlwZV9DaHJvbWVfRXh0ZW5zaW9uIDogaS5pc05vZGUgPyBwLkRldmljZVR5cGVfTm9kZSA6IHAuRGV2aWNlVHlwZV9DaHJvbWVfQnJvd3NlcjtcbiAgfVxuICAvKipcbiAgICogXHU2OEMwXHU2RDRCXHU3OUZCXHU1MkE4XHU3QUVGXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBzdGF0aWMgZGV0ZWN0TW9iaWxlRGV2aWNlKCkge1xuICAgIGxldCBlID0gITE7XG4gICAgcmV0dXJuIGkuaXNJbkJyb3dzZXIgJiYgZnVuY3Rpb24odCkge1xuICAgICAgKC8oYW5kcm9pZHxiYlxcZCt8bWVlZ28pLittb2JpbGV8YXZhbnRnb3xiYWRhXFwvfGJsYWNrYmVycnl8YmxhemVyfGNvbXBhbHxlbGFpbmV8ZmVubmVjfGhpcHRvcHxpZW1vYmlsZXxpcChob25lfG9kKXxpcmlzfGtpbmRsZXxsZ2UgfG1hZW1vfG1pZHB8bW1wfG1vYmlsZS4rZmlyZWZveHxuZXRmcm9udHxvcGVyYSBtKG9ifGluKWl8cGFsbSggb3MpP3xwaG9uZXxwKGl4aXxyZSlcXC98cGx1Y2tlcnxwb2NrZXR8cHNwfHNlcmllcyg0fDYpMHxzeW1iaWFufHRyZW98dXBcXC4oYnJvd3NlcnxsaW5rKXx2b2RhZm9uZXx3YXB8d2luZG93cyBjZXx4ZGF8eGlpbm8vaS50ZXN0KFxuICAgICAgICB0XG4gICAgICApIHx8IC8xMjA3fDYzMTB8NjU5MHwzZ3NvfDR0aHB8NTBbMS02XWl8Nzcwc3w4MDJzfGEgd2F8YWJhY3xhYyhlcnxvb3xzLSl8YWkoa298cm4pfGFsKGF2fGNhfGNvKXxhbW9pfGFuKGV4fG55fHl3KXxhcHR1fGFyKGNofGdvKXxhcyh0ZXx1cyl8YXR0d3xhdShkaXwtbXxyIHxzICl8YXZhbnxiZShja3xsbHxucSl8YmkobGJ8cmQpfGJsKGFjfGF6KXxicihlfHYpd3xidW1ifGJ3LShufHUpfGM1NVxcL3xjYXBpfGNjd2F8Y2RtLXxjZWxsfGNodG18Y2xkY3xjbWQtfGNvKG1wfG5kKXxjcmF3fGRhKGl0fGxsfG5nKXxkYnRlfGRjLXN8ZGV2aXxkaWNhfGRtb2J8ZG8oY3xwKW98ZHMoMTJ8LWQpfGVsKDQ5fGFpKXxlbShsMnx1bCl8ZXIoaWN8azApfGVzbDh8ZXooWzQtN10wfG9zfHdhfHplKXxmZXRjfGZseSgtfF8pfGcxIHV8ZzU2MHxnZW5lfGdmLTV8Zy1tb3xnbyhcXC53fG9kKXxncihhZHx1bil8aGFpZXxoY2l0fGhkLShtfHB8dCl8aGVpLXxoaShwdHx0YSl8aHAoIGl8aXApfGhzLWN8aHQoYygtfCB8X3xhfGd8cHxzfHQpfHRwKXxodShhd3x0Yyl8aS0oMjB8Z298bWEpfGkyMzB8aWFjKCB8LXxcXC8pfGlicm98aWRlYXxpZzAxfGlrb218aW0xa3xpbm5vfGlwYXF8aXJpc3xqYSh0fHYpYXxqYnJvfGplbXV8amlnc3xrZGRpfGtlaml8a2d0KCB8XFwvKXxrbG9ufGtwdCB8a3djLXxreW8oY3xrKXxsZShub3x4aSl8bGcoIGd8XFwvKGt8bHx1KXw1MHw1NHwtW2Etd10pfGxpYnd8bHlueHxtMS13fG0zZ2F8bTUwXFwvfG1hKHRlfHVpfHhvKXxtYygwMXwyMXxjYSl8bS1jcnxtZShyY3xyaSl8bWkobzh8b2F8dHMpfG1tZWZ8bW8oMDF8MDJ8Yml8ZGV8ZG98dCgtfCB8b3x2KXx6eil8bXQoNTB8cDF8diApfG13YnB8bXl3YXxuMTBbMC0yXXxuMjBbMi0zXXxuMzAoMHwyKXxuNTAoMHwyfDUpfG43KDAoMHwxKXwxMCl8bmUoKGN8bSktfG9ufHRmfHdmfHdnfHd0KXxub2soNnxpKXxuenBofG8yaW18b3AodGl8d3YpfG9yYW58b3dnMXxwODAwfHBhbihhfGR8dCl8cGR4Z3xwZygxM3wtKFsxLThdfGMpKXxwaGlsfHBpcmV8cGwoYXl8dWMpfHBuLTJ8cG8oY2t8cnR8c2UpfHByb3h8cHNpb3xwdC1nfHFhLWF8cWMoMDd8MTJ8MjF8MzJ8NjB8LVsyLTddfGktKXxxdGVrfHIzODB8cjYwMHxyYWtzfHJpbTl8cm8odmV8em8pfHM1NVxcL3xzYShnZXxtYXxtbXxtc3xueXx2YSl8c2MoMDF8aC18b298cC0pfHNka1xcL3xzZShjKC18MHwxKXw0N3xtY3xuZHxyaSl8c2doLXxzaGFyfHNpZSgtfG0pfHNrLTB8c2woNDV8aWQpfHNtKGFsfGFyfGIzfGl0fHQ1KXxzbyhmdHxueSl8c3AoMDF8aC18di18diApfHN5KDAxfG1iKXx0MigxOHw1MCl8dDYoMDB8MTB8MTgpfHRhKGd0fGxrKXx0Y2wtfHRkZy18dGVsKGl8bSl8dGltLXx0LW1vfHRvKHBsfHNoKXx0cyg3MHxtLXxtM3xtNSl8dHgtOXx1cChcXC5ifGcxfHNpKXx1dHN0fHY0MDB8djc1MHx2ZXJpfHZpKHJnfHRlKXx2ayg0MHw1WzAtM118LXYpfHZtNDB8dm9kYXx2dWxjfHZ4KDUyfDUzfDYwfDYxfDcwfDgwfDgxfDgzfDg1fDk4KXx3M2MoLXwgKXx3ZWJjfHdoaXR8d2koZyB8bmN8bncpfHdtbGJ8d29udXx4NzAwfHlhcy18eW91cnx6ZXRvfHp0ZS0vaS50ZXN0KFxuICAgICAgICB0LnN1YnN0cigwLCA0KVxuICAgICAgKSkgJiYgKGUgPSAhMCk7XG4gICAgfShuYXZpZ2F0b3IudXNlckFnZW50IHx8IG5hdmlnYXRvci52ZW5kb3IgfHwgd2luZG93Lm9wZXJhKSwgZTtcbiAgfVxufVxuZXhwb3J0IHtcbiAgbyBhcyBCYXNlUGF0aFR5cGVFbnVtLFxuICBpIGFzIEJyb3dzZXJVdGlsLFxuICB2IGFzIERldmljZURldGVjdGlvbixcbiAgcCBhcyBEZXZpY2VUeXBlRW51bSxcbiAgdyBhcyBTaXl1YW5EZXZpY2Vcbn07XG4iLCAiLypcbiAqIENvcHlyaWdodCAoYykgMjAyMywgVGVyd2VyIC4gQWxsIHJpZ2h0cyByZXNlcnZlZC5cbiAqIERPIE5PVCBBTFRFUiBPUiBSRU1PVkUgQ09QWVJJR0hUIE5PVElDRVMgT1IgVEhJUyBGSUxFIEhFQURFUi5cbiAqXG4gKiBUaGlzIGNvZGUgaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBpdFxuICogdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIgb25seSwgYXNcbiAqIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLiAgVGVyd2VyIGRlc2lnbmF0ZXMgdGhpc1xuICogcGFydGljdWxhciBmaWxlIGFzIHN1YmplY3QgdG8gdGhlIFwiQ2xhc3NwYXRoXCIgZXhjZXB0aW9uIGFzIHByb3ZpZGVkXG4gKiBieSBUZXJ3ZXIgaW4gdGhlIExJQ0VOU0UgZmlsZSB0aGF0IGFjY29tcGFuaWVkIHRoaXMgY29kZS5cbiAqXG4gKiBUaGlzIGNvZGUgaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgYnV0IFdJVEhPVVRcbiAqIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mIE1FUkNIQU5UQUJJTElUWSBvclxuICogRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlXG4gKiB2ZXJzaW9uIDIgZm9yIG1vcmUgZGV0YWlscyAoYSBjb3B5IGlzIGluY2x1ZGVkIGluIHRoZSBMSUNFTlNFIGZpbGUgdGhhdFxuICogYWNjb21wYW5pZWQgdGhpcyBjb2RlKS5cbiAqXG4gKiBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uXG4gKiAyIGFsb25nIHdpdGggdGhpcyB3b3JrOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sXG4gKiBJbmMuLCA1MSBGcmFua2xpbiBTdCwgRmlmdGggRmxvb3IsIEJvc3RvbiwgTUEgMDIxMTAtMTMwMSBVU0EuXG4gKlxuICogUGxlYXNlIGNvbnRhY3QgVGVyd2VyLCBTaGVuemhlbiwgR3Vhbmdkb25nLCBDaGluYSwgeW91d2VpY3NAMTYzLmNvbVxuICogb3IgdmlzaXQgd3d3LnRlcndlci5zcGFjZSBpZiB5b3UgbmVlZCBhZGRpdGlvbmFsIGluZm9ybWF0aW9uIG9yIGhhdmUgYW55XG4gKiBxdWVzdGlvbnMuXG4gKi9cblxuaW1wb3J0IHsgQnJvd3NlclV0aWwsIFNpeXVhbkRldmljZSB9IGZyb20gXCJ6aGktZGV2aWNlXCJcblxuLyoqXG4gKiBcdTdBOTdcdTUzRTNcdTdCQTFcdTc0MDZcdTU2NjhcbiAqXG4gKiBAYXV0aG9yIHRlcndlclxuICogQHZlcnNpb24gMS4wLjBcbiAqIEBzaW5jZSAxLjAuMFxuICovXG5jbGFzcyBXaW5kb3dNYW5hZ2VyIHtcbiAgcHJpdmF0ZSBsb2dnZXI6IGFueVxuICBwcml2YXRlIGNvbW1vbjogYW55XG5cbiAgaW5pdChsb2dnZXI6IGFueSwgY29tbW9uOiBhbnkpIHtcbiAgICB0aGlzLmxvZ2dlciA9IGxvZ2dlclxuICAgIHRoaXMuY29tbW9uID0gY29tbW9uXG4gIH1cblxuICAvKipcbiAgICogXHU2MjUzXHU1RjAwXHU2NUIwXHU3QTk3XHU1M0UzXG4gICAqXG4gICAqIFx1NzkzQVx1NEY4Qlx1RkYxQVxuICAgKlxuICAgKiBgYGBcbiAgICogIyMgZGV2ZWxvcG1lbnRcbiAgICogd2luZG93TWFuYWdlci5vcGVuQnJvd3NlcldpbmRvdyhcImh0dHBzOi8vd3d3LmJhaWR1LmNvbVwiLCB1bmRlZmluZWQsIHVuZGVmaW5lZCwgdHJ1ZSwgZmFsc2UpXG4gICAqIHdpbmRvd01hbmFnZXIub3BlbkJyb3dzZXJXaW5kb3coXCJodHRwczovL3d3dy5iYWlkdS5jb21cIiwgeyBcImtleTFcIjogXCJ2YWx1ZTFcIiwgXCJrZXkyXCI6IFwidmFsdWUyXCIgfSwgdW5kZWZpbmVkLCB0cnVlLCBmYWxzZSlcbiAgICpcbiAgICogIyMgcHJvZHVjdGlvblxuICAgKiB3aW5kb3dNYW5hZ2VyLm9wZW5Ccm93c2VyV2luZG93KFwiaHR0cHM6Ly93d3cuYmFpZHUuY29tXCIpXG4gICAqIGBgYFxuICAgKlxuICAgKiBAcGFyYW0gdXJsIC0gdXJsXG4gICAqIEBwYXJhbSBwYXJhbXMgLSBcdTUzQzJcdTY1NzBcbiAgICogQHBhcmFtIHdpbiAtIFx1NzIzNlx1N0E5N1x1NTNFM1xuICAgKiBAcGFyYW0gaXNEZXYgLSBcdTY2MkZcdTU0MjZcdTYyNTNcdTVGMDBcdTVGMDBcdTUzRDFcdTgwMDVcdTVERTVcdTUxNzdcbiAgICogQHBhcmFtIG1vZGFsIC0gXHU2NjJGXHU1NDI2XHU2QTIxXHU2MDAxXG4gICAqL1xuICBwdWJsaWMgb3BlbkJyb3dzZXJXaW5kb3codXJsOiBzdHJpbmcsIHBhcmFtcz86IFJlY29yZDxzdHJpbmcsIHN0cmluZz4sIHdpbj86IGFueSwgaXNEZXYgPSBmYWxzZSwgbW9kYWwgPSBmYWxzZSkge1xuICAgIHRyeSB7XG4gICAgICBpZiAodGhpcy5jb21tb24uc3RyVXRpbC5pc0VtcHR5U3RyaW5nKHVybCkpIHtcbiAgICAgICAgdGhpcy5sb2dnZXIuZXJyb3IoXCJVcmwgY2Fubm90IGJlIGVtcHR5XCIpXG4gICAgICAgIHJldHVyblxuICAgICAgfVxuXG4gICAgICBpZiAoIUJyb3dzZXJVdGlsLmlzRWxlY3Ryb24oKSkge1xuICAgICAgICB0aGlzLmxvZ2dlci5pbmZvKFwiQnJvd3NlcldpbmRvdyBjYW4gb255IGJlIGF2YWlsYWJsZSBpbiBzaXl1YW4gRWxlY3Ryb24gZW52aXJvbm1lbnRcIilcbiAgICAgICAgcmV0dXJuXG4gICAgICB9XG5cbiAgICAgIGlmIChwYXJhbXMpIHtcbiAgICAgICAgT2JqZWN0LmtleXMocGFyYW1zKS5mb3JFYWNoKChrZXk6IHN0cmluZykgPT4ge1xuICAgICAgICAgIGNvbnN0IHZhbHVlID0gcGFyYW1zW2tleV1cbiAgICAgICAgICB1cmwgPSBCcm93c2VyVXRpbC5zZXRVcmxQYXJhbWV0ZXIodXJsLCBrZXksIHZhbHVlKVxuICAgICAgICB9KVxuICAgICAgfVxuXG4gICAgICB0aGlzLmxvZ2dlci5pbmZvKHRoaXMuY29tbW9uLnN0clV0aWwuZihcIk9wZW5pbmcgYSBuZXcgQnJvd3NlcldpbmRvdyBmcm9tIHVybCA9PiB7MH1cIiwgdXJsKSlcblxuICAgICAgY29uc3QgbWFpbldpbiA9IHdpbiA/PyBTaXl1YW5EZXZpY2Uuc2l5dWFuV2luZG93KClcbiAgICAgIGNvbnN0IHsgYXBwLCBCcm93c2VyV2luZG93LCBnZXRDdXJyZW50V2luZG93IH0gPSBtYWluV2luLnJlcXVpcmUoXCJAZWxlY3Ryb24vcmVtb3RlXCIpXG4gICAgICBjb25zdCByZW1vdGUgPSBtYWluV2luLnJlcXVpcmUoXCJAZWxlY3Ryb24vcmVtb3RlXCIpLnJlcXVpcmUoXCJAZWxlY3Ryb24vcmVtb3RlL21haW5cIilcbiAgICAgIGNvbnN0IG1haW5XaW5kb3cgPSBnZXRDdXJyZW50V2luZG93KClcbiAgICAgIGNvbnN0IG5ld1dpbmRvdyA9IG5ldyBCcm93c2VyV2luZG93KHtcbiAgICAgICAgcGFyZW50OiBtYWluV2luZG93LFxuICAgICAgICB3aWR0aDogOTAwLFxuICAgICAgICBoZWlnaHQ6IDc1MCxcbiAgICAgICAgcmVzaXphYmxlOiB0cnVlLFxuICAgICAgICBtb2RhbDogbW9kYWwsXG4gICAgICAgIGljb246IFNpeXVhbkRldmljZS5icm93c2VySm9pblBhdGgoXG4gICAgICAgICAgU2l5dWFuRGV2aWNlLnNpeXVhbldpbmRvdygpLnNpeXVhbi5jb25maWcuc3lzdGVtLmFwcERpcixcbiAgICAgICAgICBcInN0YWdlXCIsXG4gICAgICAgICAgXCJpY29uLWxhcmdlLnBuZ1wiXG4gICAgICAgICksXG4gICAgICAgIHRpdGxlQmFyT3ZlcmxheToge1xuICAgICAgICAgIGNvbG9yOiBcIiNjY2NjY2NhNVwiLFxuICAgICAgICAgIHN5bWJvbENvbG9yOiBcImJsYWNrXCIsXG4gICAgICAgIH0sXG4gICAgICAgIHdlYlByZWZlcmVuY2VzOiB7XG4gICAgICAgICAgbmF0aXZlV2luZG93T3BlbjogdHJ1ZSxcbiAgICAgICAgICBub2RlSW50ZWdyYXRpb246IHRydWUsXG4gICAgICAgICAgd2Vidmlld1RhZzogdHJ1ZSxcbiAgICAgICAgICB3ZWJTZWN1cml0eTogZmFsc2UsXG4gICAgICAgICAgY29udGV4dElzb2xhdGlvbjogZmFsc2UsXG4gICAgICAgIH0sXG4gICAgICB9KVxuXG4gICAgICBuZXdXaW5kb3cud2ViQ29udGVudHMudXNlckFnZW50ID0gYFNpWXVhbi8ke2FwcC5nZXRWZXJzaW9uKCl9IGh0dHBzOi8vYjNsb2cub3JnL3NpeXVhbiBFbGVjdHJvbmBcbiAgICAgIC8vIFx1NTE0MVx1OEJCOFxuICAgICAgcmVtb3RlLmVuYWJsZShuZXdXaW5kb3cud2ViQ29udGVudHMpXG4gICAgICBpZiAoaXNEZXYpIHtcbiAgICAgICAgbmV3V2luZG93LndlYkNvbnRlbnRzLm9wZW5EZXZUb29scygpXG4gICAgICB9XG4gICAgICBuZXdXaW5kb3cubG9hZFVSTCh1cmwpXG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgdGhpcy5sb2dnZXIuZXJyb3IoXCJPcGVuIGJyb3dzZXIgd2luZG93IGZhaWxlZFwiLCBlKVxuICAgIH1cbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBXaW5kb3dNYW5hZ2VyXG4iLCAiLypcbiAqIENvcHlyaWdodCAoYykgMjAyMywgVGVyd2VyIC4gQWxsIHJpZ2h0cyByZXNlcnZlZC5cbiAqIERPIE5PVCBBTFRFUiBPUiBSRU1PVkUgQ09QWVJJR0hUIE5PVElDRVMgT1IgVEhJUyBGSUxFIEhFQURFUi5cbiAqXG4gKiBUaGlzIGNvZGUgaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBpdFxuICogdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIgb25seSwgYXNcbiAqIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLiAgVGVyd2VyIGRlc2lnbmF0ZXMgdGhpc1xuICogcGFydGljdWxhciBmaWxlIGFzIHN1YmplY3QgdG8gdGhlIFwiQ2xhc3NwYXRoXCIgZXhjZXB0aW9uIGFzIHByb3ZpZGVkXG4gKiBieSBUZXJ3ZXIgaW4gdGhlIExJQ0VOU0UgZmlsZSB0aGF0IGFjY29tcGFuaWVkIHRoaXMgY29kZS5cbiAqXG4gKiBUaGlzIGNvZGUgaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgYnV0IFdJVEhPVVRcbiAqIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mIE1FUkNIQU5UQUJJTElUWSBvclxuICogRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlXG4gKiB2ZXJzaW9uIDIgZm9yIG1vcmUgZGV0YWlscyAoYSBjb3B5IGlzIGluY2x1ZGVkIGluIHRoZSBMSUNFTlNFIGZpbGUgdGhhdFxuICogYWNjb21wYW5pZWQgdGhpcyBjb2RlKS5cbiAqXG4gKiBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uXG4gKiAyIGFsb25nIHdpdGggdGhpcyB3b3JrOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sXG4gKiBJbmMuLCA1MSBGcmFua2xpbiBTdCwgRmlmdGggRmxvb3IsIEJvc3RvbiwgTUEgMDIxMTAtMTMwMSBVU0EuXG4gKlxuICogUGxlYXNlIGNvbnRhY3QgVGVyd2VyLCBTaGVuemhlbiwgR3Vhbmdkb25nLCBDaGluYSwgeW91d2VpY3NAMTYzLmNvbVxuICogb3IgdmlzaXQgd3d3LnRlcndlci5zcGFjZSBpZiB5b3UgbmVlZCBhZGRpdGlvbmFsIGluZm9ybWF0aW9uIG9yIGhhdmUgYW55XG4gKiBxdWVzdGlvbnMuXG4gKi9cblxuaW1wb3J0IFdpbmRvd01hbmFnZXIgZnJvbSBcIi4vV2luZG93TWFuYWdlclwiXG5pbXBvcnQgeyBTaXl1YW5EZXZpY2UgfSBmcm9tIFwiemhpLWRldmljZVwiXG5cbi8qKlxuICogXHU4RkQ5XHU5MUNDXHU3RURGXHU0RTAwXHU2MzAyXHU4RjdEXHU0RTAwXHU0RTJBXHU2NUI5XHU2Q0Q1XHVGRjBDXHU1M0VGXHU0RUU1XHU2MjUzXHU1RjAwIEVsZWN0cm9uIFx1NzY4NCBCcm93c2VyV2luZG93XG4gKlxuICogQGF1dGhvciB0ZXJ3ZXJcbiAqIEB2ZXJzaW9uIDEuMC4wXG4gKiBAc2luY2UgMS4wLjBcbiAqL1xuY2xhc3MgWmhpQnJvd3NlcldpbmRvdyB7XG4gIHByaXZhdGUgbG9nZ2VyOiBhbnlcblxuICBwcml2YXRlIHJlYWRvbmx5IHdpbmRvd01hbmFnZXJcblxuICBjb25zdHJ1Y3RvcigpIHtcbiAgICB0aGlzLndpbmRvd01hbmFnZXIgPSBuZXcgV2luZG93TWFuYWdlcigpXG4gIH1cblxuICBpbml0KGxvZ2dlcjogYW55LCBjb21tb246IGFueSkge1xuICAgIHRoaXMubG9nZ2VyID0gbG9nZ2VyXG4gICAgdGhpcy53aW5kb3dNYW5hZ2VyLmluaXQobG9nZ2VyLCBjb21tb24pXG4gIH1cblxuICAvKipcbiAgICogXHU2MzAyXHU4RjdEIEJyb3dzZXJXaW5kb3dcbiAgICpcbiAgICogQGF1dGhvciB0ZXJ3ZXJcbiAgICogQHNpbmNlIDEuMC4wXG4gICAqL1xuICBwdWJsaWMgaW5pdEJyb3dzZXJXaW5kb3coKSB7XG4gICAgU2l5dWFuRGV2aWNlLnNpeXVhbldpbmRvdygpLnpoaVdpbmRvdyA9IHRoaXMud2luZG93TWFuYWdlclxuICAgIHRoaXMubG9nZ2VyLmluZm8oXCJ6aGlXaW5kb3cgbW91bnRlZFwiKVxuICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFpoaUJyb3dzZXJXaW5kb3dcbiJdLAogICJtYXBwaW5ncyI6ICI7Ozs7Ozs7OztBQUFBLElBQUksSUFBSSxPQUFPO0FBQ2YsSUFBSSxJQUFJLENBQUMsR0FBRyxHQUFHLE1BQU0sS0FBSyxJQUFJLEVBQUUsR0FBRyxHQUFHLEVBQUUsWUFBWSxNQUFJLGNBQWMsTUFBSSxVQUFVLE1BQUksT0FBTyxFQUFFLENBQUMsSUFBSSxFQUFFLENBQUMsSUFBSTtBQUM3RyxJQUFJLElBQUksQ0FBQyxHQUFHLEdBQUcsT0FBTyxFQUFFLEdBQUcsT0FBTyxLQUFLLFdBQVcsSUFBSSxLQUFLLEdBQUcsQ0FBQyxHQUFHO0FBQ2xFLElBQU0sSUFBSSxNQUFNO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFJZCxPQUFPLHNCQUFzQjtBQUMzQixXQUFPLEVBQUUsY0FBYyxPQUFPLFNBQVMsS0FBSyxRQUFRLHFCQUFxQixJQUFJLEtBQUs7QUFBQSxFQUNwRjtBQUNGO0FBQ0EsSUFBSSxJQUFJO0FBSVIsRUFBRSxHQUFHLFVBQVUsT0FBTyxVQUFVLEdBQUc7QUFBQTtBQUFBO0FBR25DLEVBQUUsR0FBRyxlQUFlLE9BQU8sU0FBUyxHQUFHO0FBQUE7QUFBQTtBQUd2QyxFQUFFLEdBQUcsb0JBQW9CLEdBQUc7QUFBQTtBQUFBO0FBRzVCLEVBQUUsR0FBRyxjQUFjLE1BQU0sQ0FBQyxFQUFFLGVBQWUsQ0FBQyxPQUFPLGFBQWEsQ0FBQyxPQUFPLFVBQVUsWUFBWSxRQUFLLFdBQVcsS0FBSyxPQUFPLFVBQVUsU0FBUyxDQUFDO0FBQUE7QUFBQTtBQUc5SSxFQUFFLEdBQUcsY0FBYyxNQUFNLEVBQUUsV0FBVyxLQUFLLEVBQUUsTUFBTTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBS25ELEVBQUUsR0FBRyxrQkFBa0IsQ0FBQyxNQUFNO0FBQzVCLE1BQUksQ0FBQyxFQUFFO0FBQ0wsV0FBTztBQUNULFFBQU0sSUFBSSxPQUFPLFNBQVMsT0FBTyxVQUFVLENBQUMsRUFBRSxNQUFNLEdBQUc7QUFDdkQsV0FBUyxJQUFJLEdBQUcsSUFBSSxFQUFFLFFBQVEsS0FBSztBQUNqQyxVQUFNLElBQUksRUFBRSxDQUFDLEVBQUUsTUFBTSxHQUFHO0FBQ3hCLFFBQUksRUFBRSxDQUFDLE1BQU07QUFDWCxhQUFPLEVBQUUsQ0FBQztBQUFBLEVBQ2Q7QUFDQSxTQUFPO0FBQ1QsQ0FBQztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBaUJELEVBQUUsR0FBRyxtQkFBbUIsQ0FBQyxHQUFHLEdBQUcsTUFBTTtBQUNuQyxPQUFLLFNBQVMsSUFBSTtBQUNsQixRQUFNLElBQUksSUFBSSxPQUFPLFNBQVMsSUFBSSxjQUFjO0FBQ2hELE1BQUksRUFBRSxPQUFPLENBQUMsS0FBSztBQUNqQixXQUFPLEVBQUUsUUFBUSxHQUFHLE9BQU8sSUFBSSxJQUFJO0FBQ3JDLFFBQU0sQ0FBQyxHQUFHLENBQUMsSUFBSSxFQUFFLE1BQU0sR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxNQUFNLEdBQUcsR0FBRyxJQUFJLElBQUksZ0JBQWdCLENBQUM7QUFDN0UsSUFBRSxJQUFJLEdBQUcsQ0FBQztBQUNWLFFBQU0sSUFBSSxFQUFFLFNBQVMsR0FBRyxJQUFJLEtBQUssSUFBSSxNQUFNLElBQUk7QUFDL0MsU0FBTyxJQUFJLElBQUksTUFBTSxJQUFJO0FBQzNCLENBQUM7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFPRCxFQUFFLEdBQUcsbUJBQW1CLENBQUMsR0FBRyxHQUFHLE1BQU07QUFDbkMsTUFBSSxFQUFFLFNBQVMsQ0FBQztBQUNkLFdBQU8sRUFBRSxnQkFBZ0IsR0FBRyxHQUFHLENBQUM7QUFDbEMsUUFBTSxJQUFJLEVBQUUsTUFBTSxHQUFHO0FBQ3JCLE1BQUksSUFBSSxFQUFFLENBQUM7QUFDWCxRQUFNLElBQUksRUFBRSxDQUFDO0FBQ2IsU0FBTyxFQUFFLFNBQVMsR0FBRyxJQUFJLEtBQUssSUFBSSxLQUFLLE1BQU0sS0FBSyxJQUFJLEtBQUssS0FBSyxNQUFNLEtBQUssTUFBTSxJQUFJO0FBQ3ZGLENBQUM7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBTUQsRUFBRSxHQUFHLGlCQUFpQixDQUFDLEdBQUcsSUFBSSxRQUFRO0FBQ3BDLGFBQVcsV0FBVztBQUNwQixRQUFJLEVBQUUsYUFBYTtBQUNqQixZQUFNLElBQUksT0FBTyxTQUFTO0FBQzFCLGFBQU8sU0FBUyxPQUFPLEVBQUUsZ0JBQWdCLEdBQUcsT0FBTyxDQUFDO0FBQUEsSUFDdEQ7QUFBQSxFQUNGLEdBQUcsQ0FBQztBQUNOLENBQUM7QUFBQTtBQUFBO0FBR0QsRUFBRSxHQUFHLGNBQWMsTUFBTTtBQUN2QixhQUFXLFdBQVc7QUFDcEIsTUFBRSxlQUFlLE9BQU8sU0FBUyxPQUFPO0FBQUEsRUFDMUMsR0FBRyxHQUFHO0FBQ1IsQ0FBQztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFNRCxFQUFFLEdBQUcsaUNBQWlDLENBQUMsR0FBRyxNQUFNO0FBQzlDLE9BQUssRUFBRSxDQUFDLEdBQUcsV0FBVyxXQUFXO0FBQy9CLE1BQUUsZUFBZSxPQUFPLFNBQVMsT0FBTztBQUFBLEVBQzFDLEdBQUcsR0FBRztBQUNSLENBQUM7QUFDRCxJQUFJLElBQXFCLGtCQUFDLE9BQU8sRUFBRSwwQkFBMEIsY0FBYyxFQUFFLG9CQUFvQixRQUFRLEVBQUUsc0JBQXNCLFVBQVUsRUFBRSx3QkFBd0IsWUFBWSxFQUFFLG9CQUFvQixRQUFRLElBQUksS0FBSyxDQUFDLENBQUM7QUFDMU4sSUFBTSxJQUFJLE1BQU07QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUlkLE9BQU8sb0JBQW9CO0FBQ3pCLFdBQU8sRUFBRSxjQUFjLE9BQU8sT0FBTyxTQUFTLE9BQU8sT0FBTyxPQUFPLE9BQU8sTUFBTTtBQUFBLEVBQ2xGO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFJQSxPQUFPLGVBQWU7QUFDcEIsUUFBSTtBQUNKLFdBQU8sS0FBSyxpQkFBaUIsSUFBSSxJQUFJLE9BQU8sU0FBUyxLQUFLLGlCQUFpQixLQUFLLEtBQUssa0JBQWtCLEtBQUssT0FBTyxTQUFTLE1BQU0sSUFBSSxTQUFTLElBQUksUUFBUTtBQUFBLEVBQzdKO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFhQSxhQUFhLFNBQVMsR0FBRyxHQUFHO0FBQzFCLFFBQUksSUFBSTtBQUNSLFlBQVEsR0FBRztBQUFBLE1BQ1QsS0FBSyxFQUFFO0FBQ0wsWUFBSSxLQUFLLGdCQUFnQixLQUFLLDZCQUE2QixHQUFHLENBQUM7QUFDL0Q7QUFBQSxNQUNGLEtBQUssRUFBRTtBQUNMLFlBQUksS0FBSyxnQkFBZ0IsS0FBSyx1QkFBdUIsR0FBRyxDQUFDO0FBQ3pEO0FBQUEsTUFDRixLQUFLLEVBQUU7QUFDTCxZQUFJLEtBQUssZ0JBQWdCLEtBQUssd0JBQXdCLEdBQUcsQ0FBQztBQUMxRDtBQUFBLE1BQ0YsS0FBSyxFQUFFO0FBQ0wsWUFBSSxLQUFLLGdCQUFnQixLQUFLLHFCQUFxQixHQUFHLENBQUM7QUFDdkQ7QUFBQSxNQUNGO0FBQ0UsY0FBTSxJQUFJLE1BQU0sdUJBQXVCO0FBQUEsSUFDM0M7QUFDQSxVQUFNLEVBQUUsU0FBUyxFQUFFLElBQUksTUFBTTtBQUFBO0FBQUEsTUFFM0I7QUFBQTtBQUVGLFdBQU87QUFBQSxFQUNUO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBa0VBLGFBQWEsaUJBQWlCLEdBQUc7QUFDL0IsV0FBTyxNQUFNLEtBQUssU0FBUyxHQUFHLEVBQUUscUJBQXFCO0FBQUEsRUFDdkQ7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFTQSxPQUFPLFlBQVksR0FBRztBQUNwQixRQUFJLEVBQUUsV0FBVyxHQUFHO0FBQ2xCLFlBQU0sSUFBSSxLQUFLLFdBQVcsTUFBTTtBQUNoQyxVQUFJO0FBQ0YsZUFBTyxFQUFFLEtBQUssR0FBRyxDQUFDO0FBQUEsSUFDdEI7QUFDQSxXQUFPLEtBQUssZ0JBQWdCLEdBQUcsQ0FBQztBQUFBLEVBQ2xDO0FBQUEsRUFDQSxPQUFPLG1CQUFtQixHQUFHO0FBQzNCLFdBQU8sRUFBRSxLQUFLLEVBQUUsZ0JBQWdCO0FBQUEsRUFDbEM7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUlBLE9BQU8saUJBQWlCO0FBQ3RCLFVBQU0sSUFBSSxLQUFLLGFBQWE7QUFDNUIsUUFBSSxDQUFDO0FBQ0gsWUFBTSxJQUFJLE1BQU0sbUJBQW1CO0FBQ3JDLFdBQU8sRUFBRSxPQUFPLE9BQU8sT0FBTztBQUFBLEVBQ2hDO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFJQSxPQUFPLGlCQUFpQjtBQUN0QixVQUFNLElBQUksS0FBSyxhQUFhO0FBQzVCLFFBQUksQ0FBQztBQUNILFlBQU0sSUFBSSxNQUFNLG1CQUFtQjtBQUNyQyxXQUFPLEVBQUUsT0FBTyxPQUFPLE9BQU87QUFBQSxFQUNoQztBQUFBO0FBQUE7QUFBQTtBQUFBLEVBSUEsT0FBTyx5QkFBeUI7QUFDOUIsUUFBSSxDQUFDLEtBQUssYUFBYTtBQUNyQixZQUFNLElBQUksTUFBTSxtQkFBbUI7QUFDckMsV0FBTztBQUFBLEVBQ1Q7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUlBLE9BQU8sdUJBQXVCO0FBQzVCLFdBQU8sS0FBSyxTQUFTLEtBQUssZUFBZSxHQUFHLFlBQVk7QUFBQSxFQUMxRDtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBSUEsT0FBTywrQkFBK0I7QUFDcEMsUUFBSSxDQUFDLEtBQUssYUFBYTtBQUNyQixZQUFNLElBQUksTUFBTSxtQkFBbUI7QUFDckMsV0FBTyxLQUFLLGdCQUFnQixJQUFJLFlBQVk7QUFBQSxFQUM5QztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBVUEsT0FBTyxrQkFBa0I7QUFDdkIsUUFBSSxFQUFFLFdBQVc7QUFDZixhQUFPLEtBQUssU0FBUyxLQUFLLHFCQUFxQixHQUFHLFFBQVE7QUFDNUQ7QUFDRSxZQUFNLElBQUksS0FBSyxhQUFhO0FBQzVCLFVBQUksQ0FBQztBQUNILGNBQU0sSUFBSSxNQUFNLG1CQUFtQjtBQUNyQyxhQUFPLEtBQUssU0FBUyxFQUFFLFNBQVMsUUFBUSxjQUFjLFFBQVE7QUFBQSxJQUNoRTtBQUFBLEVBQ0Y7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQUlBLE9BQU8sMEJBQTBCO0FBQy9CLFFBQUksQ0FBQyxLQUFLLGFBQWE7QUFDckIsWUFBTSxJQUFJLE1BQU0sbUJBQW1CO0FBQ3JDLFdBQU8sS0FBSyxnQkFBZ0IsSUFBSSxjQUFjLFFBQVE7QUFBQSxFQUN4RDtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBSUEsT0FBTyxlQUFlO0FBQ3BCLFdBQU8sS0FBSyxTQUFTLEtBQUssZ0JBQWdCLEdBQUcsS0FBSztBQUFBLEVBQ3BEO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFJQSxPQUFPLHVCQUF1QjtBQUM1QixXQUFPLEtBQUssZ0JBQWdCLEtBQUssd0JBQXdCLEdBQUcsS0FBSztBQUFBLEVBQ25FO0FBQ0Y7QUFDQSxJQUFJLElBQUk7QUFJUixFQUFFLEdBQUcsb0JBQW9CLE1BQU0sRUFBRSxjQUFjLE9BQU8sZ0JBQWdCLFFBQVEsT0FBTyxhQUFhLGlCQUFpQixRQUFRLE9BQU8sYUFBYSxjQUFjLGlCQUFpQixRQUFRLE9BQU8sYUFBYSxjQUFjLGNBQWMsYUFBYSxjQUFjLE1BQU0sS0FBSyxLQUFFO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFROVEsRUFBRSxHQUFHLG9CQUFvQixNQUFNLENBQUMsRUFBRSxlQUFlLENBQUMsRUFBRSxXQUFXLElBQUksUUFBSyxPQUFPLE9BQU8sU0FBUyxPQUFPLE9BQU8sT0FBTyxlQUFlLEdBQUc7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFVdEksRUFBRSxHQUFHLGNBQWMsQ0FBQyxHQUFHLElBQUksTUFBSSxJQUFJLEVBQUUsc0JBQXNCO0FBQ3pELE1BQUksQ0FBQyxFQUFFLFdBQVc7QUFDaEIsVUFBTSxJQUFJLE1BQU0sK0JBQStCO0FBQ2pELE1BQUksSUFBSTtBQUNSLE1BQUksQ0FBQztBQUNILFlBQVEsR0FBRztBQUFBLE1BQ1QsS0FBSyxFQUFFO0FBQ0wsWUFBSSxFQUFFLFNBQVMsRUFBRSxxQkFBcUIsR0FBRyxDQUFDO0FBQzFDO0FBQUEsTUFDRixLQUFLLEVBQUU7QUFDTCxZQUFJLEVBQUUsU0FBUyxFQUFFLGVBQWUsR0FBRyxDQUFDO0FBQ3BDO0FBQUEsTUFDRixLQUFLLEVBQUU7QUFDTCxZQUFJLEVBQUUsU0FBUyxFQUFFLHFCQUFxQixHQUFHLFVBQVUsQ0FBQztBQUNwRDtBQUFBLE1BQ0YsS0FBSyxFQUFFO0FBQ0wsWUFBSSxFQUFFLFNBQVMsRUFBRSxxQkFBcUIsR0FBRyxVQUFVLE9BQU8sQ0FBQztBQUMzRDtBQUFBLE1BQ0Y7QUFDRSxjQUFNLElBQUksTUFBTSxrREFBa0Q7QUFBQSxJQUN0RTtBQUNGLFFBQU0sSUFBSSxFQUFFLGFBQWE7QUFDekIsTUFBSSxDQUFDO0FBQ0gsV0FBTyxVQUFRLENBQUM7QUFDbEIsTUFBSSxPQUFPLEVBQUUsVUFBVTtBQUNyQixXQUFPLEVBQUUsUUFBUSxDQUFDO0FBQ3RCLENBQUM7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUtELEVBQUUsR0FBRyx3QkFBd0IsQ0FBQyxNQUFNLEVBQUUsV0FBVyxHQUFHLE9BQUksRUFBRSx1QkFBdUIsQ0FBQztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBS2xGLEVBQUUsR0FBRyxrQkFBa0IsQ0FBQyxNQUFNLEVBQUUsV0FBVyxHQUFHLE9BQUksRUFBRSxpQkFBaUIsQ0FBQztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBS3RFLEVBQUUsR0FBRyxvQkFBb0IsQ0FBQyxNQUFNLEVBQUUsV0FBVyxHQUFHLE9BQUksRUFBRSxtQkFBbUIsQ0FBQztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBSzFFLEVBQUUsR0FBRyxzQkFBc0IsQ0FBQyxNQUFNLEVBQUUsV0FBVyxHQUFHLE9BQUksRUFBRSxxQkFBcUIsQ0FBQzs7O0FDN1c5RSxJQUFNLGdCQUFOLE1BQW9CO0FBQUEsRUFDVjtBQUFBLEVBQ0E7QUFBQSxFQUVSLEtBQUssUUFBYSxRQUFhO0FBQzdCLFNBQUssU0FBUztBQUNkLFNBQUssU0FBUztBQUFBLEVBQ2hCO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBc0JPLGtCQUFrQixLQUFhLFFBQWlDLEtBQVcsUUFBUSxPQUFPLFFBQVEsT0FBTztBQUM5RyxRQUFJO0FBQ0YsVUFBSSxLQUFLLE9BQU8sUUFBUSxjQUFjLEdBQUcsR0FBRztBQUMxQyxhQUFLLE9BQU8sTUFBTSxxQkFBcUI7QUFDdkM7QUFBQSxNQUNGO0FBRUEsVUFBSSxDQUFDLEVBQVksV0FBVyxHQUFHO0FBQzdCLGFBQUssT0FBTyxLQUFLLG1FQUFtRTtBQUNwRjtBQUFBLE1BQ0Y7QUFFQSxVQUFJLFFBQVE7QUFDVixlQUFPLEtBQUssTUFBTSxFQUFFLFFBQVEsQ0FBQyxRQUFnQjtBQUMzQyxnQkFBTSxRQUFRLE9BQU8sR0FBRztBQUN4QixnQkFBTSxFQUFZLGdCQUFnQixLQUFLLEtBQUssS0FBSztBQUFBLFFBQ25ELENBQUM7QUFBQSxNQUNIO0FBRUEsV0FBSyxPQUFPLEtBQUssS0FBSyxPQUFPLFFBQVEsRUFBRSwrQ0FBK0MsR0FBRyxDQUFDO0FBRTFGLFlBQU0sVUFBVSxPQUFPLEVBQWEsYUFBYTtBQUNqRCxZQUFNLEVBQUUsS0FBSyxlQUFlLGlCQUFpQixJQUFJLFFBQVEsUUFBUSxrQkFBa0I7QUFDbkYsWUFBTSxTQUFTLFFBQVEsUUFBUSxrQkFBa0IsRUFBRSxRQUFRLHVCQUF1QjtBQUNsRixZQUFNLGFBQWEsaUJBQWlCO0FBQ3BDLFlBQU0sWUFBWSxJQUFJLGNBQWM7QUFBQSxRQUNsQyxRQUFRO0FBQUEsUUFDUixPQUFPO0FBQUEsUUFDUCxRQUFRO0FBQUEsUUFDUixXQUFXO0FBQUEsUUFDWDtBQUFBLFFBQ0EsTUFBTSxFQUFhO0FBQUEsVUFDakIsRUFBYSxhQUFhLEVBQUUsT0FBTyxPQUFPLE9BQU87QUFBQSxVQUNqRDtBQUFBLFVBQ0E7QUFBQSxRQUNGO0FBQUEsUUFDQSxpQkFBaUI7QUFBQSxVQUNmLE9BQU87QUFBQSxVQUNQLGFBQWE7QUFBQSxRQUNmO0FBQUEsUUFDQSxnQkFBZ0I7QUFBQSxVQUNkLGtCQUFrQjtBQUFBLFVBQ2xCLGlCQUFpQjtBQUFBLFVBQ2pCLFlBQVk7QUFBQSxVQUNaLGFBQWE7QUFBQSxVQUNiLGtCQUFrQjtBQUFBLFFBQ3BCO0FBQUEsTUFDRixDQUFDO0FBRUQsZ0JBQVUsWUFBWSxZQUFZLFVBQVUsSUFBSSxXQUFXO0FBRTNELGFBQU8sT0FBTyxVQUFVLFdBQVc7QUFDbkMsVUFBSSxPQUFPO0FBQ1Qsa0JBQVUsWUFBWSxhQUFhO0FBQUEsTUFDckM7QUFDQSxnQkFBVSxRQUFRLEdBQUc7QUFBQSxJQUN2QixTQUFTLEdBQVA7QUFDQSxXQUFLLE9BQU8sTUFBTSw4QkFBOEIsQ0FBQztBQUFBLElBQ25EO0FBQUEsRUFDRjtBQUNGO0FBRUEsSUFBTyx3QkFBUTs7O0FDMUZmLElBQU0sbUJBQU4sTUFBdUI7QUFBQSxFQUNiO0FBQUEsRUFFUztBQUFBLEVBRWpCLGNBQWM7QUFDWixTQUFLLGdCQUFnQixJQUFJLHNCQUFjO0FBQUEsRUFDekM7QUFBQSxFQUVBLEtBQUssUUFBYSxRQUFhO0FBQzdCLFNBQUssU0FBUztBQUNkLFNBQUssY0FBYyxLQUFLLFFBQVEsTUFBTTtBQUFBLEVBQ3hDO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFRTyxvQkFBb0I7QUFDekIsTUFBYSxhQUFhLEVBQUUsWUFBWSxLQUFLO0FBQzdDLFNBQUssT0FBTyxLQUFLLG1CQUFtQjtBQUFBLEVBQ3RDO0FBQ0Y7QUFFQSxJQUFPLHlCQUFROyIsCiAgIm5hbWVzIjogW10KfQo= diff --git a/public/libs/zhi-env/README.md b/public/libs/zhi-env/README.md deleted file mode 100644 index 3a899e50..00000000 --- a/public/libs/zhi-env/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# zhi-env - -a cross-platform env config lib - -## Usage - -For simple use - -```js -import { Env } from "zhi-env" - -const env = new Env({ - "some-key": "some-value", -}) -const val = env.getEnv("some-key") -console.log("val=>", val) -``` - -For `vite` - -```js -import { Env } from "zhi-env" - -const env = new Env(import.meta.env) -const val = env.getEnv("some-key") -console.log("val=>", val) -``` - -For `Nuxt` framework - -```ts -// https://github.com/vitejs/vite/issues/9539#issuecomment-1206301266 - -import { Env } from "zhi-env" - -const nuxtEnv = useRuntimeConfig() -const env = new Env(nuxtEnv) -// 访问公共变量 -// const env = new Env(nuxtEnv.public) - -const val = env.getEnv("some-key") -console.log("val=>", val) -``` - -For Astro framework or other libs - -```ts -import { Env } from "zhi-env" - -// 1 add "module": "esnext" to tsconfig.json -// add "target": "esnext" to tsconfig.json -// 2 add env.d.ts -// ``` -// interface ImportMeta { -// readonly env: ImportMetaEnv -// } -// ``` -// 3 (optional) if you are using esbuild, add define to esbuild. -// ``` -// const defineEnv = { -// NODE_ENV: isProduction ? "production" : "development", -// ...getNormalizedEnvDefines(["NODE", "VITE_"]), -// } -// bundledEsbuildConfig.define = {} -// bundledEsbuildConfig.define = { -// ...bundledEsbuildConfig.define, -// "import.meta.env": JSON.stringify(defineEnv), -// } -// ``` - -const envMeta = import.meta.env -const env = new Env(import.meta.env) - -const val = env.getEnv("some-key") -console.log("val=>", val) -``` - -For unit tests - -- vitestrecommend - -```ts -// simple -describe("zhiEnv", () => { - it("test env", () => { - const env = new Env(import.meta.env) - expect(env.getEnv(EnvConstants.NODE_ENV_KEY)).toEqual("test") - }) -}) -``` - -- jest - -```ts -import { getNormalizedEnvDefines } from "../../../packages/esbuild-config-custom/esmUtils" - -describe("zhiEnv", () => { - const NOT_EXIST_KEY = "NOT_EXIST_KEY" - getNormalizedEnvDefines(["NODE", "VITE_"]) - - it("test env", () => { - const env = new Env(import.meta.env) - expect(env.getEnv(EnvConstants.NODE_ENV_KEY)).toEqual("test") - }) - - it("test debug mode", () => { - const env = new Env(import.meta.env) - expect(env.getEnv(EnvConstants.VITE_DEBUG_MODE_KEY)).toEqual("true") - }) -}) -``` - -## Deps - -``` -## Congregations! zhi-env need no deps, it is just pure js code 🎉 -``` - -## Dev - -```bash -pnpm dev -F zhi-env -``` - -## Build - -```bash -pnpm build -F zhi-env -``` - -## Api - -```bash -pnpm doc -F zhi-env -pnpm md -F zhi-env -``` - -## Test - -Execute the unit tests via [vitest](https://vitest.dev) - -```bash -pnpm test -F zhi-env -``` - -## Publish - -```bash -pnpm publish -F zhi-env --tag latest -``` \ No newline at end of file diff --git a/public/libs/zhi-env/index.d.ts b/public/libs/zhi-env/index.d.ts deleted file mode 100644 index 8a47b85b..00000000 --- a/public/libs/zhi-env/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @packageDocumentation - * zhi-env 通用环境变量模块 - */ -import EnvConstants from "./lib/EnvConstants"; -import Env from "./lib/zhi-env"; -export { Env }; -export { EnvConstants }; diff --git a/public/libs/zhi-env/index.js b/public/libs/zhi-env/index.js deleted file mode 100644 index a12dc8f0..00000000 --- a/public/libs/zhi-env/index.js +++ /dev/null @@ -1,88 +0,0 @@ -var _ = Object.defineProperty; -var D = (i, t, e) => t in i ? _(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e; -var r = (i, t, e) => (D(i, typeof t != "symbol" ? t + "" : t, e), e); -class E { -} -/** - * Node环境 - */ -r(E, "NODE_ENV_KEY", "NODE_ENV"), /** - * 开发环境 - */ -r(E, "NODE_ENV_DEVELOPMENT", "development"), /** - * 生产环境 - */ -r(E, "NODE_ENV_PRODUCTION", "production"), /** - * 测试环境 - */ -r(E, "NODE_ENV_TEST", "test"), /** - * 是否处于调试模式 - */ -r(E, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -class N { - /** - * 环境初始化 - * - * @param envMeta - 需要传入 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false} 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(t) { - r(this, "envMeta"); - this.envMeta = t; - } - /** - * 是否是开发阶段调试 - */ - isNodeDev() { - return this.getEnv(E.NODE_ENV_KEY) === E.NODE_ENV_DEVELOPMENT; - } - /** - * 是否是调试阶段 - */ - isDev() { - return this.isNodeDev() || this.getBooleanEnv(E.VITE_DEBUG_MODE_KEY); - } - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(t) { - let e; - try { - this.envMeta[t] && (e = this.envMeta[t]); - } catch { - } - return e; - } - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(t) { - return this.getEnv(t) ?? ""; - } - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(t) { - let e = !1; - return this.getEnv(t) && (e = this.getStringEnv(t).toLowerCase() === "true"), e; - } - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(t, e) { - const n = this.getStringEnv(t); - return n.trim().length == 0 ? e : n; - } -} -export { - N as Env, - E as EnvConstants -}; diff --git a/public/libs/zhi-env/lib/EnvConstants.d.ts b/public/libs/zhi-env/lib/EnvConstants.d.ts deleted file mode 100644 index b72bb166..00000000 --- a/public/libs/zhi-env/lib/EnvConstants.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 预定义的环境变量 - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare class EnvConstants { - /** - * Node环境 - */ - static NODE_ENV_KEY: string; - /** - * 开发环境 - */ - static NODE_ENV_DEVELOPMENT: string; - /** - * 生产环境 - */ - static NODE_ENV_PRODUCTION: string; - /** - * 测试环境 - */ - static NODE_ENV_TEST: string; - /** - * 是否处于调试模式 - */ - static VITE_DEBUG_MODE_KEY: string; -} -export default EnvConstants; diff --git a/public/libs/zhi-env/lib/zhi-env.d.ts b/public/libs/zhi-env/lib/zhi-env.d.ts deleted file mode 100644 index 4420f7df..00000000 --- a/public/libs/zhi-env/lib/zhi-env.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 环境变量工具类 - * - * @public - * @author terwer - * @description 跨平台环境变量读取 - * @since 0.0.1 - */ -declare class Env { - private readonly envMeta; - /** - * 是否是开发阶段调试 - */ - isNodeDev(): boolean; - /** - * 是否是调试阶段 - */ - isDev(): boolean; - /** - * 环境初始化 - * - * @param envMeta - 需要传入 import.meta.env 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(envMeta: any); - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(key: string): string | undefined; - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(key: string): string; - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(key: string): boolean; - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(key: string, defaultValue: string): string; -} -export default Env; diff --git a/public/libs/zhi-env/package.json b/public/libs/zhi-env/package.json deleted file mode 100644 index fae563ff..00000000 --- a/public/libs/zhi-env/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "zhi-env", - "version": "1.17.1", - "type": "module", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "description": "a cross-platform env config lib", - "repository": "terwer/zhi", - "homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-env", - "author": "terwer", - "license": "GPL", - "files": [ - "dist", - "README.md" - ], - "keywords": [ - "zhi-env", - "zhi", - "env" - ], - "scripts": { - "serve": "vite", - "dev": "vite build --watch", - "build": "vite build", - "start": "vite preview", - "test": "vitest --watch" - }, - "devDependencies": { - "@terwer/eslint-config-custom": "workspace:*", - "@terwer/tsconfig": "workspace:*", - "@terwer/vite-config-custom": "workspace:*" - } -} diff --git a/public/libs/zhi-log/README.md b/public/libs/zhi-log/README.md deleted file mode 100644 index 8be0f792..00000000 --- a/public/libs/zhi-log/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# zhi-log - -a simple logger for Node and Browser - -## Usage - -```ts -import { LogFactory } from "zhi-log" - -const env = new Env(import.meta.env) -const logger = LogFactory.defaultLogger(env) -logger.debug("debug msg") -logger.info("info msg") -logger.error("error msg") -``` - -## Deps - -``` -├── zhi-device -├── zhi-env -├── loglevel -├── callsites -├── loglevel-plugin-prefix -├── ansi-colors -├── kleur -``` - -## Dev - -```bash -pnpm dev -F zhi-log -``` - -## Build - -```bash -pnpm build -F zhi-log -``` - -## Api - -```bash -pnpm doc -F zhi-log -pnpm md -F zhi-log -``` - -## Test - -Execute the unit tests via [vitest](https://vitest.dev) - -```bash -pnpm test -F zhi-log -``` - -## Publish - -``` -pnpm publish -F zhi-log --tag=latest -``` \ No newline at end of file diff --git a/public/libs/zhi-log/index.d.ts b/public/libs/zhi-log/index.d.ts deleted file mode 100644 index acbc552d..00000000 --- a/public/libs/zhi-log/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @packageDocumentation - * zhi-log 多平台日志模块 - */ -import { Env } from "zhi-env"; -import LogLevelEnum, { LogConstants } from "./lib/logConstants"; -import AbstractLogFactory from "./lib/factory/abstractLogFactory"; -import CustomLogFactory from "./lib/factory/customLogFactory"; -import DefaultLogger from "./lib/defaultLogger"; -import EnvHelper from "./lib/envHelper"; -import crossChalk from "./lib/crossChalk"; -/** - * 日志工具类 - * - * @public - * @author terwer - * @since 1.0.7 - */ -declare class LogFactory { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(env?: Env, stackSize?: number): DefaultLogger; - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(level?: LogLevelEnum, sign?: string, env?: Env): CustomLogFactory; - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(sign?: string, env?: Env): CustomLogFactory; -} -export { LogFactory }; -export { LogLevelEnum, AbstractLogFactory, CustomLogFactory }; -export { LogConstants, EnvHelper }; -export { crossChalk }; -export type { DefaultLogger }; diff --git a/public/libs/zhi-log/index.js b/public/libs/zhi-log/index.js deleted file mode 100644 index 65ff5201..00000000 --- a/public/libs/zhi-log/index.js +++ /dev/null @@ -1,992 +0,0 @@ -var ce = Object.defineProperty; -var ue = (e, r, t) => r in e ? ce(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t; -var C = (e, r, t) => (ue(e, typeof r != "symbol" ? r + "" : r, t), t); -class D { -} -C(D, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), C(D, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX"); -var S = /* @__PURE__ */ ((e) => (e.LOG_LEVEL_TRACE = "TRACE", e.LOG_LEVEL_DEBUG = "DEBUG", e.LOG_LEVEL_INFO = "INFO", e.LOG_LEVEL_WARN = "WARN", e.LOG_LEVEL_ERROR = "ERROR", e))(S || {}), ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function Y(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var te = { exports: {} }; -(function(e) { - (function(r, t) { - e.exports ? e.exports = t() : r.log = t(); - })(ee, function() { - var r = function() { - }, t = "undefined", o = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), n = [ - "trace", - "debug", - "info", - "warn", - "error" - ]; - function i(d, y) { - var m = d[y]; - if (typeof m.bind == "function") - return m.bind(d); - try { - return Function.prototype.bind.call(m, d); - } catch { - return function() { - return Function.prototype.apply.apply(m, [d, arguments]); - }; - } - } - function s() { - console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace(); - } - function u(d) { - return d === "debug" && (d = "log"), typeof console === t ? !1 : d === "trace" && o ? s : console[d] !== void 0 ? i(console, d) : console.log !== void 0 ? i(console, "log") : r; - } - function g(d, y) { - for (var m = 0; m < n.length; m++) { - var f = n[m]; - this[f] = m < d ? r : this.methodFactory(f, d, y); - } - this.log = this.debug; - } - function c(d, y, m) { - return function() { - typeof console !== t && (g.call(this, y, m), this[d].apply(this, arguments)); - }; - } - function a(d, y, m) { - return u(d) || c.apply(this, arguments); - } - function v(d, y, m) { - var f = this, F; - y = y ?? "WARN"; - var w = "loglevel"; - typeof d == "string" ? w += ":" + d : typeof d == "symbol" && (w = void 0); - function j(h) { - var L = (n[h] || "silent").toUpperCase(); - if (!(typeof window === t || !w)) { - try { - window.localStorage[w] = L; - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(w) + "=" + L + ";"; - } catch { - } - } - } - function N() { - var h; - if (!(typeof window === t || !w)) { - try { - h = window.localStorage[w]; - } catch { - } - if (typeof h === t) - try { - var L = window.document.cookie, I = L.indexOf( - encodeURIComponent(w) + "=" - ); - I !== -1 && (h = /^([^;]+)/.exec(L.slice(I))[1]); - } catch { - } - return f.levels[h] === void 0 && (h = void 0), h; - } - } - function U() { - if (!(typeof window === t || !w)) { - try { - window.localStorage.removeItem(w); - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(w) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; - } catch { - } - } - } - f.name = d, f.levels = { - TRACE: 0, - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - SILENT: 5 - }, f.methodFactory = m || a, f.getLevel = function() { - return F; - }, f.setLevel = function(h, L) { - if (typeof h == "string" && f.levels[h.toUpperCase()] !== void 0 && (h = f.levels[h.toUpperCase()]), typeof h == "number" && h >= 0 && h <= f.levels.SILENT) { - if (F = h, L !== !1 && j(h), g.call(f, h, d), typeof console === t && h < f.levels.SILENT) - return "No console available for logging"; - } else - throw "log.setLevel() called with invalid level: " + h; - }, f.setDefaultLevel = function(h) { - y = h, N() || f.setLevel(h, !1); - }, f.resetLevel = function() { - f.setLevel(y, !1), U(); - }, f.enableAll = function(h) { - f.setLevel(f.levels.TRACE, h); - }, f.disableAll = function(h) { - f.setLevel(f.levels.SILENT, h); - }; - var T = N(); - T == null && (T = y), f.setLevel(T, !1); - } - var B = new v(), k = {}; - B.getLogger = function(y) { - if (typeof y != "symbol" && typeof y != "string" || y === "") - throw new TypeError("You must supply a name when creating a logger."); - var m = k[y]; - return m || (m = k[y] = new v( - y, - B.getLevel(), - B.methodFactory - )), m; - }; - var q = typeof window !== t ? window.log : void 0; - return B.noConflict = function() { - return typeof window !== t && window.log === B && (window.log = q), B; - }, B.getLoggers = function() { - return k; - }, B.default = B, B; - }); -})(te); -var ge = te.exports; -const W = /* @__PURE__ */ Y(ge); -var re = { exports: {} }; -(function(e) { - (function(r, t) { - e.exports ? e.exports = t() : r.prefix = t(r); - })(ee, function(r) { - var t = function(a) { - for (var v = 1, B = arguments.length, k; v < B; v++) - for (k in arguments[v]) - Object.prototype.hasOwnProperty.call(arguments[v], k) && (a[k] = arguments[v][k]); - return a; - }, o = { - template: "[%t] %l:", - levelFormatter: function(a) { - return a.toUpperCase(); - }, - nameFormatter: function(a) { - return a || "root"; - }, - timestampFormatter: function(a) { - return a.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); - }, - format: void 0 - }, n, i = {}, s = function(a) { - if (!a || !a.getLogger) - throw new TypeError("Argument is not a root logger"); - n = a; - }, u = function(a, v) { - if (!a || !a.setLevel) - throw new TypeError("Argument is not a logger"); - var B = a.methodFactory, k = a.name || "", q = i[k] || i[""] || o; - function d(y, m, f) { - var F = B(y, m, f), w = i[f] || i[""], j = w.template.indexOf("%t") !== -1, N = w.template.indexOf("%l") !== -1, U = w.template.indexOf("%n") !== -1; - return function() { - for (var T = "", h = arguments.length, L = Array(h), I = 0; I < h; I++) - L[I] = arguments[I]; - if (k || !i[f]) { - var G = w.timestampFormatter(/* @__PURE__ */ new Date()), J = w.levelFormatter(y), Z = w.nameFormatter(f); - w.format ? T += w.format(J, Z, G) : (T += w.template, j && (T = T.replace(/%t/, G)), N && (T = T.replace(/%l/, J)), U && (T = T.replace(/%n/, Z))), L.length && typeof L[0] == "string" ? L[0] = T + " " + L[0] : L.unshift(T); - } - F.apply(void 0, L); - }; - } - return i[k] || (a.methodFactory = d), v = v || {}, v.template && (v.format = void 0), i[k] = t({}, q, v), a.setLevel(a.getLevel()), n || a.warn( - "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md" - ), a; - }, g = { - reg: s, - apply: u - }, c; - return r && (c = r.prefix, g.noConflict = function() { - return r.prefix === g && (r.prefix = c), g; - }), g; - }); -})(re); -var he = re.exports; -const K = /* @__PURE__ */ Y(he); -function fe() { - const e = Error.prepareStackTrace; - Error.prepareStackTrace = (t, o) => o; - const r = new Error().stack.slice(1); - return Error.prepareStackTrace = e, r; -} -class V { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - static stringToEnumValue(r, t) { - return r[Object.keys(r).filter((o) => r[o].toString() === t)[0]]; - } - /** - * 获取配置的日志级别 - */ - static getEnvLevel(r) { - if (!r) - return; - const t = r.getEnvOrDefault(D.LOG_LEVEL_KEY, S.LOG_LEVEL_INFO), o = V.stringToEnumValue(S, t.toUpperCase()); - return o || console.warn( - "[zhi-log] LOG_LEVEL is invalid in you .env file.It must be either debug, info, warn or error, fallback to default info level" - ), o; - } - /** - * 获取默认日志 - */ - static getEnvLogger(r) { - return r ? r.getEnv(D.LOG_PREFIX_KEY) : void 0; - } -} -var z = { exports: {} }, M = { exports: {} }, X; -function pe() { - return X || (X = 1, function(e) { - const r = typeof process < "u" && process.env.TERM_PROGRAM === "Hyper", t = typeof process < "u" && process.platform === "win32", o = typeof process < "u" && process.platform === "linux", n = { - ballotDisabled: "☒", - ballotOff: "☐", - ballotOn: "☑", - bullet: "•", - bulletWhite: "◦", - fullBlock: "█", - heart: "❤", - identicalTo: "≡", - line: "─", - mark: "※", - middot: "·", - minus: "-", - multiplication: "×", - obelus: "÷", - pencilDownRight: "✎", - pencilRight: "✏", - pencilUpRight: "✐", - percent: "%", - pilcrow2: "❡", - pilcrow: "¶", - plusMinus: "±", - question: "?", - section: "§", - starsOff: "☆", - starsOn: "★", - upDownArrow: "↕" - }, i = Object.assign({}, n, { - check: "√", - cross: "×", - ellipsisLarge: "...", - ellipsis: "...", - info: "i", - questionSmall: "?", - pointer: ">", - pointerSmall: "»", - radioOff: "( )", - radioOn: "(*)", - warning: "‼" - }), s = Object.assign({}, n, { - ballotCross: "✘", - check: "✔", - cross: "✖", - ellipsisLarge: "⋯", - ellipsis: "…", - info: "ℹ", - questionFull: "?", - questionSmall: "﹖", - pointer: o ? "▸" : "❯", - pointerSmall: o ? "‣" : "›", - radioOff: "◯", - radioOn: "◉", - warning: "⚠" - }); - e.exports = t && !r ? i : s, Reflect.defineProperty(e.exports, "common", { enumerable: !1, value: n }), Reflect.defineProperty(e.exports, "windows", { enumerable: !1, value: i }), Reflect.defineProperty(e.exports, "other", { enumerable: !1, value: s }); - }(M)), M.exports; -} -const de = (e) => e !== null && typeof e == "object" && !Array.isArray(e), be = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, ye = () => typeof process < "u" ? process.env.FORCE_COLOR !== "0" : !1, ne = () => { - const e = { - enabled: ye(), - visible: !0, - styles: {}, - keys: {} - }, r = (i) => { - let s = i.open = `\x1B[${i.codes[0]}m`, u = i.close = `\x1B[${i.codes[1]}m`, g = i.regex = new RegExp(`\\u001b\\[${i.codes[1]}m`, "g"); - return i.wrap = (c, a) => { - c.includes(u) && (c = c.replace(g, u + s)); - let v = s + c + u; - return a ? v.replace(/\r*\n/g, `${u}$&${s}`) : v; - }, i; - }, t = (i, s, u) => typeof i == "function" ? i(s) : i.wrap(s, u), o = (i, s) => { - if (i === "" || i == null) - return ""; - if (e.enabled === !1) - return i; - if (e.visible === !1) - return ""; - let u = "" + i, g = u.includes(` -`), c = s.length; - for (c > 0 && s.includes("unstyle") && (s = [.../* @__PURE__ */ new Set(["unstyle", ...s])].reverse()); c-- > 0; ) - u = t(e.styles[s[c]], u, g); - return u; - }, n = (i, s, u) => { - e.styles[i] = r({ name: i, codes: s }), (e.keys[u] || (e.keys[u] = [])).push(i), Reflect.defineProperty(e, i, { - configurable: !0, - enumerable: !0, - set(c) { - e.alias(i, c); - }, - get() { - let c = (a) => o(a, c.stack); - return Reflect.setPrototypeOf(c, e), c.stack = this.stack ? this.stack.concat(i) : [i], c; - } - }); - }; - return n("reset", [0, 0], "modifier"), n("bold", [1, 22], "modifier"), n("dim", [2, 22], "modifier"), n("italic", [3, 23], "modifier"), n("underline", [4, 24], "modifier"), n("inverse", [7, 27], "modifier"), n("hidden", [8, 28], "modifier"), n("strikethrough", [9, 29], "modifier"), n("black", [30, 39], "color"), n("red", [31, 39], "color"), n("green", [32, 39], "color"), n("yellow", [33, 39], "color"), n("blue", [34, 39], "color"), n("magenta", [35, 39], "color"), n("cyan", [36, 39], "color"), n("white", [37, 39], "color"), n("gray", [90, 39], "color"), n("grey", [90, 39], "color"), n("bgBlack", [40, 49], "bg"), n("bgRed", [41, 49], "bg"), n("bgGreen", [42, 49], "bg"), n("bgYellow", [43, 49], "bg"), n("bgBlue", [44, 49], "bg"), n("bgMagenta", [45, 49], "bg"), n("bgCyan", [46, 49], "bg"), n("bgWhite", [47, 49], "bg"), n("blackBright", [90, 39], "bright"), n("redBright", [91, 39], "bright"), n("greenBright", [92, 39], "bright"), n("yellowBright", [93, 39], "bright"), n("blueBright", [94, 39], "bright"), n("magentaBright", [95, 39], "bright"), n("cyanBright", [96, 39], "bright"), n("whiteBright", [97, 39], "bright"), n("bgBlackBright", [100, 49], "bgBright"), n("bgRedBright", [101, 49], "bgBright"), n("bgGreenBright", [102, 49], "bgBright"), n("bgYellowBright", [103, 49], "bgBright"), n("bgBlueBright", [104, 49], "bgBright"), n("bgMagentaBright", [105, 49], "bgBright"), n("bgCyanBright", [106, 49], "bgBright"), n("bgWhiteBright", [107, 49], "bgBright"), e.ansiRegex = be, e.hasColor = e.hasAnsi = (i) => (e.ansiRegex.lastIndex = 0, typeof i == "string" && i !== "" && e.ansiRegex.test(i)), e.alias = (i, s) => { - let u = typeof s == "string" ? e[s] : s; - if (typeof u != "function") - throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); - u.stack || (Reflect.defineProperty(u, "name", { value: i }), e.styles[i] = u, u.stack = [i]), Reflect.defineProperty(e, i, { - configurable: !0, - enumerable: !0, - set(g) { - e.alias(i, g); - }, - get() { - let g = (c) => o(c, g.stack); - return Reflect.setPrototypeOf(g, e), g.stack = this.stack ? this.stack.concat(u.stack) : u.stack, g; - } - }); - }, e.theme = (i) => { - if (!de(i)) - throw new TypeError("Expected theme to be an object"); - for (let s of Object.keys(i)) - e.alias(s, i[s]); - return e; - }, e.alias("unstyle", (i) => typeof i == "string" && i !== "" ? (e.ansiRegex.lastIndex = 0, i.replace(e.ansiRegex, "")) : ""), e.alias("noop", (i) => i), e.none = e.clear = e.noop, e.stripColor = e.unstyle, e.symbols = pe(), e.define = n, e; -}; -z.exports = ne(); -z.exports.create = ne; -var we = z.exports; -const _ = /* @__PURE__ */ Y(we); -let $, ie, oe, ae, se = !0; -typeof process < "u" && ({ FORCE_COLOR: $, NODE_DISABLE_COLORS: ie, NO_COLOR: oe, TERM: ae } = process.env || {}, se = process.stdout && process.stdout.isTTY); -const l = { - enabled: !ie && oe == null && ae !== "dumb" && ($ != null && $ !== "0" || se), - // modifiers - reset: b(0, 0), - bold: b(1, 22), - dim: b(2, 22), - italic: b(3, 23), - underline: b(4, 24), - inverse: b(7, 27), - hidden: b(8, 28), - strikethrough: b(9, 29), - // colors - black: b(30, 39), - red: b(31, 39), - green: b(32, 39), - yellow: b(33, 39), - blue: b(34, 39), - magenta: b(35, 39), - cyan: b(36, 39), - white: b(37, 39), - gray: b(90, 39), - grey: b(90, 39), - // background colors - bgBlack: b(40, 49), - bgRed: b(41, 49), - bgGreen: b(42, 49), - bgYellow: b(43, 49), - bgBlue: b(44, 49), - bgMagenta: b(45, 49), - bgCyan: b(46, 49), - bgWhite: b(47, 49) -}; -function H(e, r) { - let t = 0, o, n = "", i = ""; - for (; t < e.length; t++) - o = e[t], n += o.open, i += o.close, ~r.indexOf(o.close) && (r = r.replace(o.rgx, o.close + o.open)); - return n + r + i; -} -function me(e, r) { - let t = { has: e, keys: r }; - return t.reset = l.reset.bind(t), t.bold = l.bold.bind(t), t.dim = l.dim.bind(t), t.italic = l.italic.bind(t), t.underline = l.underline.bind(t), t.inverse = l.inverse.bind(t), t.hidden = l.hidden.bind(t), t.strikethrough = l.strikethrough.bind(t), t.black = l.black.bind(t), t.red = l.red.bind(t), t.green = l.green.bind(t), t.yellow = l.yellow.bind(t), t.blue = l.blue.bind(t), t.magenta = l.magenta.bind(t), t.cyan = l.cyan.bind(t), t.white = l.white.bind(t), t.gray = l.gray.bind(t), t.grey = l.grey.bind(t), t.bgBlack = l.bgBlack.bind(t), t.bgRed = l.bgRed.bind(t), t.bgGreen = l.bgGreen.bind(t), t.bgYellow = l.bgYellow.bind(t), t.bgBlue = l.bgBlue.bind(t), t.bgMagenta = l.bgMagenta.bind(t), t.bgCyan = l.bgCyan.bind(t), t.bgWhite = l.bgWhite.bind(t), t; -} -function b(e, r) { - let t = { - open: `\x1B[${e}m`, - close: `\x1B[${r}m`, - rgx: new RegExp(`\\x1b\\[${r}m`, "g") - }; - return function(o) { - return this !== void 0 && this.has !== void 0 ? (~this.has.indexOf(e) || (this.has.push(e), this.keys.push(t)), o === void 0 ? this : l.enabled ? H(this.keys, o + "") : o + "") : o === void 0 ? me([e], [t]) : l.enabled ? H([t], o + "") : o + ""; - }; -} -var ve = Object.defineProperty, Ee = (e, r, t) => r in e ? ve(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, E = (e, r, t) => (Ee(e, typeof r != "symbol" ? r + "" : r, t), t); -const x = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return x.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let p = x; -E(p, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -E(p, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -E(p, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -E(p, "isElectron", () => !x.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -E(p, "hasNodeEnv", () => x.isElectron() || x.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -E(p, "getQueryString", (e) => { - if (!x.isInBrowser) - return ""; - const r = window.location.search.substring(1).split("&"); - for (let t = 0; t < r.length; t++) { - const o = r[t].split("="); - if (o[0] === e) - return o[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -E(p, "replaceUrlParam", (e, r, t) => { - t == null && (t = ""); - const o = new RegExp("\\b(" + r + "=).*?(&|#|$)"); - if (e.search(o) >= 0) - return e.replace(o, "$1" + t + "$2"); - const [n, i] = e.split("#"), [s, u] = n.split("?"), g = new URLSearchParams(u); - g.set(r, t); - const c = g.toString(), a = s + (c ? "?" + c : ""); - return i ? a + "#" + i : a; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -E(p, "setUrlParameter", (e, r, t) => { - if (e.includes(r)) - return x.replaceUrlParam(e, r, t); - const o = e.split("#"); - let n = o[0]; - const i = o[1]; - return n.includes("?") ? n += `&${r}=${t}` : n += `?${r}=${t}`, i && (n += "#" + i), n; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -E(p, "reloadTabPage", (e, r = 200) => { - setTimeout(function() { - if (x.isInBrowser) { - const t = window.location.href; - window.location.href = x.setUrlParameter(t, "tab", e); - } - }, r); -}), /** -* 刷新当前tab页面 -*/ -E(p, "reloadPage", () => { - setTimeout(function() { - x.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -E(p, "reloadPageWithMessageCallback", (e, r) => { - r && r(e), setTimeout(function() { - x.isInBrowser && window.location.reload(); - }, 200); -}); -var P = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(P || {}); -const R = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return p.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, r) { - let t = e; - switch (r) { - case P.BasePathType_Appearance: - t = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case P.BasePathType_Data: - t = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case P.BasePathType_Themes: - t = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case P.BasePathType_ZhiTheme: - t = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: o } = await import( - /* @vite-ignore */ - t - ); - return o; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, P.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (p.hasNodeEnv()) { - const r = this.requireLib("path"); - if (r) - return r.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(p.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (p.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let A = R; -E(A, "isInSiyuanWidget", () => p.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -E(A, "isInSiyuanNewWin", () => !p.isInBrowser || !p.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -E(A, "requireLib", (e, r = !0, t = P.BasePathType_None) => { - if (!p.hasNodeEnv()) - throw new Error("require ony works on node env"); - let o = e; - if (!r) - switch (t) { - case P.BasePathType_Appearance: - o = R.joinPath(R.siyuanAppearancePath(), e); - break; - case P.BasePathType_Data: - o = R.joinPath(R.siyuanDataPath(), e); - break; - case P.BasePathType_Themes: - o = R.joinPath(R.siyuanAppearancePath(), "themes", e); - break; - case P.BasePathType_ZhiTheme: - o = R.joinPath(R.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const n = R.siyuanWindow(); - if (!n) - return require(o); - if (typeof n.require < "u") - return n.require(o); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -E(A, "requireAppearanceLib", (e) => R.requireLib(e, !1, P.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -E(A, "requireDataLib", (e) => R.requireLib(e, !1, P.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -E(A, "requireThemesLib", (e) => R.requireLib(e, !1, P.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -E(A, "requireZhiThemeLib", (e) => R.requireLib(e, !1, P.BasePathType_ZhiTheme)); -const O = { - white: (e) => p.isElectron() ? _.whiteBright(e) : l.white(e), - gray: (e) => p.isElectron() ? _.gray(e) : l.gray(e), - blue: (e) => p.isElectron() ? _.blue(e) : l.blue(e), - green: (e) => p.isElectron() ? _.green(e) : l.green(e), - yellow: (e) => p.isElectron() ? _.yellow(e) : l.yellow(e), - red: (e) => p.isElectron() ? _.red(e) : l.red(e), - bgWhite: (e) => p.isElectron() ? _.bgWhiteBright(e) : l.bgWhite(e), - bgGrey: (e) => p.isElectron() ? _.bgCyanBright(e) : l.bgCyan(e), - bgBlue: (e) => p.isElectron() ? _.bgBlueBright(e) : l.bgBlue(e), - bgGreen: (e) => p.isElectron() ? _.bgGreenBright(e) : l.bgGreen(e), - bgYellow: (e) => p.isElectron() ? _.bgYellowBright(e) : l.bgYellow(e), - bgRed: (e) => p.isElectron() ? _.bgRedBright(e) : l.bgRed(e) -}; -class Le { - constructor(r, t, o) { - C(this, "consoleLogger", "console"); - C(this, "stackSize", 1); - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器,默认为 console - * @author terwer - * @since 1.0.0 - */ - C(this, "getLogger", (r) => { - let t; - if (r) - t = r; - else { - const o = this.getCallStack(), n = [], i = []; - for (let s = 0; s < o.length; s++) { - const u = o[s], g = u.getFileName() ?? "none"; - if (s > this.stackSize - 1) - break; - const c = g + "-" + u.getLineNumber() + ":" + u.getColumnNumber(); - n.push(c); - } - i.length > 0 && (t = n.join(" -> ")); - } - return (!t || t.trim().length === 0) && (t = this.consoleLogger), W.getLogger(t); - }); - this.stackSize = 1; - let n; - r ? n = r : n = V.getEnvLevel(o), n = n ?? S.LOG_LEVEL_INFO, W.setLevel(n); - const i = (s, u, g, c) => { - const a = [], v = t ?? V.getEnvLogger(o) ?? "zhi"; - return a.push(O.gray("[") + c(v) + O.gray("]")), a.push(O.gray("[") + O.gray(g.toString()) + O.gray("]")), a.push(c(s.toUpperCase().toString())), a.push(c(u)), a.push(O.gray(":")), a; - }; - K.reg(W), K.apply(W, { - format(s, u, g) { - let c = []; - const a = u ?? ""; - switch (s) { - case S.LOG_LEVEL_TRACE: - c = i(s, a, g, O.gray); - break; - case S.LOG_LEVEL_DEBUG: - c = i(s, a, g, O.blue); - break; - case S.LOG_LEVEL_INFO: - c = i(s, a, g, O.green); - break; - case S.LOG_LEVEL_WARN: - c = i(s, a, g, O.yellow); - break; - case S.LOG_LEVEL_ERROR: - c = i(s, a, g, O.red); - break; - default: - c = i(S.LOG_LEVEL_INFO, a, g, O.green); - break; - } - return c.join(" "); - } - }); - } - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(r) { - this.stackSize = r ?? 1; - } - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack() { - let r; - try { - r = fe(); - } catch { - r = []; - } - return r; - } -} -class Pe { - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - constructor(r, t, o) { - C(this, "logger"); - this.logger = new Le(r, t, o); - } - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - getLogger(r, t) { - return this.logger.setStackSize(t), this.logger.getLogger(r); - } -} -class Q extends Pe { - constructor(r, t, o) { - super(r, t, o); - } - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(r, t) { - return super.getLogger(r, t); - } -} -class le { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(r, t) { - return le.customLogFactory(void 0, void 0, r).getLogger(void 0, t); - } - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(r, t, o) { - return new Q(r, t, o); - } - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(r, t) { - return new Q(void 0, r, t); - } -} -export { - Pe as AbstractLogFactory, - Q as CustomLogFactory, - V as EnvHelper, - D as LogConstants, - le as LogFactory, - S as LogLevelEnum, - O as crossChalk -}; diff --git a/public/libs/zhi-log/lib/crossChalk.d.ts b/public/libs/zhi-log/lib/crossChalk.d.ts deleted file mode 100644 index e453fdea..00000000 --- a/public/libs/zhi-log/lib/crossChalk.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 跨平台,同时支持Node和浏览器的颜色解决方案 - * - * @public - * @author terwer - * @version 1.9.2 - * @since 1.9.2 - */ -declare const crossChalk: { - white: (str: string) => string; - gray: (str: string) => string; - blue: (str: string) => string; - green: (str: string) => string; - yellow: (str: string) => string; - red: (str: string) => string; - bgWhite: (str: string) => string; - bgGrey: (str: string) => string; - bgBlue: (str: string) => string; - bgGreen: (str: string) => string; - bgYellow: (str: string) => string; - bgRed: (str: string) => string; -}; -export default crossChalk; diff --git a/public/libs/zhi-log/lib/defaultLogger.d.ts b/public/libs/zhi-log/lib/defaultLogger.d.ts deleted file mode 100644 index a178a65e..00000000 --- a/public/libs/zhi-log/lib/defaultLogger.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Logger } from "loglevel"; -/** - * 默认日志记录器 - * - * @public - * @author terwer - * @since 1.0.7 - */ -interface DefaultLogger extends Logger { - /** - * 日志颜色 - */ - colors?: string[]; - /** - * Output trace message to console. - * This will also include a full stack trace - * - * @param msg - unknown data to log to the console - */ - trace(...msg: unknown[]): void; - /** - * Output debug message to console including appropriate icons - * - * @param msg - unknown data to log to the console - */ - debug(...msg: unknown[]): void; - /** - * Output debug message to console including appropriate icons - * - * @param msg - unknown data to log to the console - */ - log(...msg: unknown[]): void; - /** - * Output info message to console including appropriate icons - * - * @param msg - unknown data to log to the console - */ - info(...msg: unknown[]): void; - /** - * Output warn message to console including appropriate icons - * - * @param msg - unknown data to log to the console - */ - warn(...msg: unknown[]): void; - /** - * Output error message to console including appropriate icons - * - * @param msg - unknown data to log to the console - */ - error(...msg: unknown[]): void; -} -export default DefaultLogger; diff --git a/public/libs/zhi-log/lib/envHelper.d.ts b/public/libs/zhi-log/lib/envHelper.d.ts deleted file mode 100644 index df59742d..00000000 --- a/public/libs/zhi-log/lib/envHelper.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import LogLevelEnum from "./logConstants"; -import { Env } from "zhi-env"; -/** - * 解析日志级别为枚举 - * - * @public - * @author terwer - * @since 1.4.0 - */ -declare class EnvHelper { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - private static stringToEnumValue; - /** - * 获取配置的日志级别 - */ - static getEnvLevel(env?: Env): LogLevelEnum | undefined; - /** - * 获取默认日志 - */ - static getEnvLogger(env?: Env): string | undefined; -} -export default EnvHelper; diff --git a/public/libs/zhi-log/lib/factory/abstractLogFactory.d.ts b/public/libs/zhi-log/lib/factory/abstractLogFactory.d.ts deleted file mode 100644 index 18d0f9b0..00000000 --- a/public/libs/zhi-log/lib/factory/abstractLogFactory.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import LogLevelEnum from "../logConstants"; -import { Env } from "zhi-env"; -import DefaultLogger from "../defaultLogger"; -/** - * 日志记录工厂 - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare abstract class AbstractLogFactory { - private logger; - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - protected constructor(level?: LogLevelEnum, sign?: string, env?: Env); - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - protected getLogger(loggerName?: string, stackSize?: number): DefaultLogger; -} -export default AbstractLogFactory; diff --git a/public/libs/zhi-log/lib/factory/customLogFactory.d.ts b/public/libs/zhi-log/lib/factory/customLogFactory.d.ts deleted file mode 100644 index d707cad4..00000000 --- a/public/libs/zhi-log/lib/factory/customLogFactory.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import AbstractLogFactory from "./abstractLogFactory"; -import LogLevelEnum from "../logConstants"; -import { Env } from "zhi-env"; -import DefaultLogger from "../defaultLogger"; -/** - * 自定义日志工厂 - * - * @public - * @author terwer - * @since 1.0.7 - */ -declare class CustomLogFactory extends AbstractLogFactory { - constructor(level?: LogLevelEnum, sign?: string, env?: Env); - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(loggerName?: string, stackSize?: number): DefaultLogger; -} -export default CustomLogFactory; diff --git a/public/libs/zhi-log/lib/logConstants.d.ts b/public/libs/zhi-log/lib/logConstants.d.ts deleted file mode 100644 index b5dff3d0..00000000 --- a/public/libs/zhi-log/lib/logConstants.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 日志常量 - * - * @public - * @author terwer - * @since 1.4.0 - */ -declare class LogConstants { - static readonly LOG_LEVEL_KEY = "VITE_LOG_LEVEL"; - static readonly LOG_PREFIX_KEY = "VITE_LOG_PREFIX"; -} -/** - * 日志级别 - * - * @author terwer - * @since 1.0.7 - * @public - */ -declare enum LogLevelEnum { - /** - * TRACE - */ - LOG_LEVEL_TRACE = "TRACE", - /** - * DEBUG - */ - LOG_LEVEL_DEBUG = "DEBUG", - /** - * INFO - */ - LOG_LEVEL_INFO = "INFO", - /** - * WARN - */ - LOG_LEVEL_WARN = "WARN", - /** - * ERROR - */ - LOG_LEVEL_ERROR = "ERROR" -} -export default LogLevelEnum; -export { LogConstants }; diff --git a/public/libs/zhi-log/lib/logger.d.ts b/public/libs/zhi-log/lib/logger.d.ts deleted file mode 100644 index d80ad411..00000000 --- a/public/libs/zhi-log/lib/logger.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import LogLevelEnum from "./logConstants"; -import { CallSite } from "callsites"; -import { Env } from "zhi-env"; -import DefaultLogger from "./defaultLogger"; -/** - * 日志工具类 - * - * @author terwer - * @since 1.0.0 - */ -declare class Logger { - private consoleLogger; - private stackSize; - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(stackSize?: number): void; - constructor(level?: LogLevelEnum, sign?: string, env?: Env); - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack(): CallSite[]; - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器,默认为 console - * @author terwer - * @since 1.0.0 - */ - getLogger: (loggerName?: string) => DefaultLogger; -} -export default Logger; diff --git a/public/libs/zhi-log/package.json b/public/libs/zhi-log/package.json deleted file mode 100644 index 8124b368..00000000 --- a/public/libs/zhi-log/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "zhi-log", - "version": "1.13.1", - "type": "module", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "description": "a simple logger for Node and Browser", - "repository": "terwer/zhi", - "homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-log", - "author": "terwer", - "license": "GPL", - "files": [ - "dist", - "README.md" - ], - "keywords": [ - "zhi-log", - "zhi", - "log" - ], - "scripts": { - "dev": "vite", - "build": "vite build", - "start": "vite preview", - "test": "vitest --watch" - }, - "devDependencies": { - "@terwer/eslint-config-custom": "workspace:*", - "@terwer/tsconfig": "workspace:*", - "@terwer/vite-config-custom": "workspace:*" - }, - "dependencies": { - "ansi-colors": "^4.1.3", - "callsites": "^4.0.0", - "kleur": "^4.1.5", - "loglevel": "^1.8.1", - "loglevel-plugin-prefix": "^0.8.4", - "zhi-device": "workspace:*", - "zhi-env": "workspace:*" - } -} diff --git a/public/libs/zhi-publisher-sdk/README.md b/public/libs/zhi-publisher-sdk/README.md deleted file mode 100644 index e25f1f17..00000000 --- a/public/libs/zhi-publisher-sdk/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# publisher-sdk - -a common sdk for publishing post to every platform - -## Usage - -```js -// usage -``` - -## Deps - -``` -## Congregations! publisher-sdk need no deps, it is just pure js code 🎉 -``` - -## Dev - -```bash -pnpm dev -F publisher-sdk -``` - -## Build - -```bash -pnpm build -F publisher-sdk -``` - -## Test - -Execute the unit tests via [vitest](https://vitest.dev) - -```bash -pnpm test -F publisher-sdk -``` - -## Publish - -```bash -pnpm publish -F publisher-sdk --tag latest -``` \ No newline at end of file diff --git a/public/libs/zhi-publisher-sdk/index.d.ts b/public/libs/zhi-publisher-sdk/index.d.ts deleted file mode 100644 index 15a86183..00000000 --- a/public/libs/zhi-publisher-sdk/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import PublishSdk from "./publish-sdk"; -export { PublishSdk }; diff --git a/public/libs/zhi-publisher-sdk/index.js b/public/libs/zhi-publisher-sdk/index.js deleted file mode 100644 index 26dd2ca3..00000000 --- a/public/libs/zhi-publisher-sdk/index.js +++ /dev/null @@ -1,47 +0,0 @@ -var r = Object.defineProperty; -var g = (n, t, s) => t in n ? r(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s; -var i = (n, t, s) => (g(n, typeof t != "symbol" ? t + "" : t, s), s); -(function(n, t) { - !n || n.getElementById("livereloadscript") || (t = n.createElement("script"), t.async = 1, t.src = "//" + (self.location.host || "localhost").split(":")[0] + ":35729/livereload.js?snipver=1", t.id = "livereloadscript", n.getElementsByTagName("head")[0].appendChild(t)); -})(self.document); -class a { - static init(t) { - this.appInstance = t.appInstance, this.Env = t.Env, this.BlogConstants = t.BlogConstants, this.BlogTypeEnum = t.BlogTypeEnum, this.SiyuanConstants = t.SiyuanConstants, this.SiyuanConfig = t.SiyuanConfig, this.SiYuanApiAdaptor = t.SiYuanApiAdaptor, this.BlogApi = t.BlogApi; - } - /** - * 获取 siyuan-kernel-api 实例 - * - * @param type - Env | BlogTypeEnum - * @param cfg - BlogConfig - * @return BlogApi - */ - static blogApi(t, s) { - if (!this.bApi) { - let e, o; - switch (t instanceof this.Env && (o = t.getEnv(this.BlogConstants.DEFAULT_BLOG_TYPE_KEY)), o) { - case this.BlogTypeEnum.BlogTypeEnum_Wordpress: - break; - default: { - if (t instanceof this.Env) { - const c = t.getEnvOrDefault(this.SiyuanConstants.VITE_SIYUAN_API_URL_KEY, "http://127.0.0.1:6806"), l = t.getStringEnv(this.SiyuanConstants.VITE_SIYUAN_AUTH_TOKEN_KEY), p = new this.SiyuanConfig(c, l); - p.fixTitle = !0, e = new this.SiYuanApiAdaptor(p); - } else - e = new this.SiYuanApiAdaptor(s), e.init(this.appInstance); - break; - } - } - if (!e) - throw new Error("ApiAdaptor cannot be null"); - this.bApi = new this.BlogApi(e); - } - return this.bApi; - } -} -/** - * BlogApi - * @private - */ -i(a, "appInstance"), i(a, "bApi"), i(a, "Env"), i(a, "BlogConstants"), i(a, "BlogTypeEnum"), i(a, "SiyuanConstants"), i(a, "SiyuanConfig"), i(a, "SiYuanApiAdaptor"), i(a, "BlogApi"); -export { - a as PublishSdk -}; diff --git a/public/libs/zhi-publisher-sdk/package.json b/public/libs/zhi-publisher-sdk/package.json deleted file mode 100644 index c598417e..00000000 --- a/public/libs/zhi-publisher-sdk/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "zhi-publisher-sdk", - "version": "0.1.0", - "type": "module", - "description": "a common sdk for publishing post to every platform", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "repository": "terwer/zhi", - "homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-publisher-sdk", - "author": "terwer", - "license": "GPL", - "files": [ - "dist", - "README.md" - ], - "keywords": [ - "zhi", - "lib" - ], - "scripts": { - "serve": "vite", - "dev": "vite build --watch", - "build": "vite build", - "start": "vite preview", - "test": "vitest --watch" - }, - "devDependencies": { - "@terwer/eslint-config-custom": "workspace:*", - "@terwer/vite-config-custom": "workspace:*" - } -} diff --git a/public/libs/zhi-publisher-sdk/publish-sdk.d.ts b/public/libs/zhi-publisher-sdk/publish-sdk.d.ts deleted file mode 100644 index 524653dd..00000000 --- a/public/libs/zhi-publisher-sdk/publish-sdk.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 发布 SDK - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class PublishSdk { - /** - * BlogApi - * @private - */ - private static appInstance; - private static bApi; - private static Env; - private static BlogConstants; - private static BlogTypeEnum; - private static SiyuanConstants; - private static SiyuanConfig; - private static SiYuanApiAdaptor; - private static BlogApi; - static init(options: { - appInstance: any; - Env: any; - BlogConstants: any; - BlogTypeEnum: any; - SiyuanConstants: any; - SiyuanConfig: any; - SiYuanApiAdaptor: any; - BlogApi: any; - }): void; - /** - * 获取 siyuan-kernel-api 实例 - * - * @param type - Env | BlogTypeEnum - * @param cfg - BlogConfig - * @return BlogApi - */ - static blogApi(type: any, cfg: any): any; -} -export default PublishSdk; diff --git a/public/libs/zhi-siyuan-api/README.md b/public/libs/zhi-siyuan-api/README.md deleted file mode 100644 index d588991b..00000000 --- a/public/libs/zhi-siyuan-api/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# zhi-siyuan-api - -a siyuan-note api including both kernel and client - -## Usage - -```js -import { SiyuanKernelApi } from "zhi-siyuan-api" - -const siyuanConfig = new SiyuanConfig("http://127.0.0.1:6806", "") -const kernelApi = new SiyuanKernelApi(siyuanConfig) -const result = await kernelApi.lsNotebooks() -console.log("result=>", result) -``` - -## Deps - -``` -├── zhi-env -├── zhi-log -├── zhi-common -├── zhi-blog-api -``` - -## Dev - -```bash -pnpm dev -F zhi-siyuan-api -``` - -## Build - -```bash -pnpm build -F zhi-siyuan-api -``` - -## Test - -Execute the unit tests via [vitest](https://vitest.dev) - -```bash -pnpm test -F zhi-siyuan-api -``` - -## Publish - -```bash -pnpm publish -F zhi-siyuan-api --tag latest -``` \ No newline at end of file diff --git a/public/libs/zhi-siyuan-api/index.d.ts b/public/libs/zhi-siyuan-api/index.d.ts deleted file mode 100644 index 49fb9909..00000000 --- a/public/libs/zhi-siyuan-api/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import SiyuanApi from "./lib/zhi-siyuan-api"; -import SiyuanKernelApi from "./lib/siyuanKernelApi"; -import type { SiyuanData } from "./lib/ISiyuanKernelApi"; -import SiyuanConfig from "./lib/siyuanConfig"; -import SiYuanApiAdaptor from "./lib/siYuanApiAdaptor"; -import SiyuanConstants from "./lib/siyuanConstants"; -export { SiyuanApi }; -export { SiyuanData, SiyuanKernelApi }; -export { SiyuanConstants, SiyuanConfig, SiYuanApiAdaptor }; diff --git a/public/libs/zhi-siyuan-api/index.js b/public/libs/zhi-siyuan-api/index.js deleted file mode 100644 index 72d4eefb..00000000 --- a/public/libs/zhi-siyuan-api/index.js +++ /dev/null @@ -1,10432 +0,0 @@ -var bs = Object.defineProperty; -var ys = (e, t, r) => t in e ? bs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r; -var $e = (e, t, r) => (ys(e, typeof t != "symbol" ? t + "" : t, r), r); -(function(e, t) { - !e || e.getElementById("livereloadscript") || (t = e.createElement("script"), t.async = 1, t.src = "//" + (self.location.host || "localhost").split(":")[0] + ":35729/livereload.js?snipver=1", t.id = "livereloadscript", e.getElementsByTagName("head")[0].appendChild(t)); -})(self.document); -var _s = Object.defineProperty, ws = (e, t, r) => t in e ? _s(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, oe = (e, t, r) => (ws(e, typeof t != "symbol" ? t + "" : t, r), r), ao = /* @__PURE__ */ ((e) => (e[e.PasswordType_Password = 0] = "PasswordType_Password", e[e.PasswordType_Token = 1] = "PasswordType_Token", e))(ao || {}); -class vs { - constructor() { - oe(this, "home"), oe(this, "apiUrl"), oe(this, "username"), oe(this, "passwordType"), oe(this, "password"), oe(this, "apiStatus"), oe(this, "blogName"), oe(this, "posidKey"), oe(this, "previewUrl"), oe(this, "pageType"), oe(this, "placeholder"), oe(this, "fixTitle"), this.home = "", this.apiUrl = "", this.username = "", this.passwordType = 0, this.password = "", this.apiStatus = !1, this.blogName = "", this.posidKey = "", this.previewUrl = "", this.pageType = 0, this.placeholder = void 0, this.fixTitle = !1; - } -} -class ks { - constructor() { - oe(this, "homePlaceholder"), oe(this, "apiUrlPlaceholder"), oe(this, "usernamePlaceholder"), oe(this, "passwordTypePlaceholder"), oe(this, "passwordPlaceholder"), oe(this, "apiStatusPlaceholder"), oe(this, "blogNamePlaceholder"), oe(this, "posidKeyPlaceholder"), oe(this, "previewUrlPlaceholder"), oe(this, "pageTypePlaceholder"), this.homePlaceholder = "", this.apiUrlPlaceholder = "", this.usernamePlaceholder = "", this.passwordTypePlaceholder = "", this.passwordPlaceholder = "", this.apiStatusPlaceholder = !1, this.blogNamePlaceholder = "", this.posidKeyPlaceholder = "", this.previewUrlPlaceholder = "", this.pageTypePlaceholder = ""; - } -} -var Br = /* @__PURE__ */ ((e) => (e.PostStatusEnum_Publish = "publish", e.PostStatusEnum_Draft = "draft", e.PostStatusEnum_Inherit = "inherit", e))(Br || {}); -class _n { - constructor() { - oe(this, "postid"), oe(this, "title"), oe(this, "mt_keywords"), oe(this, "link"), oe(this, "permalink"), oe(this, "shortDesc"), oe(this, "description"), oe(this, "mt_excerpt"), oe(this, "wp_slug"), oe(this, "dateCreated"), oe(this, "categories"), oe(this, "mt_text_more"), oe(this, "post_status"), oe(this, "isPublished"), oe(this, "wp_password"), this.postid = "", this.title = "", this.mt_keywords = "", this.permalink = "", this.description = "", this.wp_slug = "", this.dateCreated = /* @__PURE__ */ new Date(), this.categories = [], this.isPublished = !0, this.post_status = Br.PostStatusEnum_Publish, this.wp_password = ""; - } -} -var Es = Object.defineProperty, $s = (e, t, r) => t in e ? Es(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Te = (e, t, r) => ($s(e, typeof t != "symbol" ? t + "" : t, r), r), no = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function oo(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var la = { exports: {} }, so = {}, rt = {}, Ht = {}, br = {}, ie = {}, fr = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0; - class t { - } - e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; - class r extends t { - constructor(T) { - if (super(), !e.IDENTIFIER.test(T)) - throw new Error("CodeGen: name must be a valid identifier"); - this.str = T; - } - toString() { - return this.str; - } - emptyStr() { - return !1; - } - get names() { - return { [this.str]: 1 }; - } - } - e.Name = r; - class a extends t { - constructor(T) { - super(), this._items = typeof T == "string" ? [T] : T; - } - toString() { - return this.str; - } - emptyStr() { - if (this._items.length > 1) - return !1; - const T = this._items[0]; - return T === "" || T === '""'; - } - get str() { - var T; - return (T = this._str) !== null && T !== void 0 ? T : this._str = this._items.reduce((R, n) => `${R}${n}`, ""); - } - get names() { - var T; - return (T = this._names) !== null && T !== void 0 ? T : this._names = this._items.reduce((R, n) => (n instanceof r && (R[n.str] = (R[n.str] || 0) + 1), R), {}); - } - } - e._Code = a, e.nil = new a(""); - function s(v, ...T) { - const R = [v[0]]; - let n = 0; - for (; n < T.length; ) - b(R, T[n]), R.push(v[++n]); - return new a(R); - } - e._ = s; - const l = new a("+"); - function d(v, ...T) { - const R = [A(v[0])]; - let n = 0; - for (; n < T.length; ) - R.push(l), b(R, T[n]), R.push(l, A(v[++n])); - return _(R), new a(R); - } - e.str = d; - function b(v, T) { - T instanceof a ? v.push(...T._items) : T instanceof r ? v.push(T) : v.push(k(T)); - } - e.addCodeArg = b; - function _(v) { - let T = 1; - for (; T < v.length - 1; ) { - if (v[T] === l) { - const R = y(v[T - 1], v[T + 1]); - if (R !== void 0) { - v.splice(T - 1, 3, R); - continue; - } - v[T++] = "+"; - } - T++; - } - } - function y(v, T) { - if (T === '""') - return v; - if (v === '""') - return T; - if (typeof v == "string") - return T instanceof r || v[v.length - 1] !== '"' ? void 0 : typeof T != "string" ? `${v.slice(0, -1)}${T}"` : T[0] === '"' ? v.slice(0, -1) + T.slice(1) : void 0; - if (typeof T == "string" && T[0] === '"' && !(v instanceof r)) - return `"${v}${T.slice(1)}`; - } - function m(v, T) { - return T.emptyStr() ? v : v.emptyStr() ? T : d`${v}${T}`; - } - e.strConcat = m; - function k(v) { - return typeof v == "number" || typeof v == "boolean" || v === null ? v : A(Array.isArray(v) ? v.join(",") : v); - } - function N(v) { - return new a(A(v)); - } - e.stringify = N; - function A(v) { - return JSON.stringify(v).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); - } - e.safeStringify = A; - function j(v) { - return typeof v == "string" && e.IDENTIFIER.test(v) ? new a(`.${v}`) : s`[${v}]`; - } - e.getProperty = j; - function C(v) { - if (typeof v == "string" && e.IDENTIFIER.test(v)) - return new a(`${v}`); - throw new Error(`CodeGen: invalid export name: ${v}, use explicit $id name mapping`); - } - e.getEsmExportName = C; - function x(v) { - return new a(v.toString()); - } - e.regexpCode = x; -})(fr); -var ca = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0; - const t = fr; - class r extends Error { - constructor(y) { - super(`CodeGen: "code" for ${y} not defined`), this.value = y.value; - } - } - var a; - (function(_) { - _[_.Started = 0] = "Started", _[_.Completed = 1] = "Completed"; - })(a = e.UsedValueState || (e.UsedValueState = {})), e.varKinds = { - const: new t.Name("const"), - let: new t.Name("let"), - var: new t.Name("var") - }; - class s { - constructor({ prefixes: y, parent: m } = {}) { - this._names = {}, this._prefixes = y, this._parent = m; - } - toName(y) { - return y instanceof t.Name ? y : this.name(y); - } - name(y) { - return new t.Name(this._newName(y)); - } - _newName(y) { - const m = this._names[y] || this._nameGroup(y); - return `${y}${m.index++}`; - } - _nameGroup(y) { - var m, k; - if (!((k = (m = this._parent) === null || m === void 0 ? void 0 : m._prefixes) === null || k === void 0) && k.has(y) || this._prefixes && !this._prefixes.has(y)) - throw new Error(`CodeGen: prefix "${y}" is not allowed in this scope`); - return this._names[y] = { prefix: y, index: 0 }; - } - } - e.Scope = s; - class l extends t.Name { - constructor(y, m) { - super(m), this.prefix = y; - } - setValue(y, { property: m, itemIndex: k }) { - this.value = y, this.scopePath = (0, t._)`.${new t.Name(m)}[${k}]`; - } - } - e.ValueScopeName = l; - const d = (0, t._)`\n`; - class b extends s { - constructor(y) { - super(y), this._values = {}, this._scope = y.scope, this.opts = { ...y, _n: y.lines ? d : t.nil }; - } - get() { - return this._scope; - } - name(y) { - return new l(y, this._newName(y)); - } - value(y, m) { - var k; - if (m.ref === void 0) - throw new Error("CodeGen: ref must be passed in value"); - const N = this.toName(y), { prefix: A } = N, j = (k = m.key) !== null && k !== void 0 ? k : m.ref; - let C = this._values[A]; - if (C) { - const T = C.get(j); - if (T) - return T; - } else - C = this._values[A] = /* @__PURE__ */ new Map(); - C.set(j, N); - const x = this._scope[A] || (this._scope[A] = []), v = x.length; - return x[v] = m.ref, N.setValue(m, { property: A, itemIndex: v }), N; - } - getValue(y, m) { - const k = this._values[y]; - if (k) - return k.get(m); - } - scopeRefs(y, m = this._values) { - return this._reduceValues(m, (k) => { - if (k.scopePath === void 0) - throw new Error(`CodeGen: name "${k}" has no value`); - return (0, t._)`${y}${k.scopePath}`; - }); - } - scopeCode(y = this._values, m, k) { - return this._reduceValues(y, (N) => { - if (N.value === void 0) - throw new Error(`CodeGen: name "${N}" has no value`); - return N.value.code; - }, m, k); - } - _reduceValues(y, m, k = {}, N) { - let A = t.nil; - for (const j in y) { - const C = y[j]; - if (!C) - continue; - const x = k[j] = k[j] || /* @__PURE__ */ new Map(); - C.forEach((v) => { - if (x.has(v)) - return; - x.set(v, a.Started); - let T = m(v); - if (T) { - const R = this.opts.es5 ? e.varKinds.var : e.varKinds.const; - A = (0, t._)`${A}${R} ${v} = ${T};${this.opts._n}`; - } else if (T = N == null ? void 0 : N(v)) - A = (0, t._)`${A}${T}${this.opts._n}`; - else - throw new r(v); - x.set(v, a.Completed); - }); - } - return A; - } - } - e.ValueScope = b; -})(ca); -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0; - const t = fr, r = ca; - var a = fr; - Object.defineProperty(e, "_", { enumerable: !0, get: function() { - return a._; - } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() { - return a.str; - } }), Object.defineProperty(e, "strConcat", { enumerable: !0, get: function() { - return a.strConcat; - } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() { - return a.nil; - } }), Object.defineProperty(e, "getProperty", { enumerable: !0, get: function() { - return a.getProperty; - } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() { - return a.stringify; - } }), Object.defineProperty(e, "regexpCode", { enumerable: !0, get: function() { - return a.regexpCode; - } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() { - return a.Name; - } }); - var s = ca; - Object.defineProperty(e, "Scope", { enumerable: !0, get: function() { - return s.Scope; - } }), Object.defineProperty(e, "ValueScope", { enumerable: !0, get: function() { - return s.ValueScope; - } }), Object.defineProperty(e, "ValueScopeName", { enumerable: !0, get: function() { - return s.ValueScopeName; - } }), Object.defineProperty(e, "varKinds", { enumerable: !0, get: function() { - return s.varKinds; - } }), e.operators = { - GT: new t._Code(">"), - GTE: new t._Code(">="), - LT: new t._Code("<"), - LTE: new t._Code("<="), - EQ: new t._Code("==="), - NEQ: new t._Code("!=="), - NOT: new t._Code("!"), - OR: new t._Code("||"), - AND: new t._Code("&&"), - ADD: new t._Code("+") - }; - class l { - optimizeNodes() { - return this; - } - optimizeNames(h, $) { - return this; - } - } - class d extends l { - constructor(h, $, I) { - super(), this.varKind = h, this.name = $, this.rhs = I; - } - render({ es5: h, _n: $ }) { - const I = h ? r.varKinds.var : this.varKind, H = this.rhs === void 0 ? "" : ` = ${this.rhs}`; - return `${I} ${this.name}${H};` + $; - } - optimizeNames(h, $) { - if (h[this.name.str]) - return this.rhs && (this.rhs = B(this.rhs, h, $)), this; - } - get names() { - return this.rhs instanceof t._CodeOrName ? this.rhs.names : {}; - } - } - class b extends l { - constructor(h, $, I) { - super(), this.lhs = h, this.rhs = $, this.sideEffects = I; - } - render({ _n: h }) { - return `${this.lhs} = ${this.rhs};` + h; - } - optimizeNames(h, $) { - if (!(this.lhs instanceof t.Name && !h[this.lhs.str] && !this.sideEffects)) - return this.rhs = B(this.rhs, h, $), this; - } - get names() { - const h = this.lhs instanceof t.Name ? {} : { ...this.lhs.names }; - return q(h, this.rhs); - } - } - class _ extends b { - constructor(h, $, I, H) { - super(h, I, H), this.op = $; - } - render({ _n: h }) { - return `${this.lhs} ${this.op}= ${this.rhs};` + h; - } - } - class y extends l { - constructor(h) { - super(), this.label = h, this.names = {}; - } - render({ _n: h }) { - return `${this.label}:` + h; - } - } - class m extends l { - constructor(h) { - super(), this.label = h, this.names = {}; - } - render({ _n: h }) { - return `break${this.label ? ` ${this.label}` : ""};` + h; - } - } - class k extends l { - constructor(h) { - super(), this.error = h; - } - render({ _n: h }) { - return `throw ${this.error};` + h; - } - get names() { - return this.error.names; - } - } - class N extends l { - constructor(h) { - super(), this.code = h; - } - render({ _n: h }) { - return `${this.code};` + h; - } - optimizeNodes() { - return `${this.code}` ? this : void 0; - } - optimizeNames(h, $) { - return this.code = B(this.code, h, $), this; - } - get names() { - return this.code instanceof t._CodeOrName ? this.code.names : {}; - } - } - class A extends l { - constructor(h = []) { - super(), this.nodes = h; - } - render(h) { - return this.nodes.reduce(($, I) => $ + I.render(h), ""); - } - optimizeNodes() { - const { nodes: h } = this; - let $ = h.length; - for (; $--; ) { - const I = h[$].optimizeNodes(); - Array.isArray(I) ? h.splice($, 1, ...I) : I ? h[$] = I : h.splice($, 1); - } - return h.length > 0 ? this : void 0; - } - optimizeNames(h, $) { - const { nodes: I } = this; - let H = I.length; - for (; H--; ) { - const K = I[H]; - K.optimizeNames(h, $) || (G(h, K.names), I.splice(H, 1)); - } - return I.length > 0 ? this : void 0; - } - get names() { - return this.nodes.reduce((h, $) => z(h, $.names), {}); - } - } - class j extends A { - render(h) { - return "{" + h._n + super.render(h) + "}" + h._n; - } - } - class C extends A { - } - class x extends j { - } - x.kind = "else"; - class v extends j { - constructor(h, $) { - super($), this.condition = h; - } - render(h) { - let $ = `if(${this.condition})` + super.render(h); - return this.else && ($ += "else " + this.else.render(h)), $; - } - optimizeNodes() { - super.optimizeNodes(); - const h = this.condition; - if (h === !0) - return this.nodes; - let $ = this.else; - if ($) { - const I = $.optimizeNodes(); - $ = this.else = Array.isArray(I) ? new x(I) : I; - } - if ($) - return h === !1 ? $ instanceof v ? $ : $.nodes : this.nodes.length ? this : new v(w(h), $ instanceof v ? [$] : $.nodes); - if (!(h === !1 || !this.nodes.length)) - return this; - } - optimizeNames(h, $) { - var I; - if (this.else = (I = this.else) === null || I === void 0 ? void 0 : I.optimizeNames(h, $), !!(super.optimizeNames(h, $) || this.else)) - return this.condition = B(this.condition, h, $), this; - } - get names() { - const h = super.names; - return q(h, this.condition), this.else && z(h, this.else.names), h; - } - } - v.kind = "if"; - class T extends j { - } - T.kind = "for"; - class R extends T { - constructor(h) { - super(), this.iteration = h; - } - render(h) { - return `for(${this.iteration})` + super.render(h); - } - optimizeNames(h, $) { - if (super.optimizeNames(h, $)) - return this.iteration = B(this.iteration, h, $), this; - } - get names() { - return z(super.names, this.iteration.names); - } - } - class n extends T { - constructor(h, $, I, H) { - super(), this.varKind = h, this.name = $, this.from = I, this.to = H; - } - render(h) { - const $ = h.es5 ? r.varKinds.var : this.varKind, { name: I, from: H, to: K } = this; - return `for(${$} ${I}=${H}; ${I}<${K}; ${I}++)` + super.render(h); - } - get names() { - const h = q(super.names, this.from); - return q(h, this.to); - } - } - class i extends T { - constructor(h, $, I, H) { - super(), this.loop = h, this.varKind = $, this.name = I, this.iterable = H; - } - render(h) { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(h); - } - optimizeNames(h, $) { - if (super.optimizeNames(h, $)) - return this.iterable = B(this.iterable, h, $), this; - } - get names() { - return z(super.names, this.iterable.names); - } - } - class o extends j { - constructor(h, $, I) { - super(), this.name = h, this.args = $, this.async = I; - } - render(h) { - return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(h); - } - } - o.kind = "func"; - class c extends A { - render(h) { - return "return " + super.render(h); - } - } - c.kind = "return"; - class u extends j { - render(h) { - let $ = "try" + super.render(h); - return this.catch && ($ += this.catch.render(h)), this.finally && ($ += this.finally.render(h)), $; - } - optimizeNodes() { - var h, $; - return super.optimizeNodes(), (h = this.catch) === null || h === void 0 || h.optimizeNodes(), ($ = this.finally) === null || $ === void 0 || $.optimizeNodes(), this; - } - optimizeNames(h, $) { - var I, H; - return super.optimizeNames(h, $), (I = this.catch) === null || I === void 0 || I.optimizeNames(h, $), (H = this.finally) === null || H === void 0 || H.optimizeNames(h, $), this; - } - get names() { - const h = super.names; - return this.catch && z(h, this.catch.names), this.finally && z(h, this.finally.names), h; - } - } - class f extends j { - constructor(h) { - super(), this.error = h; - } - render(h) { - return `catch(${this.error})` + super.render(h); - } - } - f.kind = "catch"; - class g extends j { - render(h) { - return "finally" + super.render(h); - } - } - g.kind = "finally"; - class O { - constructor(h, $ = {}) { - this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...$, _n: $.lines ? ` -` : "" }, this._extScope = h, this._scope = new r.Scope({ parent: h }), this._nodes = [new C()]; - } - toString() { - return this._root.render(this.opts); - } - // returns unique name in the internal scope - name(h) { - return this._scope.name(h); - } - // reserves unique name in the external scope - scopeName(h) { - return this._extScope.name(h); - } - // reserves unique name in the external scope and assigns value to it - scopeValue(h, $) { - const I = this._extScope.value(h, $); - return (this._values[I.prefix] || (this._values[I.prefix] = /* @__PURE__ */ new Set())).add(I), I; - } - getScopeValue(h, $) { - return this._extScope.getValue(h, $); - } - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(h) { - return this._extScope.scopeRefs(h, this._values); - } - scopeCode() { - return this._extScope.scopeCode(this._values); - } - _def(h, $, I, H) { - const K = this._scope.toName($); - return I !== void 0 && H && (this._constants[K.str] = I), this._leafNode(new d(h, K, I)), K; - } - // `const` declaration (`var` in es5 mode) - const(h, $, I) { - return this._def(r.varKinds.const, h, $, I); - } - // `let` declaration with optional assignment (`var` in es5 mode) - let(h, $, I) { - return this._def(r.varKinds.let, h, $, I); - } - // `var` declaration with optional assignment - var(h, $, I) { - return this._def(r.varKinds.var, h, $, I); - } - // assignment code - assign(h, $, I) { - return this._leafNode(new b(h, $, I)); - } - // `+=` code - add(h, $) { - return this._leafNode(new _(h, e.operators.ADD, $)); - } - // appends passed SafeExpr to code or executes Block - code(h) { - return typeof h == "function" ? h() : h !== t.nil && this._leafNode(new N(h)), this; - } - // returns code for object literal for the passed argument list of key-value pairs - object(...h) { - const $ = ["{"]; - for (const [I, H] of h) - $.length > 1 && $.push(","), $.push(I), (I !== H || this.opts.es5) && ($.push(":"), (0, t.addCodeArg)($, H)); - return $.push("}"), new t._Code($); - } - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(h, $, I) { - if (this._blockNode(new v(h)), $ && I) - this.code($).else().code(I).endIf(); - else if ($) - this.code($).endIf(); - else if (I) - throw new Error('CodeGen: "else" body without "then" body'); - return this; - } - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(h) { - return this._elseNode(new v(h)); - } - // `else` clause - only valid after `if` or `else if` clauses - else() { - return this._elseNode(new x()); - } - // end `if` statement (needed if gen.if was used only with condition) - endIf() { - return this._endBlockNode(v, x); - } - _for(h, $) { - return this._blockNode(h), $ && this.code($).endFor(), this; - } - // a generic `for` clause (or statement if `forBody` is passed) - for(h, $) { - return this._for(new R(h), $); - } - // `for` statement for a range of values - forRange(h, $, I, H, K = this.opts.es5 ? r.varKinds.var : r.varKinds.let) { - const te = this._scope.toName(h); - return this._for(new n(K, te, $, I), () => H(te)); - } - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf(h, $, I, H = r.varKinds.const) { - const K = this._scope.toName(h); - if (this.opts.es5) { - const te = $ instanceof t.Name ? $ : this.var("_arr", $); - return this.forRange("_i", 0, (0, t._)`${te}.length`, (ne) => { - this.var(K, (0, t._)`${te}[${ne}]`), I(K); - }); - } - return this._for(new i("of", H, K, $), () => I(K)); - } - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn(h, $, I, H = this.opts.es5 ? r.varKinds.var : r.varKinds.const) { - if (this.opts.ownProperties) - return this.forOf(h, (0, t._)`Object.keys(${$})`, I); - const K = this._scope.toName(h); - return this._for(new i("in", H, K, $), () => I(K)); - } - // end `for` loop - endFor() { - return this._endBlockNode(T); - } - // `label` statement - label(h) { - return this._leafNode(new y(h)); - } - // `break` statement - break(h) { - return this._leafNode(new m(h)); - } - // `return` statement - return(h) { - const $ = new c(); - if (this._blockNode($), this.code(h), $.nodes.length !== 1) - throw new Error('CodeGen: "return" should have one node'); - return this._endBlockNode(c); - } - // `try` statement - try(h, $, I) { - if (!$ && !I) - throw new Error('CodeGen: "try" without "catch" and "finally"'); - const H = new u(); - if (this._blockNode(H), this.code(h), $) { - const K = this.name("e"); - this._currNode = H.catch = new f(K), $(K); - } - return I && (this._currNode = H.finally = new g(), this.code(I)), this._endBlockNode(f, g); - } - // `throw` statement - throw(h) { - return this._leafNode(new k(h)); - } - // start self-balancing block - block(h, $) { - return this._blockStarts.push(this._nodes.length), h && this.code(h).endBlock($), this; - } - // end the current self-balancing block - endBlock(h) { - const $ = this._blockStarts.pop(); - if ($ === void 0) - throw new Error("CodeGen: not in self-balancing block"); - const I = this._nodes.length - $; - if (I < 0 || h !== void 0 && I !== h) - throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${h} expected`); - return this._nodes.length = $, this; - } - // `function` heading (or definition if funcBody is passed) - func(h, $ = t.nil, I, H) { - return this._blockNode(new o(h, $, I)), H && this.code(H).endFunc(), this; - } - // end function definition - endFunc() { - return this._endBlockNode(o); - } - optimize(h = 1) { - for (; h-- > 0; ) - this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants); - } - _leafNode(h) { - return this._currNode.nodes.push(h), this; - } - _blockNode(h) { - this._currNode.nodes.push(h), this._nodes.push(h); - } - _endBlockNode(h, $) { - const I = this._currNode; - if (I instanceof h || $ && I instanceof $) - return this._nodes.pop(), this; - throw new Error(`CodeGen: not in block "${$ ? `${h.kind}/${$.kind}` : h.kind}"`); - } - _elseNode(h) { - const $ = this._currNode; - if (!($ instanceof v)) - throw new Error('CodeGen: "else" without "if"'); - return this._currNode = $.else = h, this; - } - get _root() { - return this._nodes[0]; - } - get _currNode() { - const h = this._nodes; - return h[h.length - 1]; - } - set _currNode(h) { - const $ = this._nodes; - $[$.length - 1] = h; - } - } - e.CodeGen = O; - function z(L, h) { - for (const $ in h) - L[$] = (L[$] || 0) + (h[$] || 0); - return L; - } - function q(L, h) { - return h instanceof t._CodeOrName ? z(L, h.names) : L; - } - function B(L, h, $) { - if (L instanceof t.Name) - return I(L); - if (!H(L)) - return L; - return new t._Code(L._items.reduce((K, te) => (te instanceof t.Name && (te = I(te)), te instanceof t._Code ? K.push(...te._items) : K.push(te), K), [])); - function I(K) { - const te = $[K.str]; - return te === void 0 || h[K.str] !== 1 ? K : (delete h[K.str], te); - } - function H(K) { - return K instanceof t._Code && K._items.some((te) => te instanceof t.Name && h[te.str] === 1 && $[te.str] !== void 0); - } - } - function G(L, h) { - for (const $ in h) - L[$] = (L[$] || 0) - (h[$] || 0); - } - function w(L) { - return typeof L == "boolean" || typeof L == "number" || L === null ? !L : (0, t._)`!${F(L)}`; - } - e.not = w; - const U = P(e.operators.AND); - function W(...L) { - return L.reduce(U); - } - e.and = W; - const J = P(e.operators.OR); - function V(...L) { - return L.reduce(J); - } - e.or = V; - function P(L) { - return (h, $) => h === t.nil ? $ : $ === t.nil ? h : (0, t._)`${F(h)} ${L} ${F($)}`; - } - function F(L) { - return L instanceof t.Name ? L : (0, t._)`(${L})`; - } -})(ie); -var ce = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0; - const t = ie, r = fr; - function a(o) { - const c = {}; - for (const u of o) - c[u] = !0; - return c; - } - e.toHash = a; - function s(o, c) { - return typeof c == "boolean" ? c : Object.keys(c).length === 0 ? !0 : (l(o, c), !d(c, o.self.RULES.all)); - } - e.alwaysValidSchema = s; - function l(o, c = o.schema) { - const { opts: u, self: f } = o; - if (!u.strictSchema || typeof c == "boolean") - return; - const g = f.RULES.keywords; - for (const O in c) - g[O] || i(o, `unknown keyword: "${O}"`); - } - e.checkUnknownRules = l; - function d(o, c) { - if (typeof o == "boolean") - return !o; - for (const u in o) - if (c[u]) - return !0; - return !1; - } - e.schemaHasRules = d; - function b(o, c) { - if (typeof o == "boolean") - return !o; - for (const u in o) - if (u !== "$ref" && c.all[u]) - return !0; - return !1; - } - e.schemaHasRulesButRef = b; - function _({ topSchemaRef: o, schemaPath: c }, u, f, g) { - if (!g) { - if (typeof u == "number" || typeof u == "boolean") - return u; - if (typeof u == "string") - return (0, t._)`${u}`; - } - return (0, t._)`${o}${c}${(0, t.getProperty)(f)}`; - } - e.schemaRefOrVal = _; - function y(o) { - return N(decodeURIComponent(o)); - } - e.unescapeFragment = y; - function m(o) { - return encodeURIComponent(k(o)); - } - e.escapeFragment = m; - function k(o) { - return typeof o == "number" ? `${o}` : o.replace(/~/g, "~0").replace(/\//g, "~1"); - } - e.escapeJsonPointer = k; - function N(o) { - return o.replace(/~1/g, "/").replace(/~0/g, "~"); - } - e.unescapeJsonPointer = N; - function A(o, c) { - if (Array.isArray(o)) - for (const u of o) - c(u); - else - c(o); - } - e.eachItem = A; - function j({ mergeNames: o, mergeToName: c, mergeValues: u, resultToName: f }) { - return (g, O, z, q) => { - const B = z === void 0 ? O : z instanceof t.Name ? (O instanceof t.Name ? o(g, O, z) : c(g, O, z), z) : O instanceof t.Name ? (c(g, z, O), O) : u(O, z); - return q === t.Name && !(B instanceof t.Name) ? f(g, B) : B; - }; - } - e.mergeEvaluated = { - props: j({ - mergeNames: (o, c, u) => o.if((0, t._)`${u} !== true && ${c} !== undefined`, () => { - o.if((0, t._)`${c} === true`, () => o.assign(u, !0), () => o.assign(u, (0, t._)`${u} || {}`).code((0, t._)`Object.assign(${u}, ${c})`)); - }), - mergeToName: (o, c, u) => o.if((0, t._)`${u} !== true`, () => { - c === !0 ? o.assign(u, !0) : (o.assign(u, (0, t._)`${u} || {}`), x(o, u, c)); - }), - mergeValues: (o, c) => o === !0 ? !0 : { ...o, ...c }, - resultToName: C - }), - items: j({ - mergeNames: (o, c, u) => o.if((0, t._)`${u} !== true && ${c} !== undefined`, () => o.assign(u, (0, t._)`${c} === true ? true : ${u} > ${c} ? ${u} : ${c}`)), - mergeToName: (o, c, u) => o.if((0, t._)`${u} !== true`, () => o.assign(u, c === !0 ? !0 : (0, t._)`${u} > ${c} ? ${u} : ${c}`)), - mergeValues: (o, c) => o === !0 ? !0 : Math.max(o, c), - resultToName: (o, c) => o.var("items", c) - }) - }; - function C(o, c) { - if (c === !0) - return o.var("props", !0); - const u = o.var("props", (0, t._)`{}`); - return c !== void 0 && x(o, u, c), u; - } - e.evaluatedPropsToName = C; - function x(o, c, u) { - Object.keys(u).forEach((f) => o.assign((0, t._)`${c}${(0, t.getProperty)(f)}`, !0)); - } - e.setEvaluated = x; - const v = {}; - function T(o, c) { - return o.scopeValue("func", { - ref: c, - code: v[c.code] || (v[c.code] = new r._Code(c.code)) - }); - } - e.useFunc = T; - var R; - (function(o) { - o[o.Num = 0] = "Num", o[o.Str = 1] = "Str"; - })(R = e.Type || (e.Type = {})); - function n(o, c, u) { - if (o instanceof t.Name) { - const f = c === R.Num; - return u ? f ? (0, t._)`"[" + ${o} + "]"` : (0, t._)`"['" + ${o} + "']"` : f ? (0, t._)`"/" + ${o}` : (0, t._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`; - } - return u ? (0, t.getProperty)(o).toString() : "/" + k(o); - } - e.getErrorPath = n; - function i(o, c, u = o.opts.strictSchema) { - if (u) { - if (c = `strict mode: ${c}`, u === !0) - throw new Error(c); - o.self.logger.warn(c); - } - } - e.checkStrictMode = i; -})(ce); -var ct = {}; -Object.defineProperty(ct, "__esModule", { value: !0 }); -const Oe = ie, Ps = { - // validation function arguments - data: new Oe.Name("data"), - // args passed from referencing schema - valCxt: new Oe.Name("valCxt"), - instancePath: new Oe.Name("instancePath"), - parentData: new Oe.Name("parentData"), - parentDataProperty: new Oe.Name("parentDataProperty"), - rootData: new Oe.Name("rootData"), - dynamicAnchors: new Oe.Name("dynamicAnchors"), - // function scoped variables - vErrors: new Oe.Name("vErrors"), - errors: new Oe.Name("errors"), - this: new Oe.Name("this"), - // "globals" - self: new Oe.Name("self"), - scope: new Oe.Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new Oe.Name("json"), - jsonPos: new Oe.Name("jsonPos"), - jsonLen: new Oe.Name("jsonLen"), - jsonPart: new Oe.Name("jsonPart") -}; -ct.default = Ps; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0; - const t = ie, r = ce, a = ct; - e.keywordError = { - message: ({ keyword: x }) => (0, t.str)`must pass "${x}" keyword validation` - }, e.keyword$DataError = { - message: ({ keyword: x, schemaType: v }) => v ? (0, t.str)`"${x}" keyword must be ${v} ($data)` : (0, t.str)`"${x}" keyword is invalid ($data)` - }; - function s(x, v = e.keywordError, T, R) { - const { it: n } = x, { gen: i, compositeRule: o, allErrors: c } = n, u = k(x, v, T); - R ?? (o || c) ? _(i, u) : y(n, (0, t._)`[${u}]`); - } - e.reportError = s; - function l(x, v = e.keywordError, T) { - const { it: R } = x, { gen: n, compositeRule: i, allErrors: o } = R, c = k(x, v, T); - _(n, c), i || o || y(R, a.default.vErrors); - } - e.reportExtraError = l; - function d(x, v) { - x.assign(a.default.errors, v), x.if((0, t._)`${a.default.vErrors} !== null`, () => x.if(v, () => x.assign((0, t._)`${a.default.vErrors}.length`, v), () => x.assign(a.default.vErrors, null))); - } - e.resetErrorsCount = d; - function b({ gen: x, keyword: v, schemaValue: T, data: R, errsCount: n, it: i }) { - if (n === void 0) - throw new Error("ajv implementation error"); - const o = x.name("err"); - x.forRange("i", n, a.default.errors, (c) => { - x.const(o, (0, t._)`${a.default.vErrors}[${c}]`), x.if((0, t._)`${o}.instancePath === undefined`, () => x.assign((0, t._)`${o}.instancePath`, (0, t.strConcat)(a.default.instancePath, i.errorPath))), x.assign((0, t._)`${o}.schemaPath`, (0, t.str)`${i.errSchemaPath}/${v}`), i.opts.verbose && (x.assign((0, t._)`${o}.schema`, T), x.assign((0, t._)`${o}.data`, R)); - }); - } - e.extendErrors = b; - function _(x, v) { - const T = x.const("err", v); - x.if((0, t._)`${a.default.vErrors} === null`, () => x.assign(a.default.vErrors, (0, t._)`[${T}]`), (0, t._)`${a.default.vErrors}.push(${T})`), x.code((0, t._)`${a.default.errors}++`); - } - function y(x, v) { - const { gen: T, validateName: R, schemaEnv: n } = x; - n.$async ? T.throw((0, t._)`new ${x.ValidationError}(${v})`) : (T.assign((0, t._)`${R}.errors`, v), T.return(!1)); - } - const m = { - keyword: new t.Name("keyword"), - schemaPath: new t.Name("schemaPath"), - params: new t.Name("params"), - propertyName: new t.Name("propertyName"), - message: new t.Name("message"), - schema: new t.Name("schema"), - parentSchema: new t.Name("parentSchema") - }; - function k(x, v, T) { - const { createErrors: R } = x.it; - return R === !1 ? (0, t._)`{}` : N(x, v, T); - } - function N(x, v, T = {}) { - const { gen: R, it: n } = x, i = [ - A(n, T), - j(x, T) - ]; - return C(x, v, i), R.object(...i); - } - function A({ errorPath: x }, { instancePath: v }) { - const T = v ? (0, t.str)`${x}${(0, r.getErrorPath)(v, r.Type.Str)}` : x; - return [a.default.instancePath, (0, t.strConcat)(a.default.instancePath, T)]; - } - function j({ keyword: x, it: { errSchemaPath: v } }, { schemaPath: T, parentSchema: R }) { - let n = R ? v : (0, t.str)`${v}/${x}`; - return T && (n = (0, t.str)`${n}${(0, r.getErrorPath)(T, r.Type.Str)}`), [m.schemaPath, n]; - } - function C(x, { params: v, message: T }, R) { - const { keyword: n, data: i, schemaValue: o, it: c } = x, { opts: u, propertyName: f, topSchemaRef: g, schemaPath: O } = c; - R.push([m.keyword, n], [m.params, typeof v == "function" ? v(x) : v || (0, t._)`{}`]), u.messages && R.push([m.message, typeof T == "function" ? T(x) : T]), u.verbose && R.push([m.schema, o], [m.parentSchema, (0, t._)`${g}${O}`], [a.default.data, i]), f && R.push([m.propertyName, f]); - } -})(br); -Object.defineProperty(Ht, "__esModule", { value: !0 }); -Ht.boolOrEmptySchema = Ht.topBoolOrEmptySchema = void 0; -const Ss = br, Ts = ie, Cs = ct, xs = { - message: "boolean schema is false" -}; -function Os(e) { - const { gen: t, schema: r, validateName: a } = e; - r === !1 ? io(e, !1) : typeof r == "object" && r.$async === !0 ? t.return(Cs.default.data) : (t.assign((0, Ts._)`${a}.errors`, null), t.return(!0)); -} -Ht.topBoolOrEmptySchema = Os; -function Ns(e, t) { - const { gen: r, schema: a } = e; - a === !1 ? (r.var(t, !1), io(e)) : r.var(t, !0); -} -Ht.boolOrEmptySchema = Ns; -function io(e, t) { - const { gen: r, data: a } = e, s = { - gen: r, - keyword: "false schema", - data: a, - schema: !1, - schemaCode: !1, - schemaValue: !1, - params: {}, - it: e - }; - (0, Ss.reportError)(s, xs, void 0, t); -} -var yr = {}, Nt = {}; -Object.defineProperty(Nt, "__esModule", { value: !0 }); -Nt.getRules = Nt.isJSONType = void 0; -const js = ["string", "number", "integer", "boolean", "null", "object", "array"], Ls = new Set(js); -function As(e) { - return typeof e == "string" && Ls.has(e); -} -Nt.isJSONType = As; -function Rs() { - const e = { - number: { type: "number", rules: [] }, - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] } - }; - return { - types: { ...e, integer: !0, boolean: !0, null: !0 }, - rules: [{ rules: [] }, e.number, e.string, e.array, e.object], - post: { rules: [] }, - all: {}, - keywords: {} - }; -} -Nt.getRules = Rs; -var pt = {}; -Object.defineProperty(pt, "__esModule", { value: !0 }); -pt.shouldUseRule = pt.shouldUseGroup = pt.schemaHasRulesForType = void 0; -function Is({ schema: e, self: t }, r) { - const a = t.RULES.types[r]; - return a && a !== !0 && lo(e, a); -} -pt.schemaHasRulesForType = Is; -function lo(e, t) { - return t.rules.some((r) => co(e, r)); -} -pt.shouldUseGroup = lo; -function co(e, t) { - var r; - return e[t.keyword] !== void 0 || ((r = t.definition.implements) === null || r === void 0 ? void 0 : r.some((a) => e[a] !== void 0)); -} -pt.shouldUseRule = co; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0; - const t = Nt, r = pt, a = br, s = ie, l = ce; - var d; - (function(R) { - R[R.Correct = 0] = "Correct", R[R.Wrong = 1] = "Wrong"; - })(d = e.DataType || (e.DataType = {})); - function b(R) { - const n = _(R.type); - if (n.includes("null")) { - if (R.nullable === !1) - throw new Error("type: null contradicts nullable: false"); - } else { - if (!n.length && R.nullable !== void 0) - throw new Error('"nullable" cannot be used without "type"'); - R.nullable === !0 && n.push("null"); - } - return n; - } - e.getSchemaTypes = b; - function _(R) { - const n = Array.isArray(R) ? R : R ? [R] : []; - if (n.every(t.isJSONType)) - return n; - throw new Error("type must be JSONType or JSONType[]: " + n.join(",")); - } - e.getJSONTypes = _; - function y(R, n) { - const { gen: i, data: o, opts: c } = R, u = k(n, c.coerceTypes), f = n.length > 0 && !(u.length === 0 && n.length === 1 && (0, r.schemaHasRulesForType)(R, n[0])); - if (f) { - const g = C(n, o, c.strictNumbers, d.Wrong); - i.if(g, () => { - u.length ? N(R, n, u) : v(R); - }); - } - return f; - } - e.coerceAndCheckDataType = y; - const m = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); - function k(R, n) { - return n ? R.filter((i) => m.has(i) || n === "array" && i === "array") : []; - } - function N(R, n, i) { - const { gen: o, data: c, opts: u } = R, f = o.let("dataType", (0, s._)`typeof ${c}`), g = o.let("coerced", (0, s._)`undefined`); - u.coerceTypes === "array" && o.if((0, s._)`${f} == 'object' && Array.isArray(${c}) && ${c}.length == 1`, () => o.assign(c, (0, s._)`${c}[0]`).assign(f, (0, s._)`typeof ${c}`).if(C(n, c, u.strictNumbers), () => o.assign(g, c))), o.if((0, s._)`${g} !== undefined`); - for (const z of i) - (m.has(z) || z === "array" && u.coerceTypes === "array") && O(z); - o.else(), v(R), o.endIf(), o.if((0, s._)`${g} !== undefined`, () => { - o.assign(c, g), A(R, g); - }); - function O(z) { - switch (z) { - case "string": - o.elseIf((0, s._)`${f} == "number" || ${f} == "boolean"`).assign(g, (0, s._)`"" + ${c}`).elseIf((0, s._)`${c} === null`).assign(g, (0, s._)`""`); - return; - case "number": - o.elseIf((0, s._)`${f} == "boolean" || ${c} === null - || (${f} == "string" && ${c} && ${c} == +${c})`).assign(g, (0, s._)`+${c}`); - return; - case "integer": - o.elseIf((0, s._)`${f} === "boolean" || ${c} === null - || (${f} === "string" && ${c} && ${c} == +${c} && !(${c} % 1))`).assign(g, (0, s._)`+${c}`); - return; - case "boolean": - o.elseIf((0, s._)`${c} === "false" || ${c} === 0 || ${c} === null`).assign(g, !1).elseIf((0, s._)`${c} === "true" || ${c} === 1`).assign(g, !0); - return; - case "null": - o.elseIf((0, s._)`${c} === "" || ${c} === 0 || ${c} === false`), o.assign(g, null); - return; - case "array": - o.elseIf((0, s._)`${f} === "string" || ${f} === "number" - || ${f} === "boolean" || ${c} === null`).assign(g, (0, s._)`[${c}]`); - } - } - } - function A({ gen: R, parentData: n, parentDataProperty: i }, o) { - R.if((0, s._)`${n} !== undefined`, () => R.assign((0, s._)`${n}[${i}]`, o)); - } - function j(R, n, i, o = d.Correct) { - const c = o === d.Correct ? s.operators.EQ : s.operators.NEQ; - let u; - switch (R) { - case "null": - return (0, s._)`${n} ${c} null`; - case "array": - u = (0, s._)`Array.isArray(${n})`; - break; - case "object": - u = (0, s._)`${n} && typeof ${n} == "object" && !Array.isArray(${n})`; - break; - case "integer": - u = f((0, s._)`!(${n} % 1) && !isNaN(${n})`); - break; - case "number": - u = f(); - break; - default: - return (0, s._)`typeof ${n} ${c} ${R}`; - } - return o === d.Correct ? u : (0, s.not)(u); - function f(g = s.nil) { - return (0, s.and)((0, s._)`typeof ${n} == "number"`, g, i ? (0, s._)`isFinite(${n})` : s.nil); - } - } - e.checkDataType = j; - function C(R, n, i, o) { - if (R.length === 1) - return j(R[0], n, i, o); - let c; - const u = (0, l.toHash)(R); - if (u.array && u.object) { - const f = (0, s._)`typeof ${n} != "object"`; - c = u.null ? f : (0, s._)`!${n} || ${f}`, delete u.null, delete u.array, delete u.object; - } else - c = s.nil; - u.number && delete u.integer; - for (const f in u) - c = (0, s.and)(c, j(f, n, i, o)); - return c; - } - e.checkDataTypes = C; - const x = { - message: ({ schema: R }) => `must be ${R}`, - params: ({ schema: R, schemaValue: n }) => typeof R == "string" ? (0, s._)`{type: ${R}}` : (0, s._)`{type: ${n}}` - }; - function v(R) { - const n = T(R); - (0, a.reportError)(n, x); - } - e.reportTypeError = v; - function T(R) { - const { gen: n, data: i, schema: o } = R, c = (0, l.schemaRefOrVal)(R, o, "type"); - return { - gen: n, - keyword: "type", - data: i, - schema: o.type, - schemaCode: c, - schemaValue: c, - parentSchema: o, - params: {}, - it: R - }; - } -})(yr); -var Zr = {}; -Object.defineProperty(Zr, "__esModule", { value: !0 }); -Zr.assignDefaults = void 0; -const Bt = ie, Ms = ce; -function Ds(e, t) { - const { properties: r, items: a } = e.schema; - if (t === "object" && r) - for (const s in r) - wn(e, s, r[s].default); - else - t === "array" && Array.isArray(a) && a.forEach((s, l) => wn(e, l, s.default)); -} -Zr.assignDefaults = Ds; -function wn(e, t, r) { - const { gen: a, compositeRule: s, data: l, opts: d } = e; - if (r === void 0) - return; - const b = (0, Bt._)`${l}${(0, Bt.getProperty)(t)}`; - if (s) { - (0, Ms.checkStrictMode)(e, `default is ignored for: ${b}`); - return; - } - let _ = (0, Bt._)`${b} === undefined`; - d.useDefaults === "empty" && (_ = (0, Bt._)`${_} || ${b} === null || ${b} === ""`), a.if(_, (0, Bt._)`${b} = ${(0, Bt.stringify)(r)}`); -} -var lt = {}, se = {}; -Object.defineProperty(se, "__esModule", { value: !0 }); -se.validateUnion = se.validateArray = se.usePattern = se.callValidateCode = se.schemaProperties = se.allSchemaProperties = se.noPropertyInData = se.propertyInData = se.isOwnProperty = se.hasPropFunc = se.reportMissingProp = se.checkMissingProp = se.checkReportMissingProp = void 0; -const _e = ie, ba = ce, mt = ct, Bs = ce; -function zs(e, t) { - const { gen: r, data: a, it: s } = e; - r.if(_a(r, a, t, s.opts.ownProperties), () => { - e.setParams({ missingProperty: (0, _e._)`${t}` }, !0), e.error(); - }); -} -se.checkReportMissingProp = zs; -function Vs({ gen: e, data: t, it: { opts: r } }, a, s) { - return (0, _e.or)(...a.map((l) => (0, _e.and)(_a(e, t, l, r.ownProperties), (0, _e._)`${s} = ${l}`))); -} -se.checkMissingProp = Vs; -function Fs(e, t) { - e.setParams({ missingProperty: t }, !0), e.error(); -} -se.reportMissingProp = Fs; -function uo(e) { - return e.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: (0, _e._)`Object.prototype.hasOwnProperty` - }); -} -se.hasPropFunc = uo; -function ya(e, t, r) { - return (0, _e._)`${uo(e)}.call(${t}, ${r})`; -} -se.isOwnProperty = ya; -function qs(e, t, r, a) { - const s = (0, _e._)`${t}${(0, _e.getProperty)(r)} !== undefined`; - return a ? (0, _e._)`${s} && ${ya(e, t, r)}` : s; -} -se.propertyInData = qs; -function _a(e, t, r, a) { - const s = (0, _e._)`${t}${(0, _e.getProperty)(r)} === undefined`; - return a ? (0, _e.or)(s, (0, _e.not)(ya(e, t, r))) : s; -} -se.noPropertyInData = _a; -function ho(e) { - return e ? Object.keys(e).filter((t) => t !== "__proto__") : []; -} -se.allSchemaProperties = ho; -function Us(e, t) { - return ho(t).filter((r) => !(0, ba.alwaysValidSchema)(e, t[r])); -} -se.schemaProperties = Us; -function Gs({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: a, schemaPath: s, errorPath: l }, it: d }, b, _, y) { - const m = y ? (0, _e._)`${e}, ${t}, ${a}${s}` : t, k = [ - [mt.default.instancePath, (0, _e.strConcat)(mt.default.instancePath, l)], - [mt.default.parentData, d.parentData], - [mt.default.parentDataProperty, d.parentDataProperty], - [mt.default.rootData, mt.default.rootData] - ]; - d.opts.dynamicRef && k.push([mt.default.dynamicAnchors, mt.default.dynamicAnchors]); - const N = (0, _e._)`${m}, ${r.object(...k)}`; - return _ !== _e.nil ? (0, _e._)`${b}.call(${_}, ${N})` : (0, _e._)`${b}(${N})`; -} -se.callValidateCode = Gs; -const Hs = (0, _e._)`new RegExp`; -function Ks({ gen: e, it: { opts: t } }, r) { - const a = t.unicodeRegExp ? "u" : "", { regExp: s } = t.code, l = s(r, a); - return e.scopeValue("pattern", { - key: l.toString(), - ref: l, - code: (0, _e._)`${s.code === "new RegExp" ? Hs : (0, Bs.useFunc)(e, s)}(${r}, ${a})` - }); -} -se.usePattern = Ks; -function Ws(e) { - const { gen: t, data: r, keyword: a, it: s } = e, l = t.name("valid"); - if (s.allErrors) { - const b = t.let("valid", !0); - return d(() => t.assign(b, !1)), b; - } - return t.var(l, !0), d(() => t.break()), l; - function d(b) { - const _ = t.const("len", (0, _e._)`${r}.length`); - t.forRange("i", 0, _, (y) => { - e.subschema({ - keyword: a, - dataProp: y, - dataPropType: ba.Type.Num - }, l), t.if((0, _e.not)(l), b); - }); - } -} -se.validateArray = Ws; -function Js(e) { - const { gen: t, schema: r, keyword: a, it: s } = e; - if (!Array.isArray(r)) - throw new Error("ajv implementation error"); - if (r.some((b) => (0, ba.alwaysValidSchema)(s, b)) && !s.opts.unevaluated) - return; - const l = t.let("valid", !1), d = t.name("_valid"); - t.block(() => r.forEach((b, _) => { - const y = e.subschema({ - keyword: a, - schemaProp: _, - compositeRule: !0 - }, d); - t.assign(l, (0, _e._)`${l} || ${d}`), e.mergeValidEvaluated(y, d) || t.if((0, _e.not)(l)); - })), e.result(l, () => e.reset(), () => e.error(!0)); -} -se.validateUnion = Js; -Object.defineProperty(lt, "__esModule", { value: !0 }); -lt.validateKeywordUsage = lt.validSchemaType = lt.funcKeywordCode = lt.macroKeywordCode = void 0; -const Ne = ie, Ct = ct, Zs = se, Ys = br; -function Qs(e, t) { - const { gen: r, keyword: a, schema: s, parentSchema: l, it: d } = e, b = t.macro.call(d.self, s, l, d), _ = po(r, a, b); - d.opts.validateSchema !== !1 && d.self.validateSchema(b, !0); - const y = r.name("valid"); - e.subschema({ - schema: b, - schemaPath: Ne.nil, - errSchemaPath: `${d.errSchemaPath}/${a}`, - topSchemaRef: _, - compositeRule: !0 - }, y), e.pass(y, () => e.error(!0)); -} -lt.macroKeywordCode = Qs; -function Xs(e, t) { - var r; - const { gen: a, keyword: s, schema: l, parentSchema: d, $data: b, it: _ } = e; - ti(_, t); - const y = !b && t.compile ? t.compile.call(_.self, l, d, _) : t.validate, m = po(a, s, y), k = a.let("valid"); - e.block$data(k, N), e.ok((r = t.valid) !== null && r !== void 0 ? r : k); - function N() { - if (t.errors === !1) - C(), t.modifying && vn(e), x(() => e.error()); - else { - const v = t.async ? A() : j(); - t.modifying && vn(e), x(() => ei(e, v)); - } - } - function A() { - const v = a.let("ruleErrs", null); - return a.try(() => C((0, Ne._)`await `), (T) => a.assign(k, !1).if((0, Ne._)`${T} instanceof ${_.ValidationError}`, () => a.assign(v, (0, Ne._)`${T}.errors`), () => a.throw(T))), v; - } - function j() { - const v = (0, Ne._)`${m}.errors`; - return a.assign(v, null), C(Ne.nil), v; - } - function C(v = t.async ? (0, Ne._)`await ` : Ne.nil) { - const T = _.opts.passContext ? Ct.default.this : Ct.default.self, R = !("compile" in t && !b || t.schema === !1); - a.assign(k, (0, Ne._)`${v}${(0, Zs.callValidateCode)(e, m, T, R)}`, t.modifying); - } - function x(v) { - var T; - a.if((0, Ne.not)((T = t.valid) !== null && T !== void 0 ? T : k), v); - } -} -lt.funcKeywordCode = Xs; -function vn(e) { - const { gen: t, data: r, it: a } = e; - t.if(a.parentData, () => t.assign(r, (0, Ne._)`${a.parentData}[${a.parentDataProperty}]`)); -} -function ei(e, t) { - const { gen: r } = e; - r.if((0, Ne._)`Array.isArray(${t})`, () => { - r.assign(Ct.default.vErrors, (0, Ne._)`${Ct.default.vErrors} === null ? ${t} : ${Ct.default.vErrors}.concat(${t})`).assign(Ct.default.errors, (0, Ne._)`${Ct.default.vErrors}.length`), (0, Ys.extendErrors)(e); - }, () => e.error()); -} -function ti({ schemaEnv: e }, t) { - if (t.async && !e.$async) - throw new Error("async keyword in sync schema"); -} -function po(e, t, r) { - if (r === void 0) - throw new Error(`keyword "${t}" failed to compile`); - return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : { ref: r, code: (0, Ne.stringify)(r) }); -} -function ri(e, t, r = !1) { - return !t.length || t.some((a) => a === "array" ? Array.isArray(e) : a === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == a || r && typeof e > "u"); -} -lt.validSchemaType = ri; -function ai({ schema: e, opts: t, self: r, errSchemaPath: a }, s, l) { - if (Array.isArray(s.keyword) ? !s.keyword.includes(l) : s.keyword !== l) - throw new Error("ajv implementation error"); - const d = s.dependencies; - if (d != null && d.some((b) => !Object.prototype.hasOwnProperty.call(e, b))) - throw new Error(`parent schema must have dependencies of ${l}: ${d.join(",")}`); - if (s.validateSchema && !s.validateSchema(e[l])) { - const b = `keyword "${l}" value is invalid at path "${a}": ` + r.errorsText(s.validateSchema.errors); - if (t.validateSchema === "log") - r.logger.error(b); - else - throw new Error(b); - } -} -lt.validateKeywordUsage = ai; -var _t = {}; -Object.defineProperty(_t, "__esModule", { value: !0 }); -_t.extendSubschemaMode = _t.extendSubschemaData = _t.getSubschema = void 0; -const it = ie, fo = ce; -function ni(e, { keyword: t, schemaProp: r, schema: a, schemaPath: s, errSchemaPath: l, topSchemaRef: d }) { - if (t !== void 0 && a !== void 0) - throw new Error('both "keyword" and "schema" passed, only one allowed'); - if (t !== void 0) { - const b = e.schema[t]; - return r === void 0 ? { - schema: b, - schemaPath: (0, it._)`${e.schemaPath}${(0, it.getProperty)(t)}`, - errSchemaPath: `${e.errSchemaPath}/${t}` - } : { - schema: b[r], - schemaPath: (0, it._)`${e.schemaPath}${(0, it.getProperty)(t)}${(0, it.getProperty)(r)}`, - errSchemaPath: `${e.errSchemaPath}/${t}/${(0, fo.escapeFragment)(r)}` - }; - } - if (a !== void 0) { - if (s === void 0 || l === void 0 || d === void 0) - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); - return { - schema: a, - schemaPath: s, - topSchemaRef: d, - errSchemaPath: l - }; - } - throw new Error('either "keyword" or "schema" must be passed'); -} -_t.getSubschema = ni; -function oi(e, t, { dataProp: r, dataPropType: a, data: s, dataTypes: l, propertyName: d }) { - if (s !== void 0 && r !== void 0) - throw new Error('both "data" and "dataProp" passed, only one allowed'); - const { gen: b } = t; - if (r !== void 0) { - const { errorPath: y, dataPathArr: m, opts: k } = t, N = b.let("data", (0, it._)`${t.data}${(0, it.getProperty)(r)}`, !0); - _(N), e.errorPath = (0, it.str)`${y}${(0, fo.getErrorPath)(r, a, k.jsPropertySyntax)}`, e.parentDataProperty = (0, it._)`${r}`, e.dataPathArr = [...m, e.parentDataProperty]; - } - if (s !== void 0) { - const y = s instanceof it.Name ? s : b.let("data", s, !0); - _(y), d !== void 0 && (e.propertyName = d); - } - l && (e.dataTypes = l); - function _(y) { - e.data = y, e.dataLevel = t.dataLevel + 1, e.dataTypes = [], t.definedProperties = /* @__PURE__ */ new Set(), e.parentData = t.data, e.dataNames = [...t.dataNames, y]; - } -} -_t.extendSubschemaData = oi; -function si(e, { jtdDiscriminator: t, jtdMetadata: r, compositeRule: a, createErrors: s, allErrors: l }) { - a !== void 0 && (e.compositeRule = a), s !== void 0 && (e.createErrors = s), l !== void 0 && (e.allErrors = l), e.jtdDiscriminator = t, e.jtdMetadata = r; -} -_t.extendSubschemaMode = si; -var xe = {}, mo = function e(t, r) { - if (t === r) - return !0; - if (t && r && typeof t == "object" && typeof r == "object") { - if (t.constructor !== r.constructor) - return !1; - var a, s, l; - if (Array.isArray(t)) { - if (a = t.length, a != r.length) - return !1; - for (s = a; s-- !== 0; ) - if (!e(t[s], r[s])) - return !1; - return !0; - } - if (t.constructor === RegExp) - return t.source === r.source && t.flags === r.flags; - if (t.valueOf !== Object.prototype.valueOf) - return t.valueOf() === r.valueOf(); - if (t.toString !== Object.prototype.toString) - return t.toString() === r.toString(); - if (l = Object.keys(t), a = l.length, a !== Object.keys(r).length) - return !1; - for (s = a; s-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(r, l[s])) - return !1; - for (s = a; s-- !== 0; ) { - var d = l[s]; - if (!e(t[d], r[d])) - return !1; - } - return !0; - } - return t !== t && r !== r; -}, go = { exports: {} }, yt = go.exports = function(e, t, r) { - typeof t == "function" && (r = t, t = {}), r = t.cb || r; - var a = typeof r == "function" ? r : r.pre || function() { - }, s = r.post || function() { - }; - Ar(t, a, s, e, "", e); -}; -yt.keywords = { - additionalItems: !0, - items: !0, - contains: !0, - additionalProperties: !0, - propertyNames: !0, - not: !0, - if: !0, - then: !0, - else: !0 -}; -yt.arrayKeywords = { - items: !0, - allOf: !0, - anyOf: !0, - oneOf: !0 -}; -yt.propsKeywords = { - $defs: !0, - definitions: !0, - properties: !0, - patternProperties: !0, - dependencies: !0 -}; -yt.skipKeywords = { - default: !0, - enum: !0, - const: !0, - required: !0, - maximum: !0, - minimum: !0, - exclusiveMaximum: !0, - exclusiveMinimum: !0, - multipleOf: !0, - maxLength: !0, - minLength: !0, - pattern: !0, - format: !0, - maxItems: !0, - minItems: !0, - uniqueItems: !0, - maxProperties: !0, - minProperties: !0 -}; -function Ar(e, t, r, a, s, l, d, b, _, y) { - if (a && typeof a == "object" && !Array.isArray(a)) { - t(a, s, l, d, b, _, y); - for (var m in a) { - var k = a[m]; - if (Array.isArray(k)) { - if (m in yt.arrayKeywords) - for (var N = 0; N < k.length; N++) - Ar(e, t, r, k[N], s + "/" + m + "/" + N, l, s, m, a, N); - } else if (m in yt.propsKeywords) { - if (k && typeof k == "object") - for (var A in k) - Ar(e, t, r, k[A], s + "/" + m + "/" + ii(A), l, s, m, a, A); - } else - (m in yt.keywords || e.allKeys && !(m in yt.skipKeywords)) && Ar(e, t, r, k, s + "/" + m, l, s, m, a); - } - r(a, s, l, d, b, _, y); - } -} -function ii(e) { - return e.replace(/~/g, "~0").replace(/\//g, "~1"); -} -var li = go.exports; -Object.defineProperty(xe, "__esModule", { value: !0 }); -xe.getSchemaRefs = xe.resolveUrl = xe.normalizeId = xe._getFullPath = xe.getFullPath = xe.inlineRef = void 0; -const ci = ce, ui = mo, di = li, hi = /* @__PURE__ */ new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const" -]); -function pi(e, t = !0) { - return typeof e == "boolean" ? !0 : t === !0 ? !ua(e) : t ? bo(e) <= t : !1; -} -xe.inlineRef = pi; -const fi = /* @__PURE__ */ new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor" -]); -function ua(e) { - for (const t in e) { - if (fi.has(t)) - return !0; - const r = e[t]; - if (Array.isArray(r) && r.some(ua) || typeof r == "object" && ua(r)) - return !0; - } - return !1; -} -function bo(e) { - let t = 0; - for (const r in e) - if (r === "$ref" || (t++, !hi.has(r) && (typeof e[r] == "object" && (0, ci.eachItem)(e[r], (a) => t += bo(a)), t === 1 / 0))) - return 1 / 0; - return t; -} -function yo(e, t = "", r) { - r !== !1 && (t = qt(t)); - const a = e.parse(t); - return _o(e, a); -} -xe.getFullPath = yo; -function _o(e, t) { - return e.serialize(t).split("#")[0] + "#"; -} -xe._getFullPath = _o; -const mi = /#\/?$/; -function qt(e) { - return e ? e.replace(mi, "") : ""; -} -xe.normalizeId = qt; -function gi(e, t, r) { - return r = qt(r), e.resolve(t, r); -} -xe.resolveUrl = gi; -const bi = /^[a-z_][-a-z0-9._]*$/i; -function yi(e, t) { - if (typeof e == "boolean") - return {}; - const { schemaId: r, uriResolver: a } = this.opts, s = qt(e[r] || t), l = { "": s }, d = yo(a, s, !1), b = {}, _ = /* @__PURE__ */ new Set(); - return di(e, { allKeys: !0 }, (k, N, A, j) => { - if (j === void 0) - return; - const C = d + N; - let x = l[j]; - typeof k[r] == "string" && (x = v.call(this, k[r])), T.call(this, k.$anchor), T.call(this, k.$dynamicAnchor), l[N] = x; - function v(R) { - const n = this.opts.uriResolver.resolve; - if (R = qt(x ? n(x, R) : R), _.has(R)) - throw m(R); - _.add(R); - let i = this.refs[R]; - return typeof i == "string" && (i = this.refs[i]), typeof i == "object" ? y(k, i.schema, R) : R !== qt(C) && (R[0] === "#" ? (y(k, b[R], R), b[R] = k) : this.refs[R] = C), R; - } - function T(R) { - if (typeof R == "string") { - if (!bi.test(R)) - throw new Error(`invalid anchor "${R}"`); - v.call(this, `#${R}`); - } - } - }), b; - function y(k, N, A) { - if (N !== void 0 && !ui(k, N)) - throw m(A); - } - function m(k) { - return new Error(`reference "${k}" resolves to more than one schema`); - } -} -xe.getSchemaRefs = yi; -Object.defineProperty(rt, "__esModule", { value: !0 }); -rt.getData = rt.KeywordCxt = rt.validateFunctionCode = void 0; -const wo = Ht, kn = yr, wa = pt, zr = yr, _i = Zr, cr = lt, ra = _t, Z = ie, X = ct, wi = xe, ft = ce, nr = br; -function vi(e) { - if (Eo(e) && ($o(e), ko(e))) { - $i(e); - return; - } - vo(e, () => (0, wo.topBoolOrEmptySchema)(e)); -} -rt.validateFunctionCode = vi; -function vo({ gen: e, validateName: t, schema: r, schemaEnv: a, opts: s }, l) { - s.code.es5 ? e.func(t, (0, Z._)`${X.default.data}, ${X.default.valCxt}`, a.$async, () => { - e.code((0, Z._)`"use strict"; ${En(r, s)}`), Ei(e, s), e.code(l); - }) : e.func(t, (0, Z._)`${X.default.data}, ${ki(s)}`, a.$async, () => e.code(En(r, s)).code(l)); -} -function ki(e) { - return (0, Z._)`{${X.default.instancePath}="", ${X.default.parentData}, ${X.default.parentDataProperty}, ${X.default.rootData}=${X.default.data}${e.dynamicRef ? (0, Z._)`, ${X.default.dynamicAnchors}={}` : Z.nil}}={}`; -} -function Ei(e, t) { - e.if(X.default.valCxt, () => { - e.var(X.default.instancePath, (0, Z._)`${X.default.valCxt}.${X.default.instancePath}`), e.var(X.default.parentData, (0, Z._)`${X.default.valCxt}.${X.default.parentData}`), e.var(X.default.parentDataProperty, (0, Z._)`${X.default.valCxt}.${X.default.parentDataProperty}`), e.var(X.default.rootData, (0, Z._)`${X.default.valCxt}.${X.default.rootData}`), t.dynamicRef && e.var(X.default.dynamicAnchors, (0, Z._)`${X.default.valCxt}.${X.default.dynamicAnchors}`); - }, () => { - e.var(X.default.instancePath, (0, Z._)`""`), e.var(X.default.parentData, (0, Z._)`undefined`), e.var(X.default.parentDataProperty, (0, Z._)`undefined`), e.var(X.default.rootData, X.default.data), t.dynamicRef && e.var(X.default.dynamicAnchors, (0, Z._)`{}`); - }); -} -function $i(e) { - const { schema: t, opts: r, gen: a } = e; - vo(e, () => { - r.$comment && t.$comment && So(e), xi(e), a.let(X.default.vErrors, null), a.let(X.default.errors, 0), r.unevaluated && Pi(e), Po(e), ji(e); - }); -} -function Pi(e) { - const { gen: t, validateName: r } = e; - e.evaluated = t.const("evaluated", (0, Z._)`${r}.evaluated`), t.if((0, Z._)`${e.evaluated}.dynamicProps`, () => t.assign((0, Z._)`${e.evaluated}.props`, (0, Z._)`undefined`)), t.if((0, Z._)`${e.evaluated}.dynamicItems`, () => t.assign((0, Z._)`${e.evaluated}.items`, (0, Z._)`undefined`)); -} -function En(e, t) { - const r = typeof e == "object" && e[t.schemaId]; - return r && (t.code.source || t.code.process) ? (0, Z._)`/*# sourceURL=${r} */` : Z.nil; -} -function Si(e, t) { - if (Eo(e) && ($o(e), ko(e))) { - Ti(e, t); - return; - } - (0, wo.boolOrEmptySchema)(e, t); -} -function ko({ schema: e, self: t }) { - if (typeof e == "boolean") - return !e; - for (const r in e) - if (t.RULES.all[r]) - return !0; - return !1; -} -function Eo(e) { - return typeof e.schema != "boolean"; -} -function Ti(e, t) { - const { schema: r, gen: a, opts: s } = e; - s.$comment && r.$comment && So(e), Oi(e), Ni(e); - const l = a.const("_errs", X.default.errors); - Po(e, l), a.var(t, (0, Z._)`${l} === ${X.default.errors}`); -} -function $o(e) { - (0, ft.checkUnknownRules)(e), Ci(e); -} -function Po(e, t) { - if (e.opts.jtd) - return $n(e, [], !1, t); - const r = (0, kn.getSchemaTypes)(e.schema), a = (0, kn.coerceAndCheckDataType)(e, r); - $n(e, r, !a, t); -} -function Ci(e) { - const { schema: t, errSchemaPath: r, opts: a, self: s } = e; - t.$ref && a.ignoreKeywordsWithRef && (0, ft.schemaHasRulesButRef)(t, s.RULES) && s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`); -} -function xi(e) { - const { schema: t, opts: r } = e; - t.default !== void 0 && r.useDefaults && r.strictSchema && (0, ft.checkStrictMode)(e, "default is ignored in the schema root"); -} -function Oi(e) { - const t = e.schema[e.opts.schemaId]; - t && (e.baseId = (0, wi.resolveUrl)(e.opts.uriResolver, e.baseId, t)); -} -function Ni(e) { - if (e.schema.$async && !e.schemaEnv.$async) - throw new Error("async schema in sync schema"); -} -function So({ gen: e, schemaEnv: t, schema: r, errSchemaPath: a, opts: s }) { - const l = r.$comment; - if (s.$comment === !0) - e.code((0, Z._)`${X.default.self}.logger.log(${l})`); - else if (typeof s.$comment == "function") { - const d = (0, Z.str)`${a}/$comment`, b = e.scopeValue("root", { ref: t.root }); - e.code((0, Z._)`${X.default.self}.opts.$comment(${l}, ${d}, ${b}.schema)`); - } -} -function ji(e) { - const { gen: t, schemaEnv: r, validateName: a, ValidationError: s, opts: l } = e; - r.$async ? t.if((0, Z._)`${X.default.errors} === 0`, () => t.return(X.default.data), () => t.throw((0, Z._)`new ${s}(${X.default.vErrors})`)) : (t.assign((0, Z._)`${a}.errors`, X.default.vErrors), l.unevaluated && Li(e), t.return((0, Z._)`${X.default.errors} === 0`)); -} -function Li({ gen: e, evaluated: t, props: r, items: a }) { - r instanceof Z.Name && e.assign((0, Z._)`${t}.props`, r), a instanceof Z.Name && e.assign((0, Z._)`${t}.items`, a); -} -function $n(e, t, r, a) { - const { gen: s, schema: l, data: d, allErrors: b, opts: _, self: y } = e, { RULES: m } = y; - if (l.$ref && (_.ignoreKeywordsWithRef || !(0, ft.schemaHasRulesButRef)(l, m))) { - s.block(() => xo(e, "$ref", m.all.$ref.definition)); - return; - } - _.jtd || Ai(e, t), s.block(() => { - for (const N of m.rules) - k(N); - k(m.post); - }); - function k(N) { - (0, wa.shouldUseGroup)(l, N) && (N.type ? (s.if((0, zr.checkDataType)(N.type, d, _.strictNumbers)), Pn(e, N), t.length === 1 && t[0] === N.type && r && (s.else(), (0, zr.reportTypeError)(e)), s.endIf()) : Pn(e, N), b || s.if((0, Z._)`${X.default.errors} === ${a || 0}`)); - } -} -function Pn(e, t) { - const { gen: r, schema: a, opts: { useDefaults: s } } = e; - s && (0, _i.assignDefaults)(e, t.type), r.block(() => { - for (const l of t.rules) - (0, wa.shouldUseRule)(a, l) && xo(e, l.keyword, l.definition, t.type); - }); -} -function Ai(e, t) { - e.schemaEnv.meta || !e.opts.strictTypes || (Ri(e, t), e.opts.allowUnionTypes || Ii(e, t), Mi(e, e.dataTypes)); -} -function Ri(e, t) { - if (t.length) { - if (!e.dataTypes.length) { - e.dataTypes = t; - return; - } - t.forEach((r) => { - To(e.dataTypes, r) || va(e, `type "${r}" not allowed by context "${e.dataTypes.join(",")}"`); - }), Bi(e, t); - } -} -function Ii(e, t) { - t.length > 1 && !(t.length === 2 && t.includes("null")) && va(e, "use allowUnionTypes to allow union type keyword"); -} -function Mi(e, t) { - const r = e.self.RULES.all; - for (const a in r) { - const s = r[a]; - if (typeof s == "object" && (0, wa.shouldUseRule)(e.schema, s)) { - const { type: l } = s.definition; - l.length && !l.some((d) => Di(t, d)) && va(e, `missing type "${l.join(",")}" for keyword "${a}"`); - } - } -} -function Di(e, t) { - return e.includes(t) || t === "number" && e.includes("integer"); -} -function To(e, t) { - return e.includes(t) || t === "integer" && e.includes("number"); -} -function Bi(e, t) { - const r = []; - for (const a of e.dataTypes) - To(t, a) ? r.push(a) : t.includes("integer") && a === "number" && r.push("integer"); - e.dataTypes = r; -} -function va(e, t) { - const r = e.schemaEnv.baseId + e.errSchemaPath; - t += ` at "${r}" (strictTypes)`, (0, ft.checkStrictMode)(e, t, e.opts.strictTypes); -} -class Co { - constructor(t, r, a) { - if ((0, cr.validateKeywordUsage)(t, r, a), this.gen = t.gen, this.allErrors = t.allErrors, this.keyword = a, this.data = t.data, this.schema = t.schema[a], this.$data = r.$data && t.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, ft.schemaRefOrVal)(t, this.schema, a, this.$data), this.schemaType = r.schemaType, this.parentSchema = t.schema, this.params = {}, this.it = t, this.def = r, this.$data) - this.schemaCode = t.gen.const("vSchema", Oo(this.$data, t)); - else if (this.schemaCode = this.schemaValue, !(0, cr.validSchemaType)(this.schema, r.schemaType, r.allowUndefined)) - throw new Error(`${a} value must be ${JSON.stringify(r.schemaType)}`); - ("code" in r ? r.trackErrors : r.errors !== !1) && (this.errsCount = t.gen.const("_errs", X.default.errors)); - } - result(t, r, a) { - this.failResult((0, Z.not)(t), r, a); - } - failResult(t, r, a) { - this.gen.if(t), a ? a() : this.error(), r ? (this.gen.else(), r(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else(); - } - pass(t, r) { - this.failResult((0, Z.not)(t), void 0, r); - } - fail(t) { - if (t === void 0) { - this.error(), this.allErrors || this.gen.if(!1); - return; - } - this.gen.if(t), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else(); - } - fail$data(t) { - if (!this.$data) - return this.fail(t); - const { schemaCode: r } = this; - this.fail((0, Z._)`${r} !== undefined && (${(0, Z.or)(this.invalid$data(), t)})`); - } - error(t, r, a) { - if (r) { - this.setParams(r), this._error(t, a), this.setParams({}); - return; - } - this._error(t, a); - } - _error(t, r) { - (t ? nr.reportExtraError : nr.reportError)(this, this.def.error, r); - } - $dataError() { - (0, nr.reportError)(this, this.def.$dataError || nr.keyword$DataError); - } - reset() { - if (this.errsCount === void 0) - throw new Error('add "trackErrors" to keyword definition'); - (0, nr.resetErrorsCount)(this.gen, this.errsCount); - } - ok(t) { - this.allErrors || this.gen.if(t); - } - setParams(t, r) { - r ? Object.assign(this.params, t) : this.params = t; - } - block$data(t, r, a = Z.nil) { - this.gen.block(() => { - this.check$data(t, a), r(); - }); - } - check$data(t = Z.nil, r = Z.nil) { - if (!this.$data) - return; - const { gen: a, schemaCode: s, schemaType: l, def: d } = this; - a.if((0, Z.or)((0, Z._)`${s} === undefined`, r)), t !== Z.nil && a.assign(t, !0), (l.length || d.validateSchema) && (a.elseIf(this.invalid$data()), this.$dataError(), t !== Z.nil && a.assign(t, !1)), a.else(); - } - invalid$data() { - const { gen: t, schemaCode: r, schemaType: a, def: s, it: l } = this; - return (0, Z.or)(d(), b()); - function d() { - if (a.length) { - if (!(r instanceof Z.Name)) - throw new Error("ajv implementation error"); - const _ = Array.isArray(a) ? a : [a]; - return (0, Z._)`${(0, zr.checkDataTypes)(_, r, l.opts.strictNumbers, zr.DataType.Wrong)}`; - } - return Z.nil; - } - function b() { - if (s.validateSchema) { - const _ = t.scopeValue("validate$data", { ref: s.validateSchema }); - return (0, Z._)`!${_}(${r})`; - } - return Z.nil; - } - } - subschema(t, r) { - const a = (0, ra.getSubschema)(this.it, t); - (0, ra.extendSubschemaData)(a, this.it, t), (0, ra.extendSubschemaMode)(a, t); - const s = { ...this.it, ...a, items: void 0, props: void 0 }; - return Si(s, r), s; - } - mergeEvaluated(t, r) { - const { it: a, gen: s } = this; - a.opts.unevaluated && (a.props !== !0 && t.props !== void 0 && (a.props = ft.mergeEvaluated.props(s, t.props, a.props, r)), a.items !== !0 && t.items !== void 0 && (a.items = ft.mergeEvaluated.items(s, t.items, a.items, r))); - } - mergeValidEvaluated(t, r) { - const { it: a, gen: s } = this; - if (a.opts.unevaluated && (a.props !== !0 || a.items !== !0)) - return s.if(r, () => this.mergeEvaluated(t, Z.Name)), !0; - } -} -rt.KeywordCxt = Co; -function xo(e, t, r, a) { - const s = new Co(e, r, t); - "code" in r ? r.code(s, a) : s.$data && r.validate ? (0, cr.funcKeywordCode)(s, r) : "macro" in r ? (0, cr.macroKeywordCode)(s, r) : (r.compile || r.validate) && (0, cr.funcKeywordCode)(s, r); -} -const zi = /^\/(?:[^~]|~0|~1)*$/, Vi = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; -function Oo(e, { dataLevel: t, dataNames: r, dataPathArr: a }) { - let s, l; - if (e === "") - return X.default.rootData; - if (e[0] === "/") { - if (!zi.test(e)) - throw new Error(`Invalid JSON-pointer: ${e}`); - s = e, l = X.default.rootData; - } else { - const y = Vi.exec(e); - if (!y) - throw new Error(`Invalid JSON-pointer: ${e}`); - const m = +y[1]; - if (s = y[2], s === "#") { - if (m >= t) - throw new Error(_("property/index", m)); - return a[t - m]; - } - if (m > t) - throw new Error(_("data", m)); - if (l = r[t - m], !s) - return l; - } - let d = l; - const b = s.split("/"); - for (const y of b) - y && (l = (0, Z._)`${l}${(0, Z.getProperty)((0, ft.unescapeJsonPointer)(y))}`, d = (0, Z._)`${d} && ${l}`); - return d; - function _(y, m) { - return `Cannot access ${y} ${m} levels up, current level is ${t}`; - } -} -rt.getData = Oo; -var _r = {}; -Object.defineProperty(_r, "__esModule", { value: !0 }); -class Fi extends Error { - constructor(t) { - super("validation failed"), this.errors = t, this.ajv = this.validation = !0; - } -} -_r.default = Fi; -var wr = {}; -Object.defineProperty(wr, "__esModule", { value: !0 }); -const aa = xe; -class qi extends Error { - constructor(t, r, a, s) { - super(s || `can't resolve reference ${a} from id ${r}`), this.missingRef = (0, aa.resolveUrl)(t, r, a), this.missingSchema = (0, aa.normalizeId)((0, aa.getFullPath)(t, this.missingRef)); - } -} -wr.default = qi; -var Be = {}; -Object.defineProperty(Be, "__esModule", { value: !0 }); -Be.resolveSchema = Be.getCompilingSchema = Be.resolveRef = Be.compileSchema = Be.SchemaEnv = void 0; -const Ze = ie, Ui = _r, Pt = ct, tt = xe, Sn = ce, Gi = rt; -class Yr { - constructor(t) { - var r; - this.refs = {}, this.dynamicAnchors = {}; - let a; - typeof t.schema == "object" && (a = t.schema), this.schema = t.schema, this.schemaId = t.schemaId, this.root = t.root || this, this.baseId = (r = t.baseId) !== null && r !== void 0 ? r : (0, tt.normalizeId)(a == null ? void 0 : a[t.schemaId || "$id"]), this.schemaPath = t.schemaPath, this.localRefs = t.localRefs, this.meta = t.meta, this.$async = a == null ? void 0 : a.$async, this.refs = {}; - } -} -Be.SchemaEnv = Yr; -function ka(e) { - const t = No.call(this, e); - if (t) - return t; - const r = (0, tt.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: a, lines: s } = this.opts.code, { ownProperties: l } = this.opts, d = new Ze.CodeGen(this.scope, { es5: a, lines: s, ownProperties: l }); - let b; - e.$async && (b = d.scopeValue("Error", { - ref: Ui.default, - code: (0, Ze._)`require("ajv/dist/runtime/validation_error").default` - })); - const _ = d.scopeName("validate"); - e.validateName = _; - const y = { - gen: d, - allErrors: this.opts.allErrors, - data: Pt.default.data, - parentData: Pt.default.parentData, - parentDataProperty: Pt.default.parentDataProperty, - dataNames: [Pt.default.data], - dataPathArr: [Ze.nil], - dataLevel: 0, - dataTypes: [], - definedProperties: /* @__PURE__ */ new Set(), - topSchemaRef: d.scopeValue("schema", this.opts.code.source === !0 ? { ref: e.schema, code: (0, Ze.stringify)(e.schema) } : { ref: e.schema }), - validateName: _, - ValidationError: b, - schema: e.schema, - schemaEnv: e, - rootId: r, - baseId: e.baseId || r, - schemaPath: Ze.nil, - errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: (0, Ze._)`""`, - opts: this.opts, - self: this - }; - let m; - try { - this._compilations.add(e), (0, Gi.validateFunctionCode)(y), d.optimize(this.opts.code.optimize); - const k = d.toString(); - m = `${d.scopeRefs(Pt.default.scope)}return ${k}`, this.opts.code.process && (m = this.opts.code.process(m, e)); - const N = new Function(`${Pt.default.self}`, `${Pt.default.scope}`, m)(this, this.scope.get()); - if (this.scope.value(_, { ref: N }), N.errors = null, N.schema = e.schema, N.schemaEnv = e, e.$async && (N.$async = !0), this.opts.code.source === !0 && (N.source = { validateName: _, validateCode: k, scopeValues: d._values }), this.opts.unevaluated) { - const { props: A, items: j } = y; - N.evaluated = { - props: A instanceof Ze.Name ? void 0 : A, - items: j instanceof Ze.Name ? void 0 : j, - dynamicProps: A instanceof Ze.Name, - dynamicItems: j instanceof Ze.Name - }, N.source && (N.source.evaluated = (0, Ze.stringify)(N.evaluated)); - } - return e.validate = N, e; - } catch (k) { - throw delete e.validate, delete e.validateName, m && this.logger.error("Error compiling schema, function code:", m), k; - } finally { - this._compilations.delete(e); - } -} -Be.compileSchema = ka; -function Hi(e, t, r) { - var a; - r = (0, tt.resolveUrl)(this.opts.uriResolver, t, r); - const s = e.refs[r]; - if (s) - return s; - let l = Ji.call(this, e, r); - if (l === void 0) { - const d = (a = e.localRefs) === null || a === void 0 ? void 0 : a[r], { schemaId: b } = this.opts; - d && (l = new Yr({ schema: d, schemaId: b, root: e, baseId: t })); - } - if (l !== void 0) - return e.refs[r] = Ki.call(this, l); -} -Be.resolveRef = Hi; -function Ki(e) { - return (0, tt.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : ka.call(this, e); -} -function No(e) { - for (const t of this._compilations) - if (Wi(t, e)) - return t; -} -Be.getCompilingSchema = No; -function Wi(e, t) { - return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId; -} -function Ji(e, t) { - let r; - for (; typeof (r = this.refs[t]) == "string"; ) - t = r; - return r || this.schemas[t] || Qr.call(this, e, t); -} -function Qr(e, t) { - const r = this.opts.uriResolver.parse(t), a = (0, tt._getFullPath)(this.opts.uriResolver, r); - let s = (0, tt.getFullPath)(this.opts.uriResolver, e.baseId, void 0); - if (Object.keys(e.schema).length > 0 && a === s) - return na.call(this, r, e); - const l = (0, tt.normalizeId)(a), d = this.refs[l] || this.schemas[l]; - if (typeof d == "string") { - const b = Qr.call(this, e, d); - return typeof (b == null ? void 0 : b.schema) != "object" ? void 0 : na.call(this, r, b); - } - if (typeof (d == null ? void 0 : d.schema) == "object") { - if (d.validate || ka.call(this, d), l === (0, tt.normalizeId)(t)) { - const { schema: b } = d, { schemaId: _ } = this.opts, y = b[_]; - return y && (s = (0, tt.resolveUrl)(this.opts.uriResolver, s, y)), new Yr({ schema: b, schemaId: _, root: e, baseId: s }); - } - return na.call(this, r, d); - } -} -Be.resolveSchema = Qr; -const Zi = /* @__PURE__ */ new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions" -]); -function na(e, { baseId: t, schema: r, root: a }) { - var s; - if (((s = e.fragment) === null || s === void 0 ? void 0 : s[0]) !== "/") - return; - for (const b of e.fragment.slice(1).split("/")) { - if (typeof r == "boolean") - return; - const _ = r[(0, Sn.unescapeFragment)(b)]; - if (_ === void 0) - return; - r = _; - const y = typeof r == "object" && r[this.opts.schemaId]; - !Zi.has(b) && y && (t = (0, tt.resolveUrl)(this.opts.uriResolver, t, y)); - } - let l; - if (typeof r != "boolean" && r.$ref && !(0, Sn.schemaHasRulesButRef)(r, this.RULES)) { - const b = (0, tt.resolveUrl)(this.opts.uriResolver, t, r.$ref); - l = Qr.call(this, a, b); - } - const { schemaId: d } = this.opts; - if (l = l || new Yr({ schema: r, schemaId: d, root: a, baseId: t }), l.schema !== l.root.schema) - return l; -} -const Yi = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", Qi = "Meta-schema for $data reference (JSON AnySchema extension proposal)", Xi = "object", el = [ - "$data" -], tl = { - $data: { - type: "string", - anyOf: [ - { - format: "relative-json-pointer" - }, - { - format: "json-pointer" - } - ] - } -}, rl = !1, al = { - $id: Yi, - description: Qi, - type: Xi, - required: el, - properties: tl, - additionalProperties: rl -}; -var Ea = {}, da = { exports: {} }; -/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -(function(e, t) { - (function(r, a) { - a(t); - })(no, function(r) { - function a() { - for (var p = arguments.length, E = Array(p), S = 0; S < p; S++) - E[S] = arguments[S]; - if (E.length > 1) { - E[0] = E[0].slice(0, -1); - for (var M = E.length - 1, D = 1; D < M; ++D) - E[D] = E[D].slice(1, -1); - return E[M] = E[M].slice(1), E.join(""); - } else - return E[0]; - } - function s(p) { - return "(?:" + p + ")"; - } - function l(p) { - return p === void 0 ? "undefined" : p === null ? "null" : Object.prototype.toString.call(p).split(" ").pop().split("]").shift().toLowerCase(); - } - function d(p) { - return p.toUpperCase(); - } - function b(p) { - return p != null ? p instanceof Array ? p : typeof p.length != "number" || p.split || p.setInterval || p.call ? [p] : Array.prototype.slice.call(p) : []; - } - function _(p, E) { - var S = p; - if (E) - for (var M in E) - S[M] = E[M]; - return S; - } - function y(p) { - var E = "[A-Za-z]", S = "[0-9]", M = a(S, "[A-Fa-f]"), D = s(s("%[EFef]" + M + "%" + M + M + "%" + M + M) + "|" + s("%[89A-Fa-f]" + M + "%" + M + M) + "|" + s("%" + M + M)), Q = "[\\:\\/\\?\\#\\[\\]\\@]", Y = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", ue = a(Q, Y), ke = p ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", pe = p ? "[\\uE000-\\uF8FF]" : "[]", le = a(E, S, "[\\-\\.\\_\\~]", ke); - s(E + a(E, S, "[\\+\\-\\.]") + "*"), s(s(D + "|" + a(le, Y, "[\\:]")) + "*"); - var ye = s(s("25[0-5]") + "|" + s("2[0-4]" + S) + "|" + s("1" + S + S) + "|" + s("0?[1-9]" + S) + "|0?0?" + S), we = s(ye + "\\." + ye + "\\." + ye + "\\." + ye), ee = s(M + "{1,4}"), Ee = s(s(ee + "\\:" + ee) + "|" + we), fe = s(s(ee + "\\:") + "{6}" + Ee), Fe = s("\\:\\:" + s(ee + "\\:") + "{5}" + Ee), Dt = s(s(ee) + "?\\:\\:" + s(ee + "\\:") + "{4}" + Ee), Je = s(s(s(ee + "\\:") + "{0,1}" + ee) + "?\\:\\:" + s(ee + "\\:") + "{3}" + Ee), dt = s(s(s(ee + "\\:") + "{0,2}" + ee) + "?\\:\\:" + s(ee + "\\:") + "{2}" + Ee), kt = s(s(s(ee + "\\:") + "{0,3}" + ee) + "?\\:\\:" + ee + "\\:" + Ee), Et = s(s(s(ee + "\\:") + "{0,4}" + ee) + "?\\:\\:" + Ee), qe = s(s(s(ee + "\\:") + "{0,5}" + ee) + "?\\:\\:" + ee), ht = s(s(s(ee + "\\:") + "{0,6}" + ee) + "?\\:\\:"), $t = s([fe, Fe, Dt, Je, dt, kt, Et, qe, ht].join("|")), ot = s(s(le + "|" + D) + "+"); - s("[vV]" + M + "+\\." + a(le, Y, "[\\:]") + "+"), s(s(D + "|" + a(le, Y)) + "*"); - var Er = s(D + "|" + a(le, Y, "[\\:\\@]")); - return s(s(D + "|" + a(le, Y, "[\\@]")) + "+"), s(s(Er + "|" + a("[\\/\\?]", pe)) + "*"), { - NOT_SCHEME: new RegExp(a("[^]", E, S, "[\\+\\-\\.]"), "g"), - NOT_USERINFO: new RegExp(a("[^\\%\\:]", le, Y), "g"), - NOT_HOST: new RegExp(a("[^\\%\\[\\]\\:]", le, Y), "g"), - NOT_PATH: new RegExp(a("[^\\%\\/\\:\\@]", le, Y), "g"), - NOT_PATH_NOSCHEME: new RegExp(a("[^\\%\\/\\@]", le, Y), "g"), - NOT_QUERY: new RegExp(a("[^\\%]", le, Y, "[\\:\\@\\/\\?]", pe), "g"), - NOT_FRAGMENT: new RegExp(a("[^\\%]", le, Y, "[\\:\\@\\/\\?]"), "g"), - ESCAPE: new RegExp(a("[^]", le, Y), "g"), - UNRESERVED: new RegExp(le, "g"), - OTHER_CHARS: new RegExp(a("[^\\%]", le, ue), "g"), - PCT_ENCODED: new RegExp(D, "g"), - IPV4ADDRESS: new RegExp("^(" + we + ")$"), - IPV6ADDRESS: new RegExp("^\\[?(" + $t + ")" + s(s("\\%25|\\%(?!" + M + "{2})") + "(" + ot + ")") + "?\\]?$") - //RFC 6874, with relaxed parsing rules - }; - } - var m = y(!1), k = y(!0), N = function() { - function p(E, S) { - var M = [], D = !0, Q = !1, Y = void 0; - try { - for (var ue = E[Symbol.iterator](), ke; !(D = (ke = ue.next()).done) && (M.push(ke.value), !(S && M.length === S)); D = !0) - ; - } catch (pe) { - Q = !0, Y = pe; - } finally { - try { - !D && ue.return && ue.return(); - } finally { - if (Q) - throw Y; - } - } - return M; - } - return function(E, S) { - if (Array.isArray(E)) - return E; - if (Symbol.iterator in Object(E)) - return p(E, S); - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - }; - }(), A = function(p) { - if (Array.isArray(p)) { - for (var E = 0, S = Array(p.length); E < p.length; E++) - S[E] = p[E]; - return S; - } else - return Array.from(p); - }, j = 2147483647, C = 36, x = 1, v = 26, T = 38, R = 700, n = 72, i = 128, o = "-", c = /^xn--/, u = /[^\0-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = { - overflow: "Overflow: input needs wider integers to process", - "not-basic": "Illegal input >= 0x80 (not a basic code point)", - "invalid-input": "Invalid input" - }, O = C - x, z = Math.floor, q = String.fromCharCode; - function B(p) { - throw new RangeError(g[p]); - } - function G(p, E) { - for (var S = [], M = p.length; M--; ) - S[M] = E(p[M]); - return S; - } - function w(p, E) { - var S = p.split("@"), M = ""; - S.length > 1 && (M = S[0] + "@", p = S[1]), p = p.replace(f, "."); - var D = p.split("."), Q = G(D, E).join("."); - return M + Q; - } - function U(p) { - for (var E = [], S = 0, M = p.length; S < M; ) { - var D = p.charCodeAt(S++); - if (D >= 55296 && D <= 56319 && S < M) { - var Q = p.charCodeAt(S++); - (Q & 64512) == 56320 ? E.push(((D & 1023) << 10) + (Q & 1023) + 65536) : (E.push(D), S--); - } else - E.push(D); - } - return E; - } - var W = function(p) { - return String.fromCodePoint.apply(String, A(p)); - }, J = function(p) { - return p - 48 < 10 ? p - 22 : p - 65 < 26 ? p - 65 : p - 97 < 26 ? p - 97 : C; - }, V = function(p, E) { - return p + 22 + 75 * (p < 26) - ((E != 0) << 5); - }, P = function(p, E, S) { - var M = 0; - for ( - p = S ? z(p / R) : p >> 1, p += z(p / E); - /* no initialization */ - p > O * v >> 1; - M += C - ) - p = z(p / O); - return z(M + (O + 1) * p / (p + T)); - }, F = function(p) { - var E = [], S = p.length, M = 0, D = i, Q = n, Y = p.lastIndexOf(o); - Y < 0 && (Y = 0); - for (var ue = 0; ue < Y; ++ue) - p.charCodeAt(ue) >= 128 && B("not-basic"), E.push(p.charCodeAt(ue)); - for (var ke = Y > 0 ? Y + 1 : 0; ke < S; ) { - for ( - var pe = M, le = 1, ye = C; - ; - /* no condition */ - ye += C - ) { - ke >= S && B("invalid-input"); - var we = J(p.charCodeAt(ke++)); - (we >= C || we > z((j - M) / le)) && B("overflow"), M += we * le; - var ee = ye <= Q ? x : ye >= Q + v ? v : ye - Q; - if (we < ee) - break; - var Ee = C - ee; - le > z(j / Ee) && B("overflow"), le *= Ee; - } - var fe = E.length + 1; - Q = P(M - pe, fe, pe == 0), z(M / fe) > j - D && B("overflow"), D += z(M / fe), M %= fe, E.splice(M++, 0, D); - } - return String.fromCodePoint.apply(String, E); - }, L = function(p) { - var E = []; - p = U(p); - var S = p.length, M = i, D = 0, Q = n, Y = !0, ue = !1, ke = void 0; - try { - for (var pe = p[Symbol.iterator](), le; !(Y = (le = pe.next()).done); Y = !0) { - var ye = le.value; - ye < 128 && E.push(q(ye)); - } - } catch (ar) { - ue = !0, ke = ar; - } finally { - try { - !Y && pe.return && pe.return(); - } finally { - if (ue) - throw ke; - } - } - var we = E.length, ee = we; - for (we && E.push(o); ee < S; ) { - var Ee = j, fe = !0, Fe = !1, Dt = void 0; - try { - for (var Je = p[Symbol.iterator](), dt; !(fe = (dt = Je.next()).done); fe = !0) { - var kt = dt.value; - kt >= M && kt < Ee && (Ee = kt); - } - } catch (ar) { - Fe = !0, Dt = ar; - } finally { - try { - !fe && Je.return && Je.return(); - } finally { - if (Fe) - throw Dt; - } - } - var Et = ee + 1; - Ee - M > z((j - D) / Et) && B("overflow"), D += (Ee - M) * Et, M = Ee; - var qe = !0, ht = !1, $t = void 0; - try { - for (var ot = p[Symbol.iterator](), Er; !(qe = (Er = ot.next()).done); qe = !0) { - var gn = Er.value; - if (gn < M && ++D > j && B("overflow"), gn == M) { - for ( - var $r = D, Pr = C; - ; - /* no condition */ - Pr += C - ) { - var Sr = Pr <= Q ? x : Pr >= Q + v ? v : Pr - Q; - if ($r < Sr) - break; - var bn = $r - Sr, yn = C - Sr; - E.push(q(V(Sr + bn % yn, 0))), $r = z(bn / yn); - } - E.push(q(V($r, 0))), Q = P(D, Et, ee == we), D = 0, ++ee; - } - } - } catch (ar) { - ht = !0, $t = ar; - } finally { - try { - !qe && ot.return && ot.return(); - } finally { - if (ht) - throw $t; - } - } - ++D, ++M; - } - return E.join(""); - }, h = function(p) { - return w(p, function(E) { - return c.test(E) ? F(E.slice(4).toLowerCase()) : E; - }); - }, $ = function(p) { - return w(p, function(E) { - return u.test(E) ? "xn--" + L(E) : E; - }); - }, I = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - version: "2.1.0", - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - ucs2: { - decode: U, - encode: W - }, - decode: F, - encode: L, - toASCII: $, - toUnicode: h - }, H = {}; - function K(p) { - var E = p.charCodeAt(0), S = void 0; - return E < 16 ? S = "%0" + E.toString(16).toUpperCase() : E < 128 ? S = "%" + E.toString(16).toUpperCase() : E < 2048 ? S = "%" + (E >> 6 | 192).toString(16).toUpperCase() + "%" + (E & 63 | 128).toString(16).toUpperCase() : S = "%" + (E >> 12 | 224).toString(16).toUpperCase() + "%" + (E >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (E & 63 | 128).toString(16).toUpperCase(), S; - } - function te(p) { - for (var E = "", S = 0, M = p.length; S < M; ) { - var D = parseInt(p.substr(S + 1, 2), 16); - if (D < 128) - E += String.fromCharCode(D), S += 3; - else if (D >= 194 && D < 224) { - if (M - S >= 6) { - var Q = parseInt(p.substr(S + 4, 2), 16); - E += String.fromCharCode((D & 31) << 6 | Q & 63); - } else - E += p.substr(S, 6); - S += 6; - } else if (D >= 224) { - if (M - S >= 9) { - var Y = parseInt(p.substr(S + 4, 2), 16), ue = parseInt(p.substr(S + 7, 2), 16); - E += String.fromCharCode((D & 15) << 12 | (Y & 63) << 6 | ue & 63); - } else - E += p.substr(S, 9); - S += 9; - } else - E += p.substr(S, 3), S += 3; - } - return E; - } - function ne(p, E) { - function S(M) { - var D = te(M); - return D.match(E.UNRESERVED) ? D : M; - } - return p.scheme && (p.scheme = String(p.scheme).replace(E.PCT_ENCODED, S).toLowerCase().replace(E.NOT_SCHEME, "")), p.userinfo !== void 0 && (p.userinfo = String(p.userinfo).replace(E.PCT_ENCODED, S).replace(E.NOT_USERINFO, K).replace(E.PCT_ENCODED, d)), p.host !== void 0 && (p.host = String(p.host).replace(E.PCT_ENCODED, S).toLowerCase().replace(E.NOT_HOST, K).replace(E.PCT_ENCODED, d)), p.path !== void 0 && (p.path = String(p.path).replace(E.PCT_ENCODED, S).replace(p.scheme ? E.NOT_PATH : E.NOT_PATH_NOSCHEME, K).replace(E.PCT_ENCODED, d)), p.query !== void 0 && (p.query = String(p.query).replace(E.PCT_ENCODED, S).replace(E.NOT_QUERY, K).replace(E.PCT_ENCODED, d)), p.fragment !== void 0 && (p.fragment = String(p.fragment).replace(E.PCT_ENCODED, S).replace(E.NOT_FRAGMENT, K).replace(E.PCT_ENCODED, d)), p; - } - function be(p) { - return p.replace(/^0*(.*)/, "$1") || "0"; - } - function Ae(p, E) { - var S = p.match(E.IPV4ADDRESS) || [], M = N(S, 2), D = M[1]; - return D ? D.split(".").map(be).join(".") : p; - } - function ut(p, E) { - var S = p.match(E.IPV6ADDRESS) || [], M = N(S, 3), D = M[1], Q = M[2]; - if (D) { - for (var Y = D.toLowerCase().split("::").reverse(), ue = N(Y, 2), ke = ue[0], pe = ue[1], le = pe ? pe.split(":").map(be) : [], ye = ke.split(":").map(be), we = E.IPV4ADDRESS.test(ye[ye.length - 1]), ee = we ? 7 : 8, Ee = ye.length - ee, fe = Array(ee), Fe = 0; Fe < ee; ++Fe) - fe[Fe] = le[Fe] || ye[Ee + Fe] || ""; - we && (fe[ee - 1] = Ae(fe[ee - 1], E)); - var Dt = fe.reduce(function(qe, ht, $t) { - if (!ht || ht === "0") { - var ot = qe[qe.length - 1]; - ot && ot.index + ot.length === $t ? ot.length++ : qe.push({ index: $t, length: 1 }); - } - return qe; - }, []), Je = Dt.sort(function(qe, ht) { - return ht.length - qe.length; - })[0], dt = void 0; - if (Je && Je.length > 1) { - var kt = fe.slice(0, Je.index), Et = fe.slice(Je.index + Je.length); - dt = kt.join(":") + "::" + Et.join(":"); - } else - dt = fe.join(":"); - return Q && (dt += "%" + Q), dt; - } else - return p; - } - var Zt = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, Yt = "".match(/(){0}/)[1] === void 0; - function ze(p) { - var E = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, S = {}, M = E.iri !== !1 ? k : m; - E.reference === "suffix" && (p = (E.scheme ? E.scheme + ":" : "") + "//" + p); - var D = p.match(Zt); - if (D) { - Yt ? (S.scheme = D[1], S.userinfo = D[3], S.host = D[4], S.port = parseInt(D[5], 10), S.path = D[6] || "", S.query = D[7], S.fragment = D[8], isNaN(S.port) && (S.port = D[5])) : (S.scheme = D[1] || void 0, S.userinfo = p.indexOf("@") !== -1 ? D[3] : void 0, S.host = p.indexOf("//") !== -1 ? D[4] : void 0, S.port = parseInt(D[5], 10), S.path = D[6] || "", S.query = p.indexOf("?") !== -1 ? D[7] : void 0, S.fragment = p.indexOf("#") !== -1 ? D[8] : void 0, isNaN(S.port) && (S.port = p.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? D[4] : void 0)), S.host && (S.host = ut(Ae(S.host, M), M)), S.scheme === void 0 && S.userinfo === void 0 && S.host === void 0 && S.port === void 0 && !S.path && S.query === void 0 ? S.reference = "same-document" : S.scheme === void 0 ? S.reference = "relative" : S.fragment === void 0 ? S.reference = "absolute" : S.reference = "uri", E.reference && E.reference !== "suffix" && E.reference !== S.reference && (S.error = S.error || "URI is not a " + E.reference + " reference."); - var Q = H[(E.scheme || S.scheme || "").toLowerCase()]; - if (!E.unicodeSupport && (!Q || !Q.unicodeSupport)) { - if (S.host && (E.domainHost || Q && Q.domainHost)) - try { - S.host = I.toASCII(S.host.replace(M.PCT_ENCODED, te).toLowerCase()); - } catch (Y) { - S.error = S.error || "Host's domain name can not be converted to ASCII via punycode: " + Y; - } - ne(S, m); - } else - ne(S, M); - Q && Q.parse && Q.parse(S, E); - } else - S.error = S.error || "URI can not be parsed."; - return S; - } - function Qt(p, E) { - var S = E.iri !== !1 ? k : m, M = []; - return p.userinfo !== void 0 && (M.push(p.userinfo), M.push("@")), p.host !== void 0 && M.push(ut(Ae(String(p.host), S), S).replace(S.IPV6ADDRESS, function(D, Q, Y) { - return "[" + Q + (Y ? "%25" + Y : "") + "]"; - })), (typeof p.port == "number" || typeof p.port == "string") && (M.push(":"), M.push(String(p.port))), M.length ? M.join("") : void 0; - } - var Lt = /^\.\.?\//, At = /^\/\.(\/|$)/, Rt = /^\/\.\.(\/|$)/, Xt = /^\/?(?:.|\n)*?(?=\/|$)/; - function at(p) { - for (var E = []; p.length; ) - if (p.match(Lt)) - p = p.replace(Lt, ""); - else if (p.match(At)) - p = p.replace(At, "/"); - else if (p.match(Rt)) - p = p.replace(Rt, "/"), E.pop(); - else if (p === "." || p === "..") - p = ""; - else { - var S = p.match(Xt); - if (S) { - var M = S[0]; - p = p.slice(M.length), E.push(M); - } else - throw new Error("Unexpected dot segment condition"); - } - return E.join(""); - } - function Re(p) { - var E = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, S = E.iri ? k : m, M = [], D = H[(E.scheme || p.scheme || "").toLowerCase()]; - if (D && D.serialize && D.serialize(p, E), p.host && !S.IPV6ADDRESS.test(p.host) && (E.domainHost || D && D.domainHost)) - try { - p.host = E.iri ? I.toUnicode(p.host) : I.toASCII(p.host.replace(S.PCT_ENCODED, te).toLowerCase()); - } catch (ue) { - p.error = p.error || "Host's domain name can not be converted to " + (E.iri ? "Unicode" : "ASCII") + " via punycode: " + ue; - } - ne(p, S), E.reference !== "suffix" && p.scheme && (M.push(p.scheme), M.push(":")); - var Q = Qt(p, E); - if (Q !== void 0 && (E.reference !== "suffix" && M.push("//"), M.push(Q), p.path && p.path.charAt(0) !== "/" && M.push("/")), p.path !== void 0) { - var Y = p.path; - !E.absolutePath && (!D || !D.absolutePath) && (Y = at(Y)), Q === void 0 && (Y = Y.replace(/^\/\//, "/%2F")), M.push(Y); - } - return p.query !== void 0 && (M.push("?"), M.push(p.query)), p.fragment !== void 0 && (M.push("#"), M.push(p.fragment)), M.join(""); - } - function It(p, E) { - var S = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, M = arguments[3], D = {}; - return M || (p = ze(Re(p, S), S), E = ze(Re(E, S), S)), S = S || {}, !S.tolerant && E.scheme ? (D.scheme = E.scheme, D.userinfo = E.userinfo, D.host = E.host, D.port = E.port, D.path = at(E.path || ""), D.query = E.query) : (E.userinfo !== void 0 || E.host !== void 0 || E.port !== void 0 ? (D.userinfo = E.userinfo, D.host = E.host, D.port = E.port, D.path = at(E.path || ""), D.query = E.query) : (E.path ? (E.path.charAt(0) === "/" ? D.path = at(E.path) : ((p.userinfo !== void 0 || p.host !== void 0 || p.port !== void 0) && !p.path ? D.path = "/" + E.path : p.path ? D.path = p.path.slice(0, p.path.lastIndexOf("/") + 1) + E.path : D.path = E.path, D.path = at(D.path)), D.query = E.query) : (D.path = p.path, E.query !== void 0 ? D.query = E.query : D.query = p.query), D.userinfo = p.userinfo, D.host = p.host, D.port = p.port), D.scheme = p.scheme), D.fragment = E.fragment, D; - } - function er(p, E, S) { - var M = _({ scheme: "null" }, S); - return Re(It(ze(p, M), ze(E, M), M, !0), M); - } - function wt(p, E) { - return typeof p == "string" ? p = Re(ze(p, E), E) : l(p) === "object" && (p = ze(Re(p, E), E)), p; - } - function tr(p, E, S) { - return typeof p == "string" ? p = Re(ze(p, S), S) : l(p) === "object" && (p = Re(p, S)), typeof E == "string" ? E = Re(ze(E, S), S) : l(E) === "object" && (E = Re(E, S)), p === E; - } - function kr(p, E) { - return p && p.toString().replace(!E || !E.iri ? m.ESCAPE : k.ESCAPE, K); - } - function Ve(p, E) { - return p && p.toString().replace(!E || !E.iri ? m.PCT_ENCODED : k.PCT_ENCODED, te); - } - var vt = { - scheme: "http", - domainHost: !0, - parse: function(p, E) { - return p.host || (p.error = p.error || "HTTP URIs must have a host."), p; - }, - serialize: function(p, E) { - var S = String(p.scheme).toLowerCase() === "https"; - return (p.port === (S ? 443 : 80) || p.port === "") && (p.port = void 0), p.path || (p.path = "/"), p; - } - }, ln = { - scheme: "https", - domainHost: vt.domainHost, - parse: vt.parse, - serialize: vt.serialize - }; - function cn(p) { - return typeof p.secure == "boolean" ? p.secure : String(p.scheme).toLowerCase() === "wss"; - } - var rr = { - scheme: "ws", - domainHost: !0, - parse: function(p, E) { - var S = p; - return S.secure = cn(S), S.resourceName = (S.path || "/") + (S.query ? "?" + S.query : ""), S.path = void 0, S.query = void 0, S; - }, - serialize: function(p, E) { - if ((p.port === (cn(p) ? 443 : 80) || p.port === "") && (p.port = void 0), typeof p.secure == "boolean" && (p.scheme = p.secure ? "wss" : "ws", p.secure = void 0), p.resourceName) { - var S = p.resourceName.split("?"), M = N(S, 2), D = M[0], Q = M[1]; - p.path = D && D !== "/" ? D : void 0, p.query = Q, p.resourceName = void 0; - } - return p.fragment = void 0, p; - } - }, un = { - scheme: "wss", - domainHost: rr.domainHost, - parse: rr.parse, - serialize: rr.serialize - }, ss = {}, dn = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", nt = "[0-9A-Fa-f]", is = s(s("%[EFef]" + nt + "%" + nt + nt + "%" + nt + nt) + "|" + s("%[89A-Fa-f]" + nt + "%" + nt + nt) + "|" + s("%" + nt + nt)), ls = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", cs = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", us = a(cs, '[\\"\\\\]'), ds = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", hs = new RegExp(dn, "g"), Mt = new RegExp(is, "g"), ps = new RegExp(a("[^]", ls, "[\\.]", '[\\"]', us), "g"), hn = new RegExp(a("[^]", dn, ds), "g"), fs = hn; - function ta(p) { - var E = te(p); - return E.match(hs) ? E : p; - } - var pn = { - scheme: "mailto", - parse: function(p, E) { - var S = p, M = S.to = S.path ? S.path.split(",") : []; - if (S.path = void 0, S.query) { - for (var D = !1, Q = {}, Y = S.query.split("&"), ue = 0, ke = Y.length; ue < ke; ++ue) { - var pe = Y[ue].split("="); - switch (pe[0]) { - case "to": - for (var le = pe[1].split(","), ye = 0, we = le.length; ye < we; ++ye) - M.push(le[ye]); - break; - case "subject": - S.subject = Ve(pe[1], E); - break; - case "body": - S.body = Ve(pe[1], E); - break; - default: - D = !0, Q[Ve(pe[0], E)] = Ve(pe[1], E); - break; - } - } - D && (S.headers = Q); - } - S.query = void 0; - for (var ee = 0, Ee = M.length; ee < Ee; ++ee) { - var fe = M[ee].split("@"); - if (fe[0] = Ve(fe[0]), E.unicodeSupport) - fe[1] = Ve(fe[1], E).toLowerCase(); - else - try { - fe[1] = I.toASCII(Ve(fe[1], E).toLowerCase()); - } catch (Fe) { - S.error = S.error || "Email address's domain name can not be converted to ASCII via punycode: " + Fe; - } - M[ee] = fe.join("@"); - } - return S; - }, - serialize: function(p, E) { - var S = p, M = b(p.to); - if (M) { - for (var D = 0, Q = M.length; D < Q; ++D) { - var Y = String(M[D]), ue = Y.lastIndexOf("@"), ke = Y.slice(0, ue).replace(Mt, ta).replace(Mt, d).replace(ps, K), pe = Y.slice(ue + 1); - try { - pe = E.iri ? I.toUnicode(pe) : I.toASCII(Ve(pe, E).toLowerCase()); - } catch (ee) { - S.error = S.error || "Email address's domain name can not be converted to " + (E.iri ? "Unicode" : "ASCII") + " via punycode: " + ee; - } - M[D] = ke + "@" + pe; - } - S.path = M.join(","); - } - var le = p.headers = p.headers || {}; - p.subject && (le.subject = p.subject), p.body && (le.body = p.body); - var ye = []; - for (var we in le) - le[we] !== ss[we] && ye.push(we.replace(Mt, ta).replace(Mt, d).replace(hn, K) + "=" + le[we].replace(Mt, ta).replace(Mt, d).replace(fs, K)); - return ye.length && (S.query = ye.join("&")), S; - } - }, ms = /^([^\:]+)\:(.*)/, fn = { - scheme: "urn", - parse: function(p, E) { - var S = p.path && p.path.match(ms), M = p; - if (S) { - var D = E.scheme || M.scheme || "urn", Q = S[1].toLowerCase(), Y = S[2], ue = D + ":" + (E.nid || Q), ke = H[ue]; - M.nid = Q, M.nss = Y, M.path = void 0, ke && (M = ke.parse(M, E)); - } else - M.error = M.error || "URN can not be parsed."; - return M; - }, - serialize: function(p, E) { - var S = E.scheme || p.scheme || "urn", M = p.nid, D = S + ":" + (E.nid || M), Q = H[D]; - Q && (p = Q.serialize(p, E)); - var Y = p, ue = p.nss; - return Y.path = (M || E.nid) + ":" + ue, Y; - } - }, gs = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, mn = { - scheme: "urn:uuid", - parse: function(p, E) { - var S = p; - return S.uuid = S.nss, S.nss = void 0, !E.tolerant && (!S.uuid || !S.uuid.match(gs)) && (S.error = S.error || "UUID is not valid."), S; - }, - serialize: function(p, E) { - var S = p; - return S.nss = (p.uuid || "").toLowerCase(), S; - } - }; - H[vt.scheme] = vt, H[ln.scheme] = ln, H[rr.scheme] = rr, H[un.scheme] = un, H[pn.scheme] = pn, H[fn.scheme] = fn, H[mn.scheme] = mn, r.SCHEMES = H, r.pctEncChar = K, r.pctDecChars = te, r.parse = ze, r.removeDotSegments = at, r.serialize = Re, r.resolveComponents = It, r.resolve = er, r.normalize = wt, r.equal = tr, r.escapeComponent = kr, r.unescapeComponent = Ve, Object.defineProperty(r, "__esModule", { value: !0 }); - }); -})(da, da.exports); -var nl = da.exports; -Object.defineProperty(Ea, "__esModule", { value: !0 }); -const jo = nl; -jo.code = 'require("ajv/dist/runtime/uri").default'; -Ea.default = jo; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0; - var t = rt; - Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() { - return t.KeywordCxt; - } }); - var r = ie; - Object.defineProperty(e, "_", { enumerable: !0, get: function() { - return r._; - } }), Object.defineProperty(e, "str", { enumerable: !0, get: function() { - return r.str; - } }), Object.defineProperty(e, "stringify", { enumerable: !0, get: function() { - return r.stringify; - } }), Object.defineProperty(e, "nil", { enumerable: !0, get: function() { - return r.nil; - } }), Object.defineProperty(e, "Name", { enumerable: !0, get: function() { - return r.Name; - } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() { - return r.CodeGen; - } }); - const a = _r, s = wr, l = Nt, d = Be, b = ie, _ = xe, y = yr, m = ce, k = al, N = Ea, A = (V, P) => new RegExp(V, P); - A.code = "new RegExp"; - const j = ["removeAdditional", "useDefaults", "coerceTypes"], C = /* @__PURE__ */ new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error" - ]), x = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", - ajvErrors: "It is default now." - }, v = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.' - }, T = 200; - function R(V) { - var P, F, L, h, $, I, H, K, te, ne, be, Ae, ut, Zt, Yt, ze, Qt, Lt, At, Rt, Xt, at, Re, It, er; - const wt = V.strict, tr = (P = V.code) === null || P === void 0 ? void 0 : P.optimize, kr = tr === !0 || tr === void 0 ? 1 : tr || 0, Ve = (L = (F = V.code) === null || F === void 0 ? void 0 : F.regExp) !== null && L !== void 0 ? L : A, vt = (h = V.uriResolver) !== null && h !== void 0 ? h : N.default; - return { - strictSchema: (I = ($ = V.strictSchema) !== null && $ !== void 0 ? $ : wt) !== null && I !== void 0 ? I : !0, - strictNumbers: (K = (H = V.strictNumbers) !== null && H !== void 0 ? H : wt) !== null && K !== void 0 ? K : !0, - strictTypes: (ne = (te = V.strictTypes) !== null && te !== void 0 ? te : wt) !== null && ne !== void 0 ? ne : "log", - strictTuples: (Ae = (be = V.strictTuples) !== null && be !== void 0 ? be : wt) !== null && Ae !== void 0 ? Ae : "log", - strictRequired: (Zt = (ut = V.strictRequired) !== null && ut !== void 0 ? ut : wt) !== null && Zt !== void 0 ? Zt : !1, - code: V.code ? { ...V.code, optimize: kr, regExp: Ve } : { optimize: kr, regExp: Ve }, - loopRequired: (Yt = V.loopRequired) !== null && Yt !== void 0 ? Yt : T, - loopEnum: (ze = V.loopEnum) !== null && ze !== void 0 ? ze : T, - meta: (Qt = V.meta) !== null && Qt !== void 0 ? Qt : !0, - messages: (Lt = V.messages) !== null && Lt !== void 0 ? Lt : !0, - inlineRefs: (At = V.inlineRefs) !== null && At !== void 0 ? At : !0, - schemaId: (Rt = V.schemaId) !== null && Rt !== void 0 ? Rt : "$id", - addUsedSchema: (Xt = V.addUsedSchema) !== null && Xt !== void 0 ? Xt : !0, - validateSchema: (at = V.validateSchema) !== null && at !== void 0 ? at : !0, - validateFormats: (Re = V.validateFormats) !== null && Re !== void 0 ? Re : !0, - unicodeRegExp: (It = V.unicodeRegExp) !== null && It !== void 0 ? It : !0, - int32range: (er = V.int32range) !== null && er !== void 0 ? er : !0, - uriResolver: vt - }; - } - class n { - constructor(P = {}) { - this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), P = this.opts = { ...P, ...R(P) }; - const { es5: F, lines: L } = this.opts.code; - this.scope = new b.ValueScope({ scope: {}, prefixes: C, es5: F, lines: L }), this.logger = z(P.logger); - const h = P.validateFormats; - P.validateFormats = !1, this.RULES = (0, l.getRules)(), i.call(this, x, P, "NOT SUPPORTED"), i.call(this, v, P, "DEPRECATED", "warn"), this._metaOpts = g.call(this), P.formats && u.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), P.keywords && f.call(this, P.keywords), typeof P.meta == "object" && this.addMetaSchema(P.meta), c.call(this), P.validateFormats = h; - } - _addVocabularies() { - this.addKeyword("$async"); - } - _addDefaultMetaSchema() { - const { $data: P, meta: F, schemaId: L } = this.opts; - let h = k; - L === "id" && (h = { ...k }, h.id = h.$id, delete h.$id), F && P && this.addMetaSchema(h, h[L], !1); - } - defaultMeta() { - const { meta: P, schemaId: F } = this.opts; - return this.opts.defaultMeta = typeof P == "object" ? P[F] || P : void 0; - } - validate(P, F) { - let L; - if (typeof P == "string") { - if (L = this.getSchema(P), !L) - throw new Error(`no schema with key or ref "${P}"`); - } else - L = this.compile(P); - const h = L(F); - return "$async" in L || (this.errors = L.errors), h; - } - compile(P, F) { - const L = this._addSchema(P, F); - return L.validate || this._compileSchemaEnv(L); - } - compileAsync(P, F) { - if (typeof this.opts.loadSchema != "function") - throw new Error("options.loadSchema should be a function"); - const { loadSchema: L } = this.opts; - return h.call(this, P, F); - async function h(ne, be) { - await $.call(this, ne.$schema); - const Ae = this._addSchema(ne, be); - return Ae.validate || I.call(this, Ae); - } - async function $(ne) { - ne && !this.getSchema(ne) && await h.call(this, { $ref: ne }, !0); - } - async function I(ne) { - try { - return this._compileSchemaEnv(ne); - } catch (be) { - if (!(be instanceof s.default)) - throw be; - return H.call(this, be), await K.call(this, be.missingSchema), I.call(this, ne); - } - } - function H({ missingSchema: ne, missingRef: be }) { - if (this.refs[ne]) - throw new Error(`AnySchema ${ne} is loaded but ${be} cannot be resolved`); - } - async function K(ne) { - const be = await te.call(this, ne); - this.refs[ne] || await $.call(this, be.$schema), this.refs[ne] || this.addSchema(be, ne, F); - } - async function te(ne) { - const be = this._loading[ne]; - if (be) - return be; - try { - return await (this._loading[ne] = L(ne)); - } finally { - delete this._loading[ne]; - } - } - } - // Adds schema to the instance - addSchema(P, F, L, h = this.opts.validateSchema) { - if (Array.isArray(P)) { - for (const I of P) - this.addSchema(I, void 0, L, h); - return this; - } - let $; - if (typeof P == "object") { - const { schemaId: I } = this.opts; - if ($ = P[I], $ !== void 0 && typeof $ != "string") - throw new Error(`schema ${I} must be string`); - } - return F = (0, _.normalizeId)(F || $), this._checkUnique(F), this.schemas[F] = this._addSchema(P, L, F, h, !0), this; - } - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema(P, F, L = this.opts.validateSchema) { - return this.addSchema(P, F, !0, L), this; - } - // Validate schema against its meta-schema - validateSchema(P, F) { - if (typeof P == "boolean") - return !0; - let L; - if (L = P.$schema, L !== void 0 && typeof L != "string") - throw new Error("$schema must be a string"); - if (L = L || this.opts.defaultMeta || this.defaultMeta(), !L) - return this.logger.warn("meta-schema not available"), this.errors = null, !0; - const h = this.validate(L, P); - if (!h && F) { - const $ = "schema is invalid: " + this.errorsText(); - if (this.opts.validateSchema === "log") - this.logger.error($); - else - throw new Error($); - } - return h; - } - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(P) { - let F; - for (; typeof (F = o.call(this, P)) == "string"; ) - P = F; - if (F === void 0) { - const { schemaId: L } = this.opts, h = new d.SchemaEnv({ schema: {}, schemaId: L }); - if (F = d.resolveSchema.call(this, h, P), !F) - return; - this.refs[P] = F; - } - return F.validate || this._compileSchemaEnv(F); - } - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(P) { - if (P instanceof RegExp) - return this._removeAllSchemas(this.schemas, P), this._removeAllSchemas(this.refs, P), this; - switch (typeof P) { - case "undefined": - return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this; - case "string": { - const F = o.call(this, P); - return typeof F == "object" && this._cache.delete(F.schema), delete this.schemas[P], delete this.refs[P], this; - } - case "object": { - const F = P; - this._cache.delete(F); - let L = P[this.opts.schemaId]; - return L && (L = (0, _.normalizeId)(L), delete this.schemas[L], delete this.refs[L]), this; - } - default: - throw new Error("ajv.removeSchema: invalid parameter"); - } - } - // add "vocabulary" - a collection of keywords - addVocabulary(P) { - for (const F of P) - this.addKeyword(F); - return this; - } - addKeyword(P, F) { - let L; - if (typeof P == "string") - L = P, typeof F == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), F.keyword = L); - else if (typeof P == "object" && F === void 0) { - if (F = P, L = F.keyword, Array.isArray(L) && !L.length) - throw new Error("addKeywords: keyword must be string or non-empty array"); - } else - throw new Error("invalid addKeywords parameters"); - if (B.call(this, L, F), !F) - return (0, m.eachItem)(L, ($) => G.call(this, $)), this; - U.call(this, F); - const h = { - ...F, - type: (0, y.getJSONTypes)(F.type), - schemaType: (0, y.getJSONTypes)(F.schemaType) - }; - return (0, m.eachItem)(L, h.type.length === 0 ? ($) => G.call(this, $, h) : ($) => h.type.forEach((I) => G.call(this, $, h, I))), this; - } - getKeyword(P) { - const F = this.RULES.all[P]; - return typeof F == "object" ? F.definition : !!F; - } - // Remove keyword - removeKeyword(P) { - const { RULES: F } = this; - delete F.keywords[P], delete F.all[P]; - for (const L of F.rules) { - const h = L.rules.findIndex(($) => $.keyword === P); - h >= 0 && L.rules.splice(h, 1); - } - return this; - } - // Add format - addFormat(P, F) { - return typeof F == "string" && (F = new RegExp(F)), this.formats[P] = F, this; - } - errorsText(P = this.errors, { separator: F = ", ", dataVar: L = "data" } = {}) { - return !P || P.length === 0 ? "No errors" : P.map((h) => `${L}${h.instancePath} ${h.message}`).reduce((h, $) => h + F + $); - } - $dataMetaSchema(P, F) { - const L = this.RULES.all; - P = JSON.parse(JSON.stringify(P)); - for (const h of F) { - const $ = h.split("/").slice(1); - let I = P; - for (const H of $) - I = I[H]; - for (const H in L) { - const K = L[H]; - if (typeof K != "object") - continue; - const { $data: te } = K.definition, ne = I[H]; - te && ne && (I[H] = J(ne)); - } - } - return P; - } - _removeAllSchemas(P, F) { - for (const L in P) { - const h = P[L]; - (!F || F.test(L)) && (typeof h == "string" ? delete P[L] : h && !h.meta && (this._cache.delete(h.schema), delete P[L])); - } - } - _addSchema(P, F, L, h = this.opts.validateSchema, $ = this.opts.addUsedSchema) { - let I; - const { schemaId: H } = this.opts; - if (typeof P == "object") - I = P[H]; - else { - if (this.opts.jtd) - throw new Error("schema must be object"); - if (typeof P != "boolean") - throw new Error("schema must be object or boolean"); - } - let K = this._cache.get(P); - if (K !== void 0) - return K; - L = (0, _.normalizeId)(I || L); - const te = _.getSchemaRefs.call(this, P, L); - return K = new d.SchemaEnv({ schema: P, schemaId: H, meta: F, baseId: L, localRefs: te }), this._cache.set(K.schema, K), $ && !L.startsWith("#") && (L && this._checkUnique(L), this.refs[L] = K), h && this.validateSchema(P, !0), K; - } - _checkUnique(P) { - if (this.schemas[P] || this.refs[P]) - throw new Error(`schema with key or id "${P}" already exists`); - } - _compileSchemaEnv(P) { - if (P.meta ? this._compileMetaSchema(P) : d.compileSchema.call(this, P), !P.validate) - throw new Error("ajv implementation error"); - return P.validate; - } - _compileMetaSchema(P) { - const F = this.opts; - this.opts = this._metaOpts; - try { - d.compileSchema.call(this, P); - } finally { - this.opts = F; - } - } - } - e.default = n, n.ValidationError = a.default, n.MissingRefError = s.default; - function i(V, P, F, L = "error") { - for (const h in V) { - const $ = h; - $ in P && this.logger[L](`${F}: option ${h}. ${V[$]}`); - } - } - function o(V) { - return V = (0, _.normalizeId)(V), this.schemas[V] || this.refs[V]; - } - function c() { - const V = this.opts.schemas; - if (V) - if (Array.isArray(V)) - this.addSchema(V); - else - for (const P in V) - this.addSchema(V[P], P); - } - function u() { - for (const V in this.opts.formats) { - const P = this.opts.formats[V]; - P && this.addFormat(V, P); - } - } - function f(V) { - if (Array.isArray(V)) { - this.addVocabulary(V); - return; - } - this.logger.warn("keywords option as map is deprecated, pass array"); - for (const P in V) { - const F = V[P]; - F.keyword || (F.keyword = P), this.addKeyword(F); - } - } - function g() { - const V = { ...this.opts }; - for (const P of j) - delete V[P]; - return V; - } - const O = { log() { - }, warn() { - }, error() { - } }; - function z(V) { - if (V === !1) - return O; - if (V === void 0) - return console; - if (V.log && V.warn && V.error) - return V; - throw new Error("logger must implement log, warn and error methods"); - } - const q = /^[a-z_$][a-z0-9_$:-]*$/i; - function B(V, P) { - const { RULES: F } = this; - if ((0, m.eachItem)(V, (L) => { - if (F.keywords[L]) - throw new Error(`Keyword ${L} is already defined`); - if (!q.test(L)) - throw new Error(`Keyword ${L} has invalid name`); - }), !!P && P.$data && !("code" in P || "validate" in P)) - throw new Error('$data keyword must have "code" or "validate" function'); - } - function G(V, P, F) { - var L; - const h = P == null ? void 0 : P.post; - if (F && h) - throw new Error('keyword with "post" flag cannot have "type"'); - const { RULES: $ } = this; - let I = h ? $.post : $.rules.find(({ type: K }) => K === F); - if (I || (I = { type: F, rules: [] }, $.rules.push(I)), $.keywords[V] = !0, !P) - return; - const H = { - keyword: V, - definition: { - ...P, - type: (0, y.getJSONTypes)(P.type), - schemaType: (0, y.getJSONTypes)(P.schemaType) - } - }; - P.before ? w.call(this, I, H, P.before) : I.rules.push(H), $.all[V] = H, (L = P.implements) === null || L === void 0 || L.forEach((K) => this.addKeyword(K)); - } - function w(V, P, F) { - const L = V.rules.findIndex((h) => h.keyword === F); - L >= 0 ? V.rules.splice(L, 0, P) : (V.rules.push(P), this.logger.warn(`rule ${F} is not defined`)); - } - function U(V) { - let { metaSchema: P } = V; - P !== void 0 && (V.$data && this.opts.$data && (P = J(P)), V.validateSchema = this.compile(P, !0)); - } - const W = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" - }; - function J(V) { - return { anyOf: [V, W] }; - } -})(so); -var $a = {}, Pa = {}, Sa = {}; -Object.defineProperty(Sa, "__esModule", { value: !0 }); -const ol = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); - } -}; -Sa.default = ol; -var jt = {}; -Object.defineProperty(jt, "__esModule", { value: !0 }); -jt.callRef = jt.getValidate = void 0; -const sl = wr, Tn = se, De = ie, zt = ct, Cn = Be, Tr = ce, il = { - keyword: "$ref", - schemaType: "string", - code(e) { - const { gen: t, schema: r, it: a } = e, { baseId: s, schemaEnv: l, validateName: d, opts: b, self: _ } = a, { root: y } = l; - if ((r === "#" || r === "#/") && s === y.baseId) - return k(); - const m = Cn.resolveRef.call(_, y, s, r); - if (m === void 0) - throw new sl.default(a.opts.uriResolver, s, r); - if (m instanceof Cn.SchemaEnv) - return N(m); - return A(m); - function k() { - if (l === y) - return Rr(e, d, l, l.$async); - const j = t.scopeValue("root", { ref: y }); - return Rr(e, (0, De._)`${j}.validate`, y, y.$async); - } - function N(j) { - const C = Lo(e, j); - Rr(e, C, j, j.$async); - } - function A(j) { - const C = t.scopeValue("schema", b.code.source === !0 ? { ref: j, code: (0, De.stringify)(j) } : { ref: j }), x = t.name("valid"), v = e.subschema({ - schema: j, - dataTypes: [], - schemaPath: De.nil, - topSchemaRef: C, - errSchemaPath: r - }, x); - e.mergeEvaluated(v), e.ok(x); - } - } -}; -function Lo(e, t) { - const { gen: r } = e; - return t.validate ? r.scopeValue("validate", { ref: t.validate }) : (0, De._)`${r.scopeValue("wrapper", { ref: t })}.validate`; -} -jt.getValidate = Lo; -function Rr(e, t, r, a) { - const { gen: s, it: l } = e, { allErrors: d, schemaEnv: b, opts: _ } = l, y = _.passContext ? zt.default.this : De.nil; - a ? m() : k(); - function m() { - if (!b.$async) - throw new Error("async schema referenced by sync schema"); - const j = s.let("valid"); - s.try(() => { - s.code((0, De._)`await ${(0, Tn.callValidateCode)(e, t, y)}`), A(t), d || s.assign(j, !0); - }, (C) => { - s.if((0, De._)`!(${C} instanceof ${l.ValidationError})`, () => s.throw(C)), N(C), d || s.assign(j, !1); - }), e.ok(j); - } - function k() { - e.result((0, Tn.callValidateCode)(e, t, y), () => A(t), () => N(t)); - } - function N(j) { - const C = (0, De._)`${j}.errors`; - s.assign(zt.default.vErrors, (0, De._)`${zt.default.vErrors} === null ? ${C} : ${zt.default.vErrors}.concat(${C})`), s.assign(zt.default.errors, (0, De._)`${zt.default.vErrors}.length`); - } - function A(j) { - var C; - if (!l.opts.unevaluated) - return; - const x = (C = r == null ? void 0 : r.validate) === null || C === void 0 ? void 0 : C.evaluated; - if (l.props !== !0) - if (x && !x.dynamicProps) - x.props !== void 0 && (l.props = Tr.mergeEvaluated.props(s, x.props, l.props)); - else { - const v = s.var("props", (0, De._)`${j}.evaluated.props`); - l.props = Tr.mergeEvaluated.props(s, v, l.props, De.Name); - } - if (l.items !== !0) - if (x && !x.dynamicItems) - x.items !== void 0 && (l.items = Tr.mergeEvaluated.items(s, x.items, l.items)); - else { - const v = s.var("items", (0, De._)`${j}.evaluated.items`); - l.items = Tr.mergeEvaluated.items(s, v, l.items, De.Name); - } - } -} -jt.callRef = Rr; -jt.default = il; -Object.defineProperty(Pa, "__esModule", { value: !0 }); -const ll = Sa, cl = jt, ul = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - { keyword: "$comment" }, - "definitions", - ll.default, - cl.default -]; -Pa.default = ul; -var Ta = {}, Ca = {}; -Object.defineProperty(Ca, "__esModule", { value: !0 }); -const Vr = ie, gt = Vr.operators, Fr = { - maximum: { okStr: "<=", ok: gt.LTE, fail: gt.GT }, - minimum: { okStr: ">=", ok: gt.GTE, fail: gt.LT }, - exclusiveMaximum: { okStr: "<", ok: gt.LT, fail: gt.GTE }, - exclusiveMinimum: { okStr: ">", ok: gt.GT, fail: gt.LTE } -}, dl = { - message: ({ keyword: e, schemaCode: t }) => (0, Vr.str)`must be ${Fr[e].okStr} ${t}`, - params: ({ keyword: e, schemaCode: t }) => (0, Vr._)`{comparison: ${Fr[e].okStr}, limit: ${t}}` -}, hl = { - keyword: Object.keys(Fr), - type: "number", - schemaType: "number", - $data: !0, - error: dl, - code(e) { - const { keyword: t, data: r, schemaCode: a } = e; - e.fail$data((0, Vr._)`${r} ${Fr[t].fail} ${a} || isNaN(${r})`); - } -}; -Ca.default = hl; -var xa = {}; -Object.defineProperty(xa, "__esModule", { value: !0 }); -const ur = ie, pl = { - message: ({ schemaCode: e }) => (0, ur.str)`must be multiple of ${e}`, - params: ({ schemaCode: e }) => (0, ur._)`{multipleOf: ${e}}` -}, fl = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: !0, - error: pl, - code(e) { - const { gen: t, data: r, schemaCode: a, it: s } = e, l = s.opts.multipleOfPrecision, d = t.let("res"), b = l ? (0, ur._)`Math.abs(Math.round(${d}) - ${d}) > 1e-${l}` : (0, ur._)`${d} !== parseInt(${d})`; - e.fail$data((0, ur._)`(${a} === 0 || (${d} = ${r}/${a}, ${b}))`); - } -}; -xa.default = fl; -var Oa = {}, Na = {}; -Object.defineProperty(Na, "__esModule", { value: !0 }); -function Ao(e) { - const t = e.length; - let r = 0, a = 0, s; - for (; a < t; ) - r++, s = e.charCodeAt(a++), s >= 55296 && s <= 56319 && a < t && (s = e.charCodeAt(a), (s & 64512) === 56320 && a++); - return r; -} -Na.default = Ao; -Ao.code = 'require("ajv/dist/runtime/ucs2length").default'; -Object.defineProperty(Oa, "__esModule", { value: !0 }); -const xt = ie, ml = ce, gl = Na, bl = { - message({ keyword: e, schemaCode: t }) { - const r = e === "maxLength" ? "more" : "fewer"; - return (0, xt.str)`must NOT have ${r} than ${t} characters`; - }, - params: ({ schemaCode: e }) => (0, xt._)`{limit: ${e}}` -}, yl = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: !0, - error: bl, - code(e) { - const { keyword: t, data: r, schemaCode: a, it: s } = e, l = t === "maxLength" ? xt.operators.GT : xt.operators.LT, d = s.opts.unicode === !1 ? (0, xt._)`${r}.length` : (0, xt._)`${(0, ml.useFunc)(e.gen, gl.default)}(${r})`; - e.fail$data((0, xt._)`${d} ${l} ${a}`); - } -}; -Oa.default = yl; -var ja = {}; -Object.defineProperty(ja, "__esModule", { value: !0 }); -const _l = se, qr = ie, wl = { - message: ({ schemaCode: e }) => (0, qr.str)`must match pattern "${e}"`, - params: ({ schemaCode: e }) => (0, qr._)`{pattern: ${e}}` -}, vl = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: !0, - error: wl, - code(e) { - const { data: t, $data: r, schema: a, schemaCode: s, it: l } = e, d = l.opts.unicodeRegExp ? "u" : "", b = r ? (0, qr._)`(new RegExp(${s}, ${d}))` : (0, _l.usePattern)(e, a); - e.fail$data((0, qr._)`!${b}.test(${t})`); - } -}; -ja.default = vl; -var La = {}; -Object.defineProperty(La, "__esModule", { value: !0 }); -const dr = ie, kl = { - message({ keyword: e, schemaCode: t }) { - const r = e === "maxProperties" ? "more" : "fewer"; - return (0, dr.str)`must NOT have ${r} than ${t} properties`; - }, - params: ({ schemaCode: e }) => (0, dr._)`{limit: ${e}}` -}, El = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: !0, - error: kl, - code(e) { - const { keyword: t, data: r, schemaCode: a } = e, s = t === "maxProperties" ? dr.operators.GT : dr.operators.LT; - e.fail$data((0, dr._)`Object.keys(${r}).length ${s} ${a}`); - } -}; -La.default = El; -var Aa = {}; -Object.defineProperty(Aa, "__esModule", { value: !0 }); -const or = se, hr = ie, $l = ce, Pl = { - message: ({ params: { missingProperty: e } }) => (0, hr.str)`must have required property '${e}'`, - params: ({ params: { missingProperty: e } }) => (0, hr._)`{missingProperty: ${e}}` -}, Sl = { - keyword: "required", - type: "object", - schemaType: "array", - $data: !0, - error: Pl, - code(e) { - const { gen: t, schema: r, schemaCode: a, data: s, $data: l, it: d } = e, { opts: b } = d; - if (!l && r.length === 0) - return; - const _ = r.length >= b.loopRequired; - if (d.allErrors ? y() : m(), b.strictRequired) { - const A = e.parentSchema.properties, { definedProperties: j } = e.it; - for (const C of r) - if ((A == null ? void 0 : A[C]) === void 0 && !j.has(C)) { - const x = d.schemaEnv.baseId + d.errSchemaPath, v = `required property "${C}" is not defined at "${x}" (strictRequired)`; - (0, $l.checkStrictMode)(d, v, d.opts.strictRequired); - } - } - function y() { - if (_ || l) - e.block$data(hr.nil, k); - else - for (const A of r) - (0, or.checkReportMissingProp)(e, A); - } - function m() { - const A = t.let("missing"); - if (_ || l) { - const j = t.let("valid", !0); - e.block$data(j, () => N(A, j)), e.ok(j); - } else - t.if((0, or.checkMissingProp)(e, r, A)), (0, or.reportMissingProp)(e, A), t.else(); - } - function k() { - t.forOf("prop", a, (A) => { - e.setParams({ missingProperty: A }), t.if((0, or.noPropertyInData)(t, s, A, b.ownProperties), () => e.error()); - }); - } - function N(A, j) { - e.setParams({ missingProperty: A }), t.forOf(A, a, () => { - t.assign(j, (0, or.propertyInData)(t, s, A, b.ownProperties)), t.if((0, hr.not)(j), () => { - e.error(), t.break(); - }); - }, hr.nil); - } - } -}; -Aa.default = Sl; -var Ra = {}; -Object.defineProperty(Ra, "__esModule", { value: !0 }); -const pr = ie, Tl = { - message({ keyword: e, schemaCode: t }) { - const r = e === "maxItems" ? "more" : "fewer"; - return (0, pr.str)`must NOT have ${r} than ${t} items`; - }, - params: ({ schemaCode: e }) => (0, pr._)`{limit: ${e}}` -}, Cl = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: !0, - error: Tl, - code(e) { - const { keyword: t, data: r, schemaCode: a } = e, s = t === "maxItems" ? pr.operators.GT : pr.operators.LT; - e.fail$data((0, pr._)`${r}.length ${s} ${a}`); - } -}; -Ra.default = Cl; -var Ia = {}, vr = {}; -Object.defineProperty(vr, "__esModule", { value: !0 }); -const Ro = mo; -Ro.code = 'require("ajv/dist/runtime/equal").default'; -vr.default = Ro; -Object.defineProperty(Ia, "__esModule", { value: !0 }); -const oa = yr, Ce = ie, xl = ce, Ol = vr, Nl = { - message: ({ params: { i: e, j: t } }) => (0, Ce.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`, - params: ({ params: { i: e, j: t } }) => (0, Ce._)`{i: ${e}, j: ${t}}` -}, jl = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: !0, - error: Nl, - code(e) { - const { gen: t, data: r, $data: a, schema: s, parentSchema: l, schemaCode: d, it: b } = e; - if (!a && !s) - return; - const _ = t.let("valid"), y = l.items ? (0, oa.getSchemaTypes)(l.items) : []; - e.block$data(_, m, (0, Ce._)`${d} === false`), e.ok(_); - function m() { - const j = t.let("i", (0, Ce._)`${r}.length`), C = t.let("j"); - e.setParams({ i: j, j: C }), t.assign(_, !0), t.if((0, Ce._)`${j} > 1`, () => (k() ? N : A)(j, C)); - } - function k() { - return y.length > 0 && !y.some((j) => j === "object" || j === "array"); - } - function N(j, C) { - const x = t.name("item"), v = (0, oa.checkDataTypes)(y, x, b.opts.strictNumbers, oa.DataType.Wrong), T = t.const("indices", (0, Ce._)`{}`); - t.for((0, Ce._)`;${j}--;`, () => { - t.let(x, (0, Ce._)`${r}[${j}]`), t.if(v, (0, Ce._)`continue`), y.length > 1 && t.if((0, Ce._)`typeof ${x} == "string"`, (0, Ce._)`${x} += "_"`), t.if((0, Ce._)`typeof ${T}[${x}] == "number"`, () => { - t.assign(C, (0, Ce._)`${T}[${x}]`), e.error(), t.assign(_, !1).break(); - }).code((0, Ce._)`${T}[${x}] = ${j}`); - }); - } - function A(j, C) { - const x = (0, xl.useFunc)(t, Ol.default), v = t.name("outer"); - t.label(v).for((0, Ce._)`;${j}--;`, () => t.for((0, Ce._)`${C} = ${j}; ${C}--;`, () => t.if((0, Ce._)`${x}(${r}[${j}], ${r}[${C}])`, () => { - e.error(), t.assign(_, !1).break(v); - }))); - } - } -}; -Ia.default = jl; -var Ma = {}; -Object.defineProperty(Ma, "__esModule", { value: !0 }); -const ha = ie, Ll = ce, Al = vr, Rl = { - message: "must be equal to constant", - params: ({ schemaCode: e }) => (0, ha._)`{allowedValue: ${e}}` -}, Il = { - keyword: "const", - $data: !0, - error: Rl, - code(e) { - const { gen: t, data: r, $data: a, schemaCode: s, schema: l } = e; - a || l && typeof l == "object" ? e.fail$data((0, ha._)`!${(0, Ll.useFunc)(t, Al.default)}(${r}, ${s})`) : e.fail((0, ha._)`${l} !== ${r}`); - } -}; -Ma.default = Il; -var Da = {}; -Object.defineProperty(Da, "__esModule", { value: !0 }); -const lr = ie, Ml = ce, Dl = vr, Bl = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode: e }) => (0, lr._)`{allowedValues: ${e}}` -}, zl = { - keyword: "enum", - schemaType: "array", - $data: !0, - error: Bl, - code(e) { - const { gen: t, data: r, $data: a, schema: s, schemaCode: l, it: d } = e; - if (!a && s.length === 0) - throw new Error("enum must have non-empty array"); - const b = s.length >= d.opts.loopEnum; - let _; - const y = () => _ ?? (_ = (0, Ml.useFunc)(t, Dl.default)); - let m; - if (b || a) - m = t.let("valid"), e.block$data(m, k); - else { - if (!Array.isArray(s)) - throw new Error("ajv implementation error"); - const A = t.const("vSchema", l); - m = (0, lr.or)(...s.map((j, C) => N(A, C))); - } - e.pass(m); - function k() { - t.assign(m, !1), t.forOf("v", l, (A) => t.if((0, lr._)`${y()}(${r}, ${A})`, () => t.assign(m, !0).break())); - } - function N(A, j) { - const C = s[j]; - return typeof C == "object" && C !== null ? (0, lr._)`${y()}(${r}, ${A}[${j}])` : (0, lr._)`${r} === ${C}`; - } - } -}; -Da.default = zl; -Object.defineProperty(Ta, "__esModule", { value: !0 }); -const Vl = Ca, Fl = xa, ql = Oa, Ul = ja, Gl = La, Hl = Aa, Kl = Ra, Wl = Ia, Jl = Ma, Zl = Da, Yl = [ - // number - Vl.default, - Fl.default, - // string - ql.default, - Ul.default, - // object - Gl.default, - Hl.default, - // array - Kl.default, - Wl.default, - // any - { keyword: "type", schemaType: ["string", "array"] }, - { keyword: "nullable", schemaType: "boolean" }, - Jl.default, - Zl.default -]; -Ta.default = Yl; -var Ba = {}, Wt = {}; -Object.defineProperty(Wt, "__esModule", { value: !0 }); -Wt.validateAdditionalItems = void 0; -const Ot = ie, pa = ce, Ql = { - message: ({ params: { len: e } }) => (0, Ot.str)`must NOT have more than ${e} items`, - params: ({ params: { len: e } }) => (0, Ot._)`{limit: ${e}}` -}, Xl = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error: Ql, - code(e) { - const { parentSchema: t, it: r } = e, { items: a } = t; - if (!Array.isArray(a)) { - (0, pa.checkStrictMode)(r, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - Io(e, a); - } -}; -function Io(e, t) { - const { gen: r, schema: a, data: s, keyword: l, it: d } = e; - d.items = !0; - const b = r.const("len", (0, Ot._)`${s}.length`); - if (a === !1) - e.setParams({ len: t.length }), e.pass((0, Ot._)`${b} <= ${t.length}`); - else if (typeof a == "object" && !(0, pa.alwaysValidSchema)(d, a)) { - const y = r.var("valid", (0, Ot._)`${b} <= ${t.length}`); - r.if((0, Ot.not)(y), () => _(y)), e.ok(y); - } - function _(y) { - r.forRange("i", t.length, b, (m) => { - e.subschema({ keyword: l, dataProp: m, dataPropType: pa.Type.Num }, y), d.allErrors || r.if((0, Ot.not)(y), () => r.break()); - }); - } -} -Wt.validateAdditionalItems = Io; -Wt.default = Xl; -var za = {}, Jt = {}; -Object.defineProperty(Jt, "__esModule", { value: !0 }); -Jt.validateTuple = void 0; -const xn = ie, Ir = ce, ec = se, tc = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(e) { - const { schema: t, it: r } = e; - if (Array.isArray(t)) - return Mo(e, "additionalItems", t); - r.items = !0, !(0, Ir.alwaysValidSchema)(r, t) && e.ok((0, ec.validateArray)(e)); - } -}; -function Mo(e, t, r = e.schema) { - const { gen: a, parentSchema: s, data: l, keyword: d, it: b } = e; - m(s), b.opts.unevaluated && r.length && b.items !== !0 && (b.items = Ir.mergeEvaluated.items(a, r.length, b.items)); - const _ = a.name("valid"), y = a.const("len", (0, xn._)`${l}.length`); - r.forEach((k, N) => { - (0, Ir.alwaysValidSchema)(b, k) || (a.if((0, xn._)`${y} > ${N}`, () => e.subschema({ - keyword: d, - schemaProp: N, - dataProp: N - }, _)), e.ok(_)); - }); - function m(k) { - const { opts: N, errSchemaPath: A } = b, j = r.length, C = j === k.minItems && (j === k.maxItems || k[t] === !1); - if (N.strictTuples && !C) { - const x = `"${d}" is ${j}-tuple, but minItems or maxItems/${t} are not specified or different at path "${A}"`; - (0, Ir.checkStrictMode)(b, x, N.strictTuples); - } - } -} -Jt.validateTuple = Mo; -Jt.default = tc; -Object.defineProperty(za, "__esModule", { value: !0 }); -const rc = Jt, ac = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (e) => (0, rc.validateTuple)(e, "items") -}; -za.default = ac; -var Va = {}; -Object.defineProperty(Va, "__esModule", { value: !0 }); -const On = ie, nc = ce, oc = se, sc = Wt, ic = { - message: ({ params: { len: e } }) => (0, On.str)`must NOT have more than ${e} items`, - params: ({ params: { len: e } }) => (0, On._)`{limit: ${e}}` -}, lc = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error: ic, - code(e) { - const { schema: t, parentSchema: r, it: a } = e, { prefixItems: s } = r; - a.items = !0, !(0, nc.alwaysValidSchema)(a, t) && (s ? (0, sc.validateAdditionalItems)(e, s) : e.ok((0, oc.validateArray)(e))); - } -}; -Va.default = lc; -var Fa = {}; -Object.defineProperty(Fa, "__esModule", { value: !0 }); -const We = ie, Cr = ce, cc = { - message: ({ params: { min: e, max: t } }) => t === void 0 ? (0, We.str)`must contain at least ${e} valid item(s)` : (0, We.str)`must contain at least ${e} and no more than ${t} valid item(s)`, - params: ({ params: { min: e, max: t } }) => t === void 0 ? (0, We._)`{minContains: ${e}}` : (0, We._)`{minContains: ${e}, maxContains: ${t}}` -}, uc = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: !0, - error: cc, - code(e) { - const { gen: t, schema: r, parentSchema: a, data: s, it: l } = e; - let d, b; - const { minContains: _, maxContains: y } = a; - l.opts.next ? (d = _ === void 0 ? 1 : _, b = y) : d = 1; - const m = t.const("len", (0, We._)`${s}.length`); - if (e.setParams({ min: d, max: b }), b === void 0 && d === 0) { - (0, Cr.checkStrictMode)(l, '"minContains" == 0 without "maxContains": "contains" keyword ignored'); - return; - } - if (b !== void 0 && d > b) { - (0, Cr.checkStrictMode)(l, '"minContains" > "maxContains" is always invalid'), e.fail(); - return; - } - if ((0, Cr.alwaysValidSchema)(l, r)) { - let C = (0, We._)`${m} >= ${d}`; - b !== void 0 && (C = (0, We._)`${C} && ${m} <= ${b}`), e.pass(C); - return; - } - l.items = !0; - const k = t.name("valid"); - b === void 0 && d === 1 ? A(k, () => t.if(k, () => t.break())) : d === 0 ? (t.let(k, !0), b !== void 0 && t.if((0, We._)`${s}.length > 0`, N)) : (t.let(k, !1), N()), e.result(k, () => e.reset()); - function N() { - const C = t.name("_valid"), x = t.let("count", 0); - A(C, () => t.if(C, () => j(x))); - } - function A(C, x) { - t.forRange("i", 0, m, (v) => { - e.subschema({ - keyword: "contains", - dataProp: v, - dataPropType: Cr.Type.Num, - compositeRule: !0 - }, C), x(); - }); - } - function j(C) { - t.code((0, We._)`${C}++`), b === void 0 ? t.if((0, We._)`${C} >= ${d}`, () => t.assign(k, !0).break()) : (t.if((0, We._)`${C} > ${b}`, () => t.assign(k, !1).break()), d === 1 ? t.assign(k, !0) : t.if((0, We._)`${C} >= ${d}`, () => t.assign(k, !0))); - } - } -}; -Fa.default = uc; -var Do = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0; - const t = ie, r = ce, a = se; - e.error = { - message: ({ params: { property: _, depsCount: y, deps: m } }) => { - const k = y === 1 ? "property" : "properties"; - return (0, t.str)`must have ${k} ${m} when property ${_} is present`; - }, - params: ({ params: { property: _, depsCount: y, deps: m, missingProperty: k } }) => (0, t._)`{property: ${_}, - missingProperty: ${k}, - depsCount: ${y}, - deps: ${m}}` - // TODO change to reference - }; - const s = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error: e.error, - code(_) { - const [y, m] = l(_); - d(_, y), b(_, m); - } - }; - function l({ schema: _ }) { - const y = {}, m = {}; - for (const k in _) { - if (k === "__proto__") - continue; - const N = Array.isArray(_[k]) ? y : m; - N[k] = _[k]; - } - return [y, m]; - } - function d(_, y = _.schema) { - const { gen: m, data: k, it: N } = _; - if (Object.keys(y).length === 0) - return; - const A = m.let("missing"); - for (const j in y) { - const C = y[j]; - if (C.length === 0) - continue; - const x = (0, a.propertyInData)(m, k, j, N.opts.ownProperties); - _.setParams({ - property: j, - depsCount: C.length, - deps: C.join(", ") - }), N.allErrors ? m.if(x, () => { - for (const v of C) - (0, a.checkReportMissingProp)(_, v); - }) : (m.if((0, t._)`${x} && (${(0, a.checkMissingProp)(_, C, A)})`), (0, a.reportMissingProp)(_, A), m.else()); - } - } - e.validatePropertyDeps = d; - function b(_, y = _.schema) { - const { gen: m, data: k, keyword: N, it: A } = _, j = m.name("valid"); - for (const C in y) - (0, r.alwaysValidSchema)(A, y[C]) || (m.if( - (0, a.propertyInData)(m, k, C, A.opts.ownProperties), - () => { - const x = _.subschema({ keyword: N, schemaProp: C }, j); - _.mergeValidEvaluated(x, j); - }, - () => m.var(j, !0) - // TODO var - ), _.ok(j)); - } - e.validateSchemaDeps = b, e.default = s; -})(Do); -var qa = {}; -Object.defineProperty(qa, "__esModule", { value: !0 }); -const Bo = ie, dc = ce, hc = { - message: "property name must be valid", - params: ({ params: e }) => (0, Bo._)`{propertyName: ${e.propertyName}}` -}, pc = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error: hc, - code(e) { - const { gen: t, schema: r, data: a, it: s } = e; - if ((0, dc.alwaysValidSchema)(s, r)) - return; - const l = t.name("valid"); - t.forIn("key", a, (d) => { - e.setParams({ propertyName: d }), e.subschema({ - keyword: "propertyNames", - data: d, - dataTypes: ["string"], - propertyName: d, - compositeRule: !0 - }, l), t.if((0, Bo.not)(l), () => { - e.error(!0), s.allErrors || t.break(); - }); - }), e.ok(l); - } -}; -qa.default = pc; -var Xr = {}; -Object.defineProperty(Xr, "__esModule", { value: !0 }); -const xr = se, Ye = ie, fc = ct, Or = ce, mc = { - message: "must NOT have additional properties", - params: ({ params: e }) => (0, Ye._)`{additionalProperty: ${e.additionalProperty}}` -}, gc = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: !0, - trackErrors: !0, - error: mc, - code(e) { - const { gen: t, schema: r, parentSchema: a, data: s, errsCount: l, it: d } = e; - if (!l) - throw new Error("ajv implementation error"); - const { allErrors: b, opts: _ } = d; - if (d.props = !0, _.removeAdditional !== "all" && (0, Or.alwaysValidSchema)(d, r)) - return; - const y = (0, xr.allSchemaProperties)(a.properties), m = (0, xr.allSchemaProperties)(a.patternProperties); - k(), e.ok((0, Ye._)`${l} === ${fc.default.errors}`); - function k() { - t.forIn("key", s, (x) => { - !y.length && !m.length ? j(x) : t.if(N(x), () => j(x)); - }); - } - function N(x) { - let v; - if (y.length > 8) { - const T = (0, Or.schemaRefOrVal)(d, a.properties, "properties"); - v = (0, xr.isOwnProperty)(t, T, x); - } else - y.length ? v = (0, Ye.or)(...y.map((T) => (0, Ye._)`${x} === ${T}`)) : v = Ye.nil; - return m.length && (v = (0, Ye.or)(v, ...m.map((T) => (0, Ye._)`${(0, xr.usePattern)(e, T)}.test(${x})`))), (0, Ye.not)(v); - } - function A(x) { - t.code((0, Ye._)`delete ${s}[${x}]`); - } - function j(x) { - if (_.removeAdditional === "all" || _.removeAdditional && r === !1) { - A(x); - return; - } - if (r === !1) { - e.setParams({ additionalProperty: x }), e.error(), b || t.break(); - return; - } - if (typeof r == "object" && !(0, Or.alwaysValidSchema)(d, r)) { - const v = t.name("valid"); - _.removeAdditional === "failing" ? (C(x, v, !1), t.if((0, Ye.not)(v), () => { - e.reset(), A(x); - })) : (C(x, v), b || t.if((0, Ye.not)(v), () => t.break())); - } - } - function C(x, v, T) { - const R = { - keyword: "additionalProperties", - dataProp: x, - dataPropType: Or.Type.Str - }; - T === !1 && Object.assign(R, { - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }), e.subschema(R, v); - } - } -}; -Xr.default = gc; -var Ua = {}; -Object.defineProperty(Ua, "__esModule", { value: !0 }); -const bc = rt, Nn = se, sa = ce, jn = Xr, yc = { - keyword: "properties", - type: "object", - schemaType: "object", - code(e) { - const { gen: t, schema: r, parentSchema: a, data: s, it: l } = e; - l.opts.removeAdditional === "all" && a.additionalProperties === void 0 && jn.default.code(new bc.KeywordCxt(l, jn.default, "additionalProperties")); - const d = (0, Nn.allSchemaProperties)(r); - for (const k of d) - l.definedProperties.add(k); - l.opts.unevaluated && d.length && l.props !== !0 && (l.props = sa.mergeEvaluated.props(t, (0, sa.toHash)(d), l.props)); - const b = d.filter((k) => !(0, sa.alwaysValidSchema)(l, r[k])); - if (b.length === 0) - return; - const _ = t.name("valid"); - for (const k of b) - y(k) ? m(k) : (t.if((0, Nn.propertyInData)(t, s, k, l.opts.ownProperties)), m(k), l.allErrors || t.else().var(_, !0), t.endIf()), e.it.definedProperties.add(k), e.ok(_); - function y(k) { - return l.opts.useDefaults && !l.compositeRule && r[k].default !== void 0; - } - function m(k) { - e.subschema({ - keyword: "properties", - schemaProp: k, - dataProp: k - }, _); - } - } -}; -Ua.default = yc; -var Ga = {}; -Object.defineProperty(Ga, "__esModule", { value: !0 }); -const Ln = se, Nr = ie, An = ce, Rn = ce, _c = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(e) { - const { gen: t, schema: r, data: a, parentSchema: s, it: l } = e, { opts: d } = l, b = (0, Ln.allSchemaProperties)(r), _ = b.filter((C) => (0, An.alwaysValidSchema)(l, r[C])); - if (b.length === 0 || _.length === b.length && (!l.opts.unevaluated || l.props === !0)) - return; - const y = d.strictSchema && !d.allowMatchingProperties && s.properties, m = t.name("valid"); - l.props !== !0 && !(l.props instanceof Nr.Name) && (l.props = (0, Rn.evaluatedPropsToName)(t, l.props)); - const { props: k } = l; - N(); - function N() { - for (const C of b) - y && A(C), l.allErrors ? j(C) : (t.var(m, !0), j(C), t.if(m)); - } - function A(C) { - for (const x in y) - new RegExp(C).test(x) && (0, An.checkStrictMode)(l, `property ${x} matches pattern ${C} (use allowMatchingProperties)`); - } - function j(C) { - t.forIn("key", a, (x) => { - t.if((0, Nr._)`${(0, Ln.usePattern)(e, C)}.test(${x})`, () => { - const v = _.includes(C); - v || e.subschema({ - keyword: "patternProperties", - schemaProp: C, - dataProp: x, - dataPropType: Rn.Type.Str - }, m), l.opts.unevaluated && k !== !0 ? t.assign((0, Nr._)`${k}[${x}]`, !0) : !v && !l.allErrors && t.if((0, Nr.not)(m), () => t.break()); - }); - }); - } - } -}; -Ga.default = _c; -var Ha = {}; -Object.defineProperty(Ha, "__esModule", { value: !0 }); -const wc = ce, vc = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: !0, - code(e) { - const { gen: t, schema: r, it: a } = e; - if ((0, wc.alwaysValidSchema)(a, r)) { - e.fail(); - return; - } - const s = t.name("valid"); - e.subschema({ - keyword: "not", - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }, s), e.failResult(s, () => e.reset(), () => e.error()); - }, - error: { message: "must NOT be valid" } -}; -Ha.default = vc; -var Ka = {}; -Object.defineProperty(Ka, "__esModule", { value: !0 }); -const kc = se, Ec = { - keyword: "anyOf", - schemaType: "array", - trackErrors: !0, - code: kc.validateUnion, - error: { message: "must match a schema in anyOf" } -}; -Ka.default = Ec; -var Wa = {}; -Object.defineProperty(Wa, "__esModule", { value: !0 }); -const Mr = ie, $c = ce, Pc = { - message: "must match exactly one schema in oneOf", - params: ({ params: e }) => (0, Mr._)`{passingSchemas: ${e.passing}}` -}, Sc = { - keyword: "oneOf", - schemaType: "array", - trackErrors: !0, - error: Pc, - code(e) { - const { gen: t, schema: r, parentSchema: a, it: s } = e; - if (!Array.isArray(r)) - throw new Error("ajv implementation error"); - if (s.opts.discriminator && a.discriminator) - return; - const l = r, d = t.let("valid", !1), b = t.let("passing", null), _ = t.name("_valid"); - e.setParams({ passing: b }), t.block(y), e.result(d, () => e.reset(), () => e.error(!0)); - function y() { - l.forEach((m, k) => { - let N; - (0, $c.alwaysValidSchema)(s, m) ? t.var(_, !0) : N = e.subschema({ - keyword: "oneOf", - schemaProp: k, - compositeRule: !0 - }, _), k > 0 && t.if((0, Mr._)`${_} && ${d}`).assign(d, !1).assign(b, (0, Mr._)`[${b}, ${k}]`).else(), t.if(_, () => { - t.assign(d, !0), t.assign(b, k), N && e.mergeEvaluated(N, Mr.Name); - }); - }); - } - } -}; -Wa.default = Sc; -var Ja = {}; -Object.defineProperty(Ja, "__esModule", { value: !0 }); -const Tc = ce, Cc = { - keyword: "allOf", - schemaType: "array", - code(e) { - const { gen: t, schema: r, it: a } = e; - if (!Array.isArray(r)) - throw new Error("ajv implementation error"); - const s = t.name("valid"); - r.forEach((l, d) => { - if ((0, Tc.alwaysValidSchema)(a, l)) - return; - const b = e.subschema({ keyword: "allOf", schemaProp: d }, s); - e.ok(s), e.mergeEvaluated(b); - }); - } -}; -Ja.default = Cc; -var Za = {}; -Object.defineProperty(Za, "__esModule", { value: !0 }); -const Ur = ie, zo = ce, xc = { - message: ({ params: e }) => (0, Ur.str)`must match "${e.ifClause}" schema`, - params: ({ params: e }) => (0, Ur._)`{failingKeyword: ${e.ifClause}}` -}, Oc = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: !0, - error: xc, - code(e) { - const { gen: t, parentSchema: r, it: a } = e; - r.then === void 0 && r.else === void 0 && (0, zo.checkStrictMode)(a, '"if" without "then" and "else" is ignored'); - const s = In(a, "then"), l = In(a, "else"); - if (!s && !l) - return; - const d = t.let("valid", !0), b = t.name("_valid"); - if (_(), e.reset(), s && l) { - const m = t.let("ifClause"); - e.setParams({ ifClause: m }), t.if(b, y("then", m), y("else", m)); - } else - s ? t.if(b, y("then")) : t.if((0, Ur.not)(b), y("else")); - e.pass(d, () => e.error(!0)); - function _() { - const m = e.subschema({ - keyword: "if", - compositeRule: !0, - createErrors: !1, - allErrors: !1 - }, b); - e.mergeEvaluated(m); - } - function y(m, k) { - return () => { - const N = e.subschema({ keyword: m }, b); - t.assign(d, b), e.mergeValidEvaluated(N, d), k ? t.assign(k, (0, Ur._)`${m}`) : e.setParams({ ifClause: m }); - }; - } - } -}; -function In(e, t) { - const r = e.schema[t]; - return r !== void 0 && !(0, zo.alwaysValidSchema)(e, r); -} -Za.default = Oc; -var Ya = {}; -Object.defineProperty(Ya, "__esModule", { value: !0 }); -const Nc = ce, jc = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword: e, parentSchema: t, it: r }) { - t.if === void 0 && (0, Nc.checkStrictMode)(r, `"${e}" without "if" is ignored`); - } -}; -Ya.default = jc; -Object.defineProperty(Ba, "__esModule", { value: !0 }); -const Lc = Wt, Ac = za, Rc = Jt, Ic = Va, Mc = Fa, Dc = Do, Bc = qa, zc = Xr, Vc = Ua, Fc = Ga, qc = Ha, Uc = Ka, Gc = Wa, Hc = Ja, Kc = Za, Wc = Ya; -function Jc(e = !1) { - const t = [ - // any - qc.default, - Uc.default, - Gc.default, - Hc.default, - Kc.default, - Wc.default, - // object - Bc.default, - zc.default, - Dc.default, - Vc.default, - Fc.default - ]; - return e ? t.push(Ac.default, Ic.default) : t.push(Lc.default, Rc.default), t.push(Mc.default), t; -} -Ba.default = Jc; -var Qa = {}, Xa = {}; -Object.defineProperty(Xa, "__esModule", { value: !0 }); -const ve = ie, Zc = { - message: ({ schemaCode: e }) => (0, ve.str)`must match format "${e}"`, - params: ({ schemaCode: e }) => (0, ve._)`{format: ${e}}` -}, Yc = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: !0, - error: Zc, - code(e, t) { - const { gen: r, data: a, $data: s, schema: l, schemaCode: d, it: b } = e, { opts: _, errSchemaPath: y, schemaEnv: m, self: k } = b; - if (!_.validateFormats) - return; - s ? N() : A(); - function N() { - const j = r.scopeValue("formats", { - ref: k.formats, - code: _.code.formats - }), C = r.const("fDef", (0, ve._)`${j}[${d}]`), x = r.let("fType"), v = r.let("format"); - r.if((0, ve._)`typeof ${C} == "object" && !(${C} instanceof RegExp)`, () => r.assign(x, (0, ve._)`${C}.type || "string"`).assign(v, (0, ve._)`${C}.validate`), () => r.assign(x, (0, ve._)`"string"`).assign(v, C)), e.fail$data((0, ve.or)(T(), R())); - function T() { - return _.strictSchema === !1 ? ve.nil : (0, ve._)`${d} && !${v}`; - } - function R() { - const n = m.$async ? (0, ve._)`(${C}.async ? await ${v}(${a}) : ${v}(${a}))` : (0, ve._)`${v}(${a})`, i = (0, ve._)`(typeof ${v} == "function" ? ${n} : ${v}.test(${a}))`; - return (0, ve._)`${v} && ${v} !== true && ${x} === ${t} && !${i}`; - } - } - function A() { - const j = k.formats[l]; - if (!j) { - T(); - return; - } - if (j === !0) - return; - const [C, x, v] = R(j); - C === t && e.pass(n()); - function T() { - if (_.strictSchema === !1) { - k.logger.warn(i()); - return; - } - throw new Error(i()); - function i() { - return `unknown format "${l}" ignored in schema at path "${y}"`; - } - } - function R(i) { - const o = i instanceof RegExp ? (0, ve.regexpCode)(i) : _.code.formats ? (0, ve._)`${_.code.formats}${(0, ve.getProperty)(l)}` : void 0, c = r.scopeValue("formats", { key: l, ref: i, code: o }); - return typeof i == "object" && !(i instanceof RegExp) ? [i.type || "string", i.validate, (0, ve._)`${c}.validate`] : ["string", i, c]; - } - function n() { - if (typeof j == "object" && !(j instanceof RegExp) && j.async) { - if (!m.$async) - throw new Error("async format in sync schema"); - return (0, ve._)`await ${v}(${a})`; - } - return typeof x == "function" ? (0, ve._)`${v}(${a})` : (0, ve._)`${v}.test(${a})`; - } - } - } -}; -Xa.default = Yc; -Object.defineProperty(Qa, "__esModule", { value: !0 }); -const Qc = Xa, Xc = [Qc.default]; -Qa.default = Xc; -var Kt = {}; -Object.defineProperty(Kt, "__esModule", { value: !0 }); -Kt.contentVocabulary = Kt.metadataVocabulary = void 0; -Kt.metadataVocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples" -]; -Kt.contentVocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema" -]; -Object.defineProperty($a, "__esModule", { value: !0 }); -const eu = Pa, tu = Ta, ru = Ba, au = Qa, Mn = Kt, nu = [ - eu.default, - tu.default, - (0, ru.default)(), - au.default, - Mn.metadataVocabulary, - Mn.contentVocabulary -]; -$a.default = nu; -var en = {}, Vo = {}; -(function(e) { - Object.defineProperty(e, "__esModule", { value: !0 }), e.DiscrError = void 0, function(t) { - t.Tag = "tag", t.Mapping = "mapping"; - }(e.DiscrError || (e.DiscrError = {})); -})(Vo); -Object.defineProperty(en, "__esModule", { value: !0 }); -const Vt = ie, fa = Vo, Dn = Be, ou = ce, su = { - message: ({ params: { discrError: e, tagName: t } }) => e === fa.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`, - params: ({ params: { discrError: e, tag: t, tagName: r } }) => (0, Vt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}` -}, iu = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error: su, - code(e) { - const { gen: t, data: r, schema: a, parentSchema: s, it: l } = e, { oneOf: d } = s; - if (!l.opts.discriminator) - throw new Error("discriminator: requires discriminator option"); - const b = a.propertyName; - if (typeof b != "string") - throw new Error("discriminator: requires propertyName"); - if (a.mapping) - throw new Error("discriminator: mapping is not supported"); - if (!d) - throw new Error("discriminator: requires oneOf keyword"); - const _ = t.let("valid", !1), y = t.const("tag", (0, Vt._)`${r}${(0, Vt.getProperty)(b)}`); - t.if((0, Vt._)`typeof ${y} == "string"`, () => m(), () => e.error(!1, { discrError: fa.DiscrError.Tag, tag: y, tagName: b })), e.ok(_); - function m() { - const A = N(); - t.if(!1); - for (const j in A) - t.elseIf((0, Vt._)`${y} === ${j}`), t.assign(_, k(A[j])); - t.else(), e.error(!1, { discrError: fa.DiscrError.Mapping, tag: y, tagName: b }), t.endIf(); - } - function k(A) { - const j = t.name("valid"), C = e.subschema({ keyword: "oneOf", schemaProp: A }, j); - return e.mergeEvaluated(C, Vt.Name), j; - } - function N() { - var A; - const j = {}, C = v(s); - let x = !0; - for (let n = 0; n < d.length; n++) { - let i = d[n]; - i != null && i.$ref && !(0, ou.schemaHasRulesButRef)(i, l.self.RULES) && (i = Dn.resolveRef.call(l.self, l.schemaEnv.root, l.baseId, i == null ? void 0 : i.$ref), i instanceof Dn.SchemaEnv && (i = i.schema)); - const o = (A = i == null ? void 0 : i.properties) === null || A === void 0 ? void 0 : A[b]; - if (typeof o != "object") - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`); - x = x && (C || v(i)), T(o, n); - } - if (!x) - throw new Error(`discriminator: "${b}" must be required`); - return j; - function v({ required: n }) { - return Array.isArray(n) && n.includes(b); - } - function T(n, i) { - if (n.const) - R(n.const, i); - else if (n.enum) - for (const o of n.enum) - R(o, i); - else - throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`); - } - function R(n, i) { - if (typeof n != "string" || n in j) - throw new Error(`discriminator: "${b}" values must be unique strings`); - j[n] = i; - } - } - } -}; -en.default = iu; -const lu = "http://json-schema.org/draft-07/schema#", cu = "http://json-schema.org/draft-07/schema#", uu = "Core schema meta-schema", du = { - schemaArray: { - type: "array", - minItems: 1, - items: { - $ref: "#" - } - }, - nonNegativeInteger: { - type: "integer", - minimum: 0 - }, - nonNegativeIntegerDefault0: { - allOf: [ - { - $ref: "#/definitions/nonNegativeInteger" - }, - { - default: 0 - } - ] - }, - simpleTypes: { - enum: [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - stringArray: { - type: "array", - items: { - type: "string" - }, - uniqueItems: !0, - default: [] - } -}, hu = [ - "object", - "boolean" -], pu = { - $id: { - type: "string", - format: "uri-reference" - }, - $schema: { - type: "string", - format: "uri" - }, - $ref: { - type: "string", - format: "uri-reference" - }, - $comment: { - type: "string" - }, - title: { - type: "string" - }, - description: { - type: "string" - }, - default: !0, - readOnly: { - type: "boolean", - default: !1 - }, - examples: { - type: "array", - items: !0 - }, - multipleOf: { - type: "number", - exclusiveMinimum: 0 - }, - maximum: { - type: "number" - }, - exclusiveMaximum: { - type: "number" - }, - minimum: { - type: "number" - }, - exclusiveMinimum: { - type: "number" - }, - maxLength: { - $ref: "#/definitions/nonNegativeInteger" - }, - minLength: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - pattern: { - type: "string", - format: "regex" - }, - additionalItems: { - $ref: "#" - }, - items: { - anyOf: [ - { - $ref: "#" - }, - { - $ref: "#/definitions/schemaArray" - } - ], - default: !0 - }, - maxItems: { - $ref: "#/definitions/nonNegativeInteger" - }, - minItems: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - uniqueItems: { - type: "boolean", - default: !1 - }, - contains: { - $ref: "#" - }, - maxProperties: { - $ref: "#/definitions/nonNegativeInteger" - }, - minProperties: { - $ref: "#/definitions/nonNegativeIntegerDefault0" - }, - required: { - $ref: "#/definitions/stringArray" - }, - additionalProperties: { - $ref: "#" - }, - definitions: { - type: "object", - additionalProperties: { - $ref: "#" - }, - default: {} - }, - properties: { - type: "object", - additionalProperties: { - $ref: "#" - }, - default: {} - }, - patternProperties: { - type: "object", - additionalProperties: { - $ref: "#" - }, - propertyNames: { - format: "regex" - }, - default: {} - }, - dependencies: { - type: "object", - additionalProperties: { - anyOf: [ - { - $ref: "#" - }, - { - $ref: "#/definitions/stringArray" - } - ] - } - }, - propertyNames: { - $ref: "#" - }, - const: !0, - enum: { - type: "array", - items: !0, - minItems: 1, - uniqueItems: !0 - }, - type: { - anyOf: [ - { - $ref: "#/definitions/simpleTypes" - }, - { - type: "array", - items: { - $ref: "#/definitions/simpleTypes" - }, - minItems: 1, - uniqueItems: !0 - } - ] - }, - format: { - type: "string" - }, - contentMediaType: { - type: "string" - }, - contentEncoding: { - type: "string" - }, - if: { - $ref: "#" - }, - then: { - $ref: "#" - }, - else: { - $ref: "#" - }, - allOf: { - $ref: "#/definitions/schemaArray" - }, - anyOf: { - $ref: "#/definitions/schemaArray" - }, - oneOf: { - $ref: "#/definitions/schemaArray" - }, - not: { - $ref: "#" - } -}, fu = { - $schema: lu, - $id: cu, - title: uu, - definitions: du, - type: hu, - properties: pu, - default: !0 -}; -(function(e, t) { - Object.defineProperty(t, "__esModule", { value: !0 }), t.MissingRefError = t.ValidationError = t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = void 0; - const r = so, a = $a, s = en, l = fu, d = ["/properties"], b = "http://json-schema.org/draft-07/schema"; - class _ extends r.default { - _addVocabularies() { - super._addVocabularies(), a.default.forEach((j) => this.addVocabulary(j)), this.opts.discriminator && this.addKeyword(s.default); - } - _addDefaultMetaSchema() { - if (super._addDefaultMetaSchema(), !this.opts.meta) - return; - const j = this.opts.$data ? this.$dataMetaSchema(l, d) : l; - this.addMetaSchema(j, b, !1), this.refs["http://json-schema.org/schema"] = b; - } - defaultMeta() { - return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(b) ? b : void 0); - } - } - e.exports = t = _, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = _; - var y = rt; - Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() { - return y.KeywordCxt; - } }); - var m = ie; - Object.defineProperty(t, "_", { enumerable: !0, get: function() { - return m._; - } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() { - return m.str; - } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() { - return m.stringify; - } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() { - return m.nil; - } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() { - return m.Name; - } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() { - return m.CodeGen; - } }); - var k = _r; - Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() { - return k.default; - } }); - var N = wr; - Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() { - return N.default; - } }); -})(la, la.exports); -var mu = la.exports; -const gu = /* @__PURE__ */ oo(mu); -class bu { - constructor() { - Te(this, "ajv"), this.ajv = new gu(); - } - validateJson(t, r) { - const a = this.ajv.validate(t, r); - return a ? { valid: a } : { valid: a, error: this.ajv.errorsText() }; - } - validateObjectSchema(t, r) { - const a = this.ajv.validate(t, r); - return a ? { valid: a } : { valid: a, error: this.ajv.errorsText() }; - } -} -class yu { - constructor() { - Te(this, "TIME_SPLIT", " "); - } - /** - * 给日期添加小时 - * - * @param date - Date - * @param numOfHours - 数字 - * @author terwer - * @since 1.0.0 - */ - addHoursToDate(t, r) { - return t.setTime(t.getTime() + r * 60 * 60 * 1e3), t; - } - /** - * 转换ISO日期为中文日期的通用转换方法 - * - * @param str - '2022-07-18T06:25:48.000Z - * @param isAddTimeZone - 是否增加时区(默认不增加) - * @param isShort - 是否只返回日期 - * @author terwer - * @since 1.0.0 - */ - formatIsoToZhDateFormat(t, r, a) { - if (!t) - return ""; - let s = t; - const l = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(.\d{3})Z$/gm, d = s.match(l); - if (d == null) - return t; - for (let b = 0; b < d.length; b++) { - const _ = d[b]; - let y = _; - r && (y = this.addHoursToDate(new Date(_), 8).toISOString()); - const m = y.split("T"), k = m[0], N = m[1].split(".")[0]; - let A = k + this.TIME_SPLIT + N; - a && (A = k), s = s.replace(_, A); - } - return s; - } - /** - * 转换ISO日期为中文完整时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZh(t) { - return this.formatIsoToZhDateFormat(t, !1, !1); - } - /** - * 转换ISO日期为中文日期 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhDate(t) { - return this.formatIsoToZhDateFormat(t, !1, !0); - } - /** - * 转换ISO日期为中文时间 - * - * @param str - '2022-07-18T06:25:48.000Z - */ - formatIsoToZhTime(t) { - return this.formatIsoToZhDateFormat(t, !1).split(this.TIME_SPLIT)[1]; - } - /** - * 当前日期时间完整格式,格式:2023-03-10 02:03:43 - */ - nowZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0); - } - /** - * 当前日期,格式:2023-03-10 - */ - nowDateZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0, !0); - } - /** - * 当前时间,格式:02:03:43 - */ - nowTimeZh() { - return this.formatIsoToZhDateFormat((/* @__PURE__ */ new Date()).toISOString(), !0).split(this.TIME_SPLIT)[1]; - } -} -class _u { - /** - * 格式化字符串 - * - * @param str - 字符串,可用占位符,例如:test \{0\} str - * @param args - 按占位符顺序排列的参数 - * @author terwer - * @since 0.0.1 - */ - f(t, ...r) { - let a = t; - for (let s = 0; s < r.length; s++) { - const l = r[s]; - typeof l == "string" ? a = a.replace(`{${s}}`, l) : a = a.replace(`{${s}}`, l.toString()); - } - return a; - } - /** - * 字符串拼接 - * - * @param str - 字符串数组 - */ - appendStr(...t) { - return t.join(""); - } - /** - * 判断字符串中,是否包含数组中任何一个元素 - * - * @param str - 字符串 - * @param arr - 字符串数组 - */ - includeInArray(t, r) { - let a = !1; - for (let s = 0; s < r.length; s++) { - const l = r[s]; - t.includes(l) && (a = !0); - } - return a; - } - /** - * 截取指定长度的字符串 - * - * @param str - str - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - getByLength(t, r, a) { - const s = t; - return s.length < r ? s : a ? s.substring(0, r) : s.substring(0, r) + "..."; - } - /** - * 字符串空值检测 - * - * @param str - 待检测的字符串 - */ - isEmptyString(t) { - return !t || typeof t != "string" ? !0 : t.trim().length === 0; - } - /** - * 路径组合,解决多出来/的问题 - * - * @param path1 - 路径1 - * @param path2 - 路径2 - */ - pathJoin(t, r) { - let a = t; - const s = t.lastIndexOf("/"); - return s + 1 === t.length && (a = t.substring(0, s)), r.indexOf("/") > 0 ? a = a + "/" + r : a = a + r, a; - } - /** - * 强转boolean - * - * @param val - val - */ - parseBoolean(t) { - return t || (t = "false"), t.toString().toLowerCase() === "true"; - } -} -const ia = (e, t) => { - const r = Bn(e), a = Bn(t), s = r.pop(), l = a.pop(), d = Fn(r, a); - return d !== 0 ? d : s && l ? Fn(s.split("."), l.split(".")) : s || l ? s ? -1 : 1 : 0; -}, wu = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Bn = (e) => { - if (typeof e != "string") - throw new TypeError("Invalid argument expected string"); - const t = e.match(wu); - if (!t) - throw new Error(`Invalid argument not valid semver ('${e}' received)`); - return t.shift(), t; -}, zn = (e) => e === "*" || e === "x" || e === "X", Vn = (e) => { - const t = parseInt(e, 10); - return isNaN(t) ? e : t; -}, vu = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], ku = (e, t) => { - if (zn(e) || zn(t)) - return 0; - const [r, a] = vu(Vn(e), Vn(t)); - return r > a ? 1 : r < a ? -1 : 0; -}, Fn = (e, t) => { - for (let r = 0; r < Math.max(e.length, t.length); r++) { - const a = ku(e[r] || "0", t[r] || "0"); - if (a !== 0) - return a; - } - return 0; -}; -class Eu { - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is higher than v2 - */ - greater(t, r) { - return ia(t, r) > 0; - } - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is equal to v2 - */ - equal(t, r) { - return ia(t, r) === 0; - } - /** - * Compare [semver](https://semver.org/) version strings - * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. - * - * @param v1 - First version to compare - * @param v2 - Second version to compare - * @returns boolean true if v1 is lesser than v2 - */ - lesser(t, r) { - return ia(t, r) < 0; - } -} -var $u = Object.defineProperty, Pu = (e, t, r) => t in e ? $u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ft = (e, t, r) => (Pu(e, typeof t != "symbol" ? t + "" : t, r), r); -let bt = class { -}; -Ft(bt, "NODE_ENV_KEY", "NODE_ENV"), /** -* 开发环境 -*/ -Ft(bt, "NODE_ENV_DEVELOPMENT", "development"), /** -* 生产环境 -*/ -Ft(bt, "NODE_ENV_PRODUCTION", "production"), /** -* 测试环境 -*/ -Ft(bt, "NODE_ENV_TEST", "test"), /** -* 是否处于调试模式 -*/ -Ft(bt, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -class Su { - /** - * 环境初始化 - * - * @param envMeta - 需要传入 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false} 。特别提醒:此参数是静态元数据,取决于最终使用的项目。因此仅仅在最终使用的地方显示传递此值,中间项目请保持参数传递 - * @see {@link https://vitejs.dev/guide/env-and-mode.html#production-replacement} - */ - constructor(t) { - Ft(this, "envMeta"), this.envMeta = t; - } - /** - * 是否是开发阶段调试 - */ - isNodeDev() { - return this.getEnv(bt.NODE_ENV_KEY) === bt.NODE_ENV_DEVELOPMENT; - } - /** - * 是否是调试阶段 - */ - isDev() { - return this.isNodeDev() || this.getBooleanEnv(bt.VITE_DEBUG_MODE_KEY); - } - /** - * 获取环境变量,key不存在返回undefined - * @param key - key - */ - getEnv(t) { - let r; - try { - this.envMeta[t] && (r = this.envMeta[t]); - } catch { - } - return r; - } - /** - * 获取String类型的环境变量,key不存在直接返回空值 - * @param key - key - */ - getStringEnv(t) { - return this.getEnv(t) ?? ""; - } - /** - * 获取Boolean类型的环境变量,key不存在返回false - * @param key - key - */ - getBooleanEnv(t) { - let r = !1; - return this.getEnv(t) && (r = this.getStringEnv(t).toLowerCase() === "true"), r; - } - /** - * 获取环境变量,如果未定义或者为空值,用指定的默认值代替 - * - * @param key - key - * @param defaultValue - 默认值 - * @since 0.1.0 - * @author terwer - */ - getEnvOrDefault(t, r) { - const a = this.getStringEnv(t); - return a.trim().length == 0 ? r : a; - } -} -var Tu = Object.defineProperty, Cu = (e, t, r) => t in e ? Tu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ut = (e, t, r) => (Cu(e, typeof t != "symbol" ? t + "" : t, r), r); -class Gr { -} -Ut(Gr, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), Ut(Gr, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX"); -var st = /* @__PURE__ */ ((e) => (e.LOG_LEVEL_TRACE = "TRACE", e.LOG_LEVEL_DEBUG = "DEBUG", e.LOG_LEVEL_INFO = "INFO", e.LOG_LEVEL_WARN = "WARN", e.LOG_LEVEL_ERROR = "ERROR", e))(st || {}), Fo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function tn(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var qo = { exports: {} }; -(function(e) { - (function(t, r) { - e.exports ? e.exports = r() : t.log = r(); - })(Fo, function() { - var t = function() { - }, r = "undefined", a = typeof window !== r && typeof window.navigator !== r && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [ - "trace", - "debug", - "info", - "warn", - "error" - ]; - function l(C, x) { - var v = C[x]; - if (typeof v.bind == "function") - return v.bind(C); - try { - return Function.prototype.bind.call(v, C); - } catch { - return function() { - return Function.prototype.apply.apply(v, [C, arguments]); - }; - } - } - function d() { - console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace(); - } - function b(C) { - return C === "debug" && (C = "log"), typeof console === r ? !1 : C === "trace" && a ? d : console[C] !== void 0 ? l(console, C) : console.log !== void 0 ? l(console, "log") : t; - } - function _(C, x) { - for (var v = 0; v < s.length; v++) { - var T = s[v]; - this[T] = v < C ? t : this.methodFactory(T, C, x); - } - this.log = this.debug; - } - function y(C, x, v) { - return function() { - typeof console !== r && (_.call(this, x, v), this[C].apply(this, arguments)); - }; - } - function m(C, x, v) { - return b(C) || y.apply(this, arguments); - } - function k(C, x, v) { - var T = this, R; - x = x ?? "WARN"; - var n = "loglevel"; - typeof C == "string" ? n += ":" + C : typeof C == "symbol" && (n = void 0); - function i(f) { - var g = (s[f] || "silent").toUpperCase(); - if (!(typeof window === r || !n)) { - try { - window.localStorage[n] = g; - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(n) + "=" + g + ";"; - } catch { - } - } - } - function o() { - var f; - if (!(typeof window === r || !n)) { - try { - f = window.localStorage[n]; - } catch { - } - if (typeof f === r) - try { - var g = window.document.cookie, O = g.indexOf( - encodeURIComponent(n) + "=" - ); - O !== -1 && (f = /^([^;]+)/.exec(g.slice(O))[1]); - } catch { - } - return T.levels[f] === void 0 && (f = void 0), f; - } - } - function c() { - if (!(typeof window === r || !n)) { - try { - window.localStorage.removeItem(n); - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(n) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; - } catch { - } - } - } - T.name = C, T.levels = { - TRACE: 0, - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - SILENT: 5 - }, T.methodFactory = v || m, T.getLevel = function() { - return R; - }, T.setLevel = function(f, g) { - if (typeof f == "string" && T.levels[f.toUpperCase()] !== void 0 && (f = T.levels[f.toUpperCase()]), typeof f == "number" && f >= 0 && f <= T.levels.SILENT) { - if (R = f, g !== !1 && i(f), _.call(T, f, C), typeof console === r && f < T.levels.SILENT) - return "No console available for logging"; - } else - throw "log.setLevel() called with invalid level: " + f; - }, T.setDefaultLevel = function(f) { - x = f, o() || T.setLevel(f, !1); - }, T.resetLevel = function() { - T.setLevel(x, !1), c(); - }, T.enableAll = function(f) { - T.setLevel(T.levels.TRACE, f); - }, T.disableAll = function(f) { - T.setLevel(T.levels.SILENT, f); - }; - var u = o(); - u == null && (u = x), T.setLevel(u, !1); - } - var N = new k(), A = {}; - N.getLogger = function(C) { - if (typeof C != "symbol" && typeof C != "string" || C === "") - throw new TypeError("You must supply a name when creating a logger."); - var x = A[C]; - return x || (x = A[C] = new k( - C, - N.getLevel(), - N.methodFactory - )), x; - }; - var j = typeof window !== r ? window.log : void 0; - return N.noConflict = function() { - return typeof window !== r && window.log === N && (window.log = j), N; - }, N.getLoggers = function() { - return A; - }, N.default = N, N; - }); -})(qo); -var xu = qo.exports; -const jr = /* @__PURE__ */ tn(xu); -var Uo = { exports: {} }; -(function(e) { - (function(t, r) { - e.exports ? e.exports = r() : t.prefix = r(t); - })(Fo, function(t) { - var r = function(m) { - for (var k = 1, N = arguments.length, A; k < N; k++) - for (A in arguments[k]) - Object.prototype.hasOwnProperty.call(arguments[k], A) && (m[A] = arguments[k][A]); - return m; - }, a = { - template: "[%t] %l:", - levelFormatter: function(m) { - return m.toUpperCase(); - }, - nameFormatter: function(m) { - return m || "root"; - }, - timestampFormatter: function(m) { - return m.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); - }, - format: void 0 - }, s, l = {}, d = function(m) { - if (!m || !m.getLogger) - throw new TypeError("Argument is not a root logger"); - s = m; - }, b = function(m, k) { - if (!m || !m.setLevel) - throw new TypeError("Argument is not a logger"); - var N = m.methodFactory, A = m.name || "", j = l[A] || l[""] || a; - function C(x, v, T) { - var R = N(x, v, T), n = l[T] || l[""], i = n.template.indexOf("%t") !== -1, o = n.template.indexOf("%l") !== -1, c = n.template.indexOf("%n") !== -1; - return function() { - for (var u = "", f = arguments.length, g = Array(f), O = 0; O < f; O++) - g[O] = arguments[O]; - if (A || !l[T]) { - var z = n.timestampFormatter(/* @__PURE__ */ new Date()), q = n.levelFormatter(x), B = n.nameFormatter(T); - n.format ? u += n.format(q, B, z) : (u += n.template, i && (u = u.replace(/%t/, z)), o && (u = u.replace(/%l/, q)), c && (u = u.replace(/%n/, B))), g.length && typeof g[0] == "string" ? g[0] = u + " " + g[0] : g.unshift(u); - } - R.apply(void 0, g); - }; - } - return l[A] || (m.methodFactory = C), k = k || {}, k.template && (k.format = void 0), l[A] = r({}, j, k), m.setLevel(m.getLevel()), s || m.warn( - "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md" - ), m; - }, _ = { - reg: d, - apply: b - }, y; - return t && (y = t.prefix, _.noConflict = function() { - return t.prefix === _ && (t.prefix = y), _; - }), _; - }); -})(Uo); -var Ou = Uo.exports; -const qn = /* @__PURE__ */ tn(Ou); -function Nu() { - const e = Error.prepareStackTrace; - Error.prepareStackTrace = (r, a) => a; - const t = new Error().stack.slice(1); - return Error.prepareStackTrace = e, t; -} -class Hr { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - static stringToEnumValue(t, r) { - return t[Object.keys(t).filter((a) => t[a].toString() === r)[0]]; - } - /** - * 获取配置的日志级别 - */ - static getEnvLevel(t) { - if (!t) - return; - const r = t.getEnvOrDefault(Gr.LOG_LEVEL_KEY, st.LOG_LEVEL_INFO), a = Hr.stringToEnumValue(st, r.toUpperCase()); - return a || console.warn( - "[zhi-log] LOG_LEVEL is invalid in you .env file.It must be either debug, info, warn or error, fallback to default info level" - ), a; - } - /** - * 获取默认日志 - */ - static getEnvLogger(t) { - return t ? t.getEnv(Gr.LOG_PREFIX_KEY) : void 0; - } -} -var rn = { exports: {} }, Un = { exports: {} }, Gn; -function ju() { - return Gn || (Gn = 1, function(e) { - const t = typeof process < "u" && process.env.TERM_PROGRAM === "Hyper", r = typeof process < "u" && process.platform === "win32", a = typeof process < "u" && process.platform === "linux", s = { - ballotDisabled: "☒", - ballotOff: "☐", - ballotOn: "☑", - bullet: "•", - bulletWhite: "◦", - fullBlock: "█", - heart: "❤", - identicalTo: "≡", - line: "─", - mark: "※", - middot: "·", - minus: "-", - multiplication: "×", - obelus: "÷", - pencilDownRight: "✎", - pencilRight: "✏", - pencilUpRight: "✐", - percent: "%", - pilcrow2: "❡", - pilcrow: "¶", - plusMinus: "±", - question: "?", - section: "§", - starsOff: "☆", - starsOn: "★", - upDownArrow: "↕" - }, l = Object.assign({}, s, { - check: "√", - cross: "×", - ellipsisLarge: "...", - ellipsis: "...", - info: "i", - questionSmall: "?", - pointer: ">", - pointerSmall: "»", - radioOff: "( )", - radioOn: "(*)", - warning: "‼" - }), d = Object.assign({}, s, { - ballotCross: "✘", - check: "✔", - cross: "✖", - ellipsisLarge: "⋯", - ellipsis: "…", - info: "ℹ", - questionFull: "?", - questionSmall: "﹖", - pointer: a ? "▸" : "❯", - pointerSmall: a ? "‣" : "›", - radioOff: "◯", - radioOn: "◉", - warning: "⚠" - }); - e.exports = r && !t ? l : d, Reflect.defineProperty(e.exports, "common", { enumerable: !1, value: s }), Reflect.defineProperty(e.exports, "windows", { enumerable: !1, value: l }), Reflect.defineProperty(e.exports, "other", { enumerable: !1, value: d }); - }(Un)), Un.exports; -} -const Lu = (e) => e !== null && typeof e == "object" && !Array.isArray(e), Au = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, Ru = () => typeof process < "u" ? process.env.FORCE_COLOR !== "0" : !1, Go = () => { - const e = { - enabled: Ru(), - visible: !0, - styles: {}, - keys: {} - }, t = (l) => { - let d = l.open = `\x1B[${l.codes[0]}m`, b = l.close = `\x1B[${l.codes[1]}m`, _ = l.regex = new RegExp(`\\u001b\\[${l.codes[1]}m`, "g"); - return l.wrap = (y, m) => { - y.includes(b) && (y = y.replace(_, b + d)); - let k = d + y + b; - return m ? k.replace(/\r*\n/g, `${b}$&${d}`) : k; - }, l; - }, r = (l, d, b) => typeof l == "function" ? l(d) : l.wrap(d, b), a = (l, d) => { - if (l === "" || l == null) - return ""; - if (e.enabled === !1) - return l; - if (e.visible === !1) - return ""; - let b = "" + l, _ = b.includes(` -`), y = d.length; - for (y > 0 && d.includes("unstyle") && (d = [.../* @__PURE__ */ new Set(["unstyle", ...d])].reverse()); y-- > 0; ) - b = r(e.styles[d[y]], b, _); - return b; - }, s = (l, d, b) => { - e.styles[l] = t({ name: l, codes: d }), (e.keys[b] || (e.keys[b] = [])).push(l), Reflect.defineProperty(e, l, { - configurable: !0, - enumerable: !0, - set(_) { - e.alias(l, _); - }, - get() { - let _ = (y) => a(y, _.stack); - return Reflect.setPrototypeOf(_, e), _.stack = this.stack ? this.stack.concat(l) : [l], _; - } - }); - }; - return s("reset", [0, 0], "modifier"), s("bold", [1, 22], "modifier"), s("dim", [2, 22], "modifier"), s("italic", [3, 23], "modifier"), s("underline", [4, 24], "modifier"), s("inverse", [7, 27], "modifier"), s("hidden", [8, 28], "modifier"), s("strikethrough", [9, 29], "modifier"), s("black", [30, 39], "color"), s("red", [31, 39], "color"), s("green", [32, 39], "color"), s("yellow", [33, 39], "color"), s("blue", [34, 39], "color"), s("magenta", [35, 39], "color"), s("cyan", [36, 39], "color"), s("white", [37, 39], "color"), s("gray", [90, 39], "color"), s("grey", [90, 39], "color"), s("bgBlack", [40, 49], "bg"), s("bgRed", [41, 49], "bg"), s("bgGreen", [42, 49], "bg"), s("bgYellow", [43, 49], "bg"), s("bgBlue", [44, 49], "bg"), s("bgMagenta", [45, 49], "bg"), s("bgCyan", [46, 49], "bg"), s("bgWhite", [47, 49], "bg"), s("blackBright", [90, 39], "bright"), s("redBright", [91, 39], "bright"), s("greenBright", [92, 39], "bright"), s("yellowBright", [93, 39], "bright"), s("blueBright", [94, 39], "bright"), s("magentaBright", [95, 39], "bright"), s("cyanBright", [96, 39], "bright"), s("whiteBright", [97, 39], "bright"), s("bgBlackBright", [100, 49], "bgBright"), s("bgRedBright", [101, 49], "bgBright"), s("bgGreenBright", [102, 49], "bgBright"), s("bgYellowBright", [103, 49], "bgBright"), s("bgBlueBright", [104, 49], "bgBright"), s("bgMagentaBright", [105, 49], "bgBright"), s("bgCyanBright", [106, 49], "bgBright"), s("bgWhiteBright", [107, 49], "bgBright"), e.ansiRegex = Au, e.hasColor = e.hasAnsi = (l) => (e.ansiRegex.lastIndex = 0, typeof l == "string" && l !== "" && e.ansiRegex.test(l)), e.alias = (l, d) => { - let b = typeof d == "string" ? e[d] : d; - if (typeof b != "function") - throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); - b.stack || (Reflect.defineProperty(b, "name", { value: l }), e.styles[l] = b, b.stack = [l]), Reflect.defineProperty(e, l, { - configurable: !0, - enumerable: !0, - set(_) { - e.alias(l, _); - }, - get() { - let _ = (y) => a(y, _.stack); - return Reflect.setPrototypeOf(_, e), _.stack = this.stack ? this.stack.concat(b.stack) : b.stack, _; - } - }); - }, e.theme = (l) => { - if (!Lu(l)) - throw new TypeError("Expected theme to be an object"); - for (let d of Object.keys(l)) - e.alias(d, l[d]); - return e; - }, e.alias("unstyle", (l) => typeof l == "string" && l !== "" ? (e.ansiRegex.lastIndex = 0, l.replace(e.ansiRegex, "")) : ""), e.alias("noop", (l) => l), e.none = e.clear = e.noop, e.stripColor = e.unstyle, e.symbols = ju(), e.define = s, e; -}; -rn.exports = Go(); -rn.exports.create = Go; -var Iu = rn.exports; -const Ue = /* @__PURE__ */ tn(Iu); -let ma, Ho, Ko, Wo, Jo = !0; -typeof process < "u" && ({ FORCE_COLOR: ma, NODE_DISABLE_COLORS: Ho, NO_COLOR: Ko, TERM: Wo } = process.env || {}, Jo = process.stdout && process.stdout.isTTY); -const re = { - enabled: !Ho && Ko == null && Wo !== "dumb" && (ma != null && ma !== "0" || Jo), - // modifiers - reset: me(0, 0), - bold: me(1, 22), - dim: me(2, 22), - italic: me(3, 23), - underline: me(4, 24), - inverse: me(7, 27), - hidden: me(8, 28), - strikethrough: me(9, 29), - // colors - black: me(30, 39), - red: me(31, 39), - green: me(32, 39), - yellow: me(33, 39), - blue: me(34, 39), - magenta: me(35, 39), - cyan: me(36, 39), - white: me(37, 39), - gray: me(90, 39), - grey: me(90, 39), - // background colors - bgBlack: me(40, 49), - bgRed: me(41, 49), - bgGreen: me(42, 49), - bgYellow: me(43, 49), - bgBlue: me(44, 49), - bgMagenta: me(45, 49), - bgCyan: me(46, 49), - bgWhite: me(47, 49) -}; -function Hn(e, t) { - let r = 0, a, s = "", l = ""; - for (; r < e.length; r++) - a = e[r], s += a.open, l += a.close, ~t.indexOf(a.close) && (t = t.replace(a.rgx, a.close + a.open)); - return s + t + l; -} -function Mu(e, t) { - let r = { has: e, keys: t }; - return r.reset = re.reset.bind(r), r.bold = re.bold.bind(r), r.dim = re.dim.bind(r), r.italic = re.italic.bind(r), r.underline = re.underline.bind(r), r.inverse = re.inverse.bind(r), r.hidden = re.hidden.bind(r), r.strikethrough = re.strikethrough.bind(r), r.black = re.black.bind(r), r.red = re.red.bind(r), r.green = re.green.bind(r), r.yellow = re.yellow.bind(r), r.blue = re.blue.bind(r), r.magenta = re.magenta.bind(r), r.cyan = re.cyan.bind(r), r.white = re.white.bind(r), r.gray = re.gray.bind(r), r.grey = re.grey.bind(r), r.bgBlack = re.bgBlack.bind(r), r.bgRed = re.bgRed.bind(r), r.bgGreen = re.bgGreen.bind(r), r.bgYellow = re.bgYellow.bind(r), r.bgBlue = re.bgBlue.bind(r), r.bgMagenta = re.bgMagenta.bind(r), r.bgCyan = re.bgCyan.bind(r), r.bgWhite = re.bgWhite.bind(r), r; -} -function me(e, t) { - let r = { - open: `\x1B[${e}m`, - close: `\x1B[${t}m`, - rgx: new RegExp(`\\x1b\\[${t}m`, "g") - }; - return function(a) { - return this !== void 0 && this.has !== void 0 ? (~this.has.indexOf(e) || (this.has.push(e), this.keys.push(r)), a === void 0 ? this : re.enabled ? Hn(this.keys, a + "") : a + "") : a === void 0 ? Mu([e], [r]) : re.enabled ? Hn([r], a + "") : a + ""; - }; -} -var Du = Object.defineProperty, Bu = (e, t, r) => t in e ? Du(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Pe = (e, t, r) => (Bu(e, typeof t != "symbol" ? t + "" : t, r), r); -const Qe = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return Qe.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let de = Qe; -Pe(de, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -Pe(de, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -Pe(de, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -Pe(de, "isElectron", () => !Qe.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -Pe(de, "hasNodeEnv", () => Qe.isElectron() || Qe.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -Pe(de, "getQueryString", (e) => { - if (!Qe.isInBrowser) - return ""; - const t = window.location.search.substring(1).split("&"); - for (let r = 0; r < t.length; r++) { - const a = t[r].split("="); - if (a[0] === e) - return a[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -Pe(de, "replaceUrlParam", (e, t, r) => { - r == null && (r = ""); - const a = new RegExp("\\b(" + t + "=).*?(&|#|$)"); - if (e.search(a) >= 0) - return e.replace(a, "$1" + r + "$2"); - const [s, l] = e.split("#"), [d, b] = s.split("?"), _ = new URLSearchParams(b); - _.set(t, r); - const y = _.toString(), m = d + (y ? "?" + y : ""); - return l ? m + "#" + l : m; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -Pe(de, "setUrlParameter", (e, t, r) => { - if (e.includes(t)) - return Qe.replaceUrlParam(e, t, r); - const a = e.split("#"); - let s = a[0]; - const l = a[1]; - return s.includes("?") ? s += `&${t}=${r}` : s += `?${t}=${r}`, l && (s += "#" + l), s; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -Pe(de, "reloadTabPage", (e, t = 200) => { - setTimeout(function() { - if (Qe.isInBrowser) { - const r = window.location.href; - window.location.href = Qe.setUrlParameter(r, "tab", e); - } - }, t); -}), /** -* 刷新当前tab页面 -*/ -Pe(de, "reloadPage", () => { - setTimeout(function() { - Qe.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -Pe(de, "reloadPageWithMessageCallback", (e, t) => { - t && t(e), setTimeout(function() { - Qe.isInBrowser && window.location.reload(); - }, 200); -}); -var je = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(je || {}); -const Ie = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return de.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, t) { - let r = e; - switch (t) { - case je.BasePathType_Appearance: - r = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case je.BasePathType_Data: - r = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case je.BasePathType_Themes: - r = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case je.BasePathType_ZhiTheme: - r = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: a } = await import( - /* @vite-ignore */ - r - ); - return a; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, je.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (de.hasNodeEnv()) { - const t = this.requireLib("path"); - if (t) - return t.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(de.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (de.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let St = Ie; -Pe(St, "isInSiyuanWidget", () => de.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -Pe(St, "isInSiyuanNewWin", () => !de.isInBrowser || !de.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -Pe(St, "requireLib", (e, t = !0, r = je.BasePathType_None) => { - if (!de.hasNodeEnv()) - throw new Error("require ony works on node env"); - let a = e; - if (!t) - switch (r) { - case je.BasePathType_Appearance: - a = Ie.joinPath(Ie.siyuanAppearancePath(), e); - break; - case je.BasePathType_Data: - a = Ie.joinPath(Ie.siyuanDataPath(), e); - break; - case je.BasePathType_Themes: - a = Ie.joinPath(Ie.siyuanAppearancePath(), "themes", e); - break; - case je.BasePathType_ZhiTheme: - a = Ie.joinPath(Ie.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const s = Ie.siyuanWindow(); - if (!s) - return require(a); - if (typeof s.require < "u") - return s.require(a); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -Pe(St, "requireAppearanceLib", (e) => Ie.requireLib(e, !1, je.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -Pe(St, "requireDataLib", (e) => Ie.requireLib(e, !1, je.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -Pe(St, "requireThemesLib", (e) => Ie.requireLib(e, !1, je.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -Pe(St, "requireZhiThemeLib", (e) => Ie.requireLib(e, !1, je.BasePathType_ZhiTheme)); -const Ge = { - white: (e) => de.isElectron() ? Ue.whiteBright(e) : re.white(e), - gray: (e) => de.isElectron() ? Ue.gray(e) : re.gray(e), - blue: (e) => de.isElectron() ? Ue.blue(e) : re.blue(e), - green: (e) => de.isElectron() ? Ue.green(e) : re.green(e), - yellow: (e) => de.isElectron() ? Ue.yellow(e) : re.yellow(e), - red: (e) => de.isElectron() ? Ue.red(e) : re.red(e), - bgWhite: (e) => de.isElectron() ? Ue.bgWhiteBright(e) : re.bgWhite(e), - bgGrey: (e) => de.isElectron() ? Ue.bgCyanBright(e) : re.bgCyan(e), - bgBlue: (e) => de.isElectron() ? Ue.bgBlueBright(e) : re.bgBlue(e), - bgGreen: (e) => de.isElectron() ? Ue.bgGreenBright(e) : re.bgGreen(e), - bgYellow: (e) => de.isElectron() ? Ue.bgYellowBright(e) : re.bgYellow(e), - bgRed: (e) => de.isElectron() ? Ue.bgRedBright(e) : re.bgRed(e) -}; -class zu { - constructor(t, r, a) { - Ut(this, "consoleLogger", "console"), Ut(this, "stackSize", 1), Ut(this, "getLogger", (d) => { - let b; - if (d) - b = d; - else { - const _ = this.getCallStack(), y = [], m = []; - for (let k = 0; k < _.length; k++) { - const N = _[k], A = N.getFileName() ?? "none"; - if (k > this.stackSize - 1) - break; - const j = A + "-" + N.getLineNumber() + ":" + N.getColumnNumber(); - y.push(j); - } - m.length > 0 && (b = y.join(" -> ")); - } - return (!b || b.trim().length === 0) && (b = this.consoleLogger), jr.getLogger(b); - }), this.stackSize = 1; - let s; - t ? s = t : s = Hr.getEnvLevel(a), s = s ?? st.LOG_LEVEL_INFO, jr.setLevel(s); - const l = (d, b, _, y) => { - const m = [], k = r ?? Hr.getEnvLogger(a) ?? "zhi"; - return m.push(Ge.gray("[") + y(k) + Ge.gray("]")), m.push(Ge.gray("[") + Ge.gray(_.toString()) + Ge.gray("]")), m.push(y(d.toUpperCase().toString())), m.push(y(b)), m.push(Ge.gray(":")), m; - }; - qn.reg(jr), qn.apply(jr, { - format(d, b, _) { - let y = []; - const m = b ?? ""; - switch (d) { - case st.LOG_LEVEL_TRACE: - y = l(d, m, _, Ge.gray); - break; - case st.LOG_LEVEL_DEBUG: - y = l(d, m, _, Ge.blue); - break; - case st.LOG_LEVEL_INFO: - y = l(d, m, _, Ge.green); - break; - case st.LOG_LEVEL_WARN: - y = l(d, m, _, Ge.yellow); - break; - case st.LOG_LEVEL_ERROR: - y = l(d, m, _, Ge.red); - break; - default: - y = l(st.LOG_LEVEL_INFO, m, _, Ge.green); - break; - } - return y.join(" "); - } - }); - } - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(t) { - this.stackSize = t ?? 1; - } - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack() { - let t; - try { - t = Nu(); - } catch { - t = []; - } - return t; - } -} -class Vu { - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - constructor(t, r, a) { - Ut(this, "logger"), this.logger = new zu(t, r, a); - } - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - getLogger(t, r) { - return this.logger.setStackSize(r), this.logger.getLogger(t); - } -} -class Kn extends Vu { - constructor(t, r, a) { - super(t, r, a); - } - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(t, r) { - return super.getLogger(t, r); - } -} -class an { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(t, r) { - return an.customLogFactory(void 0, void 0, t).getLogger(void 0, r); - } - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(t, r, a) { - return new Kn(t, r, a); - } - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(t, r) { - return new Kn(void 0, t, r); - } -} -const Fu = "zhi"; -class Dr { - /** - * 某些情况下,可能需要手动 init 之后才能用 - */ - static initEnv(t) { - this.env = t; - } - /** - * 获取 zhi-env 实例 - 必须在使用的时候重写此方法 - * - * ``` - * if (!this.env) { - * this.env = new Env({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false}) - * } - * return this.env - * ``` - * - * @see {@link https://github.com/terwer/zhi/tree/main/apps/zhi-env#usage docs for zhi-env usage} - */ - static zhiEnv() { - throw new Error("Method 'zhiEnv' must be implemented"); - } - /** - * 获取 zhi-log 实例 - * - * @param sign - 标志 - * @param loggerName - 日志名称 - */ - static zhiLogWithSign(t, r) { - if (this.loggerMap[r]) - return this.loggerMap[r].debug("Zhi-log use cache"), this.loggerMap[r]; - const a = this.env, s = an.customSignLogFactory(t, a).getLogger(r); - return this.loggerMap[r] = s, s.debug("Zhi-log add new logger"), s; - } - /** - * 获取 zhi-log 实例 - * - * @param loggerName - 日志名称 - */ - static zhiLog(t) { - return this.zhiLogWithSign(Fu, t); - } - /** - * 获取 zhi-common 实例 - */ - static zhiCommon() { - return this.common || (this.common = new Ku()), this.common; - } -} -Te(Dr, "env"), /** -* zhi-util 的日志器缓存 -*/ -Te(Dr, "loggerMap", {}), /** -* zhi-util 的通用工具类 -*/ -Te(Dr, "common"); -class nn extends Dr { - static zhiEnv() { - return this.env || (this.env = new Su({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 })), this.env; - } -} -class Wn { - constructor() { - Te(this, "logger"), this.logger = nn.zhiLog("lute-adaptor"), Lute ? this.logger.debug("Detected Lute is bundled, will use!") : this.logger.debug("Lute is not available!"); - } - isAvailable() { - return typeof Lute < "u"; - } - /** - * 高亮关键字 - * - * @param str - 字符串 - * @private - */ - highlightWords(t) { - const r = new RegExp("(?<=^|[\\s\\S])==([^\\n]+?)==(?=($|[\\s\\S]))", "g"); - return t.replace(r, '$1'); - } - /** - * 渲染Markdown - * - * @param md - Markdown - */ - async renderMarkdownStr(t) { - if (!this.isAvailable()) - return this.logger.error("Lute is not available, will return original md"), t; - const r = Lute, a = r.New(), s = { - renderText: (l, d) => d ? [this.highlightWords(l.Text()), r.WalkContinue] : ["", r.WalkContinue] - // renderStrong: (node: any, entering: any) => { - // return ["", luteObj.WalkContinue] - // }, - // renderParagraph: (node: any, entering: any) => { - // return ["", luteObj.WalkContinue] - // } - }; - return a.SetJSRenderers({ - renderers: { - Md2HTML: s - } - }), this.logger.info("Lute is rendering md to HTML..."), a.MarkdownStr("", t); - } -} -var Zo = { exports: {} }; -(function(e) { - (function() { - function t(n) { - var i = { - omitExtraWLInCodeBlocks: { - defaultValue: !1, - describe: "Omit the default extra whiteline added to code blocks", - type: "boolean" - }, - noHeaderId: { - defaultValue: !1, - describe: "Turn on/off generated header id", - type: "boolean" - }, - prefixHeaderId: { - defaultValue: !1, - describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix", - type: "string" - }, - rawPrefixHeaderId: { - defaultValue: !1, - describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)', - type: "boolean" - }, - ghCompatibleHeaderId: { - defaultValue: !1, - describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)", - type: "boolean" - }, - rawHeaderId: { - defaultValue: !1, - describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`, - type: "boolean" - }, - headerLevelStart: { - defaultValue: !1, - describe: "The header blocks level start", - type: "integer" - }, - parseImgDimensions: { - defaultValue: !1, - describe: "Turn on/off image dimension parsing", - type: "boolean" - }, - simplifiedAutoLink: { - defaultValue: !1, - describe: "Turn on/off GFM autolink style", - type: "boolean" - }, - excludeTrailingPunctuationFromURLs: { - defaultValue: !1, - describe: "Excludes trailing punctuation from links generated with autoLinking", - type: "boolean" - }, - literalMidWordUnderscores: { - defaultValue: !1, - describe: "Parse midword underscores as literal underscores", - type: "boolean" - }, - literalMidWordAsterisks: { - defaultValue: !1, - describe: "Parse midword asterisks as literal asterisks", - type: "boolean" - }, - strikethrough: { - defaultValue: !1, - describe: "Turn on/off strikethrough support", - type: "boolean" - }, - tables: { - defaultValue: !1, - describe: "Turn on/off tables support", - type: "boolean" - }, - tablesHeaderId: { - defaultValue: !1, - describe: "Add an id to table headers", - type: "boolean" - }, - ghCodeBlocks: { - defaultValue: !0, - describe: "Turn on/off GFM fenced code blocks support", - type: "boolean" - }, - tasklists: { - defaultValue: !1, - describe: "Turn on/off GFM tasklist support", - type: "boolean" - }, - smoothLivePreview: { - defaultValue: !1, - describe: "Prevents weird effects in live previews due to incomplete input", - type: "boolean" - }, - smartIndentationFix: { - defaultValue: !1, - describe: "Tries to smartly fix indentation in es6 strings", - type: "boolean" - }, - disableForced4SpacesIndentedSublists: { - defaultValue: !1, - describe: "Disables the requirement of indenting nested sublists by 4 spaces", - type: "boolean" - }, - simpleLineBreaks: { - defaultValue: !1, - describe: "Parses simple line breaks as
(GFM Style)", - type: "boolean" - }, - requireSpaceBeforeHeadingText: { - defaultValue: !1, - describe: "Makes adding a space between `#` and the header text mandatory (GFM Style)", - type: "boolean" - }, - ghMentions: { - defaultValue: !1, - describe: "Enables github @mentions", - type: "boolean" - }, - ghMentionsLink: { - defaultValue: "https://github.com/{u}", - describe: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.", - type: "string" - }, - encodeEmails: { - defaultValue: !0, - describe: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities", - type: "boolean" - }, - openLinksInNewWindow: { - defaultValue: !1, - describe: "Open all links in new windows", - type: "boolean" - }, - backslashEscapesHTMLTags: { - defaultValue: !1, - describe: "Support for HTML Tag escaping. ex:
foo
", - type: "boolean" - }, - emoji: { - defaultValue: !1, - describe: "Enable emoji support. Ex: `this is a :smile: emoji`", - type: "boolean" - }, - underline: { - defaultValue: !1, - describe: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``", - type: "boolean" - }, - ellipsis: { - defaultValue: !0, - describe: "Replaces three dots with the ellipsis unicode character", - type: "boolean" - }, - completeHTMLDocument: { - defaultValue: !1, - describe: "Outputs a complete html document, including ``, `` and `` tags", - type: "boolean" - }, - metadata: { - defaultValue: !1, - describe: "Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).", - type: "boolean" - }, - splitAdjacentBlockquotes: { - defaultValue: !1, - describe: "Split adjacent blockquote blocks", - type: "boolean" - } - }; - if (n === !1) - return JSON.parse(JSON.stringify(i)); - var o = {}; - for (var c in i) - i.hasOwnProperty(c) && (o[c] = i[c].defaultValue); - return o; - } - function r() { - var n = t(!0), i = {}; - for (var o in n) - n.hasOwnProperty(o) && (i[o] = !0); - return i; - } - var a = {}, s = {}, l = {}, d = t(!0), b = "vanilla", _ = { - github: { - omitExtraWLInCodeBlocks: !0, - simplifiedAutoLink: !0, - excludeTrailingPunctuationFromURLs: !0, - literalMidWordUnderscores: !0, - strikethrough: !0, - tables: !0, - tablesHeaderId: !0, - ghCodeBlocks: !0, - tasklists: !0, - disableForced4SpacesIndentedSublists: !0, - simpleLineBreaks: !0, - requireSpaceBeforeHeadingText: !0, - ghCompatibleHeaderId: !0, - ghMentions: !0, - backslashEscapesHTMLTags: !0, - emoji: !0, - splitAdjacentBlockquotes: !0 - }, - original: { - noHeaderId: !0, - ghCodeBlocks: !1 - }, - ghost: { - omitExtraWLInCodeBlocks: !0, - parseImgDimensions: !0, - simplifiedAutoLink: !0, - excludeTrailingPunctuationFromURLs: !0, - literalMidWordUnderscores: !0, - strikethrough: !0, - tables: !0, - tablesHeaderId: !0, - ghCodeBlocks: !0, - tasklists: !0, - smoothLivePreview: !0, - simpleLineBreaks: !0, - requireSpaceBeforeHeadingText: !0, - ghMentions: !1, - encodeEmails: !0 - }, - vanilla: t(!0), - allOn: r() - }; - a.helper = {}, a.extensions = {}, a.setOption = function(n, i) { - return d[n] = i, this; - }, a.getOption = function(n) { - return d[n]; - }, a.getOptions = function() { - return d; - }, a.resetOptions = function() { - d = t(!0); - }, a.setFlavor = function(n) { - if (!_.hasOwnProperty(n)) - throw Error(n + " flavor was not found"); - a.resetOptions(); - var i = _[n]; - b = n; - for (var o in i) - i.hasOwnProperty(o) && (d[o] = i[o]); - }, a.getFlavor = function() { - return b; - }, a.getFlavorOptions = function(n) { - if (_.hasOwnProperty(n)) - return _[n]; - }, a.getDefaultOptions = function(n) { - return t(n); - }, a.subParser = function(n, i) { - if (a.helper.isString(n)) - if (typeof i < "u") - s[n] = i; - else { - if (s.hasOwnProperty(n)) - return s[n]; - throw Error("SubParser named " + n + " not registered!"); - } - }, a.extension = function(n, i) { - if (!a.helper.isString(n)) - throw Error("Extension 'name' must be a string"); - if (n = a.helper.stdExtName(n), a.helper.isUndefined(i)) { - if (!l.hasOwnProperty(n)) - throw Error("Extension named " + n + " is not registered!"); - return l[n]; - } else { - typeof i == "function" && (i = i()), a.helper.isArray(i) || (i = [i]); - var o = y(i, n); - if (o.valid) - l[n] = i; - else - throw Error(o.error); - } - }, a.getAllExtensions = function() { - return l; - }, a.removeExtension = function(n) { - delete l[n]; - }, a.resetExtensions = function() { - l = {}; - }; - function y(n, i) { - var o = i ? "Error in " + i + " extension->" : "Error in unnamed extension", c = { - valid: !0, - error: "" - }; - a.helper.isArray(n) || (n = [n]); - for (var u = 0; u < n.length; ++u) { - var f = o + " sub-extension " + u + ": ", g = n[u]; - if (typeof g != "object") - return c.valid = !1, c.error = f + "must be an object, but " + typeof g + " given", c; - if (!a.helper.isString(g.type)) - return c.valid = !1, c.error = f + 'property "type" must be a string, but ' + typeof g.type + " given", c; - var O = g.type = g.type.toLowerCase(); - if (O === "language" && (O = g.type = "lang"), O === "html" && (O = g.type = "output"), O !== "lang" && O !== "output" && O !== "listener") - return c.valid = !1, c.error = f + "type " + O + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"', c; - if (O === "listener") { - if (a.helper.isUndefined(g.listeners)) - return c.valid = !1, c.error = f + '. Extensions of type "listener" must have a property called "listeners"', c; - } else if (a.helper.isUndefined(g.filter) && a.helper.isUndefined(g.regex)) - return c.valid = !1, c.error = f + O + ' extensions must define either a "regex" property or a "filter" method', c; - if (g.listeners) { - if (typeof g.listeners != "object") - return c.valid = !1, c.error = f + '"listeners" property must be an object but ' + typeof g.listeners + " given", c; - for (var z in g.listeners) - if (g.listeners.hasOwnProperty(z) && typeof g.listeners[z] != "function") - return c.valid = !1, c.error = f + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + z + " must be a function but " + typeof g.listeners[z] + " given", c; - } - if (g.filter) { - if (typeof g.filter != "function") - return c.valid = !1, c.error = f + '"filter" must be a function, but ' + typeof g.filter + " given", c; - } else if (g.regex) { - if (a.helper.isString(g.regex) && (g.regex = new RegExp(g.regex, "g")), !(g.regex instanceof RegExp)) - return c.valid = !1, c.error = f + '"regex" property must either be a string or a RegExp object, but ' + typeof g.regex + " given", c; - if (a.helper.isUndefined(g.replace)) - return c.valid = !1, c.error = f + '"regex" extensions must implement a replace string or function', c; - } - } - return c; - } - a.validateExtension = function(n) { - var i = y(n, null); - return i.valid ? !0 : (console.warn(i.error), !1); - }, a.hasOwnProperty("helper") || (a.helper = {}), a.helper.isString = function(n) { - return typeof n == "string" || n instanceof String; - }, a.helper.isFunction = function(n) { - var i = {}; - return n && i.toString.call(n) === "[object Function]"; - }, a.helper.isArray = function(n) { - return Array.isArray(n); - }, a.helper.isUndefined = function(n) { - return typeof n > "u"; - }, a.helper.forEach = function(n, i) { - if (a.helper.isUndefined(n)) - throw new Error("obj param is required"); - if (a.helper.isUndefined(i)) - throw new Error("callback param is required"); - if (!a.helper.isFunction(i)) - throw new Error("callback param must be a function/closure"); - if (typeof n.forEach == "function") - n.forEach(i); - else if (a.helper.isArray(n)) - for (var o = 0; o < n.length; o++) - i(n[o], o, n); - else if (typeof n == "object") - for (var c in n) - n.hasOwnProperty(c) && i(n[c], c, n); - else - throw new Error("obj does not seem to be an array or an iterable object"); - }, a.helper.stdExtName = function(n) { - return n.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase(); - }; - function m(n, i) { - var o = i.charCodeAt(0); - return "¨E" + o + "E"; - } - a.helper.escapeCharactersCallback = m, a.helper.escapeCharacters = function(n, i, o) { - var c = "([" + i.replace(/([\[\]\\])/g, "\\$1") + "])"; - o && (c = "\\\\" + c); - var u = new RegExp(c, "g"); - return n = n.replace(u, m), n; - }, a.helper.unescapeHTMLEntities = function(n) { - return n.replace(/"/g, '"').replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"); - }; - var k = function(n, i, o, c) { - var u = c || "", f = u.indexOf("g") > -1, g = new RegExp(i + "|" + o, "g" + u.replace(/g/g, "")), O = new RegExp(i, u.replace(/g/g, "")), z = [], q, B, G, w, U; - do - for (q = 0; G = g.exec(n); ) - if (O.test(G[0])) - q++ || (B = g.lastIndex, w = B - G[0].length); - else if (q && !--q) { - U = G.index + G[0].length; - var W = { - left: { start: w, end: B }, - match: { start: B, end: G.index }, - right: { start: G.index, end: U }, - wholeMatch: { start: w, end: U } - }; - if (z.push(W), !f) - return z; - } - while (q && (g.lastIndex = B)); - return z; - }; - a.helper.matchRecursiveRegExp = function(n, i, o, c) { - for (var u = k(n, i, o, c), f = [], g = 0; g < u.length; ++g) - f.push([ - n.slice(u[g].wholeMatch.start, u[g].wholeMatch.end), - n.slice(u[g].match.start, u[g].match.end), - n.slice(u[g].left.start, u[g].left.end), - n.slice(u[g].right.start, u[g].right.end) - ]); - return f; - }, a.helper.replaceRecursiveRegExp = function(n, i, o, c, u) { - if (!a.helper.isFunction(i)) { - var f = i; - i = function() { - return f; - }; - } - var g = k(n, o, c, u), O = n, z = g.length; - if (z > 0) { - var q = []; - g[0].wholeMatch.start !== 0 && q.push(n.slice(0, g[0].wholeMatch.start)); - for (var B = 0; B < z; ++B) - q.push( - i( - n.slice(g[B].wholeMatch.start, g[B].wholeMatch.end), - n.slice(g[B].match.start, g[B].match.end), - n.slice(g[B].left.start, g[B].left.end), - n.slice(g[B].right.start, g[B].right.end) - ) - ), B < z - 1 && q.push(n.slice(g[B].wholeMatch.end, g[B + 1].wholeMatch.start)); - g[z - 1].wholeMatch.end < n.length && q.push(n.slice(g[z - 1].wholeMatch.end)), O = q.join(""); - } - return O; - }, a.helper.regexIndexOf = function(n, i, o) { - if (!a.helper.isString(n)) - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; - if (!(i instanceof RegExp)) - throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp"; - var c = n.substring(o || 0).search(i); - return c >= 0 ? c + (o || 0) : c; - }, a.helper.splitAtIndex = function(n, i) { - if (!a.helper.isString(n)) - throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; - return [n.substring(0, i), n.substring(i)]; - }, a.helper.encodeEmailAddress = function(n) { - var i = [ - function(o) { - return "&#" + o.charCodeAt(0) + ";"; - }, - function(o) { - return "&#x" + o.charCodeAt(0).toString(16) + ";"; - }, - function(o) { - return o; - } - ]; - return n = n.replace(/./g, function(o) { - if (o === "@") - o = i[Math.floor(Math.random() * 2)](o); - else { - var c = Math.random(); - o = c > 0.9 ? i[2](o) : c > 0.45 ? i[1](o) : i[0](o); - } - return o; - }), n; - }, a.helper.padEnd = function(n, i, o) { - return i = i >> 0, o = String(o || " "), n.length > i ? String(n) : (i = i - n.length, i > o.length && (o += o.repeat(i / o.length)), String(n) + o.slice(0, i)); - }, typeof console > "u" && (console = { - warn: function(n) { - alert(n); - }, - log: function(n) { - alert(n); - }, - error: function(n) { - throw n; - } - }), a.helper.regexes = { - asteriskDashAndColon: /([*_:~])/g - }, a.helper.emojis = { - "+1": "👍", - "-1": "👎", - 100: "💯", - 1234: "🔢", - "1st_place_medal": "🥇", - "2nd_place_medal": "🥈", - "3rd_place_medal": "🥉", - "8ball": "🎱", - a: "🅰️", - ab: "🆎", - abc: "🔤", - abcd: "🔡", - accept: "🉑", - aerial_tramway: "🚡", - airplane: "✈️", - alarm_clock: "⏰", - alembic: "⚗️", - alien: "👽", - ambulance: "🚑", - amphora: "🏺", - anchor: "⚓️", - angel: "👼", - anger: "💢", - angry: "😠", - anguished: "😧", - ant: "🐜", - apple: "🍎", - aquarius: "♒️", - aries: "♈️", - arrow_backward: "◀️", - arrow_double_down: "⏬", - arrow_double_up: "⏫", - arrow_down: "⬇️", - arrow_down_small: "🔽", - arrow_forward: "▶️", - arrow_heading_down: "⤵️", - arrow_heading_up: "⤴️", - arrow_left: "⬅️", - arrow_lower_left: "↙️", - arrow_lower_right: "↘️", - arrow_right: "➡️", - arrow_right_hook: "↪️", - arrow_up: "⬆️", - arrow_up_down: "↕️", - arrow_up_small: "🔼", - arrow_upper_left: "↖️", - arrow_upper_right: "↗️", - arrows_clockwise: "🔃", - arrows_counterclockwise: "🔄", - art: "🎨", - articulated_lorry: "🚛", - artificial_satellite: "🛰", - astonished: "😲", - athletic_shoe: "👟", - atm: "🏧", - atom_symbol: "⚛️", - avocado: "🥑", - b: "🅱️", - baby: "👶", - baby_bottle: "🍼", - baby_chick: "🐤", - baby_symbol: "🚼", - back: "🔙", - bacon: "🥓", - badminton: "🏸", - baggage_claim: "🛄", - baguette_bread: "🥖", - balance_scale: "⚖️", - balloon: "🎈", - ballot_box: "🗳", - ballot_box_with_check: "☑️", - bamboo: "🎍", - banana: "🍌", - bangbang: "‼️", - bank: "🏦", - bar_chart: "📊", - barber: "💈", - baseball: "⚾️", - basketball: "🏀", - basketball_man: "⛹️", - basketball_woman: "⛹️‍♀️", - bat: "🦇", - bath: "🛀", - bathtub: "🛁", - battery: "🔋", - beach_umbrella: "🏖", - bear: "🐻", - bed: "🛏", - bee: "🐝", - beer: "🍺", - beers: "🍻", - beetle: "🐞", - beginner: "🔰", - bell: "🔔", - bellhop_bell: "🛎", - bento: "🍱", - biking_man: "🚴", - bike: "🚲", - biking_woman: "🚴‍♀️", - bikini: "👙", - biohazard: "☣️", - bird: "🐦", - birthday: "🎂", - black_circle: "⚫️", - black_flag: "🏴", - black_heart: "🖤", - black_joker: "🃏", - black_large_square: "⬛️", - black_medium_small_square: "◾️", - black_medium_square: "◼️", - black_nib: "✒️", - black_small_square: "▪️", - black_square_button: "🔲", - blonde_man: "👱", - blonde_woman: "👱‍♀️", - blossom: "🌼", - blowfish: "🐡", - blue_book: "📘", - blue_car: "🚙", - blue_heart: "💙", - blush: "😊", - boar: "🐗", - boat: "⛵️", - bomb: "💣", - book: "📖", - bookmark: "🔖", - bookmark_tabs: "📑", - books: "📚", - boom: "💥", - boot: "👢", - bouquet: "💐", - bowing_man: "🙇", - bow_and_arrow: "🏹", - bowing_woman: "🙇‍♀️", - bowling: "🎳", - boxing_glove: "🥊", - boy: "👦", - bread: "🍞", - bride_with_veil: "👰", - bridge_at_night: "🌉", - briefcase: "💼", - broken_heart: "💔", - bug: "🐛", - building_construction: "🏗", - bulb: "💡", - bullettrain_front: "🚅", - bullettrain_side: "🚄", - burrito: "🌯", - bus: "🚌", - business_suit_levitating: "🕴", - busstop: "🚏", - bust_in_silhouette: "👤", - busts_in_silhouette: "👥", - butterfly: "🦋", - cactus: "🌵", - cake: "🍰", - calendar: "📆", - call_me_hand: "🤙", - calling: "📲", - camel: "🐫", - camera: "📷", - camera_flash: "📸", - camping: "🏕", - cancer: "♋️", - candle: "🕯", - candy: "🍬", - canoe: "🛶", - capital_abcd: "🔠", - capricorn: "♑️", - car: "🚗", - card_file_box: "🗃", - card_index: "📇", - card_index_dividers: "🗂", - carousel_horse: "🎠", - carrot: "🥕", - cat: "🐱", - cat2: "🐈", - cd: "💿", - chains: "⛓", - champagne: "🍾", - chart: "💹", - chart_with_downwards_trend: "📉", - chart_with_upwards_trend: "📈", - checkered_flag: "🏁", - cheese: "🧀", - cherries: "🍒", - cherry_blossom: "🌸", - chestnut: "🌰", - chicken: "🐔", - children_crossing: "🚸", - chipmunk: "🐿", - chocolate_bar: "🍫", - christmas_tree: "🎄", - church: "⛪️", - cinema: "🎦", - circus_tent: "🎪", - city_sunrise: "🌇", - city_sunset: "🌆", - cityscape: "🏙", - cl: "🆑", - clamp: "🗜", - clap: "👏", - clapper: "🎬", - classical_building: "🏛", - clinking_glasses: "🥂", - clipboard: "📋", - clock1: "🕐", - clock10: "🕙", - clock1030: "🕥", - clock11: "🕚", - clock1130: "🕦", - clock12: "🕛", - clock1230: "🕧", - clock130: "🕜", - clock2: "🕑", - clock230: "🕝", - clock3: "🕒", - clock330: "🕞", - clock4: "🕓", - clock430: "🕟", - clock5: "🕔", - clock530: "🕠", - clock6: "🕕", - clock630: "🕡", - clock7: "🕖", - clock730: "🕢", - clock8: "🕗", - clock830: "🕣", - clock9: "🕘", - clock930: "🕤", - closed_book: "📕", - closed_lock_with_key: "🔐", - closed_umbrella: "🌂", - cloud: "☁️", - cloud_with_lightning: "🌩", - cloud_with_lightning_and_rain: "⛈", - cloud_with_rain: "🌧", - cloud_with_snow: "🌨", - clown_face: "🤡", - clubs: "♣️", - cocktail: "🍸", - coffee: "☕️", - coffin: "⚰️", - cold_sweat: "😰", - comet: "☄️", - computer: "💻", - computer_mouse: "🖱", - confetti_ball: "🎊", - confounded: "😖", - confused: "😕", - congratulations: "㊗️", - construction: "🚧", - construction_worker_man: "👷", - construction_worker_woman: "👷‍♀️", - control_knobs: "🎛", - convenience_store: "🏪", - cookie: "🍪", - cool: "🆒", - policeman: "👮", - copyright: "©️", - corn: "🌽", - couch_and_lamp: "🛋", - couple: "👫", - couple_with_heart_woman_man: "💑", - couple_with_heart_man_man: "👨‍❤️‍👨", - couple_with_heart_woman_woman: "👩‍❤️‍👩", - couplekiss_man_man: "👨‍❤️‍💋‍👨", - couplekiss_man_woman: "💏", - couplekiss_woman_woman: "👩‍❤️‍💋‍👩", - cow: "🐮", - cow2: "🐄", - cowboy_hat_face: "🤠", - crab: "🦀", - crayon: "🖍", - credit_card: "💳", - crescent_moon: "🌙", - cricket: "🏏", - crocodile: "🐊", - croissant: "🥐", - crossed_fingers: "🤞", - crossed_flags: "🎌", - crossed_swords: "⚔️", - crown: "👑", - cry: "😢", - crying_cat_face: "😿", - crystal_ball: "🔮", - cucumber: "🥒", - cupid: "💘", - curly_loop: "➰", - currency_exchange: "💱", - curry: "🍛", - custard: "🍮", - customs: "🛃", - cyclone: "🌀", - dagger: "🗡", - dancer: "💃", - dancing_women: "👯", - dancing_men: "👯‍♂️", - dango: "🍡", - dark_sunglasses: "🕶", - dart: "🎯", - dash: "💨", - date: "📅", - deciduous_tree: "🌳", - deer: "🦌", - department_store: "🏬", - derelict_house: "🏚", - desert: "🏜", - desert_island: "🏝", - desktop_computer: "🖥", - male_detective: "🕵️", - diamond_shape_with_a_dot_inside: "💠", - diamonds: "♦️", - disappointed: "😞", - disappointed_relieved: "😥", - dizzy: "💫", - dizzy_face: "😵", - do_not_litter: "🚯", - dog: "🐶", - dog2: "🐕", - dollar: "💵", - dolls: "🎎", - dolphin: "🐬", - door: "🚪", - doughnut: "🍩", - dove: "🕊", - dragon: "🐉", - dragon_face: "🐲", - dress: "👗", - dromedary_camel: "🐪", - drooling_face: "🤤", - droplet: "💧", - drum: "🥁", - duck: "🦆", - dvd: "📀", - "e-mail": "📧", - eagle: "🦅", - ear: "👂", - ear_of_rice: "🌾", - earth_africa: "🌍", - earth_americas: "🌎", - earth_asia: "🌏", - egg: "🥚", - eggplant: "🍆", - eight_pointed_black_star: "✴️", - eight_spoked_asterisk: "✳️", - electric_plug: "🔌", - elephant: "🐘", - email: "✉️", - end: "🔚", - envelope_with_arrow: "📩", - euro: "💶", - european_castle: "🏰", - european_post_office: "🏤", - evergreen_tree: "🌲", - exclamation: "❗️", - expressionless: "😑", - eye: "👁", - eye_speech_bubble: "👁‍🗨", - eyeglasses: "👓", - eyes: "👀", - face_with_head_bandage: "🤕", - face_with_thermometer: "🤒", - fist_oncoming: "👊", - factory: "🏭", - fallen_leaf: "🍂", - family_man_woman_boy: "👪", - family_man_boy: "👨‍👦", - family_man_boy_boy: "👨‍👦‍👦", - family_man_girl: "👨‍👧", - family_man_girl_boy: "👨‍👧‍👦", - family_man_girl_girl: "👨‍👧‍👧", - family_man_man_boy: "👨‍👨‍👦", - family_man_man_boy_boy: "👨‍👨‍👦‍👦", - family_man_man_girl: "👨‍👨‍👧", - family_man_man_girl_boy: "👨‍👨‍👧‍👦", - family_man_man_girl_girl: "👨‍👨‍👧‍👧", - family_man_woman_boy_boy: "👨‍👩‍👦‍👦", - family_man_woman_girl: "👨‍👩‍👧", - family_man_woman_girl_boy: "👨‍👩‍👧‍👦", - family_man_woman_girl_girl: "👨‍👩‍👧‍👧", - family_woman_boy: "👩‍👦", - family_woman_boy_boy: "👩‍👦‍👦", - family_woman_girl: "👩‍👧", - family_woman_girl_boy: "👩‍👧‍👦", - family_woman_girl_girl: "👩‍👧‍👧", - family_woman_woman_boy: "👩‍👩‍👦", - family_woman_woman_boy_boy: "👩‍👩‍👦‍👦", - family_woman_woman_girl: "👩‍👩‍👧", - family_woman_woman_girl_boy: "👩‍👩‍👧‍👦", - family_woman_woman_girl_girl: "👩‍👩‍👧‍👧", - fast_forward: "⏩", - fax: "📠", - fearful: "😨", - feet: "🐾", - female_detective: "🕵️‍♀️", - ferris_wheel: "🎡", - ferry: "⛴", - field_hockey: "🏑", - file_cabinet: "🗄", - file_folder: "📁", - film_projector: "📽", - film_strip: "🎞", - fire: "🔥", - fire_engine: "🚒", - fireworks: "🎆", - first_quarter_moon: "🌓", - first_quarter_moon_with_face: "🌛", - fish: "🐟", - fish_cake: "🍥", - fishing_pole_and_fish: "🎣", - fist_raised: "✊", - fist_left: "🤛", - fist_right: "🤜", - flags: "🎏", - flashlight: "🔦", - fleur_de_lis: "⚜️", - flight_arrival: "🛬", - flight_departure: "🛫", - floppy_disk: "💾", - flower_playing_cards: "🎴", - flushed: "😳", - fog: "🌫", - foggy: "🌁", - football: "🏈", - footprints: "👣", - fork_and_knife: "🍴", - fountain: "⛲️", - fountain_pen: "🖋", - four_leaf_clover: "🍀", - fox_face: "🦊", - framed_picture: "🖼", - free: "🆓", - fried_egg: "🍳", - fried_shrimp: "🍤", - fries: "🍟", - frog: "🐸", - frowning: "😦", - frowning_face: "☹️", - frowning_man: "🙍‍♂️", - frowning_woman: "🙍", - middle_finger: "🖕", - fuelpump: "⛽️", - full_moon: "🌕", - full_moon_with_face: "🌝", - funeral_urn: "⚱️", - game_die: "🎲", - gear: "⚙️", - gem: "💎", - gemini: "♊️", - ghost: "👻", - gift: "🎁", - gift_heart: "💝", - girl: "👧", - globe_with_meridians: "🌐", - goal_net: "🥅", - goat: "🐐", - golf: "⛳️", - golfing_man: "🏌️", - golfing_woman: "🏌️‍♀️", - gorilla: "🦍", - grapes: "🍇", - green_apple: "🍏", - green_book: "📗", - green_heart: "💚", - green_salad: "🥗", - grey_exclamation: "❕", - grey_question: "❔", - grimacing: "😬", - grin: "😁", - grinning: "😀", - guardsman: "💂", - guardswoman: "💂‍♀️", - guitar: "🎸", - gun: "🔫", - haircut_woman: "💇", - haircut_man: "💇‍♂️", - hamburger: "🍔", - hammer: "🔨", - hammer_and_pick: "⚒", - hammer_and_wrench: "🛠", - hamster: "🐹", - hand: "✋", - handbag: "👜", - handshake: "🤝", - hankey: "💩", - hatched_chick: "🐥", - hatching_chick: "🐣", - headphones: "🎧", - hear_no_evil: "🙉", - heart: "❤️", - heart_decoration: "💟", - heart_eyes: "😍", - heart_eyes_cat: "😻", - heartbeat: "💓", - heartpulse: "💗", - hearts: "♥️", - heavy_check_mark: "✔️", - heavy_division_sign: "➗", - heavy_dollar_sign: "💲", - heavy_heart_exclamation: "❣️", - heavy_minus_sign: "➖", - heavy_multiplication_x: "✖️", - heavy_plus_sign: "➕", - helicopter: "🚁", - herb: "🌿", - hibiscus: "🌺", - high_brightness: "🔆", - high_heel: "👠", - hocho: "🔪", - hole: "🕳", - honey_pot: "🍯", - horse: "🐴", - horse_racing: "🏇", - hospital: "🏥", - hot_pepper: "🌶", - hotdog: "🌭", - hotel: "🏨", - hotsprings: "♨️", - hourglass: "⌛️", - hourglass_flowing_sand: "⏳", - house: "🏠", - house_with_garden: "🏡", - houses: "🏘", - hugs: "🤗", - hushed: "😯", - ice_cream: "🍨", - ice_hockey: "🏒", - ice_skate: "⛸", - icecream: "🍦", - id: "🆔", - ideograph_advantage: "🉐", - imp: "👿", - inbox_tray: "📥", - incoming_envelope: "📨", - tipping_hand_woman: "💁", - information_source: "ℹ️", - innocent: "😇", - interrobang: "⁉️", - iphone: "📱", - izakaya_lantern: "🏮", - jack_o_lantern: "🎃", - japan: "🗾", - japanese_castle: "🏯", - japanese_goblin: "👺", - japanese_ogre: "👹", - jeans: "👖", - joy: "😂", - joy_cat: "😹", - joystick: "🕹", - kaaba: "🕋", - key: "🔑", - keyboard: "⌨️", - keycap_ten: "🔟", - kick_scooter: "🛴", - kimono: "👘", - kiss: "💋", - kissing: "😗", - kissing_cat: "😽", - kissing_closed_eyes: "😚", - kissing_heart: "😘", - kissing_smiling_eyes: "😙", - kiwi_fruit: "🥝", - koala: "🐨", - koko: "🈁", - label: "🏷", - large_blue_circle: "🔵", - large_blue_diamond: "🔷", - large_orange_diamond: "🔶", - last_quarter_moon: "🌗", - last_quarter_moon_with_face: "🌜", - latin_cross: "✝️", - laughing: "😆", - leaves: "🍃", - ledger: "📒", - left_luggage: "🛅", - left_right_arrow: "↔️", - leftwards_arrow_with_hook: "↩️", - lemon: "🍋", - leo: "♌️", - leopard: "🐆", - level_slider: "🎚", - libra: "♎️", - light_rail: "🚈", - link: "🔗", - lion: "🦁", - lips: "👄", - lipstick: "💄", - lizard: "🦎", - lock: "🔒", - lock_with_ink_pen: "🔏", - lollipop: "🍭", - loop: "➿", - loud_sound: "🔊", - loudspeaker: "📢", - love_hotel: "🏩", - love_letter: "💌", - low_brightness: "🔅", - lying_face: "🤥", - m: "Ⓜ️", - mag: "🔍", - mag_right: "🔎", - mahjong: "🀄️", - mailbox: "📫", - mailbox_closed: "📪", - mailbox_with_mail: "📬", - mailbox_with_no_mail: "📭", - man: "👨", - man_artist: "👨‍🎨", - man_astronaut: "👨‍🚀", - man_cartwheeling: "🤸‍♂️", - man_cook: "👨‍🍳", - man_dancing: "🕺", - man_facepalming: "🤦‍♂️", - man_factory_worker: "👨‍🏭", - man_farmer: "👨‍🌾", - man_firefighter: "👨‍🚒", - man_health_worker: "👨‍⚕️", - man_in_tuxedo: "🤵", - man_judge: "👨‍⚖️", - man_juggling: "🤹‍♂️", - man_mechanic: "👨‍🔧", - man_office_worker: "👨‍💼", - man_pilot: "👨‍✈️", - man_playing_handball: "🤾‍♂️", - man_playing_water_polo: "🤽‍♂️", - man_scientist: "👨‍🔬", - man_shrugging: "🤷‍♂️", - man_singer: "👨‍🎤", - man_student: "👨‍🎓", - man_teacher: "👨‍🏫", - man_technologist: "👨‍💻", - man_with_gua_pi_mao: "👲", - man_with_turban: "👳", - tangerine: "🍊", - mans_shoe: "👞", - mantelpiece_clock: "🕰", - maple_leaf: "🍁", - martial_arts_uniform: "🥋", - mask: "😷", - massage_woman: "💆", - massage_man: "💆‍♂️", - meat_on_bone: "🍖", - medal_military: "🎖", - medal_sports: "🏅", - mega: "📣", - melon: "🍈", - memo: "📝", - men_wrestling: "🤼‍♂️", - menorah: "🕎", - mens: "🚹", - metal: "🤘", - metro: "🚇", - microphone: "🎤", - microscope: "🔬", - milk_glass: "🥛", - milky_way: "🌌", - minibus: "🚐", - minidisc: "💽", - mobile_phone_off: "📴", - money_mouth_face: "🤑", - money_with_wings: "💸", - moneybag: "💰", - monkey: "🐒", - monkey_face: "🐵", - monorail: "🚝", - moon: "🌔", - mortar_board: "🎓", - mosque: "🕌", - motor_boat: "🛥", - motor_scooter: "🛵", - motorcycle: "🏍", - motorway: "🛣", - mount_fuji: "🗻", - mountain: "⛰", - mountain_biking_man: "🚵", - mountain_biking_woman: "🚵‍♀️", - mountain_cableway: "🚠", - mountain_railway: "🚞", - mountain_snow: "🏔", - mouse: "🐭", - mouse2: "🐁", - movie_camera: "🎥", - moyai: "🗿", - mrs_claus: "🤶", - muscle: "💪", - mushroom: "🍄", - musical_keyboard: "🎹", - musical_note: "🎵", - musical_score: "🎼", - mute: "🔇", - nail_care: "💅", - name_badge: "📛", - national_park: "🏞", - nauseated_face: "🤢", - necktie: "👔", - negative_squared_cross_mark: "❎", - nerd_face: "🤓", - neutral_face: "😐", - new: "🆕", - new_moon: "🌑", - new_moon_with_face: "🌚", - newspaper: "📰", - newspaper_roll: "🗞", - next_track_button: "⏭", - ng: "🆖", - no_good_man: "🙅‍♂️", - no_good_woman: "🙅", - night_with_stars: "🌃", - no_bell: "🔕", - no_bicycles: "🚳", - no_entry: "⛔️", - no_entry_sign: "🚫", - no_mobile_phones: "📵", - no_mouth: "😶", - no_pedestrians: "🚷", - no_smoking: "🚭", - "non-potable_water": "🚱", - nose: "👃", - notebook: "📓", - notebook_with_decorative_cover: "📔", - notes: "🎶", - nut_and_bolt: "🔩", - o: "⭕️", - o2: "🅾️", - ocean: "🌊", - octopus: "🐙", - oden: "🍢", - office: "🏢", - oil_drum: "🛢", - ok: "🆗", - ok_hand: "👌", - ok_man: "🙆‍♂️", - ok_woman: "🙆", - old_key: "🗝", - older_man: "👴", - older_woman: "👵", - om: "🕉", - on: "🔛", - oncoming_automobile: "🚘", - oncoming_bus: "🚍", - oncoming_police_car: "🚔", - oncoming_taxi: "🚖", - open_file_folder: "📂", - open_hands: "👐", - open_mouth: "😮", - open_umbrella: "☂️", - ophiuchus: "⛎", - orange_book: "📙", - orthodox_cross: "☦️", - outbox_tray: "📤", - owl: "🦉", - ox: "🐂", - package: "📦", - page_facing_up: "📄", - page_with_curl: "📃", - pager: "📟", - paintbrush: "🖌", - palm_tree: "🌴", - pancakes: "🥞", - panda_face: "🐼", - paperclip: "📎", - paperclips: "🖇", - parasol_on_ground: "⛱", - parking: "🅿️", - part_alternation_mark: "〽️", - partly_sunny: "⛅️", - passenger_ship: "🛳", - passport_control: "🛂", - pause_button: "⏸", - peace_symbol: "☮️", - peach: "🍑", - peanuts: "🥜", - pear: "🍐", - pen: "🖊", - pencil2: "✏️", - penguin: "🐧", - pensive: "😔", - performing_arts: "🎭", - persevere: "😣", - person_fencing: "🤺", - pouting_woman: "🙎", - phone: "☎️", - pick: "⛏", - pig: "🐷", - pig2: "🐖", - pig_nose: "🐽", - pill: "💊", - pineapple: "🍍", - ping_pong: "🏓", - pisces: "♓️", - pizza: "🍕", - place_of_worship: "🛐", - plate_with_cutlery: "🍽", - play_or_pause_button: "⏯", - point_down: "👇", - point_left: "👈", - point_right: "👉", - point_up: "☝️", - point_up_2: "👆", - police_car: "🚓", - policewoman: "👮‍♀️", - poodle: "🐩", - popcorn: "🍿", - post_office: "🏣", - postal_horn: "📯", - postbox: "📮", - potable_water: "🚰", - potato: "🥔", - pouch: "👝", - poultry_leg: "🍗", - pound: "💷", - rage: "😡", - pouting_cat: "😾", - pouting_man: "🙎‍♂️", - pray: "🙏", - prayer_beads: "📿", - pregnant_woman: "🤰", - previous_track_button: "⏮", - prince: "🤴", - princess: "👸", - printer: "🖨", - purple_heart: "💜", - purse: "👛", - pushpin: "📌", - put_litter_in_its_place: "🚮", - question: "❓", - rabbit: "🐰", - rabbit2: "🐇", - racehorse: "🐎", - racing_car: "🏎", - radio: "📻", - radio_button: "🔘", - radioactive: "☢️", - railway_car: "🚃", - railway_track: "🛤", - rainbow: "🌈", - rainbow_flag: "🏳️‍🌈", - raised_back_of_hand: "🤚", - raised_hand_with_fingers_splayed: "🖐", - raised_hands: "🙌", - raising_hand_woman: "🙋", - raising_hand_man: "🙋‍♂️", - ram: "🐏", - ramen: "🍜", - rat: "🐀", - record_button: "⏺", - recycle: "♻️", - red_circle: "🔴", - registered: "®️", - relaxed: "☺️", - relieved: "😌", - reminder_ribbon: "🎗", - repeat: "🔁", - repeat_one: "🔂", - rescue_worker_helmet: "⛑", - restroom: "🚻", - revolving_hearts: "💞", - rewind: "⏪", - rhinoceros: "🦏", - ribbon: "🎀", - rice: "🍚", - rice_ball: "🍙", - rice_cracker: "🍘", - rice_scene: "🎑", - right_anger_bubble: "🗯", - ring: "💍", - robot: "🤖", - rocket: "🚀", - rofl: "🤣", - roll_eyes: "🙄", - roller_coaster: "🎢", - rooster: "🐓", - rose: "🌹", - rosette: "🏵", - rotating_light: "🚨", - round_pushpin: "📍", - rowing_man: "🚣", - rowing_woman: "🚣‍♀️", - rugby_football: "🏉", - running_man: "🏃", - running_shirt_with_sash: "🎽", - running_woman: "🏃‍♀️", - sa: "🈂️", - sagittarius: "♐️", - sake: "🍶", - sandal: "👡", - santa: "🎅", - satellite: "📡", - saxophone: "🎷", - school: "🏫", - school_satchel: "🎒", - scissors: "✂️", - scorpion: "🦂", - scorpius: "♏️", - scream: "😱", - scream_cat: "🙀", - scroll: "📜", - seat: "💺", - secret: "㊙️", - see_no_evil: "🙈", - seedling: "🌱", - selfie: "🤳", - shallow_pan_of_food: "🥘", - shamrock: "☘️", - shark: "🦈", - shaved_ice: "🍧", - sheep: "🐑", - shell: "🐚", - shield: "🛡", - shinto_shrine: "⛩", - ship: "🚢", - shirt: "👕", - shopping: "🛍", - shopping_cart: "🛒", - shower: "🚿", - shrimp: "🦐", - signal_strength: "📶", - six_pointed_star: "🔯", - ski: "🎿", - skier: "⛷", - skull: "💀", - skull_and_crossbones: "☠️", - sleeping: "😴", - sleeping_bed: "🛌", - sleepy: "😪", - slightly_frowning_face: "🙁", - slightly_smiling_face: "🙂", - slot_machine: "🎰", - small_airplane: "🛩", - small_blue_diamond: "🔹", - small_orange_diamond: "🔸", - small_red_triangle: "🔺", - small_red_triangle_down: "🔻", - smile: "😄", - smile_cat: "😸", - smiley: "😃", - smiley_cat: "😺", - smiling_imp: "😈", - smirk: "😏", - smirk_cat: "😼", - smoking: "🚬", - snail: "🐌", - snake: "🐍", - sneezing_face: "🤧", - snowboarder: "🏂", - snowflake: "❄️", - snowman: "⛄️", - snowman_with_snow: "☃️", - sob: "😭", - soccer: "⚽️", - soon: "🔜", - sos: "🆘", - sound: "🔉", - space_invader: "👾", - spades: "♠️", - spaghetti: "🍝", - sparkle: "❇️", - sparkler: "🎇", - sparkles: "✨", - sparkling_heart: "💖", - speak_no_evil: "🙊", - speaker: "🔈", - speaking_head: "🗣", - speech_balloon: "💬", - speedboat: "🚤", - spider: "🕷", - spider_web: "🕸", - spiral_calendar: "🗓", - spiral_notepad: "🗒", - spoon: "🥄", - squid: "🦑", - stadium: "🏟", - star: "⭐️", - star2: "🌟", - star_and_crescent: "☪️", - star_of_david: "✡️", - stars: "🌠", - station: "🚉", - statue_of_liberty: "🗽", - steam_locomotive: "🚂", - stew: "🍲", - stop_button: "⏹", - stop_sign: "🛑", - stopwatch: "⏱", - straight_ruler: "📏", - strawberry: "🍓", - stuck_out_tongue: "😛", - stuck_out_tongue_closed_eyes: "😝", - stuck_out_tongue_winking_eye: "😜", - studio_microphone: "🎙", - stuffed_flatbread: "🥙", - sun_behind_large_cloud: "🌥", - sun_behind_rain_cloud: "🌦", - sun_behind_small_cloud: "🌤", - sun_with_face: "🌞", - sunflower: "🌻", - sunglasses: "😎", - sunny: "☀️", - sunrise: "🌅", - sunrise_over_mountains: "🌄", - surfing_man: "🏄", - surfing_woman: "🏄‍♀️", - sushi: "🍣", - suspension_railway: "🚟", - sweat: "😓", - sweat_drops: "💦", - sweat_smile: "😅", - sweet_potato: "🍠", - swimming_man: "🏊", - swimming_woman: "🏊‍♀️", - symbols: "🔣", - synagogue: "🕍", - syringe: "💉", - taco: "🌮", - tada: "🎉", - tanabata_tree: "🎋", - taurus: "♉️", - taxi: "🚕", - tea: "🍵", - telephone_receiver: "📞", - telescope: "🔭", - tennis: "🎾", - tent: "⛺️", - thermometer: "🌡", - thinking: "🤔", - thought_balloon: "💭", - ticket: "🎫", - tickets: "🎟", - tiger: "🐯", - tiger2: "🐅", - timer_clock: "⏲", - tipping_hand_man: "💁‍♂️", - tired_face: "😫", - tm: "™️", - toilet: "🚽", - tokyo_tower: "🗼", - tomato: "🍅", - tongue: "👅", - top: "🔝", - tophat: "🎩", - tornado: "🌪", - trackball: "🖲", - tractor: "🚜", - traffic_light: "🚥", - train: "🚋", - train2: "🚆", - tram: "🚊", - triangular_flag_on_post: "🚩", - triangular_ruler: "📐", - trident: "🔱", - triumph: "😤", - trolleybus: "🚎", - trophy: "🏆", - tropical_drink: "🍹", - tropical_fish: "🐠", - truck: "🚚", - trumpet: "🎺", - tulip: "🌷", - tumbler_glass: "🥃", - turkey: "🦃", - turtle: "🐢", - tv: "📺", - twisted_rightwards_arrows: "🔀", - two_hearts: "💕", - two_men_holding_hands: "👬", - two_women_holding_hands: "👭", - u5272: "🈹", - u5408: "🈴", - u55b6: "🈺", - u6307: "🈯️", - u6708: "🈷️", - u6709: "🈶", - u6e80: "🈵", - u7121: "🈚️", - u7533: "🈸", - u7981: "🈲", - u7a7a: "🈳", - umbrella: "☔️", - unamused: "😒", - underage: "🔞", - unicorn: "🦄", - unlock: "🔓", - up: "🆙", - upside_down_face: "🙃", - v: "✌️", - vertical_traffic_light: "🚦", - vhs: "📼", - vibration_mode: "📳", - video_camera: "📹", - video_game: "🎮", - violin: "🎻", - virgo: "♍️", - volcano: "🌋", - volleyball: "🏐", - vs: "🆚", - vulcan_salute: "🖖", - walking_man: "🚶", - walking_woman: "🚶‍♀️", - waning_crescent_moon: "🌘", - waning_gibbous_moon: "🌖", - warning: "⚠️", - wastebasket: "🗑", - watch: "⌚️", - water_buffalo: "🐃", - watermelon: "🍉", - wave: "👋", - wavy_dash: "〰️", - waxing_crescent_moon: "🌒", - wc: "🚾", - weary: "😩", - wedding: "💒", - weight_lifting_man: "🏋️", - weight_lifting_woman: "🏋️‍♀️", - whale: "🐳", - whale2: "🐋", - wheel_of_dharma: "☸️", - wheelchair: "♿️", - white_check_mark: "✅", - white_circle: "⚪️", - white_flag: "🏳️", - white_flower: "💮", - white_large_square: "⬜️", - white_medium_small_square: "◽️", - white_medium_square: "◻️", - white_small_square: "▫️", - white_square_button: "🔳", - wilted_flower: "🥀", - wind_chime: "🎐", - wind_face: "🌬", - wine_glass: "🍷", - wink: "😉", - wolf: "🐺", - woman: "👩", - woman_artist: "👩‍🎨", - woman_astronaut: "👩‍🚀", - woman_cartwheeling: "🤸‍♀️", - woman_cook: "👩‍🍳", - woman_facepalming: "🤦‍♀️", - woman_factory_worker: "👩‍🏭", - woman_farmer: "👩‍🌾", - woman_firefighter: "👩‍🚒", - woman_health_worker: "👩‍⚕️", - woman_judge: "👩‍⚖️", - woman_juggling: "🤹‍♀️", - woman_mechanic: "👩‍🔧", - woman_office_worker: "👩‍💼", - woman_pilot: "👩‍✈️", - woman_playing_handball: "🤾‍♀️", - woman_playing_water_polo: "🤽‍♀️", - woman_scientist: "👩‍🔬", - woman_shrugging: "🤷‍♀️", - woman_singer: "👩‍🎤", - woman_student: "👩‍🎓", - woman_teacher: "👩‍🏫", - woman_technologist: "👩‍💻", - woman_with_turban: "👳‍♀️", - womans_clothes: "👚", - womans_hat: "👒", - women_wrestling: "🤼‍♀️", - womens: "🚺", - world_map: "🗺", - worried: "😟", - wrench: "🔧", - writing_hand: "✍️", - x: "❌", - yellow_heart: "💛", - yen: "💴", - yin_yang: "☯️", - yum: "😋", - zap: "⚡️", - zipper_mouth_face: "🤐", - zzz: "💤", - /* special emojis :P */ - octocat: ':octocat:', - showdown: `S` - }, a.Converter = function(n) { - var i = {}, o = [], c = [], u = {}, f = b, g = { - parsed: {}, - raw: "", - format: "" - }; - O(); - function O() { - n = n || {}; - for (var w in d) - d.hasOwnProperty(w) && (i[w] = d[w]); - if (typeof n == "object") - for (var U in n) - n.hasOwnProperty(U) && (i[U] = n[U]); - else - throw Error("Converter expects the passed parameter to be an object, but " + typeof n + " was passed instead."); - i.extensions && a.helper.forEach(i.extensions, z); - } - function z(w, U) { - if (U = U || null, a.helper.isString(w)) - if (w = a.helper.stdExtName(w), U = w, a.extensions[w]) { - console.warn("DEPRECATION WARNING: " + w + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"), q(a.extensions[w], w); - return; - } else if (!a.helper.isUndefined(l[w])) - w = l[w]; - else - throw Error('Extension "' + w + '" could not be loaded. It was either not found or is not a valid extension.'); - typeof w == "function" && (w = w()), a.helper.isArray(w) || (w = [w]); - var W = y(w, U); - if (!W.valid) - throw Error(W.error); - for (var J = 0; J < w.length; ++J) { - switch (w[J].type) { - case "lang": - o.push(w[J]); - break; - case "output": - c.push(w[J]); - break; - } - if (w[J].hasOwnProperty("listeners")) - for (var V in w[J].listeners) - w[J].listeners.hasOwnProperty(V) && B(V, w[J].listeners[V]); - } - } - function q(w, U) { - typeof w == "function" && (w = w(new a.Converter())), a.helper.isArray(w) || (w = [w]); - var W = y(w, U); - if (!W.valid) - throw Error(W.error); - for (var J = 0; J < w.length; ++J) - switch (w[J].type) { - case "lang": - o.push(w[J]); - break; - case "output": - c.push(w[J]); - break; - default: - throw Error("Extension loader error: Type unrecognized!!!"); - } - } - function B(w, U) { - if (!a.helper.isString(w)) - throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof w + " given"); - if (typeof U != "function") - throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof U + " given"); - u.hasOwnProperty(w) || (u[w] = []), u[w].push(U); - } - function G(w) { - var U = w.match(/^\s*/)[0].length, W = new RegExp("^\\s{0," + U + "}", "gm"); - return w.replace(W, ""); - } - this._dispatch = function(w, U, W, J) { - if (u.hasOwnProperty(w)) - for (var V = 0; V < u[w].length; ++V) { - var P = u[w][V](w, U, this, W, J); - P && typeof P < "u" && (U = P); - } - return U; - }, this.listen = function(w, U) { - return B(w, U), this; - }, this.makeHtml = function(w) { - if (!w) - return w; - var U = { - gHtmlBlocks: [], - gHtmlMdBlocks: [], - gHtmlSpans: [], - gUrls: {}, - gTitles: {}, - gDimensions: {}, - gListLevel: 0, - hashLinkCounts: {}, - langExtensions: o, - outputModifiers: c, - converter: this, - ghCodeBlocks: [], - metadata: { - parsed: {}, - raw: "", - format: "" - } - }; - return w = w.replace(/¨/g, "¨T"), w = w.replace(/\$/g, "¨D"), w = w.replace(/\r\n/g, ` -`), w = w.replace(/\r/g, ` -`), w = w.replace(/\u00A0/g, " "), i.smartIndentationFix && (w = G(w)), w = ` - -` + w + ` - -`, w = a.subParser("detab")(w, i, U), w = w.replace(/^[ \t]+$/mg, ""), a.helper.forEach(o, function(W) { - w = a.subParser("runExtension")(W, w, i, U); - }), w = a.subParser("metadata")(w, i, U), w = a.subParser("hashPreCodeTags")(w, i, U), w = a.subParser("githubCodeBlocks")(w, i, U), w = a.subParser("hashHTMLBlocks")(w, i, U), w = a.subParser("hashCodeTags")(w, i, U), w = a.subParser("stripLinkDefinitions")(w, i, U), w = a.subParser("blockGamut")(w, i, U), w = a.subParser("unhashHTMLSpans")(w, i, U), w = a.subParser("unescapeSpecialChars")(w, i, U), w = w.replace(/¨D/g, "$$"), w = w.replace(/¨T/g, "¨"), w = a.subParser("completeHTMLDocument")(w, i, U), a.helper.forEach(c, function(W) { - w = a.subParser("runExtension")(W, w, i, U); - }), g = U.metadata, w; - }, this.makeMarkdown = this.makeMd = function(w, U) { - if (w = w.replace(/\r\n/g, ` -`), w = w.replace(/\r/g, ` -`), w = w.replace(/>[ \t]+¨NBSP;<"), !U) - if (window && window.document) - U = window.document; - else - throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM"); - var W = U.createElement("div"); - W.innerHTML = w; - var J = { - preList: h(W) - }; - L(W); - for (var V = W.childNodes, P = "", F = 0; F < V.length; F++) - P += a.subParser("makeMarkdown.node")(V[F], J); - function L($) { - for (var I = 0; I < $.childNodes.length; ++I) { - var H = $.childNodes[I]; - H.nodeType === 3 ? !/\S/.test(H.nodeValue) && !/^[ ]+$/.test(H.nodeValue) ? ($.removeChild(H), --I) : (H.nodeValue = H.nodeValue.split(` -`).join(" "), H.nodeValue = H.nodeValue.replace(/(\s)+/g, "$1")) : H.nodeType === 1 && L(H); - } - } - function h($) { - for (var I = $.querySelectorAll("pre"), H = [], K = 0; K < I.length; ++K) - if (I[K].childElementCount === 1 && I[K].firstChild.tagName.toLowerCase() === "code") { - var te = I[K].firstChild.innerHTML.trim(), ne = I[K].firstChild.getAttribute("data-language") || ""; - if (ne === "") - for (var be = I[K].firstChild.className.split(" "), Ae = 0; Ae < be.length; ++Ae) { - var ut = be[Ae].match(/^language-(.+)$/); - if (ut !== null) { - ne = ut[1]; - break; - } - } - te = a.helper.unescapeHTMLEntities(te), H.push(te), I[K].outerHTML = ''; - } else - H.push(I[K].innerHTML), I[K].innerHTML = "", I[K].setAttribute("prenum", K.toString()); - return H; - } - return P; - }, this.setOption = function(w, U) { - i[w] = U; - }, this.getOption = function(w) { - return i[w]; - }, this.getOptions = function() { - return i; - }, this.addExtension = function(w, U) { - U = U || null, z(w, U); - }, this.useExtension = function(w) { - z(w); - }, this.setFlavor = function(w) { - if (!_.hasOwnProperty(w)) - throw Error(w + " flavor was not found"); - var U = _[w]; - f = w; - for (var W in U) - U.hasOwnProperty(W) && (i[W] = U[W]); - }, this.getFlavor = function() { - return f; - }, this.removeExtension = function(w) { - a.helper.isArray(w) || (w = [w]); - for (var U = 0; U < w.length; ++U) { - for (var W = w[U], J = 0; J < o.length; ++J) - o[J] === W && o.splice(J, 1); - for (var V = 0; V < c.length; ++V) - c[V] === W && c.splice(V, 1); - } - }, this.getAllExtensions = function() { - return { - language: o, - output: c - }; - }, this.getMetadata = function(w) { - return w ? g.raw : g.parsed; - }, this.getMetadataFormat = function() { - return g.format; - }, this._setMetadataPair = function(w, U) { - g.parsed[w] = U; - }, this._setMetadataFormat = function(w) { - g.format = w; - }, this._setMetadataRaw = function(w) { - g.raw = w; - }; - }, a.subParser("anchors", function(n, i, o) { - n = o.converter._dispatch("anchors.before", n, i, o); - var c = function(u, f, g, O, z, q, B) { - if (a.helper.isUndefined(B) && (B = ""), g = g.toLowerCase(), u.search(/\(? ?(['"].*['"])?\)$/m) > -1) - O = ""; - else if (!O) - if (g || (g = f.toLowerCase().replace(/ ?\n/g, " ")), O = "#" + g, !a.helper.isUndefined(o.gUrls[g])) - O = o.gUrls[g], a.helper.isUndefined(o.gTitles[g]) || (B = o.gTitles[g]); - else - return u; - O = O.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var G = '", G; - }; - return n = n.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, c), n = n.replace( - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, - c - ), n = n.replace( - /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, - c - ), n = n.replace(/\[([^\[\]]+)]()()()()()/g, c), i.ghMentions && (n = n.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function(u, f, g, O, z) { - if (g === "\\") - return f + O; - if (!a.helper.isString(i.ghMentionsLink)) - throw new Error("ghMentionsLink option must be a string"); - var q = i.ghMentionsLink.replace(/\{u}/g, z), B = ""; - return i.openLinksInNewWindow && (B = ' rel="noopener noreferrer" target="¨E95Eblank"'), f + '" + O + ""; - })), n = o.converter._dispatch("anchors.after", n, i, o), n; - }); - var N = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, A = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, j = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, C = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, x = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, v = function(n) { - return function(i, o, c, u, f, g, O) { - c = c.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var z = c, q = "", B = "", G = o || "", w = O || ""; - return /^www\./i.test(c) && (c = c.replace(/^www\./i, "http://www.")), n.excludeTrailingPunctuationFromURLs && g && (q = g), n.openLinksInNewWindow && (B = ' rel="noopener noreferrer" target="¨E95Eblank"'), G + '" + z + "" + q + w; - }; - }, T = function(n, i) { - return function(o, c, u) { - var f = "mailto:"; - return c = c || "", u = a.subParser("unescapeSpecialChars")(u, n, i), n.encodeEmails ? (f = a.helper.encodeEmailAddress(f + u), u = a.helper.encodeEmailAddress(u)) : f = f + u, c + '' + u + ""; - }; - }; - a.subParser("autoLinks", function(n, i, o) { - return n = o.converter._dispatch("autoLinks.before", n, i, o), n = n.replace(j, v(i)), n = n.replace(x, T(i, o)), n = o.converter._dispatch("autoLinks.after", n, i, o), n; - }), a.subParser("simplifiedAutoLinks", function(n, i, o) { - return i.simplifiedAutoLink && (n = o.converter._dispatch("simplifiedAutoLinks.before", n, i, o), i.excludeTrailingPunctuationFromURLs ? n = n.replace(A, v(i)) : n = n.replace(N, v(i)), n = n.replace(C, T(i, o)), n = o.converter._dispatch("simplifiedAutoLinks.after", n, i, o)), n; - }), a.subParser("blockGamut", function(n, i, o) { - return n = o.converter._dispatch("blockGamut.before", n, i, o), n = a.subParser("blockQuotes")(n, i, o), n = a.subParser("headers")(n, i, o), n = a.subParser("horizontalRule")(n, i, o), n = a.subParser("lists")(n, i, o), n = a.subParser("codeBlocks")(n, i, o), n = a.subParser("tables")(n, i, o), n = a.subParser("hashHTMLBlocks")(n, i, o), n = a.subParser("paragraphs")(n, i, o), n = o.converter._dispatch("blockGamut.after", n, i, o), n; - }), a.subParser("blockQuotes", function(n, i, o) { - n = o.converter._dispatch("blockQuotes.before", n, i, o), n = n + ` - -`; - var c = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm; - return i.splitAdjacentBlockquotes && (c = /^ {0,3}>[\s\S]*?(?:\n\n)/gm), n = n.replace(c, function(u) { - return u = u.replace(/^[ \t]*>[ \t]?/gm, ""), u = u.replace(/¨0/g, ""), u = u.replace(/^[ \t]+$/gm, ""), u = a.subParser("githubCodeBlocks")(u, i, o), u = a.subParser("blockGamut")(u, i, o), u = u.replace(/(^|\n)/g, "$1 "), u = u.replace(/(\s*
[^\r]+?<\/pre>)/gm, function(f, g) {
-          var O = g;
-          return O = O.replace(/^  /mg, "¨0"), O = O.replace(/¨0/g, ""), O;
-        }), a.subParser("hashBlock")(`
-` + u + ` -
`, i, o); - }), n = o.converter._dispatch("blockQuotes.after", n, i, o), n; - }), a.subParser("codeBlocks", function(n, i, o) { - n = o.converter._dispatch("codeBlocks.before", n, i, o), n += "¨0"; - var c = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g; - return n = n.replace(c, function(u, f, g) { - var O = f, z = g, q = ` -`; - return O = a.subParser("outdent")(O, i, o), O = a.subParser("encodeCode")(O, i, o), O = a.subParser("detab")(O, i, o), O = O.replace(/^\n+/g, ""), O = O.replace(/\n+$/g, ""), i.omitExtraWLInCodeBlocks && (q = ""), O = "
" + O + q + "
", a.subParser("hashBlock")(O, i, o) + z; - }), n = n.replace(/¨0/, ""), n = o.converter._dispatch("codeBlocks.after", n, i, o), n; - }), a.subParser("codeSpans", function(n, i, o) { - return n = o.converter._dispatch("codeSpans.before", n, i, o), typeof n > "u" && (n = ""), n = n.replace( - /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, - function(c, u, f, g) { - var O = g; - return O = O.replace(/^([ \t]*)/g, ""), O = O.replace(/[ \t]*$/g, ""), O = a.subParser("encodeCode")(O, i, o), O = u + "" + O + "", O = a.subParser("hashHTMLSpans")(O, i, o), O; - } - ), n = o.converter._dispatch("codeSpans.after", n, i, o), n; - }), a.subParser("completeHTMLDocument", function(n, i, o) { - if (!i.completeHTMLDocument) - return n; - n = o.converter._dispatch("completeHTMLDocument.before", n, i, o); - var c = "html", u = ` -`, f = "", g = ` -`, O = "", z = ""; - typeof o.metadata.parsed.doctype < "u" && (u = " -`, c = o.metadata.parsed.doctype.toString().toLowerCase(), (c === "html" || c === "html5") && (g = '')); - for (var q in o.metadata.parsed) - if (o.metadata.parsed.hasOwnProperty(q)) - switch (q.toLowerCase()) { - case "doctype": - break; - case "title": - f = "" + o.metadata.parsed.title + ` -`; - break; - case "charset": - c === "html" || c === "html5" ? g = ' -` : g = ' -`; - break; - case "language": - case "lang": - O = ' lang="' + o.metadata.parsed[q] + '"', z += ' -`; - break; - default: - z += ' -`; - } - return n = u + " - -` + f + g + z + ` - -` + n.trim() + ` - -`, n = o.converter._dispatch("completeHTMLDocument.after", n, i, o), n; - }), a.subParser("detab", function(n, i, o) { - return n = o.converter._dispatch("detab.before", n, i, o), n = n.replace(/\t(?=\t)/g, " "), n = n.replace(/\t/g, "¨A¨B"), n = n.replace(/¨B(.+?)¨A/g, function(c, u) { - for (var f = u, g = 4 - f.length % 4, O = 0; O < g; O++) - f += " "; - return f; - }), n = n.replace(/¨A/g, " "), n = n.replace(/¨B/g, ""), n = o.converter._dispatch("detab.after", n, i, o), n; - }), a.subParser("ellipsis", function(n, i, o) { - return i.ellipsis && (n = o.converter._dispatch("ellipsis.before", n, i, o), n = n.replace(/\.\.\./g, "…"), n = o.converter._dispatch("ellipsis.after", n, i, o)), n; - }), a.subParser("emoji", function(n, i, o) { - if (!i.emoji) - return n; - n = o.converter._dispatch("emoji.before", n, i, o); - var c = /:([\S]+?):/g; - return n = n.replace(c, function(u, f) { - return a.helper.emojis.hasOwnProperty(f) ? a.helper.emojis[f] : u; - }), n = o.converter._dispatch("emoji.after", n, i, o), n; - }), a.subParser("encodeAmpsAndAngles", function(n, i, o) { - return n = o.converter._dispatch("encodeAmpsAndAngles.before", n, i, o), n = n.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"), n = n.replace(/<(?![a-z\/?$!])/gi, "<"), n = n.replace(//g, ">"), n = o.converter._dispatch("encodeAmpsAndAngles.after", n, i, o), n; - }), a.subParser("encodeBackslashEscapes", function(n, i, o) { - return n = o.converter._dispatch("encodeBackslashEscapes.before", n, i, o), n = n.replace(/\\(\\)/g, a.helper.escapeCharactersCallback), n = n.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g, a.helper.escapeCharactersCallback), n = o.converter._dispatch("encodeBackslashEscapes.after", n, i, o), n; - }), a.subParser("encodeCode", function(n, i, o) { - return n = o.converter._dispatch("encodeCode.before", n, i, o), n = n.replace(/&/g, "&").replace(//g, ">").replace(/([*_{}\[\]\\=~-])/g, a.helper.escapeCharactersCallback), n = o.converter._dispatch("encodeCode.after", n, i, o), n; - }), a.subParser("escapeSpecialCharsWithinTagAttributes", function(n, i, o) { - n = o.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", n, i, o); - var c = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, u = /-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; - return n = n.replace(c, function(f) { - return f.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, a.helper.escapeCharactersCallback); - }), n = n.replace(u, function(f) { - return f.replace(/([\\`*_~=|])/g, a.helper.escapeCharactersCallback); - }), n = o.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", n, i, o), n; - }), a.subParser("githubCodeBlocks", function(n, i, o) { - return i.ghCodeBlocks ? (n = o.converter._dispatch("githubCodeBlocks.before", n, i, o), n += "¨0", n = n.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(c, u, f, g) { - var O = i.omitExtraWLInCodeBlocks ? "" : ` -`; - return g = a.subParser("encodeCode")(g, i, o), g = a.subParser("detab")(g, i, o), g = g.replace(/^\n+/g, ""), g = g.replace(/\n+$/g, ""), g = "
" + g + O + "
", g = a.subParser("hashBlock")(g, i, o), ` - -¨G` + (o.ghCodeBlocks.push({ text: c, codeblock: g }) - 1) + `G - -`; - }), n = n.replace(/¨0/, ""), o.converter._dispatch("githubCodeBlocks.after", n, i, o)) : n; - }), a.subParser("hashBlock", function(n, i, o) { - return n = o.converter._dispatch("hashBlock.before", n, i, o), n = n.replace(/(^\n+|\n+$)/g, ""), n = ` - -¨K` + (o.gHtmlBlocks.push(n) - 1) + `K - -`, n = o.converter._dispatch("hashBlock.after", n, i, o), n; - }), a.subParser("hashCodeTags", function(n, i, o) { - n = o.converter._dispatch("hashCodeTags.before", n, i, o); - var c = function(u, f, g, O) { - var z = g + a.subParser("encodeCode")(f, i, o) + O; - return "¨C" + (o.gHtmlSpans.push(z) - 1) + "C"; - }; - return n = a.helper.replaceRecursiveRegExp(n, c, "]*>", "", "gim"), n = o.converter._dispatch("hashCodeTags.after", n, i, o), n; - }), a.subParser("hashElement", function(n, i, o) { - return function(c, u) { - var f = u; - return f = f.replace(/\n\n/g, ` -`), f = f.replace(/^\n/, ""), f = f.replace(/\n+$/g, ""), f = ` - -¨K` + (o.gHtmlBlocks.push(f) - 1) + `K - -`, f; - }; - }), a.subParser("hashHTMLBlocks", function(n, i, o) { - n = o.converter._dispatch("hashHTMLBlocks.before", n, i, o); - var c = [ - "pre", - "div", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "blockquote", - "table", - "dl", - "ol", - "ul", - "script", - "noscript", - "form", - "fieldset", - "iframe", - "math", - "style", - "section", - "header", - "footer", - "nav", - "article", - "aside", - "address", - "audio", - "canvas", - "figure", - "hgroup", - "output", - "video", - "p" - ], u = function(w, U, W, J) { - var V = w; - return W.search(/\bmarkdown\b/) !== -1 && (V = W + o.converter.makeHtml(U) + J), ` - -¨K` + (o.gHtmlBlocks.push(V) - 1) + `K - -`; - }; - i.backslashEscapesHTMLTags && (n = n.replace(/\\<(\/?[^>]+?)>/g, function(w, U) { - return "<" + U + ">"; - })); - for (var f = 0; f < c.length; ++f) - for (var g, O = new RegExp("^ {0,3}(<" + c[f] + "\\b[^>]*>)", "im"), z = "<" + c[f] + "\\b[^>]*>", q = ""; (g = a.helper.regexIndexOf(n, O)) !== -1; ) { - var B = a.helper.splitAtIndex(n, g), G = a.helper.replaceRecursiveRegExp(B[1], u, z, q, "im"); - if (G === B[1]) - break; - n = B[0].concat(G); - } - return n = n.replace( - /(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, - a.subParser("hashElement")(n, i, o) - ), n = a.helper.replaceRecursiveRegExp(n, function(w) { - return ` - -¨K` + (o.gHtmlBlocks.push(w) - 1) + `K - -`; - }, "^ {0,3}", "gm"), n = n.replace( - /(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, - a.subParser("hashElement")(n, i, o) - ), n = o.converter._dispatch("hashHTMLBlocks.after", n, i, o), n; - }), a.subParser("hashHTMLSpans", function(n, i, o) { - n = o.converter._dispatch("hashHTMLSpans.before", n, i, o); - function c(u) { - return "¨C" + (o.gHtmlSpans.push(u) - 1) + "C"; - } - return n = n.replace(/<[^>]+?\/>/gi, function(u) { - return c(u); - }), n = n.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function(u) { - return c(u); - }), n = n.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function(u) { - return c(u); - }), n = n.replace(/<[^>]+?>/gi, function(u) { - return c(u); - }), n = o.converter._dispatch("hashHTMLSpans.after", n, i, o), n; - }), a.subParser("unhashHTMLSpans", function(n, i, o) { - n = o.converter._dispatch("unhashHTMLSpans.before", n, i, o); - for (var c = 0; c < o.gHtmlSpans.length; ++c) { - for (var u = o.gHtmlSpans[c], f = 0; /¨C(\d+)C/.test(u); ) { - var g = RegExp.$1; - if (u = u.replace("¨C" + g + "C", o.gHtmlSpans[g]), f === 10) { - console.error("maximum nesting of 10 spans reached!!!"); - break; - } - ++f; - } - n = n.replace("¨C" + c + "C", u); - } - return n = o.converter._dispatch("unhashHTMLSpans.after", n, i, o), n; - }), a.subParser("hashPreCodeTags", function(n, i, o) { - n = o.converter._dispatch("hashPreCodeTags.before", n, i, o); - var c = function(u, f, g, O) { - var z = g + a.subParser("encodeCode")(f, i, o) + O; - return ` - -¨G` + (o.ghCodeBlocks.push({ text: u, codeblock: z }) - 1) + `G - -`; - }; - return n = a.helper.replaceRecursiveRegExp(n, c, "^ {0,3}]*>\\s*]*>", "^ {0,3}\\s*
", "gim"), n = o.converter._dispatch("hashPreCodeTags.after", n, i, o), n; - }), a.subParser("headers", function(n, i, o) { - n = o.converter._dispatch("headers.before", n, i, o); - var c = isNaN(parseInt(i.headerLevelStart)) ? 1 : parseInt(i.headerLevelStart), u = i.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, f = i.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm; - n = n.replace(u, function(z, q) { - var B = a.subParser("spanGamut")(q, i, o), G = i.noHeaderId ? "" : ' id="' + O(q) + '"', w = c, U = "" + B + ""; - return a.subParser("hashBlock")(U, i, o); - }), n = n.replace(f, function(z, q) { - var B = a.subParser("spanGamut")(q, i, o), G = i.noHeaderId ? "" : ' id="' + O(q) + '"', w = c + 1, U = "" + B + ""; - return a.subParser("hashBlock")(U, i, o); - }); - var g = i.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm; - n = n.replace(g, function(z, q, B) { - var G = B; - i.customizedHeaderId && (G = B.replace(/\s?\{([^{]+?)}\s*$/, "")); - var w = a.subParser("spanGamut")(G, i, o), U = i.noHeaderId ? "" : ' id="' + O(B) + '"', W = c - 1 + q.length, J = "" + w + ""; - return a.subParser("hashBlock")(J, i, o); - }); - function O(z) { - var q, B; - if (i.customizedHeaderId) { - var G = z.match(/\{([^{]+?)}\s*$/); - G && G[1] && (z = G[1]); - } - return q = z, a.helper.isString(i.prefixHeaderId) ? B = i.prefixHeaderId : i.prefixHeaderId === !0 ? B = "section-" : B = "", i.rawPrefixHeaderId || (q = B + q), i.ghCompatibleHeaderId ? q = q.replace(/ /g, "-").replace(/&/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase() : i.rawHeaderId ? q = q.replace(/ /g, "-").replace(/&/g, "&").replace(/¨T/g, "¨").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase() : q = q.replace(/[^\w]/g, "").toLowerCase(), i.rawPrefixHeaderId && (q = B + q), o.hashLinkCounts[q] ? q = q + "-" + o.hashLinkCounts[q]++ : o.hashLinkCounts[q] = 1, q; - } - return n = o.converter._dispatch("headers.after", n, i, o), n; - }), a.subParser("horizontalRule", function(n, i, o) { - n = o.converter._dispatch("horizontalRule.before", n, i, o); - var c = a.subParser("hashBlock")("
", i, o); - return n = n.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, c), n = n.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, c), n = n.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, c), n = o.converter._dispatch("horizontalRule.after", n, i, o), n; - }), a.subParser("images", function(n, i, o) { - n = o.converter._dispatch("images.before", n, i, o); - var c = /!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, u = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, f = /!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, g = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, O = /!\[([^\[\]]+)]()()()()()/g; - function z(B, G, w, U, W, J, V, P) { - return U = U.replace(/\s/g, ""), q(B, G, w, U, W, J, V, P); - } - function q(B, G, w, U, W, J, V, P) { - var F = o.gUrls, L = o.gTitles, h = o.gDimensions; - if (w = w.toLowerCase(), P || (P = ""), B.search(/\(? ?(['"].*['"])?\)$/m) > -1) - U = ""; - else if (U === "" || U === null) - if ((w === "" || w === null) && (w = G.toLowerCase().replace(/ ?\n/g, " ")), U = "#" + w, !a.helper.isUndefined(F[w])) - U = F[w], a.helper.isUndefined(L[w]) || (P = L[w]), a.helper.isUndefined(h[w]) || (W = h[w].width, J = h[w].height); - else - return B; - G = G.replace(/"/g, """).replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback), U = U.replace(a.helper.regexes.asteriskDashAndColon, a.helper.escapeCharactersCallback); - var $ = '' + G + '", "
"); - }), n = n.replace(/\b__(\S[\s\S]*?)__\b/g, function(u, f) { - return c(f, "", ""); - }), n = n.replace(/\b_(\S[\s\S]*?)_\b/g, function(u, f) { - return c(f, "", ""); - })) : (n = n.replace(/___(\S[\s\S]*?)___/g, function(u, f) { - return /\S$/.test(f) ? c(f, "", "") : u; - }), n = n.replace(/__(\S[\s\S]*?)__/g, function(u, f) { - return /\S$/.test(f) ? c(f, "", "") : u; - }), n = n.replace(/_([^\s_][\s\S]*?)_/g, function(u, f) { - return /\S$/.test(f) ? c(f, "", "") : u; - })), i.literalMidWordAsterisks ? (n = n.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(u, f, g) { - return c(g, f + "", ""); - }), n = n.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(u, f, g) { - return c(g, f + "", ""); - }), n = n.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(u, f, g) { - return c(g, f + "", ""); - })) : (n = n.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(u, f) { - return /\S$/.test(f) ? c(f, "", "") : u; - }), n = n.replace(/\*\*(\S[\s\S]*?)\*\*/g, function(u, f) { - return /\S$/.test(f) ? c(f, "", "") : u; - }), n = n.replace(/\*([^\s*][\s\S]*?)\*/g, function(u, f) { - return /\S$/.test(f) ? c(f, "", "") : u; - })), n = o.converter._dispatch("italicsAndBold.after", n, i, o), n; - }), a.subParser("lists", function(n, i, o) { - function c(g, O) { - o.gListLevel++, g = g.replace(/\n{2,}$/, ` -`), g += "¨0"; - var z = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, q = /\n[ \t]*\n(?!¨0)/.test(g); - return i.disableForced4SpacesIndentedSublists && (z = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm), g = g.replace(z, function(B, G, w, U, W, J, V) { - V = V && V.trim() !== ""; - var P = a.subParser("outdent")(W, i, o), F = ""; - return J && i.tasklists && (F = ' class="task-list-item" style="list-style-type: none;"', P = P.replace(/^[ \t]*\[(x|X| )?]/m, function() { - var L = ' -1 ? (P = a.subParser("githubCodeBlocks")(P, i, o), P = a.subParser("blockGamut")(P, i, o)) : (P = a.subParser("lists")(P, i, o), P = P.replace(/\n$/, ""), P = a.subParser("hashHTMLBlocks")(P, i, o), P = P.replace(/\n\n+/g, ` - -`), q ? P = a.subParser("paragraphs")(P, i, o) : P = a.subParser("spanGamut")(P, i, o)), P = P.replace("¨A", ""), P = "" + P + ` -`, P; - }), g = g.replace(/¨0/g, ""), o.gListLevel--, O && (g = g.replace(/\s+$/, "")), g; - } - function u(g, O) { - if (O === "ol") { - var z = g.match(/^ *(\d+)\./); - if (z && z[1] !== "1") - return ' start="' + z[1] + '"'; - } - return ""; - } - function f(g, O, z) { - var q = i.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, B = i.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, G = O === "ul" ? q : B, w = ""; - if (g.search(G) !== -1) - (function W(J) { - var V = J.search(G), P = u(g, O); - V !== -1 ? (w += ` - -<` + O + P + `> -` + c(J.slice(0, V), !!z) + " -`, O = O === "ul" ? "ol" : "ul", G = O === "ul" ? q : B, W(J.slice(V))) : w += ` - -<` + O + P + `> -` + c(J, !!z) + " -`; - })(g); - else { - var U = u(g, O); - w = ` - -<` + O + U + `> -` + c(g, !!z) + " -`; - } - return w; - } - return n = o.converter._dispatch("lists.before", n, i, o), n += "¨0", o.gListLevel ? n = n.replace( - /^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, - function(g, O, z) { - var q = z.search(/[*+-]/g) > -1 ? "ul" : "ol"; - return f(O, q, !0); - } - ) : n = n.replace( - /(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, - function(g, O, z, q) { - var B = q.search(/[*+-]/g) > -1 ? "ul" : "ol"; - return f(z, B, !1); - } - ), n = n.replace(/¨0/, ""), n = o.converter._dispatch("lists.after", n, i, o), n; - }), a.subParser("metadata", function(n, i, o) { - if (!i.metadata) - return n; - n = o.converter._dispatch("metadata.before", n, i, o); - function c(u) { - o.metadata.raw = u, u = u.replace(/&/g, "&").replace(/"/g, """), u = u.replace(/\n {4}/g, " "), u.replace(/^([\S ]+): +([\s\S]+?)$/gm, function(f, g, O) { - return o.metadata.parsed[g] = O, ""; - }); - } - return n = n.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(u, f, g) { - return c(g), "¨M"; - }), n = n.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(u, f, g) { - return f && (o.metadata.format = f), c(g), "¨M"; - }), n = n.replace(/¨M/g, ""), n = o.converter._dispatch("metadata.after", n, i, o), n; - }), a.subParser("outdent", function(n, i, o) { - return n = o.converter._dispatch("outdent.before", n, i, o), n = n.replace(/^(\t|[ ]{1,4})/gm, "¨0"), n = n.replace(/¨0/g, ""), n = o.converter._dispatch("outdent.after", n, i, o), n; - }), a.subParser("paragraphs", function(n, i, o) { - n = o.converter._dispatch("paragraphs.before", n, i, o), n = n.replace(/^\n+/g, ""), n = n.replace(/\n+$/g, ""); - for (var c = n.split(/\n{2,}/g), u = [], f = c.length, g = 0; g < f; g++) { - var O = c[g]; - O.search(/¨(K|G)(\d+)\1/g) >= 0 ? u.push(O) : O.search(/\S/) >= 0 && (O = a.subParser("spanGamut")(O, i, o), O = O.replace(/^([ \t]*)/g, "

"), O += "

", u.push(O)); - } - for (f = u.length, g = 0; g < f; g++) { - for (var z = "", q = u[g], B = !1; /¨(K|G)(\d+)\1/.test(q); ) { - var G = RegExp.$1, w = RegExp.$2; - G === "K" ? z = o.gHtmlBlocks[w] : B ? z = a.subParser("encodeCode")(o.ghCodeBlocks[w].text, i, o) : z = o.ghCodeBlocks[w].codeblock, z = z.replace(/\$/g, "$$$$"), q = q.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, z), /^]*>\s*]*>/.test(q) && (B = !0); - } - u[g] = q; - } - return n = u.join(` -`), n = n.replace(/^\n+/g, ""), n = n.replace(/\n+$/g, ""), o.converter._dispatch("paragraphs.after", n, i, o); - }), a.subParser("runExtension", function(n, i, o, c) { - if (n.filter) - i = n.filter(i, c.converter, o); - else if (n.regex) { - var u = n.regex; - u instanceof RegExp || (u = new RegExp(u, "g")), i = i.replace(u, n.replace); - } - return i; - }), a.subParser("spanGamut", function(n, i, o) { - return n = o.converter._dispatch("spanGamut.before", n, i, o), n = a.subParser("codeSpans")(n, i, o), n = a.subParser("escapeSpecialCharsWithinTagAttributes")(n, i, o), n = a.subParser("encodeBackslashEscapes")(n, i, o), n = a.subParser("images")(n, i, o), n = a.subParser("anchors")(n, i, o), n = a.subParser("autoLinks")(n, i, o), n = a.subParser("simplifiedAutoLinks")(n, i, o), n = a.subParser("emoji")(n, i, o), n = a.subParser("underline")(n, i, o), n = a.subParser("italicsAndBold")(n, i, o), n = a.subParser("strikethrough")(n, i, o), n = a.subParser("ellipsis")(n, i, o), n = a.subParser("hashHTMLSpans")(n, i, o), n = a.subParser("encodeAmpsAndAngles")(n, i, o), i.simpleLineBreaks ? /\n\n¨K/.test(n) || (n = n.replace(/\n+/g, `
-`)) : n = n.replace(/ +\n/g, `
-`), n = o.converter._dispatch("spanGamut.after", n, i, o), n; - }), a.subParser("strikethrough", function(n, i, o) { - function c(u) { - return i.simplifiedAutoLink && (u = a.subParser("simplifiedAutoLinks")(u, i, o)), "" + u + ""; - } - return i.strikethrough && (n = o.converter._dispatch("strikethrough.before", n, i, o), n = n.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(u, f) { - return c(f); - }), n = o.converter._dispatch("strikethrough.after", n, i, o)), n; - }), a.subParser("stripLinkDefinitions", function(n, i, o) { - var c = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, u = /^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm; - n += "¨0"; - var f = function(g, O, z, q, B, G, w) { - return O = O.toLowerCase(), n.toLowerCase().split(O).length - 1 < 2 ? g : (z.match(/^data:.+?\/.+?;base64,/) ? o.gUrls[O] = z.replace(/\s/g, "") : o.gUrls[O] = a.subParser("encodeAmpsAndAngles")(z, i, o), G ? G + w : (w && (o.gTitles[O] = w.replace(/"|'/g, """)), i.parseImgDimensions && q && B && (o.gDimensions[O] = { - width: q, - height: B - }), "")); - }; - return n = n.replace(u, f), n = n.replace(c, f), n = n.replace(/¨0/, ""), n; - }), a.subParser("tables", function(n, i, o) { - if (!i.tables) - return n; - var c = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, u = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm; - function f(B) { - return /^:[ \t]*--*$/.test(B) ? ' style="text-align:left;"' : /^--*[ \t]*:[ \t]*$/.test(B) ? ' style="text-align:right;"' : /^:[ \t]*--*[ \t]*:$/.test(B) ? ' style="text-align:center;"' : ""; - } - function g(B, G) { - var w = ""; - return B = B.trim(), (i.tablesHeaderId || i.tableHeaderId) && (w = ' id="' + B.replace(/ /g, "_").toLowerCase() + '"'), B = a.subParser("spanGamut")(B, i, o), "" + B + ` -`; - } - function O(B, G) { - var w = a.subParser("spanGamut")(B, i, o); - return "" + w + ` -`; - } - function z(B, G) { - for (var w = ` - - -`, U = B.length, W = 0; W < U; ++W) - w += B[W]; - for (w += ` - - -`, W = 0; W < G.length; ++W) { - w += ` -`; - for (var J = 0; J < U; ++J) - w += G[W][J]; - w += ` -`; - } - return w += ` -
-`, w; - } - function q(B) { - var G, w = B.split(` -`); - for (G = 0; G < w.length; ++G) - /^ {0,3}\|/.test(w[G]) && (w[G] = w[G].replace(/^ {0,3}\|/, "")), /\|[ \t]*$/.test(w[G]) && (w[G] = w[G].replace(/\|[ \t]*$/, "")), w[G] = a.subParser("codeSpans")(w[G], i, o); - var U = w[0].split("|").map(function($) { - return $.trim(); - }), W = w[1].split("|").map(function($) { - return $.trim(); - }), J = [], V = [], P = [], F = []; - for (w.shift(), w.shift(), G = 0; G < w.length; ++G) - w[G].trim() !== "" && J.push( - w[G].split("|").map(function($) { - return $.trim(); - }) - ); - if (U.length < W.length) - return B; - for (G = 0; G < W.length; ++G) - P.push(f(W[G])); - for (G = 0; G < U.length; ++G) - a.helper.isUndefined(P[G]) && (P[G] = ""), V.push(g(U[G], P[G])); - for (G = 0; G < J.length; ++G) { - for (var L = [], h = 0; h < V.length; ++h) - a.helper.isUndefined(J[G][h]), L.push(O(J[G][h], P[h])); - F.push(L); - } - return z(V, F); - } - return n = o.converter._dispatch("tables.before", n, i, o), n = n.replace(/\\(\|)/g, a.helper.escapeCharactersCallback), n = n.replace(c, q), n = n.replace(u, q), n = o.converter._dispatch("tables.after", n, i, o), n; - }), a.subParser("underline", function(n, i, o) { - return i.underline && (n = o.converter._dispatch("underline.before", n, i, o), i.literalMidWordUnderscores ? (n = n.replace(/\b___(\S[\s\S]*?)___\b/g, function(c, u) { - return "" + u + ""; - }), n = n.replace(/\b__(\S[\s\S]*?)__\b/g, function(c, u) { - return "" + u + ""; - })) : (n = n.replace(/___(\S[\s\S]*?)___/g, function(c, u) { - return /\S$/.test(u) ? "" + u + "" : c; - }), n = n.replace(/__(\S[\s\S]*?)__/g, function(c, u) { - return /\S$/.test(u) ? "" + u + "" : c; - })), n = n.replace(/(_)/g, a.helper.escapeCharactersCallback), n = o.converter._dispatch("underline.after", n, i, o)), n; - }), a.subParser("unescapeSpecialChars", function(n, i, o) { - return n = o.converter._dispatch("unescapeSpecialChars.before", n, i, o), n = n.replace(/¨E(\d+)E/g, function(c, u) { - var f = parseInt(u); - return String.fromCharCode(f); - }), n = o.converter._dispatch("unescapeSpecialChars.after", n, i, o), n; - }), a.subParser("makeMarkdown.blockquote", function(n, i) { - var o = ""; - if (n.hasChildNodes()) - for (var c = n.childNodes, u = c.length, f = 0; f < u; ++f) { - var g = a.subParser("makeMarkdown.node")(c[f], i); - g !== "" && (o += g); - } - return o = o.trim(), o = "> " + o.split(` -`).join(` -> `), o; - }), a.subParser("makeMarkdown.codeBlock", function(n, i) { - var o = n.getAttribute("language"), c = n.getAttribute("precodenum"); - return "```" + o + ` -` + i.preList[c] + "\n```"; - }), a.subParser("makeMarkdown.codeSpan", function(n) { - return "`" + n.innerHTML + "`"; - }), a.subParser("makeMarkdown.emphasis", function(n, i) { - var o = ""; - if (n.hasChildNodes()) { - o += "*"; - for (var c = n.childNodes, u = c.length, f = 0; f < u; ++f) - o += a.subParser("makeMarkdown.node")(c[f], i); - o += "*"; - } - return o; - }), a.subParser("makeMarkdown.header", function(n, i, o) { - var c = new Array(o + 1).join("#"), u = ""; - if (n.hasChildNodes()) { - u = c + " "; - for (var f = n.childNodes, g = f.length, O = 0; O < g; ++O) - u += a.subParser("makeMarkdown.node")(f[O], i); - } - return u; - }), a.subParser("makeMarkdown.hr", function() { - return "---"; - }), a.subParser("makeMarkdown.image", function(n) { - var i = ""; - return n.hasAttribute("src") && (i += "![" + n.getAttribute("alt") + "](", i += "<" + n.getAttribute("src") + ">", n.hasAttribute("width") && n.hasAttribute("height") && (i += " =" + n.getAttribute("width") + "x" + n.getAttribute("height")), n.hasAttribute("title") && (i += ' "' + n.getAttribute("title") + '"'), i += ")"), i; - }), a.subParser("makeMarkdown.links", function(n, i) { - var o = ""; - if (n.hasChildNodes() && n.hasAttribute("href")) { - var c = n.childNodes, u = c.length; - o = "["; - for (var f = 0; f < u; ++f) - o += a.subParser("makeMarkdown.node")(c[f], i); - o += "](", o += "<" + n.getAttribute("href") + ">", n.hasAttribute("title") && (o += ' "' + n.getAttribute("title") + '"'), o += ")"; - } - return o; - }), a.subParser("makeMarkdown.list", function(n, i, o) { - var c = ""; - if (!n.hasChildNodes()) - return ""; - for (var u = n.childNodes, f = u.length, g = n.getAttribute("start") || 1, O = 0; O < f; ++O) - if (!(typeof u[O].tagName > "u" || u[O].tagName.toLowerCase() !== "li")) { - var z = ""; - o === "ol" ? z = g.toString() + ". " : z = "- ", c += z + a.subParser("makeMarkdown.listItem")(u[O], i), ++g; - } - return c += ` - -`, c.trim(); - }), a.subParser("makeMarkdown.listItem", function(n, i) { - for (var o = "", c = n.childNodes, u = c.length, f = 0; f < u; ++f) - o += a.subParser("makeMarkdown.node")(c[f], i); - return /\n$/.test(o) ? o = o.split(` -`).join(` - `).replace(/^ {4}$/gm, "").replace(/\n\n+/g, ` - -`) : o += ` -`, o; - }), a.subParser("makeMarkdown.node", function(n, i, o) { - o = o || !1; - var c = ""; - if (n.nodeType === 3) - return a.subParser("makeMarkdown.txt")(n, i); - if (n.nodeType === 8) - return " - -`; - if (n.nodeType !== 1) - return ""; - var u = n.tagName.toLowerCase(); - switch (u) { - case "h1": - o || (c = a.subParser("makeMarkdown.header")(n, i, 1) + ` - -`); - break; - case "h2": - o || (c = a.subParser("makeMarkdown.header")(n, i, 2) + ` - -`); - break; - case "h3": - o || (c = a.subParser("makeMarkdown.header")(n, i, 3) + ` - -`); - break; - case "h4": - o || (c = a.subParser("makeMarkdown.header")(n, i, 4) + ` - -`); - break; - case "h5": - o || (c = a.subParser("makeMarkdown.header")(n, i, 5) + ` - -`); - break; - case "h6": - o || (c = a.subParser("makeMarkdown.header")(n, i, 6) + ` - -`); - break; - case "p": - o || (c = a.subParser("makeMarkdown.paragraph")(n, i) + ` - -`); - break; - case "blockquote": - o || (c = a.subParser("makeMarkdown.blockquote")(n, i) + ` - -`); - break; - case "hr": - o || (c = a.subParser("makeMarkdown.hr")(n, i) + ` - -`); - break; - case "ol": - o || (c = a.subParser("makeMarkdown.list")(n, i, "ol") + ` - -`); - break; - case "ul": - o || (c = a.subParser("makeMarkdown.list")(n, i, "ul") + ` - -`); - break; - case "precode": - o || (c = a.subParser("makeMarkdown.codeBlock")(n, i) + ` - -`); - break; - case "pre": - o || (c = a.subParser("makeMarkdown.pre")(n, i) + ` - -`); - break; - case "table": - o || (c = a.subParser("makeMarkdown.table")(n, i) + ` - -`); - break; - case "code": - c = a.subParser("makeMarkdown.codeSpan")(n, i); - break; - case "em": - case "i": - c = a.subParser("makeMarkdown.emphasis")(n, i); - break; - case "strong": - case "b": - c = a.subParser("makeMarkdown.strong")(n, i); - break; - case "del": - c = a.subParser("makeMarkdown.strikethrough")(n, i); - break; - case "a": - c = a.subParser("makeMarkdown.links")(n, i); - break; - case "img": - c = a.subParser("makeMarkdown.image")(n, i); - break; - default: - c = n.outerHTML + ` - -`; - } - return c; - }), a.subParser("makeMarkdown.paragraph", function(n, i) { - var o = ""; - if (n.hasChildNodes()) - for (var c = n.childNodes, u = c.length, f = 0; f < u; ++f) - o += a.subParser("makeMarkdown.node")(c[f], i); - return o = o.trim(), o; - }), a.subParser("makeMarkdown.pre", function(n, i) { - var o = n.getAttribute("prenum"); - return "
" + i.preList[o] + "
"; - }), a.subParser("makeMarkdown.strikethrough", function(n, i) { - var o = ""; - if (n.hasChildNodes()) { - o += "~~"; - for (var c = n.childNodes, u = c.length, f = 0; f < u; ++f) - o += a.subParser("makeMarkdown.node")(c[f], i); - o += "~~"; - } - return o; - }), a.subParser("makeMarkdown.strong", function(n, i) { - var o = ""; - if (n.hasChildNodes()) { - o += "**"; - for (var c = n.childNodes, u = c.length, f = 0; f < u; ++f) - o += a.subParser("makeMarkdown.node")(c[f], i); - o += "**"; - } - return o; - }), a.subParser("makeMarkdown.table", function(n, i) { - var o = "", c = [[], []], u = n.querySelectorAll("thead>tr>th"), f = n.querySelectorAll("tbody>tr"), g, O; - for (g = 0; g < u.length; ++g) { - var z = a.subParser("makeMarkdown.tableCell")(u[g], i), q = "---"; - if (u[g].hasAttribute("style")) { - var B = u[g].getAttribute("style").toLowerCase().replace(/\s/g, ""); - switch (B) { - case "text-align:left;": - q = ":---"; - break; - case "text-align:right;": - q = "---:"; - break; - case "text-align:center;": - q = ":---:"; - break; - } - } - c[0][g] = z.trim(), c[1][g] = q; - } - for (g = 0; g < f.length; ++g) { - var G = c.push([]) - 1, w = f[g].getElementsByTagName("td"); - for (O = 0; O < u.length; ++O) { - var U = " "; - typeof w[O] < "u" && (U = a.subParser("makeMarkdown.tableCell")(w[O], i)), c[G].push(U); - } - } - var W = 3; - for (g = 0; g < c.length; ++g) - for (O = 0; O < c[g].length; ++O) { - var J = c[g][O].length; - J > W && (W = J); - } - for (g = 0; g < c.length; ++g) { - for (O = 0; O < c[g].length; ++O) - g === 1 ? c[g][O].slice(-1) === ":" ? c[g][O] = a.helper.padEnd(c[g][O].slice(-1), W - 1, "-") + ":" : c[g][O] = a.helper.padEnd(c[g][O], W, "-") : c[g][O] = a.helper.padEnd(c[g][O], W); - o += "| " + c[g].join(" | ") + ` | -`; - } - return o.trim(); - }), a.subParser("makeMarkdown.tableCell", function(n, i) { - var o = ""; - if (!n.hasChildNodes()) - return ""; - for (var c = n.childNodes, u = c.length, f = 0; f < u; ++f) - o += a.subParser("makeMarkdown.node")(c[f], i, !0); - return o.trim(); - }), a.subParser("makeMarkdown.txt", function(n) { - var i = n.nodeValue; - return i = i.replace(/ +/g, " "), i = i.replace(/¨NBSP;/g, " "), i = a.helper.unescapeHTMLEntities(i), i = i.replace(/([*_~|`])/g, "\\$1"), i = i.replace(/^(\s*)>/g, "\\$1>"), i = i.replace(/^#/gm, "\\#"), i = i.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3"), i = i.replace(/^( {0,3}\d+)\./gm, "$1\\."), i = i.replace(/^( {0,3})([+-])/gm, "$1\\$2"), i = i.replace(/]([\s]*)\(/g, "\\]$1\\("), i = i.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:"), i; - }); - var R = this; - e.exports ? e.exports = a : R.showdown = a; - }).call(no); -})(Zo); -var qu = Zo.exports; -const Jn = /* @__PURE__ */ oo(qu); -class Zn { - constructor() { - Te(this, "logger"), Te(this, "converter"), this.logger = nn.zhiLog("showdown-adaptor"), this.converter = new Jn.Converter(); - } - isAvailable() { - return typeof Jn < "u"; - } - renderMarkdownStr(t) { - if (!this.isAvailable()) - throw new Error("Showdown is not available"); - return this.logger.info("Showdown is rendering md to HTML..."), Promise.resolve(this.converter.makeHtml(t)); - } -} -class Yo { - constructor() { - Te(this, "logger"), Te(this, "mdAdaptor", new Zn()), this.logger = nn.zhiLog("markdown-util"); - } - /** - * 获取当前 MD 解析器名称 - */ - getCurrentAdaptorName() { - return this.mdAdaptor instanceof Wn ? "Lute" : this.mdAdaptor instanceof Zn ? "Showdown" : "None"; - } - /** - * 渲染Markdown - * - * @param md - Markdown文本 - */ - async renderHTML(t) { - const r = new Wn(); - return this.logger.debug("Lute status =>", r.isAvailable()), r.isAvailable() && (this.mdAdaptor = r), this.logger.info(`Using ${this.getCurrentAdaptorName()} as markdown renderer`), await this.mdAdaptor.renderMarkdownStr(t); - } -} -class Uu { - constructor() { - Te(this, "mdUtil"), this.mdUtil = new Yo(); - } - /** - * 移除标题数字 - * - * @param str - 字符串 - */ - removeTitleNumber(t) { - let r = t; - const a = /([0-9]*)\./; - return r = r.replace(a, ""), r; - } - /** - * 删除挂件的HTML - * - * @param str - 原字符 - */ - removeWidgetTag(t) { - let r = t.toString(); - const a = //g; - r = r.replace(a, ""); - const s = //g; - r = r.replace(s, ""); - const l = //g; - return r = r.replace(l, ""), r; - } - /** - * 删除Markdown文本的挂件的HTML - * - * @param str - 原字符 - */ - removeMdWidgetTag(t) { - let r = t.toString(); - return r = this.removeWidgetTag(r), r; - } - /** - * 去除html标签,残缺不全也可以 - * - * @param str - 字符串 - */ - filterHtml(t) { - t = t.replace(//g, ""), t = t.replace(//g, ""), t = t.replace(/<[^>]*>/g, ""), t = t.replace(/&.*;/g, ""), t = t.replace(/(^\s*)|(\s*$)/g, ""), t = t.replace(//g, ""), t = t.replace(/"/g, "").replace(/'/g, ""), t = t.replace(/\*/g, ""), t = t.replace(/\$/g, ""), t = t.replace(/\./g, ""), t = t.replace(/\+/g, ""), t = t.replace(/\s+/g, ""), t = t.replace(/[:|:]/g, "_"), t = t.replace(/[;|;]/g, "_"), t = t.replace(/\^/g, "_"), t = t.replace(/!/g, "_"), t = t.replace(/@/g, "at_"); - const r = ["\\d*/\\d/\\d*", "[、|\\\\]", "[,|,]", "\\d", "/", "-"]; - for (let a = 0; a < r.length; a++) { - const s = new RegExp(r[a], "g"); - t = t.replace(s, ""); - } - return t = t.toLowerCase(), t; - } - /** - * 截取指定长度html - * - * @param html - html - * @param length - 长度 - * @param ignore - 不要结尾省略号 - */ - parseHtml(t, r, a) { - const s = this.filterHtml(t); - return s.length < r ? s : a === !0 ? s.substring(0, r) : s.substring(0, r) + "..."; - } - /** - * 将Markdown转换为HTML - * - * @param md - Markdown - */ - async mdToHtml(t) { - const r = await this.mdUtil.renderHTML(t); - return this.removeWidgetTag(r); - } - /** - * 将Markdown转换为纯文本 - * - * @param md - Markdown - */ - async mdToPlainText(t) { - const r = await this.mdToHtml(t); - return this.filterHtml(r); - } - /** - * 移除H1标签 - * - * @param html - html - */ - removeH1(t) { - let r = t; - const a = //g; - return r = r.replace(a, ""), r; - } - /** - * 移除Markdown里面的H1标签 - * - * JavaScript 正则表达式可以用来删除所有 Markdown 中的 h1 标签。下面是一个示例代码: - * - * const str = "# This is an H1\n## This is an H2\n### This is an H3"; - * - * const regex = /^# .*$/gm; - * const result = str.replace(regex, ''); - * - * console.log(result); - * 在这个例子中,我们使用正则表达式 /^# .*$/gm 来匹配所有的 h1 标签。 - * 在 JavaScript 中,^ 匹配行首,# 匹配 # 字符,.* 匹配任意字符,$ 匹配行尾,m 标记表示多行模式。 - */ - removeMdH1(t) { - let r = t; - const a = /^# .*$/gm; - return r = r.replace(a, ""), r; - } -} -class Gu { - /** - * 检测是否是空对象 - * - * @param obj - 对象 - */ - isEmptyObject(t) { - return t ? Object.getPrototypeOf(t) === Object.prototype && Object.getOwnPropertyNames(t).length === 0 && Object.getOwnPropertySymbols(t).length === 0 : !0; - } -} -class Hu { - constructor() { - Te(this, "dateUtil"), Te(this, "strUtil"), Te(this, "versionUtil"), Te(this, "htmlUtil"), Te(this, "markdownUtil"), Te(this, "jsonUtil"), Te(this, "objectUtil"), this.dateUtil = new yu(), this.strUtil = new _u(), this.versionUtil = new Eu(), this.htmlUtil = new Uu(), this.markdownUtil = new Yo(), this.jsonUtil = new bu(), this.objectUtil = new Gu(); - } -} -const Ku = Hu; -var Wu = Object.defineProperty, Ju = (e, t, r) => t in e ? Wu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, sr = (e, t, r) => (Ju(e, typeof t != "symbol" ? t + "" : t, r), r); -class ir { -} -sr(ir, "NODE_ENV_KEY", "NODE_ENV"), /** -* 开发环境 -*/ -sr(ir, "NODE_ENV_DEVELOPMENT", "development"), /** -* 生产环境 -*/ -sr(ir, "NODE_ENV_PRODUCTION", "production"), /** -* 测试环境 -*/ -sr(ir, "NODE_ENV_TEST", "test"), /** -* 是否处于调试模式 -*/ -sr(ir, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE"); -class Zu { -} -oe(Zu, "DEFAULT_BLOG_TYPE_KEY", "VITE_DEFAULT_TYPE"); -class Yu extends ks { -} -class Yn extends vs { - constructor(r, a) { - super(); - /** - * 思源笔记伺服地址 - */ - $e(this, "apiUrl"); - /** - * 思源笔记 API token - */ - $e(this, "password"); - /** - * 思源笔记操作提示 - * - * @protected - */ - $e(this, "placeholder"); - /** - * 是否修复标题 - * - * @protected - */ - $e(this, "fixTitle"); - this.apiUrl = r ?? "http://127.0.0.1:6806", this.passwordType = ao.PasswordType_Token, this.password = a ?? "", this.placeholder = new Yu(), this.fixTitle = !0; - } -} -var Qu = Object.defineProperty, Xu = (e, t, r) => t in e ? Qu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Gt = (e, t, r) => (Xu(e, typeof t != "symbol" ? t + "" : t, r), r); -class Kr { -} -Gt(Kr, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), Gt(Kr, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX"); -var et = /* @__PURE__ */ ((e) => (e.LOG_LEVEL_TRACE = "TRACE", e.LOG_LEVEL_DEBUG = "DEBUG", e.LOG_LEVEL_INFO = "INFO", e.LOG_LEVEL_WARN = "WARN", e.LOG_LEVEL_ERROR = "ERROR", e))(et || {}), Qo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; -function on(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -} -var Xo = { exports: {} }; -(function(e) { - (function(t, r) { - e.exports ? e.exports = r() : t.log = r(); - })(Qo, function() { - var t = function() { - }, r = "undefined", a = typeof window !== r && typeof window.navigator !== r && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [ - "trace", - "debug", - "info", - "warn", - "error" - ]; - function l(C, x) { - var v = C[x]; - if (typeof v.bind == "function") - return v.bind(C); - try { - return Function.prototype.bind.call(v, C); - } catch { - return function() { - return Function.prototype.apply.apply(v, [C, arguments]); - }; - } - } - function d() { - console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace(); - } - function b(C) { - return C === "debug" && (C = "log"), typeof console === r ? !1 : C === "trace" && a ? d : console[C] !== void 0 ? l(console, C) : console.log !== void 0 ? l(console, "log") : t; - } - function _(C, x) { - for (var v = 0; v < s.length; v++) { - var T = s[v]; - this[T] = v < C ? t : this.methodFactory(T, C, x); - } - this.log = this.debug; - } - function y(C, x, v) { - return function() { - typeof console !== r && (_.call(this, x, v), this[C].apply(this, arguments)); - }; - } - function m(C, x, v) { - return b(C) || y.apply(this, arguments); - } - function k(C, x, v) { - var T = this, R; - x = x ?? "WARN"; - var n = "loglevel"; - typeof C == "string" ? n += ":" + C : typeof C == "symbol" && (n = void 0); - function i(f) { - var g = (s[f] || "silent").toUpperCase(); - if (!(typeof window === r || !n)) { - try { - window.localStorage[n] = g; - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(n) + "=" + g + ";"; - } catch { - } - } - } - function o() { - var f; - if (!(typeof window === r || !n)) { - try { - f = window.localStorage[n]; - } catch { - } - if (typeof f === r) - try { - var g = window.document.cookie, O = g.indexOf( - encodeURIComponent(n) + "=" - ); - O !== -1 && (f = /^([^;]+)/.exec(g.slice(O))[1]); - } catch { - } - return T.levels[f] === void 0 && (f = void 0), f; - } - } - function c() { - if (!(typeof window === r || !n)) { - try { - window.localStorage.removeItem(n); - return; - } catch { - } - try { - window.document.cookie = encodeURIComponent(n) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; - } catch { - } - } - } - T.name = C, T.levels = { - TRACE: 0, - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - SILENT: 5 - }, T.methodFactory = v || m, T.getLevel = function() { - return R; - }, T.setLevel = function(f, g) { - if (typeof f == "string" && T.levels[f.toUpperCase()] !== void 0 && (f = T.levels[f.toUpperCase()]), typeof f == "number" && f >= 0 && f <= T.levels.SILENT) { - if (R = f, g !== !1 && i(f), _.call(T, f, C), typeof console === r && f < T.levels.SILENT) - return "No console available for logging"; - } else - throw "log.setLevel() called with invalid level: " + f; - }, T.setDefaultLevel = function(f) { - x = f, o() || T.setLevel(f, !1); - }, T.resetLevel = function() { - T.setLevel(x, !1), c(); - }, T.enableAll = function(f) { - T.setLevel(T.levels.TRACE, f); - }, T.disableAll = function(f) { - T.setLevel(T.levels.SILENT, f); - }; - var u = o(); - u == null && (u = x), T.setLevel(u, !1); - } - var N = new k(), A = {}; - N.getLogger = function(C) { - if (typeof C != "symbol" && typeof C != "string" || C === "") - throw new TypeError("You must supply a name when creating a logger."); - var x = A[C]; - return x || (x = A[C] = new k( - C, - N.getLevel(), - N.methodFactory - )), x; - }; - var j = typeof window !== r ? window.log : void 0; - return N.noConflict = function() { - return typeof window !== r && window.log === N && (window.log = j), N; - }, N.getLoggers = function() { - return A; - }, N.default = N, N; - }); -})(Xo); -var ed = Xo.exports; -const Lr = /* @__PURE__ */ on(ed); -var es = { exports: {} }; -(function(e) { - (function(t, r) { - e.exports ? e.exports = r() : t.prefix = r(t); - })(Qo, function(t) { - var r = function(m) { - for (var k = 1, N = arguments.length, A; k < N; k++) - for (A in arguments[k]) - Object.prototype.hasOwnProperty.call(arguments[k], A) && (m[A] = arguments[k][A]); - return m; - }, a = { - template: "[%t] %l:", - levelFormatter: function(m) { - return m.toUpperCase(); - }, - nameFormatter: function(m) { - return m || "root"; - }, - timestampFormatter: function(m) { - return m.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"); - }, - format: void 0 - }, s, l = {}, d = function(m) { - if (!m || !m.getLogger) - throw new TypeError("Argument is not a root logger"); - s = m; - }, b = function(m, k) { - if (!m || !m.setLevel) - throw new TypeError("Argument is not a logger"); - var N = m.methodFactory, A = m.name || "", j = l[A] || l[""] || a; - function C(x, v, T) { - var R = N(x, v, T), n = l[T] || l[""], i = n.template.indexOf("%t") !== -1, o = n.template.indexOf("%l") !== -1, c = n.template.indexOf("%n") !== -1; - return function() { - for (var u = "", f = arguments.length, g = Array(f), O = 0; O < f; O++) - g[O] = arguments[O]; - if (A || !l[T]) { - var z = n.timestampFormatter(/* @__PURE__ */ new Date()), q = n.levelFormatter(x), B = n.nameFormatter(T); - n.format ? u += n.format(q, B, z) : (u += n.template, i && (u = u.replace(/%t/, z)), o && (u = u.replace(/%l/, q)), c && (u = u.replace(/%n/, B))), g.length && typeof g[0] == "string" ? g[0] = u + " " + g[0] : g.unshift(u); - } - R.apply(void 0, g); - }; - } - return l[A] || (m.methodFactory = C), k = k || {}, k.template && (k.format = void 0), l[A] = r({}, j, k), m.setLevel(m.getLevel()), s || m.warn( - "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md" - ), m; - }, _ = { - reg: d, - apply: b - }, y; - return t && (y = t.prefix, _.noConflict = function() { - return t.prefix === _ && (t.prefix = y), _; - }), _; - }); -})(es); -var td = es.exports; -const Qn = /* @__PURE__ */ on(td); -function rd() { - const e = Error.prepareStackTrace; - Error.prepareStackTrace = (r, a) => a; - const t = new Error().stack.slice(1); - return Error.prepareStackTrace = e, t; -} -class mr { - /** - * 解析日志级别为枚举 - * - * @param enumObj - 枚举对象 - * @param value - 配置的值 - */ - static stringToEnumValue(t, r) { - return t[Object.keys(t).filter((a) => t[a].toString() === r)[0]]; - } - /** - * 获取配置的日志级别 - */ - static getEnvLevel(t) { - if (!t) - return; - const r = t.getEnvOrDefault(Kr.LOG_LEVEL_KEY, et.LOG_LEVEL_INFO), a = mr.stringToEnumValue(et, r.toUpperCase()); - return a || console.warn( - "[zhi-log] LOG_LEVEL is invalid in you .env file.It must be either debug, info, warn or error, fallback to default info level" - ), a; - } - /** - * 获取默认日志 - */ - static getEnvLogger(t) { - return t ? t.getEnv(Kr.LOG_PREFIX_KEY) : void 0; - } -} -var sn = { exports: {} }, Xn = { exports: {} }, eo; -function ad() { - return eo || (eo = 1, function(e) { - const t = typeof process < "u" && process.env.TERM_PROGRAM === "Hyper", r = typeof process < "u" && process.platform === "win32", a = typeof process < "u" && process.platform === "linux", s = { - ballotDisabled: "☒", - ballotOff: "☐", - ballotOn: "☑", - bullet: "•", - bulletWhite: "◦", - fullBlock: "█", - heart: "❤", - identicalTo: "≡", - line: "─", - mark: "※", - middot: "·", - minus: "-", - multiplication: "×", - obelus: "÷", - pencilDownRight: "✎", - pencilRight: "✏", - pencilUpRight: "✐", - percent: "%", - pilcrow2: "❡", - pilcrow: "¶", - plusMinus: "±", - question: "?", - section: "§", - starsOff: "☆", - starsOn: "★", - upDownArrow: "↕" - }, l = Object.assign({}, s, { - check: "√", - cross: "×", - ellipsisLarge: "...", - ellipsis: "...", - info: "i", - questionSmall: "?", - pointer: ">", - pointerSmall: "»", - radioOff: "( )", - radioOn: "(*)", - warning: "‼" - }), d = Object.assign({}, s, { - ballotCross: "✘", - check: "✔", - cross: "✖", - ellipsisLarge: "⋯", - ellipsis: "…", - info: "ℹ", - questionFull: "?", - questionSmall: "﹖", - pointer: a ? "▸" : "❯", - pointerSmall: a ? "‣" : "›", - radioOff: "◯", - radioOn: "◉", - warning: "⚠" - }); - e.exports = r && !t ? l : d, Reflect.defineProperty(e.exports, "common", { enumerable: !1, value: s }), Reflect.defineProperty(e.exports, "windows", { enumerable: !1, value: l }), Reflect.defineProperty(e.exports, "other", { enumerable: !1, value: d }); - }(Xn)), Xn.exports; -} -const nd = (e) => e !== null && typeof e == "object" && !Array.isArray(e), od = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, sd = () => typeof process < "u" ? process.env.FORCE_COLOR !== "0" : !1, ts = () => { - const e = { - enabled: sd(), - visible: !0, - styles: {}, - keys: {} - }, t = (l) => { - let d = l.open = `\x1B[${l.codes[0]}m`, b = l.close = `\x1B[${l.codes[1]}m`, _ = l.regex = new RegExp(`\\u001b\\[${l.codes[1]}m`, "g"); - return l.wrap = (y, m) => { - y.includes(b) && (y = y.replace(_, b + d)); - let k = d + y + b; - return m ? k.replace(/\r*\n/g, `${b}$&${d}`) : k; - }, l; - }, r = (l, d, b) => typeof l == "function" ? l(d) : l.wrap(d, b), a = (l, d) => { - if (l === "" || l == null) - return ""; - if (e.enabled === !1) - return l; - if (e.visible === !1) - return ""; - let b = "" + l, _ = b.includes(` -`), y = d.length; - for (y > 0 && d.includes("unstyle") && (d = [.../* @__PURE__ */ new Set(["unstyle", ...d])].reverse()); y-- > 0; ) - b = r(e.styles[d[y]], b, _); - return b; - }, s = (l, d, b) => { - e.styles[l] = t({ name: l, codes: d }), (e.keys[b] || (e.keys[b] = [])).push(l), Reflect.defineProperty(e, l, { - configurable: !0, - enumerable: !0, - set(_) { - e.alias(l, _); - }, - get() { - let _ = (y) => a(y, _.stack); - return Reflect.setPrototypeOf(_, e), _.stack = this.stack ? this.stack.concat(l) : [l], _; - } - }); - }; - return s("reset", [0, 0], "modifier"), s("bold", [1, 22], "modifier"), s("dim", [2, 22], "modifier"), s("italic", [3, 23], "modifier"), s("underline", [4, 24], "modifier"), s("inverse", [7, 27], "modifier"), s("hidden", [8, 28], "modifier"), s("strikethrough", [9, 29], "modifier"), s("black", [30, 39], "color"), s("red", [31, 39], "color"), s("green", [32, 39], "color"), s("yellow", [33, 39], "color"), s("blue", [34, 39], "color"), s("magenta", [35, 39], "color"), s("cyan", [36, 39], "color"), s("white", [37, 39], "color"), s("gray", [90, 39], "color"), s("grey", [90, 39], "color"), s("bgBlack", [40, 49], "bg"), s("bgRed", [41, 49], "bg"), s("bgGreen", [42, 49], "bg"), s("bgYellow", [43, 49], "bg"), s("bgBlue", [44, 49], "bg"), s("bgMagenta", [45, 49], "bg"), s("bgCyan", [46, 49], "bg"), s("bgWhite", [47, 49], "bg"), s("blackBright", [90, 39], "bright"), s("redBright", [91, 39], "bright"), s("greenBright", [92, 39], "bright"), s("yellowBright", [93, 39], "bright"), s("blueBright", [94, 39], "bright"), s("magentaBright", [95, 39], "bright"), s("cyanBright", [96, 39], "bright"), s("whiteBright", [97, 39], "bright"), s("bgBlackBright", [100, 49], "bgBright"), s("bgRedBright", [101, 49], "bgBright"), s("bgGreenBright", [102, 49], "bgBright"), s("bgYellowBright", [103, 49], "bgBright"), s("bgBlueBright", [104, 49], "bgBright"), s("bgMagentaBright", [105, 49], "bgBright"), s("bgCyanBright", [106, 49], "bgBright"), s("bgWhiteBright", [107, 49], "bgBright"), e.ansiRegex = od, e.hasColor = e.hasAnsi = (l) => (e.ansiRegex.lastIndex = 0, typeof l == "string" && l !== "" && e.ansiRegex.test(l)), e.alias = (l, d) => { - let b = typeof d == "string" ? e[d] : d; - if (typeof b != "function") - throw new TypeError("Expected alias to be the name of an existing color (string) or a function"); - b.stack || (Reflect.defineProperty(b, "name", { value: l }), e.styles[l] = b, b.stack = [l]), Reflect.defineProperty(e, l, { - configurable: !0, - enumerable: !0, - set(_) { - e.alias(l, _); - }, - get() { - let _ = (y) => a(y, _.stack); - return Reflect.setPrototypeOf(_, e), _.stack = this.stack ? this.stack.concat(b.stack) : b.stack, _; - } - }); - }, e.theme = (l) => { - if (!nd(l)) - throw new TypeError("Expected theme to be an object"); - for (let d of Object.keys(l)) - e.alias(d, l[d]); - return e; - }, e.alias("unstyle", (l) => typeof l == "string" && l !== "" ? (e.ansiRegex.lastIndex = 0, l.replace(e.ansiRegex, "")) : ""), e.alias("noop", (l) => l), e.none = e.clear = e.noop, e.stripColor = e.unstyle, e.symbols = ad(), e.define = s, e; -}; -sn.exports = ts(); -sn.exports.create = ts; -var id = sn.exports; -const He = /* @__PURE__ */ on(id); -let ga, rs, as, ns, os = !0; -typeof process < "u" && ({ FORCE_COLOR: ga, NODE_DISABLE_COLORS: rs, NO_COLOR: as, TERM: ns } = process.env || {}, os = process.stdout && process.stdout.isTTY); -const ae = { - enabled: !rs && as == null && ns !== "dumb" && (ga != null && ga !== "0" || os), - // modifiers - reset: ge(0, 0), - bold: ge(1, 22), - dim: ge(2, 22), - italic: ge(3, 23), - underline: ge(4, 24), - inverse: ge(7, 27), - hidden: ge(8, 28), - strikethrough: ge(9, 29), - // colors - black: ge(30, 39), - red: ge(31, 39), - green: ge(32, 39), - yellow: ge(33, 39), - blue: ge(34, 39), - magenta: ge(35, 39), - cyan: ge(36, 39), - white: ge(37, 39), - gray: ge(90, 39), - grey: ge(90, 39), - // background colors - bgBlack: ge(40, 49), - bgRed: ge(41, 49), - bgGreen: ge(42, 49), - bgYellow: ge(43, 49), - bgBlue: ge(44, 49), - bgMagenta: ge(45, 49), - bgCyan: ge(46, 49), - bgWhite: ge(47, 49) -}; -function to(e, t) { - let r = 0, a, s = "", l = ""; - for (; r < e.length; r++) - a = e[r], s += a.open, l += a.close, ~t.indexOf(a.close) && (t = t.replace(a.rgx, a.close + a.open)); - return s + t + l; -} -function ld(e, t) { - let r = { has: e, keys: t }; - return r.reset = ae.reset.bind(r), r.bold = ae.bold.bind(r), r.dim = ae.dim.bind(r), r.italic = ae.italic.bind(r), r.underline = ae.underline.bind(r), r.inverse = ae.inverse.bind(r), r.hidden = ae.hidden.bind(r), r.strikethrough = ae.strikethrough.bind(r), r.black = ae.black.bind(r), r.red = ae.red.bind(r), r.green = ae.green.bind(r), r.yellow = ae.yellow.bind(r), r.blue = ae.blue.bind(r), r.magenta = ae.magenta.bind(r), r.cyan = ae.cyan.bind(r), r.white = ae.white.bind(r), r.gray = ae.gray.bind(r), r.grey = ae.grey.bind(r), r.bgBlack = ae.bgBlack.bind(r), r.bgRed = ae.bgRed.bind(r), r.bgGreen = ae.bgGreen.bind(r), r.bgYellow = ae.bgYellow.bind(r), r.bgBlue = ae.bgBlue.bind(r), r.bgMagenta = ae.bgMagenta.bind(r), r.bgCyan = ae.bgCyan.bind(r), r.bgWhite = ae.bgWhite.bind(r), r; -} -function ge(e, t) { - let r = { - open: `\x1B[${e}m`, - close: `\x1B[${t}m`, - rgx: new RegExp(`\\x1b\\[${t}m`, "g") - }; - return function(a) { - return this !== void 0 && this.has !== void 0 ? (~this.has.indexOf(e) || (this.has.push(e), this.keys.push(r)), a === void 0 ? this : ae.enabled ? to(this.keys, a + "") : a + "") : a === void 0 ? ld([e], [r]) : ae.enabled ? to([r], a + "") : a + ""; - }; -} -var cd = Object.defineProperty, ud = (e, t, r) => t in e ? cd(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Se = (e, t, r) => (ud(e, typeof t != "symbol" ? t + "" : t, r), r); -const Xe = class { - /** - * 检测是否运行在Chrome插件中 - */ - static isInChromeExtension() { - return Xe.isInBrowser ? window.location.href.indexOf("chrome-extension://") > -1 : !1; - } -}; -let he = Xe; -Se(he, "isNode", typeof process < "u"), /** -* 是否在浏览器环境 -*/ -Se(he, "isInBrowser", typeof window < "u"), /** -* 浏览器路径分隔符 -*/ -Se(he, "BrowserSeperator", "/"), /** -* 是否是Electron环境 -*/ -Se(he, "isElectron", () => !Xe.isInBrowser || !window.navigator || !window.navigator.userAgent ? !1 : /Electron/.test(window.navigator.userAgent)), /** -* 是否有Node环境,目前包括 Electron 和 Node -*/ -Se(he, "hasNodeEnv", () => Xe.isElectron() || Xe.isNode), /** -* 获取url参数 -* -* @param sParam - 参数 -*/ -Se(he, "getQueryString", (e) => { - if (!Xe.isInBrowser) - return ""; - const t = window.location.search.substring(1).split("&"); - for (let r = 0; r < t.length; r++) { - const a = t[r].split("="); - if (a[0] === e) - return a[1]; - } - return ""; -}), /** -* 替换 URL 的参数 -* 思路: -* 1. 使用了 URLSearchParams 对象来解析和构建 URL 查询参数。 -* -* 2. 在处理包含 hash 片段的 URL 时使用了 split 函数将 URL 分成两部分:基本 URL 和 hash 片段。 -* -* 3. 然后,再次使用 split 函数将基本 URL 分成两部分:路径和查询参数。 -* -* 4. 将查询参数转换为 URLSearchParams 对象,然后设置指定的参数名和值。 -* -* 5. 最后,使用 toString 函数将查询参数转换为字符串,并将其与路径组合成新的基本 URL。如果 URL 包含 hash 片段,则将其添加到新的基本 URL 中。 -* -* @param url - 链接地址 -* @param paramName - 参数名 -* @param paramValue - 参数值 -*/ -Se(he, "replaceUrlParam", (e, t, r) => { - r == null && (r = ""); - const a = new RegExp("\\b(" + t + "=).*?(&|#|$)"); - if (e.search(a) >= 0) - return e.replace(a, "$1" + r + "$2"); - const [s, l] = e.split("#"), [d, b] = s.split("?"), _ = new URLSearchParams(b); - _.set(t, r); - const y = _.toString(), m = d + (y ? "?" + y : ""); - return l ? m + "#" + l : m; -}), /** -* 设置url参数 -* -* @param urlstring - url -* @param key - key -* @param value - value -*/ -Se(he, "setUrlParameter", (e, t, r) => { - if (e.includes(t)) - return Xe.replaceUrlParam(e, t, r); - const a = e.split("#"); - let s = a[0]; - const l = a[1]; - return s.includes("?") ? s += `&${t}=${r}` : s += `?${t}=${r}`, l && (s += "#" + l), s; -}), /** -* 重新加载指定tab -* -* @param tabname - tabname -* @param t - 延迟时间 -*/ -Se(he, "reloadTabPage", (e, t = 200) => { - setTimeout(function() { - if (Xe.isInBrowser) { - const r = window.location.href; - window.location.href = Xe.setUrlParameter(r, "tab", e); - } - }, t); -}), /** -* 刷新当前tab页面 -*/ -Se(he, "reloadPage", () => { - setTimeout(function() { - Xe.isInBrowser && window.location.reload(); - }, 200); -}), /** -* 刷新当前tab页面 -* -* @param msg - 消息提示 -* @param cb - 回调 -*/ -Se(he, "reloadPageWithMessageCallback", (e, t) => { - t && t(e), setTimeout(function() { - Xe.isInBrowser && window.location.reload(); - }, 200); -}); -var Le = /* @__PURE__ */ ((e) => (e.BasePathType_Appearance = "Appearance", e.BasePathType_Data = "Data", e.BasePathType_Themes = "Themes", e.BasePathType_ZhiTheme = "ZhiTheme", e.BasePathType_None = "None", e))(Le || {}); -const Me = class { - /** - * 检测是否运行在思源打开的浏览器中 - */ - static isInSiyuanBrowser() { - return he.isInBrowser ? typeof window.siyuan < "u" && typeof window.Lute < "u" : !1; - } - /** - * 思源笔记 window 对象 - */ - static siyuanWindow() { - let e; - return this.isInSiyuanWidget() ? e = parent.window : this.isInSiyuanNewWin() || this.isInSiyuanBrowser() || typeof window < "u" ? e = window : e = void 0, e; - } - // ========================= - // require end - // ========================= - // ========================= - // import start - // ========================= - /** - * 引入json - * - * @param jsPath - js相对路径全路径 - * @param type - 类型 - */ - static async importJs(e, t) { - let r = e; - switch (t) { - case Le.BasePathType_Appearance: - r = this.browserJoinPath(this.siyuanAppearanceRelativePath(), e); - break; - case Le.BasePathType_Data: - r = this.browserJoinPath(this.siyuanDataRelativePath(), e); - break; - case Le.BasePathType_Themes: - r = this.browserJoinPath(this.siyuanThemeRelativePath(), e); - break; - case Le.BasePathType_ZhiTheme: - r = this.browserJoinPath(this.zhiThemeRelativePath(), e); - break; - default: - throw new Error("type must be provided"); - } - const { default: a } = await import( - /* @vite-ignore */ - r - ); - return a; - } - /** - * 引入json - * - * @param jsonPath - json相对路径全路径 - * @param type - 类型 - */ - // public static async importJson(jsonPath: string, type: BasePathTypeEnum) { - // let fullJsonPath = jsonPath - // switch (type) { - // case BasePathTypeEnum.BasePathType_Appearance: - // fullJsonPath = this.browserJoinPath(this.siyuanAppearanceRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Data: - // fullJsonPath = this.browserJoinPath(this.siyuanDataRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_Themes: - // fullJsonPath = this.browserJoinPath(this.siyuanThemeRelativePath(), jsonPath) - // break - // case BasePathTypeEnum.BasePathType_ZhiTheme: - // fullJsonPath = this.browserJoinPath(this.zhiThemeRelativePath(), jsonPath) - // break - // default: - // throw new Error("type must be provided") - // } - // - // const { default: data } = await import(/* @vite-ignore */ fullJsonPath, { assert: { type: "json" } }) - // return data - // } - /** - * 引入 json - 以 data 为基本路径 - * - * @param jsonPath - 相对于 data 的相对路径 - */ - // public static async importDataJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Data) - // } - /** - * 引入 json - 以 appearance 为基本路径 - * - * @param jsonPath - 相对于 appearance 的相对路径 - */ - // public static async importAppearanceJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Appearance) - // } - /** - * 引入 json - 以 themes 为基本路径 - * - * @param jsonPath - 相对于 themes 的相对路径 - */ - // public static async importThemesJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_Themes) - // } - /** - * 引入 zhi 主题的 json - 以 zhi 主题 的根路径为基本路径 - * - * @param jsonPath - 相对于 zhi 主题根路径的相对路径 - */ - // public static async importZhiThemeJson(jsonPath: string) { - // return await this.importJson(jsonPath, BasePathTypeEnum.BasePathType_ZhiTheme) - // } - /** - * 引入 zhi 主题的 js - 以 zhi 主题 的根路径为基本路径 - * - * @param jsPath - 相对于 zhi 主题根路径的相对路径 - */ - static async importZhiThemeJs(e) { - return await this.importJs(e, Le.BasePathType_ZhiTheme); - } - // ========================= - // import start - // ========================= - /** - * 路径拼接 - * - * @param paths - 路径数组 - */ - static joinPath(...e) { - if (he.hasNodeEnv()) { - const t = this.requireLib("path"); - if (t) - return t.join(...e); - } - return this.browserJoinPath(...e); - } - static browserJoinPath(...e) { - return e.join(he.BrowserSeperator); - } - /** - * 思源笔记 conf 目录 - */ - static siyuanConfPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.confDir; - } - /** - * 思源笔记 data 目录 - */ - static siyuanDataPath() { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return e.siyuan.config.system.dataDir; - } - /** - * 思源笔记 data 目录-相对路径 - */ - static siyuanDataRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return ""; - } - /** - * 思源笔记 appearance 目录 - */ - static siyuanAppearancePath() { - return this.joinPath(this.siyuanConfPath(), "appearance"); - } - /** - * 思源笔记 appearance 目录-相对路径 - */ - static siyuanAppearanceRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance"); - } - /** - * 思源笔记 themes 目录-绝对路径 - * - * 注意: 如果是非 electron 和 Node 环境,这里返回的是浏览器的路径,不是物理路径 - * 如果使用物理路径,请调用 siyuanAppearancePath 或者 siyuanDataPath - * - * @author terwer - * @since 0.1.0 - */ - static siyuanThemePath() { - if (he.hasNodeEnv()) - return this.joinPath(this.siyuanAppearancePath(), "themes"); - { - const e = this.siyuanWindow(); - if (!e) - throw new Error("Not in siyuan env"); - return this.joinPath(e.location.origin, "appearance", "themes"); - } - } - /** - * 思源笔记 themes 目录-相对路径 - */ - static siyuanThemeRelativePath() { - if (!this.siyuanWindow()) - throw new Error("Not in siyuan env"); - return this.browserJoinPath("", "appearance", "themes"); - } - /** - * zhi 主题目录 - 绝对路径 - */ - static zhiThemePath() { - return this.joinPath(this.siyuanThemePath(), "zhi"); - } - /** - * zhi 主题目录 - 相对路径 - */ - static zhiThemeRelativePath() { - return this.browserJoinPath(this.siyuanThemeRelativePath(), "zhi"); - } -}; -let Tt = Me; -Se(Tt, "isInSiyuanWidget", () => he.isInBrowser ? window.frameElement != null && window.frameElement.parentElement != null && window.frameElement.parentElement.parentElement != null && window.frameElement.parentElement.parentElement.getAttribute("data-node-id") !== "" : !1), /** -* 思源笔记新窗口 -* -* @deprecated window.terwer 判断方式已废弃,建议以后打开新窗口注入 window.siyuanNewWin ,这样语义会更容易理解 -* @author terwer -* @version 0.1.0 -* @since 0.0.1 -*/ -Se(Tt, "isInSiyuanNewWin", () => !he.isInBrowser || !he.isElectron() ? !1 : typeof window.terwer < "u" || typeof window.siyuanNewWin < "u"), // ========================= -// require start -// ========================= -/** - * 引入依赖 - * - * @param libpath - 依赖全路径 - * @param abs - 可选,是否使用觉得路径,默认是 true , 启用之后 type参数无效 - * @param type - 可选,以谁的基本路径为准 - */ -Se(Tt, "requireLib", (e, t = !0, r = Le.BasePathType_None) => { - if (!he.hasNodeEnv()) - throw new Error("require ony works on node env"); - let a = e; - if (!t) - switch (r) { - case Le.BasePathType_Appearance: - a = Me.joinPath(Me.siyuanAppearancePath(), e); - break; - case Le.BasePathType_Data: - a = Me.joinPath(Me.siyuanDataPath(), e); - break; - case Le.BasePathType_Themes: - a = Me.joinPath(Me.siyuanAppearancePath(), "themes", e); - break; - case Le.BasePathType_ZhiTheme: - a = Me.joinPath(Me.siyuanAppearancePath(), "themes", "zhi", e); - break; - default: - throw new Error("type must be provided when not use absolute path"); - } - const s = Me.siyuanWindow(); - if (!s) - return require(a); - if (typeof s.require < "u") - return s.require(a); -}), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 appearance 的相对路径 -*/ -Se(Tt, "requireAppearanceLib", (e) => Me.requireLib(e, !1, Le.BasePathType_Appearance)), /** -* 引入依赖,以 data 的基本路径为准 -* -* @param libpath - 相对于 data 的相对路径 -*/ -Se(Tt, "requireDataLib", (e) => Me.requireLib(e, !1, Le.BasePathType_Data)), /** -* 引入依赖,以 theme 的基本路径为准 -* -* @param libpath - 相对于 theme 的相对路径 -*/ -Se(Tt, "requireThemesLib", (e) => Me.requireLib(e, !1, Le.BasePathType_Themes)), /** -* 引入依赖,以 ZhiTheme 的基本路径为准 -* -* @param libpath - 相对于 ZhiTheme 的相对路径 -*/ -Se(Tt, "requireZhiThemeLib", (e) => Me.requireLib(e, !1, Le.BasePathType_ZhiTheme)); -const Ke = { - white: (e) => he.isElectron() ? He.whiteBright(e) : ae.white(e), - gray: (e) => he.isElectron() ? He.gray(e) : ae.gray(e), - blue: (e) => he.isElectron() ? He.blue(e) : ae.blue(e), - green: (e) => he.isElectron() ? He.green(e) : ae.green(e), - yellow: (e) => he.isElectron() ? He.yellow(e) : ae.yellow(e), - red: (e) => he.isElectron() ? He.red(e) : ae.red(e), - bgWhite: (e) => he.isElectron() ? He.bgWhiteBright(e) : ae.bgWhite(e), - bgGrey: (e) => he.isElectron() ? He.bgCyanBright(e) : ae.bgCyan(e), - bgBlue: (e) => he.isElectron() ? He.bgBlueBright(e) : ae.bgBlue(e), - bgGreen: (e) => he.isElectron() ? He.bgGreenBright(e) : ae.bgGreen(e), - bgYellow: (e) => he.isElectron() ? He.bgYellowBright(e) : ae.bgYellow(e), - bgRed: (e) => he.isElectron() ? He.bgRedBright(e) : ae.bgRed(e) -}; -class dd { - constructor(t, r, a) { - Gt(this, "consoleLogger", "console"), Gt(this, "stackSize", 1), Gt(this, "getLogger", (d) => { - let b; - if (d) - b = d; - else { - const _ = this.getCallStack(), y = [], m = []; - for (let k = 0; k < _.length; k++) { - const N = _[k], A = N.getFileName() ?? "none"; - if (k > this.stackSize - 1) - break; - const j = A + "-" + N.getLineNumber() + ":" + N.getColumnNumber(); - y.push(j); - } - m.length > 0 && (b = y.join(" -> ")); - } - return (!b || b.trim().length === 0) && (b = this.consoleLogger), Lr.getLogger(b); - }), this.stackSize = 1; - let s; - t ? s = t : s = mr.getEnvLevel(a), s = s ?? et.LOG_LEVEL_INFO, Lr.setLevel(s); - const l = (d, b, _, y) => { - const m = [], k = r ?? mr.getEnvLogger(a) ?? "zhi"; - return m.push(Ke.gray("[") + y(k) + Ke.gray("]")), m.push(Ke.gray("[") + Ke.gray(_.toString()) + Ke.gray("]")), m.push(y(d.toUpperCase().toString())), m.push(y(b)), m.push(Ke.gray(":")), m; - }; - Qn.reg(Lr), Qn.apply(Lr, { - format(d, b, _) { - let y = []; - const m = b ?? ""; - switch (d) { - case et.LOG_LEVEL_TRACE: - y = l(d, m, _, Ke.gray); - break; - case et.LOG_LEVEL_DEBUG: - y = l(d, m, _, Ke.blue); - break; - case et.LOG_LEVEL_INFO: - y = l(d, m, _, Ke.green); - break; - case et.LOG_LEVEL_WARN: - y = l(d, m, _, Ke.yellow); - break; - case et.LOG_LEVEL_ERROR: - y = l(d, m, _, Ke.red); - break; - default: - y = l(et.LOG_LEVEL_INFO, m, _, Ke.green); - break; - } - return y.join(" "); - } - }); - } - /** - * 设置输出栈的深度,默认1 - * - * @param stackSize - 栈的深度 - */ - setStackSize(t) { - this.stackSize = t ?? 1; - } - /** - * 获取调用堆栈,若未获取到直接返回空数组 - * - * @author terwer - * @since 1.6.0 - */ - getCallStack() { - let t; - try { - t = rd(); - } catch { - t = []; - } - return t; - } -} -class hd { - /** - * 默认日志级别 - * - * @param level - 可选,未设置默认INFO - * @param sign - 可选前缀,默认zhi - * @param env - 可选环境变量实例 - */ - constructor(t, r, a) { - Gt(this, "logger"), this.logger = new dd(t, r, a); - } - /** - * 获取日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - * @protected - */ - getLogger(t, r) { - return this.logger.setStackSize(r), this.logger.getLogger(t); - } -} -class ro extends hd { - constructor(t, r, a) { - super(t, r, a); - } - /** - * 获取默认的日志记录器 - * - * @param loggerName - 日志记录器名称 - * @param stackSize - 打印栈的深度 - */ - getLogger(t, r) { - return super.getLogger(t, r); - } -} -class Wr { - /** - * 默认日志记录器 - * - * @param stackSize - 栈的深度 - * @param env - 环境变量实例 - */ - static defaultLogger(t, r) { - return Wr.customLogFactory(void 0, void 0, t).getLogger(void 0, r); - } - /** - * 自定义日志工厂 - * - * @param level - 级别 - * @param sign - 标志 - * @param env - 环境变量 - */ - static customLogFactory(t, r, a) { - return new ro(t, r, a); - } - /** - * 自定义日志工厂,自定义前缀 - * - * @param sign - 标志 - * @param env - 环境变量 - */ - static customSignLogFactory(t, r) { - return new ro(void 0, t, r); - } -} -class Jr { -} -/** - * 思源 API 伺服地址 - */ -$e(Jr, "VITE_SIYUAN_API_URL_KEY", "VITE_SIYUAN_API_URL"), /** - * 思源 token - */ -$e(Jr, "VITE_SIYUAN_AUTH_TOKEN_KEY", "VITE_SIYUAN_AUTH_TOKEN"); -class gr { - /** - * 通用环境变量 - * - * @param appInstance - 插件实例 - */ - static zhiEnv(t) { - return this.env || (this.env = new t.zhiEnv.Env({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 })), this.env; - } - /** - * 通用日志 - * - * @param appInstance - 应用实例 - * @param loggerName - 日志名称 - */ - static zhiLog(t, r) { - const a = this.zhiEnv(t); - return t.zhiCommon.ZhiUtil.initEnv(a), t.zhiCommon.ZhiUtil.zhiLogWithSign("publisher", r); - } - /** - * 通用工具入口 - * - * @param appInstance - 应用实例 - */ - static zhiCommon(t) { - return t.zhiCommon.ZhiUtil.zhiCommon(); - } -} -$e(gr, "env"); -class ea { - /** - * 初始化思源服务端 API - * - * @param cfg - 环境变量 或者 配置项 - */ - constructor(t) { - /** - * 思源笔记服务端API版本号 - */ - $e(this, "VERSION"); - $e(this, "logger"); - $e(this, "env"); - $e(this, "common"); - $e(this, "siyuanConfig"); - if (this.VERSION = "1.0.0", t instanceof Yn) - this.siyuanConfig = t, this.logger = Wr.customLogFactory(et.LOG_LEVEL_DEBUG, "zhi").getLogger("siyuan-kernel-api"); - else { - const r = t, a = mr.getEnvLevel(r), s = r.getStringEnv(Jr.VITE_SIYUAN_API_URL_KEY), l = r.getStringEnv(Jr.VITE_SIYUAN_AUTH_TOKEN_KEY); - this.siyuanConfig = new Yn(s, l), this.logger = Wr.customLogFactory(a, "siyuan-kernel-api", r).getLogger(ea.name); - } - } - init(t) { - this.env = gr.zhiEnv(t), this.common = gr.zhiCommon(t); - } - /** - * 分页获取根文档 - * - * @param keyword - 关键字 - */ - async getRootBlocksCount(t) { - const r = `SELECT COUNT(DISTINCT b1.root_id) as count - FROM blocks b1 - WHERE 1 = 1 - AND (b1.root_id ='${t}' OR (b1.content LIKE '%${t}%') OR (b1.tag LIKE '%${t}%') - )`, a = await this.sql(r); - return this.logger.debug("getRootBlocksCount data=>", a[0].count), a[0].count; - } - /** - * 分页获取根文档 - - * ```sql - * select DISTINCT b2.root_id,b2.parent_id,b2.content from blocks b2 - * WHERE 1==1 - * AND b2.id IN ( - * SELECT DISTINCT b1.root_id - * FROM blocks b1 - * WHERE 1 = 1 - * AND ((b1.content LIKE '%github%') OR (b1.tag LIKE '%github%')) - * ORDER BY b1.updated DESC,b1.created DESC LIMIT 0,10 - * ) - * ORDER BY b2.updated DESC,b2.created DESC - * ``` - * - * @param page 页码 - * @param pagesize 数目 - * @param keyword 可选,搜索关键字 - */ - async getRootBlocks(t, r, a) { - const s = `select DISTINCT b2.root_id,b2.parent_id,b2.content from blocks b2 - WHERE 1==1 - AND b2.id IN ( - SELECT DISTINCT b1.root_id - FROM blocks b1 - WHERE 1 = 1 - AND (b1.root_id ='${a}' OR (b1.content LIKE '%${a}%') OR (b1.tag LIKE '%${a}%')) - ORDER BY b1.updated DESC,b1.created DESC LIMIT ${t * r},${r} - ) - ORDER BY b2.updated DESC,b2.created DESC`; - return await this.sql(s); - } - /** - * 获取该文档下面的子文档个数 - * - * ```sql - * SELECT COUNT(DISTINCT b1.root_id) AS count - * FROM blocks b1 - * WHERE b1.path LIKE '%/20220927094918-1d85uyp%'; - * ``` - * - * @param docId 文档ID - */ - async getSubdocCount(t) { - const r = `SELECT COUNT(DISTINCT b1.root_id) AS count - FROM blocks b1 - WHERE b1.root_id='${t}' OR b1.path LIKE '%/${t}%'`; - return (await this.sql(r))[0].count; - } - /** - * 分页获取子文档 - * - * ```sql - * SELECT DISTINCT b2.root_id,b2.content,b2.path FROM blocks b2 - * WHERE b2.id IN ( - * SELECT DISTINCT b1.root_id - * FROM blocks b1 - * WHERE b1.path like '%/20220927094918-1d85uyp%' - * AND ((b1.content LIKE '%文档%') OR (b1.tag LIKE '%文档%')) - * ORDER BY b1.updated DESC,b1.created DESC LIMIT 0,10 - * ) - * ORDER BY b2.updated DESC,b2.created DESC - * ``` - * - * @param docId 文档ID - * @param page 页码 - * @param pagesize 数目 - * @param keyword 关键字 - */ - async getSubdocs(t, r, a, s) { - const l = `SELECT DISTINCT b2.root_id,b2.content,b2.path FROM blocks b2 - WHERE b2.id IN ( - SELECT DISTINCT b1.root_id - FROM blocks b1 - WHERE b1.root_id='${t}' OR b1.path like '%/${t}%' - AND ((b1.content LIKE '%${s}%') OR (b1.tag LIKE '%${s}%')) - ORDER BY b1.updated DESC,b1.created DESC LIMIT ${r * a},${a} - ) - ORDER BY b2.content,b2.updated DESC,b2.created DESC,id`; - return this.logger.debug("siyuanApi getSubdocs sql=>", l), await this.sql(l); - } - /** - * 以id获取思源块信息 - * @param blockId 块ID - */ - async getBlockByID(t) { - const r = `select * - from blocks - where id = '${t}'`, a = await this.sql(r); - if (!a || a.length === 0) - throw new Error("通过ID查询块信息失败"); - return a[0]; - } - /** - * 以slug获取思源块信息 - * @param slug 内容快别名 - */ - async getRootBlockBySlug(t) { - const r = `select root_id from attributes where name='custom-slug' and value='${t}' limit 1`; - return (await this.sql(r))[0]; - } - /** - * 以内容块ID获取根块 - * - * @param blockID 内容块ID - */ - async getRootBlock(t) { - const r = `select root_id from blocks where id='${t}' limit 1`; - return (await this.sql(r))[0]; - } - /** - * 导出markdown文本 - * @param docId 文档id - */ - async exportMdContent(t) { - const r = { - id: t - }, a = "/api/export/exportMdContent"; - return await this.siyuanRequest(a, r); - } - /** - * 以sql发送请求 - * - * @param sql - sql - */ - async sql(t) { - const r = { - stmt: t - }, a = "/api/query/sql"; - return this.env.isDev() && this.logger.trace("sql=>", t), await this.siyuanRequest(a, r); - } - /** - * 向思源请求数据 - * - * @param url - url - * @param data - 数据 - */ - async siyuanRequest(t, r) { - const a = `${this.siyuanConfig.apiUrl}${t}`, s = { - body: JSON.stringify(r), - method: "POST" - }; - this.common.strUtil.isEmptyString(this.siyuanConfig.password) || Object.assign(s, { - headers: { - Authorization: `Token ${this.siyuanConfig.password}` - } - }), this.env.isDev() && (this.logger.trace("开始向思源请求数据,reqUrl=>", a), this.logger.trace("开始向思源请求数据,fetchOps=>", s)); - const d = await (await fetch(a, s)).json(); - if (this.env.isDev() && this.logger.trace("思源请求数据返回,resJson=>", d), d.code === -1) - throw new Error(d.msg); - return d.code === 0 ? d.data : null; - } - /** - * 列出笔记本 - */ - async lsNotebooks() { - return await this.siyuanRequest("/api/notebook/lsNotebooks", {}); - } - /** - * 打开笔记本 - * - * @param notebookId - 笔记本ID - */ - async openNotebook(t) { - return await this.siyuanRequest("/api/notebook/openNotebook", { - notebook: t - }); - } - /** - * 关闭笔记本 - * - * @param notebookId - 笔记本ID - */ - async closeNotebook(t) { - return await this.siyuanRequest("/api/notebook/closeNotebook", { - notebook: t - }); - } - /** - * 重命名笔记本 - * - * @param notebookId - 笔记本ID - * @param name - 新笔记本名称 - */ - async renameNotebook(t, r) { - return await this.siyuanRequest("/api/notebook/renameNotebook", { - notebook: t, - name: r - }); - } - /** - * 创建笔记本 - * - * @param name - 新笔记本名称 - */ - async createNotebook(t) { - return await this.siyuanRequest("/api/notebook/createNotebook", { - name: t - }); - } - /** - * 删除笔记本 - * - * @param notebookId - 笔记本ID - */ - async removeNotebook(t) { - return await this.siyuanRequest("/api/notebook/removeNotebook", { - notebook: t - }); - } - /** - * 获取笔记本配置 - * - * @param notebookId - 笔记本ID - */ - async getNotebookConf(t) { - return await this.siyuanRequest("/api/notebook/getNotebookConf", { - notebook: t - }); - } - /** - * 保存笔记本配置 - * - * ```json - * { - * "notebook": "20210817205410-2kvfpfn", - * "conf": { - * "name": "测试笔记本", - * "closed": false, - * "refCreateSavePath": "", - * "createDocNameTemplate": "", - * "dailyNoteSavePath": "/daily note/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}", - * "dailyNoteTemplatePath": "" - * } - * } - * ``` - * @param notebookConf - 笔记本配置 - */ - async setNotebookConf(t) { - return await this.siyuanRequest("/api/notebook/setNotebookConf", t); - } - /** - * 推送消息 - * - * 参数 - * - * ```json - * { - * "msg": "test", - * "timeout": 7000 - * } - * ``` - * - * timeout:消息持续显示时间,单位为毫秒。可以不传入该字段,默认为 7000 毫秒 - * - * 返回值 - * - * ``` - * { - * "code": 0, - * "msg": "", - * "data": { - * "id": "62jtmqi" - * } - * } - * - * id:消息 ID - * ``` - * - * @param msgObj 消息体 - */ - async pushMsg(t) { - return await this.siyuanRequest("/api/notification/pushMsg", t); - } - /** - * 推送报错消息 - * - * 参数 - * - * ``` - * { - * "msg": "test", - * "timeout": 7000 - * } - * ``` - * - * timeout:消息持续显示时间,单位为毫秒。可以不传入该字段,默认为 7000 毫秒 - * - * 返回值 - * - * ``` - * { - * "code": 0, - * "msg": "", - * "data": { - * "id": "qc9znut" - * } - * } - * - * id:消息 ID - * ``` - * - * @param msgObj - */ - async pushErrMsg(t) { - return await this.siyuanRequest("/api/notification/pushErrMsg", t); - } - /** - * 获取块属性 - * @param blockId - */ - async getBlockAttrs(t) { - const r = { - id: t - }, a = "/api/attr/getBlockAttrs"; - return await this.siyuanRequest(a, r); - } - /** - * 设置块属性 - * @param blockId - * @param attrs - */ - async setBlockAttrs(t, r) { - const a = "/api/attr/setBlockAttrs"; - return await this.siyuanRequest(a, { - id: t, - attrs: r - }); - } -} -class pd { -} -class md { - /** - * 构造思源 API对象 - * - * @param cfg - 环境变量 或者 配置项 - */ - constructor(t) { - /** - * 思源笔记内核API - */ - $e(this, "kernelApi"); - /** - * 思源笔记客户端API - */ - $e(this, "clientApi"); - this.kernelApi = new ea(t), this.clientApi = new pd(); - } -} -class gd { - /** - * 初始化思源 API 适配器 - * - * @param cfg - 环境变量 或者 配置项 - */ - constructor(t) { - $e(this, "logger"); - $e(this, "common"); - $e(this, "siyuanKernelApi"); - $e(this, "cfg"); - this.siyuanKernelApi = new ea(t), this.cfg = this.siyuanKernelApi.siyuanConfig; - } - init(t) { - this.logger = gr.zhiLog(t, "siyuan-api-adaptor"), this.common = gr.zhiCommon(t), this.siyuanKernelApi.init(t); - } - async deletePost(t) { - return console.log(t), Promise.resolve(!1); - } - async editPost(t, r, a) { - return console.log(`${t} ${r} ${a}`), Promise.resolve(!1); - } - async getCategories() { - return Promise.resolve([]); - } - async getPost(t, r, a) { - let s = t; - if (r) { - const j = await this.siyuanKernelApi.getRootBlockBySlug(t); - j && (s = j.root_id); - } - const l = await this.siyuanKernelApi.getBlockByID(s); - if (!l) - throw new Error("文章不存存在,postid=>" + s); - const d = await this.siyuanKernelApi.getBlockAttrs(s); - let b = !0; - (d["custom-publish-status"] || "draft") === "secret" && (b = !1); - const y = d["custom-post-password"] || "", m = d["custom-desc"] || ""; - let k = l.content ?? ""; - this.cfg.fixTitle && (k = this.common.htmlUtil.removeTitleNumber(k)); - let N; - if (!a) { - const j = await this.siyuanKernelApi.exportMdContent(s); - N = await this.common.markdownUtil.renderHTML(j.content), N = this.common.htmlUtil.removeWidgetTag(N), this.cfg.fixTitle && (N = this.common.htmlUtil.removeH1(N)); - } - const A = new _n(); - return A.postid = l.root_id || "", A.title = k || "", A.description = N || "", A.shortDesc = m || "", A.mt_keywords = d.tags || "", A.post_status = b ? Br.PostStatusEnum_Publish : Br.PostStatusEnum_Draft, A.wp_password = y, A; - } - async getPreviewUrl(t) { - return console.log(t), Promise.resolve(""); - } - async getRecentPosts(t, r, a) { - const s = []; - let l = 0; - r && (l = r); - const d = a ?? "", b = await this.siyuanKernelApi.getRootBlocks(l, t, d); - this.logger.debug("getRecentPosts from siyuan, get counts =>", b.length); - for (let _ = 0; _ < b.length; _++) { - const y = b[_], m = await this.siyuanKernelApi.getBlockAttrs(y.root_id), k = await this.getPost(y.root_id, !1, !0), N = m["custom-slug"] || ""; - let A = y.content ?? ""; - this.cfg.fixTitle && (A = this.common.htmlUtil.removeTitleNumber(A)); - const j = new _n(); - j.postid = y.root_id, j.title = A, j.permalink = N === "" ? this.common.strUtil.appendStr("/post/", y.root_id) : this.common.strUtil.appendStr("/post/", N, ".html"), j.mt_keywords = k.mt_keywords, j.description = k.description, s.push(j); - } - return s; - } - async getRecentPostsCount(t) { - return await this.siyuanKernelApi.getRootBlocksCount(t ?? ""); - } - async getUsersBlogs() { - return Promise.resolve([]); - } - newMediaObject(t) { - return console.log(t), Promise.resolve({}); - } - async newPost(t, r) { - return console.log(`${t} ${r}`), Promise.resolve(""); - } -} -export { - gd as SiYuanApiAdaptor, - md as SiyuanApi, - Yn as SiyuanConfig, - Jr as SiyuanConstants, - ea as SiyuanKernelApi -}; diff --git a/public/libs/zhi-siyuan-api/lib/ISiyuanKernelApi.d.ts b/public/libs/zhi-siyuan-api/lib/ISiyuanKernelApi.d.ts deleted file mode 100644 index 0856cc66..00000000 --- a/public/libs/zhi-siyuan-api/lib/ISiyuanKernelApi.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 思源 API 返回类型 - */ -interface SiyuanData { - /** - * 非 0 为异常情况 - */ - code: number; - /** - * 正常情况下是空字符串,异常情况下会返回错误文案 - */ - msg: string; - /** - * 可能为 \{\}、[] 或者 NULL,根据不同接口而不同 - */ - data: any[] | object | null | undefined; -} -/** - * 思源笔记内核接口定义 - * - * @see {@link https://github.com/siyuan-note/siyuan/blob/master/API_zh_CN.md#%E9%89%B4%E6%9D%83 siyuan-api} - * @see {@link https://github.com/leolee9086/noob-core/blob/master/frontEnd/noobApi/util/kernelApi.js kernelApi} - */ -interface ISiyuanKernelApi { - lsNotebooks(): Promise; - openNotebook(notebookId: string): Promise; - closeNotebook(notebookId: string): Promise; - renameNotebook(notebookId: string, name: string): Promise; - createNotebook(name: string): Promise; - removeNotebook(notebookId: string): Promise; - getNotebookConf(notebookId: string): Promise; - setNotebookConf(notebookConf: object): Promise; - pushMsg(msgObj: object): Promise; - pushErrMsg(msgObj: object): Promise; -} -export default ISiyuanKernelApi; -export type { SiyuanData }; diff --git a/public/libs/zhi-siyuan-api/lib/ZhiSiyuanApiUtil.d.ts b/public/libs/zhi-siyuan-api/lib/ZhiSiyuanApiUtil.d.ts deleted file mode 100644 index 979e2a95..00000000 --- a/public/libs/zhi-siyuan-api/lib/ZhiSiyuanApiUtil.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 工具类统一入口,每个应用自己实现 - * - * @public - * @author terwer - * @since 1.0.0 - */ -declare class ZhiSiyuanApiUtil { - private static env; - /** - * 通用环境变量 - * - * @param appInstance - 插件实例 - */ - static zhiEnv(appInstance: any): any; - /** - * 通用日志 - * - * @param appInstance - 应用实例 - * @param loggerName - 日志名称 - */ - static zhiLog(appInstance: any, loggerName: string): any; - /** - * 通用工具入口 - * - * @param appInstance - 应用实例 - */ - static zhiCommon(appInstance: any): any; -} -export default ZhiSiyuanApiUtil; diff --git a/public/libs/zhi-siyuan-api/lib/siYuanApiAdaptor.d.ts b/public/libs/zhi-siyuan-api/lib/siYuanApiAdaptor.d.ts deleted file mode 100644 index 2401719c..00000000 --- a/public/libs/zhi-siyuan-api/lib/siYuanApiAdaptor.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { CategoryInfo, IBlogApi, MediaObject, Post, UserBlog } from "zhi-blog-api"; -import { Env } from "zhi-env"; -import SiyuanConfig from "./siyuanConfig"; -/** - * 思源笔记API适配器 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class SiYuanApiAdaptor implements IBlogApi { - private logger; - private common; - private readonly siyuanKernelApi; - private readonly cfg; - /** - * 初始化思源 API 适配器 - * - * @param cfg - 环境变量 或者 配置项 - */ - constructor(cfg: Env | SiyuanConfig); - init(appInstance: any): void; - deletePost(postid: string): Promise; - editPost(postid: string, post: Post, publish?: boolean): Promise; - getCategories(): Promise; - getPost(postid: string, useSlug?: boolean, skipBody?: boolean): Promise; - getPreviewUrl(postid: string): Promise; - getRecentPosts(numOfPosts: number, page?: number, keyword?: string): Promise>; - getRecentPostsCount(keyword?: string): Promise; - getUsersBlogs(): Promise>; - newMediaObject(mediaObject: MediaObject): Promise; - newPost(post: Post, publish?: boolean): Promise; -} -export default SiYuanApiAdaptor; diff --git a/public/libs/zhi-siyuan-api/lib/siyuanApi.d.ts b/public/libs/zhi-siyuan-api/lib/siyuanApi.d.ts deleted file mode 100644 index b3a1d7e0..00000000 --- a/public/libs/zhi-siyuan-api/lib/siyuanApi.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Env } from "zhi-env"; -import SiyuanConfig from "./siyuanConfig"; -import SiyuanKernelApi from "./siyuanKernelApi"; -import SiyuanClientApi from "./siyuanClientApi"; -/** - * 思源笔记API - * - * @author terwer - * @since 1.0.0 - */ -declare class SiyuanApi { - /** - * 思源笔记内核API - */ - readonly kernelApi: SiyuanKernelApi; - /** - * 思源笔记客户端API - */ - readonly clientApi: SiyuanClientApi; - /** - * 构造思源 API对象 - * - * @param cfg - 环境变量 或者 配置项 - */ - constructor(cfg: Env | SiyuanConfig); -} -export default SiyuanApi; diff --git a/public/libs/zhi-siyuan-api/lib/siyuanClientApi.d.ts b/public/libs/zhi-siyuan-api/lib/siyuanClientApi.d.ts deleted file mode 100644 index d4dc66f2..00000000 --- a/public/libs/zhi-siyuan-api/lib/siyuanClientApi.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare class SiyuanClientApi { -} -export default SiyuanClientApi; diff --git a/public/libs/zhi-siyuan-api/lib/siyuanConfig.d.ts b/public/libs/zhi-siyuan-api/lib/siyuanConfig.d.ts deleted file mode 100644 index 95b1155e..00000000 --- a/public/libs/zhi-siyuan-api/lib/siyuanConfig.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BlogConfig } from "zhi-blog-api"; -import SiyuanPlaceholder from "./siyuanPlaceholder"; -/** - * 思源笔记配置 - * - * @author terwer - * @since 1.0.0 - */ -declare class SiyuanConfig extends BlogConfig { - /** - * 思源笔记伺服地址 - */ - apiUrl: string; - /** - * 思源笔记 API token - */ - password: string; - /** - * 思源笔记操作提示 - * - * @protected - */ - placeholder: SiyuanPlaceholder; - /** - * 是否修复标题 - * - * @protected - */ - fixTitle: boolean; - constructor(apiUrl?: string, password?: string); -} -export default SiyuanConfig; diff --git a/public/libs/zhi-siyuan-api/lib/siyuanConstants.d.ts b/public/libs/zhi-siyuan-api/lib/siyuanConstants.d.ts deleted file mode 100644 index 9d5aa176..00000000 --- a/public/libs/zhi-siyuan-api/lib/siyuanConstants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 预定义思源变量 - * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 - */ -declare class SiyuanConstants { - /** - * 思源 API 伺服地址 - */ - static VITE_SIYUAN_API_URL_KEY: string; - /** - * 思源 token - */ - static VITE_SIYUAN_AUTH_TOKEN_KEY: string; -} -export default SiyuanConstants; diff --git a/public/libs/zhi-siyuan-api/lib/siyuanKernelApi.d.ts b/public/libs/zhi-siyuan-api/lib/siyuanKernelApi.d.ts deleted file mode 100644 index e201b139..00000000 --- a/public/libs/zhi-siyuan-api/lib/siyuanKernelApi.d.ts +++ /dev/null @@ -1,263 +0,0 @@ -import { Env } from "zhi-env"; -import SiyuanConfig from "./siyuanConfig"; -import ISiyuanKernelApi, { type SiyuanData } from "./ISiyuanKernelApi"; -/** - * 思源笔记服务端API v2.8.2 - * - * 1. 均是 POST 方法 - * - * 2. 需要带参的接口,参数为 JSON 字符串,放置到 body 里,标头 Content-Type 为 application/json - * - * 3. 鉴权:在 `设置` - `关于` 里查看 API token,请求标头:Authorization: Token xxx - * - * @public - * @author terwer - * @since 1.0.0 - * @see {@link https://github.com/siyuan-note/siyuan/blob/master/API_zh_CN.md#%E9%89%B4%E6%9D%83 siyuan-api} - * @see {@link https://github.com/leolee9086/noob-core/blob/master/frontEnd/noobApi/util/kernelApi.js kernelApi} - */ -declare class SiyuanKernelApi implements ISiyuanKernelApi { - /** - * 思源笔记服务端API版本号 - */ - readonly VERSION: string; - private logger; - private env; - private common; - readonly siyuanConfig: SiyuanConfig; - /** - * 初始化思源服务端 API - * - * @param cfg - 环境变量 或者 配置项 - */ - constructor(cfg: Env | SiyuanConfig); - init(appInstance: any): void; - /** - * 分页获取根文档 - * - * @param keyword - 关键字 - */ - getRootBlocksCount(keyword: string): Promise; - /** - * 分页获取根文档 - - * ```sql - * select DISTINCT b2.root_id,b2.parent_id,b2.content from blocks b2 - * WHERE 1==1 - * AND b2.id IN ( - * SELECT DISTINCT b1.root_id - * FROM blocks b1 - * WHERE 1 = 1 - * AND ((b1.content LIKE '%github%') OR (b1.tag LIKE '%github%')) - * ORDER BY b1.updated DESC,b1.created DESC LIMIT 0,10 - * ) - * ORDER BY b2.updated DESC,b2.created DESC - * ``` - * - * @param page 页码 - * @param pagesize 数目 - * @param keyword 可选,搜索关键字 - */ - getRootBlocks(page: number, pagesize: number, keyword: string): Promise; - /** - * 获取该文档下面的子文档个数 - * - * ```sql - * SELECT COUNT(DISTINCT b1.root_id) AS count - * FROM blocks b1 - * WHERE b1.path LIKE '%/20220927094918-1d85uyp%'; - * ``` - * - * @param docId 文档ID - */ - getSubdocCount(docId: string): Promise; - /** - * 分页获取子文档 - * - * ```sql - * SELECT DISTINCT b2.root_id,b2.content,b2.path FROM blocks b2 - * WHERE b2.id IN ( - * SELECT DISTINCT b1.root_id - * FROM blocks b1 - * WHERE b1.path like '%/20220927094918-1d85uyp%' - * AND ((b1.content LIKE '%文档%') OR (b1.tag LIKE '%文档%')) - * ORDER BY b1.updated DESC,b1.created DESC LIMIT 0,10 - * ) - * ORDER BY b2.updated DESC,b2.created DESC - * ``` - * - * @param docId 文档ID - * @param page 页码 - * @param pagesize 数目 - * @param keyword 关键字 - */ - getSubdocs(docId: string, page: number, pagesize: number, keyword: string): Promise; - /** - * 以id获取思源块信息 - * @param blockId 块ID - */ - getBlockByID(blockId: string): Promise; - /** - * 以slug获取思源块信息 - * @param slug 内容快别名 - */ - getRootBlockBySlug(slug: string): Promise; - /** - * 以内容块ID获取根块 - * - * @param blockID 内容块ID - */ - getRootBlock(blockID: string): Promise; - /** - * 导出markdown文本 - * @param docId 文档id - */ - exportMdContent(docId: string): Promise; - /** - * 以sql发送请求 - * - * @param sql - sql - */ - sql(sql: string): Promise; - /** - * 向思源请求数据 - * - * @param url - url - * @param data - 数据 - */ - siyuanRequest(url: string, data: object): Promise; - /** - * 列出笔记本 - */ - lsNotebooks(): Promise; - /** - * 打开笔记本 - * - * @param notebookId - 笔记本ID - */ - openNotebook(notebookId: string): Promise; - /** - * 关闭笔记本 - * - * @param notebookId - 笔记本ID - */ - closeNotebook(notebookId: string): Promise; - /** - * 重命名笔记本 - * - * @param notebookId - 笔记本ID - * @param name - 新笔记本名称 - */ - renameNotebook(notebookId: string, name: string): Promise; - /** - * 创建笔记本 - * - * @param name - 新笔记本名称 - */ - createNotebook(name: string): Promise; - /** - * 删除笔记本 - * - * @param notebookId - 笔记本ID - */ - removeNotebook(notebookId: string): Promise; - /** - * 获取笔记本配置 - * - * @param notebookId - 笔记本ID - */ - getNotebookConf(notebookId: string): Promise; - /** - * 保存笔记本配置 - * - * ```json - * { - * "notebook": "20210817205410-2kvfpfn", - * "conf": { - * "name": "测试笔记本", - * "closed": false, - * "refCreateSavePath": "", - * "createDocNameTemplate": "", - * "dailyNoteSavePath": "/daily note/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}", - * "dailyNoteTemplatePath": "" - * } - * } - * ``` - * @param notebookConf - 笔记本配置 - */ - setNotebookConf(notebookConf: object): Promise; - /** - * 推送消息 - * - * 参数 - * - * ```json - * { - * "msg": "test", - * "timeout": 7000 - * } - * ``` - * - * timeout:消息持续显示时间,单位为毫秒。可以不传入该字段,默认为 7000 毫秒 - * - * 返回值 - * - * ``` - * { - * "code": 0, - * "msg": "", - * "data": { - * "id": "62jtmqi" - * } - * } - * - * id:消息 ID - * ``` - * - * @param msgObj 消息体 - */ - pushMsg(msgObj: object): Promise; - /** - * 推送报错消息 - * - * 参数 - * - * ``` - * { - * "msg": "test", - * "timeout": 7000 - * } - * ``` - * - * timeout:消息持续显示时间,单位为毫秒。可以不传入该字段,默认为 7000 毫秒 - * - * 返回值 - * - * ``` - * { - * "code": 0, - * "msg": "", - * "data": { - * "id": "qc9znut" - * } - * } - * - * id:消息 ID - * ``` - * - * @param msgObj - */ - pushErrMsg(msgObj: object): Promise; - /** - * 获取块属性 - * @param blockId - */ - getBlockAttrs(blockId: string): Promise; - /** - * 设置块属性 - * @param blockId - * @param attrs - */ - setBlockAttrs(blockId: string, attrs: any): Promise; -} -export default SiyuanKernelApi; diff --git a/public/libs/zhi-siyuan-api/lib/siyuanPlaceholder.d.ts b/public/libs/zhi-siyuan-api/lib/siyuanPlaceholder.d.ts deleted file mode 100644 index cc02ab29..00000000 --- a/public/libs/zhi-siyuan-api/lib/siyuanPlaceholder.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BlogPlaceholder } from "zhi-blog-api"; -/** - * 思源笔记操作提示 - */ -declare class SiyuanPlaceholder extends BlogPlaceholder { -} -export default SiyuanPlaceholder; diff --git a/public/libs/zhi-siyuan-api/lib/zhi-siyuan-api.d.ts b/public/libs/zhi-siyuan-api/lib/zhi-siyuan-api.d.ts deleted file mode 100644 index c6b724d0..00000000 --- a/public/libs/zhi-siyuan-api/lib/zhi-siyuan-api.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import SiyuanApi from "./siyuanApi"; -export default SiyuanApi; diff --git a/public/libs/zhi-siyuan-api/package.json b/public/libs/zhi-siyuan-api/package.json deleted file mode 100644 index 8b59007f..00000000 --- a/public/libs/zhi-siyuan-api/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "zhi-siyuan-api", - "version": "1.1.2", - "type": "module", - "description": "a siyuan-note api including both kernel and client", - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "repository": "terwer/zhi", - "homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-siyuan-api", - "author": "terwer", - "license": "GPL", - "files": [ - "dist", - "README.md" - ], - "keywords": [ - "zhi", - "lib", - "siyuan", - "note", - "api" - ], - "scripts": { - "serve": "vite", - "dev": "vite build --watch", - "build": "vite build", - "start": "vite preview", - "test": "vitest --watch" - }, - "devDependencies": { - "@terwer/eslint-config-custom": "workspace:*", - "@terwer/tsconfig": "workspace:*", - "@terwer/vite-config-custom": "workspace:*" - }, - "dependencies": { - "zhi-env": "workspace:*", - "zhi-log": "workspace:*", - "zhi-blog-api": "workspace:*" - } -} diff --git a/public/polyfills/fs.js b/public/polyfills/fs.js deleted file mode 100644 index 43dba96d..00000000 --- a/public/polyfills/fs.js +++ /dev/null @@ -1,123 +0,0 @@ -import mimes from "./mimeDb.js" -import path from "./path.js" -export let readFile = async (file) => { - let res = await fetch("/api/file/getFile", { - method: "POST", - body: JSON.stringify({ - path: file, - }), - }) - if (res.status !== 200) { - console.error(`${file}读取错误`) - } - let mime = res.headers.get("Content-Type") - if (isText(mime)) { - return await res.text() - } else { - let buf = await res.arrayBuffer() - return buf - } -} -let mimetype = {} -Object.getOwnPropertyNames(mimes).forEach((type) => { - let extensions = mimes[type]["extensions"] - if (extensions) { - extensions.forEach((extension) => { - mimetype[extension] = type - }) - } -}) -export let writeFile = async (content, path, flag) => { - if (!flag) { - let extension = path.split(".").pop() - let blob = new Blob([content], { - type: mimetype[extension] || "text/plain", - }) - let file = new File([blob], path.split("/").pop(), { - lastModified: Date.now(), - }) - return await writeFileDirectly(file, path) - } else { - return await writeFileDirectly(content, path) - } -} -export let writeFileDirectly = async (file, path) => { - let data = new FormData() - data.append("path", path) - data.append("file", file) - data.append("isDir", false) - data.append("modTime", Date.now()) - let res = await fetch("/api/file/putFile", { - method: "POST", - body: data, - }) - return await res.json() -} -export let readDir = async (path) => { - let res = await fetch("/api/file/readDir", { - method: "POST", - body: JSON.stringify({ - path: path, - }), - }) - if (res.status !== 200) { - console.error(`${path}读取错误`) - } - let { data } = await res.json() - return data -} -export let exists = async (name) => { - try { - let files = await readDir(path.dirname(name)) - let result = files.find((file) => { - return path.join(path.dirname(name), file.name) === name - }) - - return result || undefined - } catch (e) { - console.warn(`工作空间内容读取错误:${e}`) - return undefined - } -} -export let mkdir = async (path) => { - let data = new FormData() - data.append("path", path) - data.append("file", "") - data.append("isDir", true) - data.append("modTime", Date.now()) - let res = await fetch("/api/file/putFile", { - method: "POST", - body: data, - }) - return await res.json() -} - -export function isText(mime) { - if (mime && mime.startsWith("text")) { - return true - } - if (mime === "application/json") { - return true - } - if (mime === "application/x-javascript") { - return true - } else return false -} -let fs = { - readFile, - writeFile, - readDir, - exists, - mkdir, -} - -export default fs -export let initFile = async (path, data) => { - if (!(await exists(path))) { - if (data === undefined) { - await writeFile("", path) - } else { - await writeFile(data, path) - } - } -} diff --git a/public/polyfills/mimeDb.js b/public/polyfills/mimeDb.js deleted file mode 100644 index b2ef0fd9..00000000 --- a/public/polyfills/mimeDb.js +++ /dev/null @@ -1,8540 +0,0 @@ -export default { - "application/1d-interleaved-parityfec": { - source: "iana", - }, - "application/3gpdash-qoe-report+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/3gpp-ims+xml": { - source: "iana", - compressible: true, - }, - "application/3gpphal+json": { - source: "iana", - compressible: true, - }, - "application/3gpphalforms+json": { - source: "iana", - compressible: true, - }, - "application/a2l": { - source: "iana", - }, - "application/ace+cbor": { - source: "iana", - }, - "application/activemessage": { - source: "iana", - }, - "application/activity+json": { - source: "iana", - compressible: true, - }, - "application/alto-costmap+json": { - source: "iana", - compressible: true, - }, - "application/alto-costmapfilter+json": { - source: "iana", - compressible: true, - }, - "application/alto-directory+json": { - source: "iana", - compressible: true, - }, - "application/alto-endpointcost+json": { - source: "iana", - compressible: true, - }, - "application/alto-endpointcostparams+json": { - source: "iana", - compressible: true, - }, - "application/alto-endpointprop+json": { - source: "iana", - compressible: true, - }, - "application/alto-endpointpropparams+json": { - source: "iana", - compressible: true, - }, - "application/alto-error+json": { - source: "iana", - compressible: true, - }, - "application/alto-networkmap+json": { - source: "iana", - compressible: true, - }, - "application/alto-networkmapfilter+json": { - source: "iana", - compressible: true, - }, - "application/alto-updatestreamcontrol+json": { - source: "iana", - compressible: true, - }, - "application/alto-updatestreamparams+json": { - source: "iana", - compressible: true, - }, - "application/aml": { - source: "iana", - }, - "application/andrew-inset": { - source: "iana", - extensions: ["ez"], - }, - "application/applefile": { - source: "iana", - }, - "application/applixware": { - source: "apache", - extensions: ["aw"], - }, - "application/at+jwt": { - source: "iana", - }, - "application/atf": { - source: "iana", - }, - "application/atfx": { - source: "iana", - }, - "application/atom+xml": { - source: "iana", - compressible: true, - extensions: ["atom"], - }, - "application/atomcat+xml": { - source: "iana", - compressible: true, - extensions: ["atomcat"], - }, - "application/atomdeleted+xml": { - source: "iana", - compressible: true, - extensions: ["atomdeleted"], - }, - "application/atomicmail": { - source: "iana", - }, - "application/atomsvc+xml": { - source: "iana", - compressible: true, - extensions: ["atomsvc"], - }, - "application/atsc-dwd+xml": { - source: "iana", - compressible: true, - extensions: ["dwd"], - }, - "application/atsc-dynamic-event-message": { - source: "iana", - }, - "application/atsc-held+xml": { - source: "iana", - compressible: true, - extensions: ["held"], - }, - "application/atsc-rdt+json": { - source: "iana", - compressible: true, - }, - "application/atsc-rsat+xml": { - source: "iana", - compressible: true, - extensions: ["rsat"], - }, - "application/atxml": { - source: "iana", - }, - "application/auth-policy+xml": { - source: "iana", - compressible: true, - }, - "application/bacnet-xdd+zip": { - source: "iana", - compressible: false, - }, - "application/batch-smtp": { - source: "iana", - }, - "application/bdoc": { - compressible: false, - extensions: ["bdoc"], - }, - "application/beep+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/calendar+json": { - source: "iana", - compressible: true, - }, - "application/calendar+xml": { - source: "iana", - compressible: true, - extensions: ["xcs"], - }, - "application/call-completion": { - source: "iana", - }, - "application/cals-1840": { - source: "iana", - }, - "application/captive+json": { - source: "iana", - compressible: true, - }, - "application/cbor": { - source: "iana", - }, - "application/cbor-seq": { - source: "iana", - }, - "application/cccex": { - source: "iana", - }, - "application/ccmp+xml": { - source: "iana", - compressible: true, - }, - "application/ccxml+xml": { - source: "iana", - compressible: true, - extensions: ["ccxml"], - }, - "application/cdfx+xml": { - source: "iana", - compressible: true, - extensions: ["cdfx"], - }, - "application/cdmi-capability": { - source: "iana", - extensions: ["cdmia"], - }, - "application/cdmi-container": { - source: "iana", - extensions: ["cdmic"], - }, - "application/cdmi-domain": { - source: "iana", - extensions: ["cdmid"], - }, - "application/cdmi-object": { - source: "iana", - extensions: ["cdmio"], - }, - "application/cdmi-queue": { - source: "iana", - extensions: ["cdmiq"], - }, - "application/cdni": { - source: "iana", - }, - "application/cea": { - source: "iana", - }, - "application/cea-2018+xml": { - source: "iana", - compressible: true, - }, - "application/cellml+xml": { - source: "iana", - compressible: true, - }, - "application/cfw": { - source: "iana", - }, - "application/city+json": { - source: "iana", - compressible: true, - }, - "application/clr": { - source: "iana", - }, - "application/clue+xml": { - source: "iana", - compressible: true, - }, - "application/clue_info+xml": { - source: "iana", - compressible: true, - }, - "application/cms": { - source: "iana", - }, - "application/cnrp+xml": { - source: "iana", - compressible: true, - }, - "application/coap-group+json": { - source: "iana", - compressible: true, - }, - "application/coap-payload": { - source: "iana", - }, - "application/commonground": { - source: "iana", - }, - "application/conference-info+xml": { - source: "iana", - compressible: true, - }, - "application/cose": { - source: "iana", - }, - "application/cose-key": { - source: "iana", - }, - "application/cose-key-set": { - source: "iana", - }, - "application/cpl+xml": { - source: "iana", - compressible: true, - extensions: ["cpl"], - }, - "application/csrattrs": { - source: "iana", - }, - "application/csta+xml": { - source: "iana", - compressible: true, - }, - "application/cstadata+xml": { - source: "iana", - compressible: true, - }, - "application/csvm+json": { - source: "iana", - compressible: true, - }, - "application/cu-seeme": { - source: "apache", - extensions: ["cu"], - }, - "application/cwt": { - source: "iana", - }, - "application/cybercash": { - source: "iana", - }, - "application/dart": { - compressible: true, - }, - "application/dash+xml": { - source: "iana", - compressible: true, - extensions: ["mpd"], - }, - "application/dash-patch+xml": { - source: "iana", - compressible: true, - extensions: ["mpp"], - }, - "application/dashdelta": { - source: "iana", - }, - "application/davmount+xml": { - source: "iana", - compressible: true, - extensions: ["davmount"], - }, - "application/dca-rft": { - source: "iana", - }, - "application/dcd": { - source: "iana", - }, - "application/dec-dx": { - source: "iana", - }, - "application/dialog-info+xml": { - source: "iana", - compressible: true, - }, - "application/dicom": { - source: "iana", - }, - "application/dicom+json": { - source: "iana", - compressible: true, - }, - "application/dicom+xml": { - source: "iana", - compressible: true, - }, - "application/dii": { - source: "iana", - }, - "application/dit": { - source: "iana", - }, - "application/dns": { - source: "iana", - }, - "application/dns+json": { - source: "iana", - compressible: true, - }, - "application/dns-message": { - source: "iana", - }, - "application/docbook+xml": { - source: "apache", - compressible: true, - extensions: ["dbk"], - }, - "application/dots+cbor": { - source: "iana", - }, - "application/dskpp+xml": { - source: "iana", - compressible: true, - }, - "application/dssc+der": { - source: "iana", - extensions: ["dssc"], - }, - "application/dssc+xml": { - source: "iana", - compressible: true, - extensions: ["xdssc"], - }, - "application/dvcs": { - source: "iana", - }, - "application/ecmascript": { - source: "iana", - compressible: true, - extensions: ["es", "ecma"], - }, - "application/edi-consent": { - source: "iana", - }, - "application/edi-x12": { - source: "iana", - compressible: false, - }, - "application/edifact": { - source: "iana", - compressible: false, - }, - "application/efi": { - source: "iana", - }, - "application/elm+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/elm+xml": { - source: "iana", - compressible: true, - }, - "application/emergencycalldata.cap+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/emergencycalldata.comment+xml": { - source: "iana", - compressible: true, - }, - "application/emergencycalldata.control+xml": { - source: "iana", - compressible: true, - }, - "application/emergencycalldata.deviceinfo+xml": { - source: "iana", - compressible: true, - }, - "application/emergencycalldata.ecall.msd": { - source: "iana", - }, - "application/emergencycalldata.providerinfo+xml": { - source: "iana", - compressible: true, - }, - "application/emergencycalldata.serviceinfo+xml": { - source: "iana", - compressible: true, - }, - "application/emergencycalldata.subscriberinfo+xml": { - source: "iana", - compressible: true, - }, - "application/emergencycalldata.veds+xml": { - source: "iana", - compressible: true, - }, - "application/emma+xml": { - source: "iana", - compressible: true, - extensions: ["emma"], - }, - "application/emotionml+xml": { - source: "iana", - compressible: true, - extensions: ["emotionml"], - }, - "application/encaprtp": { - source: "iana", - }, - "application/epp+xml": { - source: "iana", - compressible: true, - }, - "application/epub+zip": { - source: "iana", - compressible: false, - extensions: ["epub"], - }, - "application/eshop": { - source: "iana", - }, - "application/exi": { - source: "iana", - extensions: ["exi"], - }, - "application/expect-ct-report+json": { - source: "iana", - compressible: true, - }, - "application/express": { - source: "iana", - extensions: ["exp"], - }, - "application/fastinfoset": { - source: "iana", - }, - "application/fastsoap": { - source: "iana", - }, - "application/fdt+xml": { - source: "iana", - compressible: true, - extensions: ["fdt"], - }, - "application/fhir+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/fhir+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/fido.trusted-apps+json": { - compressible: true, - }, - "application/fits": { - source: "iana", - }, - "application/flexfec": { - source: "iana", - }, - "application/font-sfnt": { - source: "iana", - }, - "application/font-tdpfr": { - source: "iana", - extensions: ["pfr"], - }, - "application/font-woff": { - source: "iana", - compressible: false, - }, - "application/framework-attributes+xml": { - source: "iana", - compressible: true, - }, - "application/geo+json": { - source: "iana", - compressible: true, - extensions: ["geojson"], - }, - "application/geo+json-seq": { - source: "iana", - }, - "application/geopackage+sqlite3": { - source: "iana", - }, - "application/geoxacml+xml": { - source: "iana", - compressible: true, - }, - "application/gltf-buffer": { - source: "iana", - }, - "application/gml+xml": { - source: "iana", - compressible: true, - extensions: ["gml"], - }, - "application/gpx+xml": { - source: "apache", - compressible: true, - extensions: ["gpx"], - }, - "application/gxf": { - source: "apache", - extensions: ["gxf"], - }, - "application/gzip": { - source: "iana", - compressible: false, - extensions: ["gz"], - }, - "application/h224": { - source: "iana", - }, - "application/held+xml": { - source: "iana", - compressible: true, - }, - "application/hjson": { - extensions: ["hjson"], - }, - "application/http": { - source: "iana", - }, - "application/hyperstudio": { - source: "iana", - extensions: ["stk"], - }, - "application/ibe-key-request+xml": { - source: "iana", - compressible: true, - }, - "application/ibe-pkg-reply+xml": { - source: "iana", - compressible: true, - }, - "application/ibe-pp-data": { - source: "iana", - }, - "application/iges": { - source: "iana", - }, - "application/im-iscomposing+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/index": { - source: "iana", - }, - "application/index.cmd": { - source: "iana", - }, - "application/index.obj": { - source: "iana", - }, - "application/index.response": { - source: "iana", - }, - "application/index.vnd": { - source: "iana", - }, - "application/inkml+xml": { - source: "iana", - compressible: true, - extensions: ["ink", "inkml"], - }, - "application/iotp": { - source: "iana", - }, - "application/ipfix": { - source: "iana", - extensions: ["ipfix"], - }, - "application/ipp": { - source: "iana", - }, - "application/isup": { - source: "iana", - }, - "application/its+xml": { - source: "iana", - compressible: true, - extensions: ["its"], - }, - "application/java-archive": { - source: "apache", - compressible: false, - extensions: ["jar", "war", "ear"], - }, - "application/java-serialized-object": { - source: "apache", - compressible: false, - extensions: ["ser"], - }, - "application/java-vm": { - source: "apache", - compressible: false, - extensions: ["class"], - }, - "application/javascript": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["js", "mjs"], - }, - "application/jf2feed+json": { - source: "iana", - compressible: true, - }, - "application/jose": { - source: "iana", - }, - "application/jose+json": { - source: "iana", - compressible: true, - }, - "application/jrd+json": { - source: "iana", - compressible: true, - }, - "application/jscalendar+json": { - source: "iana", - compressible: true, - }, - "application/json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["json", "map"], - }, - "application/json-patch+json": { - source: "iana", - compressible: true, - }, - "application/json-seq": { - source: "iana", - }, - "application/json5": { - extensions: ["json5"], - }, - "application/jsonml+json": { - source: "apache", - compressible: true, - extensions: ["jsonml"], - }, - "application/jwk+json": { - source: "iana", - compressible: true, - }, - "application/jwk-set+json": { - source: "iana", - compressible: true, - }, - "application/jwt": { - source: "iana", - }, - "application/kpml-request+xml": { - source: "iana", - compressible: true, - }, - "application/kpml-response+xml": { - source: "iana", - compressible: true, - }, - "application/ld+json": { - source: "iana", - compressible: true, - extensions: ["jsonld"], - }, - "application/lgr+xml": { - source: "iana", - compressible: true, - extensions: ["lgr"], - }, - "application/link-format": { - source: "iana", - }, - "application/load-control+xml": { - source: "iana", - compressible: true, - }, - "application/lost+xml": { - source: "iana", - compressible: true, - extensions: ["lostxml"], - }, - "application/lostsync+xml": { - source: "iana", - compressible: true, - }, - "application/lpf+zip": { - source: "iana", - compressible: false, - }, - "application/lxf": { - source: "iana", - }, - "application/mac-binhex40": { - source: "iana", - extensions: ["hqx"], - }, - "application/mac-compactpro": { - source: "apache", - extensions: ["cpt"], - }, - "application/macwriteii": { - source: "iana", - }, - "application/mads+xml": { - source: "iana", - compressible: true, - extensions: ["mads"], - }, - "application/manifest+json": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["webmanifest"], - }, - "application/marc": { - source: "iana", - extensions: ["mrc"], - }, - "application/marcxml+xml": { - source: "iana", - compressible: true, - extensions: ["mrcx"], - }, - "application/mathematica": { - source: "iana", - extensions: ["ma", "nb", "mb"], - }, - "application/mathml+xml": { - source: "iana", - compressible: true, - extensions: ["mathml"], - }, - "application/mathml-content+xml": { - source: "iana", - compressible: true, - }, - "application/mathml-presentation+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-associated-procedure-description+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-deregister+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-envelope+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-msk+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-msk-response+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-protection-description+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-reception-report+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-register+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-register-response+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-schedule+xml": { - source: "iana", - compressible: true, - }, - "application/mbms-user-service-description+xml": { - source: "iana", - compressible: true, - }, - "application/mbox": { - source: "iana", - extensions: ["mbox"], - }, - "application/media-policy-dataset+xml": { - source: "iana", - compressible: true, - extensions: ["mpf"], - }, - "application/media_control+xml": { - source: "iana", - compressible: true, - }, - "application/mediaservercontrol+xml": { - source: "iana", - compressible: true, - extensions: ["mscml"], - }, - "application/merge-patch+json": { - source: "iana", - compressible: true, - }, - "application/metalink+xml": { - source: "apache", - compressible: true, - extensions: ["metalink"], - }, - "application/metalink4+xml": { - source: "iana", - compressible: true, - extensions: ["meta4"], - }, - "application/mets+xml": { - source: "iana", - compressible: true, - extensions: ["mets"], - }, - "application/mf4": { - source: "iana", - }, - "application/mikey": { - source: "iana", - }, - "application/mipc": { - source: "iana", - }, - "application/missing-blocks+cbor-seq": { - source: "iana", - }, - "application/mmt-aei+xml": { - source: "iana", - compressible: true, - extensions: ["maei"], - }, - "application/mmt-usd+xml": { - source: "iana", - compressible: true, - extensions: ["musd"], - }, - "application/mods+xml": { - source: "iana", - compressible: true, - extensions: ["mods"], - }, - "application/moss-keys": { - source: "iana", - }, - "application/moss-signature": { - source: "iana", - }, - "application/mosskey-data": { - source: "iana", - }, - "application/mosskey-request": { - source: "iana", - }, - "application/mp21": { - source: "iana", - extensions: ["m21", "mp21"], - }, - "application/mp4": { - source: "iana", - extensions: ["mp4s", "m4p"], - }, - "application/mpeg4-generic": { - source: "iana", - }, - "application/mpeg4-iod": { - source: "iana", - }, - "application/mpeg4-iod-xmt": { - source: "iana", - }, - "application/mrb-consumer+xml": { - source: "iana", - compressible: true, - }, - "application/mrb-publish+xml": { - source: "iana", - compressible: true, - }, - "application/msc-ivr+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/msc-mixer+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/msword": { - source: "iana", - compressible: false, - extensions: ["doc", "dot"], - }, - "application/mud+json": { - source: "iana", - compressible: true, - }, - "application/multipart-core": { - source: "iana", - }, - "application/mxf": { - source: "iana", - extensions: ["mxf"], - }, - "application/n-quads": { - source: "iana", - extensions: ["nq"], - }, - "application/n-triples": { - source: "iana", - extensions: ["nt"], - }, - "application/nasdata": { - source: "iana", - }, - "application/news-checkgroups": { - source: "iana", - charset: "US-ASCII", - }, - "application/news-groupinfo": { - source: "iana", - charset: "US-ASCII", - }, - "application/news-transmission": { - source: "iana", - }, - "application/nlsml+xml": { - source: "iana", - compressible: true, - }, - "application/node": { - source: "iana", - extensions: ["cjs"], - }, - "application/nss": { - source: "iana", - }, - "application/oauth-authz-req+jwt": { - source: "iana", - }, - "application/oblivious-dns-message": { - source: "iana", - }, - "application/ocsp-request": { - source: "iana", - }, - "application/ocsp-response": { - source: "iana", - }, - "application/octet-stream": { - source: "iana", - compressible: false, - extensions: [ - "bin", - "dms", - "lrf", - "mar", - "so", - "dist", - "distz", - "pkg", - "bpk", - "dump", - "elc", - "deploy", - "exe", - "dll", - "deb", - "dmg", - "iso", - "img", - "msi", - "msp", - "msm", - "buffer", - ], - }, - "application/oda": { - source: "iana", - extensions: ["oda"], - }, - "application/odm+xml": { - source: "iana", - compressible: true, - }, - "application/odx": { - source: "iana", - }, - "application/oebps-package+xml": { - source: "iana", - compressible: true, - extensions: ["opf"], - }, - "application/ogg": { - source: "iana", - compressible: false, - extensions: ["ogx"], - }, - "application/omdoc+xml": { - source: "apache", - compressible: true, - extensions: ["omdoc"], - }, - "application/onenote": { - source: "apache", - extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"], - }, - "application/opc-nodeset+xml": { - source: "iana", - compressible: true, - }, - "application/oscore": { - source: "iana", - }, - "application/oxps": { - source: "iana", - extensions: ["oxps"], - }, - "application/p21": { - source: "iana", - }, - "application/p21+zip": { - source: "iana", - compressible: false, - }, - "application/p2p-overlay+xml": { - source: "iana", - compressible: true, - extensions: ["relo"], - }, - "application/parityfec": { - source: "iana", - }, - "application/passport": { - source: "iana", - }, - "application/patch-ops-error+xml": { - source: "iana", - compressible: true, - extensions: ["xer"], - }, - "application/pdf": { - source: "iana", - compressible: false, - extensions: ["pdf"], - }, - "application/pdx": { - source: "iana", - }, - "application/pem-certificate-chain": { - source: "iana", - }, - "application/pgp-encrypted": { - source: "iana", - compressible: false, - extensions: ["pgp"], - }, - "application/pgp-keys": { - source: "iana", - extensions: ["asc"], - }, - "application/pgp-signature": { - source: "iana", - extensions: ["asc", "sig"], - }, - "application/pics-rules": { - source: "apache", - extensions: ["prf"], - }, - "application/pidf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/pidf-diff+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/pkcs10": { - source: "iana", - extensions: ["p10"], - }, - "application/pkcs12": { - source: "iana", - }, - "application/pkcs7-mime": { - source: "iana", - extensions: ["p7m", "p7c"], - }, - "application/pkcs7-signature": { - source: "iana", - extensions: ["p7s"], - }, - "application/pkcs8": { - source: "iana", - extensions: ["p8"], - }, - "application/pkcs8-encrypted": { - source: "iana", - }, - "application/pkix-attr-cert": { - source: "iana", - extensions: ["ac"], - }, - "application/pkix-cert": { - source: "iana", - extensions: ["cer"], - }, - "application/pkix-crl": { - source: "iana", - extensions: ["crl"], - }, - "application/pkix-pkipath": { - source: "iana", - extensions: ["pkipath"], - }, - "application/pkixcmp": { - source: "iana", - extensions: ["pki"], - }, - "application/pls+xml": { - source: "iana", - compressible: true, - extensions: ["pls"], - }, - "application/poc-settings+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/postscript": { - source: "iana", - compressible: true, - extensions: ["ai", "eps", "ps"], - }, - "application/ppsp-tracker+json": { - source: "iana", - compressible: true, - }, - "application/problem+json": { - source: "iana", - compressible: true, - }, - "application/problem+xml": { - source: "iana", - compressible: true, - }, - "application/provenance+xml": { - source: "iana", - compressible: true, - extensions: ["provx"], - }, - "application/prs.alvestrand.titrax-sheet": { - source: "iana", - }, - "application/prs.cww": { - source: "iana", - extensions: ["cww"], - }, - "application/prs.cyn": { - source: "iana", - charset: "7-BIT", - }, - "application/prs.hpub+zip": { - source: "iana", - compressible: false, - }, - "application/prs.nprend": { - source: "iana", - }, - "application/prs.plucker": { - source: "iana", - }, - "application/prs.rdf-xml-crypt": { - source: "iana", - }, - "application/prs.xsf+xml": { - source: "iana", - compressible: true, - }, - "application/pskc+xml": { - source: "iana", - compressible: true, - extensions: ["pskcxml"], - }, - "application/pvd+json": { - source: "iana", - compressible: true, - }, - "application/qsig": { - source: "iana", - }, - "application/raml+yaml": { - compressible: true, - extensions: ["raml"], - }, - "application/raptorfec": { - source: "iana", - }, - "application/rdap+json": { - source: "iana", - compressible: true, - }, - "application/rdf+xml": { - source: "iana", - compressible: true, - extensions: ["rdf", "owl"], - }, - "application/reginfo+xml": { - source: "iana", - compressible: true, - extensions: ["rif"], - }, - "application/relax-ng-compact-syntax": { - source: "iana", - extensions: ["rnc"], - }, - "application/remote-printing": { - source: "iana", - }, - "application/reputon+json": { - source: "iana", - compressible: true, - }, - "application/resource-lists+xml": { - source: "iana", - compressible: true, - extensions: ["rl"], - }, - "application/resource-lists-diff+xml": { - source: "iana", - compressible: true, - extensions: ["rld"], - }, - "application/rfc+xml": { - source: "iana", - compressible: true, - }, - "application/riscos": { - source: "iana", - }, - "application/rlmi+xml": { - source: "iana", - compressible: true, - }, - "application/rls-services+xml": { - source: "iana", - compressible: true, - extensions: ["rs"], - }, - "application/route-apd+xml": { - source: "iana", - compressible: true, - extensions: ["rapd"], - }, - "application/route-s-tsid+xml": { - source: "iana", - compressible: true, - extensions: ["sls"], - }, - "application/route-usd+xml": { - source: "iana", - compressible: true, - extensions: ["rusd"], - }, - "application/rpki-ghostbusters": { - source: "iana", - extensions: ["gbr"], - }, - "application/rpki-manifest": { - source: "iana", - extensions: ["mft"], - }, - "application/rpki-publication": { - source: "iana", - }, - "application/rpki-roa": { - source: "iana", - extensions: ["roa"], - }, - "application/rpki-updown": { - source: "iana", - }, - "application/rsd+xml": { - source: "apache", - compressible: true, - extensions: ["rsd"], - }, - "application/rss+xml": { - source: "apache", - compressible: true, - extensions: ["rss"], - }, - "application/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"], - }, - "application/rtploopback": { - source: "iana", - }, - "application/rtx": { - source: "iana", - }, - "application/samlassertion+xml": { - source: "iana", - compressible: true, - }, - "application/samlmetadata+xml": { - source: "iana", - compressible: true, - }, - "application/sarif+json": { - source: "iana", - compressible: true, - }, - "application/sarif-external-properties+json": { - source: "iana", - compressible: true, - }, - "application/sbe": { - source: "iana", - }, - "application/sbml+xml": { - source: "iana", - compressible: true, - extensions: ["sbml"], - }, - "application/scaip+xml": { - source: "iana", - compressible: true, - }, - "application/scim+json": { - source: "iana", - compressible: true, - }, - "application/scvp-cv-request": { - source: "iana", - extensions: ["scq"], - }, - "application/scvp-cv-response": { - source: "iana", - extensions: ["scs"], - }, - "application/scvp-vp-request": { - source: "iana", - extensions: ["spq"], - }, - "application/scvp-vp-response": { - source: "iana", - extensions: ["spp"], - }, - "application/sdp": { - source: "iana", - extensions: ["sdp"], - }, - "application/secevent+jwt": { - source: "iana", - }, - "application/senml+cbor": { - source: "iana", - }, - "application/senml+json": { - source: "iana", - compressible: true, - }, - "application/senml+xml": { - source: "iana", - compressible: true, - extensions: ["senmlx"], - }, - "application/senml-etch+cbor": { - source: "iana", - }, - "application/senml-etch+json": { - source: "iana", - compressible: true, - }, - "application/senml-exi": { - source: "iana", - }, - "application/sensml+cbor": { - source: "iana", - }, - "application/sensml+json": { - source: "iana", - compressible: true, - }, - "application/sensml+xml": { - source: "iana", - compressible: true, - extensions: ["sensmlx"], - }, - "application/sensml-exi": { - source: "iana", - }, - "application/sep+xml": { - source: "iana", - compressible: true, - }, - "application/sep-exi": { - source: "iana", - }, - "application/session-info": { - source: "iana", - }, - "application/set-payment": { - source: "iana", - }, - "application/set-payment-initiation": { - source: "iana", - extensions: ["setpay"], - }, - "application/set-registration": { - source: "iana", - }, - "application/set-registration-initiation": { - source: "iana", - extensions: ["setreg"], - }, - "application/sgml": { - source: "iana", - }, - "application/sgml-open-catalog": { - source: "iana", - }, - "application/shf+xml": { - source: "iana", - compressible: true, - extensions: ["shf"], - }, - "application/sieve": { - source: "iana", - extensions: ["siv", "sieve"], - }, - "application/simple-filter+xml": { - source: "iana", - compressible: true, - }, - "application/simple-message-summary": { - source: "iana", - }, - "application/simplesymbolcontainer": { - source: "iana", - }, - "application/sipc": { - source: "iana", - }, - "application/slate": { - source: "iana", - }, - "application/smil": { - source: "iana", - }, - "application/smil+xml": { - source: "iana", - compressible: true, - extensions: ["smi", "smil"], - }, - "application/smpte336m": { - source: "iana", - }, - "application/soap+fastinfoset": { - source: "iana", - }, - "application/soap+xml": { - source: "iana", - compressible: true, - }, - "application/sparql-query": { - source: "iana", - extensions: ["rq"], - }, - "application/sparql-results+xml": { - source: "iana", - compressible: true, - extensions: ["srx"], - }, - "application/spdx+json": { - source: "iana", - compressible: true, - }, - "application/spirits-event+xml": { - source: "iana", - compressible: true, - }, - "application/sql": { - source: "iana", - }, - "application/srgs": { - source: "iana", - extensions: ["gram"], - }, - "application/srgs+xml": { - source: "iana", - compressible: true, - extensions: ["grxml"], - }, - "application/sru+xml": { - source: "iana", - compressible: true, - extensions: ["sru"], - }, - "application/ssdl+xml": { - source: "apache", - compressible: true, - extensions: ["ssdl"], - }, - "application/ssml+xml": { - source: "iana", - compressible: true, - extensions: ["ssml"], - }, - "application/stix+json": { - source: "iana", - compressible: true, - }, - "application/swid+xml": { - source: "iana", - compressible: true, - extensions: ["swidtag"], - }, - "application/tamp-apex-update": { - source: "iana", - }, - "application/tamp-apex-update-confirm": { - source: "iana", - }, - "application/tamp-community-update": { - source: "iana", - }, - "application/tamp-community-update-confirm": { - source: "iana", - }, - "application/tamp-error": { - source: "iana", - }, - "application/tamp-sequence-adjust": { - source: "iana", - }, - "application/tamp-sequence-adjust-confirm": { - source: "iana", - }, - "application/tamp-status-query": { - source: "iana", - }, - "application/tamp-status-response": { - source: "iana", - }, - "application/tamp-update": { - source: "iana", - }, - "application/tamp-update-confirm": { - source: "iana", - }, - "application/tar": { - compressible: true, - }, - "application/taxii+json": { - source: "iana", - compressible: true, - }, - "application/td+json": { - source: "iana", - compressible: true, - }, - "application/tei+xml": { - source: "iana", - compressible: true, - extensions: ["tei", "teicorpus"], - }, - "application/tetra_isi": { - source: "iana", - }, - "application/thraud+xml": { - source: "iana", - compressible: true, - extensions: ["tfi"], - }, - "application/timestamp-query": { - source: "iana", - }, - "application/timestamp-reply": { - source: "iana", - }, - "application/timestamped-data": { - source: "iana", - extensions: ["tsd"], - }, - "application/tlsrpt+gzip": { - source: "iana", - }, - "application/tlsrpt+json": { - source: "iana", - compressible: true, - }, - "application/tnauthlist": { - source: "iana", - }, - "application/token-introspection+jwt": { - source: "iana", - }, - "application/toml": { - compressible: true, - extensions: ["toml"], - }, - "application/trickle-ice-sdpfrag": { - source: "iana", - }, - "application/trig": { - source: "iana", - extensions: ["trig"], - }, - "application/ttml+xml": { - source: "iana", - compressible: true, - extensions: ["ttml"], - }, - "application/tve-trigger": { - source: "iana", - }, - "application/tzif": { - source: "iana", - }, - "application/tzif-leap": { - source: "iana", - }, - "application/ubjson": { - compressible: false, - extensions: ["ubj"], - }, - "application/ulpfec": { - source: "iana", - }, - "application/urc-grpsheet+xml": { - source: "iana", - compressible: true, - }, - "application/urc-ressheet+xml": { - source: "iana", - compressible: true, - extensions: ["rsheet"], - }, - "application/urc-targetdesc+xml": { - source: "iana", - compressible: true, - extensions: ["td"], - }, - "application/urc-uisocketdesc+xml": { - source: "iana", - compressible: true, - }, - "application/vcard+json": { - source: "iana", - compressible: true, - }, - "application/vcard+xml": { - source: "iana", - compressible: true, - }, - "application/vemmi": { - source: "iana", - }, - "application/vividence.scriptfile": { - source: "apache", - }, - "application/vnd.1000minds.decision-model+xml": { - source: "iana", - compressible: true, - extensions: ["1km"], - }, - "application/vnd.3gpp-prose+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp-v2x-local-service-information": { - source: "iana", - }, - "application/vnd.3gpp.5gnas": { - source: "iana", - }, - "application/vnd.3gpp.access-transfer-events+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.bsf+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.gmop+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.gtpc": { - source: "iana", - }, - "application/vnd.3gpp.interworking-data": { - source: "iana", - }, - "application/vnd.3gpp.lpp": { - source: "iana", - }, - "application/vnd.3gpp.mc-signalling-ear": { - source: "iana", - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcdata-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcdata-payload": { - source: "iana", - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcdata-signalling": { - source: "iana", - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-signed+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.mid-call+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.ngap": { - source: "iana", - }, - "application/vnd.3gpp.pfcp": { - source: "iana", - }, - "application/vnd.3gpp.pic-bw-large": { - source: "iana", - extensions: ["plb"], - }, - "application/vnd.3gpp.pic-bw-small": { - source: "iana", - extensions: ["psb"], - }, - "application/vnd.3gpp.pic-bw-var": { - source: "iana", - extensions: ["pvb"], - }, - "application/vnd.3gpp.s1ap": { - source: "iana", - }, - "application/vnd.3gpp.sms": { - source: "iana", - }, - "application/vnd.3gpp.sms+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.srvcc-ext+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.srvcc-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.state-and-event-info+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp.ussd+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.3gpp2.sms": { - source: "iana", - }, - "application/vnd.3gpp2.tcap": { - source: "iana", - extensions: ["tcap"], - }, - "application/vnd.3lightssoftware.imagescal": { - source: "iana", - }, - "application/vnd.3m.post-it-notes": { - source: "iana", - extensions: ["pwn"], - }, - "application/vnd.accpac.simply.aso": { - source: "iana", - extensions: ["aso"], - }, - "application/vnd.accpac.simply.imp": { - source: "iana", - extensions: ["imp"], - }, - "application/vnd.acucobol": { - source: "iana", - extensions: ["acu"], - }, - "application/vnd.acucorp": { - source: "iana", - extensions: ["atc", "acutc"], - }, - "application/vnd.adobe.air-application-installer-package+zip": { - source: "apache", - compressible: false, - extensions: ["air"], - }, - "application/vnd.adobe.flash.movie": { - source: "iana", - }, - "application/vnd.adobe.formscentral.fcdt": { - source: "iana", - extensions: ["fcdt"], - }, - "application/vnd.adobe.fxp": { - source: "iana", - extensions: ["fxp", "fxpl"], - }, - "application/vnd.adobe.partial-upload": { - source: "iana", - }, - "application/vnd.adobe.xdp+xml": { - source: "iana", - compressible: true, - extensions: ["xdp"], - }, - "application/vnd.adobe.xfdf": { - source: "iana", - extensions: ["xfdf"], - }, - "application/vnd.aether.imp": { - source: "iana", - }, - "application/vnd.afpc.afplinedata": { - source: "iana", - }, - "application/vnd.afpc.afplinedata-pagedef": { - source: "iana", - }, - "application/vnd.afpc.cmoca-cmresource": { - source: "iana", - }, - "application/vnd.afpc.foca-charset": { - source: "iana", - }, - "application/vnd.afpc.foca-codedfont": { - source: "iana", - }, - "application/vnd.afpc.foca-codepage": { - source: "iana", - }, - "application/vnd.afpc.modca": { - source: "iana", - }, - "application/vnd.afpc.modca-cmtable": { - source: "iana", - }, - "application/vnd.afpc.modca-formdef": { - source: "iana", - }, - "application/vnd.afpc.modca-mediummap": { - source: "iana", - }, - "application/vnd.afpc.modca-objectcontainer": { - source: "iana", - }, - "application/vnd.afpc.modca-overlay": { - source: "iana", - }, - "application/vnd.afpc.modca-pagesegment": { - source: "iana", - }, - "application/vnd.age": { - source: "iana", - extensions: ["age"], - }, - "application/vnd.ah-barcode": { - source: "iana", - }, - "application/vnd.ahead.space": { - source: "iana", - extensions: ["ahead"], - }, - "application/vnd.airzip.filesecure.azf": { - source: "iana", - extensions: ["azf"], - }, - "application/vnd.airzip.filesecure.azs": { - source: "iana", - extensions: ["azs"], - }, - "application/vnd.amadeus+json": { - source: "iana", - compressible: true, - }, - "application/vnd.amazon.ebook": { - source: "apache", - extensions: ["azw"], - }, - "application/vnd.amazon.mobi8-ebook": { - source: "iana", - }, - "application/vnd.americandynamics.acc": { - source: "iana", - extensions: ["acc"], - }, - "application/vnd.amiga.ami": { - source: "iana", - extensions: ["ami"], - }, - "application/vnd.amundsen.maze+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.android.ota": { - source: "iana", - }, - "application/vnd.android.package-archive": { - source: "apache", - compressible: false, - extensions: ["apk"], - }, - "application/vnd.anki": { - source: "iana", - }, - "application/vnd.anser-web-certificate-issue-initiation": { - source: "iana", - extensions: ["cii"], - }, - "application/vnd.anser-web-funds-transfer-initiation": { - source: "apache", - extensions: ["fti"], - }, - "application/vnd.antix.game-component": { - source: "iana", - extensions: ["atx"], - }, - "application/vnd.apache.arrow.file": { - source: "iana", - }, - "application/vnd.apache.arrow.stream": { - source: "iana", - }, - "application/vnd.apache.thrift.binary": { - source: "iana", - }, - "application/vnd.apache.thrift.compact": { - source: "iana", - }, - "application/vnd.apache.thrift.json": { - source: "iana", - }, - "application/vnd.api+json": { - source: "iana", - compressible: true, - }, - "application/vnd.aplextor.warrp+json": { - source: "iana", - compressible: true, - }, - "application/vnd.apothekende.reservation+json": { - source: "iana", - compressible: true, - }, - "application/vnd.apple.installer+xml": { - source: "iana", - compressible: true, - extensions: ["mpkg"], - }, - "application/vnd.apple.keynote": { - source: "iana", - extensions: ["key"], - }, - "application/vnd.apple.mpegurl": { - source: "iana", - extensions: ["m3u8"], - }, - "application/vnd.apple.numbers": { - source: "iana", - extensions: ["numbers"], - }, - "application/vnd.apple.pages": { - source: "iana", - extensions: ["pages"], - }, - "application/vnd.apple.pkpass": { - compressible: false, - extensions: ["pkpass"], - }, - "application/vnd.arastra.swi": { - source: "iana", - }, - "application/vnd.aristanetworks.swi": { - source: "iana", - extensions: ["swi"], - }, - "application/vnd.artisan+json": { - source: "iana", - compressible: true, - }, - "application/vnd.artsquare": { - source: "iana", - }, - "application/vnd.astraea-software.iota": { - source: "iana", - extensions: ["iota"], - }, - "application/vnd.audiograph": { - source: "iana", - extensions: ["aep"], - }, - "application/vnd.autopackage": { - source: "iana", - }, - "application/vnd.avalon+json": { - source: "iana", - compressible: true, - }, - "application/vnd.avistar+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.balsamiq.bmml+xml": { - source: "iana", - compressible: true, - extensions: ["bmml"], - }, - "application/vnd.balsamiq.bmpr": { - source: "iana", - }, - "application/vnd.banana-accounting": { - source: "iana", - }, - "application/vnd.bbf.usp.error": { - source: "iana", - }, - "application/vnd.bbf.usp.msg": { - source: "iana", - }, - "application/vnd.bbf.usp.msg+json": { - source: "iana", - compressible: true, - }, - "application/vnd.bekitzur-stech+json": { - source: "iana", - compressible: true, - }, - "application/vnd.bint.med-content": { - source: "iana", - }, - "application/vnd.biopax.rdf+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.blink-idb-value-wrapper": { - source: "iana", - }, - "application/vnd.blueice.multipass": { - source: "iana", - extensions: ["mpm"], - }, - "application/vnd.bluetooth.ep.oob": { - source: "iana", - }, - "application/vnd.bluetooth.le.oob": { - source: "iana", - }, - "application/vnd.bmi": { - source: "iana", - extensions: ["bmi"], - }, - "application/vnd.bpf": { - source: "iana", - }, - "application/vnd.bpf3": { - source: "iana", - }, - "application/vnd.businessobjects": { - source: "iana", - extensions: ["rep"], - }, - "application/vnd.byu.uapi+json": { - source: "iana", - compressible: true, - }, - "application/vnd.cab-jscript": { - source: "iana", - }, - "application/vnd.canon-cpdl": { - source: "iana", - }, - "application/vnd.canon-lips": { - source: "iana", - }, - "application/vnd.capasystems-pg+json": { - source: "iana", - compressible: true, - }, - "application/vnd.cendio.thinlinc.clientconf": { - source: "iana", - }, - "application/vnd.century-systems.tcp_stream": { - source: "iana", - }, - "application/vnd.chemdraw+xml": { - source: "iana", - compressible: true, - extensions: ["cdxml"], - }, - "application/vnd.chess-pgn": { - source: "iana", - }, - "application/vnd.chipnuts.karaoke-mmd": { - source: "iana", - extensions: ["mmd"], - }, - "application/vnd.ciedi": { - source: "iana", - }, - "application/vnd.cinderella": { - source: "iana", - extensions: ["cdy"], - }, - "application/vnd.cirpack.isdn-ext": { - source: "iana", - }, - "application/vnd.citationstyles.style+xml": { - source: "iana", - compressible: true, - extensions: ["csl"], - }, - "application/vnd.claymore": { - source: "iana", - extensions: ["cla"], - }, - "application/vnd.cloanto.rp9": { - source: "iana", - extensions: ["rp9"], - }, - "application/vnd.clonk.c4group": { - source: "iana", - extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"], - }, - "application/vnd.cluetrust.cartomobile-config": { - source: "iana", - extensions: ["c11amc"], - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - source: "iana", - extensions: ["c11amz"], - }, - "application/vnd.coffeescript": { - source: "iana", - }, - "application/vnd.collabio.xodocuments.document": { - source: "iana", - }, - "application/vnd.collabio.xodocuments.document-template": { - source: "iana", - }, - "application/vnd.collabio.xodocuments.presentation": { - source: "iana", - }, - "application/vnd.collabio.xodocuments.presentation-template": { - source: "iana", - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - source: "iana", - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - source: "iana", - }, - "application/vnd.collection+json": { - source: "iana", - compressible: true, - }, - "application/vnd.collection.doc+json": { - source: "iana", - compressible: true, - }, - "application/vnd.collection.next+json": { - source: "iana", - compressible: true, - }, - "application/vnd.comicbook+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.comicbook-rar": { - source: "iana", - }, - "application/vnd.commerce-battelle": { - source: "iana", - }, - "application/vnd.commonspace": { - source: "iana", - extensions: ["csp"], - }, - "application/vnd.contact.cmsg": { - source: "iana", - extensions: ["cdbcmsg"], - }, - "application/vnd.coreos.ignition+json": { - source: "iana", - compressible: true, - }, - "application/vnd.cosmocaller": { - source: "iana", - extensions: ["cmc"], - }, - "application/vnd.crick.clicker": { - source: "iana", - extensions: ["clkx"], - }, - "application/vnd.crick.clicker.keyboard": { - source: "iana", - extensions: ["clkk"], - }, - "application/vnd.crick.clicker.palette": { - source: "iana", - extensions: ["clkp"], - }, - "application/vnd.crick.clicker.template": { - source: "iana", - extensions: ["clkt"], - }, - "application/vnd.crick.clicker.wordbank": { - source: "iana", - extensions: ["clkw"], - }, - "application/vnd.criticaltools.wbs+xml": { - source: "iana", - compressible: true, - extensions: ["wbs"], - }, - "application/vnd.cryptii.pipe+json": { - source: "iana", - compressible: true, - }, - "application/vnd.crypto-shade-file": { - source: "iana", - }, - "application/vnd.cryptomator.encrypted": { - source: "iana", - }, - "application/vnd.cryptomator.vault": { - source: "iana", - }, - "application/vnd.ctc-posml": { - source: "iana", - extensions: ["pml"], - }, - "application/vnd.ctct.ws+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.cups-pdf": { - source: "iana", - }, - "application/vnd.cups-postscript": { - source: "iana", - }, - "application/vnd.cups-ppd": { - source: "iana", - extensions: ["ppd"], - }, - "application/vnd.cups-raster": { - source: "iana", - }, - "application/vnd.cups-raw": { - source: "iana", - }, - "application/vnd.curl": { - source: "iana", - }, - "application/vnd.curl.car": { - source: "apache", - extensions: ["car"], - }, - "application/vnd.curl.pcurl": { - source: "apache", - extensions: ["pcurl"], - }, - "application/vnd.cyan.dean.root+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.cybank": { - source: "iana", - }, - "application/vnd.cyclonedx+json": { - source: "iana", - compressible: true, - }, - "application/vnd.cyclonedx+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.d2l.coursepackage1p0+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.d3m-dataset": { - source: "iana", - }, - "application/vnd.d3m-problem": { - source: "iana", - }, - "application/vnd.dart": { - source: "iana", - compressible: true, - extensions: ["dart"], - }, - "application/vnd.data-vision.rdz": { - source: "iana", - extensions: ["rdz"], - }, - "application/vnd.datapackage+json": { - source: "iana", - compressible: true, - }, - "application/vnd.dataresource+json": { - source: "iana", - compressible: true, - }, - "application/vnd.dbf": { - source: "iana", - extensions: ["dbf"], - }, - "application/vnd.debian.binary-package": { - source: "iana", - }, - "application/vnd.dece.data": { - source: "iana", - extensions: ["uvf", "uvvf", "uvd", "uvvd"], - }, - "application/vnd.dece.ttml+xml": { - source: "iana", - compressible: true, - extensions: ["uvt", "uvvt"], - }, - "application/vnd.dece.unspecified": { - source: "iana", - extensions: ["uvx", "uvvx"], - }, - "application/vnd.dece.zip": { - source: "iana", - extensions: ["uvz", "uvvz"], - }, - "application/vnd.denovo.fcselayout-link": { - source: "iana", - extensions: ["fe_launch"], - }, - "application/vnd.desmume.movie": { - source: "iana", - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - source: "iana", - }, - "application/vnd.dm.delegation+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dna": { - source: "iana", - extensions: ["dna"], - }, - "application/vnd.document+json": { - source: "iana", - compressible: true, - }, - "application/vnd.dolby.mlp": { - source: "apache", - extensions: ["mlp"], - }, - "application/vnd.dolby.mobile.1": { - source: "iana", - }, - "application/vnd.dolby.mobile.2": { - source: "iana", - }, - "application/vnd.doremir.scorecloud-binary-document": { - source: "iana", - }, - "application/vnd.dpgraph": { - source: "iana", - extensions: ["dpg"], - }, - "application/vnd.dreamfactory": { - source: "iana", - extensions: ["dfac"], - }, - "application/vnd.drive+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ds-keypoint": { - source: "apache", - extensions: ["kpxx"], - }, - "application/vnd.dtg.local": { - source: "iana", - }, - "application/vnd.dtg.local.flash": { - source: "iana", - }, - "application/vnd.dtg.local.html": { - source: "iana", - }, - "application/vnd.dvb.ait": { - source: "iana", - extensions: ["ait"], - }, - "application/vnd.dvb.dvbisl+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.dvbj": { - source: "iana", - }, - "application/vnd.dvb.esgcontainer": { - source: "iana", - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - source: "iana", - }, - "application/vnd.dvb.ipdcesgaccess": { - source: "iana", - }, - "application/vnd.dvb.ipdcesgaccess2": { - source: "iana", - }, - "application/vnd.dvb.ipdcesgpdd": { - source: "iana", - }, - "application/vnd.dvb.ipdcroaming": { - source: "iana", - }, - "application/vnd.dvb.iptv.alfec-base": { - source: "iana", - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - source: "iana", - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.notif-container+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.notif-generic+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.notif-init+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.dvb.pfr": { - source: "iana", - }, - "application/vnd.dvb.service": { - source: "iana", - extensions: ["svc"], - }, - "application/vnd.dxr": { - source: "iana", - }, - "application/vnd.dynageo": { - source: "iana", - extensions: ["geo"], - }, - "application/vnd.dzr": { - source: "iana", - }, - "application/vnd.easykaraoke.cdgdownload": { - source: "iana", - }, - "application/vnd.ecdis-update": { - source: "iana", - }, - "application/vnd.ecip.rlp": { - source: "iana", - }, - "application/vnd.eclipse.ditto+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ecowin.chart": { - source: "iana", - extensions: ["mag"], - }, - "application/vnd.ecowin.filerequest": { - source: "iana", - }, - "application/vnd.ecowin.fileupdate": { - source: "iana", - }, - "application/vnd.ecowin.series": { - source: "iana", - }, - "application/vnd.ecowin.seriesrequest": { - source: "iana", - }, - "application/vnd.ecowin.seriesupdate": { - source: "iana", - }, - "application/vnd.efi.img": { - source: "iana", - }, - "application/vnd.efi.iso": { - source: "iana", - }, - "application/vnd.emclient.accessrequest+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.enliven": { - source: "iana", - extensions: ["nml"], - }, - "application/vnd.enphase.envoy": { - source: "iana", - }, - "application/vnd.eprints.data+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.epson.esf": { - source: "iana", - extensions: ["esf"], - }, - "application/vnd.epson.msf": { - source: "iana", - extensions: ["msf"], - }, - "application/vnd.epson.quickanime": { - source: "iana", - extensions: ["qam"], - }, - "application/vnd.epson.salt": { - source: "iana", - extensions: ["slt"], - }, - "application/vnd.epson.ssf": { - source: "iana", - extensions: ["ssf"], - }, - "application/vnd.ericsson.quickcall": { - source: "iana", - }, - "application/vnd.espass-espass+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.eszigno3+xml": { - source: "iana", - compressible: true, - extensions: ["es3", "et3"], - }, - "application/vnd.etsi.aoc+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.asic-e+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.etsi.asic-s+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.etsi.cug+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvcommand+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvdiscovery+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvprofile+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvsad-bc+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvsad-cod+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvservice+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvsync+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.iptvueprofile+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.mcid+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.mheg5": { - source: "iana", - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.pstn+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.sci+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.simservs+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.timestamp-token": { - source: "iana", - }, - "application/vnd.etsi.tsl+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.etsi.tsl.der": { - source: "iana", - }, - "application/vnd.eu.kasparian.car+json": { - source: "iana", - compressible: true, - }, - "application/vnd.eudora.data": { - source: "iana", - }, - "application/vnd.evolv.ecig.profile": { - source: "iana", - }, - "application/vnd.evolv.ecig.settings": { - source: "iana", - }, - "application/vnd.evolv.ecig.theme": { - source: "iana", - }, - "application/vnd.exstream-empower+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.exstream-package": { - source: "iana", - }, - "application/vnd.ezpix-album": { - source: "iana", - extensions: ["ez2"], - }, - "application/vnd.ezpix-package": { - source: "iana", - extensions: ["ez3"], - }, - "application/vnd.f-secure.mobile": { - source: "iana", - }, - "application/vnd.familysearch.gedcom+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.fastcopy-disk-image": { - source: "iana", - }, - "application/vnd.fdf": { - source: "iana", - extensions: ["fdf"], - }, - "application/vnd.fdsn.mseed": { - source: "iana", - extensions: ["mseed"], - }, - "application/vnd.fdsn.seed": { - source: "iana", - extensions: ["seed", "dataless"], - }, - "application/vnd.ffsns": { - source: "iana", - }, - "application/vnd.ficlab.flb+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.filmit.zfc": { - source: "iana", - }, - "application/vnd.fints": { - source: "iana", - }, - "application/vnd.firemonkeys.cloudcell": { - source: "iana", - }, - "application/vnd.flographit": { - source: "iana", - extensions: ["gph"], - }, - "application/vnd.fluxtime.clip": { - source: "iana", - extensions: ["ftc"], - }, - "application/vnd.font-fontforge-sfd": { - source: "iana", - }, - "application/vnd.framemaker": { - source: "iana", - extensions: ["fm", "frame", "maker", "book"], - }, - "application/vnd.frogans.fnc": { - source: "iana", - extensions: ["fnc"], - }, - "application/vnd.frogans.ltf": { - source: "iana", - extensions: ["ltf"], - }, - "application/vnd.fsc.weblaunch": { - source: "iana", - extensions: ["fsc"], - }, - "application/vnd.fujifilm.fb.docuworks": { - source: "iana", - }, - "application/vnd.fujifilm.fb.docuworks.binder": { - source: "iana", - }, - "application/vnd.fujifilm.fb.docuworks.container": { - source: "iana", - }, - "application/vnd.fujifilm.fb.jfi+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.fujitsu.oasys": { - source: "iana", - extensions: ["oas"], - }, - "application/vnd.fujitsu.oasys2": { - source: "iana", - extensions: ["oa2"], - }, - "application/vnd.fujitsu.oasys3": { - source: "iana", - extensions: ["oa3"], - }, - "application/vnd.fujitsu.oasysgp": { - source: "iana", - extensions: ["fg5"], - }, - "application/vnd.fujitsu.oasysprs": { - source: "iana", - extensions: ["bh2"], - }, - "application/vnd.fujixerox.art-ex": { - source: "iana", - }, - "application/vnd.fujixerox.art4": { - source: "iana", - }, - "application/vnd.fujixerox.ddd": { - source: "iana", - extensions: ["ddd"], - }, - "application/vnd.fujixerox.docuworks": { - source: "iana", - extensions: ["xdw"], - }, - "application/vnd.fujixerox.docuworks.binder": { - source: "iana", - extensions: ["xbd"], - }, - "application/vnd.fujixerox.docuworks.container": { - source: "iana", - }, - "application/vnd.fujixerox.hbpl": { - source: "iana", - }, - "application/vnd.fut-misnet": { - source: "iana", - }, - "application/vnd.futoin+cbor": { - source: "iana", - }, - "application/vnd.futoin+json": { - source: "iana", - compressible: true, - }, - "application/vnd.fuzzysheet": { - source: "iana", - extensions: ["fzs"], - }, - "application/vnd.genomatix.tuxedo": { - source: "iana", - extensions: ["txd"], - }, - "application/vnd.gentics.grd+json": { - source: "iana", - compressible: true, - }, - "application/vnd.geo+json": { - source: "iana", - compressible: true, - }, - "application/vnd.geocube+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.geogebra.file": { - source: "iana", - extensions: ["ggb"], - }, - "application/vnd.geogebra.slides": { - source: "iana", - }, - "application/vnd.geogebra.tool": { - source: "iana", - extensions: ["ggt"], - }, - "application/vnd.geometry-explorer": { - source: "iana", - extensions: ["gex", "gre"], - }, - "application/vnd.geonext": { - source: "iana", - extensions: ["gxt"], - }, - "application/vnd.geoplan": { - source: "iana", - extensions: ["g2w"], - }, - "application/vnd.geospace": { - source: "iana", - extensions: ["g3w"], - }, - "application/vnd.gerber": { - source: "iana", - }, - "application/vnd.globalplatform.card-content-mgt": { - source: "iana", - }, - "application/vnd.globalplatform.card-content-mgt-response": { - source: "iana", - }, - "application/vnd.gmx": { - source: "iana", - extensions: ["gmx"], - }, - "application/vnd.google-apps.document": { - compressible: false, - extensions: ["gdoc"], - }, - "application/vnd.google-apps.presentation": { - compressible: false, - extensions: ["gslides"], - }, - "application/vnd.google-apps.spreadsheet": { - compressible: false, - extensions: ["gsheet"], - }, - "application/vnd.google-earth.kml+xml": { - source: "iana", - compressible: true, - extensions: ["kml"], - }, - "application/vnd.google-earth.kmz": { - source: "iana", - compressible: false, - extensions: ["kmz"], - }, - "application/vnd.gov.sk.e-form+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.gov.sk.e-form+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.grafeq": { - source: "iana", - extensions: ["gqf", "gqs"], - }, - "application/vnd.gridmp": { - source: "iana", - }, - "application/vnd.groove-account": { - source: "iana", - extensions: ["gac"], - }, - "application/vnd.groove-help": { - source: "iana", - extensions: ["ghf"], - }, - "application/vnd.groove-identity-message": { - source: "iana", - extensions: ["gim"], - }, - "application/vnd.groove-injector": { - source: "iana", - extensions: ["grv"], - }, - "application/vnd.groove-tool-message": { - source: "iana", - extensions: ["gtm"], - }, - "application/vnd.groove-tool-template": { - source: "iana", - extensions: ["tpl"], - }, - "application/vnd.groove-vcard": { - source: "iana", - extensions: ["vcg"], - }, - "application/vnd.hal+json": { - source: "iana", - compressible: true, - }, - "application/vnd.hal+xml": { - source: "iana", - compressible: true, - extensions: ["hal"], - }, - "application/vnd.handheld-entertainment+xml": { - source: "iana", - compressible: true, - extensions: ["zmm"], - }, - "application/vnd.hbci": { - source: "iana", - extensions: ["hbci"], - }, - "application/vnd.hc+json": { - source: "iana", - compressible: true, - }, - "application/vnd.hcl-bireports": { - source: "iana", - }, - "application/vnd.hdt": { - source: "iana", - }, - "application/vnd.heroku+json": { - source: "iana", - compressible: true, - }, - "application/vnd.hhe.lesson-player": { - source: "iana", - extensions: ["les"], - }, - "application/vnd.hl7cda+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/vnd.hl7v2+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/vnd.hp-hpgl": { - source: "iana", - extensions: ["hpgl"], - }, - "application/vnd.hp-hpid": { - source: "iana", - extensions: ["hpid"], - }, - "application/vnd.hp-hps": { - source: "iana", - extensions: ["hps"], - }, - "application/vnd.hp-jlyt": { - source: "iana", - extensions: ["jlt"], - }, - "application/vnd.hp-pcl": { - source: "iana", - extensions: ["pcl"], - }, - "application/vnd.hp-pclxl": { - source: "iana", - extensions: ["pclxl"], - }, - "application/vnd.httphone": { - source: "iana", - }, - "application/vnd.hydrostatix.sof-data": { - source: "iana", - extensions: ["sfd-hdstx"], - }, - "application/vnd.hyper+json": { - source: "iana", - compressible: true, - }, - "application/vnd.hyper-item+json": { - source: "iana", - compressible: true, - }, - "application/vnd.hyperdrive+json": { - source: "iana", - compressible: true, - }, - "application/vnd.hzn-3d-crossword": { - source: "iana", - }, - "application/vnd.ibm.afplinedata": { - source: "iana", - }, - "application/vnd.ibm.electronic-media": { - source: "iana", - }, - "application/vnd.ibm.minipay": { - source: "iana", - extensions: ["mpy"], - }, - "application/vnd.ibm.modcap": { - source: "iana", - extensions: ["afp", "listafp", "list3820"], - }, - "application/vnd.ibm.rights-management": { - source: "iana", - extensions: ["irm"], - }, - "application/vnd.ibm.secure-container": { - source: "iana", - extensions: ["sc"], - }, - "application/vnd.iccprofile": { - source: "iana", - extensions: ["icc", "icm"], - }, - "application/vnd.ieee.1905": { - source: "iana", - }, - "application/vnd.igloader": { - source: "iana", - extensions: ["igl"], - }, - "application/vnd.imagemeter.folder+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.imagemeter.image+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.immervision-ivp": { - source: "iana", - extensions: ["ivp"], - }, - "application/vnd.immervision-ivu": { - source: "iana", - extensions: ["ivu"], - }, - "application/vnd.ims.imsccv1p1": { - source: "iana", - }, - "application/vnd.ims.imsccv1p2": { - source: "iana", - }, - "application/vnd.ims.imsccv1p3": { - source: "iana", - }, - "application/vnd.ims.lis.v2.result+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - source: "iana", - compressible: true, - }, - "application/vnd.informedcontrol.rms+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.informix-visionary": { - source: "iana", - }, - "application/vnd.infotech.project": { - source: "iana", - }, - "application/vnd.infotech.project+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.innopath.wamp.notification": { - source: "iana", - }, - "application/vnd.insors.igm": { - source: "iana", - extensions: ["igm"], - }, - "application/vnd.intercon.formnet": { - source: "iana", - extensions: ["xpw", "xpx"], - }, - "application/vnd.intergeo": { - source: "iana", - extensions: ["i2g"], - }, - "application/vnd.intertrust.digibox": { - source: "iana", - }, - "application/vnd.intertrust.nncp": { - source: "iana", - }, - "application/vnd.intu.qbo": { - source: "iana", - extensions: ["qbo"], - }, - "application/vnd.intu.qfx": { - source: "iana", - extensions: ["qfx"], - }, - "application/vnd.iptc.g2.catalogitem+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.iptc.g2.conceptitem+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.iptc.g2.newsitem+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.iptc.g2.newsmessage+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.iptc.g2.packageitem+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.iptc.g2.planningitem+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.ipunplugged.rcprofile": { - source: "iana", - extensions: ["rcprofile"], - }, - "application/vnd.irepository.package+xml": { - source: "iana", - compressible: true, - extensions: ["irp"], - }, - "application/vnd.is-xpr": { - source: "iana", - extensions: ["xpr"], - }, - "application/vnd.isac.fcs": { - source: "iana", - extensions: ["fcs"], - }, - "application/vnd.iso11783-10+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.jam": { - source: "iana", - extensions: ["jam"], - }, - "application/vnd.japannet-directory-service": { - source: "iana", - }, - "application/vnd.japannet-jpnstore-wakeup": { - source: "iana", - }, - "application/vnd.japannet-payment-wakeup": { - source: "iana", - }, - "application/vnd.japannet-registration": { - source: "iana", - }, - "application/vnd.japannet-registration-wakeup": { - source: "iana", - }, - "application/vnd.japannet-setstore-wakeup": { - source: "iana", - }, - "application/vnd.japannet-verification": { - source: "iana", - }, - "application/vnd.japannet-verification-wakeup": { - source: "iana", - }, - "application/vnd.jcp.javame.midlet-rms": { - source: "iana", - extensions: ["rms"], - }, - "application/vnd.jisp": { - source: "iana", - extensions: ["jisp"], - }, - "application/vnd.joost.joda-archive": { - source: "iana", - extensions: ["joda"], - }, - "application/vnd.jsk.isdn-ngn": { - source: "iana", - }, - "application/vnd.kahootz": { - source: "iana", - extensions: ["ktz", "ktr"], - }, - "application/vnd.kde.karbon": { - source: "iana", - extensions: ["karbon"], - }, - "application/vnd.kde.kchart": { - source: "iana", - extensions: ["chrt"], - }, - "application/vnd.kde.kformula": { - source: "iana", - extensions: ["kfo"], - }, - "application/vnd.kde.kivio": { - source: "iana", - extensions: ["flw"], - }, - "application/vnd.kde.kontour": { - source: "iana", - extensions: ["kon"], - }, - "application/vnd.kde.kpresenter": { - source: "iana", - extensions: ["kpr", "kpt"], - }, - "application/vnd.kde.kspread": { - source: "iana", - extensions: ["ksp"], - }, - "application/vnd.kde.kword": { - source: "iana", - extensions: ["kwd", "kwt"], - }, - "application/vnd.kenameaapp": { - source: "iana", - extensions: ["htke"], - }, - "application/vnd.kidspiration": { - source: "iana", - extensions: ["kia"], - }, - "application/vnd.kinar": { - source: "iana", - extensions: ["kne", "knp"], - }, - "application/vnd.koan": { - source: "iana", - extensions: ["skp", "skd", "skt", "skm"], - }, - "application/vnd.kodak-descriptor": { - source: "iana", - extensions: ["sse"], - }, - "application/vnd.las": { - source: "iana", - }, - "application/vnd.las.las+json": { - source: "iana", - compressible: true, - }, - "application/vnd.las.las+xml": { - source: "iana", - compressible: true, - extensions: ["lasxml"], - }, - "application/vnd.laszip": { - source: "iana", - }, - "application/vnd.leap+json": { - source: "iana", - compressible: true, - }, - "application/vnd.liberty-request+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.llamagraphics.life-balance.desktop": { - source: "iana", - extensions: ["lbd"], - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - source: "iana", - compressible: true, - extensions: ["lbe"], - }, - "application/vnd.logipipe.circuit+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.loom": { - source: "iana", - }, - "application/vnd.lotus-1-2-3": { - source: "iana", - extensions: ["123"], - }, - "application/vnd.lotus-approach": { - source: "iana", - extensions: ["apr"], - }, - "application/vnd.lotus-freelance": { - source: "iana", - extensions: ["pre"], - }, - "application/vnd.lotus-notes": { - source: "iana", - extensions: ["nsf"], - }, - "application/vnd.lotus-organizer": { - source: "iana", - extensions: ["org"], - }, - "application/vnd.lotus-screencam": { - source: "iana", - extensions: ["scm"], - }, - "application/vnd.lotus-wordpro": { - source: "iana", - extensions: ["lwp"], - }, - "application/vnd.macports.portpkg": { - source: "iana", - extensions: ["portpkg"], - }, - "application/vnd.mapbox-vector-tile": { - source: "iana", - extensions: ["mvt"], - }, - "application/vnd.marlin.drm.actiontoken+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.marlin.drm.conftoken+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.marlin.drm.license+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.marlin.drm.mdcf": { - source: "iana", - }, - "application/vnd.mason+json": { - source: "iana", - compressible: true, - }, - "application/vnd.maxar.archive.3tz+zip": { - source: "iana", - compressible: false, - }, - "application/vnd.maxmind.maxmind-db": { - source: "iana", - }, - "application/vnd.mcd": { - source: "iana", - extensions: ["mcd"], - }, - "application/vnd.medcalcdata": { - source: "iana", - extensions: ["mc1"], - }, - "application/vnd.mediastation.cdkey": { - source: "iana", - extensions: ["cdkey"], - }, - "application/vnd.meridian-slingshot": { - source: "iana", - }, - "application/vnd.mfer": { - source: "iana", - extensions: ["mwf"], - }, - "application/vnd.mfmp": { - source: "iana", - extensions: ["mfm"], - }, - "application/vnd.micro+json": { - source: "iana", - compressible: true, - }, - "application/vnd.micrografx.flo": { - source: "iana", - extensions: ["flo"], - }, - "application/vnd.micrografx.igx": { - source: "iana", - extensions: ["igx"], - }, - "application/vnd.microsoft.portable-executable": { - source: "iana", - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - source: "iana", - }, - "application/vnd.miele+json": { - source: "iana", - compressible: true, - }, - "application/vnd.mif": { - source: "iana", - extensions: ["mif"], - }, - "application/vnd.minisoft-hp3000-save": { - source: "iana", - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - source: "iana", - }, - "application/vnd.mobius.daf": { - source: "iana", - extensions: ["daf"], - }, - "application/vnd.mobius.dis": { - source: "iana", - extensions: ["dis"], - }, - "application/vnd.mobius.mbk": { - source: "iana", - extensions: ["mbk"], - }, - "application/vnd.mobius.mqy": { - source: "iana", - extensions: ["mqy"], - }, - "application/vnd.mobius.msl": { - source: "iana", - extensions: ["msl"], - }, - "application/vnd.mobius.plc": { - source: "iana", - extensions: ["plc"], - }, - "application/vnd.mobius.txf": { - source: "iana", - extensions: ["txf"], - }, - "application/vnd.mophun.application": { - source: "iana", - extensions: ["mpn"], - }, - "application/vnd.mophun.certificate": { - source: "iana", - extensions: ["mpc"], - }, - "application/vnd.motorola.flexsuite": { - source: "iana", - }, - "application/vnd.motorola.flexsuite.adsi": { - source: "iana", - }, - "application/vnd.motorola.flexsuite.fis": { - source: "iana", - }, - "application/vnd.motorola.flexsuite.gotap": { - source: "iana", - }, - "application/vnd.motorola.flexsuite.kmr": { - source: "iana", - }, - "application/vnd.motorola.flexsuite.ttc": { - source: "iana", - }, - "application/vnd.motorola.flexsuite.wem": { - source: "iana", - }, - "application/vnd.motorola.iprm": { - source: "iana", - }, - "application/vnd.mozilla.xul+xml": { - source: "iana", - compressible: true, - extensions: ["xul"], - }, - "application/vnd.ms-3mfdocument": { - source: "iana", - }, - "application/vnd.ms-artgalry": { - source: "iana", - extensions: ["cil"], - }, - "application/vnd.ms-asf": { - source: "iana", - }, - "application/vnd.ms-cab-compressed": { - source: "iana", - extensions: ["cab"], - }, - "application/vnd.ms-color.iccprofile": { - source: "apache", - }, - "application/vnd.ms-excel": { - source: "iana", - compressible: false, - extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - source: "iana", - extensions: ["xlam"], - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - source: "iana", - extensions: ["xlsb"], - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - source: "iana", - extensions: ["xlsm"], - }, - "application/vnd.ms-excel.template.macroenabled.12": { - source: "iana", - extensions: ["xltm"], - }, - "application/vnd.ms-fontobject": { - source: "iana", - compressible: true, - extensions: ["eot"], - }, - "application/vnd.ms-htmlhelp": { - source: "iana", - extensions: ["chm"], - }, - "application/vnd.ms-ims": { - source: "iana", - extensions: ["ims"], - }, - "application/vnd.ms-lrm": { - source: "iana", - extensions: ["lrm"], - }, - "application/vnd.ms-office.activex+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.ms-officetheme": { - source: "iana", - extensions: ["thmx"], - }, - "application/vnd.ms-opentype": { - source: "apache", - compressible: true, - }, - "application/vnd.ms-outlook": { - compressible: false, - extensions: ["msg"], - }, - "application/vnd.ms-package.obfuscated-opentype": { - source: "apache", - }, - "application/vnd.ms-pki.seccat": { - source: "apache", - extensions: ["cat"], - }, - "application/vnd.ms-pki.stl": { - source: "apache", - extensions: ["stl"], - }, - "application/vnd.ms-playready.initiator+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.ms-powerpoint": { - source: "iana", - compressible: false, - extensions: ["ppt", "pps", "pot"], - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - source: "iana", - extensions: ["ppam"], - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - source: "iana", - extensions: ["pptm"], - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - source: "iana", - extensions: ["sldm"], - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - source: "iana", - extensions: ["ppsm"], - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - source: "iana", - extensions: ["potm"], - }, - "application/vnd.ms-printdevicecapabilities+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.ms-printing.printticket+xml": { - source: "apache", - compressible: true, - }, - "application/vnd.ms-printschematicket+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.ms-project": { - source: "iana", - extensions: ["mpp", "mpt"], - }, - "application/vnd.ms-tnef": { - source: "iana", - }, - "application/vnd.ms-windows.devicepairing": { - source: "iana", - }, - "application/vnd.ms-windows.nwprinting.oob": { - source: "iana", - }, - "application/vnd.ms-windows.printerpairing": { - source: "iana", - }, - "application/vnd.ms-windows.wsd.oob": { - source: "iana", - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - source: "iana", - }, - "application/vnd.ms-wmdrm.lic-resp": { - source: "iana", - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - source: "iana", - }, - "application/vnd.ms-wmdrm.meter-resp": { - source: "iana", - }, - "application/vnd.ms-word.document.macroenabled.12": { - source: "iana", - extensions: ["docm"], - }, - "application/vnd.ms-word.template.macroenabled.12": { - source: "iana", - extensions: ["dotm"], - }, - "application/vnd.ms-works": { - source: "iana", - extensions: ["wps", "wks", "wcm", "wdb"], - }, - "application/vnd.ms-wpl": { - source: "iana", - extensions: ["wpl"], - }, - "application/vnd.ms-xpsdocument": { - source: "iana", - compressible: false, - extensions: ["xps"], - }, - "application/vnd.msa-disk-image": { - source: "iana", - }, - "application/vnd.mseq": { - source: "iana", - extensions: ["mseq"], - }, - "application/vnd.msign": { - source: "iana", - }, - "application/vnd.multiad.creator": { - source: "iana", - }, - "application/vnd.multiad.creator.cif": { - source: "iana", - }, - "application/vnd.music-niff": { - source: "iana", - }, - "application/vnd.musician": { - source: "iana", - extensions: ["mus"], - }, - "application/vnd.muvee.style": { - source: "iana", - extensions: ["msty"], - }, - "application/vnd.mynfc": { - source: "iana", - extensions: ["taglet"], - }, - "application/vnd.nacamar.ybrid+json": { - source: "iana", - compressible: true, - }, - "application/vnd.ncd.control": { - source: "iana", - }, - "application/vnd.ncd.reference": { - source: "iana", - }, - "application/vnd.nearst.inv+json": { - source: "iana", - compressible: true, - }, - "application/vnd.nebumind.line": { - source: "iana", - }, - "application/vnd.nervana": { - source: "iana", - }, - "application/vnd.netfpx": { - source: "iana", - }, - "application/vnd.neurolanguage.nlu": { - source: "iana", - extensions: ["nlu"], - }, - "application/vnd.nimn": { - source: "iana", - }, - "application/vnd.nintendo.nitro.rom": { - source: "iana", - }, - "application/vnd.nintendo.snes.rom": { - source: "iana", - }, - "application/vnd.nitf": { - source: "iana", - extensions: ["ntf", "nitf"], - }, - "application/vnd.noblenet-directory": { - source: "iana", - extensions: ["nnd"], - }, - "application/vnd.noblenet-sealer": { - source: "iana", - extensions: ["nns"], - }, - "application/vnd.noblenet-web": { - source: "iana", - extensions: ["nnw"], - }, - "application/vnd.nokia.catalogs": { - source: "iana", - }, - "application/vnd.nokia.conml+wbxml": { - source: "iana", - }, - "application/vnd.nokia.conml+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.nokia.iptv.config+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.nokia.isds-radio-presets": { - source: "iana", - }, - "application/vnd.nokia.landmark+wbxml": { - source: "iana", - }, - "application/vnd.nokia.landmark+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.nokia.landmarkcollection+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.nokia.n-gage.ac+xml": { - source: "iana", - compressible: true, - extensions: ["ac"], - }, - "application/vnd.nokia.n-gage.data": { - source: "iana", - extensions: ["ngdat"], - }, - "application/vnd.nokia.n-gage.symbian.install": { - source: "iana", - extensions: ["n-gage"], - }, - "application/vnd.nokia.ncd": { - source: "iana", - }, - "application/vnd.nokia.pcd+wbxml": { - source: "iana", - }, - "application/vnd.nokia.pcd+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.nokia.radio-preset": { - source: "iana", - extensions: ["rpst"], - }, - "application/vnd.nokia.radio-presets": { - source: "iana", - extensions: ["rpss"], - }, - "application/vnd.novadigm.edm": { - source: "iana", - extensions: ["edm"], - }, - "application/vnd.novadigm.edx": { - source: "iana", - extensions: ["edx"], - }, - "application/vnd.novadigm.ext": { - source: "iana", - extensions: ["ext"], - }, - "application/vnd.ntt-local.content-share": { - source: "iana", - }, - "application/vnd.ntt-local.file-transfer": { - source: "iana", - }, - "application/vnd.ntt-local.ogw_remote-access": { - source: "iana", - }, - "application/vnd.ntt-local.sip-ta_remote": { - source: "iana", - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - source: "iana", - }, - "application/vnd.oasis.opendocument.chart": { - source: "iana", - extensions: ["odc"], - }, - "application/vnd.oasis.opendocument.chart-template": { - source: "iana", - extensions: ["otc"], - }, - "application/vnd.oasis.opendocument.database": { - source: "iana", - extensions: ["odb"], - }, - "application/vnd.oasis.opendocument.formula": { - source: "iana", - extensions: ["odf"], - }, - "application/vnd.oasis.opendocument.formula-template": { - source: "iana", - extensions: ["odft"], - }, - "application/vnd.oasis.opendocument.graphics": { - source: "iana", - compressible: false, - extensions: ["odg"], - }, - "application/vnd.oasis.opendocument.graphics-template": { - source: "iana", - extensions: ["otg"], - }, - "application/vnd.oasis.opendocument.image": { - source: "iana", - extensions: ["odi"], - }, - "application/vnd.oasis.opendocument.image-template": { - source: "iana", - extensions: ["oti"], - }, - "application/vnd.oasis.opendocument.presentation": { - source: "iana", - compressible: false, - extensions: ["odp"], - }, - "application/vnd.oasis.opendocument.presentation-template": { - source: "iana", - extensions: ["otp"], - }, - "application/vnd.oasis.opendocument.spreadsheet": { - source: "iana", - compressible: false, - extensions: ["ods"], - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - source: "iana", - extensions: ["ots"], - }, - "application/vnd.oasis.opendocument.text": { - source: "iana", - compressible: false, - extensions: ["odt"], - }, - "application/vnd.oasis.opendocument.text-master": { - source: "iana", - extensions: ["odm"], - }, - "application/vnd.oasis.opendocument.text-template": { - source: "iana", - extensions: ["ott"], - }, - "application/vnd.oasis.opendocument.text-web": { - source: "iana", - extensions: ["oth"], - }, - "application/vnd.obn": { - source: "iana", - }, - "application/vnd.ocf+cbor": { - source: "iana", - }, - "application/vnd.oci.image.manifest.v1+json": { - source: "iana", - compressible: true, - }, - "application/vnd.oftn.l10n+json": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.contentaccessdownload+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.cspg-hexbinary": { - source: "iana", - }, - "application/vnd.oipf.dae.svg+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.dae.xhtml+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.pae.gem": { - source: "iana", - }, - "application/vnd.oipf.spdiscovery+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.spdlist+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.ueprofile+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oipf.userprofile+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.olpc-sugar": { - source: "iana", - extensions: ["xo"], - }, - "application/vnd.oma-scws-config": { - source: "iana", - }, - "application/vnd.oma-scws-http-request": { - source: "iana", - }, - "application/vnd.oma-scws-http-response": { - source: "iana", - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.bcast.imd+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.bcast.ltkm": { - source: "iana", - }, - "application/vnd.oma.bcast.notification+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.bcast.provisioningtrigger": { - source: "iana", - }, - "application/vnd.oma.bcast.sgboot": { - source: "iana", - }, - "application/vnd.oma.bcast.sgdd+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.bcast.sgdu": { - source: "iana", - }, - "application/vnd.oma.bcast.simple-symbol-container": { - source: "iana", - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.bcast.sprov+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.bcast.stkm": { - source: "iana", - }, - "application/vnd.oma.cab-address-book+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.cab-feature-handler+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.cab-pcc+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.cab-subs-invite+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.cab-user-prefs+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.dcd": { - source: "iana", - }, - "application/vnd.oma.dcdc": { - source: "iana", - }, - "application/vnd.oma.dd2+xml": { - source: "iana", - compressible: true, - extensions: ["dd2"], - }, - "application/vnd.oma.drm.risd+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.group-usage-list+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.lwm2m+cbor": { - source: "iana", - }, - "application/vnd.oma.lwm2m+json": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.lwm2m+tlv": { - source: "iana", - }, - "application/vnd.oma.pal+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.poc.final-report+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.poc.groups+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.push": { - source: "iana", - }, - "application/vnd.oma.scidm.messages+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oma.xcap-directory+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.omads-email+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/vnd.omads-file+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/vnd.omads-folder+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/vnd.omaloc-supl-init": { - source: "iana", - }, - "application/vnd.onepager": { - source: "iana", - }, - "application/vnd.onepagertamp": { - source: "iana", - }, - "application/vnd.onepagertamx": { - source: "iana", - }, - "application/vnd.onepagertat": { - source: "iana", - }, - "application/vnd.onepagertatp": { - source: "iana", - }, - "application/vnd.onepagertatx": { - source: "iana", - }, - "application/vnd.openblox.game+xml": { - source: "iana", - compressible: true, - extensions: ["obgx"], - }, - "application/vnd.openblox.game-binary": { - source: "iana", - }, - "application/vnd.openeye.oeb": { - source: "iana", - }, - "application/vnd.openofficeorg.extension": { - source: "apache", - extensions: ["oxt"], - }, - "application/vnd.openstreetmap.data+xml": { - source: "iana", - compressible: true, - extensions: ["osm"], - }, - "application/vnd.opentimestamps.ots": { - source: "iana", - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - source: "iana", - compressible: false, - extensions: ["pptx"], - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - source: "iana", - extensions: ["sldx"], - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - source: "iana", - extensions: ["ppsx"], - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - source: "iana", - extensions: ["potx"], - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - source: "iana", - compressible: false, - extensions: ["xlsx"], - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - source: "iana", - extensions: ["xltx"], - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - source: "iana", - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - source: "iana", - compressible: false, - extensions: ["docx"], - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - source: "iana", - extensions: ["dotx"], - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.openxmlformats-package.relationships+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oracle.resource+json": { - source: "iana", - compressible: true, - }, - "application/vnd.orange.indata": { - source: "iana", - }, - "application/vnd.osa.netdeploy": { - source: "iana", - }, - "application/vnd.osgeo.mapguide.package": { - source: "iana", - extensions: ["mgp"], - }, - "application/vnd.osgi.bundle": { - source: "iana", - }, - "application/vnd.osgi.dp": { - source: "iana", - extensions: ["dp"], - }, - "application/vnd.osgi.subsystem": { - source: "iana", - extensions: ["esa"], - }, - "application/vnd.otps.ct-kip+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.oxli.countgraph": { - source: "iana", - }, - "application/vnd.pagerduty+json": { - source: "iana", - compressible: true, - }, - "application/vnd.palm": { - source: "iana", - extensions: ["pdb", "pqa", "oprc"], - }, - "application/vnd.panoply": { - source: "iana", - }, - "application/vnd.paos.xml": { - source: "iana", - }, - "application/vnd.patentdive": { - source: "iana", - }, - "application/vnd.patientecommsdoc": { - source: "iana", - }, - "application/vnd.pawaafile": { - source: "iana", - extensions: ["paw"], - }, - "application/vnd.pcos": { - source: "iana", - }, - "application/vnd.pg.format": { - source: "iana", - extensions: ["str"], - }, - "application/vnd.pg.osasli": { - source: "iana", - extensions: ["ei6"], - }, - "application/vnd.piaccess.application-licence": { - source: "iana", - }, - "application/vnd.picsel": { - source: "iana", - extensions: ["efif"], - }, - "application/vnd.pmi.widget": { - source: "iana", - extensions: ["wg"], - }, - "application/vnd.poc.group-advertisement+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.pocketlearn": { - source: "iana", - extensions: ["plf"], - }, - "application/vnd.powerbuilder6": { - source: "iana", - extensions: ["pbd"], - }, - "application/vnd.powerbuilder6-s": { - source: "iana", - }, - "application/vnd.powerbuilder7": { - source: "iana", - }, - "application/vnd.powerbuilder7-s": { - source: "iana", - }, - "application/vnd.powerbuilder75": { - source: "iana", - }, - "application/vnd.powerbuilder75-s": { - source: "iana", - }, - "application/vnd.preminet": { - source: "iana", - }, - "application/vnd.previewsystems.box": { - source: "iana", - extensions: ["box"], - }, - "application/vnd.proteus.magazine": { - source: "iana", - extensions: ["mgz"], - }, - "application/vnd.psfs": { - source: "iana", - }, - "application/vnd.publishare-delta-tree": { - source: "iana", - extensions: ["qps"], - }, - "application/vnd.pvi.ptid1": { - source: "iana", - extensions: ["ptid"], - }, - "application/vnd.pwg-multiplexed": { - source: "iana", - }, - "application/vnd.pwg-xhtml-print+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.qualcomm.brew-app-res": { - source: "iana", - }, - "application/vnd.quarantainenet": { - source: "iana", - }, - "application/vnd.quark.quarkxpress": { - source: "iana", - extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], - }, - "application/vnd.quobject-quoxdocument": { - source: "iana", - }, - "application/vnd.radisys.moml+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-audit+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-audit-conf+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-audit-conn+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-audit-stream+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-conf+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-dialog+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-dialog-base+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-dialog-group+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.rainstor.data": { - source: "iana", - }, - "application/vnd.rapid": { - source: "iana", - }, - "application/vnd.rar": { - source: "iana", - extensions: ["rar"], - }, - "application/vnd.realvnc.bed": { - source: "iana", - extensions: ["bed"], - }, - "application/vnd.recordare.musicxml": { - source: "iana", - extensions: ["mxl"], - }, - "application/vnd.recordare.musicxml+xml": { - source: "iana", - compressible: true, - extensions: ["musicxml"], - }, - "application/vnd.renlearn.rlprint": { - source: "iana", - }, - "application/vnd.resilient.logic": { - source: "iana", - }, - "application/vnd.restful+json": { - source: "iana", - compressible: true, - }, - "application/vnd.rig.cryptonote": { - source: "iana", - extensions: ["cryptonote"], - }, - "application/vnd.rim.cod": { - source: "apache", - extensions: ["cod"], - }, - "application/vnd.rn-realmedia": { - source: "apache", - extensions: ["rm"], - }, - "application/vnd.rn-realmedia-vbr": { - source: "apache", - extensions: ["rmvb"], - }, - "application/vnd.route66.link66+xml": { - source: "iana", - compressible: true, - extensions: ["link66"], - }, - "application/vnd.rs-274x": { - source: "iana", - }, - "application/vnd.ruckus.download": { - source: "iana", - }, - "application/vnd.s3sms": { - source: "iana", - }, - "application/vnd.sailingtracker.track": { - source: "iana", - extensions: ["st"], - }, - "application/vnd.sar": { - source: "iana", - }, - "application/vnd.sbm.cid": { - source: "iana", - }, - "application/vnd.sbm.mid2": { - source: "iana", - }, - "application/vnd.scribus": { - source: "iana", - }, - "application/vnd.sealed.3df": { - source: "iana", - }, - "application/vnd.sealed.csf": { - source: "iana", - }, - "application/vnd.sealed.doc": { - source: "iana", - }, - "application/vnd.sealed.eml": { - source: "iana", - }, - "application/vnd.sealed.mht": { - source: "iana", - }, - "application/vnd.sealed.net": { - source: "iana", - }, - "application/vnd.sealed.ppt": { - source: "iana", - }, - "application/vnd.sealed.tiff": { - source: "iana", - }, - "application/vnd.sealed.xls": { - source: "iana", - }, - "application/vnd.sealedmedia.softseal.html": { - source: "iana", - }, - "application/vnd.sealedmedia.softseal.pdf": { - source: "iana", - }, - "application/vnd.seemail": { - source: "iana", - extensions: ["see"], - }, - "application/vnd.seis+json": { - source: "iana", - compressible: true, - }, - "application/vnd.sema": { - source: "iana", - extensions: ["sema"], - }, - "application/vnd.semd": { - source: "iana", - extensions: ["semd"], - }, - "application/vnd.semf": { - source: "iana", - extensions: ["semf"], - }, - "application/vnd.shade-save-file": { - source: "iana", - }, - "application/vnd.shana.informed.formdata": { - source: "iana", - extensions: ["ifm"], - }, - "application/vnd.shana.informed.formtemplate": { - source: "iana", - extensions: ["itp"], - }, - "application/vnd.shana.informed.interchange": { - source: "iana", - extensions: ["iif"], - }, - "application/vnd.shana.informed.package": { - source: "iana", - extensions: ["ipk"], - }, - "application/vnd.shootproof+json": { - source: "iana", - compressible: true, - }, - "application/vnd.shopkick+json": { - source: "iana", - compressible: true, - }, - "application/vnd.shp": { - source: "iana", - }, - "application/vnd.shx": { - source: "iana", - }, - "application/vnd.sigrok.session": { - source: "iana", - }, - "application/vnd.simtech-mindmapper": { - source: "iana", - extensions: ["twd", "twds"], - }, - "application/vnd.siren+json": { - source: "iana", - compressible: true, - }, - "application/vnd.smaf": { - source: "iana", - extensions: ["mmf"], - }, - "application/vnd.smart.notebook": { - source: "iana", - }, - "application/vnd.smart.teacher": { - source: "iana", - extensions: ["teacher"], - }, - "application/vnd.snesdev-page-table": { - source: "iana", - }, - "application/vnd.software602.filler.form+xml": { - source: "iana", - compressible: true, - extensions: ["fo"], - }, - "application/vnd.software602.filler.form-xml-zip": { - source: "iana", - }, - "application/vnd.solent.sdkm+xml": { - source: "iana", - compressible: true, - extensions: ["sdkm", "sdkd"], - }, - "application/vnd.spotfire.dxp": { - source: "iana", - extensions: ["dxp"], - }, - "application/vnd.spotfire.sfs": { - source: "iana", - extensions: ["sfs"], - }, - "application/vnd.sqlite3": { - source: "iana", - }, - "application/vnd.sss-cod": { - source: "iana", - }, - "application/vnd.sss-dtf": { - source: "iana", - }, - "application/vnd.sss-ntf": { - source: "iana", - }, - "application/vnd.stardivision.calc": { - source: "apache", - extensions: ["sdc"], - }, - "application/vnd.stardivision.draw": { - source: "apache", - extensions: ["sda"], - }, - "application/vnd.stardivision.impress": { - source: "apache", - extensions: ["sdd"], - }, - "application/vnd.stardivision.math": { - source: "apache", - extensions: ["smf"], - }, - "application/vnd.stardivision.writer": { - source: "apache", - extensions: ["sdw", "vor"], - }, - "application/vnd.stardivision.writer-global": { - source: "apache", - extensions: ["sgl"], - }, - "application/vnd.stepmania.package": { - source: "iana", - extensions: ["smzip"], - }, - "application/vnd.stepmania.stepchart": { - source: "iana", - extensions: ["sm"], - }, - "application/vnd.street-stream": { - source: "iana", - }, - "application/vnd.sun.wadl+xml": { - source: "iana", - compressible: true, - extensions: ["wadl"], - }, - "application/vnd.sun.xml.calc": { - source: "apache", - extensions: ["sxc"], - }, - "application/vnd.sun.xml.calc.template": { - source: "apache", - extensions: ["stc"], - }, - "application/vnd.sun.xml.draw": { - source: "apache", - extensions: ["sxd"], - }, - "application/vnd.sun.xml.draw.template": { - source: "apache", - extensions: ["std"], - }, - "application/vnd.sun.xml.impress": { - source: "apache", - extensions: ["sxi"], - }, - "application/vnd.sun.xml.impress.template": { - source: "apache", - extensions: ["sti"], - }, - "application/vnd.sun.xml.math": { - source: "apache", - extensions: ["sxm"], - }, - "application/vnd.sun.xml.writer": { - source: "apache", - extensions: ["sxw"], - }, - "application/vnd.sun.xml.writer.global": { - source: "apache", - extensions: ["sxg"], - }, - "application/vnd.sun.xml.writer.template": { - source: "apache", - extensions: ["stw"], - }, - "application/vnd.sus-calendar": { - source: "iana", - extensions: ["sus", "susp"], - }, - "application/vnd.svd": { - source: "iana", - extensions: ["svd"], - }, - "application/vnd.swiftview-ics": { - source: "iana", - }, - "application/vnd.sycle+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.syft+json": { - source: "iana", - compressible: true, - }, - "application/vnd.symbian.install": { - source: "apache", - extensions: ["sis", "sisx"], - }, - "application/vnd.syncml+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xsm"], - }, - "application/vnd.syncml.dm+wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["bdm"], - }, - "application/vnd.syncml.dm+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["xdm"], - }, - "application/vnd.syncml.dm.notification": { - source: "iana", - }, - "application/vnd.syncml.dmddf+wbxml": { - source: "iana", - }, - "application/vnd.syncml.dmddf+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["ddf"], - }, - "application/vnd.syncml.dmtnds+wbxml": { - source: "iana", - }, - "application/vnd.syncml.dmtnds+xml": { - source: "iana", - charset: "UTF-8", - compressible: true, - }, - "application/vnd.syncml.ds.notification": { - source: "iana", - }, - "application/vnd.tableschema+json": { - source: "iana", - compressible: true, - }, - "application/vnd.tao.intent-module-archive": { - source: "iana", - extensions: ["tao"], - }, - "application/vnd.tcpdump.pcap": { - source: "iana", - extensions: ["pcap", "cap", "dmp"], - }, - "application/vnd.think-cell.ppttc+json": { - source: "iana", - compressible: true, - }, - "application/vnd.tmd.mediaflex.api+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.tml": { - source: "iana", - }, - "application/vnd.tmobile-livetv": { - source: "iana", - extensions: ["tmo"], - }, - "application/vnd.tri.onesource": { - source: "iana", - }, - "application/vnd.trid.tpt": { - source: "iana", - extensions: ["tpt"], - }, - "application/vnd.triscape.mxs": { - source: "iana", - extensions: ["mxs"], - }, - "application/vnd.trueapp": { - source: "iana", - extensions: ["tra"], - }, - "application/vnd.truedoc": { - source: "iana", - }, - "application/vnd.ubisoft.webplayer": { - source: "iana", - }, - "application/vnd.ufdl": { - source: "iana", - extensions: ["ufd", "ufdl"], - }, - "application/vnd.uiq.theme": { - source: "iana", - extensions: ["utz"], - }, - "application/vnd.umajin": { - source: "iana", - extensions: ["umj"], - }, - "application/vnd.unity": { - source: "iana", - extensions: ["unityweb"], - }, - "application/vnd.uoml+xml": { - source: "iana", - compressible: true, - extensions: ["uoml"], - }, - "application/vnd.uplanet.alert": { - source: "iana", - }, - "application/vnd.uplanet.alert-wbxml": { - source: "iana", - }, - "application/vnd.uplanet.bearer-choice": { - source: "iana", - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - source: "iana", - }, - "application/vnd.uplanet.cacheop": { - source: "iana", - }, - "application/vnd.uplanet.cacheop-wbxml": { - source: "iana", - }, - "application/vnd.uplanet.channel": { - source: "iana", - }, - "application/vnd.uplanet.channel-wbxml": { - source: "iana", - }, - "application/vnd.uplanet.list": { - source: "iana", - }, - "application/vnd.uplanet.list-wbxml": { - source: "iana", - }, - "application/vnd.uplanet.listcmd": { - source: "iana", - }, - "application/vnd.uplanet.listcmd-wbxml": { - source: "iana", - }, - "application/vnd.uplanet.signal": { - source: "iana", - }, - "application/vnd.uri-map": { - source: "iana", - }, - "application/vnd.valve.source.material": { - source: "iana", - }, - "application/vnd.vcx": { - source: "iana", - extensions: ["vcx"], - }, - "application/vnd.vd-study": { - source: "iana", - }, - "application/vnd.vectorworks": { - source: "iana", - }, - "application/vnd.vel+json": { - source: "iana", - compressible: true, - }, - "application/vnd.verimatrix.vcas": { - source: "iana", - }, - "application/vnd.veritone.aion+json": { - source: "iana", - compressible: true, - }, - "application/vnd.veryant.thin": { - source: "iana", - }, - "application/vnd.ves.encrypted": { - source: "iana", - }, - "application/vnd.vidsoft.vidconference": { - source: "iana", - }, - "application/vnd.visio": { - source: "iana", - extensions: ["vsd", "vst", "vss", "vsw"], - }, - "application/vnd.visionary": { - source: "iana", - extensions: ["vis"], - }, - "application/vnd.vividence.scriptfile": { - source: "iana", - }, - "application/vnd.vsf": { - source: "iana", - extensions: ["vsf"], - }, - "application/vnd.wap.sic": { - source: "iana", - }, - "application/vnd.wap.slc": { - source: "iana", - }, - "application/vnd.wap.wbxml": { - source: "iana", - charset: "UTF-8", - extensions: ["wbxml"], - }, - "application/vnd.wap.wmlc": { - source: "iana", - extensions: ["wmlc"], - }, - "application/vnd.wap.wmlscriptc": { - source: "iana", - extensions: ["wmlsc"], - }, - "application/vnd.webturbo": { - source: "iana", - extensions: ["wtb"], - }, - "application/vnd.wfa.dpp": { - source: "iana", - }, - "application/vnd.wfa.p2p": { - source: "iana", - }, - "application/vnd.wfa.wsc": { - source: "iana", - }, - "application/vnd.windows.devicepairing": { - source: "iana", - }, - "application/vnd.wmc": { - source: "iana", - }, - "application/vnd.wmf.bootstrap": { - source: "iana", - }, - "application/vnd.wolfram.mathematica": { - source: "iana", - }, - "application/vnd.wolfram.mathematica.package": { - source: "iana", - }, - "application/vnd.wolfram.player": { - source: "iana", - extensions: ["nbp"], - }, - "application/vnd.wordperfect": { - source: "iana", - extensions: ["wpd"], - }, - "application/vnd.wqd": { - source: "iana", - extensions: ["wqd"], - }, - "application/vnd.wrq-hp3000-labelled": { - source: "iana", - }, - "application/vnd.wt.stf": { - source: "iana", - extensions: ["stf"], - }, - "application/vnd.wv.csp+wbxml": { - source: "iana", - }, - "application/vnd.wv.csp+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.wv.ssp+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.xacml+json": { - source: "iana", - compressible: true, - }, - "application/vnd.xara": { - source: "iana", - extensions: ["xar"], - }, - "application/vnd.xfdl": { - source: "iana", - extensions: ["xfdl"], - }, - "application/vnd.xfdl.webform": { - source: "iana", - }, - "application/vnd.xmi+xml": { - source: "iana", - compressible: true, - }, - "application/vnd.xmpie.cpkg": { - source: "iana", - }, - "application/vnd.xmpie.dpkg": { - source: "iana", - }, - "application/vnd.xmpie.plan": { - source: "iana", - }, - "application/vnd.xmpie.ppkg": { - source: "iana", - }, - "application/vnd.xmpie.xlim": { - source: "iana", - }, - "application/vnd.yamaha.hv-dic": { - source: "iana", - extensions: ["hvd"], - }, - "application/vnd.yamaha.hv-script": { - source: "iana", - extensions: ["hvs"], - }, - "application/vnd.yamaha.hv-voice": { - source: "iana", - extensions: ["hvp"], - }, - "application/vnd.yamaha.openscoreformat": { - source: "iana", - extensions: ["osf"], - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - source: "iana", - compressible: true, - extensions: ["osfpvg"], - }, - "application/vnd.yamaha.remote-setup": { - source: "iana", - }, - "application/vnd.yamaha.smaf-audio": { - source: "iana", - extensions: ["saf"], - }, - "application/vnd.yamaha.smaf-phrase": { - source: "iana", - extensions: ["spf"], - }, - "application/vnd.yamaha.through-ngn": { - source: "iana", - }, - "application/vnd.yamaha.tunnel-udpencap": { - source: "iana", - }, - "application/vnd.yaoweme": { - source: "iana", - }, - "application/vnd.yellowriver-custom-menu": { - source: "iana", - extensions: ["cmp"], - }, - "application/vnd.youtube.yt": { - source: "iana", - }, - "application/vnd.zul": { - source: "iana", - extensions: ["zir", "zirz"], - }, - "application/vnd.zzazz.deck+xml": { - source: "iana", - compressible: true, - extensions: ["zaz"], - }, - "application/voicexml+xml": { - source: "iana", - compressible: true, - extensions: ["vxml"], - }, - "application/voucher-cms+json": { - source: "iana", - compressible: true, - }, - "application/vq-rtcpxr": { - source: "iana", - }, - "application/wasm": { - source: "iana", - compressible: true, - extensions: ["wasm"], - }, - "application/watcherinfo+xml": { - source: "iana", - compressible: true, - extensions: ["wif"], - }, - "application/webpush-options+json": { - source: "iana", - compressible: true, - }, - "application/whoispp-query": { - source: "iana", - }, - "application/whoispp-response": { - source: "iana", - }, - "application/widget": { - source: "iana", - extensions: ["wgt"], - }, - "application/winhlp": { - source: "apache", - extensions: ["hlp"], - }, - "application/wita": { - source: "iana", - }, - "application/wordperfect5.1": { - source: "iana", - }, - "application/wsdl+xml": { - source: "iana", - compressible: true, - extensions: ["wsdl"], - }, - "application/wspolicy+xml": { - source: "iana", - compressible: true, - extensions: ["wspolicy"], - }, - "application/x-7z-compressed": { - source: "apache", - compressible: false, - extensions: ["7z"], - }, - "application/x-abiword": { - source: "apache", - extensions: ["abw"], - }, - "application/x-ace-compressed": { - source: "apache", - extensions: ["ace"], - }, - "application/x-amf": { - source: "apache", - }, - "application/x-apple-diskimage": { - source: "apache", - extensions: ["dmg"], - }, - "application/x-arj": { - compressible: false, - extensions: ["arj"], - }, - "application/x-authorware-bin": { - source: "apache", - extensions: ["aab", "x32", "u32", "vox"], - }, - "application/x-authorware-map": { - source: "apache", - extensions: ["aam"], - }, - "application/x-authorware-seg": { - source: "apache", - extensions: ["aas"], - }, - "application/x-bcpio": { - source: "apache", - extensions: ["bcpio"], - }, - "application/x-bdoc": { - compressible: false, - extensions: ["bdoc"], - }, - "application/x-bittorrent": { - source: "apache", - extensions: ["torrent"], - }, - "application/x-blorb": { - source: "apache", - extensions: ["blb", "blorb"], - }, - "application/x-bzip": { - source: "apache", - compressible: false, - extensions: ["bz"], - }, - "application/x-bzip2": { - source: "apache", - compressible: false, - extensions: ["bz2", "boz"], - }, - "application/x-cbr": { - source: "apache", - extensions: ["cbr", "cba", "cbt", "cbz", "cb7"], - }, - "application/x-cdlink": { - source: "apache", - extensions: ["vcd"], - }, - "application/x-cfs-compressed": { - source: "apache", - extensions: ["cfs"], - }, - "application/x-chat": { - source: "apache", - extensions: ["chat"], - }, - "application/x-chess-pgn": { - source: "apache", - extensions: ["pgn"], - }, - "application/x-chrome-extension": { - extensions: ["crx"], - }, - "application/x-cocoa": { - source: "nginx", - extensions: ["cco"], - }, - "application/x-compress": { - source: "apache", - }, - "application/x-conference": { - source: "apache", - extensions: ["nsc"], - }, - "application/x-cpio": { - source: "apache", - extensions: ["cpio"], - }, - "application/x-csh": { - source: "apache", - extensions: ["csh"], - }, - "application/x-deb": { - compressible: false, - }, - "application/x-debian-package": { - source: "apache", - extensions: ["deb", "udeb"], - }, - "application/x-dgc-compressed": { - source: "apache", - extensions: ["dgc"], - }, - "application/x-director": { - source: "apache", - extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], - }, - "application/x-doom": { - source: "apache", - extensions: ["wad"], - }, - "application/x-dtbncx+xml": { - source: "apache", - compressible: true, - extensions: ["ncx"], - }, - "application/x-dtbook+xml": { - source: "apache", - compressible: true, - extensions: ["dtb"], - }, - "application/x-dtbresource+xml": { - source: "apache", - compressible: true, - extensions: ["res"], - }, - "application/x-dvi": { - source: "apache", - compressible: false, - extensions: ["dvi"], - }, - "application/x-envoy": { - source: "apache", - extensions: ["evy"], - }, - "application/x-eva": { - source: "apache", - extensions: ["eva"], - }, - "application/x-font-bdf": { - source: "apache", - extensions: ["bdf"], - }, - "application/x-font-dos": { - source: "apache", - }, - "application/x-font-framemaker": { - source: "apache", - }, - "application/x-font-ghostscript": { - source: "apache", - extensions: ["gsf"], - }, - "application/x-font-libgrx": { - source: "apache", - }, - "application/x-font-linux-psf": { - source: "apache", - extensions: ["psf"], - }, - "application/x-font-pcf": { - source: "apache", - extensions: ["pcf"], - }, - "application/x-font-snf": { - source: "apache", - extensions: ["snf"], - }, - "application/x-font-speedo": { - source: "apache", - }, - "application/x-font-sunos-news": { - source: "apache", - }, - "application/x-font-type1": { - source: "apache", - extensions: ["pfa", "pfb", "pfm", "afm"], - }, - "application/x-font-vfont": { - source: "apache", - }, - "application/x-freearc": { - source: "apache", - extensions: ["arc"], - }, - "application/x-futuresplash": { - source: "apache", - extensions: ["spl"], - }, - "application/x-gca-compressed": { - source: "apache", - extensions: ["gca"], - }, - "application/x-glulx": { - source: "apache", - extensions: ["ulx"], - }, - "application/x-gnumeric": { - source: "apache", - extensions: ["gnumeric"], - }, - "application/x-gramps-xml": { - source: "apache", - extensions: ["gramps"], - }, - "application/x-gtar": { - source: "apache", - extensions: ["gtar"], - }, - "application/x-gzip": { - source: "apache", - }, - "application/x-hdf": { - source: "apache", - extensions: ["hdf"], - }, - "application/x-httpd-php": { - compressible: true, - extensions: ["php"], - }, - "application/x-install-instructions": { - source: "apache", - extensions: ["install"], - }, - "application/x-iso9660-image": { - source: "apache", - extensions: ["iso"], - }, - "application/x-iwork-keynote-sffkey": { - extensions: ["key"], - }, - "application/x-iwork-numbers-sffnumbers": { - extensions: ["numbers"], - }, - "application/x-iwork-pages-sffpages": { - extensions: ["pages"], - }, - "application/x-java-archive-diff": { - source: "nginx", - extensions: ["jardiff"], - }, - "application/x-java-jnlp-file": { - source: "apache", - compressible: false, - extensions: ["jnlp"], - }, - "application/x-javascript": { - compressible: true, - }, - "application/x-keepass2": { - extensions: ["kdbx"], - }, - "application/x-latex": { - source: "apache", - compressible: false, - extensions: ["latex"], - }, - "application/x-lua-bytecode": { - extensions: ["luac"], - }, - "application/x-lzh-compressed": { - source: "apache", - extensions: ["lzh", "lha"], - }, - "application/x-makeself": { - source: "nginx", - extensions: ["run"], - }, - "application/x-mie": { - source: "apache", - extensions: ["mie"], - }, - "application/x-mobipocket-ebook": { - source: "apache", - extensions: ["prc", "mobi"], - }, - "application/x-mpegurl": { - compressible: false, - }, - "application/x-ms-application": { - source: "apache", - extensions: ["application"], - }, - "application/x-ms-shortcut": { - source: "apache", - extensions: ["lnk"], - }, - "application/x-ms-wmd": { - source: "apache", - extensions: ["wmd"], - }, - "application/x-ms-wmz": { - source: "apache", - extensions: ["wmz"], - }, - "application/x-ms-xbap": { - source: "apache", - extensions: ["xbap"], - }, - "application/x-msaccess": { - source: "apache", - extensions: ["mdb"], - }, - "application/x-msbinder": { - source: "apache", - extensions: ["obd"], - }, - "application/x-mscardfile": { - source: "apache", - extensions: ["crd"], - }, - "application/x-msclip": { - source: "apache", - extensions: ["clp"], - }, - "application/x-msdos-program": { - extensions: ["exe"], - }, - "application/x-msdownload": { - source: "apache", - extensions: ["exe", "dll", "com", "bat", "msi"], - }, - "application/x-msmediaview": { - source: "apache", - extensions: ["mvb", "m13", "m14"], - }, - "application/x-msmetafile": { - source: "apache", - extensions: ["wmf", "wmz", "emf", "emz"], - }, - "application/x-msmoney": { - source: "apache", - extensions: ["mny"], - }, - "application/x-mspublisher": { - source: "apache", - extensions: ["pub"], - }, - "application/x-msschedule": { - source: "apache", - extensions: ["scd"], - }, - "application/x-msterminal": { - source: "apache", - extensions: ["trm"], - }, - "application/x-mswrite": { - source: "apache", - extensions: ["wri"], - }, - "application/x-netcdf": { - source: "apache", - extensions: ["nc", "cdf"], - }, - "application/x-ns-proxy-autoconfig": { - compressible: true, - extensions: ["pac"], - }, - "application/x-nzb": { - source: "apache", - extensions: ["nzb"], - }, - "application/x-perl": { - source: "nginx", - extensions: ["pl", "pm"], - }, - "application/x-pilot": { - source: "nginx", - extensions: ["prc", "pdb"], - }, - "application/x-pkcs12": { - source: "apache", - compressible: false, - extensions: ["p12", "pfx"], - }, - "application/x-pkcs7-certificates": { - source: "apache", - extensions: ["p7b", "spc"], - }, - "application/x-pkcs7-certreqresp": { - source: "apache", - extensions: ["p7r"], - }, - "application/x-pki-message": { - source: "iana", - }, - "application/x-rar-compressed": { - source: "apache", - compressible: false, - extensions: ["rar"], - }, - "application/x-redhat-package-manager": { - source: "nginx", - extensions: ["rpm"], - }, - "application/x-research-info-systems": { - source: "apache", - extensions: ["ris"], - }, - "application/x-sea": { - source: "nginx", - extensions: ["sea"], - }, - "application/x-sh": { - source: "apache", - compressible: true, - extensions: ["sh"], - }, - "application/x-shar": { - source: "apache", - extensions: ["shar"], - }, - "application/x-shockwave-flash": { - source: "apache", - compressible: false, - extensions: ["swf"], - }, - "application/x-silverlight-app": { - source: "apache", - extensions: ["xap"], - }, - "application/x-sql": { - source: "apache", - extensions: ["sql"], - }, - "application/x-stuffit": { - source: "apache", - compressible: false, - extensions: ["sit"], - }, - "application/x-stuffitx": { - source: "apache", - extensions: ["sitx"], - }, - "application/x-subrip": { - source: "apache", - extensions: ["srt"], - }, - "application/x-sv4cpio": { - source: "apache", - extensions: ["sv4cpio"], - }, - "application/x-sv4crc": { - source: "apache", - extensions: ["sv4crc"], - }, - "application/x-t3vm-image": { - source: "apache", - extensions: ["t3"], - }, - "application/x-tads": { - source: "apache", - extensions: ["gam"], - }, - "application/x-tar": { - source: "apache", - compressible: true, - extensions: ["tar"], - }, - "application/x-tcl": { - source: "apache", - extensions: ["tcl", "tk"], - }, - "application/x-tex": { - source: "apache", - extensions: ["tex"], - }, - "application/x-tex-tfm": { - source: "apache", - extensions: ["tfm"], - }, - "application/x-texinfo": { - source: "apache", - extensions: ["texinfo", "texi"], - }, - "application/x-tgif": { - source: "apache", - extensions: ["obj"], - }, - "application/x-ustar": { - source: "apache", - extensions: ["ustar"], - }, - "application/x-virtualbox-hdd": { - compressible: true, - extensions: ["hdd"], - }, - "application/x-virtualbox-ova": { - compressible: true, - extensions: ["ova"], - }, - "application/x-virtualbox-ovf": { - compressible: true, - extensions: ["ovf"], - }, - "application/x-virtualbox-vbox": { - compressible: true, - extensions: ["vbox"], - }, - "application/x-virtualbox-vbox-extpack": { - compressible: false, - extensions: ["vbox-extpack"], - }, - "application/x-virtualbox-vdi": { - compressible: true, - extensions: ["vdi"], - }, - "application/x-virtualbox-vhd": { - compressible: true, - extensions: ["vhd"], - }, - "application/x-virtualbox-vmdk": { - compressible: true, - extensions: ["vmdk"], - }, - "application/x-wais-source": { - source: "apache", - extensions: ["src"], - }, - "application/x-web-app-manifest+json": { - compressible: true, - extensions: ["webapp"], - }, - "application/x-www-form-urlencoded": { - source: "iana", - compressible: true, - }, - "application/x-x509-ca-cert": { - source: "iana", - extensions: ["der", "crt", "pem"], - }, - "application/x-x509-ca-ra-cert": { - source: "iana", - }, - "application/x-x509-next-ca-cert": { - source: "iana", - }, - "application/x-xfig": { - source: "apache", - extensions: ["fig"], - }, - "application/x-xliff+xml": { - source: "apache", - compressible: true, - extensions: ["xlf"], - }, - "application/x-xpinstall": { - source: "apache", - compressible: false, - extensions: ["xpi"], - }, - "application/x-xz": { - source: "apache", - extensions: ["xz"], - }, - "application/x-zmachine": { - source: "apache", - extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], - }, - "application/x400-bp": { - source: "iana", - }, - "application/xacml+xml": { - source: "iana", - compressible: true, - }, - "application/xaml+xml": { - source: "apache", - compressible: true, - extensions: ["xaml"], - }, - "application/xcap-att+xml": { - source: "iana", - compressible: true, - extensions: ["xav"], - }, - "application/xcap-caps+xml": { - source: "iana", - compressible: true, - extensions: ["xca"], - }, - "application/xcap-diff+xml": { - source: "iana", - compressible: true, - extensions: ["xdf"], - }, - "application/xcap-el+xml": { - source: "iana", - compressible: true, - extensions: ["xel"], - }, - "application/xcap-error+xml": { - source: "iana", - compressible: true, - }, - "application/xcap-ns+xml": { - source: "iana", - compressible: true, - extensions: ["xns"], - }, - "application/xcon-conference-info+xml": { - source: "iana", - compressible: true, - }, - "application/xcon-conference-info-diff+xml": { - source: "iana", - compressible: true, - }, - "application/xenc+xml": { - source: "iana", - compressible: true, - extensions: ["xenc"], - }, - "application/xhtml+xml": { - source: "iana", - compressible: true, - extensions: ["xhtml", "xht"], - }, - "application/xhtml-voice+xml": { - source: "apache", - compressible: true, - }, - "application/xliff+xml": { - source: "iana", - compressible: true, - extensions: ["xlf"], - }, - "application/xml": { - source: "iana", - compressible: true, - extensions: ["xml", "xsl", "xsd", "rng"], - }, - "application/xml-dtd": { - source: "iana", - compressible: true, - extensions: ["dtd"], - }, - "application/xml-external-parsed-entity": { - source: "iana", - }, - "application/xml-patch+xml": { - source: "iana", - compressible: true, - }, - "application/xmpp+xml": { - source: "iana", - compressible: true, - }, - "application/xop+xml": { - source: "iana", - compressible: true, - extensions: ["xop"], - }, - "application/xproc+xml": { - source: "apache", - compressible: true, - extensions: ["xpl"], - }, - "application/xslt+xml": { - source: "iana", - compressible: true, - extensions: ["xsl", "xslt"], - }, - "application/xspf+xml": { - source: "apache", - compressible: true, - extensions: ["xspf"], - }, - "application/xv+xml": { - source: "iana", - compressible: true, - extensions: ["mxml", "xhvml", "xvml", "xvm"], - }, - "application/yang": { - source: "iana", - extensions: ["yang"], - }, - "application/yang-data+json": { - source: "iana", - compressible: true, - }, - "application/yang-data+xml": { - source: "iana", - compressible: true, - }, - "application/yang-patch+json": { - source: "iana", - compressible: true, - }, - "application/yang-patch+xml": { - source: "iana", - compressible: true, - }, - "application/yin+xml": { - source: "iana", - compressible: true, - extensions: ["yin"], - }, - "application/zip": { - source: "iana", - compressible: false, - extensions: ["zip"], - }, - "application/zlib": { - source: "iana", - }, - "application/zstd": { - source: "iana", - }, - "audio/1d-interleaved-parityfec": { - source: "iana", - }, - "audio/32kadpcm": { - source: "iana", - }, - "audio/3gpp": { - source: "iana", - compressible: false, - extensions: ["3gpp"], - }, - "audio/3gpp2": { - source: "iana", - }, - "audio/aac": { - source: "iana", - }, - "audio/ac3": { - source: "iana", - }, - "audio/adpcm": { - source: "apache", - extensions: ["adp"], - }, - "audio/amr": { - source: "iana", - extensions: ["amr"], - }, - "audio/amr-wb": { - source: "iana", - }, - "audio/amr-wb+": { - source: "iana", - }, - "audio/aptx": { - source: "iana", - }, - "audio/asc": { - source: "iana", - }, - "audio/atrac-advanced-lossless": { - source: "iana", - }, - "audio/atrac-x": { - source: "iana", - }, - "audio/atrac3": { - source: "iana", - }, - "audio/basic": { - source: "iana", - compressible: false, - extensions: ["au", "snd"], - }, - "audio/bv16": { - source: "iana", - }, - "audio/bv32": { - source: "iana", - }, - "audio/clearmode": { - source: "iana", - }, - "audio/cn": { - source: "iana", - }, - "audio/dat12": { - source: "iana", - }, - "audio/dls": { - source: "iana", - }, - "audio/dsr-es201108": { - source: "iana", - }, - "audio/dsr-es202050": { - source: "iana", - }, - "audio/dsr-es202211": { - source: "iana", - }, - "audio/dsr-es202212": { - source: "iana", - }, - "audio/dv": { - source: "iana", - }, - "audio/dvi4": { - source: "iana", - }, - "audio/eac3": { - source: "iana", - }, - "audio/encaprtp": { - source: "iana", - }, - "audio/evrc": { - source: "iana", - }, - "audio/evrc-qcp": { - source: "iana", - }, - "audio/evrc0": { - source: "iana", - }, - "audio/evrc1": { - source: "iana", - }, - "audio/evrcb": { - source: "iana", - }, - "audio/evrcb0": { - source: "iana", - }, - "audio/evrcb1": { - source: "iana", - }, - "audio/evrcnw": { - source: "iana", - }, - "audio/evrcnw0": { - source: "iana", - }, - "audio/evrcnw1": { - source: "iana", - }, - "audio/evrcwb": { - source: "iana", - }, - "audio/evrcwb0": { - source: "iana", - }, - "audio/evrcwb1": { - source: "iana", - }, - "audio/evs": { - source: "iana", - }, - "audio/flexfec": { - source: "iana", - }, - "audio/fwdred": { - source: "iana", - }, - "audio/g711-0": { - source: "iana", - }, - "audio/g719": { - source: "iana", - }, - "audio/g722": { - source: "iana", - }, - "audio/g7221": { - source: "iana", - }, - "audio/g723": { - source: "iana", - }, - "audio/g726-16": { - source: "iana", - }, - "audio/g726-24": { - source: "iana", - }, - "audio/g726-32": { - source: "iana", - }, - "audio/g726-40": { - source: "iana", - }, - "audio/g728": { - source: "iana", - }, - "audio/g729": { - source: "iana", - }, - "audio/g7291": { - source: "iana", - }, - "audio/g729d": { - source: "iana", - }, - "audio/g729e": { - source: "iana", - }, - "audio/gsm": { - source: "iana", - }, - "audio/gsm-efr": { - source: "iana", - }, - "audio/gsm-hr-08": { - source: "iana", - }, - "audio/ilbc": { - source: "iana", - }, - "audio/ip-mr_v2.5": { - source: "iana", - }, - "audio/isac": { - source: "apache", - }, - "audio/l16": { - source: "iana", - }, - "audio/l20": { - source: "iana", - }, - "audio/l24": { - source: "iana", - compressible: false, - }, - "audio/l8": { - source: "iana", - }, - "audio/lpc": { - source: "iana", - }, - "audio/melp": { - source: "iana", - }, - "audio/melp1200": { - source: "iana", - }, - "audio/melp2400": { - source: "iana", - }, - "audio/melp600": { - source: "iana", - }, - "audio/mhas": { - source: "iana", - }, - "audio/midi": { - source: "apache", - extensions: ["mid", "midi", "kar", "rmi"], - }, - "audio/mobile-xmf": { - source: "iana", - extensions: ["mxmf"], - }, - "audio/mp3": { - compressible: false, - extensions: ["mp3"], - }, - "audio/mp4": { - source: "iana", - compressible: false, - extensions: ["m4a", "mp4a"], - }, - "audio/mp4a-latm": { - source: "iana", - }, - "audio/mpa": { - source: "iana", - }, - "audio/mpa-robust": { - source: "iana", - }, - "audio/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], - }, - "audio/mpeg4-generic": { - source: "iana", - }, - "audio/musepack": { - source: "apache", - }, - "audio/ogg": { - source: "iana", - compressible: false, - extensions: ["oga", "ogg", "spx", "opus"], - }, - "audio/opus": { - source: "iana", - }, - "audio/parityfec": { - source: "iana", - }, - "audio/pcma": { - source: "iana", - }, - "audio/pcma-wb": { - source: "iana", - }, - "audio/pcmu": { - source: "iana", - }, - "audio/pcmu-wb": { - source: "iana", - }, - "audio/prs.sid": { - source: "iana", - }, - "audio/qcelp": { - source: "iana", - }, - "audio/raptorfec": { - source: "iana", - }, - "audio/red": { - source: "iana", - }, - "audio/rtp-enc-aescm128": { - source: "iana", - }, - "audio/rtp-midi": { - source: "iana", - }, - "audio/rtploopback": { - source: "iana", - }, - "audio/rtx": { - source: "iana", - }, - "audio/s3m": { - source: "apache", - extensions: ["s3m"], - }, - "audio/scip": { - source: "iana", - }, - "audio/silk": { - source: "apache", - extensions: ["sil"], - }, - "audio/smv": { - source: "iana", - }, - "audio/smv-qcp": { - source: "iana", - }, - "audio/smv0": { - source: "iana", - }, - "audio/sofa": { - source: "iana", - }, - "audio/sp-midi": { - source: "iana", - }, - "audio/speex": { - source: "iana", - }, - "audio/t140c": { - source: "iana", - }, - "audio/t38": { - source: "iana", - }, - "audio/telephone-event": { - source: "iana", - }, - "audio/tetra_acelp": { - source: "iana", - }, - "audio/tetra_acelp_bb": { - source: "iana", - }, - "audio/tone": { - source: "iana", - }, - "audio/tsvcis": { - source: "iana", - }, - "audio/uemclip": { - source: "iana", - }, - "audio/ulpfec": { - source: "iana", - }, - "audio/usac": { - source: "iana", - }, - "audio/vdvi": { - source: "iana", - }, - "audio/vmr-wb": { - source: "iana", - }, - "audio/vnd.3gpp.iufp": { - source: "iana", - }, - "audio/vnd.4sb": { - source: "iana", - }, - "audio/vnd.audiokoz": { - source: "iana", - }, - "audio/vnd.celp": { - source: "iana", - }, - "audio/vnd.cisco.nse": { - source: "iana", - }, - "audio/vnd.cmles.radio-events": { - source: "iana", - }, - "audio/vnd.cns.anp1": { - source: "iana", - }, - "audio/vnd.cns.inf1": { - source: "iana", - }, - "audio/vnd.dece.audio": { - source: "iana", - extensions: ["uva", "uvva"], - }, - "audio/vnd.digital-winds": { - source: "iana", - extensions: ["eol"], - }, - "audio/vnd.dlna.adts": { - source: "iana", - }, - "audio/vnd.dolby.heaac.1": { - source: "iana", - }, - "audio/vnd.dolby.heaac.2": { - source: "iana", - }, - "audio/vnd.dolby.mlp": { - source: "iana", - }, - "audio/vnd.dolby.mps": { - source: "iana", - }, - "audio/vnd.dolby.pl2": { - source: "iana", - }, - "audio/vnd.dolby.pl2x": { - source: "iana", - }, - "audio/vnd.dolby.pl2z": { - source: "iana", - }, - "audio/vnd.dolby.pulse.1": { - source: "iana", - }, - "audio/vnd.dra": { - source: "iana", - extensions: ["dra"], - }, - "audio/vnd.dts": { - source: "iana", - extensions: ["dts"], - }, - "audio/vnd.dts.hd": { - source: "iana", - extensions: ["dtshd"], - }, - "audio/vnd.dts.uhd": { - source: "iana", - }, - "audio/vnd.dvb.file": { - source: "iana", - }, - "audio/vnd.everad.plj": { - source: "iana", - }, - "audio/vnd.hns.audio": { - source: "iana", - }, - "audio/vnd.lucent.voice": { - source: "iana", - extensions: ["lvp"], - }, - "audio/vnd.ms-playready.media.pya": { - source: "iana", - extensions: ["pya"], - }, - "audio/vnd.nokia.mobile-xmf": { - source: "iana", - }, - "audio/vnd.nortel.vbk": { - source: "iana", - }, - "audio/vnd.nuera.ecelp4800": { - source: "iana", - extensions: ["ecelp4800"], - }, - "audio/vnd.nuera.ecelp7470": { - source: "iana", - extensions: ["ecelp7470"], - }, - "audio/vnd.nuera.ecelp9600": { - source: "iana", - extensions: ["ecelp9600"], - }, - "audio/vnd.octel.sbc": { - source: "iana", - }, - "audio/vnd.presonus.multitrack": { - source: "iana", - }, - "audio/vnd.qcelp": { - source: "iana", - }, - "audio/vnd.rhetorex.32kadpcm": { - source: "iana", - }, - "audio/vnd.rip": { - source: "iana", - extensions: ["rip"], - }, - "audio/vnd.rn-realaudio": { - compressible: false, - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - source: "iana", - }, - "audio/vnd.vmx.cvsd": { - source: "iana", - }, - "audio/vnd.wave": { - compressible: false, - }, - "audio/vorbis": { - source: "iana", - compressible: false, - }, - "audio/vorbis-config": { - source: "iana", - }, - "audio/wav": { - compressible: false, - extensions: ["wav"], - }, - "audio/wave": { - compressible: false, - extensions: ["wav"], - }, - "audio/webm": { - source: "apache", - compressible: false, - extensions: ["weba"], - }, - "audio/x-aac": { - source: "apache", - compressible: false, - extensions: ["aac"], - }, - "audio/x-aiff": { - source: "apache", - extensions: ["aif", "aiff", "aifc"], - }, - "audio/x-caf": { - source: "apache", - compressible: false, - extensions: ["caf"], - }, - "audio/x-flac": { - source: "apache", - extensions: ["flac"], - }, - "audio/x-m4a": { - source: "nginx", - extensions: ["m4a"], - }, - "audio/x-matroska": { - source: "apache", - extensions: ["mka"], - }, - "audio/x-mpegurl": { - source: "apache", - extensions: ["m3u"], - }, - "audio/x-ms-wax": { - source: "apache", - extensions: ["wax"], - }, - "audio/x-ms-wma": { - source: "apache", - extensions: ["wma"], - }, - "audio/x-pn-realaudio": { - source: "apache", - extensions: ["ram", "ra"], - }, - "audio/x-pn-realaudio-plugin": { - source: "apache", - extensions: ["rmp"], - }, - "audio/x-realaudio": { - source: "nginx", - extensions: ["ra"], - }, - "audio/x-tta": { - source: "apache", - }, - "audio/x-wav": { - source: "apache", - extensions: ["wav"], - }, - "audio/xm": { - source: "apache", - extensions: ["xm"], - }, - "chemical/x-cdx": { - source: "apache", - extensions: ["cdx"], - }, - "chemical/x-cif": { - source: "apache", - extensions: ["cif"], - }, - "chemical/x-cmdf": { - source: "apache", - extensions: ["cmdf"], - }, - "chemical/x-cml": { - source: "apache", - extensions: ["cml"], - }, - "chemical/x-csml": { - source: "apache", - extensions: ["csml"], - }, - "chemical/x-pdb": { - source: "apache", - }, - "chemical/x-xyz": { - source: "apache", - extensions: ["xyz"], - }, - "font/collection": { - source: "iana", - extensions: ["ttc"], - }, - "font/otf": { - source: "iana", - compressible: true, - extensions: ["otf"], - }, - "font/sfnt": { - source: "iana", - }, - "font/ttf": { - source: "iana", - compressible: true, - extensions: ["ttf"], - }, - "font/woff": { - source: "iana", - extensions: ["woff"], - }, - "font/woff2": { - source: "iana", - extensions: ["woff2"], - }, - "image/aces": { - source: "iana", - extensions: ["exr"], - }, - "image/apng": { - compressible: false, - extensions: ["apng"], - }, - "image/avci": { - source: "iana", - extensions: ["avci"], - }, - "image/avcs": { - source: "iana", - extensions: ["avcs"], - }, - "image/avif": { - source: "iana", - compressible: false, - extensions: ["avif"], - }, - "image/bmp": { - source: "iana", - compressible: true, - extensions: ["bmp"], - }, - "image/cgm": { - source: "iana", - extensions: ["cgm"], - }, - "image/dicom-rle": { - source: "iana", - extensions: ["drle"], - }, - "image/emf": { - source: "iana", - extensions: ["emf"], - }, - "image/fits": { - source: "iana", - extensions: ["fits"], - }, - "image/g3fax": { - source: "iana", - extensions: ["g3"], - }, - "image/gif": { - source: "iana", - compressible: false, - extensions: ["gif"], - }, - "image/heic": { - source: "iana", - extensions: ["heic"], - }, - "image/heic-sequence": { - source: "iana", - extensions: ["heics"], - }, - "image/heif": { - source: "iana", - extensions: ["heif"], - }, - "image/heif-sequence": { - source: "iana", - extensions: ["heifs"], - }, - "image/hej2k": { - source: "iana", - extensions: ["hej2"], - }, - "image/hsj2": { - source: "iana", - extensions: ["hsj2"], - }, - "image/ief": { - source: "iana", - extensions: ["ief"], - }, - "image/jls": { - source: "iana", - extensions: ["jls"], - }, - "image/jp2": { - source: "iana", - compressible: false, - extensions: ["jp2", "jpg2"], - }, - "image/jpeg": { - source: "iana", - compressible: false, - extensions: ["jpeg", "jpg", "jpe"], - }, - "image/jph": { - source: "iana", - extensions: ["jph"], - }, - "image/jphc": { - source: "iana", - extensions: ["jhc"], - }, - "image/jpm": { - source: "iana", - compressible: false, - extensions: ["jpm"], - }, - "image/jpx": { - source: "iana", - compressible: false, - extensions: ["jpx", "jpf"], - }, - "image/jxr": { - source: "iana", - extensions: ["jxr"], - }, - "image/jxra": { - source: "iana", - extensions: ["jxra"], - }, - "image/jxrs": { - source: "iana", - extensions: ["jxrs"], - }, - "image/jxs": { - source: "iana", - extensions: ["jxs"], - }, - "image/jxsc": { - source: "iana", - extensions: ["jxsc"], - }, - "image/jxsi": { - source: "iana", - extensions: ["jxsi"], - }, - "image/jxss": { - source: "iana", - extensions: ["jxss"], - }, - "image/ktx": { - source: "iana", - extensions: ["ktx"], - }, - "image/ktx2": { - source: "iana", - extensions: ["ktx2"], - }, - "image/naplps": { - source: "iana", - }, - "image/pjpeg": { - compressible: false, - }, - "image/png": { - source: "iana", - compressible: false, - extensions: ["png"], - }, - "image/prs.btif": { - source: "iana", - extensions: ["btif"], - }, - "image/prs.pti": { - source: "iana", - extensions: ["pti"], - }, - "image/pwg-raster": { - source: "iana", - }, - "image/sgi": { - source: "apache", - extensions: ["sgi"], - }, - "image/svg+xml": { - source: "iana", - compressible: true, - extensions: ["svg", "svgz"], - }, - "image/t38": { - source: "iana", - extensions: ["t38"], - }, - "image/tiff": { - source: "iana", - compressible: false, - extensions: ["tif", "tiff"], - }, - "image/tiff-fx": { - source: "iana", - extensions: ["tfx"], - }, - "image/vnd.adobe.photoshop": { - source: "iana", - compressible: true, - extensions: ["psd"], - }, - "image/vnd.airzip.accelerator.azv": { - source: "iana", - extensions: ["azv"], - }, - "image/vnd.cns.inf2": { - source: "iana", - }, - "image/vnd.dece.graphic": { - source: "iana", - extensions: ["uvi", "uvvi", "uvg", "uvvg"], - }, - "image/vnd.djvu": { - source: "iana", - extensions: ["djvu", "djv"], - }, - "image/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"], - }, - "image/vnd.dwg": { - source: "iana", - extensions: ["dwg"], - }, - "image/vnd.dxf": { - source: "iana", - extensions: ["dxf"], - }, - "image/vnd.fastbidsheet": { - source: "iana", - extensions: ["fbs"], - }, - "image/vnd.fpx": { - source: "iana", - extensions: ["fpx"], - }, - "image/vnd.fst": { - source: "iana", - extensions: ["fst"], - }, - "image/vnd.fujixerox.edmics-mmr": { - source: "iana", - extensions: ["mmr"], - }, - "image/vnd.fujixerox.edmics-rlc": { - source: "iana", - extensions: ["rlc"], - }, - "image/vnd.globalgraphics.pgb": { - source: "iana", - }, - "image/vnd.microsoft.icon": { - source: "iana", - compressible: true, - extensions: ["ico"], - }, - "image/vnd.mix": { - source: "iana", - }, - "image/vnd.mozilla.apng": { - source: "iana", - }, - "image/vnd.ms-dds": { - compressible: true, - extensions: ["dds"], - }, - "image/vnd.ms-modi": { - source: "iana", - extensions: ["mdi"], - }, - "image/vnd.ms-photo": { - source: "apache", - extensions: ["wdp"], - }, - "image/vnd.net-fpx": { - source: "iana", - extensions: ["npx"], - }, - "image/vnd.pco.b16": { - source: "iana", - extensions: ["b16"], - }, - "image/vnd.radiance": { - source: "iana", - }, - "image/vnd.sealed.png": { - source: "iana", - }, - "image/vnd.sealedmedia.softseal.gif": { - source: "iana", - }, - "image/vnd.sealedmedia.softseal.jpg": { - source: "iana", - }, - "image/vnd.svf": { - source: "iana", - }, - "image/vnd.tencent.tap": { - source: "iana", - extensions: ["tap"], - }, - "image/vnd.valve.source.texture": { - source: "iana", - extensions: ["vtf"], - }, - "image/vnd.wap.wbmp": { - source: "iana", - extensions: ["wbmp"], - }, - "image/vnd.xiff": { - source: "iana", - extensions: ["xif"], - }, - "image/vnd.zbrush.pcx": { - source: "iana", - extensions: ["pcx"], - }, - "image/webp": { - source: "apache", - extensions: ["webp"], - }, - "image/wmf": { - source: "iana", - extensions: ["wmf"], - }, - "image/x-3ds": { - source: "apache", - extensions: ["3ds"], - }, - "image/x-cmu-raster": { - source: "apache", - extensions: ["ras"], - }, - "image/x-cmx": { - source: "apache", - extensions: ["cmx"], - }, - "image/x-freehand": { - source: "apache", - extensions: ["fh", "fhc", "fh4", "fh5", "fh7"], - }, - "image/x-icon": { - source: "apache", - compressible: true, - extensions: ["ico"], - }, - "image/x-jng": { - source: "nginx", - extensions: ["jng"], - }, - "image/x-mrsid-image": { - source: "apache", - extensions: ["sid"], - }, - "image/x-ms-bmp": { - source: "nginx", - compressible: true, - extensions: ["bmp"], - }, - "image/x-pcx": { - source: "apache", - extensions: ["pcx"], - }, - "image/x-pict": { - source: "apache", - extensions: ["pic", "pct"], - }, - "image/x-portable-anymap": { - source: "apache", - extensions: ["pnm"], - }, - "image/x-portable-bitmap": { - source: "apache", - extensions: ["pbm"], - }, - "image/x-portable-graymap": { - source: "apache", - extensions: ["pgm"], - }, - "image/x-portable-pixmap": { - source: "apache", - extensions: ["ppm"], - }, - "image/x-rgb": { - source: "apache", - extensions: ["rgb"], - }, - "image/x-tga": { - source: "apache", - extensions: ["tga"], - }, - "image/x-xbitmap": { - source: "apache", - extensions: ["xbm"], - }, - "image/x-xcf": { - compressible: false, - }, - "image/x-xpixmap": { - source: "apache", - extensions: ["xpm"], - }, - "image/x-xwindowdump": { - source: "apache", - extensions: ["xwd"], - }, - "message/cpim": { - source: "iana", - }, - "message/delivery-status": { - source: "iana", - }, - "message/disposition-notification": { - source: "iana", - extensions: ["disposition-notification"], - }, - "message/external-body": { - source: "iana", - }, - "message/feedback-report": { - source: "iana", - }, - "message/global": { - source: "iana", - extensions: ["u8msg"], - }, - "message/global-delivery-status": { - source: "iana", - extensions: ["u8dsn"], - }, - "message/global-disposition-notification": { - source: "iana", - extensions: ["u8mdn"], - }, - "message/global-headers": { - source: "iana", - extensions: ["u8hdr"], - }, - "message/http": { - source: "iana", - compressible: false, - }, - "message/imdn+xml": { - source: "iana", - compressible: true, - }, - "message/news": { - source: "iana", - }, - "message/partial": { - source: "iana", - compressible: false, - }, - "message/rfc822": { - source: "iana", - compressible: true, - extensions: ["eml", "mime"], - }, - "message/s-http": { - source: "iana", - }, - "message/sip": { - source: "iana", - }, - "message/sipfrag": { - source: "iana", - }, - "message/tracking-status": { - source: "iana", - }, - "message/vnd.si.simp": { - source: "iana", - }, - "message/vnd.wfa.wsc": { - source: "iana", - extensions: ["wsc"], - }, - "model/3mf": { - source: "iana", - extensions: ["3mf"], - }, - "model/e57": { - source: "iana", - }, - "model/gltf+json": { - source: "iana", - compressible: true, - extensions: ["gltf"], - }, - "model/gltf-binary": { - source: "iana", - compressible: true, - extensions: ["glb"], - }, - "model/iges": { - source: "iana", - compressible: false, - extensions: ["igs", "iges"], - }, - "model/mesh": { - source: "iana", - compressible: false, - extensions: ["msh", "mesh", "silo"], - }, - "model/mtl": { - source: "iana", - extensions: ["mtl"], - }, - "model/obj": { - source: "iana", - extensions: ["obj"], - }, - "model/step": { - source: "iana", - }, - "model/step+xml": { - source: "iana", - compressible: true, - extensions: ["stpx"], - }, - "model/step+zip": { - source: "iana", - compressible: false, - extensions: ["stpz"], - }, - "model/step-xml+zip": { - source: "iana", - compressible: false, - extensions: ["stpxz"], - }, - "model/stl": { - source: "iana", - extensions: ["stl"], - }, - "model/vnd.collada+xml": { - source: "iana", - compressible: true, - extensions: ["dae"], - }, - "model/vnd.dwf": { - source: "iana", - extensions: ["dwf"], - }, - "model/vnd.flatland.3dml": { - source: "iana", - }, - "model/vnd.gdl": { - source: "iana", - extensions: ["gdl"], - }, - "model/vnd.gs-gdl": { - source: "apache", - }, - "model/vnd.gs.gdl": { - source: "iana", - }, - "model/vnd.gtw": { - source: "iana", - extensions: ["gtw"], - }, - "model/vnd.moml+xml": { - source: "iana", - compressible: true, - }, - "model/vnd.mts": { - source: "iana", - extensions: ["mts"], - }, - "model/vnd.opengex": { - source: "iana", - extensions: ["ogex"], - }, - "model/vnd.parasolid.transmit.binary": { - source: "iana", - extensions: ["x_b"], - }, - "model/vnd.parasolid.transmit.text": { - source: "iana", - extensions: ["x_t"], - }, - "model/vnd.pytha.pyox": { - source: "iana", - }, - "model/vnd.rosette.annotated-data-model": { - source: "iana", - }, - "model/vnd.sap.vds": { - source: "iana", - extensions: ["vds"], - }, - "model/vnd.usdz+zip": { - source: "iana", - compressible: false, - extensions: ["usdz"], - }, - "model/vnd.valve.source.compiled-map": { - source: "iana", - extensions: ["bsp"], - }, - "model/vnd.vtu": { - source: "iana", - extensions: ["vtu"], - }, - "model/vrml": { - source: "iana", - compressible: false, - extensions: ["wrl", "vrml"], - }, - "model/x3d+binary": { - source: "apache", - compressible: false, - extensions: ["x3db", "x3dbz"], - }, - "model/x3d+fastinfoset": { - source: "iana", - extensions: ["x3db"], - }, - "model/x3d+vrml": { - source: "apache", - compressible: false, - extensions: ["x3dv", "x3dvz"], - }, - "model/x3d+xml": { - source: "iana", - compressible: true, - extensions: ["x3d", "x3dz"], - }, - "model/x3d-vrml": { - source: "iana", - extensions: ["x3dv"], - }, - "multipart/alternative": { - source: "iana", - compressible: false, - }, - "multipart/appledouble": { - source: "iana", - }, - "multipart/byteranges": { - source: "iana", - }, - "multipart/digest": { - source: "iana", - }, - "multipart/encrypted": { - source: "iana", - compressible: false, - }, - "multipart/form-data": { - source: "iana", - compressible: false, - }, - "multipart/header-set": { - source: "iana", - }, - "multipart/mixed": { - source: "iana", - }, - "multipart/multilingual": { - source: "iana", - }, - "multipart/parallel": { - source: "iana", - }, - "multipart/related": { - source: "iana", - compressible: false, - }, - "multipart/report": { - source: "iana", - }, - "multipart/signed": { - source: "iana", - compressible: false, - }, - "multipart/vnd.bint.med-plus": { - source: "iana", - }, - "multipart/voice-message": { - source: "iana", - }, - "multipart/x-mixed-replace": { - source: "iana", - }, - "text/1d-interleaved-parityfec": { - source: "iana", - }, - "text/cache-manifest": { - source: "iana", - compressible: true, - extensions: ["appcache", "manifest"], - }, - "text/calendar": { - source: "iana", - extensions: ["ics", "ifb"], - }, - "text/calender": { - compressible: true, - }, - "text/cmd": { - compressible: true, - }, - "text/coffeescript": { - extensions: ["coffee", "litcoffee"], - }, - "text/cql": { - source: "iana", - }, - "text/cql-expression": { - source: "iana", - }, - "text/cql-identifier": { - source: "iana", - }, - "text/css": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["css"], - }, - "text/csv": { - source: "iana", - compressible: true, - extensions: ["csv"], - }, - "text/csv-schema": { - source: "iana", - }, - "text/directory": { - source: "iana", - }, - "text/dns": { - source: "iana", - }, - "text/ecmascript": { - source: "iana", - }, - "text/encaprtp": { - source: "iana", - }, - "text/enriched": { - source: "iana", - }, - "text/fhirpath": { - source: "iana", - }, - "text/flexfec": { - source: "iana", - }, - "text/fwdred": { - source: "iana", - }, - "text/gff3": { - source: "iana", - }, - "text/grammar-ref-list": { - source: "iana", - }, - "text/html": { - source: "iana", - compressible: true, - extensions: ["html", "htm", "shtml"], - }, - "text/jade": { - extensions: ["jade"], - }, - "text/javascript": { - source: "iana", - compressible: true, - }, - "text/jcr-cnd": { - source: "iana", - }, - "text/jsx": { - compressible: true, - extensions: ["jsx"], - }, - "text/less": { - compressible: true, - extensions: ["less"], - }, - "text/markdown": { - source: "iana", - compressible: true, - extensions: ["markdown", "md"], - }, - "text/mathml": { - source: "nginx", - extensions: ["mml"], - }, - "text/mdx": { - compressible: true, - extensions: ["mdx"], - }, - "text/mizar": { - source: "iana", - }, - "text/n3": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["n3"], - }, - "text/parameters": { - source: "iana", - charset: "UTF-8", - }, - "text/parityfec": { - source: "iana", - }, - "text/plain": { - source: "iana", - compressible: true, - extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"], - }, - "text/provenance-notation": { - source: "iana", - charset: "UTF-8", - }, - "text/prs.fallenstein.rst": { - source: "iana", - }, - "text/prs.lines.tag": { - source: "iana", - extensions: ["dsc"], - }, - "text/prs.prop.logic": { - source: "iana", - }, - "text/raptorfec": { - source: "iana", - }, - "text/red": { - source: "iana", - }, - "text/rfc822-headers": { - source: "iana", - }, - "text/richtext": { - source: "iana", - compressible: true, - extensions: ["rtx"], - }, - "text/rtf": { - source: "iana", - compressible: true, - extensions: ["rtf"], - }, - "text/rtp-enc-aescm128": { - source: "iana", - }, - "text/rtploopback": { - source: "iana", - }, - "text/rtx": { - source: "iana", - }, - "text/sgml": { - source: "iana", - extensions: ["sgml", "sgm"], - }, - "text/shaclc": { - source: "iana", - }, - "text/shex": { - source: "iana", - extensions: ["shex"], - }, - "text/slim": { - extensions: ["slim", "slm"], - }, - "text/spdx": { - source: "iana", - extensions: ["spdx"], - }, - "text/strings": { - source: "iana", - }, - "text/stylus": { - extensions: ["stylus", "styl"], - }, - "text/t140": { - source: "iana", - }, - "text/tab-separated-values": { - source: "iana", - compressible: true, - extensions: ["tsv"], - }, - "text/troff": { - source: "iana", - extensions: ["t", "tr", "roff", "man", "me", "ms"], - }, - "text/turtle": { - source: "iana", - charset: "UTF-8", - extensions: ["ttl"], - }, - "text/ulpfec": { - source: "iana", - }, - "text/uri-list": { - source: "iana", - compressible: true, - extensions: ["uri", "uris", "urls"], - }, - "text/vcard": { - source: "iana", - compressible: true, - extensions: ["vcard"], - }, - "text/vnd.a": { - source: "iana", - }, - "text/vnd.abc": { - source: "iana", - }, - "text/vnd.ascii-art": { - source: "iana", - }, - "text/vnd.curl": { - source: "iana", - extensions: ["curl"], - }, - "text/vnd.curl.dcurl": { - source: "apache", - extensions: ["dcurl"], - }, - "text/vnd.curl.mcurl": { - source: "apache", - extensions: ["mcurl"], - }, - "text/vnd.curl.scurl": { - source: "apache", - extensions: ["scurl"], - }, - "text/vnd.debian.copyright": { - source: "iana", - charset: "UTF-8", - }, - "text/vnd.dmclientscript": { - source: "iana", - }, - "text/vnd.dvb.subtitle": { - source: "iana", - extensions: ["sub"], - }, - "text/vnd.esmertec.theme-descriptor": { - source: "iana", - charset: "UTF-8", - }, - "text/vnd.familysearch.gedcom": { - source: "iana", - extensions: ["ged"], - }, - "text/vnd.ficlab.flt": { - source: "iana", - }, - "text/vnd.fly": { - source: "iana", - extensions: ["fly"], - }, - "text/vnd.fmi.flexstor": { - source: "iana", - extensions: ["flx"], - }, - "text/vnd.gml": { - source: "iana", - }, - "text/vnd.graphviz": { - source: "iana", - extensions: ["gv"], - }, - "text/vnd.hans": { - source: "iana", - }, - "text/vnd.hgl": { - source: "iana", - }, - "text/vnd.in3d.3dml": { - source: "iana", - extensions: ["3dml"], - }, - "text/vnd.in3d.spot": { - source: "iana", - extensions: ["spot"], - }, - "text/vnd.iptc.newsml": { - source: "iana", - }, - "text/vnd.iptc.nitf": { - source: "iana", - }, - "text/vnd.latex-z": { - source: "iana", - }, - "text/vnd.motorola.reflex": { - source: "iana", - }, - "text/vnd.ms-mediapackage": { - source: "iana", - }, - "text/vnd.net2phone.commcenter.command": { - source: "iana", - }, - "text/vnd.radisys.msml-basic-layout": { - source: "iana", - }, - "text/vnd.senx.warpscript": { - source: "iana", - }, - "text/vnd.si.uricatalogue": { - source: "iana", - }, - "text/vnd.sosi": { - source: "iana", - }, - "text/vnd.sun.j2me.app-descriptor": { - source: "iana", - charset: "UTF-8", - extensions: ["jad"], - }, - "text/vnd.trolltech.linguist": { - source: "iana", - charset: "UTF-8", - }, - "text/vnd.wap.si": { - source: "iana", - }, - "text/vnd.wap.sl": { - source: "iana", - }, - "text/vnd.wap.wml": { - source: "iana", - extensions: ["wml"], - }, - "text/vnd.wap.wmlscript": { - source: "iana", - extensions: ["wmls"], - }, - "text/vtt": { - source: "iana", - charset: "UTF-8", - compressible: true, - extensions: ["vtt"], - }, - "text/x-asm": { - source: "apache", - extensions: ["s", "asm"], - }, - "text/x-c": { - source: "apache", - extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], - }, - "text/x-component": { - source: "nginx", - extensions: ["htc"], - }, - "text/x-fortran": { - source: "apache", - extensions: ["f", "for", "f77", "f90"], - }, - "text/x-gwt-rpc": { - compressible: true, - }, - "text/x-handlebars-template": { - extensions: ["hbs"], - }, - "text/x-java-source": { - source: "apache", - extensions: ["java"], - }, - "text/x-jquery-tmpl": { - compressible: true, - }, - "text/x-lua": { - extensions: ["lua"], - }, - "text/x-markdown": { - compressible: true, - extensions: ["mkd"], - }, - "text/x-nfo": { - source: "apache", - extensions: ["nfo"], - }, - "text/x-opml": { - source: "apache", - extensions: ["opml"], - }, - "text/x-org": { - compressible: true, - extensions: ["org"], - }, - "text/x-pascal": { - source: "apache", - extensions: ["p", "pas"], - }, - "text/x-processing": { - compressible: true, - extensions: ["pde"], - }, - "text/x-sass": { - extensions: ["sass"], - }, - "text/x-scss": { - extensions: ["scss"], - }, - "text/x-setext": { - source: "apache", - extensions: ["etx"], - }, - "text/x-sfv": { - source: "apache", - extensions: ["sfv"], - }, - "text/x-suse-ymp": { - compressible: true, - extensions: ["ymp"], - }, - "text/x-uuencode": { - source: "apache", - extensions: ["uu"], - }, - "text/x-vcalendar": { - source: "apache", - extensions: ["vcs"], - }, - "text/x-vcard": { - source: "apache", - extensions: ["vcf"], - }, - "text/xml": { - source: "iana", - compressible: true, - extensions: ["xml"], - }, - "text/xml-external-parsed-entity": { - source: "iana", - }, - "text/yaml": { - compressible: true, - extensions: ["yaml", "yml"], - }, - "video/1d-interleaved-parityfec": { - source: "iana", - }, - "video/3gpp": { - source: "iana", - extensions: ["3gp", "3gpp"], - }, - "video/3gpp-tt": { - source: "iana", - }, - "video/3gpp2": { - source: "iana", - extensions: ["3g2"], - }, - "video/av1": { - source: "iana", - }, - "video/bmpeg": { - source: "iana", - }, - "video/bt656": { - source: "iana", - }, - "video/celb": { - source: "iana", - }, - "video/dv": { - source: "iana", - }, - "video/encaprtp": { - source: "iana", - }, - "video/ffv1": { - source: "iana", - }, - "video/flexfec": { - source: "iana", - }, - "video/h261": { - source: "iana", - extensions: ["h261"], - }, - "video/h263": { - source: "iana", - extensions: ["h263"], - }, - "video/h263-1998": { - source: "iana", - }, - "video/h263-2000": { - source: "iana", - }, - "video/h264": { - source: "iana", - extensions: ["h264"], - }, - "video/h264-rcdo": { - source: "iana", - }, - "video/h264-svc": { - source: "iana", - }, - "video/h265": { - source: "iana", - }, - "video/iso.segment": { - source: "iana", - extensions: ["m4s"], - }, - "video/jpeg": { - source: "iana", - extensions: ["jpgv"], - }, - "video/jpeg2000": { - source: "iana", - }, - "video/jpm": { - source: "apache", - extensions: ["jpm", "jpgm"], - }, - "video/jxsv": { - source: "iana", - }, - "video/mj2": { - source: "iana", - extensions: ["mj2", "mjp2"], - }, - "video/mp1s": { - source: "iana", - }, - "video/mp2p": { - source: "iana", - }, - "video/mp2t": { - source: "iana", - extensions: ["ts"], - }, - "video/mp4": { - source: "iana", - compressible: false, - extensions: ["mp4", "mp4v", "mpg4"], - }, - "video/mp4v-es": { - source: "iana", - }, - "video/mpeg": { - source: "iana", - compressible: false, - extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"], - }, - "video/mpeg4-generic": { - source: "iana", - }, - "video/mpv": { - source: "iana", - }, - "video/nv": { - source: "iana", - }, - "video/ogg": { - source: "iana", - compressible: false, - extensions: ["ogv"], - }, - "video/parityfec": { - source: "iana", - }, - "video/pointer": { - source: "iana", - }, - "video/quicktime": { - source: "iana", - compressible: false, - extensions: ["qt", "mov"], - }, - "video/raptorfec": { - source: "iana", - }, - "video/raw": { - source: "iana", - }, - "video/rtp-enc-aescm128": { - source: "iana", - }, - "video/rtploopback": { - source: "iana", - }, - "video/rtx": { - source: "iana", - }, - "video/scip": { - source: "iana", - }, - "video/smpte291": { - source: "iana", - }, - "video/smpte292m": { - source: "iana", - }, - "video/ulpfec": { - source: "iana", - }, - "video/vc1": { - source: "iana", - }, - "video/vc2": { - source: "iana", - }, - "video/vnd.cctv": { - source: "iana", - }, - "video/vnd.dece.hd": { - source: "iana", - extensions: ["uvh", "uvvh"], - }, - "video/vnd.dece.mobile": { - source: "iana", - extensions: ["uvm", "uvvm"], - }, - "video/vnd.dece.mp4": { - source: "iana", - }, - "video/vnd.dece.pd": { - source: "iana", - extensions: ["uvp", "uvvp"], - }, - "video/vnd.dece.sd": { - source: "iana", - extensions: ["uvs", "uvvs"], - }, - "video/vnd.dece.video": { - source: "iana", - extensions: ["uvv", "uvvv"], - }, - "video/vnd.directv.mpeg": { - source: "iana", - }, - "video/vnd.directv.mpeg-tts": { - source: "iana", - }, - "video/vnd.dlna.mpeg-tts": { - source: "iana", - }, - "video/vnd.dvb.file": { - source: "iana", - extensions: ["dvb"], - }, - "video/vnd.fvt": { - source: "iana", - extensions: ["fvt"], - }, - "video/vnd.hns.video": { - source: "iana", - }, - "video/vnd.iptvforum.1dparityfec-1010": { - source: "iana", - }, - "video/vnd.iptvforum.1dparityfec-2005": { - source: "iana", - }, - "video/vnd.iptvforum.2dparityfec-1010": { - source: "iana", - }, - "video/vnd.iptvforum.2dparityfec-2005": { - source: "iana", - }, - "video/vnd.iptvforum.ttsavc": { - source: "iana", - }, - "video/vnd.iptvforum.ttsmpeg2": { - source: "iana", - }, - "video/vnd.motorola.video": { - source: "iana", - }, - "video/vnd.motorola.videop": { - source: "iana", - }, - "video/vnd.mpegurl": { - source: "iana", - extensions: ["mxu", "m4u"], - }, - "video/vnd.ms-playready.media.pyv": { - source: "iana", - extensions: ["pyv"], - }, - "video/vnd.nokia.interleaved-multimedia": { - source: "iana", - }, - "video/vnd.nokia.mp4vr": { - source: "iana", - }, - "video/vnd.nokia.videovoip": { - source: "iana", - }, - "video/vnd.objectvideo": { - source: "iana", - }, - "video/vnd.radgamettools.bink": { - source: "iana", - }, - "video/vnd.radgamettools.smacker": { - source: "iana", - }, - "video/vnd.sealed.mpeg1": { - source: "iana", - }, - "video/vnd.sealed.mpeg4": { - source: "iana", - }, - "video/vnd.sealed.swf": { - source: "iana", - }, - "video/vnd.sealedmedia.softseal.mov": { - source: "iana", - }, - "video/vnd.uvvu.mp4": { - source: "iana", - extensions: ["uvu", "uvvu"], - }, - "video/vnd.vivo": { - source: "iana", - extensions: ["viv"], - }, - "video/vnd.youtube.yt": { - source: "iana", - }, - "video/vp8": { - source: "iana", - }, - "video/vp9": { - source: "iana", - }, - "video/webm": { - source: "apache", - compressible: false, - extensions: ["webm"], - }, - "video/x-f4v": { - source: "apache", - extensions: ["f4v"], - }, - "video/x-fli": { - source: "apache", - extensions: ["fli"], - }, - "video/x-flv": { - source: "apache", - compressible: false, - extensions: ["flv"], - }, - "video/x-m4v": { - source: "apache", - extensions: ["m4v"], - }, - "video/x-matroska": { - source: "apache", - compressible: false, - extensions: ["mkv", "mk3d", "mks"], - }, - "video/x-mng": { - source: "apache", - extensions: ["mng"], - }, - "video/x-ms-asf": { - source: "apache", - extensions: ["asf", "asx"], - }, - "video/x-ms-vob": { - source: "apache", - extensions: ["vob"], - }, - "video/x-ms-wm": { - source: "apache", - extensions: ["wm"], - }, - "video/x-ms-wmv": { - source: "apache", - compressible: false, - extensions: ["wmv"], - }, - "video/x-ms-wmx": { - source: "apache", - extensions: ["wmx"], - }, - "video/x-ms-wvx": { - source: "apache", - extensions: ["wvx"], - }, - "video/x-msvideo": { - source: "apache", - extensions: ["avi"], - }, - "video/x-sgi-movie": { - source: "apache", - extensions: ["movie"], - }, - "video/x-smv": { - source: "apache", - extensions: ["smv"], - }, - "x-conference/x-cooltalk": { - source: "apache", - extensions: ["ice"], - }, - "x-shader/x-fragment": { - compressible: true, - }, - "x-shader/x-vertex": { - compressible: true, - }, -} diff --git a/public/polyfills/path.js b/public/polyfills/path.js deleted file mode 100644 index 7de880e5..00000000 --- a/public/polyfills/path.js +++ /dev/null @@ -1,519 +0,0 @@ -// 'path' module extracted from Node.js v8.11.1 (only the posix part) -// transplited with Babel - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -"use strict" - -function assertPath(path) { - if (typeof path !== "string") { - throw new TypeError("Path must be a string. Received " + JSON.stringify(path)) - } -} - -// Resolves . and .. elements in a path with directory names -function normalizeStringPosix(path, allowAboveRoot) { - var res = "" - var lastSegmentLength = 0 - var lastSlash = -1 - var dots = 0 - var code - for (var i = 0; i <= path.length; ++i) { - if (i < path.length) code = path.charCodeAt(i) - else if (code === 47 /*/*/) break - else code = 47 /*/*/ - if (code === 47 /*/*/) { - if (lastSlash === i - 1 || dots === 1) { - // NOOP - } else if (lastSlash !== i - 1 && dots === 2) { - if ( - res.length < 2 || - lastSegmentLength !== 2 || - res.charCodeAt(res.length - 1) !== 46 /*.*/ || - res.charCodeAt(res.length - 2) !== 46 /*.*/ - ) { - if (res.length > 2) { - var lastSlashIndex = res.lastIndexOf("/") - if (lastSlashIndex !== res.length - 1) { - if (lastSlashIndex === -1) { - res = "" - lastSegmentLength = 0 - } else { - res = res.slice(0, lastSlashIndex) - lastSegmentLength = res.length - 1 - res.lastIndexOf("/") - } - lastSlash = i - dots = 0 - continue - } - } else if (res.length === 2 || res.length === 1) { - res = "" - lastSegmentLength = 0 - lastSlash = i - dots = 0 - continue - } - } - if (allowAboveRoot) { - if (res.length > 0) res += "/.." - else res = ".." - lastSegmentLength = 2 - } - } else { - if (res.length > 0) res += "/" + path.slice(lastSlash + 1, i) - else res = path.slice(lastSlash + 1, i) - lastSegmentLength = i - lastSlash - 1 - } - lastSlash = i - dots = 0 - } else if (code === 46 /*.*/ && dots !== -1) { - ++dots - } else { - dots = -1 - } - } - return res -} - -function _format(sep, pathObject) { - var dir = pathObject.dir || pathObject.root - var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "") - if (!dir) { - return base - } - if (dir === pathObject.root) { - return dir + base - } - return dir + sep + base -} - -var posix = { - // path.resolve([from ...], to) - resolve: function resolve() { - var resolvedPath = "" - var resolvedAbsolute = false - var cwd - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path - if (i >= 0) path = arguments[i] - else { - if (cwd === undefined) cwd = process.cwd() - path = cwd - } - - assertPath(path) - - // Skip empty entries - if (path.length === 0) { - continue - } - - resolvedPath = path + "/" + resolvedPath - resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/ - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute) - - if (resolvedAbsolute) { - if (resolvedPath.length > 0) return "/" + resolvedPath - else return "/" - } else if (resolvedPath.length > 0) { - return resolvedPath - } else { - return "." - } - }, - - normalize: function normalize(path) { - assertPath(path) - - if (path.length === 0) return "." - - var isAbsolute = path.charCodeAt(0) === 47 /*/*/ - var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/ - - // Normalize the path - path = normalizeStringPosix(path, !isAbsolute) - - if (path.length === 0 && !isAbsolute) path = "." - if (path.length > 0 && trailingSeparator) path += "/" - - if (isAbsolute) return "/" + path - return path - }, - - isAbsolute: function isAbsolute(path) { - assertPath(path) - return path.length > 0 && path.charCodeAt(0) === 47 /*/*/ - }, - - join: function join() { - if (arguments.length === 0) return "." - var joined - for (var i = 0; i < arguments.length; ++i) { - var arg = arguments[i] - assertPath(arg) - if (arg.length > 0) { - if (joined === undefined) joined = arg - else joined += "/" + arg - } - } - if (joined === undefined) return "." - return posix.normalize(joined) - }, - - relative: function relative(from, to) { - assertPath(from) - assertPath(to) - - if (from === to) return "" - - from = posix.resolve(from) - to = posix.resolve(to) - - if (from === to) return "" - - // Trim any leading backslashes - var fromStart = 1 - for (; fromStart < from.length; ++fromStart) { - if (from.charCodeAt(fromStart) !== 47 /*/*/) break - } - var fromEnd = from.length - var fromLen = fromEnd - fromStart - - // Trim any leading backslashes - var toStart = 1 - for (; toStart < to.length; ++toStart) { - if (to.charCodeAt(toStart) !== 47 /*/*/) break - } - var toEnd = to.length - var toLen = toEnd - toStart - - // Compare paths to find the longest common path from root - var length = fromLen < toLen ? fromLen : toLen - var lastCommonSep = -1 - var i = 0 - for (; i <= length; ++i) { - if (i === length) { - if (toLen > length) { - if (to.charCodeAt(toStart + i) === 47 /*/*/) { - // We get here if `from` is the exact base path for `to`. - // For example: from='/foo/bar'; to='/foo/bar/baz' - return to.slice(toStart + i + 1) - } else if (i === 0) { - // We get here if `from` is the root - // For example: from='/'; to='/foo' - return to.slice(toStart + i) - } - } else if (fromLen > length) { - if (from.charCodeAt(fromStart + i) === 47 /*/*/) { - // We get here if `to` is the exact base path for `from`. - // For example: from='/foo/bar/baz'; to='/foo/bar' - lastCommonSep = i - } else if (i === 0) { - // We get here if `to` is the root. - // For example: from='/foo'; to='/' - lastCommonSep = 0 - } - } - break - } - var fromCode = from.charCodeAt(fromStart + i) - var toCode = to.charCodeAt(toStart + i) - if (fromCode !== toCode) break - else if (fromCode === 47 /*/*/) lastCommonSep = i - } - - var out = "" - // Generate the relative path based on the path difference between `to` - // and `from` - for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { - if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) { - if (out.length === 0) out += ".." - else out += "/.." - } - } - - // Lastly, append the rest of the destination (`to`) path that comes after - // the common path parts - if (out.length > 0) return out + to.slice(toStart + lastCommonSep) - else { - toStart += lastCommonSep - if (to.charCodeAt(toStart) === 47 /*/*/) ++toStart - return to.slice(toStart) - } - }, - - _makeLong: function _makeLong(path) { - return path - }, - - dirname: function dirname(path) { - assertPath(path) - if (path.length === 0) return "." - var code = path.charCodeAt(0) - var hasRoot = code === 47 /*/*/ - var end = -1 - var matchedSlash = true - for (var i = path.length - 1; i >= 1; --i) { - code = path.charCodeAt(i) - if (code === 47 /*/*/) { - if (!matchedSlash) { - end = i - break - } - } else { - // We saw the first non-path separator - matchedSlash = false - } - } - - if (end === -1) return hasRoot ? "/" : "." - if (hasRoot && end === 1) return "//" - return path.slice(0, end) - }, - - basename: function basename(path, ext) { - if (ext !== undefined && typeof ext !== "string") throw new TypeError('"ext" argument must be a string') - assertPath(path) - - var start = 0 - var end = -1 - var matchedSlash = true - var i - - if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { - if (ext.length === path.length && ext === path) return "" - var extIdx = ext.length - 1 - var firstNonSlashEnd = -1 - for (i = path.length - 1; i >= 0; --i) { - var code = path.charCodeAt(i) - if (code === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1 - break - } - } else { - if (firstNonSlashEnd === -1) { - // We saw the first non-path separator, remember this index in case - // we need it if the extension ends up not matching - matchedSlash = false - firstNonSlashEnd = i + 1 - } - if (extIdx >= 0) { - // Try to match the explicit extension - if (code === ext.charCodeAt(extIdx)) { - if (--extIdx === -1) { - // We matched the extension, so mark this as the end of our path - // component - end = i - } - } else { - // Extension does not match, so our result is the entire path - // component - extIdx = -1 - end = firstNonSlashEnd - } - } - } - } - - if (start === end) end = firstNonSlashEnd - else if (end === -1) end = path.length - return path.slice(start, end) - } else { - for (i = path.length - 1; i >= 0; --i) { - if (path.charCodeAt(i) === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - start = i + 1 - break - } - } else if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // path component - matchedSlash = false - end = i + 1 - } - } - - if (end === -1) return "" - return path.slice(start, end) - } - }, - - extname: function extname(path) { - assertPath(path) - var startDot = -1 - var startPart = 0 - var end = -1 - var matchedSlash = true - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - var preDotState = 0 - for (var i = path.length - 1; i >= 0; --i) { - var code = path.charCodeAt(i) - if (code === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1 - break - } - continue - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false - end = i + 1 - } - if (code === 46 /*.*/) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) startDot = i - else if (preDotState !== 1) preDotState = 1 - } else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1 - } - } - - if ( - startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) - ) { - return "" - } - return path.slice(startDot, end) - }, - - format: function format(pathObject) { - if (pathObject === null || typeof pathObject !== "object") { - throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject) - } - return _format("/", pathObject) - }, - - parse: function parse(path) { - assertPath(path) - - var ret = { root: "", dir: "", base: "", ext: "", name: "" } - if (path.length === 0) return ret - var code = path.charCodeAt(0) - var isAbsolute = code === 47 /*/*/ - var start - if (isAbsolute) { - ret.root = "/" - start = 1 - } else { - start = 0 - } - var startDot = -1 - var startPart = 0 - var end = -1 - var matchedSlash = true - var i = path.length - 1 - - // Track the state of characters (if any) we see before our first dot and - // after any path separator we find - var preDotState = 0 - - // Get non-dir info - for (; i >= start; --i) { - code = path.charCodeAt(i) - if (code === 47 /*/*/) { - // If we reached a path separator that was not part of a set of path - // separators at the end of the string, stop now - if (!matchedSlash) { - startPart = i + 1 - break - } - continue - } - if (end === -1) { - // We saw the first non-path separator, mark this as the end of our - // extension - matchedSlash = false - end = i + 1 - } - if (code === 46 /*.*/) { - // If this is our first dot, mark it as the start of our extension - if (startDot === -1) startDot = i - else if (preDotState !== 1) preDotState = 1 - } else if (startDot !== -1) { - // We saw a non-dot and non-path separator before our dot, so we should - // have a good chance at having a non-empty extension - preDotState = -1 - } - } - - if ( - startDot === -1 || - end === -1 || - // We saw a non-dot character immediately before the dot - preDotState === 0 || - // The (right-most) trimmed path component is exactly '..' - (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) - ) { - if (end !== -1) { - if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end) - else ret.base = ret.name = path.slice(startPart, end) - } - } else { - if (startPart === 0 && isAbsolute) { - ret.name = path.slice(1, startDot) - ret.base = path.slice(1, end) - } else { - ret.name = path.slice(startPart, startDot) - ret.base = path.slice(startPart, end) - } - ret.ext = path.slice(startDot, end) - } - - if (startPart > 0) ret.dir = path.slice(0, startPart - 1) - else if (isAbsolute) ret.dir = "/" - - return ret - }, - - sep: "/", - delimiter: ":", - win32: null, - posix: null, -} - -posix.posix = posix - -export default posix diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 00000000..82fa0dc8 --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1,5 @@ +.venv +build +dist +*.exe +*.spec diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 00000000..f45db569 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,7 @@ +# scripts + +## Usage + +```bash +pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple +``` \ No newline at end of file diff --git a/scripts/package.py b/scripts/package.py index 8ca59f40..77baa0ae 100644 --- a/scripts/package.py +++ b/scripts/package.py @@ -14,9 +14,9 @@ v = data["version"] src_folder = dist_folder - tmp_folder_name = "./siyuan-importer" + tmp_folder_name = "./siyuan-plugin-demo" build_zip_path = "./build" - build_zip_name = "siyuan-plugin-importer-" + v + ".zip" + build_zip_name = "siyuan-plugin-demo-" + v + ".zip" try: # 压缩dist为zip diff --git a/src/App.svelte b/src/App.svelte deleted file mode 100644 index 0c8541c3..00000000 --- a/src/App.svelte +++ /dev/null @@ -1,48 +0,0 @@ - - - - - -
- - - - - - -
-
diff --git a/src/api/base-api.ts b/src/api/base-api.ts new file mode 100644 index 00000000..f44a5537 --- /dev/null +++ b/src/api/base-api.ts @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2023, Terwer . All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Terwer designates this + * particular file as subject to the "Classpath" exception as provided + * by Terwer in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com + * or visit www.terwer.space if you need additional information or have any + * questions. + */ + +import { isDev, siyuanApiToken, siyuanApiUrl } from "../Constants" +import { simpleLogger } from "zhi-lib-base" + +/** + * 思源 API 返回类型 + */ +export interface SiyuanData { + /** + * 非 0 为异常情况 + */ + code: number + + /** + * 正常情况下是空字符串,异常情况下会返回错误文案 + */ + msg: string + + /** + * 可能为 \{\}、[] 或者 NULL,根据不同接口而不同 + */ + data: any[] | object | null | undefined +} + +export class BaseApi { + private logger + + constructor() { + this.logger = simpleLogger("base-api", "custom-slug", isDev) + } + + /** + * 以sql发送请求 + * @param sql sql + */ + public async sql(sql: string): Promise { + const sqldata = { + stmt: sql, + } + const url = "/api/query/sql" + return await this.siyuanRequest(url, sqldata) + } + + /** + * 向思源请求数据 + * + * @param url - url + * @param data - 数据 + */ + public async siyuanRequest(url: string, data: object): Promise { + const reqUrl = `${siyuanApiUrl}${url}` + + const fetchOps = { + body: JSON.stringify(data), + method: "POST", + } + if (siyuanApiToken !== "") { + Object.assign(fetchOps, { + headers: { + Authorization: `Token ${siyuanApiToken}`, + }, + }) + } + + if (isDev) { + this.logger.info("开始向思源请求数据,reqUrl=>", reqUrl) + this.logger.info("开始向思源请求数据,fetchOps=>", fetchOps) + } + + const response = await fetch(reqUrl, fetchOps) + const resJson = (await response.json()) as SiyuanData + if (isDev) { + this.logger.info("思源请求数据返回,resJson=>", resJson) + } + return resJson + } +} diff --git a/src/utils/htmlUtils.ts b/src/api/kernel-api.ts similarity index 80% rename from src/utils/htmlUtils.ts rename to src/api/kernel-api.ts index 314bbf6b..649cf9ed 100644 --- a/src/utils/htmlUtils.ts +++ b/src/api/kernel-api.ts @@ -23,15 +23,17 @@ * questions. */ -class HtmlUtils { - public static async copyToClipboard(text: string): Promise { - try { - await navigator.clipboard.writeText(text) - return true - } catch (err) { - throw new Error("复制失败!" + err) - } - } -} +import { BaseApi } from "./base-api" -export default HtmlUtils +/** + * 思源笔记服务端API v2.8.9 + * + * @see {@link https://github.com/siyuan-note/siyuan/blob/master/API_zh_CN.md API} + * + * @author terwer + * @version 0.0.1 + * @since 0.0.1 + */ +class KernelApi extends BaseApi {} + +export default KernelApi diff --git a/src/constants.ts b/src/constants.ts index 629f81da..001b0274 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,19 +1,28 @@ -export const moduleBase = "/plugins/siyuan-publisher" -export const pluginDataPath = "/data/storage/petal/siyuan-publisher" -export const isDev = process.env.DEV_MODE === "true" - -/** - * 常量 +/* + * Copyright (c) 2023, Terwer . All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Terwer designates this + * particular file as subject to the "Classpath" exception as provided + * by Terwer in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com + * or visit www.terwer.space if you need additional information or have any + * questions. */ -export const Page = { - Publish: "", - Picbed: "picbed", - Setting: "setting", - GeneralSetting: "setting/general", - PicgoSetting: "setting/picgo", - PublishSetting: "setting/publish", -} + +export const workspaceDir = `${(window as any).siyuan.config.system.workspaceDir}` +export const dataDir = `${(window as any).siyuan.config.system.dataDir}` +export const isDev = process.env.DEV_MODE === "true" diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 61e50edf..7a73a41b 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -1,25 +1,2 @@ { - "publisher": "Publisher", - "publisherLoaded": "Importer loaded", - "publisherUnloaded": "Importer unloaded", - "publish": "Publish", - "picbed": "Upload picture to picbed", - "setting": "Setting", - "settingGeneral": "General setting", - "settingPicbed": "Picbed manage", - "settingPublish": "Publish setting", - "settingMenuTips": "Let creation return to fun", - "copyPageId": "Copy pageId", - "publisherWidget": "Publisher Widget", - "cancel": "Cancel", - "save": "Save", - "publishTo": "Publish to...", - "platformCnblogs": "Cnblogs", - "platformTypecho": "Typecho", - "platformWordpress": "WordPress", - "platformYuque": "Yuque", - "platformGithub": "Github", - "platformHexo": "Hexo", - "platformHugo": "Hugo", - "platformVitepress": "Vitepress" } \ No newline at end of file diff --git a/src/i18n/zh_CN.json b/src/i18n/zh_CN.json index 38a68f0a..7a73a41b 100644 --- a/src/i18n/zh_CN.json +++ b/src/i18n/zh_CN.json @@ -1,25 +1,2 @@ { - "publisher": "发布工具", - "publisherLoaded": "发布工具已加载", - "publisherUnloaded": "发布工具已卸载", - "publish": "发布", - "picbed": "上传图片到图床", - "setting": "设置", - "settingGeneral": "偏好设置", - "settingPicbed": "图床管理", - "settingPublish": "发布设置", - "settingMenuTips": "让创作回归乐趣", - "copyPageId": "复制文档ID", - "publisherWidget": "挂件版", - "cancel": "取消", - "save": "保存", - "publishTo": "发布到...", - "platformCnblogs": "博客园", - "platformTypecho": "Typecho", - "platformWordpress": "WordPress", - "platformYuque": "语雀", - "platformGithub": "Github", - "platformHexo": "Hexo", - "platformHugo": "Hugo", - "platformVitepress": "Vitepress" } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 10a73737..13431fa9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,357 +1,48 @@ -import { Dialog, isMobile, Menu, Plugin } from "siyuan" -import "./index.styl" -import { initLibs } from "~/src/loader" -import { initTools } from "~/src/tools" -import iconPublish from "~/src/utils/svg" -import { Utils } from "~/src/utils/utils" -import HtmlUtils from "~/src/utils/htmlUtils" -import PageUtil from "~/src/utils/pageUtil" -import { isDev, Page } from "~/src/constants" - -export default class PublisherPlugin extends Plugin { - public fs - public path - public importDep: (moduleName: any) => Promise - - // 基础类库 - public zhiDevice: { - DeviceDetection - SiyuanDevice - DeviceTypeEnum - } - public zhiEnv: { - Env - } - public zhiLog: { - LogFactory - DefaultLogger - crossChalk - } - public zhiCommon: { - ZhiCommon - ZhiUtil - } - // public zhiElectron - public zhiBlogApi: { - BlogConstants - BlogTypeEnum - BlogApi - } - public zhiSiyuanApi: { - SiyuanConstants - SiyuanConfig - SiYuanApiAdaptor - SiyuanKernelApi - } - public zhiPublisherSdk: { - PublishSdk - } - - // 初始化常用工具类 - // private env - public logger - // private common - public blogApi - public kernelApi - - // lifecycle - async onload() { - // 初始化基础类库 - await initLibs(this) - // 初始化常用工具类 - await initTools(this) - - // 业务逻辑 - const posts = await this.blogApi.getRecentPosts(10) - this.logger.info("siyuan recent post=>", posts) - - // 初始化菜单按钮 - this.initTopBar() - - this.logger.info(this.i18n.publisherLoaded) - } - - async onunload() { - this.logger.info(this.i18n.publisherUnloaded) - } - - public openSetting() { - this.showSettingDialog(this.i18n.setting, Page.Setting) - } - - // ====================== - // private functions - // ====================== - private initTopBar() { - const topBarElement = this.addTopBar({ - icon: iconPublish.iconPlane, - title: this.i18n.publisher, - position: "left", - callback: () => { - this.initMenu(topBarElement.getBoundingClientRect()) - }, - }) - //添加右键菜单 - topBarElement.addEventListener("contextmenu", () => { - this.showSettingDialog(this.i18n.setting, Page.Setting) - }) - } - - private async initMenu(rect: DOMRect) { - const menu = new Menu("topBarSample") - - // 发布到 - menu.addItem({ - icon: `iconRiffCard`, - label: this.i18n.publishTo, - submenu: [ - { - iconHTML: iconPublish.iconCnblogs, - label: this.i18n.platformCnblogs, - click: async () => { - // const blogApi = PublishSdk.blogApi(BlogTypeEnum.BlogTypeEnum_Metaweblog) - // const usersBlogs = blogApi.getUsersBlogs() - const blogApi = Utils.blogApi(this) - // const usersBlogs = await blogApi.getUsersBlogs() - // this.logger.info("发布到博客园", usersBlogs) - const recentPosts = await blogApi.getRecentPosts(10) - this.logger.info("发布到博客园", recentPosts) - }, - }, - { - iconHTML: iconPublish.iconTypecho, - label: this.i18n.platformTypecho, - disabled: true, - click: () => { - this.logger.info("发布到Typecho") - }, - }, - { - iconHTML: iconPublish.iconWordpress, - label: this.i18n.platformWordpress, - click: () => { - this.showPublisherDialog() - this.logger.info("发布到WordPress") - }, - }, - { - iconHTML: iconPublish.iconYuque, - label: this.i18n.platformYuque, - click: () => { - this.logger.info("发布到语雀") - }, - }, - { - iconHTML: iconPublish.iconGithub, - label: this.i18n.platformGithub, - submenu: [ - { - iconHTML: iconPublish.iconHexo, - label: this.i18n.platformHexo, - click: () => { - this.logger.info("发布到Hexo") - }, - }, - { - iconHTML: iconPublish.iconHugo, - label: this.i18n.platformHugo, - click: () => { - this.logger.info("发布到Hugo") - }, - }, - { - iconHTML: iconPublish.iconVue, - label: this.i18n.platformVitepress, - click: () => { - this.logger.info("发布到Vitepress") - }, - }, - ], - }, - ], - }) - - // 图床 - menu.addSeparator() - menu.addItem({ - iconHTML: iconPublish.iconPicture, - label: this.i18n.picbed, - click: () => { - // 使用插件版图床 - // this.showPicbedDialog() - - // 使用挂件版图床 - this.showWidgetPublisherWindow("picgo") - }, - }) - - // 设置 - menu.addSeparator() - menu.addItem({ - icon: "iconSettings", - label: this.i18n.setting, - click: () => { - this.showSettingDialog(this.i18n.setting, Page.Setting) - }, - submenu: [ - { - iconHTML: iconPublish.iconPreference, - label: this.i18n.settingGeneral, - click: () => { - this.showSettingDialog(this.i18n.settingGeneral, Page.GeneralSetting) - }, - }, - { - iconHTML: iconPublish.iconPicbed, - label: this.i18n.settingPicbed, - click: () => { - this.showSettingDialog(this.i18n.settingPicbed, Page.PicgoSetting) - }, - }, - { - iconHTML: iconPublish.iconPublish, - label: this.i18n.settingPublish, - click: () => { - this.showSettingDialog(this.i18n.settingPublish, Page.PublishSetting) - }, - }, - ], - }) - - // 当前文档ID - const pageId = PageUtil.getPageId() - menu.addSeparator() - menu.addItem({ - iconHTML: iconPublish.iconOl, - label: this.i18n.copyPageId, - click: async () => { - await HtmlUtils.copyToClipboard(pageId) - this.kernelApi.pushMsg({ - msg: `当前文档ID已复制=>${pageId}`, - timeout: 3000, - }) - this.logger.info("当前文档ID已复制", pageId) - }, - }) - - // slogan - menu.addSeparator() - menu.addItem({ - icon: "iconSparkles", - label: this.i18n.settingMenuTips, - type: "readonly", - }) - - if (isMobile()) { - menu.fullscreen() - } else { - menu.open({ - x: rect.right, - y: rect.bottom, - isLeft: true, - }) - } - } - - private showSettingDialog(settingTitle: string, settingKey: string) { - new Dialog({ - title: `${settingTitle} - ${this.i18n.publisher}`, - content: `
`, - // width: isMobile() ? "92vw" : "520px", - width: isMobile() ? "92vw" : "900px", - // height: "750px", - }) - - // setting - PageUtil.createApp(settingKey) - } - - private showPublisherDialog() { - new Dialog({ - title: `${this.i18n.setting} - ${this.i18n.publisher}`, - content: `
`, - width: isMobile() ? "92vw" : "520px", - }) - - // setting - PageUtil.createApp(Page.Publish) - } - - private showPicbedDialog() { - new Dialog({ - title: `${this.i18n.picbed} - ${this.i18n.publisher}`, - content: `
`, - width: isMobile() ? "92vw" : "520px", - }) - - // setting - PageUtil.createApp(Page.Picbed) - } - - // widget functions - private showWidgetPublisherDialog(publisherIndex: string) { - const contentHtml = ` - ` - - new Dialog({ - title: this.i18n.siyuanBlog, - transparent: false, - content: contentHtml, - width: "90%", - height: "750px", - } as any) - } - - private showWidgetPublisherWindow(type?: "blog" | "detail" | "picgo") { - const win = window as any - const deviceType = this.zhiDevice.DeviceDetection.getDevice() - this.logger.info(`you are from ${deviceType}`) - - let pageId: string | undefined = PageUtil.getPageId() - if (pageId == "") { - pageId = undefined - } - this.logger.debug("pageId=>", pageId) - - if (deviceType == this.zhiDevice.DeviceTypeEnum.DeviceType_Siyuan_MainWin) { - this.importDep("./libs/plugin-publisher-bridge/index.js").then((bridge) => { - const publisherBridge = new bridge.default() - publisherBridge.init().then(() => { - let pageUrl - switch (type) { - case "blog": - // 博客首页 - pageUrl = "blog/index.html" - break - case "detail": - // 详情 - pageUrl = "detail/index.html" - break - case "picgo": - pageUrl = "picgo/index.html" - break - default: - // 发布首页 - pageUrl = "index.html" - break - } - if (!pageId && pageUrl === "index.html") { - pageUrl = "blog/index.html" - } - - win.syp.renderPublishHelper(pageId, pageUrl, win, isDev) - this.logger.debug("publisherHook inited") - }) - }) - } else { - const publisherIndex = `/widgets/sy-post-publisher/index.html` - this.showWidgetPublisherDialog(publisherIndex) - } +/* + * Copyright (c) 2023, Terwer . All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Terwer designates this + * particular file as subject to the "Classpath" exception as provided + * by Terwer in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com + * or visit www.terwer.space if you need additional information or have any + * questions. + */ + +import { App, IObject, Plugin } from "siyuan" +import { simpleLogger } from "zhi-lib-base" + +import "../index.styl" +import { isDev } from "./Constants" + +export default class ImporterPlugin extends Plugin { + private logger + + constructor(options: { app: App; id: string; name: string; i18n: IObject }) { + super(options) + + this.logger = simpleLogger("index", "demo", isDev) + } + + onload() { + this.logger.info("Demo loaded") + } + + onunload() { + this.logger.info("Demo loaded") } } diff --git a/src/lib/preferences/GeneralSetting.svelte b/src/lib/preferences/GeneralSetting.svelte deleted file mode 100644 index 71c1be56..00000000 --- a/src/lib/preferences/GeneralSetting.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
General Setting
diff --git a/src/lib/preferences/PicgoSetting.svelte b/src/lib/preferences/PicgoSetting.svelte deleted file mode 100644 index cf3ad088..00000000 --- a/src/lib/preferences/PicgoSetting.svelte +++ /dev/null @@ -1,25 +0,0 @@ - -
PicgoSetting
diff --git a/src/lib/preferences/PublishSetting.svelte b/src/lib/preferences/PublishSetting.svelte deleted file mode 100644 index f4683067..00000000 --- a/src/lib/preferences/PublishSetting.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
Publish Setting
diff --git a/src/loader.ts b/src/loader.ts deleted file mode 100644 index e44cb897..00000000 --- a/src/loader.ts +++ /dev/null @@ -1,65 +0,0 @@ -import PublisherPlugin from "~/src/index" -import { moduleBase } from "~/src/constants" - -export const initLibs = async (pluginInstance: PublisherPlugin) => { - // polyfills - pluginInstance.fs = (await import(`${moduleBase}/polyfills/fs.js`))["default"] - pluginInstance.path = (await import(`${moduleBase}/polyfills/path.js`))["default"] - pluginInstance.importDep = async (moduleName) => { - return await import(pluginInstance.path.join(moduleBase, moduleName)) - } - - // libs - - // zhi-device - const zhiDevice = (await pluginInstance.importDep("./libs/zhi-device/index.js")) as any - pluginInstance.zhiDevice = { - DeviceDetection: zhiDevice["DeviceDetection"], - SiyuanDevice: zhiDevice["SiyuanDevice"], - DeviceTypeEnum: zhiDevice["DeviceTypeEnum"], - } - - // zhi-env - const zhiEnv = (await pluginInstance.importDep("./libs/zhi-env/index.js")) as any - pluginInstance.zhiEnv = { - Env: zhiEnv["Env"], - } - - // zhi-log - const zhiLog = (await pluginInstance.importDep("./libs/zhi-log/index.js")) as any - pluginInstance.zhiLog = { - LogFactory: zhiLog["LogFactory"], - DefaultLogger: zhiLog["DefaultLogger"], - crossChalk: zhiLog["crossChalk"], - } - - // zhi-common - const zhiCommon = (await pluginInstance.importDep("./libs/zhi-common/index.js")) as any - pluginInstance.zhiCommon = { - ZhiCommon: zhiCommon["ZhiCommon"], - ZhiUtil: zhiCommon["ZhiUtil"], - } - - // zhi-blog-api - const zhiBlogApi = (await pluginInstance.importDep("./libs/zhi-blog-api/index.js")) as any - pluginInstance.zhiBlogApi = { - BlogConstants: zhiBlogApi["BlogConstants"], - BlogTypeEnum: zhiBlogApi["BlogTypeEnum"], - BlogApi: zhiBlogApi["BlogApi"], - } - - // zhi-siyuan-api - const zhiSiyuanApi = (await pluginInstance.importDep("./libs/zhi-siyuan-api/index.js")) as any - pluginInstance.zhiSiyuanApi = { - SiyuanConstants: zhiSiyuanApi["SiyuanConstants"], - SiyuanConfig: zhiSiyuanApi["SiyuanConfig"], - SiYuanApiAdaptor: zhiSiyuanApi["SiYuanApiAdaptor"], - SiyuanKernelApi: zhiSiyuanApi["SiyuanKernelApi"] - } - - // zhi-publisher-sdk - const zhiPublisherSdk = (await pluginInstance.importDep("./libs/zhi-publisher-sdk/index.js")) as any - pluginInstance.zhiPublisherSdk = { - PublishSdk: zhiPublisherSdk["PublishSdk"], - } -} diff --git a/src/routes/Picbed.svelte b/src/routes/Picbed.svelte deleted file mode 100644 index 1a7bd5bf..00000000 --- a/src/routes/Picbed.svelte +++ /dev/null @@ -1,25 +0,0 @@ - -
Picbed
diff --git a/src/routes/Preferences.svelte b/src/routes/Preferences.svelte deleted file mode 100644 index 295a5be6..00000000 --- a/src/routes/Preferences.svelte +++ /dev/null @@ -1,35 +0,0 @@ - - - - -

Preferences

- - - diff --git a/src/routes/Publish.svelte b/src/routes/Publish.svelte deleted file mode 100644 index de2286e3..00000000 --- a/src/routes/Publish.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
Publish
diff --git a/src/siyuan.d.ts b/src/siyuan.d.ts deleted file mode 100644 index a3c22c21..00000000 --- a/src/siyuan.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2023, Terwer . All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Terwer designates this - * particular file as subject to the "Classpath" exception as provided - * by Terwer in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com - * or visit www.terwer.space if you need additional information or have any - * questions. - */ - -declare module "siyuan" { - type TEventBus = "ws-main" - - interface IObject { - [key: string]: string; - } - - interface IWebSocketData { - cmd: string - callback?: string - data: any - msg: string - code: number - sid: string - } - - interface IPluginDockTab { - position: "LeftTop" | "LeftBottom" | "RightTop" | "RightBottom" | "BottomLeft" | "BottomRight", - size: { width: number, height: number }, - icon: string, - hotkey?: string, - title: string, - } - - interface IMenuItemOption { - label?: string, - click?: (element: HTMLElement) => void, - type?: "separator" | "submenu" | "readonly", - accelerator?: string, - action?: string, - id?: string, - submenu?: IMenuItemOption[] - disabled?: boolean - icon?: string - iconHTML?: string - current?: boolean - bind?: (element: HTMLElement) => void - } - - export function fetchPost(url: string, data?: any, cb?: (response: IWebSocketData) => void, headers?: IObject): void; - - export function fetchSyncPost(url: string, data?: any): Promise; - - export function fetchGet(url: string, cb: (response: IWebSocketData) => void): void; - - export function openTab(options: { - custom?: { - title: string, - icon: string, - data?: any - fn?: () => any, - } // card 和自定义页签 必填 - position?: "right" | "bottom", - keepCursor?: boolean // 是否跳转到新 tab 上 - removeCurrentTab?: boolean // 在当前页签打开时需移除原有页签 - afterOpen?: () => void // 打开后回调 - }): void - - export function isMobile(): boolean; - - export function adaptHotkey(hotkey: string): string; - - export function confirm(title: string, text: string, confirmCB?: () => void, cancelCB?: () => void): void; - - /** - * @param timeout - ms. 0: manual close;-1: always show; 6000: default - * @param {string} [type=info] - */ - export function showMessage(text: string, timeout?: number, type?: "info" | "error", id?: string): void; - - export class App { - plugins: Plugin[]; - } - - export abstract class Plugin { - eventBus: EventBus; - i18n: IObject; - data: any; - name: string; - - constructor(options: { - app: App, - id: string, - name: string, - i18n: IObject - }) - - onload(): void; - - onunload(): void; - - /* - * @param {string} [options.position=right] - */ - addTopBar(options: { - icon: string, - title: string, - callback: (evt: MouseEvent) => void - position?: "right" | "left" - }): HTMLDivElement; - - openSetting(): void - - // registerCommand(command: IPluginCommand): void; - - // registerSettingRender(settingRender: SettingRender): void; - - loadData(storageName: string): Promise; - - saveData(storageName: string, content: any): Promise; - - removeData(storageName: string): Promise; - - addTab(options: { - type: string, - destroy?: () => void, - resize?: () => void, - update?: () => void, - init: () => void - }): () => any - - addDock(options: { - config: IPluginDockTab, - data: any, - type: string, - destroy?: () => void, - resize?: () => void, - update?: () => void, - init: () => void - }): any - } - - export class EventBus { - on(type: TEventBus, listener: (event: CustomEvent) => void): void; - - once(type: TEventBus, listener: (event: CustomEvent) => void): void; - - off(type: TEventBus, listener: (event: CustomEvent) => void): void; - - emit(type: TEventBus, detail?: any): boolean; - } - - export class Dialog { - - element: HTMLElement; - - constructor(options: { - title?: string, - transparent?: boolean, - content: string, - width?: string - height?: string, - destroyCallback?: (options?: IObject) => void - disableClose?: boolean - disableAnimation?: boolean - }); - - destroy(options?: IObject): void; - - bindInput(inputElement: HTMLInputElement | HTMLTextAreaElement, enterEvent?: () => void): void; - } - - export class Menu { - constructor(id?: string, closeCB?: () => void); - - showSubMenu(subMenuElement: HTMLElement): void; - - addItem(options: IMenuItemOption): HTMLElement; - - addSeparator(): void; - - open(options: { x: number, y: number, h?: number, w?: number, isLeft?: boolean }): void; - - /* - * @param {string} [position=all] - */ - fullscreen(position?: "bottom" | "all"): void; - - close(): void; - } -} \ No newline at end of file diff --git a/src/tools.ts b/src/tools.ts deleted file mode 100644 index 77842556..00000000 --- a/src/tools.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Utils } from "~/src/utils/utils" -import PublisherPlugin from "~/src/index" - -/** - * 初始化工具类 - * - * @param appInstance - 应用实例 - */ -export const initTools = async (appInstance: PublisherPlugin) => { - // this.env = Utils.zhiEnv(this) - appInstance.logger = Utils.zhiLog(appInstance, "publisher-index") - // this.common = Utils.zhiCommon(appInstance) - - // kernelApi - appInstance.kernelApi = Utils.kernelApi(appInstance) - - // blogApi - appInstance.blogApi = Utils.blogApi(appInstance) -} diff --git a/src/utils/pageUtil.ts b/src/utils/pageUtil.ts index cab7d140..7e21681e 100644 --- a/src/utils/pageUtil.ts +++ b/src/utils/pageUtil.ts @@ -23,30 +23,17 @@ * questions. */ -import App from "../App.svelte" - /** - * 页面统一入口,根据路由创建不同页面 + * 文档工具类 */ class PageUtil { public static getPageId() { - const element = document.querySelector(".protyle-title") - const result = element ? element.getAttribute("data-node-id") : null - return result ?? "" - } - - public static getElementId(pageId: string) { - return pageId === "" ? "home" : `publisher-${pageId}` - } - - public static createApp(pageId: string): App { - const elementId = this.getElementId(pageId) - return new App({ - target: document.getElementById(elementId) as HTMLElement, - props: { - url: `/${pageId}`, - }, - }) + // 查找包含 protyle 类但不包含 fn__none 的 div 元素 + const protyleElement = document.querySelector("div.protyle:not(.fn__none)") + // 在该 div 元素下查找包含 protyle-title 类的 div 元素,并查找 data-node-id 属性 + const protyleTitleElement = protyleElement?.querySelector("div.protyle-title") + // 如果该元素存在 data-node-id 属性,则获取其值并返回,否则返回空字符串 + return protyleTitleElement?.hasAttribute("data-node-id") ? protyleTitleElement.getAttribute("data-node-id") : "" } } diff --git a/src/utils/svg.ts b/src/utils/svg.ts index 756a94d4..6c90447d 100644 --- a/src/utils/svg.ts +++ b/src/utils/svg.ts @@ -23,24 +23,4 @@ * questions. */ -/** - * 图标 - */ -const iconPublish = { - iconPlane: ``, - iconPicture: ``, - iconOl: ``, - iconPreference: ``, - iconPicbed: ``, - iconPublish: ``, - iconCnblogs: ``, - iconTypecho: ``, - iconWordpress: ``, - iconYuque: ``, - iconGithub: ``, - iconHexo: ``, - iconHugo: ``, - iconVue: ``, -} - -export default iconPublish +export const icons = {} diff --git a/src/utils/utils.ts b/src/utils/utils.ts index f34408d6..7401aae9 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,78 +1,24 @@ -import PublisherPlugin from "~/src" - -/** - * 通用工具类 +/* + * Copyright (c) 2023, Terwer . All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * @author terwer - * @version 1.0.0 - * @since 1.0.0 + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Terwer designates this + * particular file as subject to the "Classpath" exception as provided + * by Terwer in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com + * or visit www.terwer.space if you need additional information or have any + * questions. */ -export class Utils { - private static env - private static kApi - private static bApi - - /** - * 通用环境变量 - * - * @param pluginInstance - 插件实例 - */ - public static zhiEnv(pluginInstance: PublisherPlugin) { - if (!this.env) { - // 环境变量需要在使用的时候显式指定 - this.env = new pluginInstance.zhiEnv.Env(import.meta.env) - } - return this.env - } - - /** - * 通用日志 - * - * @param pluginInstance - 插件实例 - * @param loggerName - 日志名称 - */ - public static zhiLog(pluginInstance: PublisherPlugin, loggerName: string) { - const env = this.zhiEnv(pluginInstance) - pluginInstance.zhiCommon.ZhiUtil.initEnv(env) - - // 用 common 里面的,这里面我封装了日志缓存 - return pluginInstance.zhiCommon.ZhiUtil.zhiLogWithSign("publisher", loggerName) - } - - /** - * 通用工具入口 - * - * @param pluginInstance - 插件实例 - */ - public static zhiCommon(pluginInstance: PublisherPlugin) { - return pluginInstance.zhiCommon.ZhiUtil.zhiCommon() - } - - public static kernelApi(appInstance: PublisherPlugin) { - if (!this.kApi) { - const cfg = new appInstance.zhiSiyuanApi.SiyuanConfig("", "") - this.kApi = new appInstance.zhiSiyuanApi.SiyuanKernelApi(cfg) - this.kApi.init(appInstance) - } - return this.kApi - } - public static blogApi(appInstance: PublisherPlugin, blogType?: any, blogCfg?: any) { - if (!this.bApi) { - const publishSdk = appInstance.zhiPublisherSdk.PublishSdk - publishSdk.init({ - appInstance: appInstance, - Env: appInstance.zhiEnv.Env, - BlogConstants: appInstance.zhiBlogApi.BlogConstants, - BlogTypeEnum: appInstance.zhiBlogApi.BlogTypeEnum, - SiyuanConstants: appInstance.zhiSiyuanApi.SiyuanConstants, - SiyuanConfig: appInstance.zhiSiyuanApi.SiyuanConfig, - SiYuanApiAdaptor: appInstance.zhiSiyuanApi.SiYuanApiAdaptor, - BlogApi: appInstance.zhiBlogApi.BlogApi, - }) - const type = blogType ?? appInstance.zhiBlogApi.BlogTypeEnum.BlogTypeEnum_Siyuan - const cfg = blogCfg ?? new appInstance.zhiSiyuanApi.SiyuanConfig("", "") - this.bApi = publishSdk.blogApi(type, cfg) - } - return this.bApi - } -} diff --git a/svelte.config.js b/svelte.config.js old mode 100755 new mode 100644 diff --git a/tsconfig.json b/tsconfig.json index 30bf2b9d..08cfe0c6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ESNext", + "target": "ES2020", "useDefineForClassFields": true, "module": "ESNext", "lib": [ @@ -17,38 +17,19 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", - /* Linting */ - "strict": false, - "noUnusedLocals": false, - "noUnusedParameters": false, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - - /* Svelte */ - /** - * Typecheck JS in `.svelte` and `.js` files by default. - * Disable checkJs if you'd like to use dynamic types in JS. - * Note that setting allowJs false does not prevent the use - * of JS in `.svelte` files. - */ - "allowJs": true, - "checkJs": true, - "types": [ "node", - "vite/client", - "svelte" - ], - - "paths": { - "~/*": ["./*"] - } + "vite/client" + ] }, "include": [ - "tools/**/*.ts", "src/**/*.ts", "src/**/*.d.ts", - "public/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue" ], diff --git a/vite.config.ts b/vite.config.ts index 3767839a..d3c1299f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,5 @@ -/// - -import path, { resolve } from "path" -import { defineConfig } from "vite" +import { resolve } from "path" +import { defineConfig, loadEnv } from "vite" import minimist from "minimist" import { viteStaticCopy } from "vite-plugin-static-copy" import livereload from "rollup-plugin-livereload" @@ -10,7 +8,11 @@ import fg from "fast-glob" const args = minimist(process.argv.slice(2)) const isWatch = args.watch || args.w || false -const devDistDir = "/Users/terwer/Documents/mydocs/SiYuanWorkspace/public/data/plugins/siyuan-publisher" +const isWindows = process.platform === "win32" +let devDistDir = "/Users/terwer/Documents/mydocs/SiYuanWorkspace/public/data/plugins/siyuan-plugin-custom-slug" +if (isWindows) { + devDistDir = "C:\\Users\\terwer\\Documents\\mydocs\\SiyuanWorkspace\\public\\data\\plugins\\siyuan-plugin-custom-slug" +} const distDir = isWatch ? devDistDir : "./dist" console.log("isWatch=>", isWatch) @@ -54,12 +56,6 @@ export default defineConfig({ "process.env.DEV_MODE": `"${isWatch}"`, }, - resolve: { - alias: { - "~": path.resolve(__dirname, "./"), - }, - }, - build: { // 输出路径 outDir: distDir, @@ -115,10 +111,4 @@ export default defineConfig({ }, }, }, - - test: { - globals: true, - environment: "jsdom", - include: ["src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], - }, })