@elgap/edukaai 0.1.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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/BHDzAs85.js +1 -0
- package/.output/public/_nuxt/BJzbfdL_.js +1 -0
- package/.output/public/_nuxt/BKGLlKXk.js +6 -0
- package/.output/public/_nuxt/BLuXzJk3.js +1 -0
- package/.output/public/_nuxt/BNOzzLI3.js +1 -0
- package/.output/public/_nuxt/BO5GMwXh.js +1 -0
- package/.output/public/_nuxt/BQRbsFGy.js +1 -0
- package/.output/public/_nuxt/Be4MVdOg.js +1 -0
- package/.output/public/_nuxt/Bu4d3Z1T.js +1 -0
- package/.output/public/_nuxt/BwpBBNv4.js +1 -0
- package/.output/public/_nuxt/C1Og9-6n.js +97 -0
- package/.output/public/_nuxt/C3CjAhtj.js +1 -0
- package/.output/public/_nuxt/C6E3Ty3z.js +1 -0
- package/.output/public/_nuxt/COct4B42.js +1 -0
- package/.output/public/_nuxt/CQ6g2dtj.js +1 -0
- package/.output/public/_nuxt/CURSW5TV.js +246 -0
- package/.output/public/_nuxt/CW57JW4s.js +1 -0
- package/.output/public/_nuxt/Cg2fM61o.js +18 -0
- package/.output/public/_nuxt/CgGOeWta.js +1 -0
- package/.output/public/_nuxt/CoyYbT7u.js +1 -0
- package/.output/public/_nuxt/D11MHbGc.js +133 -0
- package/.output/public/_nuxt/D24dz0S8.js +1 -0
- package/.output/public/_nuxt/D3EFPr8x.js +1 -0
- package/.output/public/_nuxt/Dvt4ZHil.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/ab87ba0e-6d0d-4466-8b12-00d44f8fb9d3.json +1 -0
- package/.output/public/_nuxt/default.C1K1-g4D.css +1 -0
- package/.output/public/_nuxt/entry.CH8k-Mga.css +1 -0
- package/.output/public/_nuxt/error-404.C-Ezrlz-.css +1 -0
- package/.output/public/_nuxt/error-500.DBWf9FGj.css +1 -0
- package/.output/public/_nuxt/first-training.wFDD65zm.css +1 -0
- package/.output/public/_nuxt/import.cUKYdCrq.css +1 -0
- package/.output/public/_nuxt/index.D-2VHyHA.css +1 -0
- package/.output/public/_nuxt/index.D4J_vHmL.css +1 -0
- package/.output/public/_nuxt/mPJeLIz7.js +1 -0
- package/.output/server/chunks/_/error-500.mjs +19 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs +8 -0
- package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs.map +1 -0
- package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs +238 -0
- package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs.map +1 -0
- package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs +8 -0
- package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs.map +1 -0
- package/.output/server/chunks/build/_id_-BUSGcL-H.mjs +113 -0
- package/.output/server/chunks/build/_id_-BUSGcL-H.mjs.map +1 -0
- package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs +112 -0
- package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs.map +1 -0
- package/.output/server/chunks/build/best-practices-DsadorHb.mjs +38 -0
- package/.output/server/chunks/build/best-practices-DsadorHb.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +4 -0
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
- package/.output/server/chunks/build/default-DPkqqHOE.mjs +354 -0
- package/.output/server/chunks/build/default-DPkqqHOE.mjs.map +1 -0
- package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs +8 -0
- package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-K4UfZNck.mjs +97 -0
- package/.output/server/chunks/build/error-404-K4UfZNck.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs +8 -0
- package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-CA7TEPNg.mjs +79 -0
- package/.output/server/chunks/build/error-500-CA7TEPNg.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs +8 -0
- package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs.map +1 -0
- package/.output/server/chunks/build/examples-BHK8MDrs.mjs +134 -0
- package/.output/server/chunks/build/examples-BHK8MDrs.mjs.map +1 -0
- package/.output/server/chunks/build/export-BzxFqqfP.mjs +233 -0
- package/.output/server/chunks/build/export-BzxFqqfP.mjs.map +1 -0
- package/.output/server/chunks/build/faq-DKch73dS.mjs +112 -0
- package/.output/server/chunks/build/faq-DKch73dS.mjs.map +1 -0
- package/.output/server/chunks/build/field-guide-qbukT8F0.mjs +38 -0
- package/.output/server/chunks/build/field-guide-qbukT8F0.mjs.map +1 -0
- package/.output/server/chunks/build/first-training-BbEOBcEW.mjs +343 -0
- package/.output/server/chunks/build/first-training-BbEOBcEW.mjs.map +1 -0
- package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs +8 -0
- package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs.map +1 -0
- package/.output/server/chunks/build/glossary-CxSGCJoH.mjs +397 -0
- package/.output/server/chunks/build/glossary-CxSGCJoH.mjs.map +1 -0
- package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs +128 -0
- package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs.map +1 -0
- package/.output/server/chunks/build/import-C0kYhRv9.mjs +247 -0
- package/.output/server/chunks/build/import-C0kYhRv9.mjs.map +1 -0
- package/.output/server/chunks/build/index-C1ntBEWd.mjs +235 -0
- package/.output/server/chunks/build/index-C1ntBEWd.mjs.map +1 -0
- package/.output/server/chunks/build/index-D3CxihcX.mjs +320 -0
- package/.output/server/chunks/build/index-D3CxihcX.mjs.map +1 -0
- package/.output/server/chunks/build/index-DgKa1cy0.mjs +360 -0
- package/.output/server/chunks/build/index-DgKa1cy0.mjs.map +1 -0
- package/.output/server/chunks/build/index-cG54gaKX.mjs +513 -0
- package/.output/server/chunks/build/index-cG54gaKX.mjs.map +1 -0
- package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs +8 -0
- package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs.map +1 -0
- package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs +91 -0
- package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs.map +1 -0
- package/.output/server/chunks/build/new-b3338aLF.mjs +92 -0
- package/.output/server/chunks/build/new-b3338aLF.mjs.map +1 -0
- package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs +290 -0
- package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs.map +1 -0
- package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs +45 -0
- package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +1979 -0
- package/.output/server/chunks/build/server.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +20 -0
- package/.output/server/chunks/build/styles.mjs.map +1 -0
- package/.output/server/chunks/build/test-router-BYM6Cpst.mjs +105 -0
- package/.output/server/chunks/build/test-router-BYM6Cpst.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +5800 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +481 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/index.mjs +12 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/api.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/app.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/component.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/context.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/hooks.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/index.js +22 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/util.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/const.js +5 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/env.js +17 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/index.js +45 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/plugin.js +2 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/proxy.js +111 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/time.js +28 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/package.json +37 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/dist/index.cjs +42 -0
- package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/package.json +32 -0
- package/.output/server/node_modules/.nitro/hookable@5.5.3/dist/index.cjs +299 -0
- package/.output/server/node_modules/.nitro/hookable@5.5.3/package.json +49 -0
- package/.output/server/node_modules/.nitro/hookable@6.0.1/dist/index.mjs +266 -0
- package/.output/server/node_modules/.nitro/hookable@6.0.1/package.json +52 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/dist/index.cjs +59 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/package.json +44 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/dist/index.mjs +89 -0
- package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/package.json +41 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.js +53 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
- package/.output/server/node_modules/@iconify/utils/package.json +118 -0
- package/.output/server/node_modules/@iconify/vue/dist/iconify.mjs +1893 -0
- package/.output/server/node_modules/@iconify/vue/package.json +64 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/devtools-kit/dist/index.cjs +6850 -0
- package/.output/server/node_modules/@vue/devtools-kit/package.json +44 -0
- package/.output/server/node_modules/@vue/devtools-shared/dist/index.cjs +378 -0
- package/.output/server/node_modules/@vue/devtools-shared/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1870 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6810 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1750 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/birpc/dist/index.cjs +296 -0
- package/.output/server/node_modules/birpc/package.json +57 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/devalue/index.js +4 -0
- package/.output/server/node_modules/devalue/package.json +37 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +7 -0
- package/.output/server/node_modules/devalue/src/parse.js +246 -0
- package/.output/server/node_modules/devalue/src/stringify.js +350 -0
- package/.output/server/node_modules/devalue/src/uneval.js +490 -0
- package/.output/server/node_modules/devalue/src/utils.js +148 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/entities/package.json +120 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/pinia/dist/pinia.prod.cjs +719 -0
- package/.output/server/node_modules/pinia/package.json +94 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
- package/.output/server/node_modules/tailwindcss/package.json +89 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/.output/server/node_modules/ufo/package.json +48 -0
- package/.output/server/node_modules/unhead/dist/index.mjs +9 -0
- package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
- package/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BPM0-cfG.mjs +44 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.D_nrZZPH.mjs +182 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.ckV6dpEQ.mjs +166 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.fVVqDC1O.mjs +203 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/.output/server/node_modules/unhead/package.json +105 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
- package/.output/server/node_modules/vue-router/dist/devtools-EWN81iOl.mjs +1220 -0
- package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1557 -0
- package/.output/server/node_modules/vue-router/package.json +153 -0
- package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
- package/.output/server/package.json +37 -0
- package/LICENSE +21 -0
- package/README.md +132 -0
- package/bin/cli.js +75 -0
- package/package.json +71 -0
|
@@ -0,0 +1,719 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* pinia v3.0.4
|
|
3
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
var vue = require('vue');
|
|
9
|
+
require('@vue/devtools-api');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* setActivePinia must be called to handle SSR at the top of functions like
|
|
13
|
+
* `fetch`, `setup`, `serverPrefetch` and others
|
|
14
|
+
*/
|
|
15
|
+
let activePinia;
|
|
16
|
+
/**
|
|
17
|
+
* Sets or unsets the active pinia. Used in SSR and internally when calling
|
|
18
|
+
* actions and getters
|
|
19
|
+
*
|
|
20
|
+
* @param pinia - Pinia instance
|
|
21
|
+
*/
|
|
22
|
+
// @ts-expect-error: cannot constrain the type of the return
|
|
23
|
+
const setActivePinia = (pinia) => (activePinia = pinia);
|
|
24
|
+
/**
|
|
25
|
+
* Get the currently active pinia if there is any.
|
|
26
|
+
*/
|
|
27
|
+
const getActivePinia = () => (vue.hasInjectionContext() && vue.inject(piniaSymbol)) || activePinia;
|
|
28
|
+
const piniaSymbol = (/* istanbul ignore next */ Symbol());
|
|
29
|
+
|
|
30
|
+
function isPlainObject(
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
+
o) {
|
|
33
|
+
return (o &&
|
|
34
|
+
typeof o === 'object' &&
|
|
35
|
+
Object.prototype.toString.call(o) === '[object Object]' &&
|
|
36
|
+
typeof o.toJSON !== 'function');
|
|
37
|
+
}
|
|
38
|
+
// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }
|
|
39
|
+
// TODO: can we change these to numbers?
|
|
40
|
+
/**
|
|
41
|
+
* Possible types for SubscriptionCallback
|
|
42
|
+
*/
|
|
43
|
+
exports.MutationType = void 0;
|
|
44
|
+
(function (MutationType) {
|
|
45
|
+
/**
|
|
46
|
+
* Direct mutation of the state:
|
|
47
|
+
*
|
|
48
|
+
* - `store.name = 'new name'`
|
|
49
|
+
* - `store.$state.name = 'new name'`
|
|
50
|
+
* - `store.list.push('new item')`
|
|
51
|
+
*/
|
|
52
|
+
MutationType["direct"] = "direct";
|
|
53
|
+
/**
|
|
54
|
+
* Mutated the state with `$patch` and an object
|
|
55
|
+
*
|
|
56
|
+
* - `store.$patch({ name: 'newName' })`
|
|
57
|
+
*/
|
|
58
|
+
MutationType["patchObject"] = "patch object";
|
|
59
|
+
/**
|
|
60
|
+
* Mutated the state with `$patch` and a function
|
|
61
|
+
*
|
|
62
|
+
* - `store.$patch(state => state.name = 'newName')`
|
|
63
|
+
*/
|
|
64
|
+
MutationType["patchFunction"] = "patch function";
|
|
65
|
+
// maybe reset? for $state = {} and $reset
|
|
66
|
+
})(exports.MutationType || (exports.MutationType = {}));
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Creates a Pinia instance to be used by the application
|
|
70
|
+
*/
|
|
71
|
+
function createPinia() {
|
|
72
|
+
const scope = vue.effectScope(true);
|
|
73
|
+
// NOTE: here we could check the window object for a state and directly set it
|
|
74
|
+
// if there is anything like it with Vue 3 SSR
|
|
75
|
+
const state = scope.run(() => vue.ref({}));
|
|
76
|
+
let _p = [];
|
|
77
|
+
// plugins added before calling app.use(pinia)
|
|
78
|
+
let toBeInstalled = [];
|
|
79
|
+
const pinia = vue.markRaw({
|
|
80
|
+
install(app) {
|
|
81
|
+
// this allows calling useStore() outside of a component setup after
|
|
82
|
+
// installing pinia's plugin
|
|
83
|
+
setActivePinia(pinia);
|
|
84
|
+
pinia._a = app;
|
|
85
|
+
app.provide(piniaSymbol, pinia);
|
|
86
|
+
app.config.globalProperties.$pinia = pinia;
|
|
87
|
+
toBeInstalled.forEach((plugin) => _p.push(plugin));
|
|
88
|
+
toBeInstalled = [];
|
|
89
|
+
},
|
|
90
|
+
use(plugin) {
|
|
91
|
+
if (!this._a) {
|
|
92
|
+
toBeInstalled.push(plugin);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
_p.push(plugin);
|
|
96
|
+
}
|
|
97
|
+
return this;
|
|
98
|
+
},
|
|
99
|
+
_p,
|
|
100
|
+
// it's actually undefined here
|
|
101
|
+
// @ts-expect-error
|
|
102
|
+
_a: null,
|
|
103
|
+
_e: scope,
|
|
104
|
+
_s: new Map(),
|
|
105
|
+
state,
|
|
106
|
+
});
|
|
107
|
+
return pinia;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly
|
|
111
|
+
* useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.
|
|
112
|
+
* Once disposed, the pinia instance cannot be used anymore.
|
|
113
|
+
*
|
|
114
|
+
* @param pinia - pinia instance
|
|
115
|
+
*/
|
|
116
|
+
function disposePinia(pinia) {
|
|
117
|
+
pinia._e.stop();
|
|
118
|
+
pinia._s.clear();
|
|
119
|
+
pinia._p.splice(0);
|
|
120
|
+
pinia.state.value = {};
|
|
121
|
+
// @ts-expect-error: non valid
|
|
122
|
+
pinia._a = null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```js
|
|
130
|
+
* const useUser = defineStore(...)
|
|
131
|
+
* if (import.meta.hot) {
|
|
132
|
+
* import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* @param initialUseStore - return of the defineStore to hot update
|
|
137
|
+
* @param hot - `import.meta.hot`
|
|
138
|
+
*/
|
|
139
|
+
function acceptHMRUpdate(initialUseStore, hot) {
|
|
140
|
+
// strip as much as possible from iife.prod
|
|
141
|
+
{
|
|
142
|
+
return () => { };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const noop = () => { };
|
|
147
|
+
function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
|
|
148
|
+
subscriptions.add(callback);
|
|
149
|
+
const removeSubscription = () => {
|
|
150
|
+
const isDel = subscriptions.delete(callback);
|
|
151
|
+
isDel && onCleanup();
|
|
152
|
+
};
|
|
153
|
+
if (!detached && vue.getCurrentScope()) {
|
|
154
|
+
vue.onScopeDispose(removeSubscription);
|
|
155
|
+
}
|
|
156
|
+
return removeSubscription;
|
|
157
|
+
}
|
|
158
|
+
function triggerSubscriptions(subscriptions, ...args) {
|
|
159
|
+
subscriptions.forEach((callback) => {
|
|
160
|
+
callback(...args);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const fallbackRunWithContext = (fn) => fn();
|
|
165
|
+
/**
|
|
166
|
+
* Marks a function as an action for `$onAction`
|
|
167
|
+
* @internal
|
|
168
|
+
*/
|
|
169
|
+
const ACTION_MARKER = Symbol();
|
|
170
|
+
/**
|
|
171
|
+
* Action name symbol. Allows to add a name to an action after defining it
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
const ACTION_NAME = Symbol();
|
|
175
|
+
function mergeReactiveObjects(target, patchToApply) {
|
|
176
|
+
// Handle Map instances
|
|
177
|
+
if (target instanceof Map && patchToApply instanceof Map) {
|
|
178
|
+
patchToApply.forEach((value, key) => target.set(key, value));
|
|
179
|
+
}
|
|
180
|
+
else if (target instanceof Set && patchToApply instanceof Set) {
|
|
181
|
+
// Handle Set instances
|
|
182
|
+
patchToApply.forEach(target.add, target);
|
|
183
|
+
}
|
|
184
|
+
// no need to go through symbols because they cannot be serialized anyway
|
|
185
|
+
for (const key in patchToApply) {
|
|
186
|
+
if (!patchToApply.hasOwnProperty(key))
|
|
187
|
+
continue;
|
|
188
|
+
const subPatch = patchToApply[key];
|
|
189
|
+
const targetValue = target[key];
|
|
190
|
+
if (isPlainObject(targetValue) &&
|
|
191
|
+
isPlainObject(subPatch) &&
|
|
192
|
+
target.hasOwnProperty(key) &&
|
|
193
|
+
!vue.isRef(subPatch) &&
|
|
194
|
+
!vue.isReactive(subPatch)) {
|
|
195
|
+
// NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might
|
|
196
|
+
// start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that
|
|
197
|
+
// to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.
|
|
198
|
+
target[key] = mergeReactiveObjects(targetValue, subPatch);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
// @ts-expect-error: subPatch is a valid value
|
|
202
|
+
target[key] = subPatch;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return target;
|
|
206
|
+
}
|
|
207
|
+
const skipHydrateSymbol = /* istanbul ignore next */ Symbol();
|
|
208
|
+
/**
|
|
209
|
+
* Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a
|
|
210
|
+
* stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.
|
|
211
|
+
*
|
|
212
|
+
* @param obj - target object
|
|
213
|
+
* @returns obj
|
|
214
|
+
*/
|
|
215
|
+
function skipHydrate(obj) {
|
|
216
|
+
return Object.defineProperty(obj, skipHydrateSymbol, {});
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Returns whether a value should be hydrated
|
|
220
|
+
*
|
|
221
|
+
* @param obj - target variable
|
|
222
|
+
* @returns true if `obj` should be hydrated
|
|
223
|
+
*/
|
|
224
|
+
function shouldHydrate(obj) {
|
|
225
|
+
return (!isPlainObject(obj) ||
|
|
226
|
+
!Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol));
|
|
227
|
+
}
|
|
228
|
+
const { assign } = Object;
|
|
229
|
+
function isComputed(o) {
|
|
230
|
+
return !!(vue.isRef(o) && o.effect);
|
|
231
|
+
}
|
|
232
|
+
function createOptionsStore(id, options, pinia, hot) {
|
|
233
|
+
const { state, actions, getters } = options;
|
|
234
|
+
const initialState = pinia.state.value[id];
|
|
235
|
+
let store;
|
|
236
|
+
function setup() {
|
|
237
|
+
if (!initialState && (true)) {
|
|
238
|
+
/* istanbul ignore if */
|
|
239
|
+
pinia.state.value[id] = state ? state() : {};
|
|
240
|
+
}
|
|
241
|
+
// avoid creating a state in pinia.state.value
|
|
242
|
+
const localState = vue.toRefs(pinia.state.value[id]);
|
|
243
|
+
return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
|
|
244
|
+
computedGetters[name] = vue.markRaw(vue.computed(() => {
|
|
245
|
+
setActivePinia(pinia);
|
|
246
|
+
// it was created just before
|
|
247
|
+
const store = pinia._s.get(id);
|
|
248
|
+
// allow cross using stores
|
|
249
|
+
// @ts-expect-error
|
|
250
|
+
// return getters![name].call(context, context)
|
|
251
|
+
// TODO: avoid reading the getter while assigning with a global variable
|
|
252
|
+
return getters[name].call(store, store);
|
|
253
|
+
}));
|
|
254
|
+
return computedGetters;
|
|
255
|
+
}, {}));
|
|
256
|
+
}
|
|
257
|
+
store = createSetupStore(id, setup, options, pinia, hot, true);
|
|
258
|
+
return store;
|
|
259
|
+
}
|
|
260
|
+
function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
|
|
261
|
+
let scope;
|
|
262
|
+
const optionsForPlugin = assign({ actions: {} }, options);
|
|
263
|
+
// watcher options for $subscribe
|
|
264
|
+
const $subscribeOptions = { deep: true };
|
|
265
|
+
// internal state
|
|
266
|
+
let isListening; // set to true at the end
|
|
267
|
+
let isSyncListening; // set to true at the end
|
|
268
|
+
let subscriptions = new Set();
|
|
269
|
+
let actionSubscriptions = new Set();
|
|
270
|
+
let debuggerEvents;
|
|
271
|
+
const initialState = pinia.state.value[$id];
|
|
272
|
+
// avoid setting the state for option stores if it is set
|
|
273
|
+
// by the setup
|
|
274
|
+
if (!isOptionsStore && !initialState && (true)) {
|
|
275
|
+
/* istanbul ignore if */
|
|
276
|
+
pinia.state.value[$id] = {};
|
|
277
|
+
}
|
|
278
|
+
vue.ref({});
|
|
279
|
+
// avoid triggering too many listeners
|
|
280
|
+
// https://github.com/vuejs/pinia/issues/1129
|
|
281
|
+
let activeListener;
|
|
282
|
+
function $patch(partialStateOrMutator) {
|
|
283
|
+
let subscriptionMutation;
|
|
284
|
+
isListening = isSyncListening = false;
|
|
285
|
+
if (typeof partialStateOrMutator === 'function') {
|
|
286
|
+
partialStateOrMutator(pinia.state.value[$id]);
|
|
287
|
+
subscriptionMutation = {
|
|
288
|
+
type: exports.MutationType.patchFunction,
|
|
289
|
+
storeId: $id,
|
|
290
|
+
events: debuggerEvents,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
|
|
295
|
+
subscriptionMutation = {
|
|
296
|
+
type: exports.MutationType.patchObject,
|
|
297
|
+
payload: partialStateOrMutator,
|
|
298
|
+
storeId: $id,
|
|
299
|
+
events: debuggerEvents,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
const myListenerId = (activeListener = Symbol());
|
|
303
|
+
vue.nextTick().then(() => {
|
|
304
|
+
if (activeListener === myListenerId) {
|
|
305
|
+
isListening = true;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
isSyncListening = true;
|
|
309
|
+
// because we paused the watcher, we need to manually call the subscriptions
|
|
310
|
+
triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
|
|
311
|
+
}
|
|
312
|
+
const $reset = isOptionsStore
|
|
313
|
+
? function $reset() {
|
|
314
|
+
const { state } = options;
|
|
315
|
+
const newState = state ? state() : {};
|
|
316
|
+
// we use a patch to group all changes into one single subscription
|
|
317
|
+
this.$patch(($state) => {
|
|
318
|
+
// @ts-expect-error: FIXME: shouldn't error?
|
|
319
|
+
assign($state, newState);
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
: /* istanbul ignore next */
|
|
323
|
+
noop;
|
|
324
|
+
function $dispose() {
|
|
325
|
+
scope.stop();
|
|
326
|
+
subscriptions.clear();
|
|
327
|
+
actionSubscriptions.clear();
|
|
328
|
+
pinia._s.delete($id);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Helper that wraps function so it can be tracked with $onAction
|
|
332
|
+
* @param fn - action to wrap
|
|
333
|
+
* @param name - name of the action
|
|
334
|
+
*/
|
|
335
|
+
const action = (fn, name = '') => {
|
|
336
|
+
if (ACTION_MARKER in fn) {
|
|
337
|
+
fn[ACTION_NAME] = name;
|
|
338
|
+
return fn;
|
|
339
|
+
}
|
|
340
|
+
const wrappedAction = function () {
|
|
341
|
+
setActivePinia(pinia);
|
|
342
|
+
const args = Array.from(arguments);
|
|
343
|
+
const afterCallbackSet = new Set();
|
|
344
|
+
const onErrorCallbackSet = new Set();
|
|
345
|
+
function after(callback) {
|
|
346
|
+
afterCallbackSet.add(callback);
|
|
347
|
+
}
|
|
348
|
+
function onError(callback) {
|
|
349
|
+
onErrorCallbackSet.add(callback);
|
|
350
|
+
}
|
|
351
|
+
// @ts-expect-error
|
|
352
|
+
triggerSubscriptions(actionSubscriptions, {
|
|
353
|
+
args,
|
|
354
|
+
name: wrappedAction[ACTION_NAME],
|
|
355
|
+
store,
|
|
356
|
+
after,
|
|
357
|
+
onError,
|
|
358
|
+
});
|
|
359
|
+
let ret;
|
|
360
|
+
try {
|
|
361
|
+
ret = fn.apply(this && this.$id === $id ? this : store, args);
|
|
362
|
+
// handle sync errors
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
triggerSubscriptions(onErrorCallbackSet, error);
|
|
366
|
+
throw error;
|
|
367
|
+
}
|
|
368
|
+
if (ret instanceof Promise) {
|
|
369
|
+
return ret
|
|
370
|
+
.then((value) => {
|
|
371
|
+
triggerSubscriptions(afterCallbackSet, value);
|
|
372
|
+
return value;
|
|
373
|
+
})
|
|
374
|
+
.catch((error) => {
|
|
375
|
+
triggerSubscriptions(onErrorCallbackSet, error);
|
|
376
|
+
return Promise.reject(error);
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
// trigger after callbacks
|
|
380
|
+
triggerSubscriptions(afterCallbackSet, ret);
|
|
381
|
+
return ret;
|
|
382
|
+
};
|
|
383
|
+
wrappedAction[ACTION_MARKER] = true;
|
|
384
|
+
wrappedAction[ACTION_NAME] = name; // will be set later
|
|
385
|
+
// @ts-expect-error: we are intentionally limiting the returned type to just Fn
|
|
386
|
+
// because all the added properties are internals that are exposed through `$onAction()` only
|
|
387
|
+
return wrappedAction;
|
|
388
|
+
};
|
|
389
|
+
const partialStore = {
|
|
390
|
+
_p: pinia,
|
|
391
|
+
// _s: scope,
|
|
392
|
+
$id,
|
|
393
|
+
$onAction: addSubscription.bind(null, actionSubscriptions),
|
|
394
|
+
$patch,
|
|
395
|
+
$reset,
|
|
396
|
+
$subscribe(callback, options = {}) {
|
|
397
|
+
const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());
|
|
398
|
+
const stopWatcher = scope.run(() => vue.watch(() => pinia.state.value[$id], (state) => {
|
|
399
|
+
if (options.flush === 'sync' ? isSyncListening : isListening) {
|
|
400
|
+
callback({
|
|
401
|
+
storeId: $id,
|
|
402
|
+
type: exports.MutationType.direct,
|
|
403
|
+
events: debuggerEvents,
|
|
404
|
+
}, state);
|
|
405
|
+
}
|
|
406
|
+
}, assign({}, $subscribeOptions, options)));
|
|
407
|
+
return removeSubscription;
|
|
408
|
+
},
|
|
409
|
+
$dispose,
|
|
410
|
+
};
|
|
411
|
+
const store = vue.reactive(partialStore);
|
|
412
|
+
// store the partial store now so the setup of stores can instantiate each other before they are finished without
|
|
413
|
+
// creating infinite loops.
|
|
414
|
+
pinia._s.set($id, store);
|
|
415
|
+
const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext;
|
|
416
|
+
// TODO: idea create skipSerialize that marks properties as non serializable and they are skipped
|
|
417
|
+
const setupStore = runWithContext(() => pinia._e.run(() => (scope = vue.effectScope()).run(() => setup({ action }))));
|
|
418
|
+
// overwrite existing actions to support $onAction
|
|
419
|
+
for (const key in setupStore) {
|
|
420
|
+
const prop = setupStore[key];
|
|
421
|
+
if ((vue.isRef(prop) && !isComputed(prop)) || vue.isReactive(prop)) {
|
|
422
|
+
// mark it as a piece of state to be serialized
|
|
423
|
+
if (!isOptionsStore) {
|
|
424
|
+
// in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created
|
|
425
|
+
if (initialState && shouldHydrate(prop)) {
|
|
426
|
+
if (vue.isRef(prop)) {
|
|
427
|
+
prop.value = initialState[key];
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
// probably a reactive object, lets recursively assign
|
|
431
|
+
// @ts-expect-error: prop is unknown
|
|
432
|
+
mergeReactiveObjects(prop, initialState[key]);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
// transfer the ref to the pinia state to keep everything in sync
|
|
436
|
+
pinia.state.value[$id][key] = prop;
|
|
437
|
+
}
|
|
438
|
+
// action
|
|
439
|
+
}
|
|
440
|
+
else if (typeof prop === 'function') {
|
|
441
|
+
const actionValue = action(prop, key);
|
|
442
|
+
// this a hot module replacement store because the hotUpdate method needs
|
|
443
|
+
// to do it with the right context
|
|
444
|
+
// @ts-expect-error
|
|
445
|
+
setupStore[key] = actionValue;
|
|
446
|
+
// list actions so they can be used in plugins
|
|
447
|
+
// @ts-expect-error
|
|
448
|
+
optionsForPlugin.actions[key] = prop;
|
|
449
|
+
}
|
|
450
|
+
else ;
|
|
451
|
+
}
|
|
452
|
+
// add the state, getters, and action properties
|
|
453
|
+
/* istanbul ignore if */
|
|
454
|
+
assign(store, setupStore);
|
|
455
|
+
// allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.
|
|
456
|
+
// Make `storeToRefs()` work with `reactive()` #799
|
|
457
|
+
assign(vue.toRaw(store), setupStore);
|
|
458
|
+
// use this instead of a computed with setter to be able to create it anywhere
|
|
459
|
+
// without linking the computed lifespan to wherever the store is first
|
|
460
|
+
// created.
|
|
461
|
+
Object.defineProperty(store, '$state', {
|
|
462
|
+
get: () => (pinia.state.value[$id]),
|
|
463
|
+
set: (state) => {
|
|
464
|
+
$patch(($state) => {
|
|
465
|
+
// @ts-expect-error: FIXME: shouldn't error?
|
|
466
|
+
assign($state, state);
|
|
467
|
+
});
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
// apply all plugins
|
|
471
|
+
pinia._p.forEach((extender) => {
|
|
472
|
+
/* istanbul ignore else */
|
|
473
|
+
{
|
|
474
|
+
assign(store, scope.run(() => extender({
|
|
475
|
+
store: store,
|
|
476
|
+
app: pinia._a,
|
|
477
|
+
pinia,
|
|
478
|
+
options: optionsForPlugin,
|
|
479
|
+
})));
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
// only apply hydrate to option stores with an initial state in pinia
|
|
483
|
+
if (initialState &&
|
|
484
|
+
isOptionsStore &&
|
|
485
|
+
options.hydrate) {
|
|
486
|
+
options.hydrate(store.$state, initialState);
|
|
487
|
+
}
|
|
488
|
+
isListening = true;
|
|
489
|
+
isSyncListening = true;
|
|
490
|
+
return store;
|
|
491
|
+
}
|
|
492
|
+
// allows unused stores to be tree shaken
|
|
493
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
494
|
+
function defineStore(
|
|
495
|
+
// TODO: add proper types from above
|
|
496
|
+
id, setup, setupOptions) {
|
|
497
|
+
let options;
|
|
498
|
+
const isSetupStore = typeof setup === 'function';
|
|
499
|
+
// the option store setup will contain the actual options in this case
|
|
500
|
+
options = isSetupStore ? setupOptions : setup;
|
|
501
|
+
function useStore(pinia, hot) {
|
|
502
|
+
const hasContext = vue.hasInjectionContext();
|
|
503
|
+
pinia =
|
|
504
|
+
// in test mode, ignore the argument provided as we can always retrieve a
|
|
505
|
+
// pinia instance with getActivePinia()
|
|
506
|
+
((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) ||
|
|
507
|
+
(hasContext ? vue.inject(piniaSymbol, null) : null);
|
|
508
|
+
if (pinia)
|
|
509
|
+
setActivePinia(pinia);
|
|
510
|
+
pinia = activePinia;
|
|
511
|
+
if (!pinia._s.has(id)) {
|
|
512
|
+
// creating the store registers it in `pinia._s`
|
|
513
|
+
if (isSetupStore) {
|
|
514
|
+
createSetupStore(id, setup, options, pinia);
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
createOptionsStore(id, options, pinia);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const store = pinia._s.get(id);
|
|
521
|
+
// StoreGeneric cannot be casted towards Store
|
|
522
|
+
return store;
|
|
523
|
+
}
|
|
524
|
+
useStore.$id = id;
|
|
525
|
+
return useStore;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
let mapStoreSuffix = 'Store';
|
|
529
|
+
/**
|
|
530
|
+
* Changes the suffix added by `mapStores()`. Can be set to an empty string.
|
|
531
|
+
* Defaults to `"Store"`. Make sure to extend the MapStoresCustomization
|
|
532
|
+
* interface if you are using TypeScript.
|
|
533
|
+
*
|
|
534
|
+
* @param suffix - new suffix
|
|
535
|
+
*/
|
|
536
|
+
function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS
|
|
537
|
+
) {
|
|
538
|
+
mapStoreSuffix = suffix;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Allows using stores without the composition API (`setup()`) by generating an
|
|
542
|
+
* object to be spread in the `computed` field of a component. It accepts a list
|
|
543
|
+
* of store definitions.
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
* ```js
|
|
547
|
+
* export default {
|
|
548
|
+
* computed: {
|
|
549
|
+
* // other computed properties
|
|
550
|
+
* ...mapStores(useUserStore, useCartStore)
|
|
551
|
+
* },
|
|
552
|
+
*
|
|
553
|
+
* created() {
|
|
554
|
+
* this.userStore // store with id "user"
|
|
555
|
+
* this.cartStore // store with id "cart"
|
|
556
|
+
* }
|
|
557
|
+
* }
|
|
558
|
+
* ```
|
|
559
|
+
*
|
|
560
|
+
* @param stores - list of stores to map to an object
|
|
561
|
+
*/
|
|
562
|
+
function mapStores(...stores) {
|
|
563
|
+
return stores.reduce((reduced, useStore) => {
|
|
564
|
+
// @ts-expect-error: $id is added by defineStore
|
|
565
|
+
reduced[useStore.$id + mapStoreSuffix] = function () {
|
|
566
|
+
return useStore(this.$pinia);
|
|
567
|
+
};
|
|
568
|
+
return reduced;
|
|
569
|
+
}, {});
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Allows using state and getters from one store without using the composition
|
|
573
|
+
* API (`setup()`) by generating an object to be spread in the `computed` field
|
|
574
|
+
* of a component.
|
|
575
|
+
*
|
|
576
|
+
* @param useStore - store to map from
|
|
577
|
+
* @param keysOrMapper - array or object
|
|
578
|
+
*/
|
|
579
|
+
function mapState(useStore, keysOrMapper) {
|
|
580
|
+
return Array.isArray(keysOrMapper)
|
|
581
|
+
? keysOrMapper.reduce((reduced, key) => {
|
|
582
|
+
reduced[key] = function () {
|
|
583
|
+
// @ts-expect-error: FIXME: should work?
|
|
584
|
+
return useStore(this.$pinia)[key];
|
|
585
|
+
};
|
|
586
|
+
return reduced;
|
|
587
|
+
}, {})
|
|
588
|
+
: Object.keys(keysOrMapper).reduce((reduced, key) => {
|
|
589
|
+
// @ts-expect-error
|
|
590
|
+
reduced[key] = function () {
|
|
591
|
+
const store = useStore(this.$pinia);
|
|
592
|
+
const storeKey = keysOrMapper[key];
|
|
593
|
+
// for some reason TS is unable to infer the type of storeKey to be a
|
|
594
|
+
// function
|
|
595
|
+
return typeof storeKey === 'function'
|
|
596
|
+
? storeKey.call(this, store)
|
|
597
|
+
: // @ts-expect-error: FIXME: should work?
|
|
598
|
+
store[storeKey];
|
|
599
|
+
};
|
|
600
|
+
return reduced;
|
|
601
|
+
}, {});
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Alias for `mapState()`. You should use `mapState()` instead.
|
|
605
|
+
* @deprecated use `mapState()` instead.
|
|
606
|
+
*/
|
|
607
|
+
const mapGetters = mapState;
|
|
608
|
+
/**
|
|
609
|
+
* Allows directly using actions from your store without using the composition
|
|
610
|
+
* API (`setup()`) by generating an object to be spread in the `methods` field
|
|
611
|
+
* of a component.
|
|
612
|
+
*
|
|
613
|
+
* @param useStore - store to map from
|
|
614
|
+
* @param keysOrMapper - array or object
|
|
615
|
+
*/
|
|
616
|
+
function mapActions(useStore, keysOrMapper) {
|
|
617
|
+
return Array.isArray(keysOrMapper)
|
|
618
|
+
? keysOrMapper.reduce((reduced, key) => {
|
|
619
|
+
// @ts-expect-error
|
|
620
|
+
reduced[key] = function (...args) {
|
|
621
|
+
// @ts-expect-error: FIXME: should work?
|
|
622
|
+
return useStore(this.$pinia)[key](...args);
|
|
623
|
+
};
|
|
624
|
+
return reduced;
|
|
625
|
+
}, {})
|
|
626
|
+
: Object.keys(keysOrMapper).reduce((reduced, key) => {
|
|
627
|
+
// @ts-expect-error
|
|
628
|
+
reduced[key] = function (...args) {
|
|
629
|
+
// @ts-expect-error: FIXME: should work?
|
|
630
|
+
return useStore(this.$pinia)[keysOrMapper[key]](...args);
|
|
631
|
+
};
|
|
632
|
+
return reduced;
|
|
633
|
+
}, {});
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Allows using state and getters from one store without using the composition
|
|
637
|
+
* API (`setup()`) by generating an object to be spread in the `computed` field
|
|
638
|
+
* of a component.
|
|
639
|
+
*
|
|
640
|
+
* @param useStore - store to map from
|
|
641
|
+
* @param keysOrMapper - array or object
|
|
642
|
+
*/
|
|
643
|
+
function mapWritableState(useStore, keysOrMapper) {
|
|
644
|
+
return Array.isArray(keysOrMapper)
|
|
645
|
+
? keysOrMapper.reduce((reduced, key) => {
|
|
646
|
+
reduced[key] = {
|
|
647
|
+
get() {
|
|
648
|
+
return useStore(this.$pinia)[key];
|
|
649
|
+
},
|
|
650
|
+
set(value) {
|
|
651
|
+
return (useStore(this.$pinia)[key] = value);
|
|
652
|
+
},
|
|
653
|
+
};
|
|
654
|
+
return reduced;
|
|
655
|
+
}, {})
|
|
656
|
+
: Object.keys(keysOrMapper).reduce((reduced, key) => {
|
|
657
|
+
reduced[key] = {
|
|
658
|
+
get() {
|
|
659
|
+
return useStore(this.$pinia)[keysOrMapper[key]];
|
|
660
|
+
},
|
|
661
|
+
set(value) {
|
|
662
|
+
return (useStore(this.$pinia)[keysOrMapper[key]] = value);
|
|
663
|
+
},
|
|
664
|
+
};
|
|
665
|
+
return reduced;
|
|
666
|
+
}, {});
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Creates an object of references with all the state, getters, and plugin-added
|
|
671
|
+
* state properties of the store. Similar to `toRefs()` but specifically
|
|
672
|
+
* designed for Pinia stores so methods and non reactive properties are
|
|
673
|
+
* completely ignored.
|
|
674
|
+
*
|
|
675
|
+
* @param store - store to extract the refs from
|
|
676
|
+
*/
|
|
677
|
+
function storeToRefs(store) {
|
|
678
|
+
const rawStore = vue.toRaw(store);
|
|
679
|
+
const refs = {};
|
|
680
|
+
for (const key in rawStore) {
|
|
681
|
+
const value = rawStore[key];
|
|
682
|
+
// There is no native method to check for a computed
|
|
683
|
+
// https://github.com/vuejs/core/pull/4165
|
|
684
|
+
if (value.effect) {
|
|
685
|
+
// @ts-expect-error: too hard to type correctly
|
|
686
|
+
refs[key] =
|
|
687
|
+
// ...
|
|
688
|
+
vue.computed({
|
|
689
|
+
get: () => store[key],
|
|
690
|
+
set(value) {
|
|
691
|
+
store[key] = value;
|
|
692
|
+
},
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
else if (vue.isRef(value) || vue.isReactive(value)) {
|
|
696
|
+
// @ts-expect-error: the key is state or getter
|
|
697
|
+
refs[key] =
|
|
698
|
+
// ---
|
|
699
|
+
vue.toRef(store, key);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return refs;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
exports.acceptHMRUpdate = acceptHMRUpdate;
|
|
706
|
+
exports.createPinia = createPinia;
|
|
707
|
+
exports.defineStore = defineStore;
|
|
708
|
+
exports.disposePinia = disposePinia;
|
|
709
|
+
exports.getActivePinia = getActivePinia;
|
|
710
|
+
exports.mapActions = mapActions;
|
|
711
|
+
exports.mapGetters = mapGetters;
|
|
712
|
+
exports.mapState = mapState;
|
|
713
|
+
exports.mapStores = mapStores;
|
|
714
|
+
exports.mapWritableState = mapWritableState;
|
|
715
|
+
exports.setActivePinia = setActivePinia;
|
|
716
|
+
exports.setMapStoreSuffix = setMapStoreSuffix;
|
|
717
|
+
exports.shouldHydrate = shouldHydrate;
|
|
718
|
+
exports.skipHydrate = skipHydrate;
|
|
719
|
+
exports.storeToRefs = storeToRefs;
|