@i18n-micro/vue 1.3.9 → 1.3.11

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/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),B=require("@i18n-micro/core"),re=require("vue-router"),O=Symbol("i18n"),F=Symbol("i18n-locales"),q=Symbol("i18n-default-locale"),N=Symbol("i18n-router-strategy"),Y=l.defineComponent({name:"I18nGroup",props:{prefix:{type:String,required:!0},groupClass:{type:String,default:""}},setup(t,{slots:e}){const o=l.inject(O);if(!o)throw new Error("[i18n-micro] I18nGroup: i18n instance not found. Make sure i18n plugin is installed.");const a=(s,r)=>o.t(`${t.prefix}.${s}`,r,void 0,o.getRoute());return()=>l.h("div",{class:["i18n-group",t.groupClass]},e.default?.({prefix:t.prefix,t:a}))}}),ee=l.defineComponent({name:"I18nLink",props:{to:{type:[String,Object],required:!0},activeStyle:{type:Object,default:()=>({})},localeRoute:{type:Function,default:void 0}},setup(t,{slots:e}){const o=l.inject(O),a=l.inject(N,void 0);if(!o)throw new Error("[i18n-micro] I18nLink: i18n instance not found. Make sure i18n plugin is installed.");const s=l.computed(()=>typeof t.to=="string"?/^(?:https?:\/\/|\/\/|[a-zA-Z0-9-]+\.[a-zA-Z]{2,})|tel:|mailto:/.test(t.to):!1),r=l.computed(()=>{if(s.value)return t.to;if(t.localeRoute){const n=t.localeRoute(t.to);return typeof n=="string"?n:n.path||"/"}if(!a?.resolvePath)return typeof t.to=="string"?t.to:t.to.path||"/";const c=a.resolvePath(t.to,o.locale.value);return typeof c=="string"?c:c.path||"/"}),u=l.computed(()=>{if(s.value||!a)return!1;const c=a.getCurrentPath().replace(/\/$/,""),n=r.value.replace(/\/$/,"");return c===n}),f=l.computed(()=>u.value?t.activeStyle:{});return()=>s.value?l.h("a",{href:r.value,target:"_blank",rel:"noopener noreferrer",style:f.value},e.default?.()):a?.linkComponent?l.h(a.linkComponent,{to:r.value,style:f.value},{default:e.default}):l.h("a",{href:r.value,style:f.value,onClick:c=>{c.preventDefault(),a?a.push({path:r.value}):window.location.href=r.value}},e.default?.())}}),te=l.defineComponent({name:"I18nSwitcher",props:{customLabels:{type:Object,default:()=>({})},customWrapperStyle:{type:Object,default:()=>({})},customButtonStyle:{type:Object,default:()=>({})},customDropdownStyle:{type:Object,default:()=>({})},customItemStyle:{type:Object,default:()=>({})},customLinkStyle:{type:Object,default:()=>({})},customActiveLinkStyle:{type:Object,default:()=>({})},customDisabledLinkStyle:{type:Object,default:()=>({})},customIconStyle:{type:Object,default:()=>({})},locales:{type:Array,default:void 0},currentLocale:{type:[String,Function],default:void 0},getLocaleName:{type:Function,default:void 0},switchLocale:{type:Function,default:void 0},localeRoute:{type:Function,default:void 0}},setup(t,{slots:e}){const o=l.inject(O),a=l.inject(N,void 0),s=l.inject(F,void 0);if(!o)throw new Error("[i18n-micro] I18nSwitcher: i18n instance not found. Make sure i18n plugin is installed.");if(!s&&!t.locales)throw new Error("[i18n-micro] I18nSwitcher: locales not provided. Make sure app.provide(I18nLocalesKey, locales) is called or pass locales prop.");const r=l.computed(()=>t.locales||s||[]),u=l.computed(()=>r.value.filter(d=>!d.disabled)),f=l.computed(()=>t.currentLocale!==void 0?typeof t.currentLocale=="function"?t.currentLocale():t.currentLocale:o.locale.value),c=l.computed(()=>r.value.some(d=>d.code===f.value&&d.disabled)),n=l.computed(()=>t.getLocaleName?t.getLocaleName()||null:r.value.find(m=>m.code===o.locale.value)?.displayName||null),i=l.ref(!1),p=l.ref(null),v=d=>{d&&(d.stopPropagation(),d.preventDefault()),i.value=!i.value},L=d=>t.customLabels[d.code]||d.displayName||d.code,I=l.computed(()=>{const d=r.value.find(m=>m.code===f.value);return d?L(d):n.value||f.value}),w=async d=>{if(i.value=!1,await l.nextTick(),t.switchLocale){t.switchLocale(d);return}if(o.locale.value=d,!a)return;const m=a.getCurrentPath(),b=t.localeRoute?(()=>{const h=t.localeRoute(m,d);return typeof h=="string"?h:h.path||"/"})():a?.resolvePath?(()=>{const h=a.resolvePath(m,d);return typeof h=="string"?h:h.path||"/"})():m;a.push({path:b})},k={position:"relative",display:"inline-block",verticalAlign:"middle"},_={padding:"4px 12px",fontSize:"16px",cursor:"pointer",backgroundColor:"#fff",border:"1px solid #333",transition:"background-color 0.3s ease",display:"flex",alignItems:"center",justifyContent:"space-between"},j={position:"absolute",top:"100%",left:"0",zIndex:1e3,backgroundColor:"#fff",border:"1px solid #333",listStyle:"none",padding:"0",margin:"4px 0 0 0",minWidth:"150px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},x={margin:"0",padding:"0"},R={display:"block",padding:"8px 12px",color:"#333",textDecoration:"none",transition:"background-color 0.3s ease",cursor:"pointer"},z={fontWeight:"bold",color:"#007bff",cursor:"not-allowed"},V={marginLeft:"8px",display:"inline-block",transition:"transform 0.3s ease"},H={transform:"rotate(180deg)"},y=d=>d?Array.isArray(d)?d:[d]:[],T=d=>{if(!i.value)return;const m=d.target;if(!m||!p.value)return;const b=p.value.contains(m),h=m.closest(".i18n-switcher-button")!==null;!b&&!h&&(i.value=!1)};return l.onMounted(()=>{document.addEventListener("click",T)}),l.onUnmounted(()=>{document.removeEventListener("click",T)}),()=>{const d=[];e["before-button"]&&d.push(...y(e["before-button"]()));const m=[];if(e["before-selected-locale"]&&m.push(...y(e["before-selected-locale"]())),m.push(l.h("span",I.value)),e["after-selected-locale"]&&m.push(...y(e["after-selected-locale"]())),m.push(l.h("span",{style:{...V,...i.value?H:{},...t.customIconStyle}},"▼")),d.push(l.h("button",{class:"i18n-switcher-button",style:{..._,...t.customButtonStyle,...c.value?t.customDisabledLinkStyle:{}},onClick:b=>{b.preventDefault(),b.stopPropagation(),v(b)},type:"button",ariaHaspopup:!0,ariaExpanded:i.value},m)),e["before-dropdown"]&&d.push(...y(e["before-dropdown"]())),i.value){const b=[];e["before-dropdown-items"]&&b.push(...y(e["before-dropdown-items"]())),u.value.forEach(h=>{const M=[];e["before-item"]&&M.push(...y(e["before-item"]({locale:h})));const A=[];e["before-link-content"]&&A.push(...y(e["before-link-content"]({locale:h}))),A.push(L(h)),e["after-link-content"]&&A.push(...y(e["after-link-content"]({locale:h})));const U=typeof window<"u"?window.location.pathname:"/",W=t.localeRoute?t.localeRoute(U,h.code):a?.resolvePath?a.resolvePath(U,h.code):U,D=typeof W=="string"?W:W.path||"#",E=h.code===f.value;M.push(l.h("a",{class:`switcher-locale-${h.code}`,href:typeof D=="string"?D:"#",style:{...R,...E?z:{},...t.customLinkStyle,...E?t.customActiveLinkStyle:{}},onClick:K=>{K.preventDefault(),K.stopPropagation(),w(h.code)}},A)),e["after-item"]&&M.push(...y(e["after-item"]({locale:h}))),b.push(l.h("li",{key:h.code,style:{...x,...t.customItemStyle}},M))}),e["after-dropdown-items"]&&b.push(...y(e["after-dropdown-items"]())),d.push(l.h("ul",{class:"i18n-switcher-dropdown",style:{...j,...t.customDropdownStyle}},b))}return e["after-dropdown"]&&d.push(...y(e["after-dropdown"]())),l.h("div",{ref:p,class:"i18n-switcher-wrapper",style:{...k,...t.customWrapperStyle}},d)}}}),ne=l.defineComponent({name:"I18nT",props:{keypath:{type:String,required:!0},plural:{type:[Number,String]},tag:{type:String,default:"span"},params:{type:Object,default:()=>({})},defaultValue:{type:String,default:""},html:{type:Boolean,default:!1},hideIfEmpty:{type:Boolean,default:!1},customPluralRule:{type:Function,default:null},number:{type:[Number,String]},date:{type:[Date,String,Number]},relativeDate:{type:[Date,String,Number]}},setup(t,{slots:e,attrs:o}){const a=l.inject(O);if(!a)throw new Error("[i18n-micro] I18nT: i18n instance not found. Make sure i18n plugin is installed.");return()=>{const s={},r=a.getRoute();if(t.number!==void 0){const n=Number(t.number),i=a.tn(n),p=a.t(t.keypath,{number:i,...t.params},void 0,r);return l.h(t.tag,{...o,innerHTML:p})}if(t.date!==void 0){const n=a.td(t.date),i=a.t(t.keypath,{date:n,...t.params},void 0,r);return l.h(t.tag,{...o,innerHTML:i})}if(t.relativeDate!==void 0){const n=a.tdr(t.relativeDate),i=a.t(t.keypath,{relativeDate:n,...t.params},void 0,r);return l.h(t.tag,{...o,innerHTML:i})}if(t.plural!==void 0){const n=Number.parseInt(t.plural.toString(),10);if(t.customPluralRule){const i=t.customPluralRule(t.keypath,n,t.params,a.locale.value,(p,v,L)=>a.t(p,v,L,r));return l.h(t.tag,{...o,innerHTML:i||""})}else{const i=a.tc(t.keypath,{count:n,...t.params});return l.h(t.tag,{...o,innerHTML:i})}}const u=(a.t(t.keypath,{...t.params,...s},void 0,r)??"").toString();if(t.hideIfEmpty&&!u.trim())return t.defaultValue??null;if(t.html)return l.h(t.tag,{...o,innerHTML:u});if(e.default)return l.h(t.tag,o,e.default({translation:u}));const f=[];let c=0;for(const[n,i]of Object.entries(e)){if(n==="default")continue;const p=`{${n}}`,v=u.indexOf(p,c);v!==-1&&(v>c&&f.push(u.slice(c,v)),i&&f.push(l.h(i)),c=v+p.length)}return c<u.length&&f.push(u.slice(c)),e.default?l.h(t.tag,o,e.default({children:f})):f.length>0?l.h(t.tag,o,f):l.h(t.tag,o,u)}}});function Z(t){return t.iso?.trim()||String(t.code)}function Q(t){const e=t.match(/^([A-Za-z]{2,3})(?:[-_](.+))?$/);return e?{language:e[1],region:e[2]}:{language:t}}function le(t,e={}){const{hreflangBaseLanguage:o=!1}=e;if(!o)return t.map(u=>{const f=String(u.code);return{hreflang:Z(u),localeCode:f}});const a=new Map;for(const u of t){const f=String(u.code),c=Z(u),{language:n,region:i}=Q(c);n&&i&&!a.has(n)&&a.set(n,f),a.set(c,f)}const s=new Set,r=[];for(const u of t){const f=String(u.code),c=Z(u),{language:n,region:i}=Q(c);n&&i&&a.get(n)===f&&!s.has(n)&&(s.add(n),r.push({hreflang:n,localeCode:f})),s.has(c)||(s.add(c),r.push({hreflang:c,localeCode:f}))}return r}function J(t){const e=t.og?.trim();if(e)return e;const o=t.iso?.trim();if(!o)return null;const a=o.indexOf("_");if(a>0){const r=o.slice(0,a),u=o.slice(a+1);if(r.length>=2&&u.length===2)return`${r.toLowerCase()}_${u.toUpperCase()}`}const s=o.indexOf("-");if(s>0){const r=o.slice(0,s),u=o.slice(s+1);if(r.length>=2&&u.length===2&&/^[A-Za-z]{2}$/.test(u))return`${r.toLowerCase()}_${u.toUpperCase()}`}return null}function X(t,e={}){if(J(t)!==null||e.missingWarn===!1||process.env.NODE_ENV==="production")return;const o=e.tag??"og:locale",a=String(t.code??"unknown"),s=t.iso?`, iso: '${t.iso}'`:"";console.warn(`[i18n] Cannot derive ${o} for locale '${a}'${s}. Set locale.og (e.g. 'en_US') or use iso with a 2-letter region (e.g. 'en-US').`)}function oe(t){const e=l.inject(O),o=l.inject(N,void 0),a=l.inject(F,void 0),s=l.inject(q,void 0);if(!e)throw new Error("[i18n-micro] useI18n() must be called after app.use(i18n). Make sure i18n plugin is installed.");if(!a)throw new Error("[i18n-micro] I18nLocalesKey not provided. Make sure app.provide(I18nLocalesKey, locales) is called.");if(!s)throw new Error("[i18n-micro] I18nDefaultLocaleKey not provided. Make sure app.provide(I18nDefaultLocaleKey, defaultLocale) is called.");const r=t?.locales||a,u=t?.defaultLocale||s,f=(c,n)=>o?.resolvePath?o.resolvePath(c,n||e.locale.value):c;return{instance:e,locale:l.computed({get:()=>e.locale.value,set:c=>{e.locale.value=c}}),getLocales:()=>r,defaultLocale:()=>u,getLocaleName:()=>r.find(n=>n.code===e.locale.value)?.displayName||null,localeRoute:f,localePath:(c,n)=>{const i=f(c,n);return typeof i=="string"?i:i.path||"/"},switchLocale:c=>{if(e.locale.value=c,o){const n=o.getCurrentPath(),i=f(n,c);o.push(typeof i=="string"?{path:i}:{path:i.path||"/"})}},t:e.t.bind(e),ts:e.ts.bind(e),tc:e.tc.bind(e),tn:e.tn.bind(e),td:e.td.bind(e),tdr:e.tdr.bind(e),has:e.has.bind(e),resolveTranslations:e.resolveTranslations.bind(e),setTranslation:e.setTranslation.bind(e),setRoute:e.setRoute.bind(e),getRoute:e.getRoute.bind(e),getLocale:()=>e.locale.value,addTranslations:e.addTranslations.bind(e),addRouteTranslations:e.addRouteTranslations.bind(e),mergeTranslations:e.mergeTranslations.bind(e),clearCache:e.clearCache.bind(e)}}function ie(t={}){const{addDirAttribute:e=!0,identifierAttribute:o="id",addSeoAttributes:a=!0,baseUrl:s="/",hreflangBaseLanguage:r=!1}=t,{getLocale:u,getLocales:f,localeRoute:c}=oe(),n=l.inject(N,void 0),i=l.ref({htmlAttrs:{},link:[],meta:[]});function p(L,I){const w=new URL(L,"http://localhost"),k=new URLSearchParams(w.search),_={};for(const x of I)k.has(x)&&(_[x]=k.get(x));const j=new URLSearchParams(_);return j.toString()?`${w.pathname}?${j.toString()}`:w.pathname}function v(L=[]){if(!n){i.value={htmlAttrs:{},link:[],meta:[]};return}const I=u(),w=f(),k=w.find(g=>g.code===I);if(!k)return;const _=k.iso||I,j=J(k),x=k.dir||"auto";let R=n.getCurrentPath();R.startsWith("/")||(R=`/${R}`);const z=R.split("/").filter(Boolean),V=w.find(g=>z[0]===g.code);let H=R,y,T;const d=typeof s=="function"?s():s;if(V){H=R.slice(V.code.length+1)||"/",y=p(H,L);const g=`/${I}`;T=`${d}${g}${y.startsWith("/")?"":"/"}${y}`}else y=p(R,L),T=`${d}${y.startsWith("/")?"":"/"}${y}`;const m={lang:_,...e?{dir:x}:{}};if(!a){i.value={htmlAttrs:m,link:[],meta:[]};return}const b=w.filter(g=>!g.disabled&&g.seo!==!1);j||X(k,{tag:"og:locale"});const h=j?{[o]:"i18n-og",property:"og:locale",content:j}:null,M={[o]:"i18n-og-url",property:"og:url",content:T},A=b.filter(g=>g.code!==I).map(g=>{const C=J(g);return C?{[o]:`i18n-og-alt-${C}`,property:"og:locale:alternate",content:C}:(X(g,{tag:"og:locale:alternate"}),null)}).filter(g=>g!==null),U={[o]:"i18n-can",rel:"canonical",href:T},W=(()=>{if(!c||!n)return[];const g=new Map,C=n.getCurrentPath();for(const S of b){const $=c(C,S.code),P=typeof $=="string"?$:$?.path||"/";if(!P)continue;let G;P.startsWith("http://")||P.startsWith("https://")?G=P:G=`${typeof s=="function"?s():s}${P.startsWith("/")?"":"/"}${P}`,g.set(String(S.code),G)}return le(b,{hreflangBaseLanguage:r}).flatMap(({hreflang:S,localeCode:$})=>{const P=g.get($);return P?[{[o]:`i18n-alternate-${S}`,rel:"alternate",href:P,hreflang:S}]:[]})})(),D=l.inject(q,void 0);let E=null;const K=D?w.find(g=>g.code===D):void 0;if(c&&n&&D&&K?.seo!==!1){const g=n.getCurrentPath(),C=c(g,D),S=typeof C=="string"?C:C?.path||"/";if(S){let $;S.startsWith("http://")||S.startsWith("https://")?$=S:$=`${typeof s=="function"?s():s}${S.startsWith("/")?"":"/"}${S}`,E={[o]:"i18n-xd",rel:"alternate",href:$,hreflang:"x-default"}}}i.value={htmlAttrs:m,meta:[...h?[h]:[],M,...A],link:[U,...W,...E?[E]:[]]}}return{metaObject:i,updateMeta:v}}class ae extends B.BaseI18n{constructor(e){const o={translations:new Map};if(super({storage:o,plural:e.plural,missingWarn:e.missingWarn,missingHandler:e.missingHandler}),this.listeners=new Set,this.storage=o,this._locale=l.shallowRef(e.locale),this._fallbackLocale=l.shallowRef(e.fallbackLocale||e.locale),this._currentRoute=l.shallowRef("index"),this._revision=l.shallowRef(0),e.messages)for(const[a,s]of Object.entries(e.messages))this.helper.loadTranslations(a,s)}get locale(){return this._locale}set locale(e){typeof e=="string"?this._locale.value=e:this._locale=e}get fallbackLocale(){return this._fallbackLocale}set fallbackLocale(e){typeof e=="string"?this._fallbackLocale.value=e:this._fallbackLocale=e}get currentRoute(){return this._currentRoute}setRoute(e){this._currentRoute.value=e}getLocale(){return this._locale.value}getFallbackLocale(){return this._fallbackLocale.value}getRoute(){return this._currentRoute.value}addTranslations(e,o,a=!0){super.loadTranslationsCore(e,o,a),this._revision.value++,this.notifyListeners()}addRouteTranslations(e,o,a,s=!0){super.loadRouteTranslationsCore(e,o,a,s),this._revision.value++,this.notifyListeners()}mergeTranslations(e,o,a){this.helper.mergeTranslation(e,o,a,!0),this._revision.value++,this.notifyListeners()}clearCache(){super.clearCache(),this._revision.value++,this.notifyListeners()}onTranslationsChanged(){this._revision.value++,this.notifyListeners()}subscribeToChanges(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e())}getStorage(){return this.storage}getRouteCache(){const e={};for(const[o,a]of this.storage.translations)e[o]=a;return e}}function ce(t){const{routingStrategy:e,locales:o,defaultLocale:a,...s}=t,r=new ae(s);let u=null,f=e||null;return{global:r,setRoutingStrategy:n=>{f=n,u&&u.provide(N,n)},install(n){u=n,n.provide(O,r),f&&n.provide(N,f),o&&n.provide(F,o),a&&n.provide(q,a),n.config.globalProperties.$t=(i,p,v,L)=>r.t(i,p,v,L),n.config.globalProperties.$ts=(i,p,v,L)=>r.ts(i,p,v,L),n.config.globalProperties.$tc=(i,p,v)=>r.tc(i,p,v),n.config.globalProperties.$tn=r.tn.bind(r),n.config.globalProperties.$td=r.td.bind(r),n.config.globalProperties.$tdr=r.tdr.bind(r),n.config.globalProperties.$has=(i,p)=>r.has(i,p),n.config.globalProperties.$i18n=r,n.component("I18nT",ne),n.component("I18nLink",ee),n.component("I18nGroup",Y),n.component("I18nSwitcher",te)}}}function se(t,e,o){const a=e.map(r=>r.code),s=(r,u)=>{const c=(typeof r=="string"?r:r.path||"/").split("/").filter(Boolean),n=c[0];n!==void 0&&a.includes(n)&&c.shift();const i=`/${c.join("/")}`;return u===o?i:`/${u}${i==="/"?"":i}`};return{linkComponent:re.RouterLink,getCurrentPath:()=>t.currentRoute.value.path,push:r=>{t.push(r.path).catch(()=>{})},replace:r=>{t.replace(r.path).catch(()=>{})},resolvePath:(r,u)=>s(r,u),getRoute:()=>({fullPath:t.currentRoute.value.fullPath,query:t.currentRoute.value.query})}}Object.defineProperty(exports,"FormatService",{enumerable:!0,get:()=>B.FormatService});Object.defineProperty(exports,"defaultPlural",{enumerable:!0,get:()=>B.defaultPlural});Object.defineProperty(exports,"interpolate",{enumerable:!0,get:()=>B.interpolate});exports.I18nDefaultLocaleKey=q;exports.I18nGroup=Y;exports.I18nInjectionKey=O;exports.I18nLink=ee;exports.I18nLocalesKey=F;exports.I18nSwitcher=te;exports.I18nT=ne;exports.VueI18n=ae;exports.createI18n=ce;exports.createVueRouterAdapter=se;exports.useI18n=oe;exports.useLocaleHead=ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),B=require("@i18n-micro/core"),re=require("vue-router"),O=Symbol("i18n"),F=Symbol("i18n-locales"),q=Symbol("i18n-default-locale"),N=Symbol("i18n-router-strategy"),Y=l.defineComponent({name:"I18nGroup",props:{prefix:{type:String,required:!0},groupClass:{type:String,default:""}},setup(t,{slots:e}){const a=l.inject(O);if(!a)throw new Error("[i18n-micro] I18nGroup: i18n instance not found. Make sure i18n plugin is installed.");const o=(s,r)=>a.t(`${t.prefix}.${s}`,r,void 0,a.getRoute());return()=>l.h("div",{class:["i18n-group",t.groupClass]},e.default?.({prefix:t.prefix,t:o}))}}),ee=l.defineComponent({name:"I18nLink",props:{to:{type:[String,Object],required:!0},activeStyle:{type:Object,default:()=>({})},localeRoute:{type:Function,default:void 0}},setup(t,{slots:e}){const a=l.inject(O),o=l.inject(N,void 0);if(!a)throw new Error("[i18n-micro] I18nLink: i18n instance not found. Make sure i18n plugin is installed.");const s=l.computed(()=>typeof t.to=="string"?/^(?:https?:\/\/|\/\/|[a-zA-Z0-9-]+\.[a-zA-Z]{2,})|tel:|mailto:/.test(t.to):!1),r=l.computed(()=>{if(s.value)return t.to;if(t.localeRoute){const n=t.localeRoute(t.to);return typeof n=="string"?n:n.path||"/"}if(!o?.resolvePath)return typeof t.to=="string"?t.to:t.to.path||"/";const c=o.resolvePath(t.to,a.locale.value);return typeof c=="string"?c:c.path||"/"}),u=l.computed(()=>{if(s.value||!o)return!1;const c=o.getCurrentPath().replace(/#.*$/,"").replace(/\/$/,""),n=r.value.replace(/#.*$/,"").replace(/\/$/,"");return c===n}),f=l.computed(()=>u.value?t.activeStyle:{});return()=>s.value?l.h("a",{href:r.value,target:"_blank",rel:"noopener noreferrer",style:f.value},e.default?.()):o?.linkComponent?l.h(o.linkComponent,{to:r.value,style:f.value},{default:e.default}):l.h("a",{href:r.value,style:f.value,onClick:c=>{c.preventDefault(),o?o.push({path:r.value}):window.location.href=r.value}},e.default?.())}}),te=l.defineComponent({name:"I18nSwitcher",props:{customLabels:{type:Object,default:()=>({})},customWrapperStyle:{type:Object,default:()=>({})},customButtonStyle:{type:Object,default:()=>({})},customDropdownStyle:{type:Object,default:()=>({})},customItemStyle:{type:Object,default:()=>({})},customLinkStyle:{type:Object,default:()=>({})},customActiveLinkStyle:{type:Object,default:()=>({})},customDisabledLinkStyle:{type:Object,default:()=>({})},customIconStyle:{type:Object,default:()=>({})},locales:{type:Array,default:void 0},currentLocale:{type:[String,Function],default:void 0},getLocaleName:{type:Function,default:void 0},switchLocale:{type:Function,default:void 0},localeRoute:{type:Function,default:void 0}},setup(t,{slots:e}){const a=l.inject(O),o=l.inject(N,void 0),s=l.inject(F,void 0);if(!a)throw new Error("[i18n-micro] I18nSwitcher: i18n instance not found. Make sure i18n plugin is installed.");if(!s&&!t.locales)throw new Error("[i18n-micro] I18nSwitcher: locales not provided. Make sure app.provide(I18nLocalesKey, locales) is called or pass locales prop.");const r=l.computed(()=>t.locales||s||[]),u=l.computed(()=>r.value.filter(d=>!d.disabled)),f=l.computed(()=>t.currentLocale!==void 0?typeof t.currentLocale=="function"?t.currentLocale():t.currentLocale:a.locale.value),c=l.computed(()=>r.value.some(d=>d.code===f.value&&d.disabled)),n=l.computed(()=>t.getLocaleName?t.getLocaleName()||null:r.value.find(m=>m.code===a.locale.value)?.displayName||null),i=l.ref(!1),p=l.ref(null),v=d=>{d&&(d.stopPropagation(),d.preventDefault()),i.value=!i.value},L=d=>t.customLabels[d.code]||d.displayName||d.code,I=l.computed(()=>{const d=r.value.find(m=>m.code===f.value);return d?L(d):n.value||f.value}),w=async d=>{if(i.value=!1,await l.nextTick(),t.switchLocale){t.switchLocale(d);return}if(a.locale.value=d,!o)return;const m=o.getCurrentPath(),b=t.localeRoute?(()=>{const h=t.localeRoute(m,d);return typeof h=="string"?h:h.path||"/"})():o?.resolvePath?(()=>{const h=o.resolvePath(m,d);return typeof h=="string"?h:h.path||"/"})():m;o.push({path:b})},k={position:"relative",display:"inline-block",verticalAlign:"middle"},_={padding:"4px 12px",fontSize:"16px",cursor:"pointer",backgroundColor:"#fff",border:"1px solid #333",transition:"background-color 0.3s ease",display:"flex",alignItems:"center",justifyContent:"space-between"},j={position:"absolute",top:"100%",left:"0",zIndex:1e3,backgroundColor:"#fff",border:"1px solid #333",listStyle:"none",padding:"0",margin:"4px 0 0 0",minWidth:"150px",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},x={margin:"0",padding:"0"},R={display:"block",padding:"8px 12px",color:"#333",textDecoration:"none",transition:"background-color 0.3s ease",cursor:"pointer"},z={fontWeight:"bold",color:"#007bff",cursor:"not-allowed"},V={marginLeft:"8px",display:"inline-block",transition:"transform 0.3s ease"},H={transform:"rotate(180deg)"},y=d=>d?Array.isArray(d)?d:[d]:[],T=d=>{if(!i.value)return;const m=d.target;if(!m||!p.value)return;const b=p.value.contains(m),h=m.closest(".i18n-switcher-button")!==null;!b&&!h&&(i.value=!1)};return l.onMounted(()=>{document.addEventListener("click",T)}),l.onUnmounted(()=>{document.removeEventListener("click",T)}),()=>{const d=[];e["before-button"]&&d.push(...y(e["before-button"]()));const m=[];if(e["before-selected-locale"]&&m.push(...y(e["before-selected-locale"]())),m.push(l.h("span",I.value)),e["after-selected-locale"]&&m.push(...y(e["after-selected-locale"]())),m.push(l.h("span",{style:{...V,...i.value?H:{},...t.customIconStyle}},"▼")),d.push(l.h("button",{class:"i18n-switcher-button",style:{..._,...t.customButtonStyle,...c.value?t.customDisabledLinkStyle:{}},onClick:b=>{b.preventDefault(),b.stopPropagation(),v(b)},type:"button",ariaHaspopup:!0,ariaExpanded:i.value},m)),e["before-dropdown"]&&d.push(...y(e["before-dropdown"]())),i.value){const b=[];e["before-dropdown-items"]&&b.push(...y(e["before-dropdown-items"]())),u.value.forEach(h=>{const M=[];e["before-item"]&&M.push(...y(e["before-item"]({locale:h})));const A=[];e["before-link-content"]&&A.push(...y(e["before-link-content"]({locale:h}))),A.push(L(h)),e["after-link-content"]&&A.push(...y(e["after-link-content"]({locale:h})));const U=typeof window<"u"?window.location.pathname:"/",W=t.localeRoute?t.localeRoute(U,h.code):o?.resolvePath?o.resolvePath(U,h.code):U,D=typeof W=="string"?W:W.path||"#",E=h.code===f.value;M.push(l.h("a",{class:`switcher-locale-${h.code}`,href:typeof D=="string"?D:"#",style:{...R,...E?z:{},...t.customLinkStyle,...E?t.customActiveLinkStyle:{}},onClick:K=>{K.preventDefault(),K.stopPropagation(),w(h.code)}},A)),e["after-item"]&&M.push(...y(e["after-item"]({locale:h}))),b.push(l.h("li",{key:h.code,style:{...x,...t.customItemStyle}},M))}),e["after-dropdown-items"]&&b.push(...y(e["after-dropdown-items"]())),d.push(l.h("ul",{class:"i18n-switcher-dropdown",style:{...j,...t.customDropdownStyle}},b))}return e["after-dropdown"]&&d.push(...y(e["after-dropdown"]())),l.h("div",{ref:p,class:"i18n-switcher-wrapper",style:{...k,...t.customWrapperStyle}},d)}}}),ne=l.defineComponent({name:"I18nT",props:{keypath:{type:String,required:!0},plural:{type:[Number,String]},tag:{type:String,default:"span"},params:{type:Object,default:()=>({})},defaultValue:{type:String,default:""},html:{type:Boolean,default:!1},hideIfEmpty:{type:Boolean,default:!1},customPluralRule:{type:Function,default:null},number:{type:[Number,String]},date:{type:[Date,String,Number]},relativeDate:{type:[Date,String,Number]}},setup(t,{slots:e,attrs:a}){const o=l.inject(O);if(!o)throw new Error("[i18n-micro] I18nT: i18n instance not found. Make sure i18n plugin is installed.");return()=>{const s={},r=o.getRoute();if(t.number!==void 0){const n=Number(t.number),i=o.tn(n),p=o.t(t.keypath,{number:i,...t.params},void 0,r);return l.h(t.tag,{...a,innerHTML:p})}if(t.date!==void 0){const n=o.td(t.date),i=o.t(t.keypath,{date:n,...t.params},void 0,r);return l.h(t.tag,{...a,innerHTML:i})}if(t.relativeDate!==void 0){const n=o.tdr(t.relativeDate),i=o.t(t.keypath,{relativeDate:n,...t.params},void 0,r);return l.h(t.tag,{...a,innerHTML:i})}if(t.plural!==void 0){const n=Number.parseInt(t.plural.toString(),10);if(t.customPluralRule){const i=t.customPluralRule(t.keypath,n,t.params,o.locale.value,(p,v,L)=>o.t(p,v,L,r));return l.h(t.tag,{...a,innerHTML:i||""})}else{const i=o.tc(t.keypath,{count:n,...t.params});return l.h(t.tag,{...a,innerHTML:i})}}const u=(o.t(t.keypath,{...t.params,...s},void 0,r)??"").toString();if(t.hideIfEmpty&&!u.trim())return t.defaultValue??null;if(t.html)return l.h(t.tag,{...a,innerHTML:u});if(e.default)return l.h(t.tag,a,e.default({translation:u}));const f=[];let c=0;for(const[n,i]of Object.entries(e)){if(n==="default")continue;const p=`{${n}}`,v=u.indexOf(p,c);v!==-1&&(v>c&&f.push(u.slice(c,v)),i&&f.push(l.h(i)),c=v+p.length)}return c<u.length&&f.push(u.slice(c)),e.default?l.h(t.tag,a,e.default({children:f})):f.length>0?l.h(t.tag,a,f):l.h(t.tag,a,u)}}});function Z(t){return t.iso?.trim()||String(t.code)}function Q(t){const e=t.match(/^([A-Za-z]{2,3})(?:[-_](.+))?$/);return e?{language:e[1],region:e[2]}:{language:t}}function le(t,e={}){const{hreflangBaseLanguage:a=!1}=e;if(!a)return t.map(u=>{const f=String(u.code);return{hreflang:Z(u),localeCode:f}});const o=new Map;for(const u of t){const f=String(u.code),c=Z(u),{language:n,region:i}=Q(c);n&&i&&!o.has(n)&&o.set(n,f),o.set(c,f)}const s=new Set,r=[];for(const u of t){const f=String(u.code),c=Z(u),{language:n,region:i}=Q(c);n&&i&&o.get(n)===f&&!s.has(n)&&(s.add(n),r.push({hreflang:n,localeCode:f})),s.has(c)||(s.add(c),r.push({hreflang:c,localeCode:f}))}return r}function J(t){const e=t.og?.trim();if(e)return e;const a=t.iso?.trim();if(!a)return null;const o=a.indexOf("_");if(o>0){const r=a.slice(0,o),u=a.slice(o+1);if(r.length>=2&&u.length===2)return`${r.toLowerCase()}_${u.toUpperCase()}`}const s=a.indexOf("-");if(s>0){const r=a.slice(0,s),u=a.slice(s+1);if(r.length>=2&&u.length===2&&/^[A-Za-z]{2}$/.test(u))return`${r.toLowerCase()}_${u.toUpperCase()}`}return null}function X(t,e={}){if(J(t)!==null||e.missingWarn===!1||process.env.NODE_ENV==="production")return;const a=e.tag??"og:locale",o=String(t.code??"unknown"),s=t.iso?`, iso: '${t.iso}'`:"";console.warn(`[i18n] Cannot derive ${a} for locale '${o}'${s}. Set locale.og (e.g. 'en_US') or use iso with a 2-letter region (e.g. 'en-US').`)}function ae(t){const e=l.inject(O),a=l.inject(N,void 0),o=l.inject(F,void 0),s=l.inject(q,void 0);if(!e)throw new Error("[i18n-micro] useI18n() must be called after app.use(i18n). Make sure i18n plugin is installed.");if(!o)throw new Error("[i18n-micro] I18nLocalesKey not provided. Make sure app.provide(I18nLocalesKey, locales) is called.");if(!s)throw new Error("[i18n-micro] I18nDefaultLocaleKey not provided. Make sure app.provide(I18nDefaultLocaleKey, defaultLocale) is called.");const r=t?.locales||o,u=t?.defaultLocale||s,f=(c,n)=>a?.resolvePath?a.resolvePath(c,n||e.locale.value):c;return{instance:e,locale:l.computed({get:()=>e.locale.value,set:c=>{e.locale.value=c}}),getLocales:()=>r,defaultLocale:()=>u,getLocaleName:()=>r.find(n=>n.code===e.locale.value)?.displayName||null,localeRoute:f,localePath:(c,n)=>{const i=f(c,n);return typeof i=="string"?i:i.path||"/"},switchLocale:c=>{if(e.locale.value=c,a){const n=a.getCurrentPath(),i=f(n,c);a.push(typeof i=="string"?{path:i}:{path:i.path||"/"})}},t:e.t.bind(e),ts:e.ts.bind(e),tc:e.tc.bind(e),tn:e.tn.bind(e),td:e.td.bind(e),tdr:e.tdr.bind(e),has:e.has.bind(e),resolveTranslations:e.resolveTranslations.bind(e),setTranslation:e.setTranslation.bind(e),setRoute:e.setRoute.bind(e),getRoute:e.getRoute.bind(e),getLocale:()=>e.locale.value,addTranslations:e.addTranslations.bind(e),addRouteTranslations:e.addRouteTranslations.bind(e),mergeTranslations:e.mergeTranslations.bind(e),clearCache:e.clearCache.bind(e)}}function ie(t={}){const{addDirAttribute:e=!0,identifierAttribute:a="id",addSeoAttributes:o=!0,baseUrl:s="/",hreflangBaseLanguage:r=!1}=t,{getLocale:u,getLocales:f,localeRoute:c}=ae(),n=l.inject(N,void 0),i=l.ref({htmlAttrs:{},link:[],meta:[]});function p(L,I){const w=new URL(L,"http://localhost"),k=new URLSearchParams(w.search),_={};for(const x of I)k.has(x)&&(_[x]=k.get(x));const j=new URLSearchParams(_);return j.toString()?`${w.pathname}?${j.toString()}`:w.pathname}function v(L=[]){if(!n){i.value={htmlAttrs:{},link:[],meta:[]};return}const I=u(),w=f(),k=w.find(g=>g.code===I);if(!k)return;const _=k.iso||I,j=J(k),x=k.dir||"auto";let R=n.getCurrentPath();R.startsWith("/")||(R=`/${R}`);const z=R.split("/").filter(Boolean),V=w.find(g=>z[0]===g.code);let H=R,y,T;const d=typeof s=="function"?s():s;if(V){H=R.slice(V.code.length+1)||"/",y=p(H,L);const g=`/${I}`;T=`${d}${g}${y.startsWith("/")?"":"/"}${y}`}else y=p(R,L),T=`${d}${y.startsWith("/")?"":"/"}${y}`;const m={lang:_,...e?{dir:x}:{}};if(!o){i.value={htmlAttrs:m,link:[],meta:[]};return}const b=w.filter(g=>!g.disabled&&g.seo!==!1);j||X(k,{tag:"og:locale"});const h=j?{[a]:"i18n-og",property:"og:locale",content:j}:null,M={[a]:"i18n-og-url",property:"og:url",content:T},A=b.filter(g=>g.code!==I).map(g=>{const $=J(g);return $?{[a]:`i18n-og-alt-${$}`,property:"og:locale:alternate",content:$}:(X(g,{tag:"og:locale:alternate"}),null)}).filter(g=>g!==null),U={[a]:"i18n-can",rel:"canonical",href:T},W=(()=>{if(!c||!n)return[];const g=new Map,$=n.getCurrentPath();for(const S of b){const C=c($,S.code),P=typeof C=="string"?C:C?.path||"/";if(!P)continue;let G;P.startsWith("http://")||P.startsWith("https://")?G=P:G=`${typeof s=="function"?s():s}${P.startsWith("/")?"":"/"}${P}`,g.set(String(S.code),G)}return le(b,{hreflangBaseLanguage:r}).flatMap(({hreflang:S,localeCode:C})=>{const P=g.get(C);return P?[{[a]:`i18n-alternate-${S}`,rel:"alternate",href:P,hreflang:S}]:[]})})(),D=l.inject(q,void 0);let E=null;const K=D?w.find(g=>g.code===D):void 0;if(c&&n&&D&&K?.seo!==!1){const g=n.getCurrentPath(),$=c(g,D),S=typeof $=="string"?$:$?.path||"/";if(S){let C;S.startsWith("http://")||S.startsWith("https://")?C=S:C=`${typeof s=="function"?s():s}${S.startsWith("/")?"":"/"}${S}`,E={[a]:"i18n-xd",rel:"alternate",href:C,hreflang:"x-default"}}}i.value={htmlAttrs:m,meta:[...h?[h]:[],M,...A],link:[U,...W,...E?[E]:[]]}}return{metaObject:i,updateMeta:v}}class oe extends B.BaseI18n{constructor(e){const a={translations:new Map};if(super({storage:a,plural:e.plural,missingWarn:e.missingWarn,missingHandler:e.missingHandler}),this.listeners=new Set,this.storage=a,this._locale=l.shallowRef(e.locale),this._fallbackLocale=l.shallowRef(e.fallbackLocale||e.locale),this._currentRoute=l.shallowRef("index"),this._revision=l.shallowRef(0),e.messages)for(const[o,s]of Object.entries(e.messages))this.helper.loadTranslations(o,s)}get locale(){return this._locale}set locale(e){typeof e=="string"?this._locale.value=e:this._locale=e}get fallbackLocale(){return this._fallbackLocale}set fallbackLocale(e){typeof e=="string"?this._fallbackLocale.value=e:this._fallbackLocale=e}get currentRoute(){return this._currentRoute}setRoute(e){this._currentRoute.value=e}getLocale(){return this._locale.value}getFallbackLocale(){return this._fallbackLocale.value}getRoute(){return this._currentRoute.value}addTranslations(e,a,o=!0){super.loadTranslationsCore(e,a,o),this._revision.value++,this.notifyListeners()}addRouteTranslations(e,a,o,s=!0){super.loadRouteTranslationsCore(e,a,o,s),this._revision.value++,this.notifyListeners()}mergeTranslations(e,a,o){this.helper.mergeTranslation(e,a,o,!0),this._revision.value++,this.notifyListeners()}clearCache(){super.clearCache(),this._revision.value++,this.notifyListeners()}onTranslationsChanged(){this._revision.value++,this.notifyListeners()}subscribeToChanges(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){this.listeners.forEach(e=>e())}getStorage(){return this.storage}getRouteCache(){const e={};for(const[a,o]of this.storage.translations)e[a]=o;return e}}function ce(t){const{routingStrategy:e,locales:a,defaultLocale:o,...s}=t,r=new oe(s);let u=null,f=e||null;return{global:r,setRoutingStrategy:n=>{f=n,u&&u.provide(N,n)},install(n){u=n,n.provide(O,r),f&&n.provide(N,f),a&&n.provide(F,a),o&&n.provide(q,o),n.config.globalProperties.$t=(i,p,v,L)=>r.t(i,p,v,L),n.config.globalProperties.$ts=(i,p,v,L)=>r.ts(i,p,v,L),n.config.globalProperties.$tc=(i,p,v)=>r.tc(i,p,v),n.config.globalProperties.$tn=r.tn.bind(r),n.config.globalProperties.$td=r.td.bind(r),n.config.globalProperties.$tdr=r.tdr.bind(r),n.config.globalProperties.$has=(i,p)=>r.has(i,p),n.config.globalProperties.$i18n=r,n.component("I18nT",ne),n.component("I18nLink",ee),n.component("I18nGroup",Y),n.component("I18nSwitcher",te)}}}function se(t,e,a){const o=e.map(r=>r.code),s=(r,u)=>{const c=(typeof r=="string"?r:r.path||"/").split("/").filter(Boolean),n=c[0];n!==void 0&&o.includes(n)&&c.shift();const i=`/${c.join("/")}`;return u===a?i:`/${u}${i==="/"?"":i}`};return{linkComponent:re.RouterLink,getCurrentPath:()=>t.currentRoute.value.path,push:r=>{t.push(r.path).catch(()=>{})},replace:r=>{t.replace(r.path).catch(()=>{})},resolvePath:(r,u)=>s(r,u),getRoute:()=>({fullPath:t.currentRoute.value.fullPath,query:t.currentRoute.value.query})}}Object.defineProperty(exports,"FormatService",{enumerable:!0,get:()=>B.FormatService});Object.defineProperty(exports,"defaultPlural",{enumerable:!0,get:()=>B.defaultPlural});Object.defineProperty(exports,"interpolate",{enumerable:!0,get:()=>B.interpolate});exports.I18nDefaultLocaleKey=q;exports.I18nGroup=Y;exports.I18nInjectionKey=O;exports.I18nLink=ee;exports.I18nLocalesKey=F;exports.I18nSwitcher=te;exports.I18nT=ne;exports.VueI18n=oe;exports.createI18n=ce;exports.createVueRouterAdapter=se;exports.useI18n=ae;exports.useLocaleHead=ie;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/injection.ts","../src/components/i18n-group.ts","../src/components/i18n-link.ts","../src/components/i18n-switcher.ts","../src/components/i18n-t.ts","../../utils/dist/resolve-hreflang.mjs","../../utils/dist/resolve-og-locale.mjs","../src/use-i18n.ts","../src/composables/use-locale-head.ts","../src/composer.ts","../src/plugin.ts","../src/router/adapter.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport type { InjectionKey } from 'vue'\nimport type { VueI18n } from './composer'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport const I18nInjectionKey: InjectionKey<VueI18n> = Symbol('i18n')\nexport const I18nLocalesKey: InjectionKey<Locale[]> = Symbol('i18n-locales')\nexport const I18nDefaultLocaleKey: InjectionKey<string> = Symbol('i18n-default-locale')\nexport const I18nRouterKey: InjectionKey<I18nRoutingStrategy> = Symbol('i18n-router-strategy')\n","import type { TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\ninterface I18nGroupProps {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup = defineComponent<I18nGroupProps>({\n name: 'I18nGroup',\n props: {\n prefix: {\n type: String,\n required: true,\n },\n groupClass: {\n type: String,\n default: '',\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nGroup: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const translate = (key: string, params?: Record<string, string | number | boolean>) => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n return i18n.t(`${props.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n }\n\n return () =>\n h(\n 'div',\n {\n class: ['i18n-group', props.groupClass],\n },\n slots.default?.({ prefix: props.prefix, t: translate }),\n )\n },\n})\n","import { type CSSProperties, computed, defineComponent, h, inject, type PropType } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nLink = defineComponent({\n name: 'I18nLink',\n props: {\n to: {\n type: [String, Object] as PropType<string | { path?: string }>,\n required: true,\n },\n activeStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nLink: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const isExternalLink = computed(() => {\n if (typeof props.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(props.to)\n }\n return false\n })\n\n const targetPath = computed(() => {\n if (isExternalLink.value) {\n return props.to as string\n }\n\n if (props.localeRoute) {\n const res = props.localeRoute(props.to)\n return typeof res === 'string' ? res : res.path || '/'\n }\n\n if (!routerStrategy?.resolvePath) {\n return typeof props.to === 'string' ? props.to : props.to.path || '/'\n }\n\n const res = routerStrategy.resolvePath(props.to, i18n.locale.value)\n return typeof res === 'string' ? res : res.path || '/'\n })\n\n const isActive = computed(() => {\n if (isExternalLink.value || !routerStrategy) {\n return false\n }\n\n const currentPath = routerStrategy.getCurrentPath().replace(/\\/$/, '')\n const linkPath = targetPath.value.replace(/\\/$/, '')\n\n return currentPath === linkPath\n })\n\n const computedStyle = computed(() => (isActive.value ? props.activeStyle : {}))\n\n return () => {\n if (isExternalLink.value) {\n return h(\n 'a',\n {\n href: targetPath.value,\n target: '_blank',\n rel: 'noopener noreferrer',\n style: computedStyle.value,\n },\n slots.default?.(),\n )\n }\n\n if (routerStrategy?.linkComponent) {\n return h(\n routerStrategy.linkComponent,\n {\n to: targetPath.value,\n style: computedStyle.value,\n },\n { default: slots.default },\n )\n }\n\n return h(\n 'a',\n {\n href: targetPath.value,\n style: computedStyle.value,\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n if (routerStrategy) {\n routerStrategy.push({ path: targetPath.value })\n } else {\n window.location.href = targetPath.value\n }\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n","import type { Locale } from '@i18n-micro/types'\nimport { type CSSProperties, computed, defineComponent, h, inject, nextTick, onMounted, onUnmounted, type PropType, ref, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nSwitcher = defineComponent({\n name: 'I18nSwitcher',\n props: {\n customLabels: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n customWrapperStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customButtonStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customDropdownStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customItemStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customActiveLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n /**\n * Inline style applied to the switcher button when the *current* locale is\n * marked as `disabled: true` in the locale config.\n *\n * Note: disabled locales are omitted from the dropdown list, but the current\n * locale label is still shown on the button.\n */\n customDisabledLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customIconStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n locales: {\n type: Array as PropType<Locale[]>,\n default: undefined,\n },\n currentLocale: {\n type: [String, Function] as PropType<string | (() => string)>,\n default: undefined,\n },\n getLocaleName: {\n type: Function as PropType<() => string | null>,\n default: undefined,\n },\n switchLocale: {\n type: Function as PropType<(locale: string) => void>,\n default: undefined,\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nSwitcher: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales && !props.locales) {\n throw new Error(\n '[i18n-micro] I18nSwitcher: locales not provided. Make sure app.provide(I18nLocalesKey, locales) is called or pass locales prop.',\n )\n }\n\n const allLocales = computed(() => props.locales || injectedLocales || [])\n const locales = computed(() => allLocales.value.filter((locale) => !locale.disabled))\n const currentLocale = computed(() => {\n if (props.currentLocale !== undefined) {\n return typeof props.currentLocale === 'function' ? props.currentLocale() : props.currentLocale\n }\n return i18n.locale.value\n })\n const currentLocaleDisabled = computed(() => allLocales.value.some((l) => l.code === currentLocale.value && l.disabled))\n const currentLocaleName = computed(() => {\n if (props.getLocaleName) {\n return props.getLocaleName() || null\n }\n // Use `allLocales` (not dropdown-only `locales`) so disabled locales still resolve\n // displayName/customLabels for the currently active button.\n const current = allLocales.value.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n })\n\n const dropdownOpen = ref(false)\n const wrapperRef = ref<HTMLElement | null>(null)\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n dropdownOpen.value = !dropdownOpen.value\n }\n\n const localeLabel = (localeItem: Locale) => {\n const current = props.customLabels[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = computed(() => {\n const current = allLocales.value.find((l) => l.code === currentLocale.value)\n return current ? localeLabel(current) : currentLocaleName.value || currentLocale.value\n })\n\n const handleSwitchLocale = async (code: string) => {\n dropdownOpen.value = false\n await nextTick()\n\n if (props.switchLocale) {\n props.switchLocale(code)\n return\n }\n\n i18n.locale.value = code\n\n if (!routerStrategy) {\n return\n }\n\n const currentPath = routerStrategy.getCurrentPath()\n const newPath = props.localeRoute\n ? (() => {\n const res = props.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : routerStrategy?.resolvePath\n ? (() => {\n const res = routerStrategy.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n routerStrategy.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n verticalAlign: 'middle',\n }\n\n const buttonStyle: CSSProperties = {\n padding: '4px 12px',\n fontSize: '16px',\n cursor: 'pointer',\n backgroundColor: '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }\n\n const dropdownStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n zIndex: 1000,\n backgroundColor: '#fff',\n border: '1px solid #333',\n listStyle: 'none',\n padding: '0',\n margin: '4px 0 0 0',\n minWidth: '150px',\n boxShadow: '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n textDecoration: 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: CSSProperties = {\n fontWeight: 'bold',\n color: '#007bff',\n // Current locale is not a meaningful switch target\n cursor: 'not-allowed',\n }\n\n const iconStyle: CSSProperties = {\n marginLeft: '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const normalizeSlot = (slotResult: unknown): (VNode | string)[] => {\n if (!slotResult) return []\n return Array.isArray(slotResult) ? slotResult : [slotResult as VNode]\n }\n\n // Simplified and reliable outside click logic\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen.value) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef.value) return\n\n // Check that the click is not inside our wrapper\n const isClickInside = wrapperRef.value.contains(target)\n\n // Also check if the target is the switcher button\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n dropdownOpen.value = false\n }\n }\n\n onMounted(() => {\n // Use regular bubbling, but with a slight delay to give the dropdown time to open\n document.addEventListener('click', handleClickOutside)\n })\n\n onUnmounted(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return () => {\n const children: (VNode | string)[] = []\n\n // 1. Button rendering\n if (slots['before-button']) {\n children.push(...normalizeSlot(slots['before-button']()))\n }\n\n const buttonContent: (VNode | string)[] = []\n if (slots['before-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['before-selected-locale']()))\n }\n\n buttonContent.push(h('span', currentLocaleLabel.value))\n\n if (slots['after-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['after-selected-locale']()))\n }\n\n buttonContent.push(\n h(\n 'span',\n {\n style: {\n ...iconStyle,\n ...(dropdownOpen.value ? openIconStyle : {}),\n ...props.customIconStyle,\n },\n },\n '▼',\n ),\n )\n\n children.push(\n h(\n 'button',\n {\n class: 'i18n-switcher-button',\n style: {\n ...buttonStyle,\n ...props.customButtonStyle,\n ...(currentLocaleDisabled.value ? props.customDisabledLinkStyle : {}),\n },\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n },\n type: 'button',\n ariaHaspopup: true,\n ariaExpanded: dropdownOpen.value,\n },\n buttonContent,\n ),\n )\n\n // 2. Dropdown rendering\n if (slots['before-dropdown']) {\n children.push(...normalizeSlot(slots['before-dropdown']()))\n }\n\n if (dropdownOpen.value) {\n const dropdownItems: VNode[] = []\n\n if (slots['before-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['before-dropdown-items']()) as VNode[]))\n }\n\n locales.value.forEach((localeItem) => {\n const itemChildren: (VNode | string)[] = []\n\n if (slots['before-item']) {\n itemChildren.push(...normalizeSlot(slots['before-item']({ locale: localeItem })))\n }\n\n const linkContent: (VNode | string)[] = []\n if (slots['before-link-content']) {\n linkContent.push(...normalizeSlot(slots['before-link-content']({ locale: localeItem })))\n }\n linkContent.push(localeLabel(localeItem))\n if (slots['after-link-content']) {\n linkContent.push(...normalizeSlot(slots['after-link-content']({ locale: localeItem })))\n }\n\n const currentPath = typeof window !== 'undefined' ? window.location.pathname : '/'\n const result = props.localeRoute\n ? props.localeRoute(currentPath, localeItem.code)\n : routerStrategy?.resolvePath\n ? routerStrategy.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result.path || '#'\n const isActive = localeItem.code === currentLocale.value\n\n itemChildren.push(\n h(\n 'a',\n {\n class: `switcher-locale-${localeItem.code}`,\n href: typeof routeTo === 'string' ? routeTo : '#',\n style: {\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...props.customLinkStyle,\n // active-specific customization wins over the generic link style\n // (matches the React/Preact/Solid switchers)\n ...(isActive ? props.customActiveLinkStyle : {}),\n },\n // Prevent default navigation, use only handleSwitchLocale\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n },\n },\n linkContent,\n ),\n )\n\n if (slots['after-item']) {\n itemChildren.push(...normalizeSlot(slots['after-item']({ locale: localeItem })))\n }\n\n dropdownItems.push(\n h(\n 'li',\n {\n key: localeItem.code,\n style: { ...itemStyle, ...props.customItemStyle },\n },\n itemChildren,\n ),\n )\n })\n\n if (slots['after-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['after-dropdown-items']()) as VNode[]))\n }\n\n // Render UL right here, WITHOUT Teleport\n children.push(\n h(\n 'ul',\n {\n class: 'i18n-switcher-dropdown',\n style: { ...dropdownStyle, ...props.customDropdownStyle },\n },\n dropdownItems,\n ),\n )\n }\n\n if (slots['after-dropdown']) {\n children.push(...normalizeSlot(slots['after-dropdown']()))\n }\n\n // Return wrapper with ref\n return h(\n 'div',\n {\n ref: wrapperRef,\n class: 'i18n-switcher-wrapper',\n style: { ...wrapperStyle, ...props.customWrapperStyle },\n },\n children,\n )\n }\n },\n})\n","import type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject, type PropType, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\nexport const I18nT = defineComponent({\n name: 'I18nT',\n props: {\n keypath: {\n type: String as PropType<TranslationKey>,\n required: true,\n },\n plural: {\n type: [Number, String] as PropType<number | string>,\n },\n tag: {\n type: String as PropType<string>,\n default: 'span',\n },\n params: {\n type: Object as PropType<Record<string, string | number | boolean>>,\n default: () => ({}),\n },\n defaultValue: {\n type: String as PropType<string>,\n default: '',\n },\n html: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n hideIfEmpty: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n customPluralRule: {\n type: Function as PropType<PluralFunc>,\n default: null,\n },\n number: {\n type: [Number, String] as PropType<number | string>,\n },\n date: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n relativeDate: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n },\n setup(props, { slots, attrs }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nT: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n return () => {\n const options: Record<string, string | number | boolean> = {}\n const route = i18n.getRoute()\n\n // Handle number formatting\n if (props.number !== undefined) {\n const numberValue = Number(props.number)\n const formattedNumber = i18n.tn(numberValue)\n const translation = i18n.t(props.keypath, { number: formattedNumber, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle date formatting\n if (props.date !== undefined) {\n const formattedDate = i18n.td(props.date)\n const translation = i18n.t(props.keypath, { date: formattedDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle relative date formatting\n if (props.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(props.relativeDate)\n const translation = i18n.t(props.keypath, { relativeDate: formattedRelativeDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle pluralization\n if (props.plural !== undefined) {\n const count = Number.parseInt(props.plural.toString(), 10)\n if (props.customPluralRule) {\n const translation = props.customPluralRule(\n props.keypath,\n count,\n props.params,\n i18n.locale.value,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return h(props.tag, { ...attrs, innerHTML: translation || '' })\n } else {\n const translation = i18n.tc(props.keypath, { count, ...props.params })\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n }\n\n // Regular translation\n const translation = (i18n.t(props.keypath, { ...props.params, ...options }, undefined, route) ?? '').toString()\n\n if (props.hideIfEmpty && !translation.trim()) {\n return props.defaultValue ?? null\n }\n\n if (props.html) {\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle slots\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ translation }))\n }\n\n // Handle named slots for interpolation\n const children: (string | VNode)[] = []\n let lastIndex = 0\n\n for (const [slotName, slotFn] of Object.entries(slots)) {\n if (slotName === 'default') continue\n\n const placeholder = `{${slotName}}`\n const index = translation.indexOf(placeholder, lastIndex)\n\n if (index !== -1) {\n if (index > lastIndex) {\n children.push(translation.slice(lastIndex, index))\n }\n\n if (slotFn) {\n children.push(h(slotFn))\n }\n\n lastIndex = index + placeholder.length\n }\n }\n\n if (lastIndex < translation.length) {\n children.push(translation.slice(lastIndex))\n }\n\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ children }))\n }\n\n if (children.length > 0) {\n return h(props.tag, attrs, children)\n }\n\n return h(props.tag, attrs, translation)\n }\n },\n})\n","function u(n) {\n return n.iso?.trim() || String(n.code);\n}\nfunction f(n) {\n const r = n.match(/^([A-Za-z]{2,3})(?:[-_](.+))?$/);\n return r ? { language: r[1], region: r[2] } : { language: n };\n}\nfunction d(n, r = {}) {\n const { hreflangBaseLanguage: l = !1 } = r;\n if (!l)\n return n.map((o) => {\n const t = String(o.code);\n return { hreflang: u(o), localeCode: t };\n });\n const g = /* @__PURE__ */ new Map();\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && !g.has(e) && g.set(e, t), g.set(a, t);\n }\n const s = /* @__PURE__ */ new Set(), c = [];\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && g.get(e) === t && !s.has(e) && (s.add(e), c.push({ hreflang: e, localeCode: t })), s.has(a) || (s.add(a), c.push({ hreflang: a, localeCode: t }));\n }\n return c;\n}\nexport {\n d as resolveHreflangAlternates\n};\n","function c(n) {\n const t = n.og?.trim();\n if (t) return t;\n const e = n.iso?.trim();\n if (!e) return null;\n const r = e.indexOf(\"_\");\n if (r > 0) {\n const s = e.slice(0, r), o = e.slice(r + 1);\n if (s.length >= 2 && o.length === 2)\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n const i = e.indexOf(\"-\");\n if (i > 0) {\n const s = e.slice(0, i), o = e.slice(i + 1);\n if (s.length >= 2 && o.length === 2 && /^[A-Za-z]{2}$/.test(o))\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n return null;\n}\nfunction l(n, t = {}) {\n if (c(n) !== null || t.missingWarn === !1 || process.env.NODE_ENV === \"production\") return;\n const e = t.tag ?? \"og:locale\", r = String(n.code ?? \"unknown\"), i = n.iso ? `, iso: '${n.iso}'` : \"\";\n console.warn(\n `[i18n] Cannot derive ${e} for locale '${r}'${i}. Set locale.og (e.g. 'en_US') or use iso with a 2-letter region (e.g. 'en-US').`\n );\n}\nexport {\n c as resolveOgLocale,\n l as warnUnresolvedOgLocale\n};\n","import type { Locale } from '@i18n-micro/types'\nimport { computed, inject } from 'vue'\nimport type { VueI18n } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\n/**\n * Get the i18n instance from the Vue app context\n * Returns the same instance that was created with createI18n()\n */\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const router = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] useI18n() must be called after app.use(i18n). Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales) {\n throw new Error('[i18n-micro] I18nLocalesKey not provided. Make sure app.provide(I18nLocalesKey, locales) is called.')\n }\n\n if (!injectedDefaultLocale) {\n throw new Error('[i18n-micro] I18nDefaultLocaleKey not provided. Make sure app.provide(I18nDefaultLocaleKey, defaultLocale) is called.')\n }\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.locale.value)\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive)\n locale: computed({\n get: () => i18n.locale.value,\n set: (val: string) => {\n i18n.locale.value = val\n },\n }),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n const current = locales.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale.value = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n resolveTranslations: i18n.resolveTranslations.bind(i18n),\n setTranslation: i18n.setTranslation.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.locale.value,\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n mergeTranslations: i18n.mergeTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { resolveHreflangAlternates } from '@i18n-micro/utils/resolve-hreflang'\nimport { resolveOgLocale, warnUnresolvedOgLocale } from '@i18n-micro/utils/resolve-og-locale'\nimport { inject, ref } from 'vue'\nimport { I18nDefaultLocaleKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\nimport { useI18n } from '../use-i18n'\n\ninterface MetaLink {\n [key: string]: string | undefined\n rel: string\n href: string\n hreflang?: string\n}\n\ninterface MetaTag {\n [key: string]: string\n property: string\n content: string\n}\n\ninterface MetaObject {\n htmlAttrs: {\n lang?: string\n dir?: 'ltr' | 'rtl' | 'auto'\n }\n link: MetaLink[]\n meta: MetaTag[]\n}\n\nexport interface UseLocaleHeadOptions {\n addDirAttribute?: boolean\n identifierAttribute?: string\n addSeoAttributes?: boolean\n baseUrl?: string | (() => string)\n /**\n * Also emit bare-language `hreflang` tags derived from `iso` (never from routing `code`).\n * @default false\n */\n hreflangBaseLanguage?: boolean\n}\n\nexport function useLocaleHead(options: UseLocaleHeadOptions = {}) {\n const { addDirAttribute = true, identifierAttribute = 'id', addSeoAttributes = true, baseUrl = '/', hreflangBaseLanguage = false } = options\n\n const { getLocale, getLocales, localeRoute: i18nLocaleRoute } = useI18n()\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n const metaObject = ref<MetaObject>({\n htmlAttrs: {},\n link: [],\n meta: [],\n })\n\n function filterQuery(fullPath: string, whitelist: string[]): string {\n const url = new URL(fullPath, 'http://localhost')\n const params = new URLSearchParams(url.search)\n const filtered: Record<string, string> = {}\n for (const key of whitelist) {\n if (params.has(key)) {\n filtered[key] = params.get(key) as string\n }\n }\n const filteredParams = new URLSearchParams(filtered)\n return filteredParams.toString() ? `${url.pathname}?${filteredParams.toString()}` : url.pathname\n }\n\n function updateMeta(canonicalQueryWhitelist: string[] = []) {\n if (!routerStrategy) {\n metaObject.value = { htmlAttrs: {}, link: [], meta: [] }\n return\n }\n\n const locale = getLocale()\n const allLocales = getLocales()\n const currentLocaleObj = allLocales.find((loc: Locale) => loc.code === locale)\n\n if (!currentLocaleObj) {\n return\n }\n\n const currentIso = currentLocaleObj.iso || locale\n const currentOg = resolveOgLocale(currentLocaleObj)\n const currentDir = currentLocaleObj.dir || 'auto'\n\n let fullPath = routerStrategy.getCurrentPath()\n if (!fullPath.startsWith('/')) {\n fullPath = `/${fullPath}`\n }\n\n const pathSegments = fullPath.split('/').filter(Boolean)\n const matchedLocale = allLocales.find((localeItem: Locale) => pathSegments[0] === localeItem.code)\n\n let localizedPath = fullPath\n let canonicalPath: string\n\n let ogUrl: string\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n\n if (matchedLocale) {\n localizedPath = fullPath.slice(matchedLocale.code.length + 1) || '/'\n canonicalPath = filterQuery(localizedPath, canonicalQueryWhitelist)\n const localePrefix = `/${locale}`\n ogUrl = `${baseUrlValue}${localePrefix}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n } else {\n canonicalPath = filterQuery(fullPath, canonicalQueryWhitelist)\n ogUrl = `${baseUrlValue}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n }\n\n const htmlAttrs = {\n lang: currentIso,\n ...(addDirAttribute ? { dir: currentDir } : {}),\n }\n\n if (!addSeoAttributes) {\n metaObject.value = { htmlAttrs, link: [], meta: [] }\n return\n }\n\n const alternateLocales = allLocales.filter((loc: Locale) => !loc.disabled && loc.seo !== false)\n\n if (!currentOg) {\n warnUnresolvedOgLocale(currentLocaleObj, { tag: 'og:locale' })\n }\n\n const ogLocaleMeta: MetaTag | null = currentOg\n ? {\n [identifierAttribute]: 'i18n-og',\n property: 'og:locale',\n content: currentOg,\n }\n : null\n\n const ogUrlMeta: MetaTag = {\n [identifierAttribute]: 'i18n-og-url',\n property: 'og:url',\n content: ogUrl,\n }\n\n const alternateOgLocalesMeta = alternateLocales\n .filter((loc: Locale) => loc.code !== locale)\n .map((loc: Locale) => {\n const ogAlt = resolveOgLocale(loc)\n if (!ogAlt) {\n warnUnresolvedOgLocale(loc, { tag: 'og:locale:alternate' })\n return null\n }\n return {\n [identifierAttribute]: `i18n-og-alt-${ogAlt}`,\n property: 'og:locale:alternate',\n content: ogAlt,\n }\n })\n .filter((meta): meta is MetaTag => meta !== null)\n\n const canonicalLink: MetaLink = {\n [identifierAttribute]: 'i18n-can',\n rel: 'canonical',\n href: ogUrl,\n }\n\n const alternateLinks: MetaLink[] = (() => {\n if (!i18nLocaleRoute || !routerStrategy) {\n return []\n }\n\n const hrefByCode = new Map<string, string>()\n const currentPath = routerStrategy.getCurrentPath()\n\n for (const loc of alternateLocales) {\n const switchedPathResult = i18nLocaleRoute(currentPath, loc.code)\n const switchedPath = typeof switchedPathResult === 'string' ? switchedPathResult : switchedPathResult?.path || '/'\n if (!switchedPath) continue\n\n let href: string\n if (switchedPath.startsWith('http://') || switchedPath.startsWith('https://')) {\n href = switchedPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n href = `${baseUrlValue}${switchedPath.startsWith('/') ? '' : '/'}${switchedPath}`\n }\n hrefByCode.set(String(loc.code), href)\n }\n\n return resolveHreflangAlternates(alternateLocales, { hreflangBaseLanguage }).flatMap(({ hreflang, localeCode }) => {\n const href = hrefByCode.get(localeCode)\n if (!href) return []\n return [\n {\n [identifierAttribute]: `i18n-alternate-${hreflang}`,\n rel: 'alternate',\n href,\n hreflang,\n } satisfies MetaLink,\n ]\n })\n })()\n\n // Generate x-default hreflang link pointing to the default locale's URL.\n // x-default tells search engines which URL to show when none of the\n // specified languages match the user's browser settings.\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n let xDefaultLink: MetaLink | null = null\n const defaultLocObj = injectedDefaultLocale ? allLocales.find((l: Locale) => l.code === injectedDefaultLocale) : undefined\n if (i18nLocaleRoute && routerStrategy && injectedDefaultLocale && defaultLocObj?.seo !== false) {\n const currentPath = routerStrategy.getCurrentPath()\n const defaultPathResult = i18nLocaleRoute(currentPath, injectedDefaultLocale)\n const defaultPath = typeof defaultPathResult === 'string' ? defaultPathResult : defaultPathResult?.path || '/'\n if (defaultPath) {\n let xDefaultHref: string\n if (defaultPath.startsWith('http://') || defaultPath.startsWith('https://')) {\n xDefaultHref = defaultPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n xDefaultHref = `${baseUrlValue}${defaultPath.startsWith('/') ? '' : '/'}${defaultPath}`\n }\n xDefaultLink = {\n [identifierAttribute]: 'i18n-xd',\n rel: 'alternate',\n href: xDefaultHref,\n hreflang: 'x-default',\n }\n }\n }\n\n metaObject.value = {\n htmlAttrs,\n meta: [...(ogLocaleMeta ? [ogLocaleMeta] : []), ogUrlMeta, ...alternateOgLocalesMeta],\n link: [canonicalLink, ...alternateLinks, ...(xDefaultLink ? [xDefaultLink] : [])],\n }\n }\n\n return {\n metaObject,\n updateMeta,\n }\n}\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Ref, shallowRef } from 'vue'\n\nexport interface VueI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class VueI18n extends BaseI18n {\n private _locale: Ref<string>\n private _fallbackLocale: Ref<string>\n private _currentRoute: Ref<string>\n private _revision: Ref<number>\n\n public readonly storage: TranslationStorage\n\n private listeners: Set<() => void> = new Set()\n\n constructor(options: VueI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n this._locale = shallowRef(options.locale)\n this._fallbackLocale = shallowRef(options.fallbackLocale || options.locale)\n this._currentRoute = shallowRef('index')\n this._revision = shallowRef(0)\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.helper.loadTranslations(lang, msgs)\n }\n }\n }\n\n get locale(): Ref<string> {\n return this._locale\n }\n\n set locale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._locale.value = val\n } else {\n this._locale = val\n }\n }\n\n get fallbackLocale(): Ref<string> {\n return this._fallbackLocale\n }\n\n set fallbackLocale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._fallbackLocale.value = val\n } else {\n this._fallbackLocale = val\n }\n }\n\n get currentRoute(): Ref<string> {\n return this._currentRoute\n }\n\n setRoute(routeName: string): void {\n this._currentRoute.value = routeName\n }\n\n public getLocale(): string {\n return this._locale.value\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale.value\n }\n\n public getRoute(): string {\n return this._currentRoute.value\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public mergeTranslations(locale: string, routeName: string, translations: Translations): void {\n this.helper.mergeTranslation(locale, routeName, translations, true)\n this._revision.value++\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this._revision.value++\n this.notifyListeners()\n }\n\n protected override onTranslationsChanged(): void {\n this._revision.value++\n this.notifyListeners()\n }\n\n public subscribeToChanges(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n\n public getStorage(): TranslationStorage {\n return this.storage\n }\n\n public getRouteCache(): Record<string, Translations> {\n const result: Record<string, Translations> = {}\n for (const [key, value] of this.storage.translations) {\n result[key] = value\n }\n return result\n }\n}\n","import type { Locale, TranslationKey } from '@i18n-micro/types'\nimport type { App, Plugin } from 'vue'\nimport { I18nGroup } from './components/i18n-group'\nimport { I18nLink } from './components/i18n-link'\nimport { I18nSwitcher } from './components/i18n-switcher'\nimport { I18nT } from './components/i18n-t'\nimport { VueI18n, type VueI18nOptions } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface CreateI18nOptions extends VueI18nOptions {\n routingStrategy?: I18nRoutingStrategy\n /**\n * Array of locale configurations\n * If provided, will be automatically provided to the app via I18nLocalesKey\n */\n locales?: Locale[]\n /**\n * Default locale code\n * If provided, will be automatically provided to the app via I18nDefaultLocaleKey\n */\n defaultLocale?: string\n}\n\nexport type I18nPlugin = Plugin & {\n global: VueI18n\n setRoutingStrategy: (strategy: I18nRoutingStrategy) => void\n}\n\nexport function createI18n(options: CreateI18nOptions): I18nPlugin {\n const { routingStrategy, locales, defaultLocale, ...i18nOptions } = options\n const i18n = new VueI18n(i18nOptions)\n\n let currentApp: App | null = null\n let currentStrategy: I18nRoutingStrategy | null = routingStrategy || null\n\n const setRoutingStrategy = (strategy: I18nRoutingStrategy) => {\n currentStrategy = strategy\n if (currentApp) {\n currentApp.provide(I18nRouterKey, strategy)\n }\n }\n\n return {\n global: i18n, // Access to instance outside components\n setRoutingStrategy, // Method for setting adapter after creation\n install(app: App) {\n currentApp = app\n // 1. Provide for useI18n\n app.provide(I18nInjectionKey, i18n)\n\n // 2. Provide routing strategy if provided\n if (currentStrategy) {\n app.provide(I18nRouterKey, currentStrategy)\n }\n\n // 3. Automatically provide locales and defaultLocale if provided in options\n // This improves DX by eliminating the need for manual provide calls\n if (locales) {\n app.provide(I18nLocalesKey, locales)\n }\n if (defaultLocale) {\n app.provide(I18nDefaultLocaleKey, defaultLocale)\n }\n\n // 4. Global properties ($t, $tc, etc.)\n // Note: In templates, these may be called with string literals, so we use TranslationKey type\n app.config.globalProperties.$t = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string | null,\n routeName?: string,\n ) => {\n return i18n.t(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$ts = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string,\n routeName?: string,\n ) => {\n return i18n.ts(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$tc = (key: TranslationKey, count: number | Record<string, string | number | boolean>, defaultValue?: string) => {\n return i18n.tc(key, count, defaultValue)\n }\n app.config.globalProperties.$tn = i18n.tn.bind(i18n)\n app.config.globalProperties.$td = i18n.td.bind(i18n)\n app.config.globalProperties.$tdr = i18n.tdr.bind(i18n)\n app.config.globalProperties.$has = (key: TranslationKey, routeName?: string) => {\n return i18n.has(key, routeName)\n }\n // Provide access to i18n instance via $i18n\n // Using unknown and then casting to avoid any, but Vue's globalProperties requires flexibility\n app.config.globalProperties.$i18n = i18n as any\n\n // 5. Register components\n app.component('I18nT', I18nT)\n app.component('I18nLink', I18nLink)\n app.component('I18nGroup', I18nGroup)\n app.component('I18nSwitcher', I18nSwitcher)\n },\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport type { Router } from 'vue-router'\nimport { RouterLink } from 'vue-router'\nimport type { I18nRoutingStrategy } from './types'\n\n/**\n * Factory for Vue Router adapter\n * Implements routing utilities for Vue Router\n * Uses vue-router APIs for navigation and path resolution\n */\nexport function createVueRouterAdapter(router: Router, locales: Locale[], defaultLocale: string): I18nRoutingStrategy {\n const localeCodes = locales.map((loc) => loc.code)\n\n /**\n * Path resolution logic (add prefix or not)\n */\n const resolvePath = (to: string | { path?: string }, locale: string): string => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n // If path already starts with a locale, remove it\n const first = pathSegments[0]\n if (first !== undefined && localeCodes.includes(first)) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n\n // If default locale - return clean path\n if (locale === defaultLocale) {\n return cleanPath\n }\n\n // Otherwise add prefix\n return `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n linkComponent: RouterLink,\n\n getCurrentPath: () => {\n // currentRoute in Vue Router is reactive\n return router.currentRoute.value.path\n },\n\n push: (target: { path: string }) => {\n router.push(target.path).catch(() => {})\n },\n\n replace: (target: { path: string }) => {\n router.replace(target.path).catch(() => {})\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: router.currentRoute.value.fullPath,\n query: router.currentRoute.value.query,\n }),\n }\n}\n"],"names":["I18nInjectionKey","I18nLocalesKey","I18nDefaultLocaleKey","I18nRouterKey","I18nGroup","defineComponent","props","slots","i18n","inject","translate","key","params","h","I18nLink","routerStrategy","isExternalLink","computed","targetPath","res","isActive","currentPath","linkPath","computedStyle","e","I18nSwitcher","injectedLocales","allLocales","locales","locale","currentLocale","currentLocaleDisabled","l","currentLocaleName","dropdownOpen","ref","wrapperRef","toggleDropdown","event","localeLabel","localeItem","currentLocaleLabel","current","handleSwitchLocale","code","nextTick","newPath","wrapperStyle","buttonStyle","dropdownStyle","itemStyle","linkStyle","activeLinkStyle","iconStyle","openIconStyle","normalizeSlot","slotResult","handleClickOutside","target","isClickInside","isButtonClick","onMounted","onUnmounted","children","buttonContent","dropdownItems","itemChildren","linkContent","result","routeTo","I18nT","attrs","options","route","numberValue","formattedNumber","translation","formattedDate","formattedRelativeDate","count","k","p","dv","lastIndex","slotName","slotFn","placeholder","index","u","n","f","r","d","o","t","g","a","c","s","i","useI18n","router","injectedDefaultLocale","defaultLocale","resolveLocalePath","to","localeCode","val","newLocale","useLocaleHead","addDirAttribute","identifierAttribute","addSeoAttributes","baseUrl","hreflangBaseLanguage","getLocale","getLocales","i18nLocaleRoute","metaObject","filterQuery","fullPath","whitelist","url","filtered","filteredParams","updateMeta","canonicalQueryWhitelist","currentLocaleObj","loc","currentIso","currentOg","resolveOgLocale","currentDir","pathSegments","matchedLocale","localizedPath","canonicalPath","ogUrl","baseUrlValue","localePrefix","htmlAttrs","alternateLocales","warnUnresolvedOgLocale","ogLocaleMeta","ogUrlMeta","alternateOgLocalesMeta","ogAlt","meta","canonicalLink","alternateLinks","hrefByCode","switchedPathResult","switchedPath","href","resolveHreflangAlternates","hreflang","xDefaultLink","defaultLocObj","defaultPathResult","defaultPath","xDefaultHref","VueI18n","BaseI18n","storage","shallowRef","lang","msgs","routeName","translations","merge","cb","value","createI18n","routingStrategy","i18nOptions","currentApp","currentStrategy","strategy","app","defaultValue","createVueRouterAdapter","localeCodes","resolvePath","first","cleanPath","RouterLink"],"mappings":"8JAKaA,SAAiD,MAAM,EACvDC,SAAgD,cAAc,EAC9DC,SAAoD,qBAAqB,EACzEC,SAA0D,sBAAsB,ECEhFC,EAAYC,EAAAA,gBAAgC,CACvD,KAAM,YACN,MAAO,CACL,OAAQ,CACN,KAAM,OACN,SAAU,EAAA,EAEZ,WAAY,CACV,KAAM,OACN,QAAS,EAAA,CACX,EAEF,MAAMC,EAAO,CAAE,MAAAC,GAAS,CACtB,MAAMC,EAAOC,EAAAA,OAAgBT,CAAgB,EAE7C,GAAI,CAACQ,EACH,MAAM,IAAI,MAAM,sFAAsF,EAGxG,MAAME,EAAY,CAACC,EAAaC,IAGvBJ,EAAK,EAAE,GAAGF,EAAM,MAAM,IAAIK,CAAG,GAAsBC,EAAQ,OAAWJ,EAAK,SAAA,CAAU,EAG9F,MAAO,IACLK,EAAAA,EACE,MACA,CACE,MAAO,CAAC,aAAcP,EAAM,UAAU,CAAA,EAExCC,EAAM,UAAU,CAAE,OAAQD,EAAM,OAAQ,EAAGI,EAAW,CAAA,CAE5D,CACF,CAAC,ECvCYI,GAAWT,EAAAA,gBAAgB,CACtC,KAAM,WACN,MAAO,CACL,GAAI,CACF,KAAM,CAAC,OAAQ,MAAM,EACrB,SAAU,EAAA,EAEZ,YAAa,CACX,KAAM,OACN,QAAS,KAAO,CAAA,EAAC,EAEnB,YAAa,CACX,KAAM,SACN,QAAS,MAAA,CACX,EAEF,MAAMC,EAAO,CAAE,MAAAC,GAAS,CACtB,MAAMC,EAAOC,EAAAA,OAAgBT,CAAgB,EACvCe,EAAiBN,EAAAA,OAAwCN,EAAe,MAAS,EAEvF,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,qFAAqF,EAGvG,MAAMQ,EAAiBC,EAAAA,SAAS,IAC1B,OAAOX,EAAM,IAAO,SACf,iEAAiE,KAAKA,EAAM,EA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,IAAKoG,GAAQA,EAAI,IAAI,EAK3CsD,EAAc,CAAC7E,EAAgC5E,IAA2B,CAE9E,MAAMwG,GADO,OAAO5B,GAAO,SAAWA,EAAKA,EAAG,MAAQ,KAC5B,MAAM,GAAG,EAAE,OAAO,OAAO,EAG7C8E,EAAQlD,EAAa,CAAC,EACxBkD,IAAU,QAAaF,EAAY,SAASE,CAAK,GACnDlD,EAAa,MAAA,EAGf,MAAMmD,EAAY,IAAInD,EAAa,KAAK,GAAG,CAAC,GAG5C,OAAIxG,IAAW0E,EACNiF,EAIF,IAAI3J,CAAM,GAAG2J,IAAc,IAAM,GAAKA,CAAS,EACxD,EAEA,MAAO,CACL,cAAeC,GAAAA,WAEf,eAAgB,IAEPpF,EAAO,aAAa,MAAM,KAGnC,KAAO3C,GAA6B,CAClC2C,EAAO,KAAK3C,EAAO,IAAI,EAAE,MAAM,IAAM,CAAC,CAAC,CACzC,EAEA,QAAUA,GAA6B,CACrC2C,EAAO,QAAQ3C,EAAO,IAAI,EAAE,MAAM,IAAM,CAAC,CAAC,CAC5C,EAEA,YAAa,CAAC+C,EAAgC5E,IAAmByJ,EAAY7E,EAAI5E,CAAM,EAEvF,SAAU,KAAO,CACf,SAAUwE,EAAO,aAAa,MAAM,SACpC,MAAOA,EAAO,aAAa,MAAM,KAAA,EACnC,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/injection.ts","../src/components/i18n-group.ts","../src/components/i18n-link.ts","../src/components/i18n-switcher.ts","../src/components/i18n-t.ts","../../utils/dist/resolve-hreflang.mjs","../../utils/dist/resolve-og-locale.mjs","../src/use-i18n.ts","../src/composables/use-locale-head.ts","../src/composer.ts","../src/plugin.ts","../src/router/adapter.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport type { InjectionKey } from 'vue'\nimport type { VueI18n } from './composer'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport const I18nInjectionKey: InjectionKey<VueI18n> = Symbol('i18n')\nexport const I18nLocalesKey: InjectionKey<Locale[]> = Symbol('i18n-locales')\nexport const I18nDefaultLocaleKey: InjectionKey<string> = Symbol('i18n-default-locale')\nexport const I18nRouterKey: InjectionKey<I18nRoutingStrategy> = Symbol('i18n-router-strategy')\n","import type { TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\ninterface I18nGroupProps {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup = defineComponent<I18nGroupProps>({\n name: 'I18nGroup',\n props: {\n prefix: {\n type: String,\n required: true,\n },\n groupClass: {\n type: String,\n default: '',\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nGroup: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const translate = (key: string, params?: Record<string, string | number | boolean>) => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n return i18n.t(`${props.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n }\n\n return () =>\n h(\n 'div',\n {\n class: ['i18n-group', props.groupClass],\n },\n slots.default?.({ prefix: props.prefix, t: translate }),\n )\n },\n})\n","import { type CSSProperties, computed, defineComponent, h, inject, type PropType } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nLink = defineComponent({\n name: 'I18nLink',\n props: {\n to: {\n type: [String, Object] as PropType<string | { path?: string }>,\n required: true,\n },\n activeStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nLink: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const isExternalLink = computed(() => {\n if (typeof props.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(props.to)\n }\n return false\n })\n\n const targetPath = computed(() => {\n if (isExternalLink.value) {\n return props.to as string\n }\n\n if (props.localeRoute) {\n const res = props.localeRoute(props.to)\n return typeof res === 'string' ? res : res.path || '/'\n }\n\n if (!routerStrategy?.resolvePath) {\n return typeof props.to === 'string' ? props.to : props.to.path || '/'\n }\n\n const res = routerStrategy.resolvePath(props.to, i18n.locale.value)\n return typeof res === 'string' ? res : res.path || '/'\n })\n\n const isActive = computed(() => {\n if (isExternalLink.value || !routerStrategy) {\n return false\n }\n\n const currentPath = routerStrategy.getCurrentPath().replace(/#.*$/, '').replace(/\\/$/, '')\n const linkPath = targetPath.value.replace(/#.*$/, '').replace(/\\/$/, '')\n\n return currentPath === linkPath\n })\n\n const computedStyle = computed(() => (isActive.value ? props.activeStyle : {}))\n\n return () => {\n if (isExternalLink.value) {\n return h(\n 'a',\n {\n href: targetPath.value,\n target: '_blank',\n rel: 'noopener noreferrer',\n style: computedStyle.value,\n },\n slots.default?.(),\n )\n }\n\n if (routerStrategy?.linkComponent) {\n return h(\n routerStrategy.linkComponent,\n {\n to: targetPath.value,\n style: computedStyle.value,\n },\n { default: slots.default },\n )\n }\n\n return h(\n 'a',\n {\n href: targetPath.value,\n style: computedStyle.value,\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n if (routerStrategy) {\n routerStrategy.push({ path: targetPath.value })\n } else {\n window.location.href = targetPath.value\n }\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n","import type { Locale } from '@i18n-micro/types'\nimport { type CSSProperties, computed, defineComponent, h, inject, nextTick, onMounted, onUnmounted, type PropType, ref, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nSwitcher = defineComponent({\n name: 'I18nSwitcher',\n props: {\n customLabels: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n customWrapperStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customButtonStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customDropdownStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customItemStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customActiveLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n /**\n * Inline style applied to the switcher button when the *current* locale is\n * marked as `disabled: true` in the locale config.\n *\n * Note: disabled locales are omitted from the dropdown list, but the current\n * locale label is still shown on the button.\n */\n customDisabledLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customIconStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n locales: {\n type: Array as PropType<Locale[]>,\n default: undefined,\n },\n currentLocale: {\n type: [String, Function] as PropType<string | (() => string)>,\n default: undefined,\n },\n getLocaleName: {\n type: Function as PropType<() => string | null>,\n default: undefined,\n },\n switchLocale: {\n type: Function as PropType<(locale: string) => void>,\n default: undefined,\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nSwitcher: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales && !props.locales) {\n throw new Error(\n '[i18n-micro] I18nSwitcher: locales not provided. Make sure app.provide(I18nLocalesKey, locales) is called or pass locales prop.',\n )\n }\n\n const allLocales = computed(() => props.locales || injectedLocales || [])\n const locales = computed(() => allLocales.value.filter((locale) => !locale.disabled))\n const currentLocale = computed(() => {\n if (props.currentLocale !== undefined) {\n return typeof props.currentLocale === 'function' ? props.currentLocale() : props.currentLocale\n }\n return i18n.locale.value\n })\n const currentLocaleDisabled = computed(() => allLocales.value.some((l) => l.code === currentLocale.value && l.disabled))\n const currentLocaleName = computed(() => {\n if (props.getLocaleName) {\n return props.getLocaleName() || null\n }\n // Use `allLocales` (not dropdown-only `locales`) so disabled locales still resolve\n // displayName/customLabels for the currently active button.\n const current = allLocales.value.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n })\n\n const dropdownOpen = ref(false)\n const wrapperRef = ref<HTMLElement | null>(null)\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n dropdownOpen.value = !dropdownOpen.value\n }\n\n const localeLabel = (localeItem: Locale) => {\n const current = props.customLabels[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = computed(() => {\n const current = allLocales.value.find((l) => l.code === currentLocale.value)\n return current ? localeLabel(current) : currentLocaleName.value || currentLocale.value\n })\n\n const handleSwitchLocale = async (code: string) => {\n dropdownOpen.value = false\n await nextTick()\n\n if (props.switchLocale) {\n props.switchLocale(code)\n return\n }\n\n i18n.locale.value = code\n\n if (!routerStrategy) {\n return\n }\n\n const currentPath = routerStrategy.getCurrentPath()\n const newPath = props.localeRoute\n ? (() => {\n const res = props.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : routerStrategy?.resolvePath\n ? (() => {\n const res = routerStrategy.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n routerStrategy.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n verticalAlign: 'middle',\n }\n\n const buttonStyle: CSSProperties = {\n padding: '4px 12px',\n fontSize: '16px',\n cursor: 'pointer',\n backgroundColor: '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }\n\n const dropdownStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n zIndex: 1000,\n backgroundColor: '#fff',\n border: '1px solid #333',\n listStyle: 'none',\n padding: '0',\n margin: '4px 0 0 0',\n minWidth: '150px',\n boxShadow: '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n textDecoration: 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: CSSProperties = {\n fontWeight: 'bold',\n color: '#007bff',\n // Current locale is not a meaningful switch target\n cursor: 'not-allowed',\n }\n\n const iconStyle: CSSProperties = {\n marginLeft: '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const normalizeSlot = (slotResult: unknown): (VNode | string)[] => {\n if (!slotResult) return []\n return Array.isArray(slotResult) ? slotResult : [slotResult as VNode]\n }\n\n // Simplified and reliable outside click logic\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen.value) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef.value) return\n\n // Check that the click is not inside our wrapper\n const isClickInside = wrapperRef.value.contains(target)\n\n // Also check if the target is the switcher button\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n dropdownOpen.value = false\n }\n }\n\n onMounted(() => {\n // Use regular bubbling, but with a slight delay to give the dropdown time to open\n document.addEventListener('click', handleClickOutside)\n })\n\n onUnmounted(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return () => {\n const children: (VNode | string)[] = []\n\n // 1. Button rendering\n if (slots['before-button']) {\n children.push(...normalizeSlot(slots['before-button']()))\n }\n\n const buttonContent: (VNode | string)[] = []\n if (slots['before-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['before-selected-locale']()))\n }\n\n buttonContent.push(h('span', currentLocaleLabel.value))\n\n if (slots['after-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['after-selected-locale']()))\n }\n\n buttonContent.push(\n h(\n 'span',\n {\n style: {\n ...iconStyle,\n ...(dropdownOpen.value ? openIconStyle : {}),\n ...props.customIconStyle,\n },\n },\n '▼',\n ),\n )\n\n children.push(\n h(\n 'button',\n {\n class: 'i18n-switcher-button',\n style: {\n ...buttonStyle,\n ...props.customButtonStyle,\n ...(currentLocaleDisabled.value ? props.customDisabledLinkStyle : {}),\n },\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n },\n type: 'button',\n ariaHaspopup: true,\n ariaExpanded: dropdownOpen.value,\n },\n buttonContent,\n ),\n )\n\n // 2. Dropdown rendering\n if (slots['before-dropdown']) {\n children.push(...normalizeSlot(slots['before-dropdown']()))\n }\n\n if (dropdownOpen.value) {\n const dropdownItems: VNode[] = []\n\n if (slots['before-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['before-dropdown-items']()) as VNode[]))\n }\n\n locales.value.forEach((localeItem) => {\n const itemChildren: (VNode | string)[] = []\n\n if (slots['before-item']) {\n itemChildren.push(...normalizeSlot(slots['before-item']({ locale: localeItem })))\n }\n\n const linkContent: (VNode | string)[] = []\n if (slots['before-link-content']) {\n linkContent.push(...normalizeSlot(slots['before-link-content']({ locale: localeItem })))\n }\n linkContent.push(localeLabel(localeItem))\n if (slots['after-link-content']) {\n linkContent.push(...normalizeSlot(slots['after-link-content']({ locale: localeItem })))\n }\n\n const currentPath = typeof window !== 'undefined' ? window.location.pathname : '/'\n const result = props.localeRoute\n ? props.localeRoute(currentPath, localeItem.code)\n : routerStrategy?.resolvePath\n ? routerStrategy.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result.path || '#'\n const isActive = localeItem.code === currentLocale.value\n\n itemChildren.push(\n h(\n 'a',\n {\n class: `switcher-locale-${localeItem.code}`,\n href: typeof routeTo === 'string' ? routeTo : '#',\n style: {\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...props.customLinkStyle,\n // active-specific customization wins over the generic link style\n // (matches the React/Preact/Solid switchers)\n ...(isActive ? props.customActiveLinkStyle : {}),\n },\n // Prevent default navigation, use only handleSwitchLocale\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n },\n },\n linkContent,\n ),\n )\n\n if (slots['after-item']) {\n itemChildren.push(...normalizeSlot(slots['after-item']({ locale: localeItem })))\n }\n\n dropdownItems.push(\n h(\n 'li',\n {\n key: localeItem.code,\n style: { ...itemStyle, ...props.customItemStyle },\n },\n itemChildren,\n ),\n )\n })\n\n if (slots['after-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['after-dropdown-items']()) as VNode[]))\n }\n\n // Render UL right here, WITHOUT Teleport\n children.push(\n h(\n 'ul',\n {\n class: 'i18n-switcher-dropdown',\n style: { ...dropdownStyle, ...props.customDropdownStyle },\n },\n dropdownItems,\n ),\n )\n }\n\n if (slots['after-dropdown']) {\n children.push(...normalizeSlot(slots['after-dropdown']()))\n }\n\n // Return wrapper with ref\n return h(\n 'div',\n {\n ref: wrapperRef,\n class: 'i18n-switcher-wrapper',\n style: { ...wrapperStyle, ...props.customWrapperStyle },\n },\n children,\n )\n }\n },\n})\n","import type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject, type PropType, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\nexport const I18nT = defineComponent({\n name: 'I18nT',\n props: {\n keypath: {\n type: String as PropType<TranslationKey>,\n required: true,\n },\n plural: {\n type: [Number, String] as PropType<number | string>,\n },\n tag: {\n type: String as PropType<string>,\n default: 'span',\n },\n params: {\n type: Object as PropType<Record<string, string | number | boolean>>,\n default: () => ({}),\n },\n defaultValue: {\n type: String as PropType<string>,\n default: '',\n },\n html: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n hideIfEmpty: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n customPluralRule: {\n type: Function as PropType<PluralFunc>,\n default: null,\n },\n number: {\n type: [Number, String] as PropType<number | string>,\n },\n date: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n relativeDate: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n },\n setup(props, { slots, attrs }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nT: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n return () => {\n const options: Record<string, string | number | boolean> = {}\n const route = i18n.getRoute()\n\n // Handle number formatting\n if (props.number !== undefined) {\n const numberValue = Number(props.number)\n const formattedNumber = i18n.tn(numberValue)\n const translation = i18n.t(props.keypath, { number: formattedNumber, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle date formatting\n if (props.date !== undefined) {\n const formattedDate = i18n.td(props.date)\n const translation = i18n.t(props.keypath, { date: formattedDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle relative date formatting\n if (props.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(props.relativeDate)\n const translation = i18n.t(props.keypath, { relativeDate: formattedRelativeDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle pluralization\n if (props.plural !== undefined) {\n const count = Number.parseInt(props.plural.toString(), 10)\n if (props.customPluralRule) {\n const translation = props.customPluralRule(\n props.keypath,\n count,\n props.params,\n i18n.locale.value,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return h(props.tag, { ...attrs, innerHTML: translation || '' })\n } else {\n const translation = i18n.tc(props.keypath, { count, ...props.params })\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n }\n\n // Regular translation\n const translation = (i18n.t(props.keypath, { ...props.params, ...options }, undefined, route) ?? '').toString()\n\n if (props.hideIfEmpty && !translation.trim()) {\n return props.defaultValue ?? null\n }\n\n if (props.html) {\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle slots\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ translation }))\n }\n\n // Handle named slots for interpolation\n const children: (string | VNode)[] = []\n let lastIndex = 0\n\n for (const [slotName, slotFn] of Object.entries(slots)) {\n if (slotName === 'default') continue\n\n const placeholder = `{${slotName}}`\n const index = translation.indexOf(placeholder, lastIndex)\n\n if (index !== -1) {\n if (index > lastIndex) {\n children.push(translation.slice(lastIndex, index))\n }\n\n if (slotFn) {\n children.push(h(slotFn))\n }\n\n lastIndex = index + placeholder.length\n }\n }\n\n if (lastIndex < translation.length) {\n children.push(translation.slice(lastIndex))\n }\n\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ children }))\n }\n\n if (children.length > 0) {\n return h(props.tag, attrs, children)\n }\n\n return h(props.tag, attrs, translation)\n }\n },\n})\n","function u(n) {\n return n.iso?.trim() || String(n.code);\n}\nfunction f(n) {\n const r = n.match(/^([A-Za-z]{2,3})(?:[-_](.+))?$/);\n return r ? { language: r[1], region: r[2] } : { language: n };\n}\nfunction d(n, r = {}) {\n const { hreflangBaseLanguage: l = !1 } = r;\n if (!l)\n return n.map((o) => {\n const t = String(o.code);\n return { hreflang: u(o), localeCode: t };\n });\n const g = /* @__PURE__ */ new Map();\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && !g.has(e) && g.set(e, t), g.set(a, t);\n }\n const s = /* @__PURE__ */ new Set(), c = [];\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && g.get(e) === t && !s.has(e) && (s.add(e), c.push({ hreflang: e, localeCode: t })), s.has(a) || (s.add(a), c.push({ hreflang: a, localeCode: t }));\n }\n return c;\n}\nexport {\n d as resolveHreflangAlternates\n};\n","function c(n) {\n const t = n.og?.trim();\n if (t) return t;\n const e = n.iso?.trim();\n if (!e) return null;\n const r = e.indexOf(\"_\");\n if (r > 0) {\n const s = e.slice(0, r), o = e.slice(r + 1);\n if (s.length >= 2 && o.length === 2)\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n const i = e.indexOf(\"-\");\n if (i > 0) {\n const s = e.slice(0, i), o = e.slice(i + 1);\n if (s.length >= 2 && o.length === 2 && /^[A-Za-z]{2}$/.test(o))\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n return null;\n}\nfunction l(n, t = {}) {\n if (c(n) !== null || t.missingWarn === !1 || process.env.NODE_ENV === \"production\") return;\n const e = t.tag ?? \"og:locale\", r = String(n.code ?? \"unknown\"), i = n.iso ? `, iso: '${n.iso}'` : \"\";\n console.warn(\n `[i18n] Cannot derive ${e} for locale '${r}'${i}. Set locale.og (e.g. 'en_US') or use iso with a 2-letter region (e.g. 'en-US').`\n );\n}\nexport {\n c as resolveOgLocale,\n l as warnUnresolvedOgLocale\n};\n","import type { Locale } from '@i18n-micro/types'\nimport { computed, inject } from 'vue'\nimport type { VueI18n } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\n/**\n * Get the i18n instance from the Vue app context\n * Returns the same instance that was created with createI18n()\n */\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const router = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] useI18n() must be called after app.use(i18n). Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales) {\n throw new Error('[i18n-micro] I18nLocalesKey not provided. Make sure app.provide(I18nLocalesKey, locales) is called.')\n }\n\n if (!injectedDefaultLocale) {\n throw new Error('[i18n-micro] I18nDefaultLocaleKey not provided. Make sure app.provide(I18nDefaultLocaleKey, defaultLocale) is called.')\n }\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.locale.value)\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive)\n locale: computed({\n get: () => i18n.locale.value,\n set: (val: string) => {\n i18n.locale.value = val\n },\n }),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n const current = locales.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale.value = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n resolveTranslations: i18n.resolveTranslations.bind(i18n),\n setTranslation: i18n.setTranslation.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.locale.value,\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n mergeTranslations: i18n.mergeTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { resolveHreflangAlternates } from '@i18n-micro/utils/resolve-hreflang'\nimport { resolveOgLocale, warnUnresolvedOgLocale } from '@i18n-micro/utils/resolve-og-locale'\nimport { inject, ref } from 'vue'\nimport { I18nDefaultLocaleKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\nimport { useI18n } from '../use-i18n'\n\ninterface MetaLink {\n [key: string]: string | undefined\n rel: string\n href: string\n hreflang?: string\n}\n\ninterface MetaTag {\n [key: string]: string\n property: string\n content: string\n}\n\ninterface MetaObject {\n htmlAttrs: {\n lang?: string\n dir?: 'ltr' | 'rtl' | 'auto'\n }\n link: MetaLink[]\n meta: MetaTag[]\n}\n\nexport interface UseLocaleHeadOptions {\n addDirAttribute?: boolean\n identifierAttribute?: string\n addSeoAttributes?: boolean\n baseUrl?: string | (() => string)\n /**\n * Also emit bare-language `hreflang` tags derived from `iso` (never from routing `code`).\n * @default false\n */\n hreflangBaseLanguage?: boolean\n}\n\nexport function useLocaleHead(options: UseLocaleHeadOptions = {}) {\n const { addDirAttribute = true, identifierAttribute = 'id', addSeoAttributes = true, baseUrl = '/', hreflangBaseLanguage = false } = options\n\n const { getLocale, getLocales, localeRoute: i18nLocaleRoute } = useI18n()\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n const metaObject = ref<MetaObject>({\n htmlAttrs: {},\n link: [],\n meta: [],\n })\n\n function filterQuery(fullPath: string, whitelist: string[]): string {\n const url = new URL(fullPath, 'http://localhost')\n const params = new URLSearchParams(url.search)\n const filtered: Record<string, string> = {}\n for (const key of whitelist) {\n if (params.has(key)) {\n filtered[key] = params.get(key) as string\n }\n }\n const filteredParams = new URLSearchParams(filtered)\n return filteredParams.toString() ? `${url.pathname}?${filteredParams.toString()}` : url.pathname\n }\n\n function updateMeta(canonicalQueryWhitelist: string[] = []) {\n if (!routerStrategy) {\n metaObject.value = { htmlAttrs: {}, link: [], meta: [] }\n return\n }\n\n const locale = getLocale()\n const allLocales = getLocales()\n const currentLocaleObj = allLocales.find((loc: Locale) => loc.code === locale)\n\n if (!currentLocaleObj) {\n return\n }\n\n const currentIso = currentLocaleObj.iso || locale\n const currentOg = resolveOgLocale(currentLocaleObj)\n const currentDir = currentLocaleObj.dir || 'auto'\n\n let fullPath = routerStrategy.getCurrentPath()\n if (!fullPath.startsWith('/')) {\n fullPath = `/${fullPath}`\n }\n\n const pathSegments = fullPath.split('/').filter(Boolean)\n const matchedLocale = allLocales.find((localeItem: Locale) => pathSegments[0] === localeItem.code)\n\n let localizedPath = fullPath\n let canonicalPath: string\n\n let ogUrl: string\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n\n if (matchedLocale) {\n localizedPath = fullPath.slice(matchedLocale.code.length + 1) || '/'\n canonicalPath = filterQuery(localizedPath, canonicalQueryWhitelist)\n const localePrefix = `/${locale}`\n ogUrl = `${baseUrlValue}${localePrefix}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n } else {\n canonicalPath = filterQuery(fullPath, canonicalQueryWhitelist)\n ogUrl = `${baseUrlValue}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n }\n\n const htmlAttrs = {\n lang: currentIso,\n ...(addDirAttribute ? { dir: currentDir } : {}),\n }\n\n if (!addSeoAttributes) {\n metaObject.value = { htmlAttrs, link: [], meta: [] }\n return\n }\n\n const alternateLocales = allLocales.filter((loc: Locale) => !loc.disabled && loc.seo !== false)\n\n if (!currentOg) {\n warnUnresolvedOgLocale(currentLocaleObj, { tag: 'og:locale' })\n }\n\n const ogLocaleMeta: MetaTag | null = currentOg\n ? {\n [identifierAttribute]: 'i18n-og',\n property: 'og:locale',\n content: currentOg,\n }\n : null\n\n const ogUrlMeta: MetaTag = {\n [identifierAttribute]: 'i18n-og-url',\n property: 'og:url',\n content: ogUrl,\n }\n\n const alternateOgLocalesMeta = alternateLocales\n .filter((loc: Locale) => loc.code !== locale)\n .map((loc: Locale) => {\n const ogAlt = resolveOgLocale(loc)\n if (!ogAlt) {\n warnUnresolvedOgLocale(loc, { tag: 'og:locale:alternate' })\n return null\n }\n return {\n [identifierAttribute]: `i18n-og-alt-${ogAlt}`,\n property: 'og:locale:alternate',\n content: ogAlt,\n }\n })\n .filter((meta): meta is MetaTag => meta !== null)\n\n const canonicalLink: MetaLink = {\n [identifierAttribute]: 'i18n-can',\n rel: 'canonical',\n href: ogUrl,\n }\n\n const alternateLinks: MetaLink[] = (() => {\n if (!i18nLocaleRoute || !routerStrategy) {\n return []\n }\n\n const hrefByCode = new Map<string, string>()\n const currentPath = routerStrategy.getCurrentPath()\n\n for (const loc of alternateLocales) {\n const switchedPathResult = i18nLocaleRoute(currentPath, loc.code)\n const switchedPath = typeof switchedPathResult === 'string' ? switchedPathResult : switchedPathResult?.path || '/'\n if (!switchedPath) continue\n\n let href: string\n if (switchedPath.startsWith('http://') || switchedPath.startsWith('https://')) {\n href = switchedPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n href = `${baseUrlValue}${switchedPath.startsWith('/') ? '' : '/'}${switchedPath}`\n }\n hrefByCode.set(String(loc.code), href)\n }\n\n return resolveHreflangAlternates(alternateLocales, { hreflangBaseLanguage }).flatMap(({ hreflang, localeCode }) => {\n const href = hrefByCode.get(localeCode)\n if (!href) return []\n return [\n {\n [identifierAttribute]: `i18n-alternate-${hreflang}`,\n rel: 'alternate',\n href,\n hreflang,\n } satisfies MetaLink,\n ]\n })\n })()\n\n // Generate x-default hreflang link pointing to the default locale's URL.\n // x-default tells search engines which URL to show when none of the\n // specified languages match the user's browser settings.\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n let xDefaultLink: MetaLink | null = null\n const defaultLocObj = injectedDefaultLocale ? allLocales.find((l: Locale) => l.code === injectedDefaultLocale) : undefined\n if (i18nLocaleRoute && routerStrategy && injectedDefaultLocale && defaultLocObj?.seo !== false) {\n const currentPath = routerStrategy.getCurrentPath()\n const defaultPathResult = i18nLocaleRoute(currentPath, injectedDefaultLocale)\n const defaultPath = typeof defaultPathResult === 'string' ? defaultPathResult : defaultPathResult?.path || '/'\n if (defaultPath) {\n let xDefaultHref: string\n if (defaultPath.startsWith('http://') || defaultPath.startsWith('https://')) {\n xDefaultHref = defaultPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n xDefaultHref = `${baseUrlValue}${defaultPath.startsWith('/') ? '' : '/'}${defaultPath}`\n }\n xDefaultLink = {\n [identifierAttribute]: 'i18n-xd',\n rel: 'alternate',\n href: xDefaultHref,\n hreflang: 'x-default',\n }\n }\n }\n\n metaObject.value = {\n htmlAttrs,\n meta: [...(ogLocaleMeta ? [ogLocaleMeta] : []), ogUrlMeta, ...alternateOgLocalesMeta],\n link: [canonicalLink, ...alternateLinks, ...(xDefaultLink ? [xDefaultLink] : [])],\n }\n }\n\n return {\n metaObject,\n updateMeta,\n }\n}\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Ref, shallowRef } from 'vue'\n\nexport interface VueI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class VueI18n extends BaseI18n {\n private _locale: Ref<string>\n private _fallbackLocale: Ref<string>\n private _currentRoute: Ref<string>\n private _revision: Ref<number>\n\n public readonly storage: TranslationStorage\n\n private listeners: Set<() => void> = new Set()\n\n constructor(options: VueI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n this._locale = shallowRef(options.locale)\n this._fallbackLocale = shallowRef(options.fallbackLocale || options.locale)\n this._currentRoute = shallowRef('index')\n this._revision = shallowRef(0)\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.helper.loadTranslations(lang, msgs)\n }\n }\n }\n\n get locale(): Ref<string> {\n return this._locale\n }\n\n set locale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._locale.value = val\n } else {\n this._locale = val\n }\n }\n\n get fallbackLocale(): Ref<string> {\n return this._fallbackLocale\n }\n\n set fallbackLocale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._fallbackLocale.value = val\n } else {\n this._fallbackLocale = val\n }\n }\n\n get currentRoute(): Ref<string> {\n return this._currentRoute\n }\n\n setRoute(routeName: string): void {\n this._currentRoute.value = routeName\n }\n\n public getLocale(): string {\n return this._locale.value\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale.value\n }\n\n public getRoute(): string {\n return this._currentRoute.value\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public mergeTranslations(locale: string, routeName: string, translations: Translations): void {\n this.helper.mergeTranslation(locale, routeName, translations, true)\n this._revision.value++\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this._revision.value++\n this.notifyListeners()\n }\n\n protected override onTranslationsChanged(): void {\n this._revision.value++\n this.notifyListeners()\n }\n\n public subscribeToChanges(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n\n public getStorage(): TranslationStorage {\n return this.storage\n }\n\n public getRouteCache(): Record<string, Translations> {\n const result: Record<string, Translations> = {}\n for (const [key, value] of this.storage.translations) {\n result[key] = value\n }\n return result\n }\n}\n","import type { Locale, TranslationKey } from '@i18n-micro/types'\nimport type { App, Plugin } from 'vue'\nimport { I18nGroup } from './components/i18n-group'\nimport { I18nLink } from './components/i18n-link'\nimport { I18nSwitcher } from './components/i18n-switcher'\nimport { I18nT } from './components/i18n-t'\nimport { VueI18n, type VueI18nOptions } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface CreateI18nOptions extends VueI18nOptions {\n routingStrategy?: I18nRoutingStrategy\n /**\n * Array of locale configurations\n * If provided, will be automatically provided to the app via I18nLocalesKey\n */\n locales?: Locale[]\n /**\n * Default locale code\n * If provided, will be automatically provided to the app via I18nDefaultLocaleKey\n */\n defaultLocale?: string\n}\n\nexport type I18nPlugin = Plugin & {\n global: VueI18n\n setRoutingStrategy: (strategy: I18nRoutingStrategy) => void\n}\n\nexport function createI18n(options: CreateI18nOptions): I18nPlugin {\n const { routingStrategy, locales, defaultLocale, ...i18nOptions } = options\n const i18n = new VueI18n(i18nOptions)\n\n let currentApp: App | null = null\n let currentStrategy: I18nRoutingStrategy | null = routingStrategy || null\n\n const setRoutingStrategy = (strategy: I18nRoutingStrategy) => {\n currentStrategy = strategy\n if (currentApp) {\n currentApp.provide(I18nRouterKey, strategy)\n }\n }\n\n return {\n global: i18n, // Access to instance outside components\n setRoutingStrategy, // Method for setting adapter after creation\n install(app: App) {\n currentApp = app\n // 1. Provide for useI18n\n app.provide(I18nInjectionKey, i18n)\n\n // 2. Provide routing strategy if provided\n if (currentStrategy) {\n app.provide(I18nRouterKey, currentStrategy)\n }\n\n // 3. Automatically provide locales and defaultLocale if provided in options\n // This improves DX by eliminating the need for manual provide calls\n if (locales) {\n app.provide(I18nLocalesKey, locales)\n }\n if (defaultLocale) {\n app.provide(I18nDefaultLocaleKey, defaultLocale)\n }\n\n // 4. Global properties ($t, $tc, etc.)\n // Note: In templates, these may be called with string literals, so we use TranslationKey type\n app.config.globalProperties.$t = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string | null,\n routeName?: string,\n ) => {\n return i18n.t(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$ts = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string,\n routeName?: string,\n ) => {\n return i18n.ts(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$tc = (key: TranslationKey, count: number | Record<string, string | number | boolean>, defaultValue?: string) => {\n return i18n.tc(key, count, defaultValue)\n }\n app.config.globalProperties.$tn = i18n.tn.bind(i18n)\n app.config.globalProperties.$td = i18n.td.bind(i18n)\n app.config.globalProperties.$tdr = i18n.tdr.bind(i18n)\n app.config.globalProperties.$has = (key: TranslationKey, routeName?: string) => {\n return i18n.has(key, routeName)\n }\n // Provide access to i18n instance via $i18n\n // Using unknown and then casting to avoid any, but Vue's globalProperties requires flexibility\n app.config.globalProperties.$i18n = i18n as any\n\n // 5. Register components\n app.component('I18nT', I18nT)\n app.component('I18nLink', I18nLink)\n app.component('I18nGroup', I18nGroup)\n app.component('I18nSwitcher', I18nSwitcher)\n },\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport type { Router } from 'vue-router'\nimport { RouterLink } from 'vue-router'\nimport type { I18nRoutingStrategy } from './types'\n\n/**\n * Factory for Vue Router adapter\n * Implements routing utilities for Vue Router\n * Uses vue-router APIs for navigation and path resolution\n */\nexport function createVueRouterAdapter(router: Router, locales: Locale[], defaultLocale: string): I18nRoutingStrategy {\n const localeCodes = locales.map((loc) => loc.code)\n\n /**\n * Path resolution logic (add prefix or not)\n */\n const resolvePath = (to: string | { path?: string }, locale: string): string => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n // If path already starts with a locale, remove it\n const first = pathSegments[0]\n if (first !== undefined && localeCodes.includes(first)) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n\n // If default locale - return clean path\n if (locale === defaultLocale) {\n return cleanPath\n }\n\n // Otherwise add prefix\n return `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n linkComponent: RouterLink,\n\n getCurrentPath: () => {\n // currentRoute in Vue Router is reactive\n return router.currentRoute.value.path\n },\n\n push: (target: { path: string }) => {\n router.push(target.path).catch(() => {})\n },\n\n replace: (target: { path: string }) => {\n router.replace(target.path).catch(() => {})\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: router.currentRoute.value.fullPath,\n query: router.currentRoute.value.query,\n }),\n }\n}\n"],"names":["I18nInjectionKey","I18nLocalesKey","I18nDefaultLocaleKey","I18nRouterKey","I18nGroup","defineComponent","props","slots","i18n","inject","translate","key","params","h","I18nLink","routerStrategy","isExternalLink","computed","targetPath","res","isActive","currentPath","linkPath","computedStyle","e","I18nSwitcher","injectedLocales","allLocales","locales","locale","currentLocale","currentLocaleDisabled","l","currentLocaleName","dropdownOpen","ref","wrapperRef","toggleDropdown","event","localeLabel","localeItem","currentLocaleLabel","current","handleSwitchLocale","code","nextTick","newPath","wrapperStyle","buttonStyle","dropdownStyle","itemStyle","linkStyle","activeLinkStyle","iconStyle","openIconStyle","normalizeSlot","slotResult","handleClickOutside","target","isClickInside","isButtonClick","onMounted","onUnmounted","children","buttonContent","dropdownItems","itemChildren","linkContent","result","routeTo","I18nT","attrs","options","route","numberValue","formattedNumber","translation","formattedDate","formattedRelativeDate","count","k","p","dv","lastIndex","slotName","slotFn","placeholder","index","u","n","f","r","d","o","t","g","a","c","s","i","useI18n","router","injectedDefaultLocale","defaultLocale","resolveLocalePath","to","localeCode","val","newLocale","useLocaleHead","addDirAttribute","identifierAttribute","addSeoAttributes","baseUrl","hreflangBaseLanguage","getLocale","getLocales","i18nLocaleRoute","metaObject","filterQuery","fullPath","whitelist","url","filtered","filteredParams","updateMeta","canonicalQueryWhitelist","currentLocaleObj","loc","currentIso","currentOg","resolveOgLocale","currentDir","pathSegments","matchedLocale","localizedPath","canonicalPath","ogUrl","baseUrlValue","localePrefix","htmlAttrs","alternateLocales","warnUnresolvedOgLocale","ogLocaleMeta","ogUrlMeta","alternateOgLocalesMeta","ogAlt","meta","canonicalLink","alternateLinks","hrefByCode","switchedPathResult","switchedPath","href","resolveHreflangAlternates","hreflang","xDefaultLink","defaultLocObj","defaultPathResult","defaultPath","xDefaultHref","VueI18n","BaseI18n","storage","shallowRef","lang","msgs","routeName","translations","merge","cb","value","createI18n","routingStrategy","i18nOptions","currentApp","currentStrategy","strategy","app","defaultValue","createVueRouterAdapter","localeCodes","resolvePath","first","cleanPath","RouterLink"],"mappings":"8JAKaA,SAAiD,MAAM,EACvDC,SAAgD,cAAc,EAC9DC,SAAoD,qBAAqB,EACzEC,SAA0D,sBAAsB,ECEhFC,EAAYC,EAAAA,gBAAgC,CACvD,KAAM,YACN,MAAO,CACL,OAAQ,CACN,KAAM,OACN,SAAU,EAAA,EAEZ,WAAY,CACV,KAAM,OACN,QAAS,EAAA,CACX,EAEF,MAAMC,EAAO,CAAE,MAAAC,GAAS,CACtB,MAAMC,EAAOC,EAAAA,OAAgBT,CAAgB,EAE7C,GAAI,CAACQ,EACH,MAAM,IAAI,MAAM,sFAAsF,EAGxG,MAAME,EAAY,CAACC,EAAaC,IAGvBJ,EAAK,EAAE,GAAGF,EAAM,MAAM,IAAIK,CAAG,GAAsBC,EAAQ,OAAWJ,EAAK,SAAA,CAAU,EAG9F,MAAO,IACLK,EAAAA,EACE,MACA,CACE,MAAO,CAAC,aAAcP,EAAM,UAAU,CAAA,EAExCC,EAAM,UAAU,CAAE,OAAQD,EAAM,OAAQ,EAAGI,EAAW,CAAA,CAE5D,CACF,CAAC,ECvCYI,GAAWT,EAAAA,gBAAgB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,SAAU,KAAO,CACf,SAAUwE,EAAO,aAAa,MAAM,SACpC,MAAOA,EAAO,aAAa,MAAM,KAAA,EACnC,CAEJ"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as q, inject as S, h as g, computed as k, ref as Q, onMounted as ae, onUnmounted as oe, nextTick as re, shallowRef as z } from "vue";
2
2
  import { BaseI18n as le } from "@i18n-micro/core";
3
- import { FormatService as Pe, defaultPlural as Re, interpolate as $e } from "@i18n-micro/core";
3
+ import { FormatService as Pe, defaultPlural as $e, interpolate as Re } from "@i18n-micro/core";
4
4
  import { RouterLink as ie } from "vue-router";
5
5
  const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-locales"), ee = /* @__PURE__ */ Symbol("i18n-default-locale"), U = /* @__PURE__ */ Symbol("i18n-router-strategy"), ce = q({
6
6
  name: "I18nGroup",
@@ -61,7 +61,7 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
61
61
  }), s = k(() => {
62
62
  if (c.value || !o)
63
63
  return !1;
64
- const i = o.getCurrentPath().replace(/\/$/, ""), n = r.value.replace(/\/$/, "");
64
+ const i = o.getCurrentPath().replace(/#.*$/, "").replace(/\/$/, ""), n = r.value.replace(/#.*$/, "").replace(/\/$/, "");
65
65
  return i === n;
66
66
  }), f = k(() => s.value ? t.activeStyle : {});
67
67
  return () => c.value ? g(
@@ -167,10 +167,10 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
167
167
  throw new Error(
168
168
  "[i18n-micro] I18nSwitcher: locales not provided. Make sure app.provide(I18nLocalesKey, locales) is called or pass locales prop."
169
169
  );
170
- const r = k(() => t.locales || c || []), s = k(() => r.value.filter((u) => !u.disabled)), f = k(() => t.currentLocale !== void 0 ? typeof t.currentLocale == "function" ? t.currentLocale() : t.currentLocale : a.locale.value), i = k(() => r.value.some((u) => u.code === f.value && u.disabled)), n = k(() => t.getLocaleName ? t.getLocaleName() || null : r.value.find((y) => y.code === a.locale.value)?.displayName || null), l = Q(!1), m = Q(null), v = (u) => {
170
+ const r = k(() => t.locales || c || []), s = k(() => r.value.filter((u) => !u.disabled)), f = k(() => t.currentLocale !== void 0 ? typeof t.currentLocale == "function" ? t.currentLocale() : t.currentLocale : a.locale.value), i = k(() => r.value.some((u) => u.code === f.value && u.disabled)), n = k(() => t.getLocaleName ? t.getLocaleName() || null : r.value.find((p) => p.code === a.locale.value)?.displayName || null), l = Q(!1), m = Q(null), v = (u) => {
171
171
  u && (u.stopPropagation(), u.preventDefault()), l.value = !l.value;
172
172
  }, L = (u) => t.customLabels[u.code] || u.displayName || u.code, T = k(() => {
173
- const u = r.value.find((y) => y.code === f.value);
173
+ const u = r.value.find((p) => p.code === f.value);
174
174
  return u ? L(u) : n.value || f.value;
175
175
  }), P = async (u) => {
176
176
  if (l.value = !1, await re(), t.switchLocale) {
@@ -179,15 +179,15 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
179
179
  }
180
180
  if (a.locale.value = u, !o)
181
181
  return;
182
- const y = o.getCurrentPath(), b = t.localeRoute ? (() => {
183
- const d = t.localeRoute(y, u);
182
+ const p = o.getCurrentPath(), b = t.localeRoute ? (() => {
183
+ const d = t.localeRoute(p, u);
184
184
  return typeof d == "string" ? d : d.path || "/";
185
185
  })() : o?.resolvePath ? (() => {
186
- const d = o.resolvePath(y, u);
186
+ const d = o.resolvePath(p, u);
187
187
  return typeof d == "string" ? d : d.path || "/";
188
- })() : y;
188
+ })() : p;
189
189
  o.push({ path: b });
190
- }, R = {
190
+ }, $ = {
191
191
  position: "relative",
192
192
  display: "inline-block",
193
193
  verticalAlign: "middle"
@@ -234,11 +234,11 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
234
234
  transition: "transform 0.3s ease"
235
235
  }, F = {
236
236
  transform: "rotate(180deg)"
237
- }, p = (u) => u ? Array.isArray(u) ? u : [u] : [], O = (u) => {
237
+ }, y = (u) => u ? Array.isArray(u) ? u : [u] : [], O = (u) => {
238
238
  if (!l.value) return;
239
- const y = u.target;
240
- if (!y || !m.value) return;
241
- const b = m.value.contains(y), d = y.closest(".i18n-switcher-button") !== null;
239
+ const p = u.target;
240
+ if (!p || !m.value) return;
241
+ const b = m.value.contains(p), d = p.closest(".i18n-switcher-button") !== null;
242
242
  !b && !d && (l.value = !1);
243
243
  };
244
244
  return ae(() => {
@@ -247,9 +247,9 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
247
247
  document.removeEventListener("click", O);
248
248
  }), () => {
249
249
  const u = [];
250
- e["before-button"] && u.push(...p(e["before-button"]()));
251
- const y = [];
252
- if (e["before-selected-locale"] && y.push(...p(e["before-selected-locale"]())), y.push(g("span", T.value)), e["after-selected-locale"] && y.push(...p(e["after-selected-locale"]())), y.push(
250
+ e["before-button"] && u.push(...y(e["before-button"]()));
251
+ const p = [];
252
+ if (e["before-selected-locale"] && p.push(...y(e["before-selected-locale"]())), p.push(g("span", T.value)), e["after-selected-locale"] && p.push(...y(e["after-selected-locale"]())), p.push(
253
253
  g(
254
254
  "span",
255
255
  {
@@ -278,15 +278,15 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
278
278
  ariaHaspopup: !0,
279
279
  ariaExpanded: l.value
280
280
  },
281
- y
281
+ p
282
282
  )
283
- ), e["before-dropdown"] && u.push(...p(e["before-dropdown"]())), l.value) {
283
+ ), e["before-dropdown"] && u.push(...y(e["before-dropdown"]())), l.value) {
284
284
  const b = [];
285
- e["before-dropdown-items"] && b.push(...p(e["before-dropdown-items"]())), s.value.forEach((d) => {
285
+ e["before-dropdown-items"] && b.push(...y(e["before-dropdown-items"]())), s.value.forEach((d) => {
286
286
  const A = [];
287
- e["before-item"] && A.push(...p(e["before-item"]({ locale: d })));
287
+ e["before-item"] && A.push(...y(e["before-item"]({ locale: d })));
288
288
  const E = [];
289
- e["before-link-content"] && E.push(...p(e["before-link-content"]({ locale: d }))), E.push(L(d)), e["after-link-content"] && E.push(...p(e["after-link-content"]({ locale: d })));
289
+ e["before-link-content"] && E.push(...y(e["before-link-content"]({ locale: d }))), E.push(L(d)), e["after-link-content"] && E.push(...y(e["after-link-content"]({ locale: d })));
290
290
  const B = typeof window < "u" ? window.location.pathname : "/", H = t.localeRoute ? t.localeRoute(B, d.code) : o?.resolvePath ? o.resolvePath(B, d.code) : B, j = typeof H == "string" ? H : H.path || "#", N = d.code === f.value;
291
291
  A.push(
292
292
  g(
@@ -309,7 +309,7 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
309
309
  },
310
310
  E
311
311
  )
312
- ), e["after-item"] && A.push(...p(e["after-item"]({ locale: d }))), b.push(
312
+ ), e["after-item"] && A.push(...y(e["after-item"]({ locale: d }))), b.push(
313
313
  g(
314
314
  "li",
315
315
  {
@@ -319,7 +319,7 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
319
319
  A
320
320
  )
321
321
  );
322
- }), e["after-dropdown-items"] && b.push(...p(e["after-dropdown-items"]())), u.push(
322
+ }), e["after-dropdown-items"] && b.push(...y(e["after-dropdown-items"]())), u.push(
323
323
  g(
324
324
  "ul",
325
325
  {
@@ -330,12 +330,12 @@ const W = /* @__PURE__ */ Symbol("i18n"), Y = /* @__PURE__ */ Symbol("i18n-local
330
330
  )
331
331
  );
332
332
  }
333
- return e["after-dropdown"] && u.push(...p(e["after-dropdown"]())), g(
333
+ return e["after-dropdown"] && u.push(...y(e["after-dropdown"]())), g(
334
334
  "div",
335
335
  {
336
336
  ref: m,
337
337
  class: "i18n-switcher-wrapper",
338
- style: { ...R, ...t.customWrapperStyle }
338
+ style: { ...$, ...t.customWrapperStyle }
339
339
  },
340
340
  u
341
341
  );
@@ -552,9 +552,9 @@ function be(t = {}) {
552
552
  meta: []
553
553
  });
554
554
  function m(L, T) {
555
- const P = new URL(L, "http://localhost"), R = new URLSearchParams(P.search), M = {};
555
+ const P = new URL(L, "http://localhost"), $ = new URLSearchParams(P.search), M = {};
556
556
  for (const _ of T)
557
- R.has(_) && (M[_] = R.get(_));
557
+ $.has(_) && (M[_] = $.get(_));
558
558
  const D = new URLSearchParams(M);
559
559
  return D.toString() ? `${P.pathname}?${D.toString()}` : P.pathname;
560
560
  }
@@ -563,31 +563,31 @@ function be(t = {}) {
563
563
  l.value = { htmlAttrs: {}, link: [], meta: [] };
564
564
  return;
565
565
  }
566
- const T = s(), P = f(), R = P.find((h) => h.code === T);
567
- if (!R)
566
+ const T = s(), P = f(), $ = P.find((h) => h.code === T);
567
+ if (!$)
568
568
  return;
569
- const M = R.iso || T, D = X(R), _ = R.dir || "auto";
569
+ const M = $.iso || T, D = X($), _ = $.dir || "auto";
570
570
  let C = n.getCurrentPath();
571
571
  C.startsWith("/") || (C = `/${C}`);
572
572
  const G = C.split("/").filter(Boolean), V = P.find((h) => G[0] === h.code);
573
- let F = C, p, O;
573
+ let F = C, y, O;
574
574
  const u = typeof c == "function" ? c() : c;
575
575
  if (V) {
576
- F = C.slice(V.code.length + 1) || "/", p = m(F, L);
576
+ F = C.slice(V.code.length + 1) || "/", y = m(F, L);
577
577
  const h = `/${T}`;
578
- O = `${u}${h}${p.startsWith("/") ? "" : "/"}${p}`;
578
+ O = `${u}${h}${y.startsWith("/") ? "" : "/"}${y}`;
579
579
  } else
580
- p = m(C, L), O = `${u}${p.startsWith("/") ? "" : "/"}${p}`;
581
- const y = {
580
+ y = m(C, L), O = `${u}${y.startsWith("/") ? "" : "/"}${y}`;
581
+ const p = {
582
582
  lang: M,
583
583
  ...e ? { dir: _ } : {}
584
584
  };
585
585
  if (!o) {
586
- l.value = { htmlAttrs: y, link: [], meta: [] };
586
+ l.value = { htmlAttrs: p, link: [], meta: [] };
587
587
  return;
588
588
  }
589
589
  const b = P.filter((h) => !h.disabled && h.seo !== !1);
590
- D || ne(R, { tag: "og:locale" });
590
+ D || ne($, { tag: "og:locale" });
591
591
  const d = D ? {
592
592
  [a]: "i18n-og",
593
593
  property: "og:locale",
@@ -612,18 +612,18 @@ function be(t = {}) {
612
612
  return [];
613
613
  const h = /* @__PURE__ */ new Map(), x = n.getCurrentPath();
614
614
  for (const w of b) {
615
- const I = i(x, w.code), $ = typeof I == "string" ? I : I?.path || "/";
616
- if (!$) continue;
615
+ const I = i(x, w.code), R = typeof I == "string" ? I : I?.path || "/";
616
+ if (!R) continue;
617
617
  let Z;
618
- $.startsWith("http://") || $.startsWith("https://") ? Z = $ : Z = `${typeof c == "function" ? c() : c}${$.startsWith("/") ? "" : "/"}${$}`, h.set(String(w.code), Z);
618
+ R.startsWith("http://") || R.startsWith("https://") ? Z = R : Z = `${typeof c == "function" ? c() : c}${R.startsWith("/") ? "" : "/"}${R}`, h.set(String(w.code), Z);
619
619
  }
620
620
  return de(b, { hreflangBaseLanguage: r }).flatMap(({ hreflang: w, localeCode: I }) => {
621
- const $ = h.get(I);
622
- return $ ? [
621
+ const R = h.get(I);
622
+ return R ? [
623
623
  {
624
624
  [a]: `i18n-alternate-${w}`,
625
625
  rel: "alternate",
626
- href: $,
626
+ href: R,
627
627
  hreflang: w
628
628
  }
629
629
  ] : [];
@@ -644,7 +644,7 @@ function be(t = {}) {
644
644
  }
645
645
  }
646
646
  l.value = {
647
- htmlAttrs: y,
647
+ htmlAttrs: p,
648
648
  meta: [...d ? [d] : [], A, ...E],
649
649
  link: [B, ...H, ...N ? [N] : []]
650
650
  };
@@ -778,8 +778,8 @@ export {
778
778
  ge as VueI18n,
779
779
  Le as createI18n,
780
780
  Se as createVueRouterAdapter,
781
- Re as defaultPlural,
782
- $e as interpolate,
781
+ $e as defaultPlural,
782
+ Re as interpolate,
783
783
  he as useI18n,
784
784
  be as useLocaleHead
785
785
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/injection.ts","../src/components/i18n-group.ts","../src/components/i18n-link.ts","../src/components/i18n-switcher.ts","../src/components/i18n-t.ts","../../utils/dist/resolve-hreflang.mjs","../../utils/dist/resolve-og-locale.mjs","../src/use-i18n.ts","../src/composables/use-locale-head.ts","../src/composer.ts","../src/plugin.ts","../src/router/adapter.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport type { InjectionKey } from 'vue'\nimport type { VueI18n } from './composer'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport const I18nInjectionKey: InjectionKey<VueI18n> = Symbol('i18n')\nexport const I18nLocalesKey: InjectionKey<Locale[]> = Symbol('i18n-locales')\nexport const I18nDefaultLocaleKey: InjectionKey<string> = Symbol('i18n-default-locale')\nexport const I18nRouterKey: InjectionKey<I18nRoutingStrategy> = Symbol('i18n-router-strategy')\n","import type { TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\ninterface I18nGroupProps {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup = defineComponent<I18nGroupProps>({\n name: 'I18nGroup',\n props: {\n prefix: {\n type: String,\n required: true,\n },\n groupClass: {\n type: String,\n default: '',\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nGroup: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const translate = (key: string, params?: Record<string, string | number | boolean>) => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n return i18n.t(`${props.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n }\n\n return () =>\n h(\n 'div',\n {\n class: ['i18n-group', props.groupClass],\n },\n slots.default?.({ prefix: props.prefix, t: translate }),\n )\n },\n})\n","import { type CSSProperties, computed, defineComponent, h, inject, type PropType } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nLink = defineComponent({\n name: 'I18nLink',\n props: {\n to: {\n type: [String, Object] as PropType<string | { path?: string }>,\n required: true,\n },\n activeStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nLink: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const isExternalLink = computed(() => {\n if (typeof props.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(props.to)\n }\n return false\n })\n\n const targetPath = computed(() => {\n if (isExternalLink.value) {\n return props.to as string\n }\n\n if (props.localeRoute) {\n const res = props.localeRoute(props.to)\n return typeof res === 'string' ? res : res.path || '/'\n }\n\n if (!routerStrategy?.resolvePath) {\n return typeof props.to === 'string' ? props.to : props.to.path || '/'\n }\n\n const res = routerStrategy.resolvePath(props.to, i18n.locale.value)\n return typeof res === 'string' ? res : res.path || '/'\n })\n\n const isActive = computed(() => {\n if (isExternalLink.value || !routerStrategy) {\n return false\n }\n\n const currentPath = routerStrategy.getCurrentPath().replace(/\\/$/, '')\n const linkPath = targetPath.value.replace(/\\/$/, '')\n\n return currentPath === linkPath\n })\n\n const computedStyle = computed(() => (isActive.value ? props.activeStyle : {}))\n\n return () => {\n if (isExternalLink.value) {\n return h(\n 'a',\n {\n href: targetPath.value,\n target: '_blank',\n rel: 'noopener noreferrer',\n style: computedStyle.value,\n },\n slots.default?.(),\n )\n }\n\n if (routerStrategy?.linkComponent) {\n return h(\n routerStrategy.linkComponent,\n {\n to: targetPath.value,\n style: computedStyle.value,\n },\n { default: slots.default },\n )\n }\n\n return h(\n 'a',\n {\n href: targetPath.value,\n style: computedStyle.value,\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n if (routerStrategy) {\n routerStrategy.push({ path: targetPath.value })\n } else {\n window.location.href = targetPath.value\n }\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n","import type { Locale } from '@i18n-micro/types'\nimport { type CSSProperties, computed, defineComponent, h, inject, nextTick, onMounted, onUnmounted, type PropType, ref, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nSwitcher = defineComponent({\n name: 'I18nSwitcher',\n props: {\n customLabels: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n customWrapperStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customButtonStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customDropdownStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customItemStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customActiveLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n /**\n * Inline style applied to the switcher button when the *current* locale is\n * marked as `disabled: true` in the locale config.\n *\n * Note: disabled locales are omitted from the dropdown list, but the current\n * locale label is still shown on the button.\n */\n customDisabledLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customIconStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n locales: {\n type: Array as PropType<Locale[]>,\n default: undefined,\n },\n currentLocale: {\n type: [String, Function] as PropType<string | (() => string)>,\n default: undefined,\n },\n getLocaleName: {\n type: Function as PropType<() => string | null>,\n default: undefined,\n },\n switchLocale: {\n type: Function as PropType<(locale: string) => void>,\n default: undefined,\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nSwitcher: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales && !props.locales) {\n throw new Error(\n '[i18n-micro] I18nSwitcher: locales not provided. Make sure app.provide(I18nLocalesKey, locales) is called or pass locales prop.',\n )\n }\n\n const allLocales = computed(() => props.locales || injectedLocales || [])\n const locales = computed(() => allLocales.value.filter((locale) => !locale.disabled))\n const currentLocale = computed(() => {\n if (props.currentLocale !== undefined) {\n return typeof props.currentLocale === 'function' ? props.currentLocale() : props.currentLocale\n }\n return i18n.locale.value\n })\n const currentLocaleDisabled = computed(() => allLocales.value.some((l) => l.code === currentLocale.value && l.disabled))\n const currentLocaleName = computed(() => {\n if (props.getLocaleName) {\n return props.getLocaleName() || null\n }\n // Use `allLocales` (not dropdown-only `locales`) so disabled locales still resolve\n // displayName/customLabels for the currently active button.\n const current = allLocales.value.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n })\n\n const dropdownOpen = ref(false)\n const wrapperRef = ref<HTMLElement | null>(null)\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n dropdownOpen.value = !dropdownOpen.value\n }\n\n const localeLabel = (localeItem: Locale) => {\n const current = props.customLabels[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = computed(() => {\n const current = allLocales.value.find((l) => l.code === currentLocale.value)\n return current ? localeLabel(current) : currentLocaleName.value || currentLocale.value\n })\n\n const handleSwitchLocale = async (code: string) => {\n dropdownOpen.value = false\n await nextTick()\n\n if (props.switchLocale) {\n props.switchLocale(code)\n return\n }\n\n i18n.locale.value = code\n\n if (!routerStrategy) {\n return\n }\n\n const currentPath = routerStrategy.getCurrentPath()\n const newPath = props.localeRoute\n ? (() => {\n const res = props.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : routerStrategy?.resolvePath\n ? (() => {\n const res = routerStrategy.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n routerStrategy.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n verticalAlign: 'middle',\n }\n\n const buttonStyle: CSSProperties = {\n padding: '4px 12px',\n fontSize: '16px',\n cursor: 'pointer',\n backgroundColor: '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }\n\n const dropdownStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n zIndex: 1000,\n backgroundColor: '#fff',\n border: '1px solid #333',\n listStyle: 'none',\n padding: '0',\n margin: '4px 0 0 0',\n minWidth: '150px',\n boxShadow: '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n textDecoration: 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: CSSProperties = {\n fontWeight: 'bold',\n color: '#007bff',\n // Current locale is not a meaningful switch target\n cursor: 'not-allowed',\n }\n\n const iconStyle: CSSProperties = {\n marginLeft: '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const normalizeSlot = (slotResult: unknown): (VNode | string)[] => {\n if (!slotResult) return []\n return Array.isArray(slotResult) ? slotResult : [slotResult as VNode]\n }\n\n // Simplified and reliable outside click logic\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen.value) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef.value) return\n\n // Check that the click is not inside our wrapper\n const isClickInside = wrapperRef.value.contains(target)\n\n // Also check if the target is the switcher button\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n dropdownOpen.value = false\n }\n }\n\n onMounted(() => {\n // Use regular bubbling, but with a slight delay to give the dropdown time to open\n document.addEventListener('click', handleClickOutside)\n })\n\n onUnmounted(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return () => {\n const children: (VNode | string)[] = []\n\n // 1. Button rendering\n if (slots['before-button']) {\n children.push(...normalizeSlot(slots['before-button']()))\n }\n\n const buttonContent: (VNode | string)[] = []\n if (slots['before-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['before-selected-locale']()))\n }\n\n buttonContent.push(h('span', currentLocaleLabel.value))\n\n if (slots['after-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['after-selected-locale']()))\n }\n\n buttonContent.push(\n h(\n 'span',\n {\n style: {\n ...iconStyle,\n ...(dropdownOpen.value ? openIconStyle : {}),\n ...props.customIconStyle,\n },\n },\n '▼',\n ),\n )\n\n children.push(\n h(\n 'button',\n {\n class: 'i18n-switcher-button',\n style: {\n ...buttonStyle,\n ...props.customButtonStyle,\n ...(currentLocaleDisabled.value ? props.customDisabledLinkStyle : {}),\n },\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n },\n type: 'button',\n ariaHaspopup: true,\n ariaExpanded: dropdownOpen.value,\n },\n buttonContent,\n ),\n )\n\n // 2. Dropdown rendering\n if (slots['before-dropdown']) {\n children.push(...normalizeSlot(slots['before-dropdown']()))\n }\n\n if (dropdownOpen.value) {\n const dropdownItems: VNode[] = []\n\n if (slots['before-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['before-dropdown-items']()) as VNode[]))\n }\n\n locales.value.forEach((localeItem) => {\n const itemChildren: (VNode | string)[] = []\n\n if (slots['before-item']) {\n itemChildren.push(...normalizeSlot(slots['before-item']({ locale: localeItem })))\n }\n\n const linkContent: (VNode | string)[] = []\n if (slots['before-link-content']) {\n linkContent.push(...normalizeSlot(slots['before-link-content']({ locale: localeItem })))\n }\n linkContent.push(localeLabel(localeItem))\n if (slots['after-link-content']) {\n linkContent.push(...normalizeSlot(slots['after-link-content']({ locale: localeItem })))\n }\n\n const currentPath = typeof window !== 'undefined' ? window.location.pathname : '/'\n const result = props.localeRoute\n ? props.localeRoute(currentPath, localeItem.code)\n : routerStrategy?.resolvePath\n ? routerStrategy.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result.path || '#'\n const isActive = localeItem.code === currentLocale.value\n\n itemChildren.push(\n h(\n 'a',\n {\n class: `switcher-locale-${localeItem.code}`,\n href: typeof routeTo === 'string' ? routeTo : '#',\n style: {\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...props.customLinkStyle,\n // active-specific customization wins over the generic link style\n // (matches the React/Preact/Solid switchers)\n ...(isActive ? props.customActiveLinkStyle : {}),\n },\n // Prevent default navigation, use only handleSwitchLocale\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n },\n },\n linkContent,\n ),\n )\n\n if (slots['after-item']) {\n itemChildren.push(...normalizeSlot(slots['after-item']({ locale: localeItem })))\n }\n\n dropdownItems.push(\n h(\n 'li',\n {\n key: localeItem.code,\n style: { ...itemStyle, ...props.customItemStyle },\n },\n itemChildren,\n ),\n )\n })\n\n if (slots['after-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['after-dropdown-items']()) as VNode[]))\n }\n\n // Render UL right here, WITHOUT Teleport\n children.push(\n h(\n 'ul',\n {\n class: 'i18n-switcher-dropdown',\n style: { ...dropdownStyle, ...props.customDropdownStyle },\n },\n dropdownItems,\n ),\n )\n }\n\n if (slots['after-dropdown']) {\n children.push(...normalizeSlot(slots['after-dropdown']()))\n }\n\n // Return wrapper with ref\n return h(\n 'div',\n {\n ref: wrapperRef,\n class: 'i18n-switcher-wrapper',\n style: { ...wrapperStyle, ...props.customWrapperStyle },\n },\n children,\n )\n }\n },\n})\n","import type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject, type PropType, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\nexport const I18nT = defineComponent({\n name: 'I18nT',\n props: {\n keypath: {\n type: String as PropType<TranslationKey>,\n required: true,\n },\n plural: {\n type: [Number, String] as PropType<number | string>,\n },\n tag: {\n type: String as PropType<string>,\n default: 'span',\n },\n params: {\n type: Object as PropType<Record<string, string | number | boolean>>,\n default: () => ({}),\n },\n defaultValue: {\n type: String as PropType<string>,\n default: '',\n },\n html: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n hideIfEmpty: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n customPluralRule: {\n type: Function as PropType<PluralFunc>,\n default: null,\n },\n number: {\n type: [Number, String] as PropType<number | string>,\n },\n date: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n relativeDate: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n },\n setup(props, { slots, attrs }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nT: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n return () => {\n const options: Record<string, string | number | boolean> = {}\n const route = i18n.getRoute()\n\n // Handle number formatting\n if (props.number !== undefined) {\n const numberValue = Number(props.number)\n const formattedNumber = i18n.tn(numberValue)\n const translation = i18n.t(props.keypath, { number: formattedNumber, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle date formatting\n if (props.date !== undefined) {\n const formattedDate = i18n.td(props.date)\n const translation = i18n.t(props.keypath, { date: formattedDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle relative date formatting\n if (props.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(props.relativeDate)\n const translation = i18n.t(props.keypath, { relativeDate: formattedRelativeDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle pluralization\n if (props.plural !== undefined) {\n const count = Number.parseInt(props.plural.toString(), 10)\n if (props.customPluralRule) {\n const translation = props.customPluralRule(\n props.keypath,\n count,\n props.params,\n i18n.locale.value,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return h(props.tag, { ...attrs, innerHTML: translation || '' })\n } else {\n const translation = i18n.tc(props.keypath, { count, ...props.params })\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n }\n\n // Regular translation\n const translation = (i18n.t(props.keypath, { ...props.params, ...options }, undefined, route) ?? '').toString()\n\n if (props.hideIfEmpty && !translation.trim()) {\n return props.defaultValue ?? null\n }\n\n if (props.html) {\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle slots\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ translation }))\n }\n\n // Handle named slots for interpolation\n const children: (string | VNode)[] = []\n let lastIndex = 0\n\n for (const [slotName, slotFn] of Object.entries(slots)) {\n if (slotName === 'default') continue\n\n const placeholder = `{${slotName}}`\n const index = translation.indexOf(placeholder, lastIndex)\n\n if (index !== -1) {\n if (index > lastIndex) {\n children.push(translation.slice(lastIndex, index))\n }\n\n if (slotFn) {\n children.push(h(slotFn))\n }\n\n lastIndex = index + placeholder.length\n }\n }\n\n if (lastIndex < translation.length) {\n children.push(translation.slice(lastIndex))\n }\n\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ children }))\n }\n\n if (children.length > 0) {\n return h(props.tag, attrs, children)\n }\n\n return h(props.tag, attrs, translation)\n }\n },\n})\n","function u(n) {\n return n.iso?.trim() || String(n.code);\n}\nfunction f(n) {\n const r = n.match(/^([A-Za-z]{2,3})(?:[-_](.+))?$/);\n return r ? { language: r[1], region: r[2] } : { language: n };\n}\nfunction d(n, r = {}) {\n const { hreflangBaseLanguage: l = !1 } = r;\n if (!l)\n return n.map((o) => {\n const t = String(o.code);\n return { hreflang: u(o), localeCode: t };\n });\n const g = /* @__PURE__ */ new Map();\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && !g.has(e) && g.set(e, t), g.set(a, t);\n }\n const s = /* @__PURE__ */ new Set(), c = [];\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && g.get(e) === t && !s.has(e) && (s.add(e), c.push({ hreflang: e, localeCode: t })), s.has(a) || (s.add(a), c.push({ hreflang: a, localeCode: t }));\n }\n return c;\n}\nexport {\n d as resolveHreflangAlternates\n};\n","function c(n) {\n const t = n.og?.trim();\n if (t) return t;\n const e = n.iso?.trim();\n if (!e) return null;\n const r = e.indexOf(\"_\");\n if (r > 0) {\n const s = e.slice(0, r), o = e.slice(r + 1);\n if (s.length >= 2 && o.length === 2)\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n const i = e.indexOf(\"-\");\n if (i > 0) {\n const s = e.slice(0, i), o = e.slice(i + 1);\n if (s.length >= 2 && o.length === 2 && /^[A-Za-z]{2}$/.test(o))\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n return null;\n}\nfunction l(n, t = {}) {\n if (c(n) !== null || t.missingWarn === !1 || process.env.NODE_ENV === \"production\") return;\n const e = t.tag ?? \"og:locale\", r = String(n.code ?? \"unknown\"), i = n.iso ? `, iso: '${n.iso}'` : \"\";\n console.warn(\n `[i18n] Cannot derive ${e} for locale '${r}'${i}. Set locale.og (e.g. 'en_US') or use iso with a 2-letter region (e.g. 'en-US').`\n );\n}\nexport {\n c as resolveOgLocale,\n l as warnUnresolvedOgLocale\n};\n","import type { Locale } from '@i18n-micro/types'\nimport { computed, inject } from 'vue'\nimport type { VueI18n } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\n/**\n * Get the i18n instance from the Vue app context\n * Returns the same instance that was created with createI18n()\n */\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const router = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] useI18n() must be called after app.use(i18n). Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales) {\n throw new Error('[i18n-micro] I18nLocalesKey not provided. Make sure app.provide(I18nLocalesKey, locales) is called.')\n }\n\n if (!injectedDefaultLocale) {\n throw new Error('[i18n-micro] I18nDefaultLocaleKey not provided. Make sure app.provide(I18nDefaultLocaleKey, defaultLocale) is called.')\n }\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.locale.value)\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive)\n locale: computed({\n get: () => i18n.locale.value,\n set: (val: string) => {\n i18n.locale.value = val\n },\n }),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n const current = locales.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale.value = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n resolveTranslations: i18n.resolveTranslations.bind(i18n),\n setTranslation: i18n.setTranslation.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.locale.value,\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n mergeTranslations: i18n.mergeTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { resolveHreflangAlternates } from '@i18n-micro/utils/resolve-hreflang'\nimport { resolveOgLocale, warnUnresolvedOgLocale } from '@i18n-micro/utils/resolve-og-locale'\nimport { inject, ref } from 'vue'\nimport { I18nDefaultLocaleKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\nimport { useI18n } from '../use-i18n'\n\ninterface MetaLink {\n [key: string]: string | undefined\n rel: string\n href: string\n hreflang?: string\n}\n\ninterface MetaTag {\n [key: string]: string\n property: string\n content: string\n}\n\ninterface MetaObject {\n htmlAttrs: {\n lang?: string\n dir?: 'ltr' | 'rtl' | 'auto'\n }\n link: MetaLink[]\n meta: MetaTag[]\n}\n\nexport interface UseLocaleHeadOptions {\n addDirAttribute?: boolean\n identifierAttribute?: string\n addSeoAttributes?: boolean\n baseUrl?: string | (() => string)\n /**\n * Also emit bare-language `hreflang` tags derived from `iso` (never from routing `code`).\n * @default false\n */\n hreflangBaseLanguage?: boolean\n}\n\nexport function useLocaleHead(options: UseLocaleHeadOptions = {}) {\n const { addDirAttribute = true, identifierAttribute = 'id', addSeoAttributes = true, baseUrl = '/', hreflangBaseLanguage = false } = options\n\n const { getLocale, getLocales, localeRoute: i18nLocaleRoute } = useI18n()\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n const metaObject = ref<MetaObject>({\n htmlAttrs: {},\n link: [],\n meta: [],\n })\n\n function filterQuery(fullPath: string, whitelist: string[]): string {\n const url = new URL(fullPath, 'http://localhost')\n const params = new URLSearchParams(url.search)\n const filtered: Record<string, string> = {}\n for (const key of whitelist) {\n if (params.has(key)) {\n filtered[key] = params.get(key) as string\n }\n }\n const filteredParams = new URLSearchParams(filtered)\n return filteredParams.toString() ? `${url.pathname}?${filteredParams.toString()}` : url.pathname\n }\n\n function updateMeta(canonicalQueryWhitelist: string[] = []) {\n if (!routerStrategy) {\n metaObject.value = { htmlAttrs: {}, link: [], meta: [] }\n return\n }\n\n const locale = getLocale()\n const allLocales = getLocales()\n const currentLocaleObj = allLocales.find((loc: Locale) => loc.code === locale)\n\n if (!currentLocaleObj) {\n return\n }\n\n const currentIso = currentLocaleObj.iso || locale\n const currentOg = resolveOgLocale(currentLocaleObj)\n const currentDir = currentLocaleObj.dir || 'auto'\n\n let fullPath = routerStrategy.getCurrentPath()\n if (!fullPath.startsWith('/')) {\n fullPath = `/${fullPath}`\n }\n\n const pathSegments = fullPath.split('/').filter(Boolean)\n const matchedLocale = allLocales.find((localeItem: Locale) => pathSegments[0] === localeItem.code)\n\n let localizedPath = fullPath\n let canonicalPath: string\n\n let ogUrl: string\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n\n if (matchedLocale) {\n localizedPath = fullPath.slice(matchedLocale.code.length + 1) || '/'\n canonicalPath = filterQuery(localizedPath, canonicalQueryWhitelist)\n const localePrefix = `/${locale}`\n ogUrl = `${baseUrlValue}${localePrefix}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n } else {\n canonicalPath = filterQuery(fullPath, canonicalQueryWhitelist)\n ogUrl = `${baseUrlValue}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n }\n\n const htmlAttrs = {\n lang: currentIso,\n ...(addDirAttribute ? { dir: currentDir } : {}),\n }\n\n if (!addSeoAttributes) {\n metaObject.value = { htmlAttrs, link: [], meta: [] }\n return\n }\n\n const alternateLocales = allLocales.filter((loc: Locale) => !loc.disabled && loc.seo !== false)\n\n if (!currentOg) {\n warnUnresolvedOgLocale(currentLocaleObj, { tag: 'og:locale' })\n }\n\n const ogLocaleMeta: MetaTag | null = currentOg\n ? {\n [identifierAttribute]: 'i18n-og',\n property: 'og:locale',\n content: currentOg,\n }\n : null\n\n const ogUrlMeta: MetaTag = {\n [identifierAttribute]: 'i18n-og-url',\n property: 'og:url',\n content: ogUrl,\n }\n\n const alternateOgLocalesMeta = alternateLocales\n .filter((loc: Locale) => loc.code !== locale)\n .map((loc: Locale) => {\n const ogAlt = resolveOgLocale(loc)\n if (!ogAlt) {\n warnUnresolvedOgLocale(loc, { tag: 'og:locale:alternate' })\n return null\n }\n return {\n [identifierAttribute]: `i18n-og-alt-${ogAlt}`,\n property: 'og:locale:alternate',\n content: ogAlt,\n }\n })\n .filter((meta): meta is MetaTag => meta !== null)\n\n const canonicalLink: MetaLink = {\n [identifierAttribute]: 'i18n-can',\n rel: 'canonical',\n href: ogUrl,\n }\n\n const alternateLinks: MetaLink[] = (() => {\n if (!i18nLocaleRoute || !routerStrategy) {\n return []\n }\n\n const hrefByCode = new Map<string, string>()\n const currentPath = routerStrategy.getCurrentPath()\n\n for (const loc of alternateLocales) {\n const switchedPathResult = i18nLocaleRoute(currentPath, loc.code)\n const switchedPath = typeof switchedPathResult === 'string' ? switchedPathResult : switchedPathResult?.path || '/'\n if (!switchedPath) continue\n\n let href: string\n if (switchedPath.startsWith('http://') || switchedPath.startsWith('https://')) {\n href = switchedPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n href = `${baseUrlValue}${switchedPath.startsWith('/') ? '' : '/'}${switchedPath}`\n }\n hrefByCode.set(String(loc.code), href)\n }\n\n return resolveHreflangAlternates(alternateLocales, { hreflangBaseLanguage }).flatMap(({ hreflang, localeCode }) => {\n const href = hrefByCode.get(localeCode)\n if (!href) return []\n return [\n {\n [identifierAttribute]: `i18n-alternate-${hreflang}`,\n rel: 'alternate',\n href,\n hreflang,\n } satisfies MetaLink,\n ]\n })\n })()\n\n // Generate x-default hreflang link pointing to the default locale's URL.\n // x-default tells search engines which URL to show when none of the\n // specified languages match the user's browser settings.\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n let xDefaultLink: MetaLink | null = null\n const defaultLocObj = injectedDefaultLocale ? allLocales.find((l: Locale) => l.code === injectedDefaultLocale) : undefined\n if (i18nLocaleRoute && routerStrategy && injectedDefaultLocale && defaultLocObj?.seo !== false) {\n const currentPath = routerStrategy.getCurrentPath()\n const defaultPathResult = i18nLocaleRoute(currentPath, injectedDefaultLocale)\n const defaultPath = typeof defaultPathResult === 'string' ? defaultPathResult : defaultPathResult?.path || '/'\n if (defaultPath) {\n let xDefaultHref: string\n if (defaultPath.startsWith('http://') || defaultPath.startsWith('https://')) {\n xDefaultHref = defaultPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n xDefaultHref = `${baseUrlValue}${defaultPath.startsWith('/') ? '' : '/'}${defaultPath}`\n }\n xDefaultLink = {\n [identifierAttribute]: 'i18n-xd',\n rel: 'alternate',\n href: xDefaultHref,\n hreflang: 'x-default',\n }\n }\n }\n\n metaObject.value = {\n htmlAttrs,\n meta: [...(ogLocaleMeta ? [ogLocaleMeta] : []), ogUrlMeta, ...alternateOgLocalesMeta],\n link: [canonicalLink, ...alternateLinks, ...(xDefaultLink ? [xDefaultLink] : [])],\n }\n }\n\n return {\n metaObject,\n updateMeta,\n }\n}\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Ref, shallowRef } from 'vue'\n\nexport interface VueI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class VueI18n extends BaseI18n {\n private _locale: Ref<string>\n private _fallbackLocale: Ref<string>\n private _currentRoute: Ref<string>\n private _revision: Ref<number>\n\n public readonly storage: TranslationStorage\n\n private listeners: Set<() => void> = new Set()\n\n constructor(options: VueI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n this._locale = shallowRef(options.locale)\n this._fallbackLocale = shallowRef(options.fallbackLocale || options.locale)\n this._currentRoute = shallowRef('index')\n this._revision = shallowRef(0)\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.helper.loadTranslations(lang, msgs)\n }\n }\n }\n\n get locale(): Ref<string> {\n return this._locale\n }\n\n set locale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._locale.value = val\n } else {\n this._locale = val\n }\n }\n\n get fallbackLocale(): Ref<string> {\n return this._fallbackLocale\n }\n\n set fallbackLocale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._fallbackLocale.value = val\n } else {\n this._fallbackLocale = val\n }\n }\n\n get currentRoute(): Ref<string> {\n return this._currentRoute\n }\n\n setRoute(routeName: string): void {\n this._currentRoute.value = routeName\n }\n\n public getLocale(): string {\n return this._locale.value\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale.value\n }\n\n public getRoute(): string {\n return this._currentRoute.value\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public mergeTranslations(locale: string, routeName: string, translations: Translations): void {\n this.helper.mergeTranslation(locale, routeName, translations, true)\n this._revision.value++\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this._revision.value++\n this.notifyListeners()\n }\n\n protected override onTranslationsChanged(): void {\n this._revision.value++\n this.notifyListeners()\n }\n\n public subscribeToChanges(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n\n public getStorage(): TranslationStorage {\n return this.storage\n }\n\n public getRouteCache(): Record<string, Translations> {\n const result: Record<string, Translations> = {}\n for (const [key, value] of this.storage.translations) {\n result[key] = value\n }\n return result\n }\n}\n","import type { Locale, TranslationKey } from '@i18n-micro/types'\nimport type { App, Plugin } from 'vue'\nimport { I18nGroup } from './components/i18n-group'\nimport { I18nLink } from './components/i18n-link'\nimport { I18nSwitcher } from './components/i18n-switcher'\nimport { I18nT } from './components/i18n-t'\nimport { VueI18n, type VueI18nOptions } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface CreateI18nOptions extends VueI18nOptions {\n routingStrategy?: I18nRoutingStrategy\n /**\n * Array of locale configurations\n * If provided, will be automatically provided to the app via I18nLocalesKey\n */\n locales?: Locale[]\n /**\n * Default locale code\n * If provided, will be automatically provided to the app via I18nDefaultLocaleKey\n */\n defaultLocale?: string\n}\n\nexport type I18nPlugin = Plugin & {\n global: VueI18n\n setRoutingStrategy: (strategy: I18nRoutingStrategy) => void\n}\n\nexport function createI18n(options: CreateI18nOptions): I18nPlugin {\n const { routingStrategy, locales, defaultLocale, ...i18nOptions } = options\n const i18n = new VueI18n(i18nOptions)\n\n let currentApp: App | null = null\n let currentStrategy: I18nRoutingStrategy | null = routingStrategy || null\n\n const setRoutingStrategy = (strategy: I18nRoutingStrategy) => {\n currentStrategy = strategy\n if (currentApp) {\n currentApp.provide(I18nRouterKey, strategy)\n }\n }\n\n return {\n global: i18n, // Access to instance outside components\n setRoutingStrategy, // Method for setting adapter after creation\n install(app: App) {\n currentApp = app\n // 1. Provide for useI18n\n app.provide(I18nInjectionKey, i18n)\n\n // 2. Provide routing strategy if provided\n if (currentStrategy) {\n app.provide(I18nRouterKey, currentStrategy)\n }\n\n // 3. Automatically provide locales and defaultLocale if provided in options\n // This improves DX by eliminating the need for manual provide calls\n if (locales) {\n app.provide(I18nLocalesKey, locales)\n }\n if (defaultLocale) {\n app.provide(I18nDefaultLocaleKey, defaultLocale)\n }\n\n // 4. Global properties ($t, $tc, etc.)\n // Note: In templates, these may be called with string literals, so we use TranslationKey type\n app.config.globalProperties.$t = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string | null,\n routeName?: string,\n ) => {\n return i18n.t(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$ts = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string,\n routeName?: string,\n ) => {\n return i18n.ts(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$tc = (key: TranslationKey, count: number | Record<string, string | number | boolean>, defaultValue?: string) => {\n return i18n.tc(key, count, defaultValue)\n }\n app.config.globalProperties.$tn = i18n.tn.bind(i18n)\n app.config.globalProperties.$td = i18n.td.bind(i18n)\n app.config.globalProperties.$tdr = i18n.tdr.bind(i18n)\n app.config.globalProperties.$has = (key: TranslationKey, routeName?: string) => {\n return i18n.has(key, routeName)\n }\n // Provide access to i18n instance via $i18n\n // Using unknown and then casting to avoid any, but Vue's globalProperties requires flexibility\n app.config.globalProperties.$i18n = i18n as any\n\n // 5. Register components\n app.component('I18nT', I18nT)\n app.component('I18nLink', I18nLink)\n app.component('I18nGroup', I18nGroup)\n app.component('I18nSwitcher', I18nSwitcher)\n },\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport type { Router } from 'vue-router'\nimport { RouterLink } from 'vue-router'\nimport type { I18nRoutingStrategy } from './types'\n\n/**\n * Factory for Vue Router adapter\n * Implements routing utilities for Vue Router\n * Uses vue-router APIs for navigation and path resolution\n */\nexport function createVueRouterAdapter(router: Router, locales: Locale[], defaultLocale: string): I18nRoutingStrategy {\n const localeCodes = locales.map((loc) => loc.code)\n\n /**\n * Path resolution logic (add prefix or not)\n */\n const resolvePath = (to: string | { path?: string }, locale: string): string => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n // If path already starts with a locale, remove it\n const first = pathSegments[0]\n if (first !== undefined && localeCodes.includes(first)) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n\n // If default locale - return clean path\n if (locale === defaultLocale) {\n return cleanPath\n }\n\n // Otherwise add prefix\n return `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n linkComponent: RouterLink,\n\n getCurrentPath: () => {\n // currentRoute in Vue Router is reactive\n return router.currentRoute.value.path\n },\n\n push: (target: { path: string }) => {\n router.push(target.path).catch(() => {})\n },\n\n replace: (target: { path: string }) => {\n router.replace(target.path).catch(() => {})\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: router.currentRoute.value.fullPath,\n query: router.currentRoute.value.query,\n }),\n }\n}\n"],"names":["I18nInjectionKey","I18nLocalesKey","I18nDefaultLocaleKey","I18nRouterKey","I18nGroup","defineComponent","props","slots","i18n","inject","translate","key","params","h","I18nLink","routerStrategy","isExternalLink","computed","targetPath","res","isActive","currentPath","linkPath","computedStyle","e","I18nSwitcher","injectedLocales","allLocales","locales","locale","currentLocale","currentLocaleDisabled","l","currentLocaleName","dropdownOpen","ref","wrapperRef","toggleDropdown","event","localeLabel","localeItem","currentLocaleLabel","current","handleSwitchLocale","code","nextTick","newPath","wrapperStyle","buttonStyle","dropdownStyle","itemStyle","linkStyle","activeLinkStyle","iconStyle","openIconStyle","normalizeSlot","slotResult","handleClickOutside","target","isClickInside","isButtonClick","onMounted","onUnmounted","children","buttonContent","dropdownItems","itemChildren","linkContent","result","routeTo","I18nT","attrs","options","route","numberValue","formattedNumber","translation","formattedDate","formattedRelativeDate","count","k","p","dv","lastIndex","slotName","slotFn","placeholder","index","u","n","f","r","d","o","t","g","a","i","s","c","useI18n","router","injectedDefaultLocale","defaultLocale","resolveLocalePath","to","localeCode","val","newLocale","useLocaleHead","addDirAttribute","identifierAttribute","addSeoAttributes","baseUrl","hreflangBaseLanguage","getLocale","getLocales","i18nLocaleRoute","metaObject","filterQuery","fullPath","whitelist","url","filtered","filteredParams","updateMeta","canonicalQueryWhitelist","currentLocaleObj","loc","currentIso","currentOg","resolveOgLocale","currentDir","pathSegments","matchedLocale","localizedPath","canonicalPath","ogUrl","baseUrlValue","localePrefix","htmlAttrs","alternateLocales","warnUnresolvedOgLocale","ogLocaleMeta","ogUrlMeta","alternateOgLocalesMeta","ogAlt","meta","canonicalLink","alternateLinks","hrefByCode","switchedPathResult","switchedPath","href","resolveHreflangAlternates","hreflang","xDefaultLink","defaultLocObj","defaultPathResult","defaultPath","xDefaultHref","VueI18n","BaseI18n","storage","shallowRef","lang","msgs","routeName","translations","merge","cb","value","createI18n","routingStrategy","i18nOptions","currentApp","currentStrategy","strategy","app","defaultValue","createVueRouterAdapter","localeCodes","resolvePath","first","cleanPath","RouterLink"],"mappings":";;;;AAKO,MAAMA,2BAAiD,MAAM,GACvDC,2BAAgD,cAAc,GAC9DC,4BAAoD,qBAAqB,GACzEC,2BAA0D,sBAAsB,GCEhFC,KAAYC,EAAgC;AAAA,EACvD,MAAM;AAAA,EACN,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,IAEZ,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,MAAMC,GAAO,EAAE,OAAAC,KAAS;A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,GAK3CsD,IAAc,CAAC7E,GAAgC5E,MAA2B;AAE9E,UAAMwG,KADO,OAAO5B,KAAO,WAAWA,IAAKA,EAAG,QAAQ,KAC5B,MAAM,GAAG,EAAE,OAAO,OAAO,GAG7C8E,IAAQlD,EAAa,CAAC;AAC5B,IAAIkD,MAAU,UAAaF,EAAY,SAASE,CAAK,KACnDlD,EAAa,MAAA;AAGf,UAAMmD,IAAY,IAAInD,EAAa,KAAK,GAAG,CAAC;AAG5C,WAAIxG,MAAW0E,IACNiF,IAIF,IAAI3J,CAAM,GAAG2J,MAAc,MAAM,KAAKA,CAAS;AAAA,EACxD;AAEA,SAAO;AAAA,IACL,eAAeC;AAAA,IAEf,gBAAgB,MAEPpF,EAAO,aAAa,MAAM;AAAA,IAGnC,MAAM,CAAC3C,MAA6B;AAClC,MAAA2C,EAAO,KAAK3C,EAAO,IAAI,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IACzC;AAAA,IAEA,SAAS,CAACA,MAA6B;AACrC,MAAA2C,EAAO,QAAQ3C,EAAO,IAAI,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IAC5C;AAAA,IAEA,aAAa,CAAC+C,GAAgC5E,MAAmByJ,EAAY7E,GAAI5E,CAAM;AAAA,IAEvF,UAAU,OAAO;AAAA,MACf,UAAUwE,EAAO,aAAa,MAAM;AAAA,MACpC,OAAOA,EAAO,aAAa,MAAM;AAAA,IAAA;AAAA,EACnC;AAEJ;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/injection.ts","../src/components/i18n-group.ts","../src/components/i18n-link.ts","../src/components/i18n-switcher.ts","../src/components/i18n-t.ts","../../utils/dist/resolve-hreflang.mjs","../../utils/dist/resolve-og-locale.mjs","../src/use-i18n.ts","../src/composables/use-locale-head.ts","../src/composer.ts","../src/plugin.ts","../src/router/adapter.ts"],"sourcesContent":["import type { Locale } from '@i18n-micro/types'\nimport type { InjectionKey } from 'vue'\nimport type { VueI18n } from './composer'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport const I18nInjectionKey: InjectionKey<VueI18n> = Symbol('i18n')\nexport const I18nLocalesKey: InjectionKey<Locale[]> = Symbol('i18n-locales')\nexport const I18nDefaultLocaleKey: InjectionKey<string> = Symbol('i18n-default-locale')\nexport const I18nRouterKey: InjectionKey<I18nRoutingStrategy> = Symbol('i18n-router-strategy')\n","import type { TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\ninterface I18nGroupProps {\n prefix: string\n groupClass?: string\n}\n\nexport const I18nGroup = defineComponent<I18nGroupProps>({\n name: 'I18nGroup',\n props: {\n prefix: {\n type: String,\n required: true,\n },\n groupClass: {\n type: String,\n default: '',\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nGroup: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const translate = (key: string, params?: Record<string, string | number | boolean>) => {\n // Use type assertion for dynamic keys with prefix\n // The developer is responsible for ensuring the key exists\n return i18n.t(`${props.prefix}.${key}` as TranslationKey, params, undefined, i18n.getRoute())\n }\n\n return () =>\n h(\n 'div',\n {\n class: ['i18n-group', props.groupClass],\n },\n slots.default?.({ prefix: props.prefix, t: translate }),\n )\n },\n})\n","import { type CSSProperties, computed, defineComponent, h, inject, type PropType } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nLink = defineComponent({\n name: 'I18nLink',\n props: {\n to: {\n type: [String, Object] as PropType<string | { path?: string }>,\n required: true,\n },\n activeStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nLink: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n const isExternalLink = computed(() => {\n if (typeof props.to === 'string') {\n return /^(?:https?:\\/\\/|\\/\\/|[a-zA-Z0-9-]+\\.[a-zA-Z]{2,})|tel:|mailto:/.test(props.to)\n }\n return false\n })\n\n const targetPath = computed(() => {\n if (isExternalLink.value) {\n return props.to as string\n }\n\n if (props.localeRoute) {\n const res = props.localeRoute(props.to)\n return typeof res === 'string' ? res : res.path || '/'\n }\n\n if (!routerStrategy?.resolvePath) {\n return typeof props.to === 'string' ? props.to : props.to.path || '/'\n }\n\n const res = routerStrategy.resolvePath(props.to, i18n.locale.value)\n return typeof res === 'string' ? res : res.path || '/'\n })\n\n const isActive = computed(() => {\n if (isExternalLink.value || !routerStrategy) {\n return false\n }\n\n const currentPath = routerStrategy.getCurrentPath().replace(/#.*$/, '').replace(/\\/$/, '')\n const linkPath = targetPath.value.replace(/#.*$/, '').replace(/\\/$/, '')\n\n return currentPath === linkPath\n })\n\n const computedStyle = computed(() => (isActive.value ? props.activeStyle : {}))\n\n return () => {\n if (isExternalLink.value) {\n return h(\n 'a',\n {\n href: targetPath.value,\n target: '_blank',\n rel: 'noopener noreferrer',\n style: computedStyle.value,\n },\n slots.default?.(),\n )\n }\n\n if (routerStrategy?.linkComponent) {\n return h(\n routerStrategy.linkComponent,\n {\n to: targetPath.value,\n style: computedStyle.value,\n },\n { default: slots.default },\n )\n }\n\n return h(\n 'a',\n {\n href: targetPath.value,\n style: computedStyle.value,\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n if (routerStrategy) {\n routerStrategy.push({ path: targetPath.value })\n } else {\n window.location.href = targetPath.value\n }\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n","import type { Locale } from '@i18n-micro/types'\nimport { type CSSProperties, computed, defineComponent, h, inject, nextTick, onMounted, onUnmounted, type PropType, ref, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\n\nexport const I18nSwitcher = defineComponent({\n name: 'I18nSwitcher',\n props: {\n customLabels: {\n type: Object as PropType<Record<string, string>>,\n default: () => ({}),\n },\n customWrapperStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customButtonStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customDropdownStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customItemStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customActiveLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n /**\n * Inline style applied to the switcher button when the *current* locale is\n * marked as `disabled: true` in the locale config.\n *\n * Note: disabled locales are omitted from the dropdown list, but the current\n * locale label is still shown on the button.\n */\n customDisabledLinkStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n customIconStyle: {\n type: Object as PropType<CSSProperties>,\n default: () => ({}),\n },\n locales: {\n type: Array as PropType<Locale[]>,\n default: undefined,\n },\n currentLocale: {\n type: [String, Function] as PropType<string | (() => string)>,\n default: undefined,\n },\n getLocaleName: {\n type: Function as PropType<() => string | null>,\n default: undefined,\n },\n switchLocale: {\n type: Function as PropType<(locale: string) => void>,\n default: undefined,\n },\n localeRoute: {\n type: Function as PropType<(to: string | { path?: string }, locale?: string) => string | { path?: string }>,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nSwitcher: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales && !props.locales) {\n throw new Error(\n '[i18n-micro] I18nSwitcher: locales not provided. Make sure app.provide(I18nLocalesKey, locales) is called or pass locales prop.',\n )\n }\n\n const allLocales = computed(() => props.locales || injectedLocales || [])\n const locales = computed(() => allLocales.value.filter((locale) => !locale.disabled))\n const currentLocale = computed(() => {\n if (props.currentLocale !== undefined) {\n return typeof props.currentLocale === 'function' ? props.currentLocale() : props.currentLocale\n }\n return i18n.locale.value\n })\n const currentLocaleDisabled = computed(() => allLocales.value.some((l) => l.code === currentLocale.value && l.disabled))\n const currentLocaleName = computed(() => {\n if (props.getLocaleName) {\n return props.getLocaleName() || null\n }\n // Use `allLocales` (not dropdown-only `locales`) so disabled locales still resolve\n // displayName/customLabels for the currently active button.\n const current = allLocales.value.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n })\n\n const dropdownOpen = ref(false)\n const wrapperRef = ref<HTMLElement | null>(null)\n\n const toggleDropdown = (event?: Event) => {\n if (event) {\n event.stopPropagation()\n event.preventDefault()\n }\n dropdownOpen.value = !dropdownOpen.value\n }\n\n const localeLabel = (localeItem: Locale) => {\n const current = props.customLabels[localeItem.code] || localeItem.displayName\n return current || localeItem.code\n }\n\n const currentLocaleLabel = computed(() => {\n const current = allLocales.value.find((l) => l.code === currentLocale.value)\n return current ? localeLabel(current) : currentLocaleName.value || currentLocale.value\n })\n\n const handleSwitchLocale = async (code: string) => {\n dropdownOpen.value = false\n await nextTick()\n\n if (props.switchLocale) {\n props.switchLocale(code)\n return\n }\n\n i18n.locale.value = code\n\n if (!routerStrategy) {\n return\n }\n\n const currentPath = routerStrategy.getCurrentPath()\n const newPath = props.localeRoute\n ? (() => {\n const res = props.localeRoute(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : routerStrategy?.resolvePath\n ? (() => {\n const res = routerStrategy.resolvePath(currentPath, code)\n return typeof res === 'string' ? res : res.path || '/'\n })()\n : currentPath\n\n routerStrategy.push({ path: newPath })\n }\n\n // Default Styles\n const wrapperStyle: CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n verticalAlign: 'middle',\n }\n\n const buttonStyle: CSSProperties = {\n padding: '4px 12px',\n fontSize: '16px',\n cursor: 'pointer',\n backgroundColor: '#fff',\n border: '1px solid #333',\n transition: 'background-color 0.3s ease',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }\n\n const dropdownStyle: CSSProperties = {\n position: 'absolute',\n top: '100%',\n left: '0',\n zIndex: 1000,\n backgroundColor: '#fff',\n border: '1px solid #333',\n listStyle: 'none',\n padding: '0',\n margin: '4px 0 0 0',\n minWidth: '150px',\n boxShadow: '0 2px 8px rgba(0,0,0,0.15)',\n }\n\n const itemStyle: CSSProperties = {\n margin: '0',\n padding: '0',\n }\n\n const linkStyle: CSSProperties = {\n display: 'block',\n padding: '8px 12px',\n color: '#333',\n textDecoration: 'none',\n transition: 'background-color 0.3s ease',\n cursor: 'pointer',\n }\n\n const activeLinkStyle: CSSProperties = {\n fontWeight: 'bold',\n color: '#007bff',\n // Current locale is not a meaningful switch target\n cursor: 'not-allowed',\n }\n\n const iconStyle: CSSProperties = {\n marginLeft: '8px',\n display: 'inline-block',\n transition: 'transform 0.3s ease',\n }\n\n const openIconStyle: CSSProperties = {\n transform: 'rotate(180deg)',\n }\n\n const normalizeSlot = (slotResult: unknown): (VNode | string)[] => {\n if (!slotResult) return []\n return Array.isArray(slotResult) ? slotResult : [slotResult as VNode]\n }\n\n // Simplified and reliable outside click logic\n const handleClickOutside = (event: MouseEvent) => {\n if (!dropdownOpen.value) return\n\n const target = event.target as HTMLElement\n if (!target || !wrapperRef.value) return\n\n // Check that the click is not inside our wrapper\n const isClickInside = wrapperRef.value.contains(target)\n\n // Also check if the target is the switcher button\n const isButtonClick = target.closest('.i18n-switcher-button') !== null\n\n if (!isClickInside && !isButtonClick) {\n dropdownOpen.value = false\n }\n }\n\n onMounted(() => {\n // Use regular bubbling, but with a slight delay to give the dropdown time to open\n document.addEventListener('click', handleClickOutside)\n })\n\n onUnmounted(() => {\n document.removeEventListener('click', handleClickOutside)\n })\n\n return () => {\n const children: (VNode | string)[] = []\n\n // 1. Button rendering\n if (slots['before-button']) {\n children.push(...normalizeSlot(slots['before-button']()))\n }\n\n const buttonContent: (VNode | string)[] = []\n if (slots['before-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['before-selected-locale']()))\n }\n\n buttonContent.push(h('span', currentLocaleLabel.value))\n\n if (slots['after-selected-locale']) {\n buttonContent.push(...normalizeSlot(slots['after-selected-locale']()))\n }\n\n buttonContent.push(\n h(\n 'span',\n {\n style: {\n ...iconStyle,\n ...(dropdownOpen.value ? openIconStyle : {}),\n ...props.customIconStyle,\n },\n },\n '▼',\n ),\n )\n\n children.push(\n h(\n 'button',\n {\n class: 'i18n-switcher-button',\n style: {\n ...buttonStyle,\n ...props.customButtonStyle,\n ...(currentLocaleDisabled.value ? props.customDisabledLinkStyle : {}),\n },\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n toggleDropdown(e)\n },\n type: 'button',\n ariaHaspopup: true,\n ariaExpanded: dropdownOpen.value,\n },\n buttonContent,\n ),\n )\n\n // 2. Dropdown rendering\n if (slots['before-dropdown']) {\n children.push(...normalizeSlot(slots['before-dropdown']()))\n }\n\n if (dropdownOpen.value) {\n const dropdownItems: VNode[] = []\n\n if (slots['before-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['before-dropdown-items']()) as VNode[]))\n }\n\n locales.value.forEach((localeItem) => {\n const itemChildren: (VNode | string)[] = []\n\n if (slots['before-item']) {\n itemChildren.push(...normalizeSlot(slots['before-item']({ locale: localeItem })))\n }\n\n const linkContent: (VNode | string)[] = []\n if (slots['before-link-content']) {\n linkContent.push(...normalizeSlot(slots['before-link-content']({ locale: localeItem })))\n }\n linkContent.push(localeLabel(localeItem))\n if (slots['after-link-content']) {\n linkContent.push(...normalizeSlot(slots['after-link-content']({ locale: localeItem })))\n }\n\n const currentPath = typeof window !== 'undefined' ? window.location.pathname : '/'\n const result = props.localeRoute\n ? props.localeRoute(currentPath, localeItem.code)\n : routerStrategy?.resolvePath\n ? routerStrategy.resolvePath(currentPath, localeItem.code)\n : currentPath\n const routeTo = typeof result === 'string' ? result : result.path || '#'\n const isActive = localeItem.code === currentLocale.value\n\n itemChildren.push(\n h(\n 'a',\n {\n class: `switcher-locale-${localeItem.code}`,\n href: typeof routeTo === 'string' ? routeTo : '#',\n style: {\n ...linkStyle,\n ...(isActive ? activeLinkStyle : {}),\n ...props.customLinkStyle,\n // active-specific customization wins over the generic link style\n // (matches the React/Preact/Solid switchers)\n ...(isActive ? props.customActiveLinkStyle : {}),\n },\n // Prevent default navigation, use only handleSwitchLocale\n onClick: (e: MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n handleSwitchLocale(localeItem.code)\n },\n },\n linkContent,\n ),\n )\n\n if (slots['after-item']) {\n itemChildren.push(...normalizeSlot(slots['after-item']({ locale: localeItem })))\n }\n\n dropdownItems.push(\n h(\n 'li',\n {\n key: localeItem.code,\n style: { ...itemStyle, ...props.customItemStyle },\n },\n itemChildren,\n ),\n )\n })\n\n if (slots['after-dropdown-items']) {\n dropdownItems.push(...(normalizeSlot(slots['after-dropdown-items']()) as VNode[]))\n }\n\n // Render UL right here, WITHOUT Teleport\n children.push(\n h(\n 'ul',\n {\n class: 'i18n-switcher-dropdown',\n style: { ...dropdownStyle, ...props.customDropdownStyle },\n },\n dropdownItems,\n ),\n )\n }\n\n if (slots['after-dropdown']) {\n children.push(...normalizeSlot(slots['after-dropdown']()))\n }\n\n // Return wrapper with ref\n return h(\n 'div',\n {\n ref: wrapperRef,\n class: 'i18n-switcher-wrapper',\n style: { ...wrapperStyle, ...props.customWrapperStyle },\n },\n children,\n )\n }\n },\n})\n","import type { PluralFunc, TranslationKey } from '@i18n-micro/types'\nimport { defineComponent, h, inject, type PropType, type VNode } from 'vue'\nimport type { VueI18n } from '../composer'\nimport { I18nInjectionKey } from '../injection'\n\nexport const I18nT = defineComponent({\n name: 'I18nT',\n props: {\n keypath: {\n type: String as PropType<TranslationKey>,\n required: true,\n },\n plural: {\n type: [Number, String] as PropType<number | string>,\n },\n tag: {\n type: String as PropType<string>,\n default: 'span',\n },\n params: {\n type: Object as PropType<Record<string, string | number | boolean>>,\n default: () => ({}),\n },\n defaultValue: {\n type: String as PropType<string>,\n default: '',\n },\n html: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n hideIfEmpty: {\n type: Boolean as PropType<boolean>,\n default: false,\n },\n customPluralRule: {\n type: Function as PropType<PluralFunc>,\n default: null,\n },\n number: {\n type: [Number, String] as PropType<number | string>,\n },\n date: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n relativeDate: {\n type: [Date, String, Number] as PropType<Date | string | number>,\n },\n },\n setup(props, { slots, attrs }) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n\n if (!i18n) {\n throw new Error('[i18n-micro] I18nT: i18n instance not found. Make sure i18n plugin is installed.')\n }\n\n return () => {\n const options: Record<string, string | number | boolean> = {}\n const route = i18n.getRoute()\n\n // Handle number formatting\n if (props.number !== undefined) {\n const numberValue = Number(props.number)\n const formattedNumber = i18n.tn(numberValue)\n const translation = i18n.t(props.keypath, { number: formattedNumber, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle date formatting\n if (props.date !== undefined) {\n const formattedDate = i18n.td(props.date)\n const translation = i18n.t(props.keypath, { date: formattedDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle relative date formatting\n if (props.relativeDate !== undefined) {\n const formattedRelativeDate = i18n.tdr(props.relativeDate)\n const translation = i18n.t(props.keypath, { relativeDate: formattedRelativeDate, ...props.params }, undefined, route)\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle pluralization\n if (props.plural !== undefined) {\n const count = Number.parseInt(props.plural.toString(), 10)\n if (props.customPluralRule) {\n const translation = props.customPluralRule(\n props.keypath,\n count,\n props.params,\n i18n.locale.value,\n (k: TranslationKey, p?: Record<string, string | number | boolean>, dv?: string) => i18n.t(k, p, dv, route),\n )\n return h(props.tag, { ...attrs, innerHTML: translation || '' })\n } else {\n const translation = i18n.tc(props.keypath, { count, ...props.params })\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n }\n\n // Regular translation\n const translation = (i18n.t(props.keypath, { ...props.params, ...options }, undefined, route) ?? '').toString()\n\n if (props.hideIfEmpty && !translation.trim()) {\n return props.defaultValue ?? null\n }\n\n if (props.html) {\n return h(props.tag, { ...attrs, innerHTML: translation })\n }\n\n // Handle slots\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ translation }))\n }\n\n // Handle named slots for interpolation\n const children: (string | VNode)[] = []\n let lastIndex = 0\n\n for (const [slotName, slotFn] of Object.entries(slots)) {\n if (slotName === 'default') continue\n\n const placeholder = `{${slotName}}`\n const index = translation.indexOf(placeholder, lastIndex)\n\n if (index !== -1) {\n if (index > lastIndex) {\n children.push(translation.slice(lastIndex, index))\n }\n\n if (slotFn) {\n children.push(h(slotFn))\n }\n\n lastIndex = index + placeholder.length\n }\n }\n\n if (lastIndex < translation.length) {\n children.push(translation.slice(lastIndex))\n }\n\n if (slots.default) {\n return h(props.tag, attrs, slots.default({ children }))\n }\n\n if (children.length > 0) {\n return h(props.tag, attrs, children)\n }\n\n return h(props.tag, attrs, translation)\n }\n },\n})\n","function u(n) {\n return n.iso?.trim() || String(n.code);\n}\nfunction f(n) {\n const r = n.match(/^([A-Za-z]{2,3})(?:[-_](.+))?$/);\n return r ? { language: r[1], region: r[2] } : { language: n };\n}\nfunction d(n, r = {}) {\n const { hreflangBaseLanguage: l = !1 } = r;\n if (!l)\n return n.map((o) => {\n const t = String(o.code);\n return { hreflang: u(o), localeCode: t };\n });\n const g = /* @__PURE__ */ new Map();\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && !g.has(e) && g.set(e, t), g.set(a, t);\n }\n const s = /* @__PURE__ */ new Set(), c = [];\n for (const o of n) {\n const t = String(o.code), a = u(o), { language: e, region: i } = f(a);\n e && i && g.get(e) === t && !s.has(e) && (s.add(e), c.push({ hreflang: e, localeCode: t })), s.has(a) || (s.add(a), c.push({ hreflang: a, localeCode: t }));\n }\n return c;\n}\nexport {\n d as resolveHreflangAlternates\n};\n","function c(n) {\n const t = n.og?.trim();\n if (t) return t;\n const e = n.iso?.trim();\n if (!e) return null;\n const r = e.indexOf(\"_\");\n if (r > 0) {\n const s = e.slice(0, r), o = e.slice(r + 1);\n if (s.length >= 2 && o.length === 2)\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n const i = e.indexOf(\"-\");\n if (i > 0) {\n const s = e.slice(0, i), o = e.slice(i + 1);\n if (s.length >= 2 && o.length === 2 && /^[A-Za-z]{2}$/.test(o))\n return `${s.toLowerCase()}_${o.toUpperCase()}`;\n }\n return null;\n}\nfunction l(n, t = {}) {\n if (c(n) !== null || t.missingWarn === !1 || process.env.NODE_ENV === \"production\") return;\n const e = t.tag ?? \"og:locale\", r = String(n.code ?? \"unknown\"), i = n.iso ? `, iso: '${n.iso}'` : \"\";\n console.warn(\n `[i18n] Cannot derive ${e} for locale '${r}'${i}. Set locale.og (e.g. 'en_US') or use iso with a 2-letter region (e.g. 'en-US').`\n );\n}\nexport {\n c as resolveOgLocale,\n l as warnUnresolvedOgLocale\n};\n","import type { Locale } from '@i18n-micro/types'\nimport { computed, inject } from 'vue'\nimport type { VueI18n } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface UseI18nOptions {\n locales?: Locale[]\n defaultLocale?: string\n}\n\n/**\n * Get the i18n instance from the Vue app context\n * Returns the same instance that was created with createI18n()\n */\nexport function useI18n(options?: UseI18nOptions) {\n const i18n = inject<VueI18n>(I18nInjectionKey)\n const router = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n const injectedLocales = inject<Locale[] | undefined>(I18nLocalesKey, undefined)\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n\n if (!i18n) {\n throw new Error('[i18n-micro] useI18n() must be called after app.use(i18n). Make sure i18n plugin is installed.')\n }\n\n if (!injectedLocales) {\n throw new Error('[i18n-micro] I18nLocalesKey not provided. Make sure app.provide(I18nLocalesKey, locales) is called.')\n }\n\n if (!injectedDefaultLocale) {\n throw new Error('[i18n-micro] I18nDefaultLocaleKey not provided. Make sure app.provide(I18nDefaultLocaleKey, defaultLocale) is called.')\n }\n\n const locales = options?.locales || injectedLocales\n const defaultLocale = options?.defaultLocale || injectedDefaultLocale\n\n const resolveLocalePath = (to: string | { path?: string }, localeCode?: string): string | { path?: string } => {\n if (!router?.resolvePath) {\n return to\n }\n return router.resolvePath(to, localeCode || i18n.locale.value)\n }\n\n return {\n // Direct access to instance\n instance: i18n,\n\n // Locale (reactive)\n locale: computed({\n get: () => i18n.locale.value,\n set: (val: string) => {\n i18n.locale.value = val\n },\n }),\n\n // Locale helpers\n getLocales: () => locales,\n defaultLocale: () => defaultLocale,\n getLocaleName: () => {\n const current = locales.find((l) => l.code === i18n.locale.value)\n return current?.displayName || null\n },\n\n // Routing helpers\n localeRoute: resolveLocalePath,\n localePath: (to: string | { path?: string }, locale?: string): string => {\n const res = resolveLocalePath(to, locale)\n return typeof res === 'string' ? res : res.path || '/'\n },\n switchLocale: (newLocale: string) => {\n i18n.locale.value = newLocale\n if (router) {\n const currentPath = router.getCurrentPath()\n const newPath = resolveLocalePath(currentPath, newLocale)\n router.push(typeof newPath === 'string' ? { path: newPath } : { path: newPath.path || '/' })\n }\n },\n\n // Translation methods (delegate to instance)\n t: i18n.t.bind(i18n),\n ts: i18n.ts.bind(i18n),\n tc: i18n.tc.bind(i18n),\n tn: i18n.tn.bind(i18n),\n td: i18n.td.bind(i18n),\n tdr: i18n.tdr.bind(i18n),\n has: i18n.has.bind(i18n),\n resolveTranslations: i18n.resolveTranslations.bind(i18n),\n setTranslation: i18n.setTranslation.bind(i18n),\n\n // Route management\n setRoute: i18n.setRoute.bind(i18n),\n getRoute: i18n.getRoute.bind(i18n),\n getLocale: () => i18n.locale.value,\n\n // Translation management\n addTranslations: i18n.addTranslations.bind(i18n),\n addRouteTranslations: i18n.addRouteTranslations.bind(i18n),\n mergeTranslations: i18n.mergeTranslations.bind(i18n),\n clearCache: i18n.clearCache.bind(i18n),\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport { resolveHreflangAlternates } from '@i18n-micro/utils/resolve-hreflang'\nimport { resolveOgLocale, warnUnresolvedOgLocale } from '@i18n-micro/utils/resolve-og-locale'\nimport { inject, ref } from 'vue'\nimport { I18nDefaultLocaleKey, I18nRouterKey } from '../injection'\nimport type { I18nRoutingStrategy } from '../router/types'\nimport { useI18n } from '../use-i18n'\n\ninterface MetaLink {\n [key: string]: string | undefined\n rel: string\n href: string\n hreflang?: string\n}\n\ninterface MetaTag {\n [key: string]: string\n property: string\n content: string\n}\n\ninterface MetaObject {\n htmlAttrs: {\n lang?: string\n dir?: 'ltr' | 'rtl' | 'auto'\n }\n link: MetaLink[]\n meta: MetaTag[]\n}\n\nexport interface UseLocaleHeadOptions {\n addDirAttribute?: boolean\n identifierAttribute?: string\n addSeoAttributes?: boolean\n baseUrl?: string | (() => string)\n /**\n * Also emit bare-language `hreflang` tags derived from `iso` (never from routing `code`).\n * @default false\n */\n hreflangBaseLanguage?: boolean\n}\n\nexport function useLocaleHead(options: UseLocaleHeadOptions = {}) {\n const { addDirAttribute = true, identifierAttribute = 'id', addSeoAttributes = true, baseUrl = '/', hreflangBaseLanguage = false } = options\n\n const { getLocale, getLocales, localeRoute: i18nLocaleRoute } = useI18n()\n const routerStrategy = inject<I18nRoutingStrategy | undefined>(I18nRouterKey, undefined)\n\n const metaObject = ref<MetaObject>({\n htmlAttrs: {},\n link: [],\n meta: [],\n })\n\n function filterQuery(fullPath: string, whitelist: string[]): string {\n const url = new URL(fullPath, 'http://localhost')\n const params = new URLSearchParams(url.search)\n const filtered: Record<string, string> = {}\n for (const key of whitelist) {\n if (params.has(key)) {\n filtered[key] = params.get(key) as string\n }\n }\n const filteredParams = new URLSearchParams(filtered)\n return filteredParams.toString() ? `${url.pathname}?${filteredParams.toString()}` : url.pathname\n }\n\n function updateMeta(canonicalQueryWhitelist: string[] = []) {\n if (!routerStrategy) {\n metaObject.value = { htmlAttrs: {}, link: [], meta: [] }\n return\n }\n\n const locale = getLocale()\n const allLocales = getLocales()\n const currentLocaleObj = allLocales.find((loc: Locale) => loc.code === locale)\n\n if (!currentLocaleObj) {\n return\n }\n\n const currentIso = currentLocaleObj.iso || locale\n const currentOg = resolveOgLocale(currentLocaleObj)\n const currentDir = currentLocaleObj.dir || 'auto'\n\n let fullPath = routerStrategy.getCurrentPath()\n if (!fullPath.startsWith('/')) {\n fullPath = `/${fullPath}`\n }\n\n const pathSegments = fullPath.split('/').filter(Boolean)\n const matchedLocale = allLocales.find((localeItem: Locale) => pathSegments[0] === localeItem.code)\n\n let localizedPath = fullPath\n let canonicalPath: string\n\n let ogUrl: string\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n\n if (matchedLocale) {\n localizedPath = fullPath.slice(matchedLocale.code.length + 1) || '/'\n canonicalPath = filterQuery(localizedPath, canonicalQueryWhitelist)\n const localePrefix = `/${locale}`\n ogUrl = `${baseUrlValue}${localePrefix}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n } else {\n canonicalPath = filterQuery(fullPath, canonicalQueryWhitelist)\n ogUrl = `${baseUrlValue}${canonicalPath.startsWith('/') ? '' : '/'}${canonicalPath}`\n }\n\n const htmlAttrs = {\n lang: currentIso,\n ...(addDirAttribute ? { dir: currentDir } : {}),\n }\n\n if (!addSeoAttributes) {\n metaObject.value = { htmlAttrs, link: [], meta: [] }\n return\n }\n\n const alternateLocales = allLocales.filter((loc: Locale) => !loc.disabled && loc.seo !== false)\n\n if (!currentOg) {\n warnUnresolvedOgLocale(currentLocaleObj, { tag: 'og:locale' })\n }\n\n const ogLocaleMeta: MetaTag | null = currentOg\n ? {\n [identifierAttribute]: 'i18n-og',\n property: 'og:locale',\n content: currentOg,\n }\n : null\n\n const ogUrlMeta: MetaTag = {\n [identifierAttribute]: 'i18n-og-url',\n property: 'og:url',\n content: ogUrl,\n }\n\n const alternateOgLocalesMeta = alternateLocales\n .filter((loc: Locale) => loc.code !== locale)\n .map((loc: Locale) => {\n const ogAlt = resolveOgLocale(loc)\n if (!ogAlt) {\n warnUnresolvedOgLocale(loc, { tag: 'og:locale:alternate' })\n return null\n }\n return {\n [identifierAttribute]: `i18n-og-alt-${ogAlt}`,\n property: 'og:locale:alternate',\n content: ogAlt,\n }\n })\n .filter((meta): meta is MetaTag => meta !== null)\n\n const canonicalLink: MetaLink = {\n [identifierAttribute]: 'i18n-can',\n rel: 'canonical',\n href: ogUrl,\n }\n\n const alternateLinks: MetaLink[] = (() => {\n if (!i18nLocaleRoute || !routerStrategy) {\n return []\n }\n\n const hrefByCode = new Map<string, string>()\n const currentPath = routerStrategy.getCurrentPath()\n\n for (const loc of alternateLocales) {\n const switchedPathResult = i18nLocaleRoute(currentPath, loc.code)\n const switchedPath = typeof switchedPathResult === 'string' ? switchedPathResult : switchedPathResult?.path || '/'\n if (!switchedPath) continue\n\n let href: string\n if (switchedPath.startsWith('http://') || switchedPath.startsWith('https://')) {\n href = switchedPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n href = `${baseUrlValue}${switchedPath.startsWith('/') ? '' : '/'}${switchedPath}`\n }\n hrefByCode.set(String(loc.code), href)\n }\n\n return resolveHreflangAlternates(alternateLocales, { hreflangBaseLanguage }).flatMap(({ hreflang, localeCode }) => {\n const href = hrefByCode.get(localeCode)\n if (!href) return []\n return [\n {\n [identifierAttribute]: `i18n-alternate-${hreflang}`,\n rel: 'alternate',\n href,\n hreflang,\n } satisfies MetaLink,\n ]\n })\n })()\n\n // Generate x-default hreflang link pointing to the default locale's URL.\n // x-default tells search engines which URL to show when none of the\n // specified languages match the user's browser settings.\n const injectedDefaultLocale = inject<string | undefined>(I18nDefaultLocaleKey, undefined)\n let xDefaultLink: MetaLink | null = null\n const defaultLocObj = injectedDefaultLocale ? allLocales.find((l: Locale) => l.code === injectedDefaultLocale) : undefined\n if (i18nLocaleRoute && routerStrategy && injectedDefaultLocale && defaultLocObj?.seo !== false) {\n const currentPath = routerStrategy.getCurrentPath()\n const defaultPathResult = i18nLocaleRoute(currentPath, injectedDefaultLocale)\n const defaultPath = typeof defaultPathResult === 'string' ? defaultPathResult : defaultPathResult?.path || '/'\n if (defaultPath) {\n let xDefaultHref: string\n if (defaultPath.startsWith('http://') || defaultPath.startsWith('https://')) {\n xDefaultHref = defaultPath\n } else {\n const baseUrlValue = typeof baseUrl === 'function' ? baseUrl() : baseUrl\n xDefaultHref = `${baseUrlValue}${defaultPath.startsWith('/') ? '' : '/'}${defaultPath}`\n }\n xDefaultLink = {\n [identifierAttribute]: 'i18n-xd',\n rel: 'alternate',\n href: xDefaultHref,\n hreflang: 'x-default',\n }\n }\n }\n\n metaObject.value = {\n htmlAttrs,\n meta: [...(ogLocaleMeta ? [ogLocaleMeta] : []), ogUrlMeta, ...alternateOgLocalesMeta],\n link: [canonicalLink, ...alternateLinks, ...(xDefaultLink ? [xDefaultLink] : [])],\n }\n }\n\n return {\n metaObject,\n updateMeta,\n }\n}\n","import { BaseI18n, type TranslationStorage } from '@i18n-micro/core'\nimport type { PluralFunc, Translations } from '@i18n-micro/types'\nimport { type Ref, shallowRef } from 'vue'\n\nexport interface VueI18nOptions {\n locale: string\n fallbackLocale?: string\n messages?: Record<string, Translations>\n plural?: PluralFunc\n missingWarn?: boolean\n missingHandler?: (locale: string, key: string, routeName: string) => void\n}\n\nexport class VueI18n extends BaseI18n {\n private _locale: Ref<string>\n private _fallbackLocale: Ref<string>\n private _currentRoute: Ref<string>\n private _revision: Ref<number>\n\n public readonly storage: TranslationStorage\n\n private listeners: Set<() => void> = new Set()\n\n constructor(options: VueI18nOptions) {\n const storage: TranslationStorage = {\n translations: new Map<string, Translations>(),\n }\n\n super({\n storage,\n plural: options.plural,\n missingWarn: options.missingWarn,\n missingHandler: options.missingHandler,\n })\n\n this.storage = storage\n this._locale = shallowRef(options.locale)\n this._fallbackLocale = shallowRef(options.fallbackLocale || options.locale)\n this._currentRoute = shallowRef('index')\n this._revision = shallowRef(0)\n\n if (options.messages) {\n for (const [lang, msgs] of Object.entries(options.messages)) {\n this.helper.loadTranslations(lang, msgs)\n }\n }\n }\n\n get locale(): Ref<string> {\n return this._locale\n }\n\n set locale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._locale.value = val\n } else {\n this._locale = val\n }\n }\n\n get fallbackLocale(): Ref<string> {\n return this._fallbackLocale\n }\n\n set fallbackLocale(val: Ref<string> | string) {\n if (typeof val === 'string') {\n this._fallbackLocale.value = val\n } else {\n this._fallbackLocale = val\n }\n }\n\n get currentRoute(): Ref<string> {\n return this._currentRoute\n }\n\n setRoute(routeName: string): void {\n this._currentRoute.value = routeName\n }\n\n public getLocale(): string {\n return this._locale.value\n }\n\n public getFallbackLocale(): string {\n return this._fallbackLocale.value\n }\n\n public getRoute(): string {\n return this._currentRoute.value\n }\n\n public addTranslations(locale: string, translations: Translations, merge = true): void {\n super.loadTranslationsCore(locale, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public addRouteTranslations(locale: string, routeName: string, translations: Translations, merge = true): void {\n super.loadRouteTranslationsCore(locale, routeName, translations, merge)\n this._revision.value++\n this.notifyListeners()\n }\n\n public mergeTranslations(locale: string, routeName: string, translations: Translations): void {\n this.helper.mergeTranslation(locale, routeName, translations, true)\n this._revision.value++\n this.notifyListeners()\n }\n\n public override clearCache(): void {\n super.clearCache()\n this._revision.value++\n this.notifyListeners()\n }\n\n protected override onTranslationsChanged(): void {\n this._revision.value++\n this.notifyListeners()\n }\n\n public subscribeToChanges(cb: () => void): () => void {\n this.listeners.add(cb)\n return () => this.listeners.delete(cb)\n }\n\n private notifyListeners(): void {\n this.listeners.forEach((cb) => cb())\n }\n\n public getStorage(): TranslationStorage {\n return this.storage\n }\n\n public getRouteCache(): Record<string, Translations> {\n const result: Record<string, Translations> = {}\n for (const [key, value] of this.storage.translations) {\n result[key] = value\n }\n return result\n }\n}\n","import type { Locale, TranslationKey } from '@i18n-micro/types'\nimport type { App, Plugin } from 'vue'\nimport { I18nGroup } from './components/i18n-group'\nimport { I18nLink } from './components/i18n-link'\nimport { I18nSwitcher } from './components/i18n-switcher'\nimport { I18nT } from './components/i18n-t'\nimport { VueI18n, type VueI18nOptions } from './composer'\nimport { I18nDefaultLocaleKey, I18nInjectionKey, I18nLocalesKey, I18nRouterKey } from './injection'\nimport type { I18nRoutingStrategy } from './router/types'\n\nexport interface CreateI18nOptions extends VueI18nOptions {\n routingStrategy?: I18nRoutingStrategy\n /**\n * Array of locale configurations\n * If provided, will be automatically provided to the app via I18nLocalesKey\n */\n locales?: Locale[]\n /**\n * Default locale code\n * If provided, will be automatically provided to the app via I18nDefaultLocaleKey\n */\n defaultLocale?: string\n}\n\nexport type I18nPlugin = Plugin & {\n global: VueI18n\n setRoutingStrategy: (strategy: I18nRoutingStrategy) => void\n}\n\nexport function createI18n(options: CreateI18nOptions): I18nPlugin {\n const { routingStrategy, locales, defaultLocale, ...i18nOptions } = options\n const i18n = new VueI18n(i18nOptions)\n\n let currentApp: App | null = null\n let currentStrategy: I18nRoutingStrategy | null = routingStrategy || null\n\n const setRoutingStrategy = (strategy: I18nRoutingStrategy) => {\n currentStrategy = strategy\n if (currentApp) {\n currentApp.provide(I18nRouterKey, strategy)\n }\n }\n\n return {\n global: i18n, // Access to instance outside components\n setRoutingStrategy, // Method for setting adapter after creation\n install(app: App) {\n currentApp = app\n // 1. Provide for useI18n\n app.provide(I18nInjectionKey, i18n)\n\n // 2. Provide routing strategy if provided\n if (currentStrategy) {\n app.provide(I18nRouterKey, currentStrategy)\n }\n\n // 3. Automatically provide locales and defaultLocale if provided in options\n // This improves DX by eliminating the need for manual provide calls\n if (locales) {\n app.provide(I18nLocalesKey, locales)\n }\n if (defaultLocale) {\n app.provide(I18nDefaultLocaleKey, defaultLocale)\n }\n\n // 4. Global properties ($t, $tc, etc.)\n // Note: In templates, these may be called with string literals, so we use TranslationKey type\n app.config.globalProperties.$t = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string | null,\n routeName?: string,\n ) => {\n return i18n.t(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$ts = (\n key: TranslationKey,\n params?: Record<string, string | number | boolean>,\n defaultValue?: string,\n routeName?: string,\n ) => {\n return i18n.ts(key, params, defaultValue, routeName)\n }\n app.config.globalProperties.$tc = (key: TranslationKey, count: number | Record<string, string | number | boolean>, defaultValue?: string) => {\n return i18n.tc(key, count, defaultValue)\n }\n app.config.globalProperties.$tn = i18n.tn.bind(i18n)\n app.config.globalProperties.$td = i18n.td.bind(i18n)\n app.config.globalProperties.$tdr = i18n.tdr.bind(i18n)\n app.config.globalProperties.$has = (key: TranslationKey, routeName?: string) => {\n return i18n.has(key, routeName)\n }\n // Provide access to i18n instance via $i18n\n // Using unknown and then casting to avoid any, but Vue's globalProperties requires flexibility\n app.config.globalProperties.$i18n = i18n as any\n\n // 5. Register components\n app.component('I18nT', I18nT)\n app.component('I18nLink', I18nLink)\n app.component('I18nGroup', I18nGroup)\n app.component('I18nSwitcher', I18nSwitcher)\n },\n }\n}\n","import type { Locale } from '@i18n-micro/types'\nimport type { Router } from 'vue-router'\nimport { RouterLink } from 'vue-router'\nimport type { I18nRoutingStrategy } from './types'\n\n/**\n * Factory for Vue Router adapter\n * Implements routing utilities for Vue Router\n * Uses vue-router APIs for navigation and path resolution\n */\nexport function createVueRouterAdapter(router: Router, locales: Locale[], defaultLocale: string): I18nRoutingStrategy {\n const localeCodes = locales.map((loc) => loc.code)\n\n /**\n * Path resolution logic (add prefix or not)\n */\n const resolvePath = (to: string | { path?: string }, locale: string): string => {\n const path = typeof to === 'string' ? to : to.path || '/'\n const pathSegments = path.split('/').filter(Boolean)\n\n // If path already starts with a locale, remove it\n const first = pathSegments[0]\n if (first !== undefined && localeCodes.includes(first)) {\n pathSegments.shift()\n }\n\n const cleanPath = `/${pathSegments.join('/')}`\n\n // If default locale - return clean path\n if (locale === defaultLocale) {\n return cleanPath\n }\n\n // Otherwise add prefix\n return `/${locale}${cleanPath === '/' ? '' : cleanPath}`\n }\n\n return {\n linkComponent: RouterLink,\n\n getCurrentPath: () => {\n // currentRoute in Vue Router is reactive\n return router.currentRoute.value.path\n },\n\n push: (target: { path: string }) => {\n router.push(target.path).catch(() => {})\n },\n\n replace: (target: { path: string }) => {\n router.replace(target.path).catch(() => {})\n },\n\n resolvePath: (to: string | { path?: string }, locale: string) => resolvePath(to, locale),\n\n getRoute: () => ({\n fullPath: router.currentRoute.value.fullPath,\n query: router.currentRoute.value.query,\n }),\n }\n}\n"],"names":["I18nInjectionKey","I18nLocalesKey","I18nDefaultLocaleKey","I18nRouterKey","I18nGroup","defineComponent","props","slots","i18n","inject","translate","key","params","h","I18nLink","routerStrategy","isExternalLink","computed","targetPath","res","isActive","currentPath","linkPath","computedStyle","e","I18nSwitcher","injectedLocales","allLocales","locales","locale","currentLocale","currentLocaleDisabled","l","currentLocaleName","dropdownOpen","ref","wrapperRef","toggleDropdown","event","localeLabel","localeItem","currentLocaleLabel","current","handleSwitchLocale","code","nextTick","newPath","wrapperStyle","buttonStyle","dropdownStyle","itemStyle","linkStyle","activeLinkStyle","iconStyle","openIconStyle","normalizeSlot","slotResult","handleClickOutside","target","isClickInside","isButtonClick","onMounted","onUnmounted","children","buttonContent","dropdownItems","itemChildren","linkContent","result","routeTo","I18nT","attrs","options","route","numberValue","formattedNumber","translation","formattedDate","formattedRelativeDate","count","k","p","dv","lastIndex","slotName","slotFn","placeholder","index","u","n","f","r","d","o","t","g","a","i","s","c","useI18n","router","injectedDefaultLocale","defaultLocale","resolveLocalePath","to","localeCode","val","newLocale","useLocaleHead","addDirAttribute","identifierAttribute","addSeoAttributes","baseUrl","hreflangBaseLanguage","getLocale","getLocales","i18nLocaleRoute","metaObject","filterQuery","fullPath","whitelist","url","filtered","filteredParams","updateMeta","canonicalQueryWhitelist","currentLocaleObj","loc","currentIso","currentOg","resolveOgLocale","currentDir","pathSegments","matchedLocale","localizedPath","canonicalPath","ogUrl","baseUrlValue","localePrefix","htmlAttrs","alternateLocales","warnUnresolvedOgLocale","ogLocaleMeta","ogUrlMeta","alternateOgLocalesMeta","ogAlt","meta","canonicalLink","alternateLinks","hrefByCode","switchedPathResult","switchedPath","href","resolveHreflangAlternates","hreflang","xDefaultLink","defaultLocObj","defaultPathResult","defaultPath","xDefaultHref","VueI18n","BaseI18n","storage","shallowRef","lang","msgs","routeName","translations","merge","cb","value","createI18n","routingStrategy","i18nOptions","currentApp","currentStrategy","strategy","app","defaultValue","createVueRouterAdapter","localeCodes","resolvePath","first","cleanPath","RouterLink"],"mappings":";;;;AAKO,MAAMA,2BAAiD,MAAM,GACvDC,2BAAgD,cAAc,GAC9DC,4BAAoD,qBAAqB,GACzEC,2BAA0D,sBAAsB,GCEhFC,KAAYC,EAAgC;AAAA,EACvD,MAAM;AAAA,EACN,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,IAEZ,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,MAAMC,GAAO,EAAE,OAAAC,KAAS;AACtB,UAAMC,IAAOC,EAAgBT,CAAgB;AAE7C,QAAI,CAACQ;AACH,YAAM,IAAI,MAAM,sFAAsF;AAGxG,UAAME,IAAY,CAACC,GAAaC,MAGvBJ,EAAK,EAAE,GAAGF,EAAM,MAAM,IAAIK,CAAG,IAAsBC,GAAQ,QAAWJ,EAAK,SAAA,CAAU;AAG9F,WAAO,MACLK;AAAA,MACE;AAA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aF,EAAY,SAASE,CAAK,KACnDlD,EAAa,MAAA;AAGf,UAAMmD,IAAY,IAAInD,EAAa,KAAK,GAAG,CAAC;AAG5C,WAAIxG,MAAW0E,IACNiF,IAIF,IAAI3J,CAAM,GAAG2J,MAAc,MAAM,KAAKA,CAAS;AAAA,EACxD;AAEA,SAAO;AAAA,IACL,eAAeC;AAAA,IAEf,gBAAgB,MAEPpF,EAAO,aAAa,MAAM;AAAA,IAGnC,MAAM,CAAC3C,MAA6B;AAClC,MAAA2C,EAAO,KAAK3C,EAAO,IAAI,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IACzC;AAAA,IAEA,SAAS,CAACA,MAA6B;AACrC,MAAA2C,EAAO,QAAQ3C,EAAO,IAAI,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IAC5C;AAAA,IAEA,aAAa,CAAC+C,GAAgC5E,MAAmByJ,EAAY7E,GAAI5E,CAAM;AAAA,IAEvF,UAAU,OAAO;AAAA,MACf,UAAUwE,EAAO,aAAa,MAAM;AAAA,MACpC,OAAOA,EAAO,aAAa,MAAM;AAAA,IAAA;AAAA,EACnC;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-micro/vue",
3
- "version": "1.3.9",
3
+ "version": "1.3.11",
4
4
  "description": "Vue 3 bindings for i18n-micro — composables, components, and routing helpers.",
5
5
  "keywords": [
6
6
  "i18n",
@@ -46,9 +46,9 @@
46
46
  "access": "public"
47
47
  },
48
48
  "dependencies": {
49
- "@i18n-micro/core": "^1.3.11",
50
- "@i18n-micro/utils": "^1.0.13",
51
- "@i18n-micro/types": "^1.2.10"
49
+ "@i18n-micro/core": "^1.3.13",
50
+ "@i18n-micro/utils": "^1.0.14",
51
+ "@i18n-micro/types": "^1.2.11"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@vue/test-utils": "^2.4.6",