j-vue
Version:
.vue single-file component back-end compiler. Belong to "Plan J"./.vue 单文件组件后端编译工具。从属于“简计划”。
1,332 lines (1,185 loc) • 203 kB
JavaScript
/*!@preserve@license
* 模块名称:j-vue
* 模块功能:构建后的 .vue 文件的前端运行时依赖。从属于“简计划”。
The front-end runtime dependency for built .vue files. Belong to "Plan J".
* 模块版本:26.1.0
* 许可条款:LGPL-3.0
* 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
* 问题反馈:https://GitHub.com/LongTengDao/j-vue/issues
* 项目主页:https://GitHub.com/LongTengDao/j-vue/
*/
import test from '.RegExp.prototype.test';
import join from '.Array.prototype.join';
import unshift from '.Array.prototype.unshift';
import Error from '.Error';
import isArray from '.Array.isArray';
import create$1 from '.Object.create';
import freeze from '.Object.freeze';
import isPrototypeOf from '.Object.prototype.isPrototypeOf';
import match from '.String.prototype.match';
import undefined$1 from '.undefined';
import RegExp from '.RegExp';
import defineProperty from '.Object.defineProperty';
import NULL from '.null.prototype';
import create from '.Object.create?=';
import Symbol from '.Symbol?';
import document from '.document';
import head from '.document.head';
import Function from '.Function';
import TypeError from '.TypeError';
import WeakMap from '.WeakMap?';
import from from '.Array.from?';
import getPrototypeOf$1 from '.Reflect.getPrototypeOf?=Object.getPrototypeOf';
import setPrototypeOf from '.Object.setPrototypeOf?';
import getOwnPropertyNames from '.Object.getOwnPropertyNames';
import getOwnPropertyDescriptor from '.Object.getOwnPropertyDescriptor';
import getOwnPropertySymbols from '.Object.getOwnPropertySymbols?';
import defineProperties from '.Object.defineProperties';
import get$1 from '.Reflect.get?';
import apply from '.Reflect.apply?';
import assign from '.Object.assign?';
import Keys from '.Object.keys';
import OwnKeys from '.Reflect.ownKeys?';
import PROTO_BUG from '.Object.prototype';
import hasOwnProperty from '.Object.prototype.hasOwnProperty';
import window from '.window';
import getOwnPropertyDescriptors from '.Object.getOwnPropertyDescriptors';
import getPrototypeOf from '.Object.getPrototypeOf';
import propertyIsEnumerable from '.Object.prototype.propertyIsEnumerable';
import error from '.console.error';
import Default from '.default';
var version = '26.1.0';
var object = {
'0': '1', '1': '2', '2': '3', '3': '4', '4': '5', '5': '6', '6': '7', '7': '8', '8': '9', '9': 'a',
a: 'b', b: 'c', c: 'd', d: 'e', e: 'f', f: 'g', g: 'h',
h: 'i', i: 'j', j: 'k', k: 'l', l: 'm', m: 'n', n: 'o',
o: 'p', p: 'q', q: 'r', r: 's', s: 't', t: 'u',
u: 'v', v: 'w', w: 'x', x: 'y', y: 'z'
} ;
var lastItem = 'z';
var array = [ lastItem ];
var lastIndex = array.length - 1;
var notKeyword = /*#__PURE__*/test.bind(/\d/);
var toString = /*#__PURE__*/join.bind(array, '');
var prependA = /*#__PURE__*/unshift.bind(array, 'a');
function Identifier () {
if ( lastItem==='9' ) {
array[lastIndex] = 'a';
var string ;
if ( notKeyword(string = toString()) ) {
lastItem = 'a';
return string;
}
}
else if ( lastItem!=='z' ) {
lastItem = array[lastIndex] = object[lastItem];
return toString();
}
lastItem = array[lastIndex] = '0';
for ( var index = lastIndex; index; array[index] = '0' ) {
var item = array[--index] ;
if ( item!=='z' ) {
array[index] = object[item];
return toString();
}
}
lastIndex = prependA() - 1;
return toString();
}
/*!@preserve@license
* 模块名称:j-regexp
* 模块功能:可读性更好的正则表达式创建方式。从属于“简计划”。
More readable way for creating RegExp. Belong to "Plan J".
* 模块版本:8.0.0
* 许可条款:LGPL-3.0
* 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
* 问题反馈:https://GitHub.com/LongTengDao/j-regexp/issues
* 项目主页:https://GitHub.com/LongTengDao/j-regexp/
*/
var NEED_TO_ESCAPE_IN_REGEXP = /^[$()*+\-.?[\\\]^{|]/;
var SURROGATE_PAIR = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/;
var GROUP = /*#__PURE__*/create(NULL) ;
function groupify (branches , uFlag , noEscape ) {
var group = create(NULL) ;
var appendBranch = uFlag ? appendPointBranch : appendCodeBranch;
for ( var length = branches.length, index = 0; index<length; ++index ) { appendBranch(group, branches[index] ); }
return sourcify(group, !noEscape);
}
function appendPointBranch (group , branch ) {
if ( branch ) {
var character = SURROGATE_PAIR.test(branch) ? branch.slice(0, 2) : branch.charAt(0);
appendPointBranch(group[character] || ( group[character] = create(NULL) ), branch.slice(character.length));
}
else { group[''] = GROUP; }
}
function appendCodeBranch (group , branch ) {
if ( branch ) {
var character = branch.charAt(0);
appendCodeBranch(group[character] || ( group[character] = create(NULL) ), branch.slice(1));
}
else { group[''] = GROUP; }
}
function sourcify (group , needEscape ) {
var branches = [];
var singleCharactersBranch = [];
var noEmptyBranch = true;
for ( var character in group ) {
if ( character ) {
var sub_branches = sourcify(group[character] , needEscape);
if ( needEscape && NEED_TO_ESCAPE_IN_REGEXP.test(character) ) { character = '\\' + character; }
sub_branches ? branches.push(character + sub_branches) : singleCharactersBranch.push(character);
}
else { noEmptyBranch = false; }
}
singleCharactersBranch.length && branches.unshift(singleCharactersBranch.length===1 ? singleCharactersBranch[0] : '[' + singleCharactersBranch.join('') + ']');
return branches.length===0
? ''
: ( branches.length===1 && ( singleCharactersBranch.length || noEmptyBranch )
? branches[0]
: '(?:' + branches.join('|') + ')'
)
+ ( noEmptyBranch ? '' : '?' );
}
/*¡ j-regexp */
var _ = Symbol ? /*#__PURE__*/Symbol('_') : '_';
function $ ( css , media ) {
var style = document.createElement('style');
if ( css ) { style.textContent = this[_](css); }
if ( media!==undefined$1 ) { style.media = media; }
head.appendChild(style);
return this;
}
var prepare_ = typeof _==='symbol' ? null : /*#__PURE__*/function () {
var _descriptor = create$1(NULL) ;
_descriptor.value = null;
_descriptor.writable = true;
_descriptor.enumerable = true;
_descriptor.configurable = true;
return function $ (scope ) { defineProperty(scope, _, _descriptor); };
}();
function Search (keys ) { return RegExp('__' + groupify(keys, false, true) + '__', 'g'); }
function Replacer (scope ) { return function replacer (__key__ ) { return scope[__key__.slice(2, -2)] ; }; }
var StaticScope = function StaticScope ( keys ) {
prepare_ && prepare_(this);
this[_] = function _ (string ) { return string.replace(_search, _replacer); };
var _search = Search(keys);
var _replacer = Replacer(this);
for ( var index = keys.length; index; ) { this[keys[--index] ] = Identifier(); }
}
;
var SCOPE = StaticScope.prototype = /*#__PURE__*/freeze(create$1(null, {
$: { value: $, writable: false, enumerable: false, configurable: false },
}) );
var InheritedStaticScope = /*#__PURE__*/function () {
function InheritedStaticScope ( keys , proto ) {
prepare_ && prepare_(this);
this[_] = function _ (string ) { return string.replace(_search, _replacer); };
for ( var index = keys.length; index; ) { this[keys[--index] ] = Identifier(); }
for ( var key in proto ) { /*key==='_' || key==='$' || ( */
keys[keys.length] = key/* )*/;
}
var _search = Search(keys);
var _replacer = Replacer(this);
}
InheritedStaticScope.prototype = SCOPE;
return InheritedStaticScope;
}()
;
var KEYS = /[^\x00-@[-`{-\x7F\s][^\x00-/:-@[-`{-\x7F\s]*(?:_[^\x00-/:-@[-`{-\x7F\s]+)*/g;
var __KEY__ = RegExp('__' + KEYS.source + '__', 'g');
function get (cache , key ) { return cache[key] || ( cache[key] = Identifier() ); }
function scopify (value , cache ) {
var keys ,
index ,
values ,
key ;
if ( value ) {
switch ( typeof value ) {
case 'string':
if ( value.indexOf(' ')<0 ) {
return get(cache, value);
}
else {
keys = '';
values = value.split(' ');
for ( index = values.length; index; ) {
key = value[--index] ;
if ( key ) { keys = get(cache, key)+' '+keys; }
}
return keys && keys.slice(0, -1);
}
case 'object':
keys = '';
if ( isArray(value) ) {
for ( index = value.length; index; ) {
key = scopify(value[--index], cache);
if ( key ) { keys = key+' '+keys; }
}
return keys && keys.slice(0, -1);
}
else {
for ( key in value ) {
if ( ( value )[key] ) { keys += ' '+get(cache, key); }
}
return keys && keys.slice(1);
}
}
}
return '';
}
function DynamicScope (cache ) {
var scope = function scope (value ) {
var length = arguments.length;
if ( length>1 ) {
value = [ value, arguments[1] ];
for ( var index = 2; index!==length; ++index ) { ( value )[index] = arguments[index]; }
}
return scopify(value, cache);
} ;
scope.prototype = cache;
scope.$ = $;
scope[_] = function _ (string ) { return string.replace(__KEY__, _replacer); };
function _replacer (__key__ ) { return get(cache, __key__.slice(2, -2)); }
return scope;
}
function throwEmpty (keys ) { throw Error('Scope("' + keys + '")'); }
var isStaticScope = /*#__PURE__*/isPrototypeOf.bind(SCOPE) ;
var match_call = /*#__PURE__*/match.call.bind(match);
function mix (protos ) {
var scope = create$1(SCOPE);
for ( var length = protos.length, index = 0; index<length; ++index ) {
var proto = protos[index];
if ( typeof proto==='function' ) { proto = proto.prototype; }
for ( var id in proto ) { scope[id] = proto[id]; }
}
return scope;
}
var Scope = /*#__PURE__*/function () {
function Scope ( keys ) {
if ( keys===undefined$1 ) {
if ( this ) {
if ( isArray(this) ) { return DynamicScope(mix(this )); }
else if ( typeof this==='function' && isStaticScope(this.prototype) ) { return DynamicScope(create$1(this.prototype)); }
else if ( isStaticScope(this) ) { return DynamicScope(create$1(this)); }
}
return DynamicScope(create$1(SCOPE));
}
else {
if ( this ) {
if ( isArray(this) ) { var scope = new InheritedStaticScope(match_call(keys, KEYS) || throwEmpty(keys), InheritedStaticScope.prototype = mix(this )); }
else if ( typeof this==='function' && isStaticScope(this.prototype) ) { scope = new InheritedStaticScope(match_call(keys, KEYS) || throwEmpty(keys), InheritedStaticScope.prototype = this.prototype); }
else if ( isStaticScope(this) ) { scope = new InheritedStaticScope(match_call(keys, KEYS) || throwEmpty(keys), InheritedStaticScope.prototype = this); }
else { return new StaticScope(match_call(keys, KEYS) || throwEmpty(keys)); }
InheritedStaticScope.prototype = SCOPE;
return scope;
}
else { return new StaticScope(match_call(keys, KEYS) || throwEmpty(keys)); }
}
}
//@ts-ignore
Scope.prototype = null;
return freeze(Scope);
}();
function Template (html , scope ) {
return /*#__PURE__*/scope[_](html);
}
var IS_NOT_ES5 = /*#__PURE__*/test.bind(/^(cons|le)t /);
function WithStripped (render ) {
render._withStripped = true;
return render;
}
function Render (code , scope ) {
return code[0]==='('
? /*#__PURE__*/Function('"use strict";return class Render extends null{constructor' + ( scope ? scope[_](code) : code ) + '};')()
: /*#__PURE__*/WithStripped(
/*#__PURE__*/Function(/*#__PURE__*/IS_NOT_ES5(code)
? '"use strict";return{render(){' + ( scope ? scope[_](code) : code ) + '}}.render;'
: '"use strict";return function render(){' + ( scope ? scope[_](code) : code ) + '};'
)()
);
}
function StaticRenderFns (codes , scope ) {
var index = codes.length;
var body = ']';
if ( scope ) {
for ( var scope_ = scope[_]; index; ) { body = 'function(){' + scope_(codes[--index] ) + '},' + body; }
}
else {
while ( index ) { body = 'function(){' + codes[--index] + '},' + body; }
}
return Function('"use strict";return[' + body)();
}
function Style (css , scope ) {
var style = document.createElement('style');
if ( css ) { style.textContent = scope ? scope[_](css) : css; }
return head.appendChild(style);
}
function remove (style ) {
head.removeChild(style);
return remove;
}
var that = null;
var NAMES = assign && /*#__PURE__*/assign(create$1(null), {
_: null,
_c: null,
_computedWatchers: null,
_data: null,
_directInactive: null,
_events: null,
_hasHookEvent: null,
_hasMove: null,
_inactive: null,
_isBeingDestroyed: null,
_isDestroyed: null,
_isMounted: null,
_isVue: null,
_leaving: null,
_name: null,
_props: null,
_provided: null,
_reflow: null,
_renderProxy: null,
_self: null,
_staticTrees: null,
_uid: null,
_update: null,
_vnode: null,
_watcher: null,
_watchers: null,
});
function proProto (self , protoDescriptors ) {
var _ = self._;
defineProperties(_ ? _.ctx : self, protoDescriptors);
}
function proConstructor (self , protoDescriptors , constructor , Vue3 ) {
var _ = self._;
var ctx = _ ? _.ctx : self;
protoDescriptors && defineProperties(ctx, protoDescriptors);
var previous = that;
that = self;
try { new constructor(Vue3); }
finally { that = previous; }
}
function proNames (self , protoDescriptors , constructor , Vue3 , dataNames , shadowAssigner ) {
var _ = self._;
var ctx = _ ? _.ctx : self;
protoDescriptors && defineProperties(ctx, protoDescriptors);
var previous = that;
that = self;
try { new constructor(Vue3); }
finally { that = previous; }
var data = assign(create$1(NULL), dataNames) ;
if ( _ ) {
var accessCache = _.accessCache;
for ( var name in dataNames ) {
data[name] = ctx[name ];
if ( name in accessCache ) { accessCache[name ] = undefined$1; }
}
}
else {
for ( name in dataNames ) { data[name] = ctx[name ]; }
}
shadowAssigner && shadowAssigner(self, data);
return data;
}
function proData (self , protoDescriptors , constructor , Vue3 , restNames , shadowAssigner ) {
var _ = self._;
var ctx = _ ? _.ctx : self;
protoDescriptors && defineProperties(ctx, protoDescriptors);
var previous = that;
that = self;
try { new constructor(Vue3); }
finally { that = previous; }
var data = create$1(NULL) ;
if ( _ ) {
var accessCache = _.accessCache;
for ( var name in ctx ) {
if ( !( name in restNames ) && name[0]!=='$' ) {
data[name] = ctx[name ];
if ( name in accessCache ) { accessCache[name ] = undefined$1; }
}
}
}
else {
var nowNames = Keys(ctx);
var index = nowNames.length;
while ( index ) {
name = nowNames[--index] ;
if ( !( name in restNames ) && name[0]!=='$' ) { data[name] = ctx[name ]; }
}
}
shadowAssigner && shadowAssigner(self, data);
return data;
}
function devData (self , protoDescriptors , constructor , Vue3 , skipData , dataNames , restNames , shadowAssigner , shadowChecker , skipConstructor , __dev__ ) {
var _ = self._;
var ctx = _ ? _.ctx : self;
for ( var name in ctx ) {
if ( name[0]==='_' && !( name in NAMES ) ) {
error(Error('[jVue bug]: vm.' + name + ' is unknown but exists'));
break;
}
}
var oldDescriptors = assign(create$1(NULL), getOwnPropertyDescriptors(ctx), protoDescriptors);
if ( protoDescriptors ) {
for ( var $name in protoDescriptors ) { if ( $name in ctx ) { throw Error(__dev__.runtime_reserved); } }
defineProperties(ctx, protoDescriptors);
}
var previous = that;
that = self;
try { new constructor(Vue3); }
finally { that = previous; }
OwnKeys(oldDescriptors).forEach(function (key) {
var oldDescriptor = oldDescriptors[key] ;
var newDescriptor = getOwnPropertyDescriptor(ctx, key );
if (
!newDescriptor ||
newDescriptor.configurable!==oldDescriptor.configurable ||
newDescriptor.enumerable!==oldDescriptor.enumerable ||
( newDescriptor.hasOwnProperty('value')
//@ts-ignore
? newDescriptor.value!==oldDescriptor.value || newDescriptor.writable!==oldDescriptor.writable
//@ts-ignore
: newDescriptor.get!==oldDescriptor.get || newDescriptor.set!==oldDescriptor.set
)
) { throw Error(__dev__.runtime_redefined); }
});
var difKeys = OwnKeys(ctx).filter(function (key) {
return !( key in oldDescriptors );
});
if ( skipConstructor ) {
if ( difKeys.length ) { throw Error(__dev__.runtime_data); }
}
var difNames = difKeys.filter(function (key) {
return typeof key==='string' && key[0]!=='$';
});
if ( skipData ) {
if ( difNames.length ) { throw Error(__dev__.runtime_data); }
}
if ( dataNames ) {
var count = 0;
for ( name in dataNames ) { ++count; }
if ( count!==difNames.length ) { throw Error(__dev__.runtime_data); }
difNames.forEach(function (name) {
if ( !( name in dataNames ) ) { throw Error(__dev__.runtime_data); }
});
}
difNames.forEach(function ( name) {
if ( name in this && !( name in {} ) || name in restNames ) { throw Error(__dev__.runtime_redefined); }
if ( name[0]==='_' ) { throw Error(__dev__.runtime_reserved); }
if ( name==='constructor' ) { throw Error(__dev__.proto); }
if ( !propertyIsEnumerable.call(ctx, name)) { throw Error(__dev__.runtime_enumerable); }
}, getPrototypeOf(ctx));
var data = create$1(NULL) ;
difNames.forEach(function (name) {
( data )[name] = ctx[name ];
if ( _ && name in _.accessCache ) { _.accessCache[name ] = undefined$1; }
});
if ( shadowAssigner ) {
shadowChecker (data);
shadowAssigner(self, data);
}
return data;
}
var INIT = /*#__PURE__*/function () {
var INIT = create$1(NULL) ;
INIT.mode = 'open';
return INIT;
}();
function attach ( el ) { return el && ( el.shadowRoot || el.attachShadow(INIT) ); }
function ShadowAssigner ( along ) {
var index = along.indexOf('.');
var names = index<0 ? null : along.slice(index + 1).split('.');
var toName = names ? along.slice(0, index) : along;
if ( names ) {
if ( names.length===1 ) {
var name$get = names[0] + '$get';
var name$set = names[0] + '$set';
return function ( self , data ) {
var all = data[toName] = create$1(NULL) ;
all[name$set] = function ( el ) { self[toName] [name$get] = attach(el); };
all[name$get] = null;
} ;
}
else {
return function ( self , data ) {
var all = data[toName] = create$1(NULL) ;
names .forEach(function (name ) {
all[name + '$set'] = function ( el ) { self[toName] [name] = attach(el); };
all[name += '$get'] = null;
});
} ;
}
}
else {
var toName$get = toName + '$get';
var toName$set = toName + '$set';
return function ( self , data ) {
data[toName$set] = function ( el ) { self[toName$get] = attach(el); };
data[toName$get] = null;
} ;
}
}
function ShadowChecker ( along , restNames , dataNames , shadowNames , __dev__ ) {
if ( along[0]==='_' || along[0]==='$' ) { throw Error(__dev__.compile_shadow); }
var index = along.indexOf('.');
if ( index<0 ) {
var toName$get = along.slice(0, index) + '$get';
var toName$set = along.slice(0, index) + '$set';
if ( toName$get in restNames || toName$set in restNames ) { throw Error(__dev__.compile_shadow); }
shadowNames[toName$get] = null;
shadowNames[toName$set] = null;
if ( dataNames ) {
if ( toName$get in dataNames || toName$set in dataNames ) { throw Error(__dev__.compile_shadow); }
return function () {};
}
return function ( data ) {
if ( toName$get in data || toName$set in data ) { throw Error(__dev__.runtime_shadow); }
};
}
else {
if ( along==='constructor' ) { throw Error(__dev__.proto); }
if ( along in restNames ) { throw Error(__dev__.compile_shadow); }
shadowNames[along] = null;
if ( dataNames ) {
if ( along in dataNames ) { throw Error(__dev__.compile_shadow); }
return function () {};
}
return function ( data ) {
if ( along in data ) { throw Error(__dev__.runtime_shadow); }
};
}
}
var Component = /*#__PURE__*/freeze(/*#__PURE__*/defineProperties(
function Component () { return that; },
{
prototype: {
configurable: false,
enumerable: false,
value: null,
},
render: {
enumerable: false,
get: function render ( ) { throw TypeError('Component.render='); },
set: function render ( value ) { ( that ._ || that .$options ).render = value; },
},
_main: {
enumerable: false,
get: function _main ( ) {
var Component = this;
if ( !isComponentConstructor(Component) ) { throw TypeError('(!Component)._main'); }
return function _main ( ) {
if ( once ) { throw Error('Component._main()x2'); }
if ( this!==Component && isComponentConstructor(this) ) { throw TypeError('(Component!this)._main()'); }
var Vue = Function('return Vue')();
if ( typeof Vue==='object' ) {
var dev =
'__VUE__' in window &&
'__VUE_HMR_RUNTIME__' in window &&
isArray(( window ).devtoolsFormatters);
var app = Vue.createApp(
ToOptions(
Component,
Vue,
dev ? create$1(NULL) : undefined$1
)
);
app.config.isCustomElement = isCustomElement;
if ( dev ) { app.config.performance = true; }
app.mount(document.body);
}
else {
new ( Vue.extend(
ToOptions(
Component,
undefined$1,
Vue.devtools ? ( Vue.config.ignoredElements.push(STARTS_WITH_LOWERCASE), Vue.config.performance = true, create$1(NULL) ) : undefined$1,
FunctionalComponent2
)
) )()
.$mount(( document.body.innerHTML = '<br>', 'br' ));
}
once = true;
};
},
set: undefined$1,
},
_toOptions: {
enumerable: false,
value: function _toOptions ( Vue3 , __dev__ ) {
if ( !isComponentConstructor(this) ) { throw TypeError('(!Component)._toOptions()'); }
return ToOptions(this, Vue3, __dev__, Vue3 ? OPTIONS.fix.get(Vue3) || FunctionalComponentConstructor(Vue3) : FunctionalComponent2);
},
},
}
));
var once = false;
function ToOptions ( constructor , Vue3 , __dev__ , FunctionalComponent ) {
var DID_OPTIONS = OPTIONS.objects.into(__dev__ || OPTIONS ).into(FunctionalComponent || OPTIONS );
var TMP_OPTIONS = new OPTIONS.objectsTmp;
var options = Options(
constructor,
Vue3 || undefined$1,
__dev__ ? DEV.reduce(function Dev (dev, key) {
dev[key] = __dev__ [key] || key;
return dev;
}, create$1(NULL) ) : null,
DID_OPTIONS,
TMP_OPTIONS,
FunctionalComponent || null
);
TMP_OPTIONS.forEach (function (optionsValue, constructorKey) { DID_OPTIONS.set(constructorKey, optionsValue); });
return options;
}
var _mixins = Symbol && /*#__PURE__*/Symbol('_mixins') ;
function __PURE__ ( Sub , mixins ) {
Sub.prototype = null;
Sub[_mixins] = mixins;
return setPrototypeOf(Sub, Component);
}
function mixin ( ) {
return arguments.length
? /*#__PURE__*/__PURE__(function () { return that; }, /*#__PURE__*/from(arguments))
: Component;
}
function Options (constructor , Vue3 , __dev__ , DID_OPTIONS , TMP_OPTIONS , FunctionalComponent ) {
var options = DID_OPTIONS.get(constructor) || TMP_OPTIONS.get(constructor);
if ( options ) { return options; }
OPTIONS.constructor.set(options = create$1(NULL) , constructor);
if ( isMixins(constructor) ) {
var static_mixins = constructor[_mixins] ;
var mixins = new OPTIONS.Set ();
var index = 0;
while ( index!==static_mixins.length ) {
var mixin = static_mixins[index++] ;
if ( isComponentConstructor(mixin) ) {
var mixinOptions = Options(mixin, Vue3, __dev__, DID_OPTIONS, TMP_OPTIONS, FunctionalComponent);
if ( isMixins(mixin) ) {
var mixinMixins = mixinOptions.mixins ;
var mixinIndex = 0;
while ( mixinIndex!==mixinMixins.length ) { mixins.add(mixinMixins[mixinIndex++] ); }
}
else { mixins.add(mixinOptions); }
}
else { mixins.add(mixin ); }
}
options.mixins = from(mixins);
__dev__ && check(options, __dev__);
collectNames(options, constructor);
TMP_OPTIONS.set(constructor, options);
return options;
}
var prototype = constructor.prototype;
var Super = OPTIONS.super.get(constructor);
if ( !Super ) {
OPTIONS.super.set(constructor, Super = getPrototypeOf$1(constructor));
Super===Component || isMixins(Super) || ( setPrototypeOf(constructor, Component), setPrototypeOf(prototype, null) );
}
if ( Super!==Component ) {
var SuperOptions = Options(Super, Vue3, __dev__, DID_OPTIONS, TMP_OPTIONS, FunctionalComponent);
isMixins(Super)
? SuperOptions.mixins .length===1
? options.extends = SuperOptions.mixins [0]
: options.mixins = SuperOptions.mixins
: options.extends = SuperOptions;
}
__dev__ && getOwnPropertySymbols(constructor).forEach(function (symbol) {
if ( symbol!==_mixins && !( symbol in SYMBOLS ) ) { throw Error(__dev__.compile_symbol); }
});
var set = __dev__ ? devSet.bind(__dev__) : proSet;
var assertFunction = __dev__ ? devAssertFunction.bind(__dev__) : proAssertFunction;
var staticNames = getOwnPropertyNames(constructor);
index = staticNames.length;
var shadowAssigner = null;
var skipConstructor = false;
while ( index ) {
var staticName = staticNames[--index] ;
if ( staticName==='Render' ) { var Render = constructor[staticName] ; }
//@ts-ignore
else if ( staticName==='name' || staticName==='length' ) {
descriptor = getOwnPropertyDescriptor(constructor, staticName);
if ( descriptor.hasOwnProperty('value') ) {
descriptor.enumerable && set(options, staticName, descriptor.value);
}
else {
set(options, staticName, apply(descriptor.get , constructor, ARGS));
}
}
else if ( staticName==='data' ) {
if ( __dev__ ) {
if ( constructor[staticName]!==undefined$1 ) { throw Error(isArray(constructor[staticName]) ? __dev__.compile_layer : __dev__.compile_type); }
}
skipConstructor = true;
}
else if ( staticName!=='prototype' ) {
if ( __dev__ ) {
if ( staticName[0]==='_' ) { throw Error(__dev__.compile_reserved); }
if (
//@ts-ignore
staticName==='setup' || staticName==='watch' || staticName==='methods' || staticName==='computed' || staticName==='extends' || staticName==='mixins' ||
//@ts-ignore
staticName==='beforeCreated' || staticName==='created' || staticName==='beforeMount' || staticName==='mounted' || staticName==='beforeUpdate' || staticName==='updated' || staticName==='activated' || staticName==='deactivated' || staticName==='beforeUnmount' || staticName==='unmounted' || staticName==='beforeDestroy' || staticName==='destroyed' ||
//@ts-ignore
staticName==='inject' || staticName==='props' || protoName1==='emits'
) { throw Error(__dev__.compile_layer); }
}
//@ts-ignore
set(options, staticName==='displayName' ? 'name' : staticName, constructor[staticName]);
}
}
var protoDescriptors = null;
var protoNames = getOwnPropertyNames(prototype);
index = protoNames.length;
var watchers = [];
var skipData = false;
var dataNames = null;
while ( index ) {
var protoName = protoNames[--index] ;
if ( protoName==='_data' ) {
var _data = get$1(prototype, protoName, undefined$1);
if ( _data ) {
if ( __dev__ ) {
if ( !isArray(_data) ) { throw Error(__dev__.compile_type); }
_data.forEach(function (name) {
if ( typeof name!=='string' ) { throw Error(__dev__.compile_type); }
if ( name[0]==='_' || name[0]==='$' ) { throw Error(__dev__.compile_reserved); }
});
if ( skipConstructor ) { throw Error(__dev__.compile_redefined); }
}
var length = _data.length;
if ( length ) {
dataNames = create$1(NULL) ;
var i = 0;
do { dataNames[_data[i]] = null; }
while ( ++i!==length );
dataNames = assign(create$1(NULL), dataNames);
__dev__ && OPTIONS.data.set(options, dataNames);
}
else {
skipData = true;
}
}
else {
if ( __dev__ ) {
if ( _data!==undefined$1 ) { throw Error(__dev__.compile_type); }
if ( skipConstructor ) { throw Error(__dev__.compile_redefined); }
}
skipConstructor = true;
}
}
else if ( protoName[0]==='_' && !( protoName.startsWith('_watch(') ) ) {
if ( __dev__ ) {
var protoName1 = protoName.slice(1);
if ( protoName1[0]==='_' ) { throw Error(__dev__.compile_reserved); }
if (
protoName1==='setup' || protoName1==='watch' || protoName1==='methods' || protoName1==='computed' || protoName1==='extends' || protoName1==='mixins' ||
protoName1==='components' || protoName1==='directives' || protoName1==='staticRenderFns' || protoName1==='template' || protoName1==='inheritAttrs' ||
protoName1==='name' ||
protoName1==='Render' ||
protoName1==='delimiters' ||
protoName1==='filters' || protoName1==='comments' || protoName1==='functional' || protoName1==='propsData' || protoName1==='model'
) { throw Error(__dev__.compile_layer); }
}
set(options, protoName.slice(1), get$1(prototype, protoName, undefined$1));
}
else {
var descriptor = getOwnPropertyDescriptor(prototype, protoName);
if ( protoName[0]==='_' ) {
var indexOfQ = protoName.lastIndexOf(')');
var watcher = watchers[watchers.length] = create$1(NULL) ;
if ( descriptor.hasOwnProperty('value') ) {
watcher.$ = protoName.slice(7, indexOfQ).trim();
watcher.handler = assertFunction(descriptor.value);
}
else {
watcher.$ = assertFunction(descriptor.get);
watcher.handler = assertFunction(descriptor.set);
}
if ( indexOfQ + 1!==protoName.length ) {
indexOfQ += 2;
do {
var indexOfA = protoName.indexOf(';', indexOfQ);
var pair = indexOfA<0
? protoName.slice(indexOfQ)
: protoName.slice(indexOfQ, indexOfA);
indexOfQ = indexOfA + 1;
if ( pair ) {
var indexOfE = pair.indexOf('=');
indexOfE<0
? watcher[pair] = true
: watcher[pair.slice(0, indexOfE)] = pair.slice(indexOfE + 1);
}
}
while ( indexOfQ );
}
}
else if ( protoName[0]==='$' ) {
( protoDescriptors || ( protoDescriptors = create$1(NULL) ) )[protoName] = assign(create$1(NULL), descriptor);
}
else {
if ( descriptor.hasOwnProperty('value') ) {
if ( protoName!=='constructor' || descriptor.value!==constructor ) {
( options.methods || ( options.methods = create$1(NULL) ) )[protoName] = assertFunction(descriptor.value);
}
}
else {
( options.computed || ( options.computed = create$1(NULL) ) )[protoName] = descriptor.set ? {
get: descriptor.get,
set: descriptor.set
} : descriptor.get ;
}
}
}
}
var protoSymbols = getOwnPropertySymbols(prototype) ;
if ( ( index = protoSymbols.length ) ) {
if ( !protoDescriptors ) { protoDescriptors = create$1(NULL) ; }
do {
var protoSymbol = protoSymbols[--index] ;
protoDescriptors [protoSymbol] = assign(create$1(NULL), getOwnPropertyDescriptor(prototype, protoSymbol));
}
while ( index );
}
protoDescriptors && OPTIONS.proto.set(options, protoDescriptors = assign(create$1(NULL), protoDescriptors));
__dev__ && check(options, __dev__);
var restNames = collectNames(options, constructor);
if ( Render && Vue3 ) {
var shadow = Render.shadow;
if ( shadow ) {
if ( __dev__ ) {
if ( skipConstructor && skipData ) { throw Error(__dev__.compile_shadow); }
var shadowNames = create$1(NULL) ;
var shadowChecker = ShadowChecker(shadow, restNames, dataNames, shadowNames, __dev__);
OPTIONS.shadow.set(options, shadowNames);
}
shadowAssigner = ShadowAssigner(shadow);
}
var sheet = Render.sheet;
if ( sheet ) {
var watchers2 = [];
OwnKeys(sheet).forEach(function ( key, index) {
var watcher = this[index] = create$1(NULL) ;
watcher.$ = assertFunction(sheet [key]);
watcher.handler = function ( css ) { ( this.$refs[key] ).textContent = css; };
watcher.immediate = true;
watcher.flush = 'sync';
}, watchers2);
watchers2.reverse();
var beforeMount = options.beforeMount;
options.beforeMount = beforeMount
? function beforeBeforeMount () {
$watch(this, watchers2);
return apply(beforeMount , this, ARGS);
}
: function beforeBeforeMount () {
$watch(this, watchers2);
};
}
options.render = assertFunction(new Render(Vue3 ));
}
if ( __dev__ ) { options.data = function (self ) { return devData(self , protoDescriptors, constructor, Vue3, skipData, dataNames, restNames, shadowAssigner, shadowChecker, skipConstructor, __dev__); }; }
else if ( skipConstructor || skipData ) ;
else if ( dataNames ) { options.data = function (self ) { return proNames(self , protoDescriptors, constructor, Vue3, dataNames , shadowAssigner); }; }
else { options.data = function (self ) { return proData(self , protoDescriptors, constructor, Vue3, restNames, shadowAssigner); }; }
if ( watchers.length || !__dev__ && ( skipConstructor && protoDescriptors || skipData ) ) {
watchers.length && watchers.reverse();
var created = options.created;
switch ( ( __dev__ ? ( skipConstructor ? 's' : 'n' ) : '_' ) + ( watchers.length ? 'w' : '_' ) + ( created ? 'c' : '_' ) ) {
case 'swc':
options.created = function beforeCreated ( ) {
proProto(this , protoDescriptors );
$watch(this, watchers);
return apply(created , this, ARGS);
};
break;
case 'sw_':
options.created = function beforeCreated ( ) {
proProto(this , protoDescriptors );
$watch(this, watchers);
};
break;
case 's_c':
options.created = function beforeCreated ( ) {
proProto(this , protoDescriptors );
return apply(created , this, ARGS);
};
break;
case 's__':
options.created = function beforeCreated ( ) {
proProto(this , protoDescriptors );
};
break;
case 'nwc':
options.created = function beforeCreated ( ) {
proConstructor(this , protoDescriptors, constructor, Vue3);
$watch(this, watchers);
return apply(created , this, ARGS);
};
break;
case 'nw_':
options.created = function beforeCreated ( ) {
proConstructor(this , protoDescriptors, constructor, Vue3);
$watch(this, watchers);
};
break;
case 'n_c':
options.created = function beforeCreated ( ) {
proConstructor(this , protoDescriptors, constructor, Vue3);
return apply(created , this, ARGS);
};
break;
case 'n__':
options.created = function beforeCreated ( ) {
proConstructor(this , protoDescriptors, constructor, Vue3);
};
break;
case '_wc':
options.created = function beforeCreated ( ) {
$watch(this, watchers);
return apply(created , this, ARGS);
};
break;
case '_w_':
options.created = function beforeCreated ( ) {
$watch(this, watchers);
};
break;
}
}
TMP_OPTIONS.set(constructor, options);
//@ts-ignore
if ( options.components || options.name ) {
var components = options.components = assign(create$1(NULL), options.components);
if ( __dev__ ) {
for ( pascal in components ) {
if ( !pascal || STARTS_WITH_LOWERCASE.test(pascal) ) { throw Error(__dev__.compile_name); }
}
if ( Vue3 && FunctionalComponent ) {
if (
//@ts-ignore
options.name && INCLUDES_UPPERCASE.test(options.name.slice(1))
) { throw Error(__dev__.compile_name); }
}
}
for ( var pascal in components ) {
var value = components[pascal] ;
if ( isComponentConstructor(value) ) { components[pascal] = Options(value, Vue3, __dev__, DID_OPTIONS, TMP_OPTIONS, FunctionalComponent); }
}
if ( FunctionalComponent ) {
var cases = create$1(NULL) ;
//@ts-ignore
options.name && fixPascal(options.name, cases, FunctionalComponent);
for ( pascal in components ) { fixPascal(pascal, cases, FunctionalComponent); }
assign(components, assign(cases, components));
}
}
return options;
}
var OPTIONS = /*#__PURE__*/function () {
try {
return Function('"use strict";\
class EasyMap extends WeakMap{into(key){let sub=this.get(key);sub??this.set(key,sub=new EasyMap);return sub}}EasyMap.prototype.get=WeakMap.prototype.get;EasyMap.prototype.set=WeakMap.prototype.set;\
class StrongMap extends Map{}StrongMap.prototype.get=Map.prototype.get;StrongMap.prototype.set=Map.prototype.set;StrongMap.prototype.forEach=Map.prototype.forEach;\
class StrongSet extends Set{}StrongSet.prototype.add=Set.prototype.add;StrongSet.prototype[Symbol.iterator]=Set.prototype[Symbol.iterator];\
return{objects:new EasyMap,objectsTmp:StrongMap,super:new EasyMap,rest:new EasyMap,data:new EasyMap,proto:new EasyMap,constructor:new EasyMap,shadow:new EasyMap,fix:new EasyMap,Set:StrongSet}\
')();
}
catch (error) {}
}()
;
var isComponentConstructor = /*#__PURE__*/isPrototypeOf.bind(Component) ;
var ARGS = [] ;
var _MIXINS = [ _mixins ] ;
function isMixins (constructor ) { return apply(hasOwnProperty, constructor, _MIXINS); }
var SYMBOLS = /*#__PURE__*/getOwnPropertyNames(Symbol).reduce(function (SYMBOLS, name) {
if ( typeof Symbol[name]==='symbol' ) { SYMBOLS[Symbol[name] ] = null; }
return SYMBOLS;
}, create$1(NULL) );
function $watch (that , watchers ) {
var index = watchers.length;
do {
var watcher = watchers[--index];
that.$watch(watcher.$, watcher.handler, watcher);
}
while ( index );
}
function collectNames (options , constructor ) {
var restNames = OPTIONS.rest.get(options);
if ( !restNames ) {
if ( constructor ) { restNames = OPTIONS.rest.get(constructor); }
if ( !restNames ) {
restNames = create$1(NAMES);
var extend = options.extends;
extend && assign(restNames, collectNames(extend, null));
var mixins = options.mixins;
if ( mixins ) { for ( var index = mixins.length; index; ) { assign(restNames, collectNames(mixins[--index] , null)); } }
var props = options.props;
var name ;
if ( isArray(props) ) { for ( index = props.length; index; ) { restNames[props[--index] ] = null; } }
else { for ( name in props ) { restNames[name] = null; } }
props = options.inject;
if ( isArray(props) ) { for ( index = props.length; index; ) { restNames[props[--index] ] = null; } }
else { for ( name in props ) { restNames[name] = null; } }
for ( name in options.methods ) { restNames[name] = null; }
for ( name in options.computed ) { restNames[name] = null; }
restNames = assign(create$1(NULL), restNames);
}
if ( constructor ) { OPTIONS.rest.set(constructor, restNames); }
OPTIONS.rest.set(options, restNames);
}
return restNames;
}
function proSet (object , name , value ) { object[name] = value; }
function devSet ( object , name , value ) {
if ( name in object ) { throw Error(this.compile_redefined); }
object[name] = value;
}
function proAssertFunction (fn ) { return fn ; }
function devAssertFunction ( fn ) {
if ( typeof fn!=='function' ) { throw TypeError(this.compile_type); }
return fn ;
}
var INCLUDES_UPPERCASE = /[A-Z]/;
var STARTS_WITH_LOWERCASE = /^[a-z]/;
var CHECKED = WeakMap && /*#__PURE__*/new WeakMap ();
function forKeys (option , callback ) {
if ( isArray(option) ) { option.forEach(callback); }
else { for ( var key in option ) { callback(key); } }
}
function check (options , __dev__ ) {
var belong = OPTIONS.constructor.get(options) || options;
var ownKeys = CHECKED.get(belong);
if ( ownKeys ) { return ownKeys; }
var allKeys = create$1(NULL) ;
( options.extends ? [ options.extends ] : [] ).concat(options.mixins || []).forEach(function (mixin) {
var mixinNames = check(mixin, __dev__);
for ( var name in mixinNames ) {
if ( name in allKeys && mixinNames[name]!==allKeys[name] ) { throw Error(__dev__.compile_overwrite); }
}
assign(allKeys, mixinNames);
});
ownKeys = create$1(NULL) ;
var protoDescriptors = OPTIONS.proto.get(options);
protoDescriptors && OwnKeys(protoDescriptors).forEach(function (key) {
ownKeys [key] = belong;
});
forKeys(options.props, function (name) {
if ( typeof name!=='string' ) { throw Error(__dev__.compile_type); }
if ( /-|^(?:key$|on|ref$)/.test(name) ) { throw Error(__dev__.compile_props); }
if ( name in PROTO_BUG ) { throw Error(__dev__.proto); }
if ( name[0]==='_' || name[0]==='$' ) { throw Error(__dev__.compile_reserved); }
if ( name in ownKeys ) { throw Error(__dev__.compile_redefined); }
ownKeys [name] = belong;
});
forKeys(options.inject, function (name) {
if ( typeof name!=='string' ) { throw Error(__dev__.compile_type); }
if ( name[0]==='_' || name[0]==='$' ) { throw Error(__dev__.compile_reserved); }
if ( name in ownKeys ) { throw Error(__dev__.compile_redefined); }
ownKeys [name] = belong;
});
var name ;
for ( name in options.methods ) {
if ( name[0]==='_' || name[0]==='$' ) { throw Error(__dev__.compile_reserved); }
if ( name in ownKeys ) { throw Error(__dev__.compile_redefined); }
ownKeys[name] = belong;
}
for ( name in options.computed ) {
if ( name[0]==='_' || name[0]==='$' ) { throw Error(__dev__.compile_reserved); }
if ( name in ownKeys ) { throw Error(__dev__.compile_redefined); }
ownKeys[name] = belong;
}
for ( name in OPTIONS.data.get(options) ) {
if ( name in ownKeys ) { throw Error(__dev__.compile_redefined); }
ownKeys [name] = belong;
}
for ( name in OPTIONS.shadow.get(options) ) {
if ( name in ownKeys ) { throw Error(__dev__.compile_redefined); }
ownKeys [name] = belong;
}
if ( 'constructor' in ownKeys ) { throw Error(__dev__.proto); }
OwnKeys(ownKeys).forEach(function (key) {
if ( key in allKeys ) { throw Error(__dev__.compile_overwrite); }
});
assign(allKeys, ownKeys);
if ( typeof options==='object' ) {
name = options.name;
if ( typeof name==='string'
? !name || STARTS_WITH_LOWERCASE.test(name) || options.components && name in options.components && options.components[name]!==options
: name!==undefined$1
) { throw Error(__dev__.compile_name); }
}
options.emits &&
( isArray(options.emits) ? options.emits : Keys(options.emits) ).forEach(function (event) {
if ( typeof event!=='string' ) { throw Error(__dev__.compile_type); }
if ( /(?:capture|once|passive)$/.test('on' + event.toLowerCase()) || /^-?[vV]node/.test(event) ) { throw Error(__dev__.compile_emits); }
});
if (
options.directives && 'is' in options.directives// 2
||//@ts-ignore
options.props && ( isArray(options.props) ? options.props.includes('is') : 'is' in options.props )// 3
) { throw Error(__dev__.compile_is); }
CHECKED.set(belong, allKeys);
return allKeys;
}
var UPPER = /[A-Z]/;
function fixPascal (pascal , cases , FunctionalComponent ) {
var First = pascal[0] ;
var first = First.toLowerCase();
var rest = pascal.slice(1);
FunctionalComponent(cases, first + rest);
hyphenate(first, rest, cases, FunctionalComponent);
first===First || hyphenate(First, rest, cases, FunctionalComponent);
}
function hyphenate (before , after , cases , FunctionalComponent ) {
var index = after.search(UPPER);
if ( index<0 ) { FunctionalComponent(cases, before + after); }
else {
if ( index ) { before += after.slice(0, index); }
var char = after[index] ;
after = after.slice(index + 1);
hyphenate(before + '-' + char.toLowerCase(), after, cases, FunctionalComponent);
hyphenate(before + '-' + char, after, cases, FunctionalComponent);
before[before.length - 1]==='-' || hyphenate(before + char, after, cases, FunctionalComponent);
}
}
function FunctionalComponentConstructor (Vue3 ) {
var openBlock = Vue3.openBlock;
var createBlock = Vue3.createBlock;
var cache = create$1(NULL) ;
function FunctionalComponent (cases , name ) {
cases[name] = cache[name] || ( cache[name] = function (prop , context ) {
openBlock();
return createBlock(name, context.attrs, context.slots);
} );
}
OPTIONS.fix.set(Vue3, FunctionalComponent);
return FunctionalComponent;
}
function FunctionalComponent2 (cases , name ) { cases[name] = null; }
var isCustomElement = /*#__PURE__*/test.bind(/^(?:[ad-jl-ru-z]|b(?!ase-transition$)|c(?!omponent$)|k(?!eep-alive$)|s(?!lot$|uspense$)|t(?!e(?:leport|mplate)$|transition(?:-group)?$))/);
var DEV = [
'proto',
'compile_name',
'compile_props',
'compile_emits',
'compile_is',
'compile_layer',
'compile_reserved',
'compile_redefined',
'compile_overwrite',
'compile_type',
'compile_symbol',
'compile_shadow',
'runtime_shadow',
'runtime_redefined',
'runtime_symbol',
'runtime_reserved',
'runtime_enumerable',
'runtime_data',
];
function created (el , binding ) { binding.arg===undefined$1 ? assign(el, binding.value) : ( el[binding.arg] = binding.value ); }
function updated (el , binding ) { binding.arg===undefined$1 ? assign(el, binding.value) : binding.oldValue===binding.value || ( el[binding.arg] = binding.value ); }
var prop = /*#__PURE__*/freeze(create$1(NULL, {
created: { value: created, enumerable: true },
bind: { value: created, enumerable: true },
upda