athar-mcp 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/.output/nitro.json +15 -0
- package/dashboard/.output/public/_fonts/31PZhXd_YTCmsoiPQZc-xVtAWAkLogRFRj5mWplmKFE-6WsTw05QKugcwLySGc_b9CIheG8j8LRyo47qPL430Mk.woff2 +0 -0
- package/dashboard/.output/public/_fonts/3e3wuf-V_7icWvlsSS3Ud6R1mFSymwsfz35VcqiVjOk-jnii4_jMs7YAJOhzZP3bGdrbXGt5dYv8_t_rhpHzpcQ.woff2 +0 -0
- package/dashboard/.output/public/_fonts/3mk1pEYaO7RuhctnlpKcyb7yjVLICedncSfY13ffbM8-vJidvBvYJRk77_zQIyVpja44ymm1FQTiYKUcM_aD5Sg.woff2 +0 -0
- package/dashboard/.output/public/_fonts/9FWLUGCSCYLRIRMtCzLrt4Go7DMFXOeN_pyCOJD_44Y-Yh2wNaqrq_e759vVlc3tX81lMwRu9ktkQJX_Svgs-VI.woff2 +0 -0
- package/dashboard/.output/public/_fonts/9IZYb3o3tpRXPqjzNd4r3vIIohLuRBC5-h_ByvqRowU-ZgMUMfi6FcHpaV_ucYIWcBvLG6geajFq70Smps0DAj0.woff2 +0 -0
- package/dashboard/.output/public/_fonts/AA0_6TP-Ed9gQINhOsvbweBE3xLQgxmg6pXqHmvCwsM-egZLwYC5qVnfGWql7G5NfYTIiMP1PB_tQWIq5f7S-0k.woff2 +0 -0
- package/dashboard/.output/public/_fonts/BQnDL9FFy0Q_jvURlmv87luvmXLSMbSuXsfZv_R2Rkk-y5MVrLtP4J_1al8rz8R-MDaUOMAHckAWCwDrKhw25fY.woff2 +0 -0
- package/dashboard/.output/public/_fonts/Df7M9JXECnQBPeMk0JlWv5oI4E80OSjKvG82PCAX-MI-aXpKyr1n0W6NWbCApKANrm9O50H_fjFMdBzwfTY75iM.woff2 +0 -0
- package/dashboard/.output/public/_fonts/F00Bxq4ciZESODR5suhK3xDWcsQ9RLj9SyZQEevpEsw-BLNEvb6wAcL3fpb4n4d3zVEKUoa2hsUKxxkf3YdvJKc.woff2 +0 -0
- package/dashboard/.output/public/_fonts/HsvEuay0nMOs_2ObxMGaCaFlKdRnnDmfWeFTeRbjAVE-UeGuS_NHKiKleun7gcayWaUNaV2zWnEeGUxJVueLYm0.woff +0 -0
- package/dashboard/.output/public/_fonts/JSrPAbQHsQEdUrIE5Ts6fIQ2ymsa4i7HhiCpui6ulCc-_AoyGWssOn06OMh3ZY_GddBBPRny4Igxin4fT_1K6F4.woff2 +0 -0
- package/dashboard/.output/public/_fonts/Jtqhy44WKYEjGWTSusP5YJfJv7Wf74QqgkBOI9u_77s-Rl_Bht5SvmaotE20bkavBEAJEEGEa0hcz3d_8yOeXmw.woff +0 -0
- package/dashboard/.output/public/_fonts/KOrIgK47CByspZJWjOLg8AL2ADg9uFcNjZd9W78jrmM-dU37DP77KwUzMqqldljJHhSe3lJpaSfI9HPfiVAxPOM.woff2 +0 -0
- package/dashboard/.output/public/_fonts/M-60tFLmAJxdPjHsK-2ILWom5zPbu37lb3Qex2waL14-A9y4QcXALPi_RvQsmRsSFUxrT3_J213W4zPFIXetlbw.woff2 +0 -0
- package/dashboard/.output/public/_fonts/NwLHmPccLrJlBVGp4QRXOLZaNI0M_K6XuSwyVjpr47g-jl4tqz8gcsgAJDPcbl5roY78zy31I6Rq51WBLpZngFg.woff2 +0 -0
- package/dashboard/.output/public/_fonts/T-ozk-QJ_Ck37B2RHPl2i-s_gAGGo7suFgagWoJ8bO4-maDXQ_nEXKAaLHm4Joud3DJR9EVzS7QXWMWK8YOTIcs.woff2 +0 -0
- package/dashboard/.output/public/_fonts/TTYbISAfwy-y4uVGS9AH32sK7b2xJsoCESo64ryf8LU-y87nRMqBGo42rUOW9tWZa06o4oTa0USJrAMMoKDamgs.woff2 +0 -0
- package/dashboard/.output/public/_fonts/Y_5DOsLit49q2i2tbcNxnyUen9__GPCX8mwAi03q1aA-pBCjVKDT5tBT3BJckh9uzNkfUWeUIBPz9Y8T55vcj8E.woff2 +0 -0
- package/dashboard/.output/public/_fonts/ZHaz3DhCHNWhsElqYfuM71rfBBDgjuU2sd34vaYJwQg-71NZaZSGjxzAGjCMnCc2zS5rS_EGA0xHKPGCggWuXik.woff +0 -0
- package/dashboard/.output/public/_fonts/_lyVj3lEzRng_G7gZNcCmL83BnMEos-Hf8bpHLMzGQI-zsVE1T2QbmkXlEbQhs2gb3j3VBOOGhzqyW_ZW_0s3F8.woff2 +0 -0
- package/dashboard/.output/public/_fonts/bUcXp2ExGsFoCjH4L_AiPGX0TLCAgnqR8nvW7SxSJYQ-kvm9UWc_MFZW_r85yX6uPdzXVmdcUOio_Wb1x_7QdXM.woff2 +0 -0
- package/dashboard/.output/public/_fonts/f3COenLcoezM74LmVz7-HHQTyPKopVoMY6x2syLMzQE-shPZYE7IAjZWz4okT_CWn96WfGzoLhasK43_mhj3CZI.woff2 +0 -0
- package/dashboard/.output/public/_fonts/h9PwCjip_BNPVO50hT4v29USWFv6H3ZlYx_IestfqgY-sYfLVuZXl9E1aYbn1S0pAr4zfdQ_WT7iBZhrgQY6N-4.woff2 +0 -0
- package/dashboard/.output/public/_fonts/l00UCz_-QvI_NO8AGcu7ooAcrFDlxYUdxCSCh6gBwd4-vPjTZ3ztgw27A2TnHeCycxPvUtXWEVpG33_97ra6su8.woff2 +0 -0
- package/dashboard/.output/public/_fonts/nuenOq7ZFSZ65QudJO7uQ0sOjDqow2WjfXrQh4S9gEc-uF81rxcswER5srfhzyLfPoGlKNAIt2C_BvkXFOc19rw.woff2 +0 -0
- package/dashboard/.output/public/_fonts/pWMvGwciZ-EfQsfR2ueelhC7Jnt5K-8Px8PjPK0mDII-eT9iD0iZ9WWhTJs6V5GxXr0iaUwx_WxgGGriOiGb81o.woff2 +0 -0
- package/dashboard/.output/public/_fonts/sqxfSu-14RfawvZSbzb3mPoBYaXxmTGIac1Kk0GVk_w-oe_5KiWXPVdvpURHWSiaIjA1N_zLqpjSzmfpwRHr7CQ.woff2 +0 -0
- package/dashboard/.output/public/_fonts/wMdBqIWtsuS5eTYXRFwACf6n6oW2h-j42f90vWIPIO8-vrVOc_lrScYZMKO0_R3igKLheJfV2qZ3c5qlWOY0LDQ.woff +0 -0
- package/dashboard/.output/public/_fonts/y3mP_zJcojQwJn30TpF_XxDzgeM6Nbk7MaRg1Ne0YcI-lFx13nqMCMgk_S70gRmwEHXlE5BLp1B4W82RpFihpMs.woff2 +0 -0
- package/dashboard/.output/public/_fonts/zr3WxpLd5PmlBr7e4PWGkhZv6XTg70Pi4sCbC-CEV0Q-v2yL98XOiD3FkbiYlYYeAeTSVSkgAckeOp55Q5kHJmU.woff2 +0 -0
- package/dashboard/.output/public/_nuxt/B0Bu7wg2.js +1 -0
- package/dashboard/.output/public/_nuxt/BNBS3IWx.js +1 -0
- package/dashboard/.output/public/_nuxt/Ba3u15ft.js +1 -0
- package/dashboard/.output/public/_nuxt/CH7yjz82.js +4 -0
- package/dashboard/.output/public/_nuxt/COkkU9In.js +1 -0
- package/dashboard/.output/public/_nuxt/C_XEhq4z.js +1 -0
- package/dashboard/.output/public/_nuxt/YOlRD-cU.js +1 -0
- package/dashboard/.output/public/_nuxt/_id_.Dz86UAW3.css +1 -0
- package/dashboard/.output/public/_nuxt/builds/latest.json +1 -0
- package/dashboard/.output/public/_nuxt/builds/meta/a6e303b2-379a-45a9-8bdf-906e96134fda.json +1 -0
- package/dashboard/.output/public/_nuxt/entry.D51cHmax.css +1 -0
- package/dashboard/.output/public/_nuxt/error-404.C3kT2QX-.css +1 -0
- package/dashboard/.output/public/_nuxt/error-500.BW0Y54Of.css +1 -0
- package/dashboard/.output/public/_nuxt/fpe_5SoV.js +1 -0
- package/dashboard/.output/server/chunks/_/db.mjs +27 -0
- package/dashboard/.output/server/chunks/_/db.mjs.map +1 -0
- package/dashboard/.output/server/chunks/_/error-500.mjs +19 -0
- package/dashboard/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/_id_-CQaF66RF.mjs +139 -0
- package/dashboard/.output/server/chunks/build/_id_-CQaF66RF.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/_id_-styles.DKwggH1p.mjs +8 -0
- package/dashboard/.output/server/chunks/build/_id_-styles.DKwggH1p.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/app-styles.nHRnXOH3.mjs +25 -0
- package/dashboard/.output/server/chunks/build/app-styles.nHRnXOH3.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/client.precomputed.mjs +4 -0
- package/dashboard/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/composables-lps5heb5.mjs +23 -0
- package/dashboard/.output/server/chunks/build/composables-lps5heb5.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/error-404-D0Xi6cQ6.mjs +92 -0
- package/dashboard/.output/server/chunks/build/error-404-D0Xi6cQ6.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/error-404-styles.C8lgdT6t.mjs +8 -0
- package/dashboard/.output/server/chunks/build/error-404-styles.C8lgdT6t.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/error-500-DabQpmqy.mjs +75 -0
- package/dashboard/.output/server/chunks/build/error-500-DabQpmqy.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/error-500-styles.Ccrcwcfa.mjs +8 -0
- package/dashboard/.output/server/chunks/build/error-500-styles.Ccrcwcfa.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/fetch-BlczD9wj.mjs +503 -0
- package/dashboard/.output/server/chunks/build/fetch-BlczD9wj.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/index-C-zhU_b9.mjs +174 -0
- package/dashboard/.output/server/chunks/build/index-C-zhU_b9.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/index-Dnk7jknb.mjs +154 -0
- package/dashboard/.output/server/chunks/build/index-Dnk7jknb.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/server.mjs +1552 -0
- package/dashboard/.output/server/chunks/build/server.mjs.map +1 -0
- package/dashboard/.output/server/chunks/build/styles.mjs +10 -0
- package/dashboard/.output/server/chunks/build/styles.mjs.map +1 -0
- package/dashboard/.output/server/chunks/nitro/nitro.mjs +5497 -0
- package/dashboard/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/dashboard/.output/server/chunks/routes/api/lessons/_id_.get.mjs +35 -0
- package/dashboard/.output/server/chunks/routes/api/lessons/_id_.get.mjs.map +1 -0
- package/dashboard/.output/server/chunks/routes/api/lessons.get.mjs +64 -0
- package/dashboard/.output/server/chunks/routes/api/lessons.get.mjs.map +1 -0
- package/dashboard/.output/server/chunks/routes/api/stats.get.mjs +59 -0
- package/dashboard/.output/server/chunks/routes/api/stats.get.mjs.map +1 -0
- package/dashboard/.output/server/chunks/routes/renderer.mjs +458 -0
- package/dashboard/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/dashboard/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/dashboard/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/dashboard/.output/server/index.mjs +10 -0
- package/dashboard/.output/server/index.mjs.map +1 -0
- package/dashboard/.output/server/node_modules/@babel/parser/lib/index.js +14599 -0
- package/dashboard/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/dashboard/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6759 -0
- package/dashboard/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/dashboard/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
- package/dashboard/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/dashboard/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
- package/dashboard/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/api/api.js +2 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/api/app.js +2 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/api/component.js +2 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/api/context.js +2 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/api/index.js +22 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/api/util.js +2 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/const.js +5 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/env.js +17 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/index.js +45 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/plugin.js +2 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/proxy.js +111 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/lib/cjs/time.js +28 -0
- package/dashboard/.output/server/node_modules/@vue/devtools-api/package.json +37 -0
- package/dashboard/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1899 -0
- package/dashboard/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/dashboard/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6940 -0
- package/dashboard/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/dashboard/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1822 -0
- package/dashboard/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/dashboard/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +896 -0
- package/dashboard/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/dashboard/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
- package/dashboard/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/dashboard/.output/server/node_modules/devalue/index.js +4 -0
- package/dashboard/.output/server/node_modules/devalue/package.json +40 -0
- package/dashboard/.output/server/node_modules/devalue/src/base64.js +60 -0
- package/dashboard/.output/server/node_modules/devalue/src/constants.js +12 -0
- package/dashboard/.output/server/node_modules/devalue/src/parse.js +283 -0
- package/dashboard/.output/server/node_modules/devalue/src/stringify.js +401 -0
- package/dashboard/.output/server/node_modules/devalue/src/uneval.js +552 -0
- package/dashboard/.output/server/node_modules/devalue/src/utils.js +160 -0
- package/dashboard/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/dashboard/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/dashboard/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/dashboard/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/dashboard/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/dashboard/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/dashboard/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/dashboard/.output/server/node_modules/entities/package.json +120 -0
- package/dashboard/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/dashboard/.output/server/node_modules/estree-walker/package.json +37 -0
- package/dashboard/.output/server/node_modules/hookable/dist/index.mjs +257 -0
- package/dashboard/.output/server/node_modules/hookable/package.json +53 -0
- package/dashboard/.output/server/node_modules/perfect-debounce/dist/index.mjs +89 -0
- package/dashboard/.output/server/node_modules/perfect-debounce/package.json +41 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/dashboard/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/dashboard/.output/server/node_modules/source-map-js/package.json +71 -0
- package/dashboard/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/dashboard/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/dashboard/.output/server/node_modules/ufo/package.json +48 -0
- package/dashboard/.output/server/node_modules/unhead/dist/index.mjs +9 -0
- package/dashboard/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/dashboard/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
- package/dashboard/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
- package/dashboard/.output/server/node_modules/unhead/dist/server.mjs +180 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.B3VbJo7Y.mjs +207 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.CaI5ZD4O.mjs +182 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +236 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.Dh1cQCTe.mjs +44 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.TxTMM7cM.mjs +166 -0
- package/dashboard/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/dashboard/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/dashboard/.output/server/node_modules/unhead/package.json +105 -0
- package/dashboard/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/dashboard/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/dashboard/.output/server/node_modules/vue/index.js +7 -0
- package/dashboard/.output/server/node_modules/vue/index.mjs +1 -0
- package/dashboard/.output/server/node_modules/vue/package.json +112 -0
- package/dashboard/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/dashboard/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +249 -0
- package/dashboard/.output/server/node_modules/vue-bundle-renderer/package.json +57 -0
- package/dashboard/.output/server/node_modules/vue-router/dist/devtools-EWN81iOl.mjs +1220 -0
- package/dashboard/.output/server/node_modules/vue-router/dist/vue-router.mjs +1557 -0
- package/dashboard/.output/server/node_modules/vue-router/package.json +153 -0
- package/dashboard/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
- package/dashboard/.output/server/package.json +29 -0
- package/dist/cli/commands/dashboard.d.ts +2 -0
- package/dist/cli/commands/dashboard.d.ts.map +1 -0
- package/dist/cli/commands/dashboard.js +30 -0
- package/dist/cli/commands/dashboard.js.map +1 -0
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { createHooks } from 'hookable';
|
|
2
|
+
import { n as normalizeEntryToTags, d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey } from './unhead.B3VbJo7Y.mjs';
|
|
3
|
+
import { t as tagWeight, s as sortTags } from './unhead.CbpEuj3y.mjs';
|
|
4
|
+
import { c as UsesMergeStrategy, V as ValidHeadTags } from './unhead.yem5I2v_.mjs';
|
|
5
|
+
|
|
6
|
+
function registerPlugin(head, p) {
|
|
7
|
+
const plugin = typeof p === "function" ? p(head) : p;
|
|
8
|
+
const key = plugin.key || String(head.plugins.size + 1);
|
|
9
|
+
const exists = head.plugins.get(key);
|
|
10
|
+
if (!exists) {
|
|
11
|
+
head.plugins.set(key, plugin);
|
|
12
|
+
head.hooks.addHooks(plugin.hooks || {});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
// @__NO_SIDE_EFFECTS__
|
|
16
|
+
function createHeadCore(resolvedOptions = {}) {
|
|
17
|
+
return /* @__PURE__ */ createUnhead(resolvedOptions);
|
|
18
|
+
}
|
|
19
|
+
// @__NO_SIDE_EFFECTS__
|
|
20
|
+
function createUnhead(resolvedOptions = {}) {
|
|
21
|
+
const hooks = createHooks();
|
|
22
|
+
hooks.addHooks(resolvedOptions.hooks || {});
|
|
23
|
+
const ssr = !resolvedOptions.document;
|
|
24
|
+
const entries = /* @__PURE__ */ new Map();
|
|
25
|
+
const plugins = /* @__PURE__ */ new Map();
|
|
26
|
+
const normalizeQueue = /* @__PURE__ */ new Set();
|
|
27
|
+
const head = {
|
|
28
|
+
_entryCount: 1,
|
|
29
|
+
// 0 is reserved for internal use
|
|
30
|
+
plugins,
|
|
31
|
+
dirty: false,
|
|
32
|
+
resolvedOptions,
|
|
33
|
+
hooks,
|
|
34
|
+
ssr,
|
|
35
|
+
entries,
|
|
36
|
+
headEntries() {
|
|
37
|
+
return [...entries.values()];
|
|
38
|
+
},
|
|
39
|
+
use: (p) => registerPlugin(head, p),
|
|
40
|
+
push(input, _options) {
|
|
41
|
+
const options = { ..._options || {} };
|
|
42
|
+
delete options.head;
|
|
43
|
+
const _i = options._index ?? head._entryCount++;
|
|
44
|
+
const inst = { _i, input, options };
|
|
45
|
+
const _ = {
|
|
46
|
+
_poll(rm = false) {
|
|
47
|
+
head.dirty = true;
|
|
48
|
+
!rm && normalizeQueue.add(_i);
|
|
49
|
+
hooks.callHook("entries:updated", head);
|
|
50
|
+
},
|
|
51
|
+
dispose() {
|
|
52
|
+
if (entries.delete(_i)) {
|
|
53
|
+
head.invalidate();
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
// a patch is the same as creating a new entry, just a nice DX
|
|
57
|
+
patch(input2) {
|
|
58
|
+
if (!options.mode || options.mode === "server" && ssr || options.mode === "client" && !ssr) {
|
|
59
|
+
inst.input = input2;
|
|
60
|
+
entries.set(_i, inst);
|
|
61
|
+
_._poll();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
_.patch(input);
|
|
66
|
+
return _;
|
|
67
|
+
},
|
|
68
|
+
async resolveTags() {
|
|
69
|
+
const ctx = {
|
|
70
|
+
tagMap: /* @__PURE__ */ new Map(),
|
|
71
|
+
tags: [],
|
|
72
|
+
entries: [...head.entries.values()]
|
|
73
|
+
};
|
|
74
|
+
await hooks.callHook("entries:resolve", ctx);
|
|
75
|
+
while (normalizeQueue.size) {
|
|
76
|
+
const i = normalizeQueue.values().next().value;
|
|
77
|
+
normalizeQueue.delete(i);
|
|
78
|
+
const e = entries.get(i);
|
|
79
|
+
if (e) {
|
|
80
|
+
const normalizeCtx = {
|
|
81
|
+
tags: normalizeEntryToTags(e.input, resolvedOptions.propResolvers || []).map((t) => Object.assign(t, e.options)),
|
|
82
|
+
entry: e
|
|
83
|
+
};
|
|
84
|
+
await hooks.callHook("entries:normalize", normalizeCtx);
|
|
85
|
+
e._tags = normalizeCtx.tags.map((t, i2) => {
|
|
86
|
+
t._w = tagWeight(head, t);
|
|
87
|
+
t._p = (e._i << 10) + i2;
|
|
88
|
+
t._d = dedupeKey(t);
|
|
89
|
+
if (!t._d)
|
|
90
|
+
t._h = hashTag(t);
|
|
91
|
+
return t;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
let hasFlatMeta = false;
|
|
96
|
+
ctx.entries.flatMap((e) => (e._tags || []).map((t) => ({ ...t, props: { ...t.props } }))).sort(sortTags).reduce((acc, next) => {
|
|
97
|
+
const k = next._d || next._h;
|
|
98
|
+
if (!acc.has(k))
|
|
99
|
+
return acc.set(k, next);
|
|
100
|
+
const prev = acc.get(k);
|
|
101
|
+
const strategy = next?.tagDuplicateStrategy || (UsesMergeStrategy.has(next.tag) ? "merge" : null) || (next.key && next.key === prev.key ? "merge" : null);
|
|
102
|
+
if (strategy === "merge") {
|
|
103
|
+
const newProps = { ...prev.props };
|
|
104
|
+
Object.entries(next.props).forEach(([p, v]) => (
|
|
105
|
+
// @ts-expect-error untyped
|
|
106
|
+
newProps[p] = p === "style" ? new Map([...prev.props.style || /* @__PURE__ */ new Map(), ...v]) : p === "class" ? /* @__PURE__ */ new Set([...prev.props.class || /* @__PURE__ */ new Set(), ...v]) : v
|
|
107
|
+
));
|
|
108
|
+
acc.set(k, { ...next, props: newProps });
|
|
109
|
+
} else if (next._p >> 10 === prev._p >> 10 && next.tag === "meta" && isMetaArrayDupeKey(k)) {
|
|
110
|
+
acc.set(k, Object.assign([...Array.isArray(prev) ? prev : [prev], next], next));
|
|
111
|
+
hasFlatMeta = true;
|
|
112
|
+
} else if (next._w === prev._w ? next._p > prev._p : next?._w < prev?._w) {
|
|
113
|
+
acc.set(k, next);
|
|
114
|
+
}
|
|
115
|
+
return acc;
|
|
116
|
+
}, ctx.tagMap);
|
|
117
|
+
const title = ctx.tagMap.get("title");
|
|
118
|
+
const titleTemplate = ctx.tagMap.get("titleTemplate");
|
|
119
|
+
head._title = title?.textContent;
|
|
120
|
+
if (titleTemplate) {
|
|
121
|
+
const titleTemplateFn = titleTemplate?.textContent;
|
|
122
|
+
head._titleTemplate = titleTemplateFn;
|
|
123
|
+
if (titleTemplateFn) {
|
|
124
|
+
let newTitle = typeof titleTemplateFn === "function" ? titleTemplateFn(title?.textContent) : titleTemplateFn;
|
|
125
|
+
if (typeof newTitle === "string" && !head.plugins.has("template-params")) {
|
|
126
|
+
newTitle = newTitle.replace("%s", title?.textContent || "");
|
|
127
|
+
}
|
|
128
|
+
if (title) {
|
|
129
|
+
newTitle === null ? ctx.tagMap.delete("title") : ctx.tagMap.set("title", { ...title, textContent: newTitle });
|
|
130
|
+
} else {
|
|
131
|
+
titleTemplate.tag = "title";
|
|
132
|
+
titleTemplate.textContent = newTitle;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
ctx.tags = Array.from(ctx.tagMap.values());
|
|
137
|
+
if (hasFlatMeta) {
|
|
138
|
+
ctx.tags = ctx.tags.flat().sort(sortTags);
|
|
139
|
+
}
|
|
140
|
+
await hooks.callHook("tags:beforeResolve", ctx);
|
|
141
|
+
await hooks.callHook("tags:resolve", ctx);
|
|
142
|
+
await hooks.callHook("tags:afterResolve", ctx);
|
|
143
|
+
const finalTags = [];
|
|
144
|
+
for (const t of ctx.tags) {
|
|
145
|
+
const { innerHTML, tag, props } = t;
|
|
146
|
+
if (!ValidHeadTags.has(tag)) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (Object.keys(props).length === 0 && !t.innerHTML && !t.textContent) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (tag === "meta" && !props.content && !props["http-equiv"] && !props.charset) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
if (tag === "script" && innerHTML) {
|
|
156
|
+
if (String(props.type).endsWith("json")) {
|
|
157
|
+
const v = typeof innerHTML === "string" ? innerHTML : JSON.stringify(innerHTML);
|
|
158
|
+
t.innerHTML = v.replace(/</g, "\\u003C");
|
|
159
|
+
} else if (typeof innerHTML === "string") {
|
|
160
|
+
t.innerHTML = innerHTML.replace(new RegExp(`</${tag}`, "g"), `<\\/${tag}`);
|
|
161
|
+
}
|
|
162
|
+
t._d = dedupeKey(t);
|
|
163
|
+
}
|
|
164
|
+
finalTags.push(t);
|
|
165
|
+
}
|
|
166
|
+
return finalTags;
|
|
167
|
+
},
|
|
168
|
+
invalidate() {
|
|
169
|
+
for (const entry of entries.values()) {
|
|
170
|
+
normalizeQueue.add(entry._i);
|
|
171
|
+
}
|
|
172
|
+
head.dirty = true;
|
|
173
|
+
hooks.callHook("entries:updated", head);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
(resolvedOptions?.plugins || []).forEach((p) => registerPlugin(head, p));
|
|
177
|
+
head.hooks.callHook("init", head);
|
|
178
|
+
resolvedOptions.init?.forEach((e) => e && head.push(e));
|
|
179
|
+
return head;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { createUnhead as a, createHeadCore as c };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const sortTags = (a, b) => a._w === b._w ? a._p - b._p : a._w - b._w;
|
|
2
|
+
const TAG_WEIGHTS = {
|
|
3
|
+
base: -10,
|
|
4
|
+
title: 10
|
|
5
|
+
};
|
|
6
|
+
const TAG_ALIASES = {
|
|
7
|
+
critical: -8,
|
|
8
|
+
high: -1,
|
|
9
|
+
low: 2
|
|
10
|
+
};
|
|
11
|
+
const WEIGHT_MAP = {
|
|
12
|
+
meta: {
|
|
13
|
+
"content-security-policy": -30,
|
|
14
|
+
"charset": -20,
|
|
15
|
+
"viewport": -15
|
|
16
|
+
},
|
|
17
|
+
link: {
|
|
18
|
+
"preconnect": 20,
|
|
19
|
+
"stylesheet": 60,
|
|
20
|
+
"preload": 70,
|
|
21
|
+
"modulepreload": 70,
|
|
22
|
+
"prefetch": 90,
|
|
23
|
+
"dns-prefetch": 90,
|
|
24
|
+
"prerender": 90
|
|
25
|
+
},
|
|
26
|
+
script: {
|
|
27
|
+
async: 30,
|
|
28
|
+
defer: 80,
|
|
29
|
+
sync: 50
|
|
30
|
+
},
|
|
31
|
+
style: {
|
|
32
|
+
imported: 40,
|
|
33
|
+
sync: 60
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const ImportStyleRe = /@import/;
|
|
37
|
+
const isTruthy = (val) => val === "" || val === true;
|
|
38
|
+
function tagWeight(head, tag) {
|
|
39
|
+
if (typeof tag.tagPriority === "number")
|
|
40
|
+
return tag.tagPriority;
|
|
41
|
+
let weight = 100;
|
|
42
|
+
const offset = TAG_ALIASES[tag.tagPriority] || 0;
|
|
43
|
+
const weightMap = head.resolvedOptions.disableCapoSorting ? {
|
|
44
|
+
link: {},
|
|
45
|
+
script: {},
|
|
46
|
+
style: {}
|
|
47
|
+
} : WEIGHT_MAP;
|
|
48
|
+
if (tag.tag in TAG_WEIGHTS) {
|
|
49
|
+
weight = TAG_WEIGHTS[tag.tag];
|
|
50
|
+
} else if (tag.tag === "meta") {
|
|
51
|
+
const metaType = tag.props["http-equiv"] === "content-security-policy" ? "content-security-policy" : tag.props.charset ? "charset" : tag.props.name === "viewport" ? "viewport" : null;
|
|
52
|
+
if (metaType)
|
|
53
|
+
weight = WEIGHT_MAP.meta[metaType];
|
|
54
|
+
} else if (tag.tag === "link" && tag.props.rel) {
|
|
55
|
+
weight = weightMap.link[tag.props.rel];
|
|
56
|
+
} else if (tag.tag === "script") {
|
|
57
|
+
const type = String(tag.props.type);
|
|
58
|
+
if (isTruthy(tag.props.async)) {
|
|
59
|
+
weight = weightMap.script.async;
|
|
60
|
+
} else if (tag.props.src && !isTruthy(tag.props.defer) && !isTruthy(tag.props.async) && type !== "module" && !type.endsWith("json") || tag.innerHTML && !type.endsWith("json")) {
|
|
61
|
+
weight = weightMap.script.sync;
|
|
62
|
+
} else if (isTruthy(tag.props.defer) && tag.props.src && !isTruthy(tag.props.async) || type === "module") {
|
|
63
|
+
weight = weightMap.script.defer;
|
|
64
|
+
}
|
|
65
|
+
} else if (tag.tag === "style") {
|
|
66
|
+
weight = tag.innerHTML && ImportStyleRe.test(tag.innerHTML) ? weightMap.style.imported : weightMap.style.sync;
|
|
67
|
+
}
|
|
68
|
+
return (weight || 100) + offset;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { sortTags as s, tagWeight as t };
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { u as unpackMeta } from './unhead.DQc16pHI.mjs';
|
|
2
|
+
|
|
3
|
+
function defineHeadPlugin(plugin) {
|
|
4
|
+
return plugin;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const FlatMetaPlugin = /* @__PURE__ */ defineHeadPlugin({
|
|
8
|
+
key: "flatMeta",
|
|
9
|
+
hooks: {
|
|
10
|
+
"entries:normalize": (ctx) => {
|
|
11
|
+
const tagsToAdd = [];
|
|
12
|
+
ctx.tags = ctx.tags.map((t) => {
|
|
13
|
+
if (t.tag !== "_flatMeta") {
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
tagsToAdd.push(unpackMeta(t.props).map((p) => ({
|
|
17
|
+
...t,
|
|
18
|
+
tag: "meta",
|
|
19
|
+
props: p
|
|
20
|
+
})));
|
|
21
|
+
return false;
|
|
22
|
+
}).filter(Boolean).concat(...tagsToAdd);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const WhitelistAttributes = {
|
|
28
|
+
htmlAttrs: /* @__PURE__ */ new Set(["class", "style", "lang", "dir"]),
|
|
29
|
+
bodyAttrs: /* @__PURE__ */ new Set(["class", "style"]),
|
|
30
|
+
meta: /* @__PURE__ */ new Set(["name", "property", "charset", "content", "media"]),
|
|
31
|
+
noscript: /* @__PURE__ */ new Set([]),
|
|
32
|
+
style: /* @__PURE__ */ new Set(["media", "nonce", "title", "blocking"]),
|
|
33
|
+
script: /* @__PURE__ */ new Set(["type", "textContent", "nonce", "blocking"]),
|
|
34
|
+
link: /* @__PURE__ */ new Set(["color", "crossorigin", "fetchpriority", "href", "hreflang", "imagesrcset", "imagesizes", "integrity", "media", "referrerpolicy", "rel", "sizes", "type"])
|
|
35
|
+
};
|
|
36
|
+
const BlockedLinkRels = /* @__PURE__ */ new Set(["canonical", "modulepreload", "prerender", "preload", "prefetch", "dns-prefetch", "preconnect", "manifest", "pingback"]);
|
|
37
|
+
const SafeAttrName = /^[a-z][a-z0-9\-]*[a-z0-9]$/i;
|
|
38
|
+
const HtmlEntityHex = /&#x([0-9a-f]+);?/gi;
|
|
39
|
+
const HtmlEntityDec = /&#(\d+);?/g;
|
|
40
|
+
const HtmlEntityNamed = /&(tab|newline|colon|semi|lpar|rpar|sol|bsol|comma|period|excl|num|dollar|percnt|amp|apos|ast|plus|lt|gt|equals|quest|at|lsqb|rsqb|lcub|rcub|vert|hat|grave|tilde|nbsp);?/gi;
|
|
41
|
+
const ControlChars = /[\x00-\x20]+/g;
|
|
42
|
+
const NamedEntityMap = {
|
|
43
|
+
tab: " ",
|
|
44
|
+
newline: "\n",
|
|
45
|
+
colon: ":",
|
|
46
|
+
semi: ";",
|
|
47
|
+
lpar: "(",
|
|
48
|
+
rpar: ")",
|
|
49
|
+
sol: "/",
|
|
50
|
+
bsol: "\\",
|
|
51
|
+
comma: ",",
|
|
52
|
+
period: ".",
|
|
53
|
+
excl: "!",
|
|
54
|
+
num: "#",
|
|
55
|
+
dollar: "$",
|
|
56
|
+
percnt: "%",
|
|
57
|
+
amp: "&",
|
|
58
|
+
apos: "'",
|
|
59
|
+
ast: "*",
|
|
60
|
+
plus: "+",
|
|
61
|
+
lt: "<",
|
|
62
|
+
gt: ">",
|
|
63
|
+
equals: "=",
|
|
64
|
+
quest: "?",
|
|
65
|
+
at: "@",
|
|
66
|
+
lsqb: "[",
|
|
67
|
+
rsqb: "]",
|
|
68
|
+
lcub: "{",
|
|
69
|
+
rcub: "}",
|
|
70
|
+
vert: "|",
|
|
71
|
+
hat: "^",
|
|
72
|
+
grave: "`",
|
|
73
|
+
tilde: "~",
|
|
74
|
+
nbsp: "\xA0"
|
|
75
|
+
};
|
|
76
|
+
function safeFromCodePoint(codePoint) {
|
|
77
|
+
if (codePoint > 1114111 || codePoint < 0 || Number.isNaN(codePoint))
|
|
78
|
+
return "";
|
|
79
|
+
return String.fromCodePoint(codePoint);
|
|
80
|
+
}
|
|
81
|
+
function decodeHtmlEntities(str) {
|
|
82
|
+
return str.replace(HtmlEntityHex, (_, hex) => safeFromCodePoint(Number.parseInt(hex, 16))).replace(HtmlEntityDec, (_, dec) => safeFromCodePoint(Number(dec))).replace(HtmlEntityNamed, (_, name) => NamedEntityMap[name.toLowerCase()] || "");
|
|
83
|
+
}
|
|
84
|
+
function hasDangerousProtocol(url) {
|
|
85
|
+
const entityDecoded = decodeHtmlEntities(url);
|
|
86
|
+
const cleaned = entityDecoded.replace(ControlChars, "");
|
|
87
|
+
let decoded;
|
|
88
|
+
try {
|
|
89
|
+
decoded = decodeURIComponent(cleaned);
|
|
90
|
+
} catch {
|
|
91
|
+
decoded = cleaned;
|
|
92
|
+
}
|
|
93
|
+
const sanitized = decoded.replace(ControlChars, "");
|
|
94
|
+
const lower = sanitized.toLowerCase();
|
|
95
|
+
return lower.startsWith("javascript:") || lower.startsWith("data:") || lower.startsWith("vbscript:");
|
|
96
|
+
}
|
|
97
|
+
function stripProtoKeys(obj) {
|
|
98
|
+
if (Array.isArray(obj))
|
|
99
|
+
return obj.map(stripProtoKeys);
|
|
100
|
+
if (obj && typeof obj === "object") {
|
|
101
|
+
const clean = {};
|
|
102
|
+
for (const key of Object.keys(obj)) {
|
|
103
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
|
104
|
+
continue;
|
|
105
|
+
clean[key] = stripProtoKeys(obj[key]);
|
|
106
|
+
}
|
|
107
|
+
return clean;
|
|
108
|
+
}
|
|
109
|
+
return obj;
|
|
110
|
+
}
|
|
111
|
+
function acceptDataAttrs(value, allowId = true) {
|
|
112
|
+
return Object.fromEntries(
|
|
113
|
+
Object.entries(value || {}).filter(([key]) => (allowId && key === "id" || key.startsWith("data-")) && SafeAttrName.test(key))
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function makeTagSafe(tag) {
|
|
117
|
+
let next = {};
|
|
118
|
+
const { tag: type, props: prev } = tag;
|
|
119
|
+
switch (type) {
|
|
120
|
+
// title: textContent is escaped in rendering (tagToString), no props needed
|
|
121
|
+
case "title":
|
|
122
|
+
break;
|
|
123
|
+
// virtual tags, not rendered to HTML — but sanitize to prevent injection if rendered
|
|
124
|
+
case "titleTemplate":
|
|
125
|
+
case "templateParams":
|
|
126
|
+
next = prev;
|
|
127
|
+
break;
|
|
128
|
+
case "htmlAttrs":
|
|
129
|
+
case "bodyAttrs":
|
|
130
|
+
WhitelistAttributes[type].forEach((attr) => {
|
|
131
|
+
if (prev[attr]) {
|
|
132
|
+
next[attr] = prev[attr];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
delete tag.innerHTML;
|
|
136
|
+
delete tag.textContent;
|
|
137
|
+
tag.props = { ...acceptDataAttrs(prev, false), ...next };
|
|
138
|
+
return !Object.keys(tag.props).length ? false : tag;
|
|
139
|
+
case "style":
|
|
140
|
+
next = acceptDataAttrs(prev);
|
|
141
|
+
WhitelistAttributes.style.forEach((key) => {
|
|
142
|
+
if (prev[key]) {
|
|
143
|
+
next[key] = prev[key];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
break;
|
|
147
|
+
// meta is safe, except for http-equiv
|
|
148
|
+
case "meta":
|
|
149
|
+
WhitelistAttributes.meta.forEach((key) => {
|
|
150
|
+
if (prev[key]) {
|
|
151
|
+
next[key] = prev[key];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
break;
|
|
155
|
+
// link tags we block preloading, prerendering, prefetching, dns-prefetch, preconnect, manifest, etc
|
|
156
|
+
case "link":
|
|
157
|
+
WhitelistAttributes.link.forEach((key) => {
|
|
158
|
+
const val = prev[key];
|
|
159
|
+
if (!val) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (key === "rel" && (typeof val !== "string" || BlockedLinkRels.has(val.toLowerCase()))) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (key === "href" || key === "imagesrcset") {
|
|
166
|
+
if (typeof val !== "string") {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const urls = key === "imagesrcset" ? val.split(",").map((s) => s.trim()) : [val];
|
|
170
|
+
if (urls.some((u) => hasDangerousProtocol(u))) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
next[key] = val;
|
|
174
|
+
} else if (val) {
|
|
175
|
+
next[key] = val;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
if (!next.href && !next.imagesrcset || !next.rel) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
case "noscript":
|
|
183
|
+
WhitelistAttributes.noscript.forEach((key) => {
|
|
184
|
+
if (prev[key]) {
|
|
185
|
+
next[key] = prev[key];
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
break;
|
|
189
|
+
// we only allow JSON in scripts
|
|
190
|
+
case "script":
|
|
191
|
+
if (!tag.textContent || typeof prev.type !== "string" || !prev.type.endsWith("json")) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
const jsonVal = typeof tag.textContent === "string" ? JSON.parse(tag.textContent) : tag.textContent;
|
|
196
|
+
tag.textContent = JSON.stringify(stripProtoKeys(jsonVal), null, 0);
|
|
197
|
+
} catch {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
WhitelistAttributes.script.forEach((s) => {
|
|
201
|
+
if (s !== "textContent" && prev[s]) {
|
|
202
|
+
next[s] = prev[s];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
delete tag.innerHTML;
|
|
208
|
+
if (type !== "title" && type !== "script") {
|
|
209
|
+
delete tag.textContent;
|
|
210
|
+
}
|
|
211
|
+
tag.props = { ...acceptDataAttrs(prev), ...next };
|
|
212
|
+
if (!Object.keys(tag.props).length && !tag.tag.endsWith("Attrs") && !tag.textContent) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
return tag;
|
|
216
|
+
}
|
|
217
|
+
const SafeInputPlugin = (
|
|
218
|
+
/* @PURE */
|
|
219
|
+
defineHeadPlugin({
|
|
220
|
+
key: "safe",
|
|
221
|
+
hooks: {
|
|
222
|
+
"entries:normalize": (ctx) => {
|
|
223
|
+
if (ctx.entry.options?._safe) {
|
|
224
|
+
ctx.tags = ctx.tags.reduce((acc, tag) => {
|
|
225
|
+
const safeTag = makeTagSafe(tag);
|
|
226
|
+
if (safeTag)
|
|
227
|
+
acc.push(safeTag);
|
|
228
|
+
return acc;
|
|
229
|
+
}, []);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
export { FlatMetaPlugin as F, SafeInputPlugin as S, defineHeadPlugin as d };
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { M as MetaTagsArrayable } from './unhead.yem5I2v_.mjs';
|
|
2
|
+
|
|
3
|
+
const NAMESPACES = {
|
|
4
|
+
META: /* @__PURE__ */ new Set(["twitter"]),
|
|
5
|
+
OG: /* @__PURE__ */ new Set(["og", "book", "article", "profile", "fb"]),
|
|
6
|
+
MEDIA: /* @__PURE__ */ new Set(["ogImage", "ogVideo", "ogAudio", "twitterImage"]),
|
|
7
|
+
HTTP_EQUIV: /* @__PURE__ */ new Set(["contentType", "defaultStyle", "xUaCompatible"])
|
|
8
|
+
};
|
|
9
|
+
const META_ALIASES = {
|
|
10
|
+
articleExpirationTime: "article:expiration_time",
|
|
11
|
+
articleModifiedTime: "article:modified_time",
|
|
12
|
+
articlePublishedTime: "article:published_time",
|
|
13
|
+
bookReleaseDate: "book:release_date",
|
|
14
|
+
fbAppId: "fb:app_id",
|
|
15
|
+
ogAudioSecureUrl: "og:audio:secure_url",
|
|
16
|
+
ogAudioUrl: "og:audio",
|
|
17
|
+
ogImageSecureUrl: "og:image:secure_url",
|
|
18
|
+
ogImageUrl: "og:image",
|
|
19
|
+
ogSiteName: "og:site_name",
|
|
20
|
+
ogVideoSecureUrl: "og:video:secure_url",
|
|
21
|
+
ogVideoUrl: "og:video",
|
|
22
|
+
profileFirstName: "profile:first_name",
|
|
23
|
+
profileLastName: "profile:last_name",
|
|
24
|
+
profileUsername: "profile:username",
|
|
25
|
+
msapplicationConfig: "msapplication-Config",
|
|
26
|
+
msapplicationTileColor: "msapplication-TileColor",
|
|
27
|
+
msapplicationTileImage: "msapplication-TileImage"
|
|
28
|
+
};
|
|
29
|
+
const MetaPackingSchema = {
|
|
30
|
+
appleItunesApp: {
|
|
31
|
+
unpack: {
|
|
32
|
+
entrySeparator: ", ",
|
|
33
|
+
// @ts-expect-error untyped
|
|
34
|
+
resolve: ({ key, value }) => `${fixKeyCase(key)}=${value}`
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
refresh: {
|
|
38
|
+
metaKey: "http-equiv",
|
|
39
|
+
unpack: {
|
|
40
|
+
entrySeparator: ";",
|
|
41
|
+
// @ts-expect-error untyped
|
|
42
|
+
resolve: ({ key, value }) => key === "seconds" ? `${value}` : void 0
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
robots: {
|
|
46
|
+
unpack: {
|
|
47
|
+
entrySeparator: ", ",
|
|
48
|
+
// @ts-expect-error untyped
|
|
49
|
+
resolve: ({ key, value }) => typeof value === "boolean" ? fixKeyCase(key) : `${fixKeyCase(key)}:${value}`
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
contentSecurityPolicy: {
|
|
53
|
+
metaKey: "http-equiv",
|
|
54
|
+
unpack: {
|
|
55
|
+
entrySeparator: "; ",
|
|
56
|
+
// @ts-expect-error untyped
|
|
57
|
+
resolve: ({ key, value }) => `${fixKeyCase(key)} ${value}`
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
charset: {}
|
|
61
|
+
};
|
|
62
|
+
function fixKeyCase(key) {
|
|
63
|
+
const updated = key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
64
|
+
const prefixIndex = updated.indexOf("-");
|
|
65
|
+
return prefixIndex === -1 ? updated : NAMESPACES.META.has(updated.slice(0, prefixIndex)) || NAMESPACES.OG.has(updated.slice(0, prefixIndex)) ? key.replace(/([A-Z])/g, ":$1").toLowerCase() : updated;
|
|
66
|
+
}
|
|
67
|
+
function sanitizeObject(input) {
|
|
68
|
+
return Object.fromEntries(Object.entries(input).filter(([k, v]) => String(v) !== "false" && k));
|
|
69
|
+
}
|
|
70
|
+
function transformObject(obj) {
|
|
71
|
+
return Array.isArray(obj) ? obj.map(transformObject) : !obj || typeof obj !== "object" ? obj : Object.fromEntries(Object.entries(obj).map(([k, v]) => [fixKeyCase(k), transformObject(v)]));
|
|
72
|
+
}
|
|
73
|
+
function unpackToString(value, options = {}) {
|
|
74
|
+
const { entrySeparator = "", keyValueSeparator = "", wrapValue, resolve } = options;
|
|
75
|
+
return Object.entries(value).map(([key, val]) => {
|
|
76
|
+
if (resolve) {
|
|
77
|
+
const resolved = resolve({ key, value: val });
|
|
78
|
+
if (resolved !== void 0)
|
|
79
|
+
return resolved;
|
|
80
|
+
}
|
|
81
|
+
const processedVal = typeof val === "object" ? unpackToString(val, options) : typeof val === "number" ? val.toString() : typeof val === "string" && wrapValue ? `${wrapValue}${val.replace(new RegExp(wrapValue, "g"), `\\${wrapValue}`)}${wrapValue}` : val;
|
|
82
|
+
return `${key}${keyValueSeparator}${processedVal}`;
|
|
83
|
+
}).join(entrySeparator);
|
|
84
|
+
}
|
|
85
|
+
function handleObjectEntry(key, value) {
|
|
86
|
+
const sanitizedValue = sanitizeObject(value);
|
|
87
|
+
const fixedKey = fixKeyCase(key);
|
|
88
|
+
const attr = resolveMetaKeyType(fixedKey);
|
|
89
|
+
if (!MetaTagsArrayable.has(fixedKey)) {
|
|
90
|
+
return [{ [attr]: fixedKey, ...sanitizedValue }];
|
|
91
|
+
}
|
|
92
|
+
const input = Object.fromEntries(
|
|
93
|
+
Object.entries(sanitizedValue).map(([k, v]) => [`${key}${k === "url" ? "" : `${k[0].toUpperCase()}${k.slice(1)}`}`, v])
|
|
94
|
+
);
|
|
95
|
+
return unpackMeta(input || {}).sort((a, b) => (a[attr]?.length || 0) - (b[attr]?.length || 0));
|
|
96
|
+
}
|
|
97
|
+
function resolveMetaKeyType(key) {
|
|
98
|
+
if (MetaPackingSchema[key]?.metaKey === "http-equiv" || NAMESPACES.HTTP_EQUIV.has(key)) {
|
|
99
|
+
return "http-equiv";
|
|
100
|
+
}
|
|
101
|
+
const fixed = fixKeyCase(key);
|
|
102
|
+
const colonIndex = fixed.indexOf(":");
|
|
103
|
+
return colonIndex === -1 ? "name" : NAMESPACES.OG.has(fixed.slice(0, colonIndex)) ? "property" : "name";
|
|
104
|
+
}
|
|
105
|
+
function resolveMetaKeyValue(key) {
|
|
106
|
+
return META_ALIASES[key] || fixKeyCase(key);
|
|
107
|
+
}
|
|
108
|
+
function resolvePackedMetaObjectValue(value, key) {
|
|
109
|
+
if (key === "refresh")
|
|
110
|
+
return `${value.seconds};url=${value.url}`;
|
|
111
|
+
return unpackToString(transformObject(value), {
|
|
112
|
+
keyValueSeparator: "=",
|
|
113
|
+
entrySeparator: ", ",
|
|
114
|
+
resolve: ({ value: value2, key: key2 }) => value2 === null ? "" : typeof value2 === "boolean" ? key2 : void 0,
|
|
115
|
+
// @ts-expect-error untyped
|
|
116
|
+
...MetaPackingSchema[key]?.unpack
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function unpackMeta(input) {
|
|
120
|
+
const extras = [];
|
|
121
|
+
const primitives = {};
|
|
122
|
+
for (const [key, value] of Object.entries(input)) {
|
|
123
|
+
if (Array.isArray(value)) {
|
|
124
|
+
if (key === "themeColor") {
|
|
125
|
+
value.forEach((v) => {
|
|
126
|
+
if (typeof v === "object" && v !== null) {
|
|
127
|
+
extras.push({ name: "theme-color", ...v });
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
for (const v of value) {
|
|
133
|
+
if (typeof v === "object" && v !== null) {
|
|
134
|
+
const urlProps = [];
|
|
135
|
+
const otherProps = [];
|
|
136
|
+
for (const [propKey, propValue] of Object.entries(v)) {
|
|
137
|
+
const metaKey = `${key}${propKey === "url" ? "" : `:${propKey}`}`;
|
|
138
|
+
const meta2 = unpackMeta({ [metaKey]: propValue });
|
|
139
|
+
(propKey === "url" ? urlProps : otherProps).push(...meta2);
|
|
140
|
+
}
|
|
141
|
+
extras.push(...urlProps, ...otherProps);
|
|
142
|
+
} else {
|
|
143
|
+
extras.push(...typeof v === "string" ? unpackMeta({ [key]: v }) : handleObjectEntry(key, v));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (typeof value === "object" && value) {
|
|
149
|
+
if (NAMESPACES.MEDIA.has(key)) {
|
|
150
|
+
const prefix = key.startsWith("twitter") ? "twitter" : "og";
|
|
151
|
+
const type = key.replace(/^(og|twitter)/, "").toLowerCase();
|
|
152
|
+
const metaKey = prefix === "twitter" ? "name" : "property";
|
|
153
|
+
if (value.url) {
|
|
154
|
+
extras.push({
|
|
155
|
+
[metaKey]: `${prefix}:${type}`,
|
|
156
|
+
content: value.url
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (value.secureUrl) {
|
|
160
|
+
extras.push({
|
|
161
|
+
[metaKey]: `${prefix}:${type}:secure_url`,
|
|
162
|
+
content: value.secureUrl
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
for (const [propKey, propValue] of Object.entries(value)) {
|
|
166
|
+
if (propKey !== "url" && propKey !== "secureUrl") {
|
|
167
|
+
extras.push({
|
|
168
|
+
[metaKey]: `${prefix}:${type}:${propKey}`,
|
|
169
|
+
// @ts-expect-error untyped
|
|
170
|
+
content: propValue
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} else if (MetaTagsArrayable.has(fixKeyCase(key))) {
|
|
175
|
+
extras.push(...handleObjectEntry(key, value));
|
|
176
|
+
} else {
|
|
177
|
+
primitives[key] = sanitizeObject(value);
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
primitives[key] = value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const meta = Object.entries(primitives).map(([key, value]) => {
|
|
184
|
+
if (key === "charset")
|
|
185
|
+
return { charset: value === null ? "_null" : value };
|
|
186
|
+
const metaKey = resolveMetaKeyType(key);
|
|
187
|
+
const keyValue = resolveMetaKeyValue(key);
|
|
188
|
+
const processedValue = value === null ? "_null" : typeof value === "object" ? resolvePackedMetaObjectValue(value, key) : typeof value === "number" ? value.toString() : value;
|
|
189
|
+
return metaKey === "http-equiv" ? { "http-equiv": keyValue, "content": processedValue } : { [metaKey]: keyValue, content: processedValue };
|
|
190
|
+
});
|
|
191
|
+
return [...extras, ...meta].map(
|
|
192
|
+
(m) => !("content" in m) ? m : m.content === "_null" ? { ...m, content: null } : m
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export { resolveMetaKeyValue as a, resolvePackedMetaObjectValue as b, resolveMetaKeyType as r, unpackMeta as u };
|