Socket
Socket
Sign inDemoInstall

vue-meta

Package Overview
Dependencies
21
Maintainers
5
Versions
72
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0-alpha.9 to 3.0.0-alpha.10

6

dist/vue-meta.cjs.js
/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -964,3 +964,3 @@ * - All the amazing contributors

if (isFunction(metaInfo)) {
const computedMetaInfo = vue.computed(metaInfo);
const computedMetaInfo = vue.computed(metaInfo.bind(this));
useMeta(computedMetaInfo);

@@ -967,0 +967,0 @@ }

/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -944,3 +944,3 @@ * - All the amazing contributors

if (isFunction(metaInfo)) {
const computedMetaInfo = vue.computed(metaInfo);
const computedMetaInfo = vue.computed(metaInfo.bind(this));
useMeta(computedMetaInfo);

@@ -947,0 +947,0 @@ }

/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -9,5 +9,5 @@ * - All the amazing contributors

/// <reference path="ssr.d.ts" />
/// <reference path="../ssr/index.d.ts" />
import { App, ComponentInternalInstance, Slots, VNode } from 'vue';
import { App, ComponentInternalInstance, Slots, VNode, ComponentOptionsMixin } from 'vue';

@@ -170,3 +170,3 @@ declare const IS_PROXY: unique symbol;

}
declare type ComponentOptionsMetaInfo = ComponentMetaInfo | (() => ComponentMetaInfo);
declare type ComponentOptionsMetaInfo = ComponentMetaInfo | ((this: ComponentOptionsMixin) => ComponentMetaInfo);

@@ -173,0 +173,0 @@ declare type MetaConfigSectionKey = 'tag' | 'to' | 'keyAttribute' | 'valueAttribute' | 'nameless' | 'group' | 'namespaced' | 'namespacedAttribute' | 'attributesFor';

/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -960,3 +960,3 @@ * - All the amazing contributors

if (isFunction(metaInfo)) {
const computedMetaInfo = computed(metaInfo);
const computedMetaInfo = computed(metaInfo.bind(this));
useMeta(computedMetaInfo);

@@ -963,0 +963,0 @@ }

/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -8,2 +8,2 @@ * - All the amazing contributors

*/
import{markRaw as t,h as e,getCurrentInstance as o,isProxy as r,watch as n,inject as s,defineComponent as i,reactive as c,onUnmounted as a,Teleport as u,Comment as l,computed as f}from"vue";const d=(t,e)=>(o,r)=>{let n=-1;if(r.reduce(((e,o,r)=>{const s=t(e,o);return s!==e?(n=r,s):e}),e),n>-1)return o[n]},p=d(((t,e)=>{const{depth:o}=e;return!t||o>t?o:t}));var m=Object.freeze({__proto__:null,setup:t=>{let e=0;if(t.vm){let{vm:o}=t;do{o.parent&&(e++,o=o.parent)}while(o&&o.parent&&o!==o.root)}t.depth=e},resolve:p});const b={body:{tag:"script",to:"body"},base:{valueAttribute:"href"},charset:{tag:"meta",nameless:!0,valueAttribute:"charset"},description:{tag:"meta"},og:{group:!0,namespacedAttribute:!0,tag:"meta",keyAttribute:"property"},twitter:{group:!0,namespacedAttribute:!0,tag:"meta"},htmlAttrs:{attributesFor:"html"},headAttrs:{attributesFor:"head"},bodyAttrs:{attributesFor:"body"}},h={title:{attributes:!1},base:{contentAsAttribute:!0,attributes:["href","target"]},meta:{contentAsAttribute:!0,keyAttribute:"name",attributes:["content","name","http-equiv","charset"]},link:{contentAsAttribute:!0,attributes:["href","crossorigin","rel","media","integrity","hreflang","type","referrerpolicy","sizes","imagesrcset","imagesizes","as","color"]},style:{attributes:["media"]},script:{attributes:["src","type","nomodule","async","defer","crossorigin","integrity","referrerpolicy"]},noscript:{attributes:!1}};Object.freeze({}),Object.freeze([]);const g=Array.isArray,y=t=>"function"==typeof t,v=t=>"string"==typeof t,S=t=>null!==t&&"object"==typeof t,A=Object.prototype.toString,k=t=>"[object Object]"===A.call(t),N=Symbol("kIsProxy"),j=Symbol("kProxySources"),R=Symbol("kProxyTarget"),w=Symbol("kResolveContext");function x(t){if(g(t))return t.map(x);if(S(t)){const e={};for(const o in t)e[o]="context"===o?t[o]:x(t[o]);return e}return t}const O=(t,e,o)=>{const r=[];for(const n of t)n&&e in n&&(r.push(n[e]),o&&o(n));return r},$=(t,e=[],o,r)=>{if(!o&&!r&&(({active:o,sources:r}=t),e.length))for(let t=0;t<e.length;t++){const n=e[t];if(!o||!o[n])return void console.error(`recompute: segment ${n} not found on target`,e,o);o=o[n],r=r.map((t=>t[n])).filter(Boolean)}if(!o||!r)return;const n=((t,...e)=>{const o=t?Object.keys(t):[];if(e)for(const t of e)if(t&&S(t))for(const e in t)o.includes(e)||o.push(e);return o})(...r),s=Object.keys(o);for(const t of s)n.includes(t)||delete o[t];for(const s of n){let n=!1;for(let t=0;t<r.length;t++){const e=r[t];if(e&&s in e&&void 0!==e[s]){n=k(e[s]);break}}if(n){o[s]||(o[s]={});const n=[];for(const t of r)s in t&&n.push(t[s]);$(t,[...e,s],o[s],n);continue}!o[s]&&g(r[0][s])&&(o[s]=[]);const i=[],c=O(r,s,(t=>i.push(t[w])));let a=t.resolve(c,i,o[s],s,e);k(a)&&(a=x(a)),o[s]=a}},P=(e,o,r,n=[])=>{const s=C(e,r,n),i=t(new Proxy(o,s));return!n.length&&e.sources&&e.sources.push(i),i},C=(t,e,o=[])=>({get:(r,n,s)=>{if(n===N)return!0;if(n===j)return t.sources;if(n===R)return r;if(n===w)return e;let i=Reflect.get(r,n,s);if(!S(i))return i;if(!i[N]){const s=[...o,n];i=P(t,i,e,s),Reflect.set(r,n,i)}return i},set:(e,r,n)=>{const s=Reflect.set(e,r,n);if(s){const i=g(e);let c,a=!1,{sources:u,active:l}=t,f=0;for(const t of o){if(u=O(u,t),i&&f===o.length-1){c=t;break}g(l)&&(a=!0),l=l[t],f++}if(a)return $(t),s;if(k(n))return $(t,o),s;let d,p=[];i?(d=u,p=u.map((t=>t[w]))):d=O(u,r,(t=>p.push(t[w])));let m=t.resolve(d,p,l,r,o);k(m)&&(m=x(m)),i&&c?l[c]=m:l[r]=m}return s},deleteProperty:(e,r)=>{const n=Reflect.deleteProperty(e,r);if(n){const n=g(e);let s,i=t.sources,c=t.active,a=0;for(const t of o){if(i=i.map((e=>e&&e[t])),n&&a===o.length-1){s=t;break}c=c[t],a++}if(i.some((t=>t&&r in t))){let e,a=[];n?(e=i,a=i.map((t=>t[w]))):e=O(i,r,(t=>a.push(t[w])));let u=t.resolve(e,a,c,r,o);k(u)&&(u=x(u)),n&&s?c[s]=u:c[r]=u}else delete c[r]}return n}}),M={};function F(t,o,r,n){return"attributesFor"in n?function(t,o,r,n){const{attributesFor:s}=n;if(!s||!r)return;if(t.isSSR)return{to:"",vnode:e(`ssr-${s}`,r)};if(!M[s]){const[t,e]=Array.from(document.querySelectorAll(s));if(!t)return void console.error("Could not find element for selector",s,", won't render attributes");e&&console.warn("Found multiple elements for selector",s),M[s]={el:t,attrs:[]}}const{el:i,attrs:c}=M[s];for(const e in r){let n=U(t,`${o}(${e})`,r[e],r);g(n)&&(n=n.join(",")),i.setAttribute(e,n||""),c.includes(e)||c.push(e)}const a=c.filter((t=>!r[t]));for(const t of a)i.removeAttribute(t)}(t,o,r,n):"group"in n?function(t,e,o,r){if(g(o))return console.warn("Specifying an array for group properties isnt supported"),[];return Object.keys(o).map((n=>{const s={group:e,data:o};if(r.namespaced)s.tagNamespace=!0===r.namespaced?e:r.namespaced;else if(r.namespacedAttribute){const t=!0===r.namespacedAttribute?e:r.namespacedAttribute;s.fullName=`${t}:${n}`,s.slotName=`${t}(${n})`}return E(t,e,o[n],r,s)})).filter(Boolean).flat()}(t,o,r,n):E(t,o,r,n)}function E(t,o,r,n={},s){const i=["content","json","rawContent"],c=t=>function(t,e){for(const o of t){const t=h[o];if(o&&t)return t[e]}}([a,n.tag],t);if(g(r))return r.map((e=>E(t,o,e,n,s))).filter(Boolean).flat();const{tag:a=n.tag||o}=r;let u="",l=!1,f=!1;if(v(r))u=r;else if(r.children&&g(r.children))l=!0,u=r.children.map((e=>{const r=E(t,o,e,n,s);return g(r)?r.map((({vnode:t})=>t)):r&&r.vnode}));else{let t=0;for(const e of i){if(!u&&r[e]){u=1===t?JSON.stringify(r[e]):r[e],f=t>1;break}t++}}const d=s&&s.fullName||o,p=s&&s.slotName||o;let{attrs:m}=r;if(m||"object"!=typeof r)m||(m={});else{m={...r},delete m.tag,delete m.children,delete m.to;for(const t of i)delete m[t]}if(l)u=U(t,p,u,r);else{const e=!!c("contentAsAttribute");let{valueAttribute:o}=n;if(!o&&e){const[t]=c("attributes");o=v(e)?e:t}if(o){const{nameless:e}=n;if(!e){const t=n.keyAttribute||c("keyAttribute");t&&(m[t]=d)}m[o]=U(t,p,m[o]||u,s),u=""}else u=U(t,p,u,r)}const b=s&&s.tagNamespace?`${s.tagNamespace}:${a}`:a;if("title"===b&&!t.isSSR)return void(document.title=u);f&&u&&(m.innerHTML=u);const y=e(b,m,u||void 0);return{to:r.to,vnode:y}}function U({metainfo:t,slots:e},o,r,n){const s=e&&e[o];if(!s||!y(s))return r;const i={content:r,metainfo:t};if(n&&n.group){const{group:t,data:e}=n;i[t]=e}const c=s(i);if(c&&c.length){const{children:t}=c[0];return t?t.toString():""}return r}const z="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,_=(t=>z?Symbol("[vue-meta]: "+t):"[vue-meta]: "+t)("meta_active");function L(t,e,o){for(const r in e)r in o?S(t[r])?L(t[r],e[r],o[r]):e[r]!==o[r]&&(t[r]=e[r]):t[r]=e[r];for(const r in o)e&&r in e||delete t[r]}function q(t){if(t||(t=o()||void 0),t)return t.appContext.config.globalProperties.$metaManager}function B(t,e){const s=o()||void 0;if(!e&&s&&(e=q(s)),!e)throw new Error("No manager or current instance");r(t)&&(n(t,((t,e)=>{L(i.meta,t,e)})),t=t.value);const i=e.addMeta(t,s);return i}function I(){return s(_)}const T=i({name:"Metainfo",inheritAttrs:!1,setup:(t,{slots:e})=>()=>{const t=q();if(t)return t.render({slots:e})}});function D(t,e,o,r){const n=g(r)?r:[r];t?o.endsWith("Attrs")||n.forEach((t=>{t.props||(t.props={}),t.props["data-vm-ssr"]=!0})):n.forEach(((t,e)=>{t.type===l&&n.splice(e,1)})),e[o]||(e[o]=[]),e[o].push(...n)}const H=(t=!1,e,o)=>J.create(t,e||b,o||m);class J{isSSR=!1;config;target;resolver;ssrCleanedUp=!1;constructor(t,e,o,r){this.isSSR=t,this.config=e,this.target=o,r&&"setup"in r&&y(r.setup)&&(this.resolver=r)}static create=(t,e,o)=>{const r=((t,e)=>{const o=[],r={active:e,resolve:t,sources:o},n=()=>$(r);return{context:r,compute:n,addSource:(t,e,o=!1)=>{const s=P(r,t,e||{});return o&&n(),s},delSource:(t,e=!0)=>{const r=o.findIndex((e=>e===t||e[R]===t));return r>-1&&(o.splice(r,1),e&&n(),!0)}}})(((t,e,r,n,s)=>y(o)?o(t,e,r,n,s):o.resolve(t,e,r,n,s)),c({}));return new J(t,e,r,o)};install(t){t.component("Metainfo",T),t.config.globalProperties.$metaManager=this,t.provide(_,this.target.context.active)}addMeta(t,e){e||(e=o()||void 0);const r={removed:[]},n={vm:e},{resolver:s}=this;s&&s.setup&&s.setup(n);const i=this.target.addSource(t,n,!0),c=t=>this.unmount(!!t,i,r,e);return e&&a(c),{meta:i,onRemoved:t=>r.removed.push(t),unmount:c}}unmount(t,e,o,r){if(r){const{$el:n}=r.proxy;if(n&&n.offsetParent){let r=new MutationObserver((s=>{for(const{removedNodes:i}of s)i&&i.forEach((s=>{s===n&&r&&(r.disconnect(),r=void 0,this.reallyUnmount(t,e,o))}))}));return void r.observe(n.parentNode,{childList:!0})}}this.reallyUnmount(t,e,o)}async reallyUnmount(t,e,o){this.target.delSource(e),!t&&o&&await Promise.all(o.removed.map((t=>t())))}render({slots:t}={}){const o=this.target.context.active,{isSSR:r}=this;if(!r&&!this.ssrCleanedUp){this.ssrCleanedUp=!0;const t=()=>{const t=document.querySelectorAll("[data-vm-ssr]");t&&t.length&&t.forEach((t=>t.parentNode&&t.parentNode.removeChild(t)))};"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t,{once:!0}):t()}const n={};for(const e in o){const s=this.config[e]||{};let i=F({isSSR:r,metainfo:o,slots:t},e,o[e],s);if(!i)continue;g(i)||(i=[i]);let c="base"!==e&&o[e].to;!c&&"to"in s&&(c=s.to),!c&&"attributesFor"in s&&(c=e);for(const{to:t,vnode:e}of i)D(this.isSSR,n,t||c||"head",e)}if(t)for(const e in t){const r="default"===e?"head":e;if("head"!==r&&"body"!==r)continue;const s=t[e];y(s)&&D(this.isSSR,n,r,s({metainfo:o}))}return Object.keys(n).map((t=>e(u,{to:t},n[t])))}}const W={keyName:"metaInfo"},G=(t,e={})=>{const r=Object.assign({},W,e);t.mixin((t=>({created(){const e=o();if(!e?.type||!(t.keyName in e.type))return;const r=e.type[t.keyName];y(r)?B(f(r)):B(r)}}))(r))};export{H as createMetaManager,m as deepestResolver,b as defaultConfig,q as getCurrentManager,G as plugin,d as resolveOption,I as useActiveMeta,B as useMeta};
import{markRaw as t,h as e,getCurrentInstance as o,isProxy as r,watch as n,inject as s,defineComponent as i,reactive as c,onUnmounted as a,Teleport as u,Comment as l,computed as f}from"vue";const d=(t,e)=>(o,r)=>{let n=-1;if(r.reduce(((e,o,r)=>{const s=t(e,o);return s!==e?(n=r,s):e}),e),n>-1)return o[n]},p=d(((t,e)=>{const{depth:o}=e;return!t||o>t?o:t}));var m=Object.freeze({__proto__:null,setup:t=>{let e=0;if(t.vm){let{vm:o}=t;do{o.parent&&(e++,o=o.parent)}while(o&&o.parent&&o!==o.root)}t.depth=e},resolve:p});const b={body:{tag:"script",to:"body"},base:{valueAttribute:"href"},charset:{tag:"meta",nameless:!0,valueAttribute:"charset"},description:{tag:"meta"},og:{group:!0,namespacedAttribute:!0,tag:"meta",keyAttribute:"property"},twitter:{group:!0,namespacedAttribute:!0,tag:"meta"},htmlAttrs:{attributesFor:"html"},headAttrs:{attributesFor:"head"},bodyAttrs:{attributesFor:"body"}},h={title:{attributes:!1},base:{contentAsAttribute:!0,attributes:["href","target"]},meta:{contentAsAttribute:!0,keyAttribute:"name",attributes:["content","name","http-equiv","charset"]},link:{contentAsAttribute:!0,attributes:["href","crossorigin","rel","media","integrity","hreflang","type","referrerpolicy","sizes","imagesrcset","imagesizes","as","color"]},style:{attributes:["media"]},script:{attributes:["src","type","nomodule","async","defer","crossorigin","integrity","referrerpolicy"]},noscript:{attributes:!1}};Object.freeze({}),Object.freeze([]);const g=Array.isArray,y=t=>"function"==typeof t,v=t=>"string"==typeof t,S=t=>null!==t&&"object"==typeof t,A=Object.prototype.toString,k=t=>"[object Object]"===A.call(t),N=Symbol("kIsProxy"),j=Symbol("kProxySources"),R=Symbol("kProxyTarget"),w=Symbol("kResolveContext");function x(t){if(g(t))return t.map(x);if(S(t)){const e={};for(const o in t)e[o]="context"===o?t[o]:x(t[o]);return e}return t}const O=(t,e,o)=>{const r=[];for(const n of t)n&&e in n&&(r.push(n[e]),o&&o(n));return r},$=(t,e=[],o,r)=>{if(!o&&!r&&(({active:o,sources:r}=t),e.length))for(let t=0;t<e.length;t++){const n=e[t];if(!o||!o[n])return void console.error(`recompute: segment ${n} not found on target`,e,o);o=o[n],r=r.map((t=>t[n])).filter(Boolean)}if(!o||!r)return;const n=((t,...e)=>{const o=t?Object.keys(t):[];if(e)for(const t of e)if(t&&S(t))for(const e in t)o.includes(e)||o.push(e);return o})(...r),s=Object.keys(o);for(const t of s)n.includes(t)||delete o[t];for(const s of n){let n=!1;for(let t=0;t<r.length;t++){const e=r[t];if(e&&s in e&&void 0!==e[s]){n=k(e[s]);break}}if(n){o[s]||(o[s]={});const n=[];for(const t of r)s in t&&n.push(t[s]);$(t,[...e,s],o[s],n);continue}!o[s]&&g(r[0][s])&&(o[s]=[]);const i=[],c=O(r,s,(t=>i.push(t[w])));let a=t.resolve(c,i,o[s],s,e);k(a)&&(a=x(a)),o[s]=a}},P=(e,o,r,n=[])=>{const s=C(e,r,n),i=t(new Proxy(o,s));return!n.length&&e.sources&&e.sources.push(i),i},C=(t,e,o=[])=>({get:(r,n,s)=>{if(n===N)return!0;if(n===j)return t.sources;if(n===R)return r;if(n===w)return e;let i=Reflect.get(r,n,s);if(!S(i))return i;if(!i[N]){const s=[...o,n];i=P(t,i,e,s),Reflect.set(r,n,i)}return i},set:(e,r,n)=>{const s=Reflect.set(e,r,n);if(s){const i=g(e);let c,a=!1,{sources:u,active:l}=t,f=0;for(const t of o){if(u=O(u,t),i&&f===o.length-1){c=t;break}g(l)&&(a=!0),l=l[t],f++}if(a)return $(t),s;if(k(n))return $(t,o),s;let d,p=[];i?(d=u,p=u.map((t=>t[w]))):d=O(u,r,(t=>p.push(t[w])));let m=t.resolve(d,p,l,r,o);k(m)&&(m=x(m)),i&&c?l[c]=m:l[r]=m}return s},deleteProperty:(e,r)=>{const n=Reflect.deleteProperty(e,r);if(n){const n=g(e);let s,i=t.sources,c=t.active,a=0;for(const t of o){if(i=i.map((e=>e&&e[t])),n&&a===o.length-1){s=t;break}c=c[t],a++}if(i.some((t=>t&&r in t))){let e,a=[];n?(e=i,a=i.map((t=>t[w]))):e=O(i,r,(t=>a.push(t[w])));let u=t.resolve(e,a,c,r,o);k(u)&&(u=x(u)),n&&s?c[s]=u:c[r]=u}else delete c[r]}return n}}),M={};function F(t,o,r,n){return"attributesFor"in n?function(t,o,r,n){const{attributesFor:s}=n;if(!s||!r)return;if(t.isSSR)return{to:"",vnode:e(`ssr-${s}`,r)};if(!M[s]){const[t,e]=Array.from(document.querySelectorAll(s));if(!t)return void console.error("Could not find element for selector",s,", won't render attributes");e&&console.warn("Found multiple elements for selector",s),M[s]={el:t,attrs:[]}}const{el:i,attrs:c}=M[s];for(const e in r){let n=U(t,`${o}(${e})`,r[e],r);g(n)&&(n=n.join(",")),i.setAttribute(e,n||""),c.includes(e)||c.push(e)}const a=c.filter((t=>!r[t]));for(const t of a)i.removeAttribute(t)}(t,o,r,n):"group"in n?function(t,e,o,r){if(g(o))return console.warn("Specifying an array for group properties isnt supported"),[];return Object.keys(o).map((n=>{const s={group:e,data:o};if(r.namespaced)s.tagNamespace=!0===r.namespaced?e:r.namespaced;else if(r.namespacedAttribute){const t=!0===r.namespacedAttribute?e:r.namespacedAttribute;s.fullName=`${t}:${n}`,s.slotName=`${t}(${n})`}return E(t,e,o[n],r,s)})).filter(Boolean).flat()}(t,o,r,n):E(t,o,r,n)}function E(t,o,r,n={},s){const i=["content","json","rawContent"],c=t=>function(t,e){for(const o of t){const t=h[o];if(o&&t)return t[e]}}([a,n.tag],t);if(g(r))return r.map((e=>E(t,o,e,n,s))).filter(Boolean).flat();const{tag:a=n.tag||o}=r;let u="",l=!1,f=!1;if(v(r))u=r;else if(r.children&&g(r.children))l=!0,u=r.children.map((e=>{const r=E(t,o,e,n,s);return g(r)?r.map((({vnode:t})=>t)):r&&r.vnode}));else{let t=0;for(const e of i){if(!u&&r[e]){u=1===t?JSON.stringify(r[e]):r[e],f=t>1;break}t++}}const d=s&&s.fullName||o,p=s&&s.slotName||o;let{attrs:m}=r;if(m||"object"!=typeof r)m||(m={});else{m={...r},delete m.tag,delete m.children,delete m.to;for(const t of i)delete m[t]}if(l)u=U(t,p,u,r);else{const e=!!c("contentAsAttribute");let{valueAttribute:o}=n;if(!o&&e){const[t]=c("attributes");o=v(e)?e:t}if(o){const{nameless:e}=n;if(!e){const t=n.keyAttribute||c("keyAttribute");t&&(m[t]=d)}m[o]=U(t,p,m[o]||u,s),u=""}else u=U(t,p,u,r)}const b=s&&s.tagNamespace?`${s.tagNamespace}:${a}`:a;if("title"===b&&!t.isSSR)return void(document.title=u);f&&u&&(m.innerHTML=u);const y=e(b,m,u||void 0);return{to:r.to,vnode:y}}function U({metainfo:t,slots:e},o,r,n){const s=e&&e[o];if(!s||!y(s))return r;const i={content:r,metainfo:t};if(n&&n.group){const{group:t,data:e}=n;i[t]=e}const c=s(i);if(c&&c.length){const{children:t}=c[0];return t?t.toString():""}return r}const z="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,_=(t=>z?Symbol("[vue-meta]: "+t):"[vue-meta]: "+t)("meta_active");function L(t,e,o){for(const r in e)r in o?S(t[r])?L(t[r],e[r],o[r]):e[r]!==o[r]&&(t[r]=e[r]):t[r]=e[r];for(const r in o)e&&r in e||delete t[r]}function q(t){if(t||(t=o()||void 0),t)return t.appContext.config.globalProperties.$metaManager}function B(t,e){const s=o()||void 0;if(!e&&s&&(e=q(s)),!e)throw new Error("No manager or current instance");r(t)&&(n(t,((t,e)=>{L(i.meta,t,e)})),t=t.value);const i=e.addMeta(t,s);return i}function I(){return s(_)}const T=i({name:"Metainfo",inheritAttrs:!1,setup:(t,{slots:e})=>()=>{const t=q();if(t)return t.render({slots:e})}});function D(t,e,o,r){const n=g(r)?r:[r];t?o.endsWith("Attrs")||n.forEach((t=>{t.props||(t.props={}),t.props["data-vm-ssr"]=!0})):n.forEach(((t,e)=>{t.type===l&&n.splice(e,1)})),e[o]||(e[o]=[]),e[o].push(...n)}const H=(t=!1,e,o)=>J.create(t,e||b,o||m);class J{isSSR=!1;config;target;resolver;ssrCleanedUp=!1;constructor(t,e,o,r){this.isSSR=t,this.config=e,this.target=o,r&&"setup"in r&&y(r.setup)&&(this.resolver=r)}static create=(t,e,o)=>{const r=((t,e)=>{const o=[],r={active:e,resolve:t,sources:o},n=()=>$(r);return{context:r,compute:n,addSource:(t,e,o=!1)=>{const s=P(r,t,e||{});return o&&n(),s},delSource:(t,e=!0)=>{const r=o.findIndex((e=>e===t||e[R]===t));return r>-1&&(o.splice(r,1),e&&n(),!0)}}})(((t,e,r,n,s)=>y(o)?o(t,e,r,n,s):o.resolve(t,e,r,n,s)),c({}));return new J(t,e,r,o)};install(t){t.component("Metainfo",T),t.config.globalProperties.$metaManager=this,t.provide(_,this.target.context.active)}addMeta(t,e){e||(e=o()||void 0);const r={removed:[]},n={vm:e},{resolver:s}=this;s&&s.setup&&s.setup(n);const i=this.target.addSource(t,n,!0),c=t=>this.unmount(!!t,i,r,e);return e&&a(c),{meta:i,onRemoved:t=>r.removed.push(t),unmount:c}}unmount(t,e,o,r){if(r){const{$el:n}=r.proxy;if(n&&n.offsetParent){let r=new MutationObserver((s=>{for(const{removedNodes:i}of s)i&&i.forEach((s=>{s===n&&r&&(r.disconnect(),r=void 0,this.reallyUnmount(t,e,o))}))}));return void r.observe(n.parentNode,{childList:!0})}}this.reallyUnmount(t,e,o)}async reallyUnmount(t,e,o){this.target.delSource(e),!t&&o&&await Promise.all(o.removed.map((t=>t())))}render({slots:t}={}){const o=this.target.context.active,{isSSR:r}=this;if(!r&&!this.ssrCleanedUp){this.ssrCleanedUp=!0;const t=()=>{const t=document.querySelectorAll("[data-vm-ssr]");t&&t.length&&t.forEach((t=>t.parentNode&&t.parentNode.removeChild(t)))};"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t,{once:!0}):t()}const n={};for(const e in o){const s=this.config[e]||{};let i=F({isSSR:r,metainfo:o,slots:t},e,o[e],s);if(!i)continue;g(i)||(i=[i]);let c="base"!==e&&o[e].to;!c&&"to"in s&&(c=s.to),!c&&"attributesFor"in s&&(c=e);for(const{to:t,vnode:e}of i)D(this.isSSR,n,t||c||"head",e)}if(t)for(const e in t){const r="default"===e?"head":e;if("head"!==r&&"body"!==r)continue;const s=t[e];y(s)&&D(this.isSSR,n,r,s({metainfo:o}))}return Object.keys(n).map((t=>e(u,{to:t},n[t])))}}const W={keyName:"metaInfo"},G=t=>({created(){const e=o();if(!e?.type||!(t.keyName in e.type))return;const r=e.type[t.keyName];if(y(r)){B(f(r.bind(this)))}else B(r)}}),K=(t,e={})=>{const o=Object.assign({},W,e);t.mixin(G(o))};export{H as createMetaManager,m as deepestResolver,b as defaultConfig,q as getCurrentManager,K as plugin,d as resolveOption,I as useActiveMeta,B as useMeta};
/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -960,3 +960,3 @@ * - All the amazing contributors

if (isFunction(metaInfo)) {
const computedMetaInfo = computed(metaInfo);
const computedMetaInfo = computed(metaInfo.bind(this));
useMeta(computedMetaInfo);

@@ -963,0 +963,0 @@ }

/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -961,3 +961,3 @@ * - All the amazing contributors

if (isFunction(metaInfo)) {
const computedMetaInfo = vue.computed(metaInfo);
const computedMetaInfo = vue.computed(metaInfo.bind(this));
useMeta(computedMetaInfo);

@@ -964,0 +964,0 @@ }

/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -8,2 +8,2 @@ * - All the amazing contributors

*/
var VueMeta=function(t,e){"use strict";const r=(t,e)=>(r,n)=>{let o=-1;if(n.reduce(((e,r,n)=>{const s=t(e,r);return s!==e?(o=n,s):e}),e),o>-1)return r[o]},n=r(((t,e)=>{const{depth:r}=e;return!t||r>t?r:t}));var o=Object.freeze({__proto__:null,setup:t=>{let e=0;if(t.vm){let{vm:r}=t;do{r.parent&&(e++,r=r.parent)}while(r&&r.parent&&r!==r.root)}t.depth=e},resolve:n});const s={body:{tag:"script",to:"body"},base:{valueAttribute:"href"},charset:{tag:"meta",nameless:!0,valueAttribute:"charset"},description:{tag:"meta"},og:{group:!0,namespacedAttribute:!0,tag:"meta",keyAttribute:"property"},twitter:{group:!0,namespacedAttribute:!0,tag:"meta"},htmlAttrs:{attributesFor:"html"},headAttrs:{attributesFor:"head"},bodyAttrs:{attributesFor:"body"}},i={title:{attributes:!1},base:{contentAsAttribute:!0,attributes:["href","target"]},meta:{contentAsAttribute:!0,keyAttribute:"name",attributes:["content","name","http-equiv","charset"]},link:{contentAsAttribute:!0,attributes:["href","crossorigin","rel","media","integrity","hreflang","type","referrerpolicy","sizes","imagesrcset","imagesizes","as","color"]},style:{attributes:["media"]},script:{attributes:["src","type","nomodule","async","defer","crossorigin","integrity","referrerpolicy"]},noscript:{attributes:!1}};Object.freeze({}),Object.freeze([]);const c=Array.isArray,a=t=>"function"==typeof t,u=t=>"string"==typeof t,l=t=>null!==t&&"object"==typeof t,f=Object.prototype.toString,d=t=>"[object Object]"===f.call(t),p=Symbol("kIsProxy"),m=Symbol("kProxySources"),g=Symbol("kProxyTarget"),h=Symbol("kResolveContext");function b(t){if(c(t))return t.map(b);if(l(t)){const e={};for(const r in t)e[r]="context"===r?t[r]:b(t[r]);return e}return t}const y=(t,e,r)=>{const n=[];for(const o of t)o&&e in o&&(n.push(o[e]),r&&r(o));return n},v=(t,e=[],r,n)=>{if(!r&&!n&&(({active:r,sources:n}=t),e.length))for(let t=0;t<e.length;t++){const o=e[t];if(!r||!r[o])return void console.error(`recompute: segment ${o} not found on target`,e,r);r=r[o],n=n.map((t=>t[o])).filter(Boolean)}if(!r||!n)return;const o=((t,...e)=>{const r=t?Object.keys(t):[];if(e)for(const t of e)if(t&&l(t))for(const e in t)r.includes(e)||r.push(e);return r})(...n),s=Object.keys(r);for(const t of s)o.includes(t)||delete r[t];for(const s of o){let o=!1;for(let t=0;t<n.length;t++){const e=n[t];if(e&&s in e&&void 0!==e[s]){o=d(e[s]);break}}if(o){r[s]||(r[s]={});const o=[];for(const t of n)s in t&&o.push(t[s]);v(t,[...e,s],r[s],o);continue}!r[s]&&c(n[0][s])&&(r[s]=[]);const i=[],a=y(n,s,(t=>i.push(t[h])));let u=t.resolve(a,i,r[s],s,e);d(u)&&(u=b(u)),r[s]=u}},S=(t,r,n,o=[])=>{const s=A(t,n,o),i=e.markRaw(new Proxy(r,s));return!o.length&&t.sources&&t.sources.push(i),i},A=(t,e,r=[])=>({get:(n,o,s)=>{if(o===p)return!0;if(o===m)return t.sources;if(o===g)return n;if(o===h)return e;let i=Reflect.get(n,o,s);if(!l(i))return i;if(!i[p]){const s=[...r,o];i=S(t,i,e,s),Reflect.set(n,o,i)}return i},set:(e,n,o)=>{const s=Reflect.set(e,n,o);if(s){const i=c(e);let a,u=!1,{sources:l,active:f}=t,p=0;for(const t of r){if(l=y(l,t),i&&p===r.length-1){a=t;break}c(f)&&(u=!0),f=f[t],p++}if(u)return v(t),s;if(d(o))return v(t,r),s;let m,g=[];i?(m=l,g=l.map((t=>t[h]))):m=y(l,n,(t=>g.push(t[h])));let S=t.resolve(m,g,f,n,r);d(S)&&(S=b(S)),i&&a?f[a]=S:f[n]=S}return s},deleteProperty:(e,n)=>{const o=Reflect.deleteProperty(e,n);if(o){const o=c(e);let s,i=t.sources,a=t.active,u=0;for(const t of r){if(i=i.map((e=>e&&e[t])),o&&u===r.length-1){s=t;break}a=a[t],u++}if(i.some((t=>t&&n in t))){let e,c=[];o?(e=i,c=i.map((t=>t[h]))):e=y(i,n,(t=>c.push(t[h])));let u=t.resolve(e,c,a,n,r);d(u)&&(u=b(u)),o&&s?a[s]=u:a[n]=u}else delete a[n]}return o}}),k={};function j(t,r,n,o){return"attributesFor"in o?function(t,r,n,o){const{attributesFor:s}=o;if(!s||!n)return;if(t.isSSR)return{to:"",vnode:e.h(`ssr-${s}`,n)};if(!k[s]){const[t,e]=Array.from(document.querySelectorAll(s));if(!t)return void console.error("Could not find element for selector",s,", won't render attributes");e&&console.warn("Found multiple elements for selector",s),k[s]={el:t,attrs:[]}}const{el:i,attrs:a}=k[s];for(const e in n){let o=w(t,`${r}(${e})`,n[e],n);c(o)&&(o=o.join(",")),i.setAttribute(e,o||""),a.includes(e)||a.push(e)}const u=a.filter((t=>!n[t]));for(const t of u)i.removeAttribute(t)}(t,r,n,o):"group"in o?function(t,e,r,n){if(c(r))return console.warn("Specifying an array for group properties isnt supported"),[];return Object.keys(r).map((o=>{const s={group:e,data:r};if(n.namespaced)s.tagNamespace=!0===n.namespaced?e:n.namespaced;else if(n.namespacedAttribute){const t=!0===n.namespacedAttribute?e:n.namespacedAttribute;s.fullName=`${t}:${o}`,s.slotName=`${t}(${o})`}return C(t,e,r[o],n,s)})).filter(Boolean).flat()}(t,r,n,o):C(t,r,n,o)}function C(t,r,n,o={},s){const a=["content","json","rawContent"],l=t=>function(t,e){for(const r of t){const t=i[r];if(r&&t)return t[e]}}([f,o.tag],t);if(c(n))return n.map((e=>C(t,r,e,o,s))).filter(Boolean).flat();const{tag:f=o.tag||r}=n;let d="",p=!1,m=!1;if(u(n))d=n;else if(n.children&&c(n.children))p=!0,d=n.children.map((e=>{const n=C(t,r,e,o,s);return c(n)?n.map((({vnode:t})=>t)):n&&n.vnode}));else{let t=0;for(const e of a){if(!d&&n[e]){d=1===t?JSON.stringify(n[e]):n[e],m=t>1;break}t++}}const g=s&&s.fullName||r,h=s&&s.slotName||r;let{attrs:b}=n;if(b||"object"!=typeof n)b||(b={});else{b={...n},delete b.tag,delete b.children,delete b.to;for(const t of a)delete b[t]}if(p)d=w(t,h,d,n);else{const e=!!l("contentAsAttribute");let{valueAttribute:r}=o;if(!r&&e){const[t]=l("attributes");r=u(e)?e:t}if(r){const{nameless:e}=o;if(!e){const t=o.keyAttribute||l("keyAttribute");t&&(b[t]=g)}b[r]=w(t,h,b[r]||d,s),d=""}else d=w(t,h,d,n)}const y=s&&s.tagNamespace?`${s.tagNamespace}:${f}`:f;if("title"===y&&!t.isSSR)return void(document.title=d);m&&d&&(b.innerHTML=d);const v=e.h(y,b,d||void 0);return{to:n.to,vnode:v}}function w({metainfo:t,slots:e},r,n,o){const s=e&&e[r];if(!s||!a(s))return n;const i={content:n,metainfo:t};if(o&&o.group){const{group:t,data:e}=o;i[t]=e}const c=s(i);if(c&&c.length){const{children:t}=c[0];return t?t.toString():""}return n}const M="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,N=(t=>M?Symbol("[vue-meta]: "+t):"[vue-meta]: "+t)("meta_active");function R(t,e,r){for(const n in e)n in r?l(t[n])?R(t[n],e[n],r[n]):e[n]!==r[n]&&(t[n]=e[n]):t[n]=e[n];for(const n in r)e&&n in e||delete t[n]}function O(t){if(t||(t=e.getCurrentInstance()||void 0),t)return t.appContext.config.globalProperties.$metaManager}function x(t,r){const n=e.getCurrentInstance()||void 0;if(!r&&n&&(r=O(n)),!r)throw new Error("No manager or current instance");e.isProxy(t)&&(e.watch(t,((t,e)=>{R(o.meta,t,e)})),t=t.value);const o=r.addMeta(t,n);return o}const $=e.defineComponent({name:"Metainfo",inheritAttrs:!1,setup:(t,{slots:e})=>()=>{const t=O();if(t)return t.render({slots:e})}}),P="data-vm-ssr";function F(t,r,n,o){const s=c(o)?o:[o];t?n.endsWith("Attrs")||s.forEach((t=>{t.props||(t.props={}),t.props[P]=!0})):s.forEach(((t,r)=>{t.type===e.Comment&&s.splice(r,1)})),r[n]||(r[n]=[]),r[n].push(...s)}class I{isSSR=!1;config;target;resolver;ssrCleanedUp=!1;constructor(t,e,r,n){this.isSSR=t,this.config=e,this.target=r,n&&"setup"in n&&a(n.setup)&&(this.resolver=n)}static create=(t,r,n)=>{const o=((t,e)=>{const r=[],n={active:e,resolve:t,sources:r},o=()=>v(n);return{context:n,compute:o,addSource:(t,e,r=!1)=>{const s=S(n,t,e||{});return r&&o(),s},delSource:(t,e=!0)=>{const n=r.findIndex((e=>e===t||e[g]===t));return n>-1&&(r.splice(n,1),e&&o(),!0)}}})(((t,e,r,o,s)=>a(n)?n(t,e,r,o,s):n.resolve(t,e,r,o,s)),e.reactive({}));return new I(t,r,o,n)};install(t){t.component("Metainfo",$),t.config.globalProperties.$metaManager=this,t.provide(N,this.target.context.active)}addMeta(t,r){r||(r=e.getCurrentInstance()||void 0);const n={removed:[]},o={vm:r},{resolver:s}=this;s&&s.setup&&s.setup(o);const i=this.target.addSource(t,o,!0),c=t=>this.unmount(!!t,i,n,r);return r&&e.onUnmounted(c),{meta:i,onRemoved:t=>n.removed.push(t),unmount:c}}unmount(t,e,r,n){if(n){const{$el:o}=n.proxy;if(o&&o.offsetParent){let n=new MutationObserver((s=>{for(const{removedNodes:i}of s)i&&i.forEach((s=>{s===o&&n&&(n.disconnect(),n=void 0,this.reallyUnmount(t,e,r))}))}));return void n.observe(o.parentNode,{childList:!0})}}this.reallyUnmount(t,e,r)}async reallyUnmount(t,e,r){this.target.delSource(e),!t&&r&&await Promise.all(r.removed.map((t=>t())))}render({slots:t}={}){const r=this.target.context.active,{isSSR:n}=this;if(!n&&!this.ssrCleanedUp){this.ssrCleanedUp=!0;const t=()=>{const t=document.querySelectorAll("[data-vm-ssr]");t&&t.length&&t.forEach((t=>t.parentNode&&t.parentNode.removeChild(t)))};"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t,{once:!0}):t()}const o={};for(const e in r){const s=this.config[e]||{};let i=j({isSSR:n,metainfo:r,slots:t},e,r[e],s);if(!i)continue;c(i)||(i=[i]);let a="base"!==e&&r[e].to;!a&&"to"in s&&(a=s.to),!a&&"attributesFor"in s&&(a=e);for(const{to:t,vnode:e}of i)F(this.isSSR,o,t||a||"head",e)}if(t)for(const e in t){const n="default"===e?"head":e;if("head"!==n&&"body"!==n)continue;const s=t[e];a(s)&&F(this.isSSR,o,n,s({metainfo:r}))}return Object.keys(o).map((t=>e.h(e.Teleport,{to:t},o[t])))}}const U={keyName:"metaInfo"};return t.createMetaManager=(t=!1,e,r)=>I.create(t,e||s,r||o),t.deepestResolver=o,t.defaultConfig=s,t.getCurrentManager=O,t.plugin=(t,r={})=>{const n=Object.assign({},U,r);t.mixin((t=>({created(){const r=e.getCurrentInstance();if(!r?.type||!(t.keyName in r.type))return;const n=r.type[t.keyName];a(n)?x(e.computed(n)):x(n)}}))(n))},t.resolveOption=r,t.useActiveMeta=function(){return e.inject(N)},t.useMeta=x,Object.defineProperty(t,"__esModule",{value:!0}),t}({},Vue);
var VueMeta=function(t,e){"use strict";const r=(t,e)=>(r,n)=>{let o=-1;if(n.reduce(((e,r,n)=>{const s=t(e,r);return s!==e?(o=n,s):e}),e),o>-1)return r[o]},n=r(((t,e)=>{const{depth:r}=e;return!t||r>t?r:t}));var o=Object.freeze({__proto__:null,setup:t=>{let e=0;if(t.vm){let{vm:r}=t;do{r.parent&&(e++,r=r.parent)}while(r&&r.parent&&r!==r.root)}t.depth=e},resolve:n});const s={body:{tag:"script",to:"body"},base:{valueAttribute:"href"},charset:{tag:"meta",nameless:!0,valueAttribute:"charset"},description:{tag:"meta"},og:{group:!0,namespacedAttribute:!0,tag:"meta",keyAttribute:"property"},twitter:{group:!0,namespacedAttribute:!0,tag:"meta"},htmlAttrs:{attributesFor:"html"},headAttrs:{attributesFor:"head"},bodyAttrs:{attributesFor:"body"}},i={title:{attributes:!1},base:{contentAsAttribute:!0,attributes:["href","target"]},meta:{contentAsAttribute:!0,keyAttribute:"name",attributes:["content","name","http-equiv","charset"]},link:{contentAsAttribute:!0,attributes:["href","crossorigin","rel","media","integrity","hreflang","type","referrerpolicy","sizes","imagesrcset","imagesizes","as","color"]},style:{attributes:["media"]},script:{attributes:["src","type","nomodule","async","defer","crossorigin","integrity","referrerpolicy"]},noscript:{attributes:!1}};Object.freeze({}),Object.freeze([]);const c=Array.isArray,a=t=>"function"==typeof t,u=t=>"string"==typeof t,l=t=>null!==t&&"object"==typeof t,f=Object.prototype.toString,d=t=>"[object Object]"===f.call(t),p=Symbol("kIsProxy"),m=Symbol("kProxySources"),g=Symbol("kProxyTarget"),h=Symbol("kResolveContext");function b(t){if(c(t))return t.map(b);if(l(t)){const e={};for(const r in t)e[r]="context"===r?t[r]:b(t[r]);return e}return t}const y=(t,e,r)=>{const n=[];for(const o of t)o&&e in o&&(n.push(o[e]),r&&r(o));return n},v=(t,e=[],r,n)=>{if(!r&&!n&&(({active:r,sources:n}=t),e.length))for(let t=0;t<e.length;t++){const o=e[t];if(!r||!r[o])return void console.error(`recompute: segment ${o} not found on target`,e,r);r=r[o],n=n.map((t=>t[o])).filter(Boolean)}if(!r||!n)return;const o=((t,...e)=>{const r=t?Object.keys(t):[];if(e)for(const t of e)if(t&&l(t))for(const e in t)r.includes(e)||r.push(e);return r})(...n),s=Object.keys(r);for(const t of s)o.includes(t)||delete r[t];for(const s of o){let o=!1;for(let t=0;t<n.length;t++){const e=n[t];if(e&&s in e&&void 0!==e[s]){o=d(e[s]);break}}if(o){r[s]||(r[s]={});const o=[];for(const t of n)s in t&&o.push(t[s]);v(t,[...e,s],r[s],o);continue}!r[s]&&c(n[0][s])&&(r[s]=[]);const i=[],a=y(n,s,(t=>i.push(t[h])));let u=t.resolve(a,i,r[s],s,e);d(u)&&(u=b(u)),r[s]=u}},S=(t,r,n,o=[])=>{const s=A(t,n,o),i=e.markRaw(new Proxy(r,s));return!o.length&&t.sources&&t.sources.push(i),i},A=(t,e,r=[])=>({get:(n,o,s)=>{if(o===p)return!0;if(o===m)return t.sources;if(o===g)return n;if(o===h)return e;let i=Reflect.get(n,o,s);if(!l(i))return i;if(!i[p]){const s=[...r,o];i=S(t,i,e,s),Reflect.set(n,o,i)}return i},set:(e,n,o)=>{const s=Reflect.set(e,n,o);if(s){const i=c(e);let a,u=!1,{sources:l,active:f}=t,p=0;for(const t of r){if(l=y(l,t),i&&p===r.length-1){a=t;break}c(f)&&(u=!0),f=f[t],p++}if(u)return v(t),s;if(d(o))return v(t,r),s;let m,g=[];i?(m=l,g=l.map((t=>t[h]))):m=y(l,n,(t=>g.push(t[h])));let S=t.resolve(m,g,f,n,r);d(S)&&(S=b(S)),i&&a?f[a]=S:f[n]=S}return s},deleteProperty:(e,n)=>{const o=Reflect.deleteProperty(e,n);if(o){const o=c(e);let s,i=t.sources,a=t.active,u=0;for(const t of r){if(i=i.map((e=>e&&e[t])),o&&u===r.length-1){s=t;break}a=a[t],u++}if(i.some((t=>t&&n in t))){let e,c=[];o?(e=i,c=i.map((t=>t[h]))):e=y(i,n,(t=>c.push(t[h])));let u=t.resolve(e,c,a,n,r);d(u)&&(u=b(u)),o&&s?a[s]=u:a[n]=u}else delete a[n]}return o}}),k={};function j(t,r,n,o){return"attributesFor"in o?function(t,r,n,o){const{attributesFor:s}=o;if(!s||!n)return;if(t.isSSR)return{to:"",vnode:e.h(`ssr-${s}`,n)};if(!k[s]){const[t,e]=Array.from(document.querySelectorAll(s));if(!t)return void console.error("Could not find element for selector",s,", won't render attributes");e&&console.warn("Found multiple elements for selector",s),k[s]={el:t,attrs:[]}}const{el:i,attrs:a}=k[s];for(const e in n){let o=w(t,`${r}(${e})`,n[e],n);c(o)&&(o=o.join(",")),i.setAttribute(e,o||""),a.includes(e)||a.push(e)}const u=a.filter((t=>!n[t]));for(const t of u)i.removeAttribute(t)}(t,r,n,o):"group"in o?function(t,e,r,n){if(c(r))return console.warn("Specifying an array for group properties isnt supported"),[];return Object.keys(r).map((o=>{const s={group:e,data:r};if(n.namespaced)s.tagNamespace=!0===n.namespaced?e:n.namespaced;else if(n.namespacedAttribute){const t=!0===n.namespacedAttribute?e:n.namespacedAttribute;s.fullName=`${t}:${o}`,s.slotName=`${t}(${o})`}return C(t,e,r[o],n,s)})).filter(Boolean).flat()}(t,r,n,o):C(t,r,n,o)}function C(t,r,n,o={},s){const a=["content","json","rawContent"],l=t=>function(t,e){for(const r of t){const t=i[r];if(r&&t)return t[e]}}([f,o.tag],t);if(c(n))return n.map((e=>C(t,r,e,o,s))).filter(Boolean).flat();const{tag:f=o.tag||r}=n;let d="",p=!1,m=!1;if(u(n))d=n;else if(n.children&&c(n.children))p=!0,d=n.children.map((e=>{const n=C(t,r,e,o,s);return c(n)?n.map((({vnode:t})=>t)):n&&n.vnode}));else{let t=0;for(const e of a){if(!d&&n[e]){d=1===t?JSON.stringify(n[e]):n[e],m=t>1;break}t++}}const g=s&&s.fullName||r,h=s&&s.slotName||r;let{attrs:b}=n;if(b||"object"!=typeof n)b||(b={});else{b={...n},delete b.tag,delete b.children,delete b.to;for(const t of a)delete b[t]}if(p)d=w(t,h,d,n);else{const e=!!l("contentAsAttribute");let{valueAttribute:r}=o;if(!r&&e){const[t]=l("attributes");r=u(e)?e:t}if(r){const{nameless:e}=o;if(!e){const t=o.keyAttribute||l("keyAttribute");t&&(b[t]=g)}b[r]=w(t,h,b[r]||d,s),d=""}else d=w(t,h,d,n)}const y=s&&s.tagNamespace?`${s.tagNamespace}:${f}`:f;if("title"===y&&!t.isSSR)return void(document.title=d);m&&d&&(b.innerHTML=d);const v=e.h(y,b,d||void 0);return{to:n.to,vnode:v}}function w({metainfo:t,slots:e},r,n,o){const s=e&&e[r];if(!s||!a(s))return n;const i={content:n,metainfo:t};if(o&&o.group){const{group:t,data:e}=o;i[t]=e}const c=s(i);if(c&&c.length){const{children:t}=c[0];return t?t.toString():""}return n}const M="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,N=(t=>M?Symbol("[vue-meta]: "+t):"[vue-meta]: "+t)("meta_active");function R(t,e,r){for(const n in e)n in r?l(t[n])?R(t[n],e[n],r[n]):e[n]!==r[n]&&(t[n]=e[n]):t[n]=e[n];for(const n in r)e&&n in e||delete t[n]}function O(t){if(t||(t=e.getCurrentInstance()||void 0),t)return t.appContext.config.globalProperties.$metaManager}function x(t,r){const n=e.getCurrentInstance()||void 0;if(!r&&n&&(r=O(n)),!r)throw new Error("No manager or current instance");e.isProxy(t)&&(e.watch(t,((t,e)=>{R(o.meta,t,e)})),t=t.value);const o=r.addMeta(t,n);return o}const $=e.defineComponent({name:"Metainfo",inheritAttrs:!1,setup:(t,{slots:e})=>()=>{const t=O();if(t)return t.render({slots:e})}}),P="data-vm-ssr";function F(t,r,n,o){const s=c(o)?o:[o];t?n.endsWith("Attrs")||s.forEach((t=>{t.props||(t.props={}),t.props[P]=!0})):s.forEach(((t,r)=>{t.type===e.Comment&&s.splice(r,1)})),r[n]||(r[n]=[]),r[n].push(...s)}class I{isSSR=!1;config;target;resolver;ssrCleanedUp=!1;constructor(t,e,r,n){this.isSSR=t,this.config=e,this.target=r,n&&"setup"in n&&a(n.setup)&&(this.resolver=n)}static create=(t,r,n)=>{const o=((t,e)=>{const r=[],n={active:e,resolve:t,sources:r},o=()=>v(n);return{context:n,compute:o,addSource:(t,e,r=!1)=>{const s=S(n,t,e||{});return r&&o(),s},delSource:(t,e=!0)=>{const n=r.findIndex((e=>e===t||e[g]===t));return n>-1&&(r.splice(n,1),e&&o(),!0)}}})(((t,e,r,o,s)=>a(n)?n(t,e,r,o,s):n.resolve(t,e,r,o,s)),e.reactive({}));return new I(t,r,o,n)};install(t){t.component("Metainfo",$),t.config.globalProperties.$metaManager=this,t.provide(N,this.target.context.active)}addMeta(t,r){r||(r=e.getCurrentInstance()||void 0);const n={removed:[]},o={vm:r},{resolver:s}=this;s&&s.setup&&s.setup(o);const i=this.target.addSource(t,o,!0),c=t=>this.unmount(!!t,i,n,r);return r&&e.onUnmounted(c),{meta:i,onRemoved:t=>n.removed.push(t),unmount:c}}unmount(t,e,r,n){if(n){const{$el:o}=n.proxy;if(o&&o.offsetParent){let n=new MutationObserver((s=>{for(const{removedNodes:i}of s)i&&i.forEach((s=>{s===o&&n&&(n.disconnect(),n=void 0,this.reallyUnmount(t,e,r))}))}));return void n.observe(o.parentNode,{childList:!0})}}this.reallyUnmount(t,e,r)}async reallyUnmount(t,e,r){this.target.delSource(e),!t&&r&&await Promise.all(r.removed.map((t=>t())))}render({slots:t}={}){const r=this.target.context.active,{isSSR:n}=this;if(!n&&!this.ssrCleanedUp){this.ssrCleanedUp=!0;const t=()=>{const t=document.querySelectorAll("[data-vm-ssr]");t&&t.length&&t.forEach((t=>t.parentNode&&t.parentNode.removeChild(t)))};"loading"===document.readyState?window.addEventListener("DOMContentLoaded",t,{once:!0}):t()}const o={};for(const e in r){const s=this.config[e]||{};let i=j({isSSR:n,metainfo:r,slots:t},e,r[e],s);if(!i)continue;c(i)||(i=[i]);let a="base"!==e&&r[e].to;!a&&"to"in s&&(a=s.to),!a&&"attributesFor"in s&&(a=e);for(const{to:t,vnode:e}of i)F(this.isSSR,o,t||a||"head",e)}if(t)for(const e in t){const n="default"===e?"head":e;if("head"!==n&&"body"!==n)continue;const s=t[e];a(s)&&F(this.isSSR,o,n,s({metainfo:r}))}return Object.keys(o).map((t=>e.h(e.Teleport,{to:t},o[t])))}}const U={keyName:"metaInfo"},_=t=>({created(){const r=e.getCurrentInstance();if(!r?.type||!(t.keyName in r.type))return;const n=r.type[t.keyName];if(a(n)){x(e.computed(n.bind(this)))}else x(n)}});return t.createMetaManager=(t=!1,e,r)=>I.create(t,e||s,r||o),t.deepestResolver=o,t.defaultConfig=s,t.getCurrentManager=O,t.plugin=(t,e={})=>{const r=Object.assign({},U,e);t.mixin(_(r))},t.resolveOption=r,t.useActiveMeta=function(){return e.inject(N)},t.useMeta=x,Object.defineProperty(t,"__esModule",{value:!0}),t}({},Vue);
{
"name": "vue-meta",
"version": "3.0.0-alpha.9",
"version": "3.0.0-alpha.10",
"description": "Manage HTML metadata in Vue.js components with SSR support",

@@ -59,20 +59,20 @@ "main": "dist/vue-meta.cjs.js",

"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/plugin-transform-modules-commonjs": "^7.14.0",
"@babel/preset-typescript": "^7.13.0",
"@babel/core": "^7.14.8",
"@babel/plugin-transform-modules-commonjs": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@nuxtjs/eslint-config-typescript": "^6.0.1",
"@rollup/plugin-alias": "^3.1.2",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.4.2",
"@types/jest": "^26.0.23",
"@rollup/plugin-alias": "^3.1.5",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@rollup/plugin-replace": "^3.0.0",
"@types/jest": "^26.0.24",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.16.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"@vue/compiler-sfc": "^3.0.11",
"@vue/server-renderer": "^3.0.11",
"@types/webpack-env": "^1.16.2",
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.5",
"@vue/compiler-sfc": "^3.1.5",
"@vue/server-renderer": "^3.1.5",
"@vue/test-utils": "^2.0.0-rc.6",
"@wishy-gift/html-include-chunks-webpack-plugin": "^1.0.1",
"babel-jest": "^27.0.2",
"babel-jest": "^27.0.6",
"babel-loader": "^8.2.2",

@@ -85,29 +85,29 @@ "babel-plugin-dynamic-import-node": "^2.3.3",

"browserstack-local": "^1.4.8",
"chromedriver": "^91.0.0",
"codecov": "^3.8.2",
"chromedriver": "^92.0.0",
"codecov": "^3.8.3",
"consola": "^2.15.3",
"eslint": "^7.28.0",
"eslint": "^7.32.0",
"express-urlrewrite": "^1.4.0",
"geckodriver": "^2.0.0",
"html-webpack-plugin": "^5.3.1",
"jest": "^27.0.4",
"jest-environment-jsdom": "^27.0.3",
"geckodriver": "^2.0.1",
"html-webpack-plugin": "^5.3.2",
"jest": "^27.0.6",
"jest-environment-jsdom": "^27.0.6",
"jest-environment-jsdom-global": "^2.0.4",
"jiti": "^1.10.1",
"jiti": "^1.11.0",
"jsdom": "^16.6.0",
"lodash": "^4.17.21",
"node-env-file": "^0.1.8",
"puppeteer-core": "^10.0.0",
"puppeteer-core": "^10.1.0",
"rimraf": "^3.0.2",
"rollup": "^2.51.0",
"rollup": "^2.55.1",
"rollup-plugin-dts": "^3.0.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"selenium-webdriver": "^4.0.0-beta.3",
"standard-version": "^9.3.0",
"selenium-webdriver": "^4.0.0-beta.4",
"standard-version": "^9.3.1",
"tib": "^0.7.5",
"ts-jest": "^27.0.2",
"ts-loader": "^9.2.3",
"typescript": "^4.3.2",
"vite": "^2.3.6",
"ts-jest": "^27.0.4",
"ts-loader": "^9.2.4",
"typescript": "^4.3.5",
"vite": "^2.4.4",
"vue": "^3.0.6",

@@ -117,5 +117,5 @@ "vue-jest": "^5.0.0-alpha.9",

"vue-router": "^4.0.6",
"webpack": "^5.38.1",
"webpack": "^5.47.1",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.7.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^4.0.0-beta.2",

@@ -122,0 +122,0 @@ "webpackbar": "^4.0.0"

/**
* vue-meta v3.0.0-alpha.9
* (c) 2021
* vue-meta v3.0.0-alpha.10
* (c) 2022
* - Pim (@pimlie)

@@ -5,0 +5,0 @@ * - All the amazing contributors

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc