Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.compiler-core.esm-bundler.js Maven / Gradle / Ivy
/**
* @vue/compiler-core v3.4.34
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
import { isString, NOOP, isObject, NO, extend, isSymbol, isArray, capitalize, camelize, EMPTY_OBJ, PatchFlagNames, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared';
export { generateCodeFrame } from '@vue/shared';
const FRAGMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``);
const TELEPORT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Teleport` : ``);
const SUSPENSE = Symbol(!!(process.env.NODE_ENV !== "production") ? `Suspense` : ``);
const KEEP_ALIVE = Symbol(!!(process.env.NODE_ENV !== "production") ? `KeepAlive` : ``);
const BASE_TRANSITION = Symbol(!!(process.env.NODE_ENV !== "production") ? `BaseTransition` : ``);
const OPEN_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `openBlock` : ``);
const CREATE_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `createBlock` : ``);
const CREATE_ELEMENT_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `createElementBlock` : ``);
const CREATE_VNODE = Symbol(!!(process.env.NODE_ENV !== "production") ? `createVNode` : ``);
const CREATE_ELEMENT_VNODE = Symbol(!!(process.env.NODE_ENV !== "production") ? `createElementVNode` : ``);
const CREATE_COMMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `createCommentVNode` : ``);
const CREATE_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? `createTextVNode` : ``);
const CREATE_STATIC = Symbol(!!(process.env.NODE_ENV !== "production") ? `createStaticVNode` : ``);
const RESOLVE_COMPONENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `resolveComponent` : ``);
const RESOLVE_DYNAMIC_COMPONENT = Symbol(
!!(process.env.NODE_ENV !== "production") ? `resolveDynamicComponent` : ``
);
const RESOLVE_DIRECTIVE = Symbol(!!(process.env.NODE_ENV !== "production") ? `resolveDirective` : ``);
const RESOLVE_FILTER = Symbol(!!(process.env.NODE_ENV !== "production") ? `resolveFilter` : ``);
const WITH_DIRECTIVES = Symbol(!!(process.env.NODE_ENV !== "production") ? `withDirectives` : ``);
const RENDER_LIST = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderList` : ``);
const RENDER_SLOT = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderSlot` : ``);
const CREATE_SLOTS = Symbol(!!(process.env.NODE_ENV !== "production") ? `createSlots` : ``);
const TO_DISPLAY_STRING = Symbol(!!(process.env.NODE_ENV !== "production") ? `toDisplayString` : ``);
const MERGE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `mergeProps` : ``);
const NORMALIZE_CLASS = Symbol(!!(process.env.NODE_ENV !== "production") ? `normalizeClass` : ``);
const NORMALIZE_STYLE = Symbol(!!(process.env.NODE_ENV !== "production") ? `normalizeStyle` : ``);
const NORMALIZE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `normalizeProps` : ``);
const GUARD_REACTIVE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `guardReactiveProps` : ``);
const TO_HANDLERS = Symbol(!!(process.env.NODE_ENV !== "production") ? `toHandlers` : ``);
const CAMELIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `camelize` : ``);
const CAPITALIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `capitalize` : ``);
const TO_HANDLER_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? `toHandlerKey` : ``);
const SET_BLOCK_TRACKING = Symbol(!!(process.env.NODE_ENV !== "production") ? `setBlockTracking` : ``);
const PUSH_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `pushScopeId` : ``);
const POP_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `popScopeId` : ``);
const WITH_CTX = Symbol(!!(process.env.NODE_ENV !== "production") ? `withCtx` : ``);
const UNREF = Symbol(!!(process.env.NODE_ENV !== "production") ? `unref` : ``);
const IS_REF = Symbol(!!(process.env.NODE_ENV !== "production") ? `isRef` : ``);
const WITH_MEMO = Symbol(!!(process.env.NODE_ENV !== "production") ? `withMemo` : ``);
const IS_MEMO_SAME = Symbol(!!(process.env.NODE_ENV !== "production") ? `isMemoSame` : ``);
const helperNameMap = {
[FRAGMENT]: `Fragment`,
[TELEPORT]: `Teleport`,
[SUSPENSE]: `Suspense`,
[KEEP_ALIVE]: `KeepAlive`,
[BASE_TRANSITION]: `BaseTransition`,
[OPEN_BLOCK]: `openBlock`,
[CREATE_BLOCK]: `createBlock`,
[CREATE_ELEMENT_BLOCK]: `createElementBlock`,
[CREATE_VNODE]: `createVNode`,
[CREATE_ELEMENT_VNODE]: `createElementVNode`,
[CREATE_COMMENT]: `createCommentVNode`,
[CREATE_TEXT]: `createTextVNode`,
[CREATE_STATIC]: `createStaticVNode`,
[RESOLVE_COMPONENT]: `resolveComponent`,
[RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
[RESOLVE_DIRECTIVE]: `resolveDirective`,
[RESOLVE_FILTER]: `resolveFilter`,
[WITH_DIRECTIVES]: `withDirectives`,
[RENDER_LIST]: `renderList`,
[RENDER_SLOT]: `renderSlot`,
[CREATE_SLOTS]: `createSlots`,
[TO_DISPLAY_STRING]: `toDisplayString`,
[MERGE_PROPS]: `mergeProps`,
[NORMALIZE_CLASS]: `normalizeClass`,
[NORMALIZE_STYLE]: `normalizeStyle`,
[NORMALIZE_PROPS]: `normalizeProps`,
[GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
[TO_HANDLERS]: `toHandlers`,
[CAMELIZE]: `camelize`,
[CAPITALIZE]: `capitalize`,
[TO_HANDLER_KEY]: `toHandlerKey`,
[SET_BLOCK_TRACKING]: `setBlockTracking`,
[PUSH_SCOPE_ID]: `pushScopeId`,
[POP_SCOPE_ID]: `popScopeId`,
[WITH_CTX]: `withCtx`,
[UNREF]: `unref`,
[IS_REF]: `isRef`,
[WITH_MEMO]: `withMemo`,
[IS_MEMO_SAME]: `isMemoSame`
};
function registerRuntimeHelpers(helpers) {
Object.getOwnPropertySymbols(helpers).forEach((s) => {
helperNameMap[s] = helpers[s];
});
}
const Namespaces = {
"HTML": 0,
"0": "HTML",
"SVG": 1,
"1": "SVG",
"MATH_ML": 2,
"2": "MATH_ML"
};
const NodeTypes = {
"ROOT": 0,
"0": "ROOT",
"ELEMENT": 1,
"1": "ELEMENT",
"TEXT": 2,
"2": "TEXT",
"COMMENT": 3,
"3": "COMMENT",
"SIMPLE_EXPRESSION": 4,
"4": "SIMPLE_EXPRESSION",
"INTERPOLATION": 5,
"5": "INTERPOLATION",
"ATTRIBUTE": 6,
"6": "ATTRIBUTE",
"DIRECTIVE": 7,
"7": "DIRECTIVE",
"COMPOUND_EXPRESSION": 8,
"8": "COMPOUND_EXPRESSION",
"IF": 9,
"9": "IF",
"IF_BRANCH": 10,
"10": "IF_BRANCH",
"FOR": 11,
"11": "FOR",
"TEXT_CALL": 12,
"12": "TEXT_CALL",
"VNODE_CALL": 13,
"13": "VNODE_CALL",
"JS_CALL_EXPRESSION": 14,
"14": "JS_CALL_EXPRESSION",
"JS_OBJECT_EXPRESSION": 15,
"15": "JS_OBJECT_EXPRESSION",
"JS_PROPERTY": 16,
"16": "JS_PROPERTY",
"JS_ARRAY_EXPRESSION": 17,
"17": "JS_ARRAY_EXPRESSION",
"JS_FUNCTION_EXPRESSION": 18,
"18": "JS_FUNCTION_EXPRESSION",
"JS_CONDITIONAL_EXPRESSION": 19,
"19": "JS_CONDITIONAL_EXPRESSION",
"JS_CACHE_EXPRESSION": 20,
"20": "JS_CACHE_EXPRESSION",
"JS_BLOCK_STATEMENT": 21,
"21": "JS_BLOCK_STATEMENT",
"JS_TEMPLATE_LITERAL": 22,
"22": "JS_TEMPLATE_LITERAL",
"JS_IF_STATEMENT": 23,
"23": "JS_IF_STATEMENT",
"JS_ASSIGNMENT_EXPRESSION": 24,
"24": "JS_ASSIGNMENT_EXPRESSION",
"JS_SEQUENCE_EXPRESSION": 25,
"25": "JS_SEQUENCE_EXPRESSION",
"JS_RETURN_STATEMENT": 26,
"26": "JS_RETURN_STATEMENT"
};
const ElementTypes = {
"ELEMENT": 0,
"0": "ELEMENT",
"COMPONENT": 1,
"1": "COMPONENT",
"SLOT": 2,
"2": "SLOT",
"TEMPLATE": 3,
"3": "TEMPLATE"
};
const ConstantTypes = {
"NOT_CONSTANT": 0,
"0": "NOT_CONSTANT",
"CAN_SKIP_PATCH": 1,
"1": "CAN_SKIP_PATCH",
"CAN_HOIST": 2,
"2": "CAN_HOIST",
"CAN_STRINGIFY": 3,
"3": "CAN_STRINGIFY"
};
const locStub = {
start: { line: 1, column: 1, offset: 0 },
end: { line: 1, column: 1, offset: 0 },
source: ""
};
function createRoot(children, source = "") {
return {
type: 0,
source,
children,
helpers: /* @__PURE__ */ new Set(),
components: [],
directives: [],
hoists: [],
imports: [],
cached: 0,
temps: 0,
codegenNode: void 0,
loc: locStub
};
}
function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
if (context) {
if (isBlock) {
context.helper(OPEN_BLOCK);
context.helper(getVNodeBlockHelper(context.inSSR, isComponent));
} else {
context.helper(getVNodeHelper(context.inSSR, isComponent));
}
if (directives) {
context.helper(WITH_DIRECTIVES);
}
}
return {
type: 13,
tag,
props,
children,
patchFlag,
dynamicProps,
directives,
isBlock,
disableTracking,
isComponent,
loc
};
}
function createArrayExpression(elements, loc = locStub) {
return {
type: 17,
loc,
elements
};
}
function createObjectExpression(properties, loc = locStub) {
return {
type: 15,
loc,
properties
};
}
function createObjectProperty(key, value) {
return {
type: 16,
loc: locStub,
key: isString(key) ? createSimpleExpression(key, true) : key,
value
};
}
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
return {
type: 4,
loc,
content,
isStatic,
constType: isStatic ? 3 : constType
};
}
function createInterpolation(content, loc) {
return {
type: 5,
loc,
content: isString(content) ? createSimpleExpression(content, false, loc) : content
};
}
function createCompoundExpression(children, loc = locStub) {
return {
type: 8,
loc,
children
};
}
function createCallExpression(callee, args = [], loc = locStub) {
return {
type: 14,
loc,
callee,
arguments: args
};
}
function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
return {
type: 18,
params,
returns,
newline,
isSlot,
loc
};
}
function createConditionalExpression(test, consequent, alternate, newline = true) {
return {
type: 19,
test,
consequent,
alternate,
newline,
loc: locStub
};
}
function createCacheExpression(index, value, isVOnce = false) {
return {
type: 20,
index,
value,
isVOnce,
loc: locStub
};
}
function createBlockStatement(body) {
return {
type: 21,
body,
loc: locStub
};
}
function createTemplateLiteral(elements) {
return {
type: 22,
elements,
loc: locStub
};
}
function createIfStatement(test, consequent, alternate) {
return {
type: 23,
test,
consequent,
alternate,
loc: locStub
};
}
function createAssignmentExpression(left, right) {
return {
type: 24,
left,
right,
loc: locStub
};
}
function createSequenceExpression(expressions) {
return {
type: 25,
expressions,
loc: locStub
};
}
function createReturnStatement(returns) {
return {
type: 26,
returns,
loc: locStub
};
}
function getVNodeHelper(ssr, isComponent) {
return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
}
function getVNodeBlockHelper(ssr, isComponent) {
return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
}
function convertToBlock(node, { helper, removeHelper, inSSR }) {
if (!node.isBlock) {
node.isBlock = true;
removeHelper(getVNodeHelper(inSSR, node.isComponent));
helper(OPEN_BLOCK);
helper(getVNodeBlockHelper(inSSR, node.isComponent));
}
}
const defaultDelimitersOpen = new Uint8Array([123, 123]);
const defaultDelimitersClose = new Uint8Array([125, 125]);
function isTagStartChar(c) {
return c >= 97 && c <= 122 || c >= 65 && c <= 90;
}
function isWhitespace(c) {
return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
}
function isEndOfTagSection(c) {
return c === 47 || c === 62 || isWhitespace(c);
}
function toCharCodes(str) {
const ret = new Uint8Array(str.length);
for (let i = 0; i < str.length; i++) {
ret[i] = str.charCodeAt(i);
}
return ret;
}
const Sequences = {
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
// CDATA[
CdataEnd: new Uint8Array([93, 93, 62]),
// ]]>
CommentEnd: new Uint8Array([45, 45, 62]),
// `-->`
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
// `<\/script`
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
// `= 0; i--) {
const newlineIndex = this.newlines[i];
if (index > newlineIndex) {
line = i + 2;
column = index - newlineIndex;
break;
}
}
return {
column,
line,
offset: index
};
}
peek() {
return this.buffer.charCodeAt(this.index + 1);
}
stateText(c) {
if (c === 60) {
if (this.index > this.sectionStart) {
this.cbs.ontext(this.sectionStart, this.index);
}
this.state = 5;
this.sectionStart = this.index;
} else if (!this.inVPre && c === this.delimiterOpen[0]) {
this.state = 2;
this.delimiterIndex = 0;
this.stateInterpolationOpen(c);
}
}
stateInterpolationOpen(c) {
if (c === this.delimiterOpen[this.delimiterIndex]) {
if (this.delimiterIndex === this.delimiterOpen.length - 1) {
const start = this.index + 1 - this.delimiterOpen.length;
if (start > this.sectionStart) {
this.cbs.ontext(this.sectionStart, start);
}
this.state = 3;
this.sectionStart = start;
} else {
this.delimiterIndex++;
}
} else if (this.inRCDATA) {
this.state = 32;
this.stateInRCDATA(c);
} else {
this.state = 1;
this.stateText(c);
}
}
stateInterpolation(c) {
if (c === this.delimiterClose[0]) {
this.state = 4;
this.delimiterIndex = 0;
this.stateInterpolationClose(c);
}
}
stateInterpolationClose(c) {
if (c === this.delimiterClose[this.delimiterIndex]) {
if (this.delimiterIndex === this.delimiterClose.length - 1) {
this.cbs.oninterpolation(this.sectionStart, this.index + 1);
if (this.inRCDATA) {
this.state = 32;
} else {
this.state = 1;
}
this.sectionStart = this.index + 1;
} else {
this.delimiterIndex++;
}
} else {
this.state = 3;
this.stateInterpolation(c);
}
}
stateSpecialStartSequence(c) {
const isEnd = this.sequenceIndex === this.currentSequence.length;
const isMatch = isEnd ? (
// If we are at the end of the sequence, make sure the tag name has ended
isEndOfTagSection(c)
) : (
// Otherwise, do a case-insensitive comparison
(c | 32) === this.currentSequence[this.sequenceIndex]
);
if (!isMatch) {
this.inRCDATA = false;
} else if (!isEnd) {
this.sequenceIndex++;
return;
}
this.sequenceIndex = 0;
this.state = 6;
this.stateInTagName(c);
}
/** Look for an end tag. For and