提交 2d1c11d7 编写于 作者: fxy060608's avatar fxy060608

feat(vue3): add vue-i18n uni-app uni-stat

上级 966e08fb
......@@ -19,6 +19,8 @@ packages/*/packages/mpvue
packages/*/packages/mpvue-page-factory
packages/*/packages/mpvue-template-compiler
packages/*/packages/postcss-normalize-whitespace
packages/*/packages/uni-app
packages/*/packages/uni-stat
packages/*/packages/uni-cloud
packages/*/packages/vue-loader
packages/*/packages/vue-template-compiler
......
......@@ -6,3 +6,4 @@ unpackage/
.DS_Store
!packages/uni-app-plus/dist
package-lock.json
!packages/vue-cli-plugin-uni/packages/**/*
......@@ -575,8 +575,7 @@ function parseApp(instance, parseAppOptions) {
});
injectAppLaunchHooks(internalInstance);
ctx.globalData = this.globalData;
options.app = this;
instance.$callHook(ON_LAUNCH, options);
instance.$callHook(ON_LAUNCH, extend({ app: this }, options));
},
};
const vueOptions = instance.$.type;
......
......@@ -600,8 +600,7 @@ function parseApp(instance, parseAppOptions) {
});
injectAppLaunchHooks(internalInstance);
ctx.globalData = this.globalData;
options.app = this;
instance.$callHook(ON_LAUNCH, options);
instance.$callHook(ON_LAUNCH, extend({ app: this }, options));
},
};
const vueOptions = instance.$.type;
......
......@@ -600,8 +600,7 @@ function parseApp(instance, parseAppOptions) {
});
injectAppLaunchHooks(internalInstance);
ctx.globalData = this.globalData;
options.app = this;
instance.$callHook(ON_LAUNCH, options);
instance.$callHook(ON_LAUNCH, extend({ app: this }, options));
},
};
const vueOptions = instance.$.type;
......
......@@ -600,8 +600,7 @@ function parseApp(instance, parseAppOptions) {
});
injectAppLaunchHooks(internalInstance);
ctx.globalData = this.globalData;
options.app = this;
instance.$callHook(ON_LAUNCH, options);
instance.$callHook(ON_LAUNCH, extend({ app: this }, options));
},
};
const vueOptions = instance.$.type;
......
......@@ -603,8 +603,7 @@ function parseApp(instance, parseAppOptions) {
});
injectAppLaunchHooks(internalInstance);
ctx.globalData = this.globalData;
options.app = this;
instance.$callHook(ON_LAUNCH, options);
instance.$callHook(ON_LAUNCH, extend({ app: this }, options));
},
};
const vueOptions = instance.$.type;
......
......@@ -546,8 +546,7 @@ function parseApp(instance, parseAppOptions) {
});
injectAppLaunchHooks(internalInstance);
ctx.globalData = this.globalData;
options.app = this;
instance.$callHook(ON_LAUNCH, options);
instance.$callHook(ON_LAUNCH, extend({ app: this }, options));
},
};
const vueOptions = instance.$.type;
......
......@@ -531,8 +531,7 @@ function parseApp(instance, parseAppOptions) {
});
injectAppLaunchHooks(internalInstance);
ctx.globalData = this.globalData;
options.app = this;
instance.$callHook(ON_LAUNCH, options);
instance.$callHook(ON_LAUNCH, extend({ app: this }, options));
},
};
const vueOptions = instance.$.type;
......
......@@ -189,6 +189,9 @@ module.exports = {
if (process.env.UNI_USING_VUE3) {
alias.vuex = require.resolve('@dcloudio/vue-cli-plugin-uni/packages/vuex')
alias['@vue/devtools-api'] = require.resolve('@dcloudio/vue-cli-plugin-uni/packages/@vue/devtools-api')
alias['vue-i18n'] = require.resolve('@dcloudio/vue-cli-plugin-uni/packages/vue3/node_modules/vue-i18n')
alias['@dcloudio/uni-app'] = require.resolve('@dcloudio/vue-cli-plugin-uni/packages/uni-app')
} else {
alias.vuex = require.resolve('@dcloudio/vue-cli-plugin-uni/packages/vuex3')
}
......@@ -306,4 +309,4 @@ module.exports = {
webpackConfig.plugins.delete('preload')
webpackConfig.plugins.delete('prefetch')
}
}
}
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
\ No newline at end of file
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var shared = require('@vue/shared');
const sanitise = (val) => (val && JSON.parse(JSON.stringify(val))) || val;
const UNI_SSR = '__uniSSR';
const UNI_SSR_DATA = 'data';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_BACK_PRESS = 'onBackPress';
const ON_PAGE_SCROLL = 'onPageScroll';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_SHARE_TIMELINE = 'onShareTimeline';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const ON_SHARE_APP_MESSAGE = 'onShareAppMessage';
// navigationBar
const ON_NAVIGATION_BAR_BUTTON_TAP = 'onNavigationBarButtonTap';
const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = 'onNavigationBarSearchInputClicked';
const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = 'onNavigationBarSearchInputChanged';
const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = 'onNavigationBarSearchInputConfirmed';
const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = 'onNavigationBarSearchInputFocusChanged';
function assertKey(key, shallow = false) {
if (!key) {
throw new Error(`${shallow ? 'shallowSsrRef' : 'ssrRef'}: You must provide a key.`);
}
}
function proxy(target, track, trigger) {
return new Proxy(target, {
get(target, prop) {
track();
if (shared.isObject(target[prop])) {
return proxy(target[prop], track, trigger);
}
return Reflect.get(target, prop);
},
set(obj, prop, newVal) {
const result = Reflect.set(obj, prop, newVal);
trigger();
return result;
},
});
}
const globalData = {};
const ssrServerRef = (value, key, shallow = false) => {
assertKey(key, shallow);
const ctx = vue.getCurrentInstance() && vue.useSSRContext();
let state;
if (ctx) {
const __uniSSR = ctx[UNI_SSR] || (ctx[UNI_SSR] = {});
state = __uniSSR[UNI_SSR_DATA] || (__uniSSR[UNI_SSR_DATA] = {});
}
else {
state = globalData;
}
state[key] = sanitise(value);
// SSR 模式下 watchEffect 不生效 https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/apiWatch.ts#L253
// 故自定义ref
return vue.customRef((track, trigger) => {
const customTrigger = () => (trigger(), (state[key] = sanitise(value)));
return {
get: () => {
track();
if (!shallow && shared.isObject(value)) {
return proxy(value, track, customTrigger);
}
return value;
},
set: (v) => {
value = v;
customTrigger();
},
};
});
};
const ssrRef = (value, key) => {
{
return ssrServerRef(value, key);
}
};
const shallowSsrRef = (value, key) => {
{
return ssrServerRef(value, key, true);
}
};
function getSsrGlobalData() {
return sanitise(globalData);
}
function resolveEasycom(component, easycom) {
return shared.isString(component) ? easycom : component;
}
// @ts-ignore
const createHook = (lifecycle) => (hook, target = vue.getCurrentInstance()) =>
// post-create lifecycle registrations are noops during SSR
!vue.isInSSRComponentSetup && vue.injectHook(lifecycle, hook, target);
const onShow = /*#__PURE__*/ createHook(ON_SHOW);
const onHide = /*#__PURE__*/ createHook(ON_HIDE);
const onLaunch = /*#__PURE__*/ createHook(ON_LAUNCH);
const onError = /*#__PURE__*/ createHook(ON_ERROR);
const onThemeChange = /*#__PURE__*/ createHook(ON_THEME_CHANGE);
const onPageNotFound = /*#__PURE__*/ createHook(ON_PAGE_NOT_FOUND);
const onUnhandledRejection = /*#__PURE__*/ createHook(ON_UNHANDLE_REJECTION);
const onReady = /*#__PURE__*/ createHook(ON_READY);
const onUnload = /*#__PURE__*/ createHook(ON_UNLOAD);
const onResize = /*#__PURE__*/ createHook(ON_RESIZE);
const onBackPress = /*#__PURE__*/ createHook(ON_BACK_PRESS);
const onPageScroll = /*#__PURE__*/ createHook(ON_PAGE_SCROLL);
const onTabItemTap = /*#__PURE__*/ createHook(ON_TAB_ITEM_TAP);
const onReachBottom = /*#__PURE__*/ createHook(ON_REACH_BOTTOM);
const onPullDownRefresh = /*#__PURE__*/ createHook(ON_PULL_DOWN_REFRESH);
const onShareTimeline = /*#__PURE__*/ createHook(ON_SHARE_TIMELINE);
const onAddToFavorites = /*#__PURE__*/ createHook(ON_ADD_TO_FAVORITES);
const onShareAppMessage = /*#__PURE__*/ createHook(ON_SHARE_APP_MESSAGE);
const onNavigationBarButtonTap = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_BUTTON_TAP);
const onNavigationBarSearchInputChanged = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED);
const onNavigationBarSearchInputClicked = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED);
const onNavigationBarSearchInputConfirmed = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED);
const onNavigationBarSearchInputFocusChanged = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED);
exports.getSsrGlobalData = getSsrGlobalData;
exports.onAddToFavorites = onAddToFavorites;
exports.onBackPress = onBackPress;
exports.onError = onError;
exports.onHide = onHide;
exports.onLaunch = onLaunch;
exports.onNavigationBarButtonTap = onNavigationBarButtonTap;
exports.onNavigationBarSearchInputChanged = onNavigationBarSearchInputChanged;
exports.onNavigationBarSearchInputClicked = onNavigationBarSearchInputClicked;
exports.onNavigationBarSearchInputConfirmed = onNavigationBarSearchInputConfirmed;
exports.onNavigationBarSearchInputFocusChanged = onNavigationBarSearchInputFocusChanged;
exports.onPageNotFound = onPageNotFound;
exports.onPageScroll = onPageScroll;
exports.onPullDownRefresh = onPullDownRefresh;
exports.onReachBottom = onReachBottom;
exports.onReady = onReady;
exports.onResize = onResize;
exports.onShareAppMessage = onShareAppMessage;
exports.onShareTimeline = onShareTimeline;
exports.onShow = onShow;
exports.onTabItemTap = onTabItemTap;
exports.onThemeChange = onThemeChange;
exports.onUnhandledRejection = onUnhandledRejection;
exports.onUnload = onUnload;
exports.resolveEasycom = resolveEasycom;
exports.shallowSsrRef = shallowSsrRef;
exports.ssrRef = ssrRef;
import { ComponentInternalInstance } from 'vue';
import { ref } from 'vue';
import { shallowRef } from 'vue';
export declare function getSsrGlobalData(): any;
export declare const onAddToFavorites: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onBackPress: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onError: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onHide: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onLaunch: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onNavigationBarButtonTap: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onNavigationBarSearchInputChanged: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onNavigationBarSearchInputClicked: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onNavigationBarSearchInputConfirmed: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onNavigationBarSearchInputFocusChanged: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onPageNotFound: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onPageScroll: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onPullDownRefresh: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onReachBottom: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onReady: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onResize: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onShareAppMessage: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onShareTimeline: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onShow: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onTabItemTap: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onThemeChange: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onUnhandledRejection: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare const onUnload: (hook: () => any, target?: ComponentInternalInstance | null) => any;
export declare function resolveEasycom(component: unknown, easycom: unknown): unknown;
export declare const shallowSsrRef: SSRRef;
declare type SSRRef = (value: unknown, key?: string, shallow?: boolean) => ReturnType<typeof ref> | ReturnType<typeof shallowRef>;
export declare const ssrRef: SSRRef;
export { }
import { shallowRef, ref, getCurrentInstance, isInSSRComponentSetup, injectHook } from 'vue';
import { hasOwn, isString } from '@vue/shared';
const sanitise = (val) => (val && JSON.parse(JSON.stringify(val))) || val;
const UNI_SSR = '__uniSSR';
const UNI_SSR_DATA = 'data';
const UNI_SSR_GLOBAL_DATA = 'globalData';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_BACK_PRESS = 'onBackPress';
const ON_PAGE_SCROLL = 'onPageScroll';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_SHARE_TIMELINE = 'onShareTimeline';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const ON_SHARE_APP_MESSAGE = 'onShareAppMessage';
// navigationBar
const ON_NAVIGATION_BAR_BUTTON_TAP = 'onNavigationBarButtonTap';
const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = 'onNavigationBarSearchInputClicked';
const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = 'onNavigationBarSearchInputChanged';
const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = 'onNavigationBarSearchInputConfirmed';
const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = 'onNavigationBarSearchInputFocusChanged';
function getSSRDataType() {
return getCurrentInstance() ? UNI_SSR_DATA : UNI_SSR_GLOBAL_DATA;
}
function assertKey(key, shallow = false) {
if (!key) {
throw new Error(`${shallow ? 'shallowSsrRef' : 'ssrRef'}: You must provide a key.`);
}
}
const ssrClientRef = (value, key, shallow = false) => {
const valRef = shallow ? shallowRef(value) : ref(value);
// 非 h5 平台
if (typeof window === 'undefined') {
return valRef;
}
const __uniSSR = window[UNI_SSR];
if (!__uniSSR) {
return valRef;
}
const type = getSSRDataType();
assertKey(key, shallow);
if (hasOwn(__uniSSR[type], key)) {
valRef.value = __uniSSR[type][key];
if (type === UNI_SSR_DATA) {
delete __uniSSR[type][key]; // TODO 非全局数据仅使用一次?否则下次还会再次使用该数据
}
}
return valRef;
};
const globalData = {};
const ssrRef = (value, key) => {
return ssrClientRef(value, key);
};
const shallowSsrRef = (value, key) => {
return ssrClientRef(value, key, true);
};
function getSsrGlobalData() {
return sanitise(globalData);
}
function resolveEasycom(component, easycom) {
return isString(component) ? easycom : component;
}
// @ts-ignore
const createHook = (lifecycle) => (hook, target = getCurrentInstance()) =>
// post-create lifecycle registrations are noops during SSR
!isInSSRComponentSetup && injectHook(lifecycle, hook, target);
const onShow = /*#__PURE__*/ createHook(ON_SHOW);
const onHide = /*#__PURE__*/ createHook(ON_HIDE);
const onLaunch = /*#__PURE__*/ createHook(ON_LAUNCH);
const onError = /*#__PURE__*/ createHook(ON_ERROR);
const onThemeChange = /*#__PURE__*/ createHook(ON_THEME_CHANGE);
const onPageNotFound = /*#__PURE__*/ createHook(ON_PAGE_NOT_FOUND);
const onUnhandledRejection = /*#__PURE__*/ createHook(ON_UNHANDLE_REJECTION);
const onReady = /*#__PURE__*/ createHook(ON_READY);
const onUnload = /*#__PURE__*/ createHook(ON_UNLOAD);
const onResize = /*#__PURE__*/ createHook(ON_RESIZE);
const onBackPress = /*#__PURE__*/ createHook(ON_BACK_PRESS);
const onPageScroll = /*#__PURE__*/ createHook(ON_PAGE_SCROLL);
const onTabItemTap = /*#__PURE__*/ createHook(ON_TAB_ITEM_TAP);
const onReachBottom = /*#__PURE__*/ createHook(ON_REACH_BOTTOM);
const onPullDownRefresh = /*#__PURE__*/ createHook(ON_PULL_DOWN_REFRESH);
const onShareTimeline = /*#__PURE__*/ createHook(ON_SHARE_TIMELINE);
const onAddToFavorites = /*#__PURE__*/ createHook(ON_ADD_TO_FAVORITES);
const onShareAppMessage = /*#__PURE__*/ createHook(ON_SHARE_APP_MESSAGE);
const onNavigationBarButtonTap = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_BUTTON_TAP);
const onNavigationBarSearchInputChanged = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED);
const onNavigationBarSearchInputClicked = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED);
const onNavigationBarSearchInputConfirmed = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED);
const onNavigationBarSearchInputFocusChanged = /*#__PURE__*/ createHook(ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED);
export { getSsrGlobalData, onAddToFavorites, onBackPress, onError, onHide, onLaunch, onNavigationBarButtonTap, onNavigationBarSearchInputChanged, onNavigationBarSearchInputClicked, onNavigationBarSearchInputConfirmed, onNavigationBarSearchInputFocusChanged, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, resolveEasycom, shallowSsrRef, ssrRef };
{
"name": "@dcloudio/uni-app",
"version": "3.0.0-alpha-3000020210813002",
"description": "@dcloudio/uni-app",
"main": "./dist/uni-app.cjs.js",
"module": "./dist/uni-app.es.js",
"types": "./dist/uni-app.d.ts",
"files": [
"dist"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
"directory": "packages/uni-app"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/dcloudio/uni-app/issues"
},
"gitHead": "d5896d19315a106039411c16bbf8b804a865450d"
}
const debug = require('debug')
const {
M,
defineUniMainJsPlugin,
getUniStatistics,
parseManifestJsonOnce,
parsePagesJsonOnce,
} = require('@dcloudio/uni-cli-shared')
module.exports = [
defineUniMainJsPlugin((opts) => {
let isEnable = false
return {
name: 'vite:uni-stat',
enforce: 'pre',
config(config, env) {
if (isSsr(env.command, config)) {
return
}
const inputDir = process.env.UNI_INPUT_DIR
const platform = process.env.UNI_PLATFORM
isEnable = getUniStatistics(inputDir, platform).enable === true
if (process.env.NODE_ENV === 'production') {
const manifestJson = parseManifestJsonOnce(inputDir)
if (!manifestJson.appid) {
console.log()
console.warn(M['stat.warn.appid'])
console.log()
isEnable = false
}
}
const titlesJson = Object.create(null)
if (isEnable) {
parsePagesJsonOnce(inputDir, platform).pages.forEach((page) => {
const titleText = page.style.navigationBar.titleText || ''
if (titleText) {
titlesJson[page.path] = titleText
}
})
}
debug('vite:uni:stat')('isEnable', isEnable)
return {
define: {
'process.env.UNI_STAT_TITLE_JSON': JSON.stringify(titlesJson),
},
}
},
transform(code, id) {
if (isEnable && opts.filter(id)) {
return {
code: code + `;import '@dcloudio/uni-stat';`,
map: null,
}
}
},
}
}),
]
function isSsr(command, config) {
if (command === 'serve') {
return !!(config.server && config.server.middlewareMode)
}
if (command === 'build') {
return !!(config.build && config.build.ssr)
}
return false
}
{
"name": "@dcloudio/uni-stat",
"version": "3.0.0-alpha-3000020210813002",
"description": "@dcloudio/uni-stat",
"main": "dist/uni-stat.cjs.js",
"module": "dist/uni-stat.es.js",
"files": [
"dist",
"lib"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
"directory": "packages/uni-stat"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/dcloudio/uni-app/issues"
},
"uni-app": {
"name": "uniStat"
},
"gitHead": "d5896d19315a106039411c16bbf8b804a865450d"
}
{
"systemParams": "darwin-x64-83",
"modulesFolders": [
"node_modules"
],
"flags": [],
"linkedModules": [
"vite"
],
"topLevelPatterns": [
"vue-i18n@^9.1.7"
],
"lockfileEntries": {
"@intlify/core-base@9.1.7": "https://registry.yarnpkg.com/@intlify/core-base/-/core-base-9.1.7.tgz#a454a492683690bc3d0abab82605ab5a23645bd0",
"@intlify/devtools-if@9.1.7": "https://registry.yarnpkg.com/@intlify/devtools-if/-/devtools-if-9.1.7.tgz#a5df0f33e06c3ead3e53b7f4d4b10a2d52309361",
"@intlify/message-compiler@9.1.7": "https://registry.yarnpkg.com/@intlify/message-compiler/-/message-compiler-9.1.7.tgz#4663fcc2a190f3cc6970e12565c8d6f22beeb719",
"@intlify/message-resolver@9.1.7": "https://registry.yarnpkg.com/@intlify/message-resolver/-/message-resolver-9.1.7.tgz#a95d13866c8de85784358039c8845668152e4162",
"@intlify/runtime@9.1.7": "https://registry.yarnpkg.com/@intlify/runtime/-/runtime-9.1.7.tgz#67e0d6b2fd85a5b0b301a151c2f436f93154c3c6",
"@intlify/shared@9.1.7": "https://registry.yarnpkg.com/@intlify/shared/-/shared-9.1.7.tgz#e7d8bc90cb59dc17dd7b4c85a73db16fcb7891fc",
"@intlify/vue-devtools@9.1.7": "https://registry.yarnpkg.com/@intlify/vue-devtools/-/vue-devtools-9.1.7.tgz#b08d39bb5f21ba9b1954eab9466e9408129425a7",
"@vue/devtools-api@^6.0.0-beta.7": "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.15.tgz#ad7cb384e062f165bcf9c83732125bffbc2ad83d",
"source-map@0.6.1": "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
"vue-i18n@^9.1.7": "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-9.1.7.tgz#6f28dd2135197066508e2e65ab204a019750d773"
},
"files": [],
"artifacts": {}
}
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2020 kazuya kawaguchi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @intlify/core-base
The intlify core base module
## :copyright: License
[MIT](http://opensource.org/licenses/MIT)
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/core-base.cjs.prod.js')
} else {
module.exports = require('./dist/core-base.cjs.js')
}
{
"name": "@intlify/core-base",
"version": "9.1.7",
"description": "@intlify/core-base",
"keywords": [
"core",
"fundamental",
"i18n",
"internationalization",
"intlify"
],
"license": "MIT",
"author": {
"name": "kazuya kawaguchi",
"email": "kawakazu80@gmail.com"
},
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/core-base#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/intlify/vue-i18n-next.git",
"directory": "packages/core"
},
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/core-base.esm-bundler.js",
"unpkg": "dist/core-base.global.js",
"jsdelivr": "dist/core-base.global.js",
"types": "dist/core-base.d.ts",
"dependencies": {
"@intlify/devtools-if": "9.1.7",
"@intlify/message-compiler": "9.1.7",
"@intlify/message-resolver": "9.1.7",
"@intlify/runtime": "9.1.7",
"@intlify/shared": "9.1.7",
"@intlify/vue-devtools": "9.1.7"
},
"engines": {
"node": ">= 10"
},
"buildOptions": {
"name": "IntlifyCoreBase",
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"publishConfig": {
"access": "public"
},
"sideEffects": false
}
The MIT License (MIT)
Copyright (c) 2021 kazuya kawaguchi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @intlify/devtools-if
The [`@intlify/devtools`](https://github.com/intlify/devtools) interface(I/F:if) for intlify projects
## :warning: NOTE:
This is experimental.
Don’t use in production yet.
## :copyright: License
[MIT](http://opensource.org/licenses/MIT)
/*!
* @intlify/devtools-if v9.1.7
* (c) 2021 kazuya kawaguchi
* Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const IntlifyDevToolsHooks = {
I18nInit: 'i18n:init',
FunctionTranslate: 'function:translate'
};
exports.IntlifyDevToolsHooks = IntlifyDevToolsHooks;
/*!
* @intlify/devtools-if v9.1.7
* (c) 2021 kazuya kawaguchi
* Released under the MIT License.
*/
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const IntlifyDevToolsHooks = {
I18nInit: 'i18n:init',
FunctionTranslate: 'function:translate'
};
exports.IntlifyDevToolsHooks = IntlifyDevToolsHooks;
import type { Emittable } from '@intlify/shared';
export declare type AdditionalPayloads = {
meta?: Record<string, unknown>;
};
export declare type IntlifyDevToolsEmitter = Emittable<IntlifyDevToolsEmitterHooks>;
export declare type IntlifyDevToolsEmitterHooks = {
[IntlifyDevToolsHooks.I18nInit]: IntlifyDevToolsHookPayloads[typeof IntlifyDevToolsHooks.I18nInit];
[IntlifyDevToolsHooks.FunctionTranslate]: IntlifyDevToolsHookPayloads[typeof IntlifyDevToolsHooks.FunctionTranslate];
};
export declare type IntlifyDevToolsHookPayloads = {
[IntlifyDevToolsHooks.I18nInit]: {
timestamp: number;
i18n: unknown;
version: string;
} & AdditionalPayloads;
[IntlifyDevToolsHooks.FunctionTranslate]: {
timestamp: number;
message: string | number;
key: string;
locale: string;
format?: string;
} & AdditionalPayloads;
};
export declare const IntlifyDevToolsHooks: {
readonly I18nInit: "i18n:init";
readonly FunctionTranslate: "function:translate";
};
export declare type IntlifyDevToolsHooks = typeof IntlifyDevToolsHooks[keyof typeof IntlifyDevToolsHooks];
export declare interface IntlifyRecord {
id: number;
i18n: unknown;
version: string;
types: Record<string, string | Symbol>;
}
export { }
/*!
* @intlify/devtools-if v9.1.7
* (c) 2021 kazuya kawaguchi
* Released under the MIT License.
*/
const IntlifyDevToolsHooks = {
I18nInit: 'i18n:init',
FunctionTranslate: 'function:translate'
};
export { IntlifyDevToolsHooks };
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/devtools-if.cjs.prod.js')
} else {
module.exports = require('./dist/devtools-if.cjs.js')
}
{
"name": "@intlify/devtools-if",
"version": "9.1.7",
"description": "@intlify/devtools-if",
"keywords": [
"devtools",
"i18n",
"internationalization",
"intlify"
],
"license": "MIT",
"author": {
"name": "kazuya kawaguchi",
"email": "kawakazu80@gmail.com"
},
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/devtools-if#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/intlify/vue-i18n-next.git",
"directory": "packages/devtools-if"
},
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/devtools-if.esm-bundler.js",
"types": "dist/devtools-if.d.ts",
"dependencies": {
"@intlify/shared": "9.1.7"
},
"engines": {
"node": ">= 10"
},
"buildOptions": {
"name": "IntlifyDevToolsIf",
"formats": [
"esm-bundler",
"cjs"
]
},
"publishConfig": {
"access": "public"
},
"sideEffects": false
}
The MIT License (MIT)
Copyright (c) 2020 kazuya kawaguchi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @intlify/message-compiler
The message compiler for intlify project
## :copyright: License
[MIT](http://opensource.org/licenses/MIT)
import { RawSourceMap } from 'source-map';
export declare function baseCompile(source: string, options?: CompileOptions): CodeGenResult;
export declare interface CodeGenOptions {
mode?: 'normal' | 'arrow';
breakLineCode?: '\n' | ';';
needIndent?: boolean;
onError?: CompileErrorHandler;
sourceMap?: boolean;
filename?: string;
}
declare interface CodeGenResult {
code: string;
ast: ResourceNode;
map?: RawSourceMap;
}
export declare type CompileCacheKeyHandler = (source: string) => string;
export declare type CompileDomain = 'tokenizer' | 'parser' | 'generator' | 'transformer' | 'compiler';
export declare interface CompileError extends SyntaxError {
code: number;
domain?: CompileDomain;
location?: SourceLocation;
}
export declare const enum CompileErrorCodes {
EXPECTED_TOKEN = 0,
INVALID_TOKEN_IN_PLACEHOLDER = 1,
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER = 2,
UNKNOWN_ESCAPE_SEQUENCE = 3,
INVALID_UNICODE_ESCAPE_SEQUENCE = 4,
UNBALANCED_CLOSING_BRACE = 5,
UNTERMINATED_CLOSING_BRACE = 6,
EMPTY_PLACEHOLDER = 7,
NOT_ALLOW_NEST_PLACEHOLDER = 8,
INVALID_LINKED_FORMAT = 9,
MUST_HAVE_MESSAGES_IN_PLURAL = 10,
UNEXPECTED_EMPTY_LINKED_MODIFIER = 11,
UNEXPECTED_EMPTY_LINKED_KEY = 12,
UNEXPECTED_LEXICAL_ANALYSIS = 13,
__EXTEND_POINT__ = 14
}
export declare type CompileErrorHandler = (error: CompileError) => void;
export declare type CompileOptions = {
warnHtmlMessage?: boolean;
onCacheKey?: CompileCacheKeyHandler;
} & TransformOptions & CodeGenOptions & ParserOptions & TokenizeOptions;
export declare function createCompileError<T extends number>(code: T, loc: SourceLocation | null, options?: CreateCompileErrorOptions): CompileError;
export declare interface CreateCompileErrorOptions {
domain?: CompileDomain;
messages?: {
[code: number]: string;
};
args?: unknown[];
}
export declare function createLocation(start: Position, end: Position, source?: string): SourceLocation;
export declare function createParser(options?: ParserOptions): Parser;
export declare function createPosition(line: number, column: number, offset: number): Position;
/* Excluded from this release type: defaultOnError */
export declare const ERROR_DOMAIN = "parser";
/* Excluded from this release type: errorMessages */
export declare const enum HelperNameMap {
LIST = "list",
NAMED = "named",
PLURAL = "plural",
LINKED = "linked",
MESSAGE = "message",
TYPE = "type",
INTERPOLATE = "interpolate",
NORMALIZE = "normalize"
}
export declare type Identifier = string;
export declare interface LinkedKeyNode extends Node_2 {
type: NodeTypes.LinkedKey;
value: string;
}
export declare interface LinkedModifierNode extends Node_2 {
type: NodeTypes.LinkedModifier;
value: Identifier;
}
export declare interface LinkedNode extends Node_2 {
type: NodeTypes.Linked;
modifier?: LinkedModifierNode;
key: LinkedKeyNode | NamedNode | ListNode | LiteralNode;
}
export declare interface ListNode extends Node_2 {
type: NodeTypes.List;
index: number;
}
export declare interface LiteralNode extends Node_2 {
type: NodeTypes.Literal;
value: string;
}
export declare const LocationStub: SourceLocation;
declare type MessageElementNode = TextNode | NamedNode | ListNode | LiteralNode | LinkedNode;
export declare interface MessageNode extends Node_2 {
type: NodeTypes.Message;
items: MessageElementNode[];
}
export declare interface NamedNode extends Node_2 {
type: NodeTypes.Named;
key: Identifier;
}
declare interface Node_2 {
type: NodeTypes;
start: number;
end: number;
loc?: SourceLocation;
}
export { Node_2 as Node }
export declare const enum NodeTypes {
Resource = 0,
Plural = 1,
Message = 2,
Text = 3,
Named = 4,
List = 5,
Linked = 6,
LinkedKey = 7,
LinkedModifier = 8,
Literal = 9
}
export declare interface Parser {
parse(source: string): ResourceNode;
}
export declare interface ParserOptions {
location?: boolean;
onError?: CompileErrorHandler;
}
export declare interface PluralNode extends Node_2 {
type: NodeTypes.Plural;
cases: MessageNode[];
}
export declare interface Position {
offset: number;
line: number;
column: number;
}
export declare interface ResourceNode extends Node_2 {
type: NodeTypes.Resource;
body: MessageNode | PluralNode;
helpers?: string[];
}
export declare interface SourceLocation {
start: Position;
end: Position;
source?: string;
}
export declare interface TextNode extends Node_2 {
type: NodeTypes.Text;
value: string;
}
export declare interface TokenizeOptions {
location?: boolean;
onError?: CompileErrorHandler;
}
export declare interface TransformOptions {
onError?: CompileErrorHandler;
}
export { }
/*!
* @intlify/message-compiler v9.1.7
* (c) 2021 kazuya kawaguchi
* Released under the MIT License.
*/
const e=Object.assign,n=e=>"string"==typeof e,t={0:"Expected token: '{0}'",1:"Invalid token in placeholder: '{0}'",2:"Unterminated single quote in placeholder",3:"Unknown escape sequence: \\{0}",4:"Invalid unicode escape sequence: {0}",5:"Unbalanced closing brace",6:"Unterminated closing brace",7:"Empty placeholder",8:"Not allowed nest placeholder",9:"Invalid linked format",10:"Plural must have messages",11:"Unexpected empty linked modifier",12:"Unexpected empty linked key",13:"Unexpected lexical analysis in token: '{0}'"};function r(e,n,t={}){const{domain:r}=t,c=new SyntaxError(String(e));return c.code=e,n&&(c.location=n),c.domain=r,c}function c(e){throw e}const o={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function u(e,n,t){return{line:e,column:n,offset:t}}function s(e,n,t){const r={start:e,end:n};return null!=t&&(r.source=t),r}const i=String.fromCharCode(8232),a=String.fromCharCode(8233);function l(e){const n=e;let t=0,r=1,c=1,o=0;const u=e=>"\r"===n[e]&&"\n"===n[e+1],s=e=>n[e]===a,l=e=>n[e]===i,f=e=>u(e)||(e=>"\n"===n[e])(e)||s(e)||l(e),d=e=>u(e)||s(e)||l(e)?"\n":n[e];function p(){return o=0,f(t)&&(r++,c=0),u(t)&&t++,t++,c++,n[t]}return{index:()=>t,line:()=>r,column:()=>c,peekOffset:()=>o,charAt:d,currentChar:()=>d(t),currentPeek:()=>d(t+o),next:p,peek:function(){return u(t+o)&&o++,o++,n[t+o]},reset:function(){t=0,r=1,c=1,o=0},resetPeek:function(e=0){o=e},skipToPeek:function(){const e=t+o;for(;e!==t;)p();o=0}}}const f=void 0;function d(e,n={}){const t=!1!==n.location,r=l(e),c=()=>r.index(),o=()=>u(r.line(),r.column(),r.index()),i=o(),a=c(),d={currentType:14,offset:a,startLoc:i,endLoc:i,lastType:14,lastOffset:a,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},p=()=>d,{onError:k}=n;function h(e,n,r){e.endLoc=o(),e.currentType=n;const c={type:n};return t&&(c.loc=s(e.startLoc,e.endLoc)),null!=r&&(c.value=r),c}const x=e=>h(e,14);function y(e,n){return e.currentChar()===n?(e.next(),n):(o(),"")}function m(e){let n="";for(;" "===e.currentPeek()||"\n"===e.currentPeek();)n+=e.currentPeek(),e.peek();return n}function b(e){const n=m(e);return e.skipToPeek(),n}function L(e){if(e===f)return!1;const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||95===n}function T(e,n){const{currentType:t}=n;if(2!==t)return!1;m(e);const r=function(e){if(e===f)return!1;const n=e.charCodeAt(0);return n>=48&&n<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function v(e){m(e);const n="|"===e.currentPeek();return e.resetPeek(),n}function P(e,n=!0){const t=(n=!1,r="",c=!1)=>{const o=e.currentPeek();return"{"===o?"%"!==r&&n:"@"!==o&&o?"%"===o?(e.peek(),t(n,"%",!0)):"|"===o?!("%"!==r&&!c)||!(" "===r||"\n"===r):" "===o?(e.peek(),t(!0," ",c)):"\n"!==o||(e.peek(),t(!0,"\n",c)):"%"===r||n},r=t();return n&&e.resetPeek(),r}function C(e,n){const t=e.currentChar();return t===f?f:n(t)?(e.next(),t):null}function O(e){return C(e,(e=>{const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||95===n||36===n}))}function g(e){return C(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57}))}function N(e){return C(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}))}function w(e){let n="",t="";for(;n=g(e);)t+=n;return t}function $(e){const n=e.currentChar();switch(n){case"\\":case"'":return e.next(),`\\${n}`;case"u":return S(e,n,4);case"U":return S(e,n,6);default:return o(),""}}function S(e,n,t){y(e,n);let r="";for(let n=0;n<t;n++){const n=N(e);if(!n){o(),e.currentChar();break}r+=n}return`\\${n}${r}`}function I(e){b(e);const n=y(e,"|");return b(e),n}function A(e,n){let t=null;switch(e.currentChar()){case"{":return n.braceNest>=1&&o(),e.next(),t=h(n,2,"{"),b(e),n.braceNest++,t;case"}":return n.braceNest>0&&2===n.currentType&&o(),e.next(),t=h(n,3,"}"),n.braceNest--,n.braceNest>0&&b(e),n.inLinked&&0===n.braceNest&&(n.inLinked=!1),t;case"@":return n.braceNest>0&&o(),t=E(e,n)||x(n),n.braceNest=0,t;default:let r=!0,c=!0,u=!0;if(v(e))return n.braceNest>0&&o(),t=h(n,1,I(e)),n.braceNest=0,n.inLinked=!1,t;if(n.braceNest>0&&(5===n.currentType||6===n.currentType||7===n.currentType))return o(),n.braceNest=0,U(e,n);if(r=function(e,n){const{currentType:t}=n;if(2!==t)return!1;m(e);const r=L(e.currentPeek());return e.resetPeek(),r}(e,n))return t=h(n,5,function(e){b(e);let n="",t="";for(;n=O(e);)t+=n;return e.currentChar()===f&&o(),t}(e)),b(e),t;if(c=T(e,n))return t=h(n,6,function(e){b(e);let n="";return"-"===e.currentChar()?(e.next(),n+=`-${w(e)}`):n+=w(e),e.currentChar()===f&&o(),n}(e)),b(e),t;if(u=function(e,n){const{currentType:t}=n;if(2!==t)return!1;m(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,n))return t=h(n,7,function(e){b(e),y(e,"'");let n="",t="";const r=e=>"'"!==e&&"\n"!==e;for(;n=C(e,r);)t+="\\"===n?$(e):n;const c=e.currentChar();return"\n"===c||c===f?(o(),"\n"===c&&(e.next(),y(e,"'")),t):(y(e,"'"),t)}(e)),b(e),t;if(!r&&!c&&!u)return t=h(n,13,function(e){b(e);let n="",t="";const r=e=>"{"!==e&&"}"!==e&&" "!==e&&"\n"!==e;for(;n=C(e,r);)t+=n;return t}(e)),o(),b(e),t}return t}function E(e,n){const{currentType:t}=n;let r=null;const c=e.currentChar();switch(8!==t&&9!==t&&12!==t&&10!==t||"\n"!==c&&" "!==c||o(),c){case"@":return e.next(),r=h(n,8,"@"),n.inLinked=!0,r;case".":return b(e),e.next(),h(n,9,".");case":":return b(e),e.next(),h(n,10,":");default:return v(e)?(r=h(n,1,I(e)),n.braceNest=0,n.inLinked=!1,r):function(e,n){const{currentType:t}=n;if(8!==t)return!1;m(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,n)||function(e,n){const{currentType:t}=n;if(8!==t&&12!==t)return!1;m(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,n)?(b(e),E(e,n)):function(e,n){const{currentType:t}=n;if(9!==t)return!1;m(e);const r=L(e.currentPeek());return e.resetPeek(),r}(e,n)?(b(e),h(n,12,function(e){let n="",t="";for(;n=O(e);)t+=n;return t}(e))):function(e,n){const{currentType:t}=n;if(10!==t)return!1;const r=()=>{const n=e.currentPeek();return"{"===n?L(e.peek()):!("@"===n||"%"===n||"|"===n||":"===n||"."===n||" "===n||!n)&&("\n"===n?(e.peek(),r()):L(n))},c=r();return e.resetPeek(),c}(e,n)?(b(e),"{"===c?A(e,n)||r:h(n,11,function(e){const n=(t=!1,r)=>{const c=e.currentChar();return"{"!==c&&"%"!==c&&"@"!==c&&"|"!==c&&c?" "===c?r:"\n"===c?(r+=c,e.next(),n(t,r)):(r+=c,e.next(),n(!0,r)):r};return n(!1,"")}(e))):(8===t&&o(),n.braceNest=0,n.inLinked=!1,U(e,n))}}function U(e,n){let t={type:14};if(n.braceNest>0)return A(e,n)||x(n);if(n.inLinked)return E(e,n)||x(n);const r=e.currentChar();switch(r){case"{":return A(e,n)||x(n);case"}":return o(),e.next(),h(n,3,"}");case"@":return E(e,n)||x(n);default:if(v(e))return t=h(n,1,I(e)),n.braceNest=0,n.inLinked=!1,t;if(P(e))return h(n,0,function(e){const n=t=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?P(e)?(t+=r,e.next(),n(t)):t:"|"===r?t:" "===r||"\n"===r?P(e)?(t+=r,e.next(),n(t)):v(e)?t:(t+=r,e.next(),n(t)):(t+=r,e.next(),n(t)):t};return n("")}(e));if("%"===r)return e.next(),h(n,4,"%")}return t}return{nextToken:function(){const{currentType:e,offset:n,startLoc:t,endLoc:u}=d;return d.lastType=e,d.lastOffset=n,d.lastStartLoc=t,d.lastEndLoc=u,d.offset=c(),d.startLoc=o(),r.currentChar()===f?h(d,14):U(r,d)},currentOffset:c,currentPosition:o,context:p}}const p="parser",k=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function h(e,n,t){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(n||t,16);return e<=55295||e>=57344?String.fromCodePoint(e):""}}}function x(n={}){const t=!1!==n.location,{onError:r}=n;function c(e,n,r){const c={type:e,start:n,end:n};return t&&(c.loc={start:r,end:r}),c}function o(e,n,r,c){e.end=n,c&&(e.type=c),t&&e.loc&&(e.loc.end=r)}function u(e,n){const t=e.context(),r=c(3,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}function s(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(5,r,u);return s.index=parseInt(n,10),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function i(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(4,r,u);return s.key=n,e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function a(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(9,r,u);return s.value=n.replace(k,h),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function l(e){const n=e.context(),t=c(6,n.offset,n.startLoc);let r=e.nextToken();if(9===r.type){const n=function(e){const n=e.nextToken(),t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(8,r,u);return 12!==n.type?(s.value="",o(s,r,u),{nextConsumeToken:n,node:s}):(null==n.value&&y(n),s.value=n.value||"",o(s,e.currentOffset(),e.currentPosition()),{node:s})}(e);t.modifier=n.node,r=n.nextConsumeToken||e.nextToken()}switch(10!==r.type&&y(r),r=e.nextToken(),2===r.type&&(r=e.nextToken()),r.type){case 11:null==r.value&&y(r),t.key=function(e,n){const t=e.context(),r=c(7,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}(e,r.value||"");break;case 5:null==r.value&&y(r),t.key=i(e,r.value||"");break;case 6:null==r.value&&y(r),t.key=s(e,r.value||"");break;case 7:null==r.value&&y(r),t.key=a(e,r.value||"");break;default:const n=e.context(),u=c(7,n.offset,n.startLoc);return u.value="",o(u,n.offset,n.startLoc),t.key=u,o(t,n.offset,n.startLoc),{nextConsumeToken:r,node:t}}return o(t,e.currentOffset(),e.currentPosition()),{node:t}}function f(e){const n=e.context(),t=c(2,1===n.currentType?e.currentOffset():n.offset,1===n.currentType?n.endLoc:n.startLoc);t.items=[];let r=null;do{const n=r||e.nextToken();switch(r=null,n.type){case 0:null==n.value&&y(n),t.items.push(u(e,n.value||""));break;case 6:null==n.value&&y(n),t.items.push(s(e,n.value||""));break;case 5:null==n.value&&y(n),t.items.push(i(e,n.value||""));break;case 7:null==n.value&&y(n),t.items.push(a(e,n.value||""));break;case 8:const c=l(e);t.items.push(c.node),r=c.nextConsumeToken||null}}while(14!==n.currentType&&1!==n.currentType);return o(t,1===n.currentType?n.lastOffset:e.currentOffset(),1===n.currentType?n.lastEndLoc:e.currentPosition()),t}function p(e){const n=e.context(),{offset:t,startLoc:r}=n,u=f(e);return 14===n.currentType?u:function(e,n,t,r){const u=e.context();let s=0===r.items.length;const i=c(1,n,t);i.cases=[],i.cases.push(r);do{const n=f(e);s||(s=0===n.items.length),i.cases.push(n)}while(14!==u.currentType);return o(i,e.currentOffset(),e.currentPosition()),i}(e,t,r,u)}return{parse:function(r){const u=d(r,e({},n)),s=u.context(),i=c(0,s.offset,s.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=p(u),o(i,u.currentOffset(),u.currentPosition()),i}}}function y(e){if(14===e.type)return"EOF";const n=(e.value||"").replace(/\r?\n/gu,"\\n");return n.length>10?n.slice(0,9)+"":n}function m(e,n){for(let t=0;t<e.length;t++)b(e[t],n)}function b(e,n){switch(e.type){case 1:m(e.cases,n),n.helper("plural");break;case 2:m(e.items,n);break;case 6:b(e.key,n),n.helper("linked");break;case 5:n.helper("interpolate"),n.helper("list");break;case 4:n.helper("interpolate"),n.helper("named")}}function L(e,n={}){const t=function(e,n={}){const t={ast:e,helpers:new Set};return{context:()=>t,helper:e=>(t.helpers.add(e),e)}}(e);t.helper("normalize"),e.body&&b(e.body,t);const r=t.context();e.helpers=Array.from(r.helpers)}function T(e,n){const{helper:t}=e;switch(n.type){case 0:!function(e,n){n.body?T(e,n.body):e.push("null")}(e,n);break;case 1:!function(e,n){const{helper:t,needIndent:r}=e;if(n.cases.length>1){e.push(`${t("plural")}([`),e.indent(r());const c=n.cases.length;for(let t=0;t<c&&(T(e,n.cases[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}}(e,n);break;case 2:!function(e,n){const{helper:t,needIndent:r}=e;e.push(`${t("normalize")}([`),e.indent(r());const c=n.items.length;for(let t=0;t<c&&(T(e,n.items[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}(e,n);break;case 6:!function(e,n){const{helper:t}=e;e.push(`${t("linked")}(`),T(e,n.key),n.modifier&&(e.push(", "),T(e,n.modifier)),e.push(")")}(e,n);break;case 8:case 7:e.push(JSON.stringify(n.value),n);break;case 5:e.push(`${t("interpolate")}(${t("list")}(${n.index}))`,n);break;case 4:e.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(n.key)}))`,n);break;case 9:case 3:e.push(JSON.stringify(n.value),n)}}function v(t,r={}){const c=e({},r),o=x(c).parse(t);return L(o,c),((e,t={})=>{const r=n(t.mode)?t.mode:"normal",c=n(t.filename)?t.filename:"message.intl",o=t.needIndent?t.needIndent:"arrow"!==r,u=e.helpers||[],s=function(e,n){const{filename:t,breakLineCode:r,needIndent:c}=n,o={source:e.loc.source,filename:t,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:c,indentLevel:0};function u(e,n){o.code+=e}function s(e,n=!0){const t=n?r:"";u(c?t+" ".repeat(e):t)}return{context:()=>o,push:u,indent:function(e=!0){const n=++o.indentLevel;e&&s(n)},deindent:function(e=!0){const n=--o.indentLevel;e&&s(n)},newline:function(){s(o.indentLevel)},helper:e=>`_${e}`,needIndent:()=>o.needIndent}}(e,{mode:r,filename:c,sourceMap:!!t.sourceMap,breakLineCode:null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",needIndent:o});s.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),u.length>0&&(s.push(`const { ${u.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),T(s,e),s.deindent(o),s.push("}");const{code:i,map:a}=s.context();return{ast:e,code:i,map:a?a.toJSON():void 0}})(o,c)}export{p as ERROR_DOMAIN,o as LocationStub,v as baseCompile,r as createCompileError,s as createLocation,x as createParser,u as createPosition,c as defaultOnError,t as errorMessages};
/*!
* @intlify/message-compiler v9.1.7
* (c) 2021 kazuya kawaguchi
* Released under the MIT License.
*/
var IntlifyMessageCompiler=function(e){"use strict";const n=Object.assign,t=e=>"string"==typeof e,r={0:"Expected token: '{0}'",1:"Invalid token in placeholder: '{0}'",2:"Unterminated single quote in placeholder",3:"Unknown escape sequence: \\{0}",4:"Invalid unicode escape sequence: {0}",5:"Unbalanced closing brace",6:"Unterminated closing brace",7:"Empty placeholder",8:"Not allowed nest placeholder",9:"Invalid linked format",10:"Plural must have messages",11:"Unexpected empty linked modifier",12:"Unexpected empty linked key",13:"Unexpected lexical analysis in token: '{0}'"};function c(e,n,t={}){const{domain:r}=t,c=new SyntaxError(String(e));return c.code=e,n&&(c.location=n),c.domain=r,c}function o(e,n,t){return{line:e,column:n,offset:t}}function u(e,n,t){const r={start:e,end:n};return null!=t&&(r.source=t),r}const s=" ",i="\n",a=String.fromCharCode(8232),l=String.fromCharCode(8233);function f(e){const n=e;let t=0,r=1,c=1,o=0;const u=e=>"\r"===n[e]&&n[e+1]===i,s=e=>n[e]===l,f=e=>n[e]===a,d=e=>u(e)||(e=>n[e]===i)(e)||s(e)||f(e),p=e=>u(e)||s(e)||f(e)?i:n[e];function k(){return o=0,d(t)&&(r++,c=0),u(t)&&t++,t++,c++,n[t]}return{index:()=>t,line:()=>r,column:()=>c,peekOffset:()=>o,charAt:p,currentChar:()=>p(t),currentPeek:()=>p(t+o),next:k,peek:function(){return u(t+o)&&o++,o++,n[t+o]},reset:function(){t=0,r=1,c=1,o=0},resetPeek:function(e=0){o=e},skipToPeek:function(){const e=t+o;for(;e!==t;)k();o=0}}}const d=void 0;function p(e,n={}){const t=!1!==n.location,r=f(e),c=()=>r.index(),a=()=>o(r.line(),r.column(),r.index()),l=a(),p=c(),k={currentType:14,offset:p,startLoc:l,endLoc:l,lastType:14,lastOffset:p,lastStartLoc:l,lastEndLoc:l,braceNest:0,inLinked:!1,text:""},h=()=>k,{onError:x}=n;function y(e,n,r){e.endLoc=a(),e.currentType=n;const c={type:n};return t&&(c.loc=u(e.startLoc,e.endLoc)),null!=r&&(c.value=r),c}const m=e=>y(e,14);function b(e,n){return e.currentChar()===n?(e.next(),n):(a(),"")}function L(e){let n="";for(;e.currentPeek()===s||e.currentPeek()===i;)n+=e.currentPeek(),e.peek();return n}function P(e){const n=L(e);return e.skipToPeek(),n}function v(e){if(e===d)return!1;const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||95===n}function T(e,n){const{currentType:t}=n;if(2!==t)return!1;L(e);const r=function(e){if(e===d)return!1;const n=e.charCodeAt(0);return n>=48&&n<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function C(e){L(e);const n="|"===e.currentPeek();return e.resetPeek(),n}function O(e,n=!0){const t=(n=!1,r="",c=!1)=>{const o=e.currentPeek();return"{"===o?"%"!==r&&n:"@"!==o&&o?"%"===o?(e.peek(),t(n,"%",!0)):"|"===o?!("%"!==r&&!c)||!(r===s||r===i):o===s?(e.peek(),t(!0,s,c)):o!==i||(e.peek(),t(!0,i,c)):"%"===r||n},r=t();return n&&e.resetPeek(),r}function g(e,n){const t=e.currentChar();return t===d?d:n(t)?(e.next(),t):null}function N(e){return g(e,(e=>{const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||95===n||36===n}))}function w(e){return g(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57}))}function S(e){return g(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}))}function $(e){let n="",t="";for(;n=w(e);)t+=n;return t}function I(e){const n=e.currentChar();switch(n){case"\\":case"'":return e.next(),`\\${n}`;case"u":return E(e,n,4);case"U":return E(e,n,6);default:return a(),""}}function E(e,n,t){b(e,n);let r="";for(let n=0;n<t;n++){const n=S(e);if(!n){a(),e.currentChar();break}r+=n}return`\\${n}${r}`}function A(e){P(e);const n=b(e,"|");return P(e),n}function U(e,n){let t=null;switch(e.currentChar()){case"{":return n.braceNest>=1&&a(),e.next(),t=y(n,2,"{"),P(e),n.braceNest++,t;case"}":return n.braceNest>0&&2===n.currentType&&a(),e.next(),t=y(n,3,"}"),n.braceNest--,n.braceNest>0&&P(e),n.inLinked&&0===n.braceNest&&(n.inLinked=!1),t;case"@":return n.braceNest>0&&a(),t=_(e,n)||m(n),n.braceNest=0,t;default:let r=!0,c=!0,o=!0;if(C(e))return n.braceNest>0&&a(),t=y(n,1,A(e)),n.braceNest=0,n.inLinked=!1,t;if(n.braceNest>0&&(5===n.currentType||6===n.currentType||7===n.currentType))return a(),n.braceNest=0,M(e,n);if(r=function(e,n){const{currentType:t}=n;if(2!==t)return!1;L(e);const r=v(e.currentPeek());return e.resetPeek(),r}(e,n))return t=y(n,5,function(e){P(e);let n="",t="";for(;n=N(e);)t+=n;return e.currentChar()===d&&a(),t}(e)),P(e),t;if(c=T(e,n))return t=y(n,6,function(e){P(e);let n="";return"-"===e.currentChar()?(e.next(),n+=`-${$(e)}`):n+=$(e),e.currentChar()===d&&a(),n}(e)),P(e),t;if(o=function(e,n){const{currentType:t}=n;if(2!==t)return!1;L(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,n))return t=y(n,7,function(e){P(e),b(e,"'");let n="",t="";const r=e=>"'"!==e&&e!==i;for(;n=g(e,r);)t+="\\"===n?I(e):n;const c=e.currentChar();return c===i||c===d?(a(),c===i&&(e.next(),b(e,"'")),t):(b(e,"'"),t)}(e)),P(e),t;if(!r&&!c&&!o)return t=y(n,13,function(e){P(e);let n="",t="";const r=e=>"{"!==e&&"}"!==e&&e!==s&&e!==i;for(;n=g(e,r);)t+=n;return t}(e)),a(),P(e),t}return t}function _(e,n){const{currentType:t}=n;let r=null;const c=e.currentChar();switch(8!==t&&9!==t&&12!==t&&10!==t||c!==i&&c!==s||a(),c){case"@":return e.next(),r=y(n,8,"@"),n.inLinked=!0,r;case".":return P(e),e.next(),y(n,9,".");case":":return P(e),e.next(),y(n,10,":");default:return C(e)?(r=y(n,1,A(e)),n.braceNest=0,n.inLinked=!1,r):function(e,n){const{currentType:t}=n;if(8!==t)return!1;L(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,n)||function(e,n){const{currentType:t}=n;if(8!==t&&12!==t)return!1;L(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,n)?(P(e),_(e,n)):function(e,n){const{currentType:t}=n;if(9!==t)return!1;L(e);const r=v(e.currentPeek());return e.resetPeek(),r}(e,n)?(P(e),y(n,12,function(e){let n="",t="";for(;n=N(e);)t+=n;return t}(e))):function(e,n){const{currentType:t}=n;if(10!==t)return!1;const r=()=>{const n=e.currentPeek();return"{"===n?v(e.peek()):!("@"===n||"%"===n||"|"===n||":"===n||"."===n||n===s||!n)&&(n===i?(e.peek(),r()):v(n))},c=r();return e.resetPeek(),c}(e,n)?(P(e),"{"===c?U(e,n)||r:y(n,11,function(e){const n=(t=!1,r)=>{const c=e.currentChar();return"{"!==c&&"%"!==c&&"@"!==c&&"|"!==c&&c?c===s?r:c===i?(r+=c,e.next(),n(t,r)):(r+=c,e.next(),n(!0,r)):r};return n(!1,"")}(e))):(8===t&&a(),n.braceNest=0,n.inLinked=!1,M(e,n))}}function M(e,n){let t={type:14};if(n.braceNest>0)return U(e,n)||m(n);if(n.inLinked)return _(e,n)||m(n);const r=e.currentChar();switch(r){case"{":return U(e,n)||m(n);case"}":return a(),e.next(),y(n,3,"}");case"@":return _(e,n)||m(n);default:if(C(e))return t=y(n,1,A(e)),n.braceNest=0,n.inLinked=!1,t;if(O(e))return y(n,0,function(e){const n=t=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?O(e)?(t+=r,e.next(),n(t)):t:"|"===r?t:r===s||r===i?O(e)?(t+=r,e.next(),n(t)):C(e)?t:(t+=r,e.next(),n(t)):(t+=r,e.next(),n(t)):t};return n("")}(e));if("%"===r)return e.next(),y(n,4,"%")}return t}return{nextToken:function(){const{currentType:e,offset:n,startLoc:t,endLoc:o}=k;return k.lastType=e,k.lastOffset=n,k.lastStartLoc=t,k.lastEndLoc=o,k.offset=c(),k.startLoc=a(),r.currentChar()===d?y(k,14):M(r,k)},currentOffset:c,currentPosition:a,context:h}}const k="parser",h=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function x(e,n,t){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(n||t,16);return e<=55295||e>=57344?String.fromCodePoint(e):""}}}function y(e={}){const t=!1!==e.location,{onError:r}=e;function c(e,n,r){const c={type:e,start:n,end:n};return t&&(c.loc={start:r,end:r}),c}function o(e,n,r,c){e.end=n,c&&(e.type=c),t&&e.loc&&(e.loc.end=r)}function u(e,n){const t=e.context(),r=c(3,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}function s(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(5,r,u);return s.index=parseInt(n,10),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function i(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(4,r,u);return s.key=n,e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function a(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(9,r,u);return s.value=n.replace(h,x),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function l(e){const n=e.context(),t=c(6,n.offset,n.startLoc);let r=e.nextToken();if(9===r.type){const n=function(e){const n=e.nextToken(),t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(8,r,u);return 12!==n.type?(s.value="",o(s,r,u),{nextConsumeToken:n,node:s}):(null==n.value&&m(n),s.value=n.value||"",o(s,e.currentOffset(),e.currentPosition()),{node:s})}(e);t.modifier=n.node,r=n.nextConsumeToken||e.nextToken()}switch(10!==r.type&&m(r),r=e.nextToken(),2===r.type&&(r=e.nextToken()),r.type){case 11:null==r.value&&m(r),t.key=function(e,n){const t=e.context(),r=c(7,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}(e,r.value||"");break;case 5:null==r.value&&m(r),t.key=i(e,r.value||"");break;case 6:null==r.value&&m(r),t.key=s(e,r.value||"");break;case 7:null==r.value&&m(r),t.key=a(e,r.value||"");break;default:const n=e.context(),u=c(7,n.offset,n.startLoc);return u.value="",o(u,n.offset,n.startLoc),t.key=u,o(t,n.offset,n.startLoc),{nextConsumeToken:r,node:t}}return o(t,e.currentOffset(),e.currentPosition()),{node:t}}function f(e){const n=e.context(),t=c(2,1===n.currentType?e.currentOffset():n.offset,1===n.currentType?n.endLoc:n.startLoc);t.items=[];let r=null;do{const n=r||e.nextToken();switch(r=null,n.type){case 0:null==n.value&&m(n),t.items.push(u(e,n.value||""));break;case 6:null==n.value&&m(n),t.items.push(s(e,n.value||""));break;case 5:null==n.value&&m(n),t.items.push(i(e,n.value||""));break;case 7:null==n.value&&m(n),t.items.push(a(e,n.value||""));break;case 8:const c=l(e);t.items.push(c.node),r=c.nextConsumeToken||null}}while(14!==n.currentType&&1!==n.currentType);return o(t,1===n.currentType?n.lastOffset:e.currentOffset(),1===n.currentType?n.lastEndLoc:e.currentPosition()),t}function d(e){const n=e.context(),{offset:t,startLoc:r}=n,u=f(e);return 14===n.currentType?u:function(e,n,t,r){const u=e.context();let s=0===r.items.length;const i=c(1,n,t);i.cases=[],i.cases.push(r);do{const n=f(e);s||(s=0===n.items.length),i.cases.push(n)}while(14!==u.currentType);return o(i,e.currentOffset(),e.currentPosition()),i}(e,t,r,u)}return{parse:function(r){const u=p(r,n({},e)),s=u.context(),i=c(0,s.offset,s.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=d(u),o(i,u.currentOffset(),u.currentPosition()),i}}}function m(e){if(14===e.type)return"EOF";const n=(e.value||"").replace(/\r?\n/gu,"\\n");return n.length>10?n.slice(0,9)+"":n}function b(e,n){for(let t=0;t<e.length;t++)L(e[t],n)}function L(e,n){switch(e.type){case 1:b(e.cases,n),n.helper("plural");break;case 2:b(e.items,n);break;case 6:L(e.key,n),n.helper("linked");break;case 5:n.helper("interpolate"),n.helper("list");break;case 4:n.helper("interpolate"),n.helper("named")}}function P(e,n={}){const t=function(e,n={}){const t={ast:e,helpers:new Set};return{context:()=>t,helper:e=>(t.helpers.add(e),e)}}(e);t.helper("normalize"),e.body&&L(e.body,t);const r=t.context();e.helpers=Array.from(r.helpers)}function v(e,n){const{helper:t}=e;switch(n.type){case 0:!function(e,n){n.body?v(e,n.body):e.push("null")}(e,n);break;case 1:!function(e,n){const{helper:t,needIndent:r}=e;if(n.cases.length>1){e.push(`${t("plural")}([`),e.indent(r());const c=n.cases.length;for(let t=0;t<c&&(v(e,n.cases[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}}(e,n);break;case 2:!function(e,n){const{helper:t,needIndent:r}=e;e.push(`${t("normalize")}([`),e.indent(r());const c=n.items.length;for(let t=0;t<c&&(v(e,n.items[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}(e,n);break;case 6:!function(e,n){const{helper:t}=e;e.push(`${t("linked")}(`),v(e,n.key),n.modifier&&(e.push(", "),v(e,n.modifier)),e.push(")")}(e,n);break;case 8:case 7:e.push(JSON.stringify(n.value),n);break;case 5:e.push(`${t("interpolate")}(${t("list")}(${n.index}))`,n);break;case 4:e.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(n.key)}))`,n);break;case 9:case 3:e.push(JSON.stringify(n.value),n)}}return e.ERROR_DOMAIN=k,e.LocationStub={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}},e.baseCompile=function(e,r={}){const c=n({},r),o=y(c).parse(e);return P(o,c),((e,n={})=>{const r=t(n.mode)?n.mode:"normal",c=t(n.filename)?n.filename:"message.intl",o=n.needIndent?n.needIndent:"arrow"!==r,u=e.helpers||[],s=function(e,n){const{filename:t,breakLineCode:r,needIndent:c}=n,o={source:e.loc.source,filename:t,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:c,indentLevel:0};function u(e,n){o.code+=e}function s(e,n=!0){const t=n?r:"";u(c?t+" ".repeat(e):t)}return{context:()=>o,push:u,indent:function(e=!0){const n=++o.indentLevel;e&&s(n)},deindent:function(e=!0){const n=--o.indentLevel;e&&s(n)},newline:function(){s(o.indentLevel)},helper:e=>`_${e}`,needIndent:()=>o.needIndent}}(e,{mode:r,filename:c,sourceMap:!!n.sourceMap,breakLineCode:null!=n.breakLineCode?n.breakLineCode:"arrow"===r?";":"\n",needIndent:o});s.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),u.length>0&&(s.push(`const { ${u.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),v(s,e),s.deindent(o),s.push("}");const{code:i,map:a}=s.context();return{ast:e,code:i,map:a?a.toJSON():void 0}})(o,c)},e.createCompileError=c,e.createLocation=u,e.createParser=y,e.createPosition=o,e.defaultOnError=function(e){throw e},e.errorMessages=r,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/message-compiler.cjs.prod.js')
} else {
module.exports = require('./dist/message-compiler.cjs.js')
}
The MIT License (MIT)
Copyright (c) 2020 kazuya kawaguchi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# @intlify/message-resolver
The locale message resolver for intlify project
## :copyright: License
[MIT](http://opensource.org/licenses/MIT)
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册