1 | 'use strict';
|
2 |
|
3 | var build = require('./dep-cc49d7be.js');
|
4 |
|
5 | var compilerDom_cjs$2 = {};
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | function makeMap(str, expectsLowerCase) {
|
15 | const map = Object.create(null);
|
16 | const list = str.split(',');
|
17 | for (let i = 0; i < list.length; i++) {
|
18 | map[list[i]] = true;
|
19 | }
|
20 | return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];
|
21 | }
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | const PatchFlagNames = {
|
27 | [1 ]: `TEXT`,
|
28 | [2 ]: `CLASS`,
|
29 | [4 ]: `STYLE`,
|
30 | [8 ]: `PROPS`,
|
31 | [16 ]: `FULL_PROPS`,
|
32 | [32 ]: `HYDRATE_EVENTS`,
|
33 | [64 ]: `STABLE_FRAGMENT`,
|
34 | [128 ]: `KEYED_FRAGMENT`,
|
35 | [256 ]: `UNKEYED_FRAGMENT`,
|
36 | [512 ]: `NEED_PATCH`,
|
37 | [1024 ]: `DYNAMIC_SLOTS`,
|
38 | [2048 ]: `DEV_ROOT_FRAGMENT`,
|
39 | [-1 ]: `HOISTED`,
|
40 | [-2 ]: `BAIL`
|
41 | };
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | const slotFlagsText = {
|
47 | [1 ]: 'STABLE',
|
48 | [2 ]: 'DYNAMIC',
|
49 | [3 ]: 'FORWARDED'
|
50 | };
|
51 |
|
52 | const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
|
53 | 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
|
54 | 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
|
55 | const isGloballyWhitelisted = makeMap(GLOBALS_WHITE_LISTED);
|
56 |
|
57 | const range = 2;
|
58 | function generateCodeFrame(source, start = 0, end = source.length) {
|
59 | const lines = source.split(/\r?\n/);
|
60 | let count = 0;
|
61 | const res = [];
|
62 | for (let i = 0; i < lines.length; i++) {
|
63 | count += lines[i].length + 1;
|
64 | if (count >= start) {
|
65 | for (let j = i - range; j <= i + range || end > count; j++) {
|
66 | if (j < 0 || j >= lines.length)
|
67 | continue;
|
68 | const line = j + 1;
|
69 | res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
|
70 | const lineLength = lines[j].length;
|
71 | if (j === i) {
|
72 |
|
73 | const pad = start - (count - lineLength) + 1;
|
74 | const length = Math.max(1, end > count ? lineLength - pad : end - start);
|
75 | res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
|
76 | }
|
77 | else if (j > i) {
|
78 | if (end > count) {
|
79 | const length = Math.max(Math.min(end - count, lineLength), 1);
|
80 | res.push(` | ` + '^'.repeat(length));
|
81 | }
|
82 | count += lineLength + 1;
|
83 | }
|
84 | }
|
85 | break;
|
86 | }
|
87 | }
|
88 | return res.join('\n');
|
89 | }
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
103 | const isSpecialBooleanAttr = makeMap(specialBooleanAttrs);
|
104 |
|
105 |
|
106 |
|
107 | const isBooleanAttr = makeMap(specialBooleanAttrs +
|
108 | `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
|
109 | `loop,open,required,reversed,scoped,seamless,` +
|
110 | `checked,muted,multiple,selected`);
|
111 | const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
|
112 | const attrValidationCache = {};
|
113 | function isSSRSafeAttrName(name) {
|
114 | if (attrValidationCache.hasOwnProperty(name)) {
|
115 | return attrValidationCache[name];
|
116 | }
|
117 | const isUnsafe = unsafeAttrCharRE.test(name);
|
118 | if (isUnsafe) {
|
119 | console.error(`unsafe attribute name: ${name}`);
|
120 | }
|
121 | return (attrValidationCache[name] = !isUnsafe);
|
122 | }
|
123 | const propsToAttrMap = {
|
124 | acceptCharset: 'accept-charset',
|
125 | className: 'class',
|
126 | htmlFor: 'for',
|
127 | httpEquiv: 'http-equiv'
|
128 | };
|
129 |
|
130 |
|
131 |
|
132 | const isNoUnitNumericStyleProp = makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +
|
133 | `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +
|
134 | `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +
|
135 | `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
|
136 | `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
|
137 | `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
|
138 |
|
139 | `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +
|
140 | `stroke-miterlimit,stroke-opacity,stroke-width`);
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 | const isKnownAttr = makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
|
148 | `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
|
149 | `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
|
150 | `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
|
151 | `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
|
152 | `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
|
153 | `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
|
154 | `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
|
155 | `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
|
156 | `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
|
157 | `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
|
158 | `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
|
159 | `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
|
160 | `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
|
161 | `value,width,wrap`);
|
162 |
|
163 | function normalizeStyle(value) {
|
164 | if (isArray(value)) {
|
165 | const res = {};
|
166 | for (let i = 0; i < value.length; i++) {
|
167 | const item = value[i];
|
168 | const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);
|
169 | if (normalized) {
|
170 | for (const key in normalized) {
|
171 | res[key] = normalized[key];
|
172 | }
|
173 | }
|
174 | }
|
175 | return res;
|
176 | }
|
177 | else if (isObject(value)) {
|
178 | return value;
|
179 | }
|
180 | }
|
181 | const listDelimiterRE = /;(?![^(]*\))/g;
|
182 | const propertyDelimiterRE = /:(.+)/;
|
183 | function parseStringStyle(cssText) {
|
184 | const ret = {};
|
185 | cssText.split(listDelimiterRE).forEach(item => {
|
186 | if (item) {
|
187 | const tmp = item.split(propertyDelimiterRE);
|
188 | tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
189 | }
|
190 | });
|
191 | return ret;
|
192 | }
|
193 | function stringifyStyle(styles) {
|
194 | let ret = '';
|
195 | if (!styles) {
|
196 | return ret;
|
197 | }
|
198 | for (const key in styles) {
|
199 | const value = styles[key];
|
200 | const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
|
201 | if (isString(value) ||
|
202 | (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {
|
203 |
|
204 | ret += `${normalizedKey}:${value};`;
|
205 | }
|
206 | }
|
207 | return ret;
|
208 | }
|
209 | function normalizeClass(value) {
|
210 | let res = '';
|
211 | if (isString(value)) {
|
212 | res = value;
|
213 | }
|
214 | else if (isArray(value)) {
|
215 | for (let i = 0; i < value.length; i++) {
|
216 | const normalized = normalizeClass(value[i]);
|
217 | if (normalized) {
|
218 | res += normalized + ' ';
|
219 | }
|
220 | }
|
221 | }
|
222 | else if (isObject(value)) {
|
223 | for (const name in value) {
|
224 | if (value[name]) {
|
225 | res += name + ' ';
|
226 | }
|
227 | }
|
228 | }
|
229 | return res.trim();
|
230 | }
|
231 |
|
232 |
|
233 |
|
234 | const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
|
235 | 'header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,' +
|
236 | 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
|
237 | 'data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,' +
|
238 | 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
|
239 | 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +
|
240 | 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +
|
241 | 'option,output,progress,select,textarea,details,dialog,menu,' +
|
242 | 'summary,template,blockquote,iframe,tfoot';
|
243 |
|
244 | const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
|
245 | 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
|
246 | 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
|
247 | 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
|
248 | 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
|
249 | 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
|
250 | 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
|
251 | 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +
|
252 | 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
|
253 | 'text,textPath,title,tspan,unknown,use,view';
|
254 | const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
|
255 | const isHTMLTag = makeMap(HTML_TAGS);
|
256 | const isSVGTag = makeMap(SVG_TAGS);
|
257 | const isVoidTag = makeMap(VOID_TAGS);
|
258 |
|
259 | const escapeRE = /["'&<>]/;
|
260 | function escapeHtml(string) {
|
261 | const str = '' + string;
|
262 | const match = escapeRE.exec(str);
|
263 | if (!match) {
|
264 | return str;
|
265 | }
|
266 | let html = '';
|
267 | let escaped;
|
268 | let index;
|
269 | let lastIndex = 0;
|
270 | for (index = match.index; index < str.length; index++) {
|
271 | switch (str.charCodeAt(index)) {
|
272 | case 34:
|
273 | escaped = '"';
|
274 | break;
|
275 | case 38:
|
276 | escaped = '&';
|
277 | break;
|
278 | case 39:
|
279 | escaped = ''';
|
280 | break;
|
281 | case 60:
|
282 | escaped = '<';
|
283 | break;
|
284 | case 62:
|
285 | escaped = '>';
|
286 | break;
|
287 | default:
|
288 | continue;
|
289 | }
|
290 | if (lastIndex !== index) {
|
291 | html += str.substring(lastIndex, index);
|
292 | }
|
293 | lastIndex = index + 1;
|
294 | html += escaped;
|
295 | }
|
296 | return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
297 | }
|
298 |
|
299 | const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
|
300 | function escapeHtmlComment(src) {
|
301 | return src.replace(commentStripRE, '');
|
302 | }
|
303 |
|
304 | function looseCompareArrays(a, b) {
|
305 | if (a.length !== b.length)
|
306 | return false;
|
307 | let equal = true;
|
308 | for (let i = 0; equal && i < a.length; i++) {
|
309 | equal = looseEqual(a[i], b[i]);
|
310 | }
|
311 | return equal;
|
312 | }
|
313 | function looseEqual(a, b) {
|
314 | if (a === b)
|
315 | return true;
|
316 | let aValidType = isDate(a);
|
317 | let bValidType = isDate(b);
|
318 | if (aValidType || bValidType) {
|
319 | return aValidType && bValidType ? a.getTime() === b.getTime() : false;
|
320 | }
|
321 | aValidType = isArray(a);
|
322 | bValidType = isArray(b);
|
323 | if (aValidType || bValidType) {
|
324 | return aValidType && bValidType ? looseCompareArrays(a, b) : false;
|
325 | }
|
326 | aValidType = isObject(a);
|
327 | bValidType = isObject(b);
|
328 | if (aValidType || bValidType) {
|
329 |
|
330 | if (!aValidType || !bValidType) {
|
331 | return false;
|
332 | }
|
333 | const aKeysCount = Object.keys(a).length;
|
334 | const bKeysCount = Object.keys(b).length;
|
335 | if (aKeysCount !== bKeysCount) {
|
336 | return false;
|
337 | }
|
338 | for (const key in a) {
|
339 | const aHasKey = a.hasOwnProperty(key);
|
340 | const bHasKey = b.hasOwnProperty(key);
|
341 | if ((aHasKey && !bHasKey) ||
|
342 | (!aHasKey && bHasKey) ||
|
343 | !looseEqual(a[key], b[key])) {
|
344 | return false;
|
345 | }
|
346 | }
|
347 | }
|
348 | return String(a) === String(b);
|
349 | }
|
350 | function looseIndexOf(arr, val) {
|
351 | return arr.findIndex(item => looseEqual(item, val));
|
352 | }
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 | const toDisplayString = (val) => {
|
359 | return val == null
|
360 | ? ''
|
361 | : isObject(val)
|
362 | ? JSON.stringify(val, replacer, 2)
|
363 | : String(val);
|
364 | };
|
365 | const replacer = (_key, val) => {
|
366 | if (isMap(val)) {
|
367 | return {
|
368 | [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
|
369 | entries[`${key} =>`] = val;
|
370 | return entries;
|
371 | }, {})
|
372 | };
|
373 | }
|
374 | else if (isSet(val)) {
|
375 | return {
|
376 | [`Set(${val.size})`]: [...val.values()]
|
377 | };
|
378 | }
|
379 | else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
380 | return String(val);
|
381 | }
|
382 | return val;
|
383 | };
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 | const babelParserDefaultPlugins = [
|
392 | 'bigInt',
|
393 | 'optionalChaining',
|
394 | 'nullishCoalescingOperator'
|
395 | ];
|
396 | const EMPTY_OBJ = (process.env.NODE_ENV !== 'production')
|
397 | ? Object.freeze({})
|
398 | : {};
|
399 | const EMPTY_ARR = (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
|
400 | const NOOP = () => { };
|
401 |
|
402 |
|
403 |
|
404 | const NO = () => false;
|
405 | const onRE = /^on[^a-z]/;
|
406 | const isOn = (key) => onRE.test(key);
|
407 | const isModelListener = (key) => key.startsWith('onUpdate:');
|
408 | const extend = Object.assign;
|
409 | const remove = (arr, el) => {
|
410 | const i = arr.indexOf(el);
|
411 | if (i > -1) {
|
412 | arr.splice(i, 1);
|
413 | }
|
414 | };
|
415 | const hasOwnProperty = Object.prototype.hasOwnProperty;
|
416 | const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
417 | const isArray = Array.isArray;
|
418 | const isMap = (val) => toTypeString(val) === '[object Map]';
|
419 | const isSet = (val) => toTypeString(val) === '[object Set]';
|
420 | const isDate = (val) => val instanceof Date;
|
421 | const isFunction = (val) => typeof val === 'function';
|
422 | const isString = (val) => typeof val === 'string';
|
423 | const isSymbol = (val) => typeof val === 'symbol';
|
424 | const isObject = (val) => val !== null && typeof val === 'object';
|
425 | const isPromise = (val) => {
|
426 | return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
427 | };
|
428 | const objectToString = Object.prototype.toString;
|
429 | const toTypeString = (value) => objectToString.call(value);
|
430 | const toRawType = (value) => {
|
431 |
|
432 | return toTypeString(value).slice(8, -1);
|
433 | };
|
434 | const isPlainObject = (val) => toTypeString(val) === '[object Object]';
|
435 | const isIntegerKey = (key) => isString(key) &&
|
436 | key !== 'NaN' &&
|
437 | key[0] !== '-' &&
|
438 | '' + parseInt(key, 10) === key;
|
439 | const isReservedProp = makeMap(
|
440 |
|
441 | ',key,ref,' +
|
442 | 'onVnodeBeforeMount,onVnodeMounted,' +
|
443 | 'onVnodeBeforeUpdate,onVnodeUpdated,' +
|
444 | 'onVnodeBeforeUnmount,onVnodeUnmounted');
|
445 | const cacheStringFunction$1 = (fn) => {
|
446 | const cache = Object.create(null);
|
447 | return ((str) => {
|
448 | const hit = cache[str];
|
449 | return hit || (cache[str] = fn(str));
|
450 | });
|
451 | };
|
452 | const camelizeRE$1 = /-(\w)/g;
|
453 |
|
454 |
|
455 |
|
456 | const camelize$1 = cacheStringFunction$1((str) => {
|
457 | return str.replace(camelizeRE$1, (_, c) => (c ? c.toUpperCase() : ''));
|
458 | });
|
459 | const hyphenateRE = /\B([A-Z])/g;
|
460 |
|
461 |
|
462 |
|
463 | const hyphenate = cacheStringFunction$1((str) => str.replace(hyphenateRE, '-$1').toLowerCase());
|
464 |
|
465 |
|
466 |
|
467 | const capitalize = cacheStringFunction$1((str) => str.charAt(0).toUpperCase() + str.slice(1));
|
468 |
|
469 |
|
470 |
|
471 | const toHandlerKey = cacheStringFunction$1((str) => (str ? `on${capitalize(str)}` : ``));
|
472 |
|
473 | const hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
|
474 | const invokeArrayFns = (fns, arg) => {
|
475 | for (let i = 0; i < fns.length; i++) {
|
476 | fns[i](arg);
|
477 | }
|
478 | };
|
479 | const def = (obj, key, value) => {
|
480 | Object.defineProperty(obj, key, {
|
481 | configurable: true,
|
482 | enumerable: false,
|
483 | value
|
484 | });
|
485 | };
|
486 | const toNumber = (val) => {
|
487 | const n = parseFloat(val);
|
488 | return isNaN(n) ? val : n;
|
489 | };
|
490 | let _globalThis;
|
491 | const getGlobalThis = () => {
|
492 | return (_globalThis ||
|
493 | (_globalThis =
|
494 | typeof globalThis !== 'undefined'
|
495 | ? globalThis
|
496 | : typeof self !== 'undefined'
|
497 | ? self
|
498 | : typeof window !== 'undefined'
|
499 | ? window
|
500 | : typeof global !== 'undefined'
|
501 | ? global
|
502 | : {}));
|
503 | };
|
504 |
|
505 | var shared_esmBundler = {
|
506 | __proto__: null,
|
507 | EMPTY_ARR: EMPTY_ARR,
|
508 | EMPTY_OBJ: EMPTY_OBJ,
|
509 | NO: NO,
|
510 | NOOP: NOOP,
|
511 | PatchFlagNames: PatchFlagNames,
|
512 | babelParserDefaultPlugins: babelParserDefaultPlugins,
|
513 | camelize: camelize$1,
|
514 | capitalize: capitalize,
|
515 | def: def,
|
516 | escapeHtml: escapeHtml,
|
517 | escapeHtmlComment: escapeHtmlComment,
|
518 | extend: extend,
|
519 | generateCodeFrame: generateCodeFrame,
|
520 | getGlobalThis: getGlobalThis,
|
521 | hasChanged: hasChanged,
|
522 | hasOwn: hasOwn,
|
523 | hyphenate: hyphenate,
|
524 | invokeArrayFns: invokeArrayFns,
|
525 | isArray: isArray,
|
526 | isBooleanAttr: isBooleanAttr,
|
527 | isDate: isDate,
|
528 | isFunction: isFunction,
|
529 | isGloballyWhitelisted: isGloballyWhitelisted,
|
530 | isHTMLTag: isHTMLTag,
|
531 | isIntegerKey: isIntegerKey,
|
532 | isKnownAttr: isKnownAttr,
|
533 | isMap: isMap,
|
534 | isModelListener: isModelListener,
|
535 | isNoUnitNumericStyleProp: isNoUnitNumericStyleProp,
|
536 | isObject: isObject,
|
537 | isOn: isOn,
|
538 | isPlainObject: isPlainObject,
|
539 | isPromise: isPromise,
|
540 | isReservedProp: isReservedProp,
|
541 | isSSRSafeAttrName: isSSRSafeAttrName,
|
542 | isSVGTag: isSVGTag,
|
543 | isSet: isSet,
|
544 | isSpecialBooleanAttr: isSpecialBooleanAttr,
|
545 | isString: isString,
|
546 | isSymbol: isSymbol,
|
547 | isVoidTag: isVoidTag,
|
548 | looseEqual: looseEqual,
|
549 | looseIndexOf: looseIndexOf,
|
550 | makeMap: makeMap,
|
551 | normalizeClass: normalizeClass,
|
552 | normalizeStyle: normalizeStyle,
|
553 | objectToString: objectToString,
|
554 | parseStringStyle: parseStringStyle,
|
555 | propsToAttrMap: propsToAttrMap,
|
556 | remove: remove,
|
557 | slotFlagsText: slotFlagsText,
|
558 | stringifyStyle: stringifyStyle,
|
559 | toDisplayString: toDisplayString,
|
560 | toHandlerKey: toHandlerKey,
|
561 | toNumber: toNumber,
|
562 | toRawType: toRawType,
|
563 | toTypeString: toTypeString
|
564 | };
|
565 |
|
566 | function defaultOnError(error) {
|
567 | throw error;
|
568 | }
|
569 | function defaultOnWarn(msg) {
|
570 | (process.env.NODE_ENV !== 'production') && console.warn(`[Vue warn] ${msg.message}`);
|
571 | }
|
572 | function createCompilerError(code, loc, messages, additionalMessage) {
|
573 | const msg = (process.env.NODE_ENV !== 'production') || !true
|
574 | ? (messages || errorMessages)[code] + (additionalMessage || ``)
|
575 | : code;
|
576 | const error = new SyntaxError(String(msg));
|
577 | error.code = code;
|
578 | error.loc = loc;
|
579 | return error;
|
580 | }
|
581 | const errorMessages = {
|
582 |
|
583 | [0 ]: 'Illegal comment.',
|
584 | [1 ]: 'CDATA section is allowed only in XML context.',
|
585 | [2 ]: 'Duplicate attribute.',
|
586 | [3 ]: 'End tag cannot have attributes.',
|
587 | [4 ]: "Illegal '/' in tags.",
|
588 | [5 ]: 'Unexpected EOF in tag.',
|
589 | [6 ]: 'Unexpected EOF in CDATA section.',
|
590 | [7 ]: 'Unexpected EOF in comment.',
|
591 | [8 ]: 'Unexpected EOF in script.',
|
592 | [9 ]: 'Unexpected EOF in tag.',
|
593 | [10 ]: 'Incorrectly closed comment.',
|
594 | [11 ]: 'Incorrectly opened comment.',
|
595 | [12 ]: "Illegal tag name. Use '<' to print '<'.",
|
596 | [13 ]: 'Attribute value was expected.',
|
597 | [14 ]: 'End tag name was expected.',
|
598 | [15 ]: 'Whitespace was expected.',
|
599 | [16 ]: "Unexpected '<!--' in comment.",
|
600 | [17 ]: 'Attribute name cannot contain U+0022 ("), U+0027 (\'), and U+003C (<).',
|
601 | [18 ]: 'Unquoted attribute value cannot contain U+0022 ("), U+0027 (\'), U+003C (<), U+003D (=), and U+0060 (`).',
|
602 | [19 ]: "Attribute name cannot start with '='.",
|
603 | [21 ]: "'<?' is allowed only in XML context.",
|
604 | [20 ]: `Unexpected null cahracter.`,
|
605 | [22 ]: "Illegal '/' in tags.",
|
606 |
|
607 | [23 ]: 'Invalid end tag.',
|
608 | [24 ]: 'Element is missing end tag.',
|
609 | [25 ]: 'Interpolation end sign was not found.',
|
610 | [26 ]: 'End bracket for dynamic directive argument was not found. ' +
|
611 | 'Note that dynamic directive argument cannot contain spaces.',
|
612 |
|
613 | [27 ]: `v-if/v-else-if is missing expression.`,
|
614 | [28 ]: `v-if/else branches must use unique keys.`,
|
615 | [29 ]: `v-else/v-else-if has no adjacent v-if.`,
|
616 | [30 ]: `v-for is missing expression.`,
|
617 | [31 ]: `v-for has invalid expression.`,
|
618 | [32 ]: `<template v-for> key should be placed on the <template> tag.`,
|
619 | [33 ]: `v-bind is missing expression.`,
|
620 | [34 ]: `v-on is missing expression.`,
|
621 | [35 ]: `Unexpected custom directive on <slot> outlet.`,
|
622 | [36 ]: `Mixed v-slot usage on both the component and nested <template>.` +
|
623 | `When there are multiple named slots, all slots should use <template> ` +
|
624 | `syntax to avoid scope ambiguity.`,
|
625 | [37 ]: `Duplicate slot names found. `,
|
626 | [38 ]: `Extraneous children found when component already has explicitly named ` +
|
627 | `default slot. These children will be ignored.`,
|
628 | [39 ]: `v-slot can only be used on components or <template> tags.`,
|
629 | [40 ]: `v-model is missing expression.`,
|
630 | [41 ]: `v-model value must be a valid JavaScript member expression.`,
|
631 | [42 ]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
632 | [43 ]: `Error parsing JavaScript expression: `,
|
633 | [44 ]: `<KeepAlive> expects exactly one child component.`,
|
634 |
|
635 | [45 ]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
636 | [46 ]: `ES module mode is not supported in this build of compiler.`,
|
637 | [47 ]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
638 | [48 ]: `"scopeId" option is only supported in module mode.`,
|
639 |
|
640 | [49 ]: ``
|
641 | };
|
642 |
|
643 | const FRAGMENT = Symbol((process.env.NODE_ENV !== 'production') ? `Fragment` : ``);
|
644 | const TELEPORT = Symbol((process.env.NODE_ENV !== 'production') ? `Teleport` : ``);
|
645 | const SUSPENSE = Symbol((process.env.NODE_ENV !== 'production') ? `Suspense` : ``);
|
646 | const KEEP_ALIVE = Symbol((process.env.NODE_ENV !== 'production') ? `KeepAlive` : ``);
|
647 | const BASE_TRANSITION = Symbol((process.env.NODE_ENV !== 'production') ? `BaseTransition` : ``);
|
648 | const OPEN_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `openBlock` : ``);
|
649 | const CREATE_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `createBlock` : ``);
|
650 | const CREATE_VNODE = Symbol((process.env.NODE_ENV !== 'production') ? `createVNode` : ``);
|
651 | const CREATE_COMMENT = Symbol((process.env.NODE_ENV !== 'production') ? `createCommentVNode` : ``);
|
652 | const CREATE_TEXT = Symbol((process.env.NODE_ENV !== 'production') ? `createTextVNode` : ``);
|
653 | const CREATE_STATIC = Symbol((process.env.NODE_ENV !== 'production') ? `createStaticVNode` : ``);
|
654 | const RESOLVE_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveComponent` : ``);
|
655 | const RESOLVE_DYNAMIC_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDynamicComponent` : ``);
|
656 | const RESOLVE_DIRECTIVE = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDirective` : ``);
|
657 | const RESOLVE_FILTER = Symbol((process.env.NODE_ENV !== 'production') ? `resolveFilter` : ``);
|
658 | const WITH_DIRECTIVES = Symbol((process.env.NODE_ENV !== 'production') ? `withDirectives` : ``);
|
659 | const RENDER_LIST = Symbol((process.env.NODE_ENV !== 'production') ? `renderList` : ``);
|
660 | const RENDER_SLOT = Symbol((process.env.NODE_ENV !== 'production') ? `renderSlot` : ``);
|
661 | const CREATE_SLOTS = Symbol((process.env.NODE_ENV !== 'production') ? `createSlots` : ``);
|
662 | const TO_DISPLAY_STRING = Symbol((process.env.NODE_ENV !== 'production') ? `toDisplayString` : ``);
|
663 | const MERGE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `mergeProps` : ``);
|
664 | const TO_HANDLERS = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlers` : ``);
|
665 | const CAMELIZE = Symbol((process.env.NODE_ENV !== 'production') ? `camelize` : ``);
|
666 | const CAPITALIZE = Symbol((process.env.NODE_ENV !== 'production') ? `capitalize` : ``);
|
667 | const TO_HANDLER_KEY = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlerKey` : ``);
|
668 | const SET_BLOCK_TRACKING = Symbol((process.env.NODE_ENV !== 'production') ? `setBlockTracking` : ``);
|
669 | const PUSH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `pushScopeId` : ``);
|
670 | const POP_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `popScopeId` : ``);
|
671 | const WITH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `withScopeId` : ``);
|
672 | const WITH_CTX = Symbol((process.env.NODE_ENV !== 'production') ? `withCtx` : ``);
|
673 | const UNREF = Symbol((process.env.NODE_ENV !== 'production') ? `unref` : ``);
|
674 | const IS_REF = Symbol((process.env.NODE_ENV !== 'production') ? `isRef` : ``);
|
675 |
|
676 |
|
677 |
|
678 | const helperNameMap = {
|
679 | [FRAGMENT]: `Fragment`,
|
680 | [TELEPORT]: `Teleport`,
|
681 | [SUSPENSE]: `Suspense`,
|
682 | [KEEP_ALIVE]: `KeepAlive`,
|
683 | [BASE_TRANSITION]: `BaseTransition`,
|
684 | [OPEN_BLOCK]: `openBlock`,
|
685 | [CREATE_BLOCK]: `createBlock`,
|
686 | [CREATE_VNODE]: `createVNode`,
|
687 | [CREATE_COMMENT]: `createCommentVNode`,
|
688 | [CREATE_TEXT]: `createTextVNode`,
|
689 | [CREATE_STATIC]: `createStaticVNode`,
|
690 | [RESOLVE_COMPONENT]: `resolveComponent`,
|
691 | [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
|
692 | [RESOLVE_DIRECTIVE]: `resolveDirective`,
|
693 | [RESOLVE_FILTER]: `resolveFilter`,
|
694 | [WITH_DIRECTIVES]: `withDirectives`,
|
695 | [RENDER_LIST]: `renderList`,
|
696 | [RENDER_SLOT]: `renderSlot`,
|
697 | [CREATE_SLOTS]: `createSlots`,
|
698 | [TO_DISPLAY_STRING]: `toDisplayString`,
|
699 | [MERGE_PROPS]: `mergeProps`,
|
700 | [TO_HANDLERS]: `toHandlers`,
|
701 | [CAMELIZE]: `camelize`,
|
702 | [CAPITALIZE]: `capitalize`,
|
703 | [TO_HANDLER_KEY]: `toHandlerKey`,
|
704 | [SET_BLOCK_TRACKING]: `setBlockTracking`,
|
705 | [PUSH_SCOPE_ID]: `pushScopeId`,
|
706 | [POP_SCOPE_ID]: `popScopeId`,
|
707 | [WITH_SCOPE_ID]: `withScopeId`,
|
708 | [WITH_CTX]: `withCtx`,
|
709 | [UNREF]: `unref`,
|
710 | [IS_REF]: `isRef`
|
711 | };
|
712 | function registerRuntimeHelpers(helpers) {
|
713 | Object.getOwnPropertySymbols(helpers).forEach(s => {
|
714 | helperNameMap[s] = helpers[s];
|
715 | });
|
716 | }
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 | const locStub = {
|
723 | source: '',
|
724 | start: { line: 1, column: 1, offset: 0 },
|
725 | end: { line: 1, column: 1, offset: 0 }
|
726 | };
|
727 | function createRoot(children, loc = locStub) {
|
728 | return {
|
729 | type: 0 ,
|
730 | children,
|
731 | helpers: [],
|
732 | components: [],
|
733 | directives: [],
|
734 | hoists: [],
|
735 | imports: [],
|
736 | cached: 0,
|
737 | temps: 0,
|
738 | codegenNode: undefined,
|
739 | loc
|
740 | };
|
741 | }
|
742 | function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, loc = locStub) {
|
743 | if (context) {
|
744 | if (isBlock) {
|
745 | context.helper(OPEN_BLOCK);
|
746 | context.helper(CREATE_BLOCK);
|
747 | }
|
748 | else {
|
749 | context.helper(CREATE_VNODE);
|
750 | }
|
751 | if (directives) {
|
752 | context.helper(WITH_DIRECTIVES);
|
753 | }
|
754 | }
|
755 | return {
|
756 | type: 13 ,
|
757 | tag,
|
758 | props,
|
759 | children,
|
760 | patchFlag,
|
761 | dynamicProps,
|
762 | directives,
|
763 | isBlock,
|
764 | disableTracking,
|
765 | loc
|
766 | };
|
767 | }
|
768 | function createArrayExpression(elements, loc = locStub) {
|
769 | return {
|
770 | type: 17 ,
|
771 | loc,
|
772 | elements
|
773 | };
|
774 | }
|
775 | function createObjectExpression(properties, loc = locStub) {
|
776 | return {
|
777 | type: 15 ,
|
778 | loc,
|
779 | properties
|
780 | };
|
781 | }
|
782 | function createObjectProperty(key, value) {
|
783 | return {
|
784 | type: 16 ,
|
785 | loc: locStub,
|
786 | key: isString(key) ? createSimpleExpression(key, true) : key,
|
787 | value
|
788 | };
|
789 | }
|
790 | function createSimpleExpression(content, isStatic, loc = locStub, constType = 0 /* NOT_CONSTANT */) {
|
791 | return {
|
792 | type: 4 ,
|
793 | loc,
|
794 | content,
|
795 | isStatic,
|
796 | constType: isStatic ? 3 : constType
|
797 | };
|
798 | }
|
799 | function createInterpolation(content, loc) {
|
800 | return {
|
801 | type: 5 ,
|
802 | loc,
|
803 | content: isString(content)
|
804 | ? createSimpleExpression(content, false, loc)
|
805 | : content
|
806 | };
|
807 | }
|
808 | function createCompoundExpression(children, loc = locStub) {
|
809 | return {
|
810 | type: 8 ,
|
811 | loc,
|
812 | children
|
813 | };
|
814 | }
|
815 | function createCallExpression(callee, args = [], loc = locStub) {
|
816 | return {
|
817 | type: 14 ,
|
818 | loc,
|
819 | callee,
|
820 | arguments: args
|
821 | };
|
822 | }
|
823 | function createFunctionExpression(params, returns = undefined, newline = false, isSlot = false, loc = locStub) {
|
824 | return {
|
825 | type: 18 ,
|
826 | params,
|
827 | returns,
|
828 | newline,
|
829 | isSlot,
|
830 | loc
|
831 | };
|
832 | }
|
833 | function createConditionalExpression(test, consequent, alternate, newline = true) {
|
834 | return {
|
835 | type: 19 ,
|
836 | test,
|
837 | consequent,
|
838 | alternate,
|
839 | newline,
|
840 | loc: locStub
|
841 | };
|
842 | }
|
843 | function createCacheExpression(index, value, isVNode = false) {
|
844 | return {
|
845 | type: 20 ,
|
846 | index,
|
847 | value,
|
848 | isVNode,
|
849 | loc: locStub
|
850 | };
|
851 | }
|
852 | function createBlockStatement(body) {
|
853 | return {
|
854 | type: 21 ,
|
855 | body,
|
856 | loc: locStub
|
857 | };
|
858 | }
|
859 | function createTemplateLiteral(elements) {
|
860 | return {
|
861 | type: 22 ,
|
862 | elements,
|
863 | loc: locStub
|
864 | };
|
865 | }
|
866 | function createIfStatement(test, consequent, alternate) {
|
867 | return {
|
868 | type: 23 ,
|
869 | test,
|
870 | consequent,
|
871 | alternate,
|
872 | loc: locStub
|
873 | };
|
874 | }
|
875 | function createAssignmentExpression(left, right) {
|
876 | return {
|
877 | type: 24 ,
|
878 | left,
|
879 | right,
|
880 | loc: locStub
|
881 | };
|
882 | }
|
883 | function createSequenceExpression(expressions) {
|
884 | return {
|
885 | type: 25 ,
|
886 | expressions,
|
887 | loc: locStub
|
888 | };
|
889 | }
|
890 | function createReturnStatement(returns) {
|
891 | return {
|
892 | type: 26 ,
|
893 | returns,
|
894 | loc: locStub
|
895 | };
|
896 | }
|
897 |
|
898 | const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
899 | const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
|
900 | function isCoreComponent(tag) {
|
901 | if (isBuiltInType(tag, 'Teleport')) {
|
902 | return TELEPORT;
|
903 | }
|
904 | else if (isBuiltInType(tag, 'Suspense')) {
|
905 | return SUSPENSE;
|
906 | }
|
907 | else if (isBuiltInType(tag, 'KeepAlive')) {
|
908 | return KEEP_ALIVE;
|
909 | }
|
910 | else if (isBuiltInType(tag, 'BaseTransition')) {
|
911 | return BASE_TRANSITION;
|
912 | }
|
913 | }
|
914 | const nonIdentifierRE = /^\d|[^\$\w]/;
|
915 | const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
916 | const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
|
917 | const validIdentCharRE = /[\.\w$\xA0-\uFFFF]/;
|
918 | const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 | const isMemberExpression = (path) => {
|
926 |
|
927 | path = path.trim().replace(whitespaceRE, s => s.trim());
|
928 | let state = 0 ;
|
929 | let prevState = 0 ;
|
930 | let currentOpenBracketCount = 0;
|
931 | let currentStringType = null;
|
932 | for (let i = 0; i < path.length; i++) {
|
933 | const char = path.charAt(i);
|
934 | switch (state) {
|
935 | case 0 :
|
936 | if (char === '[') {
|
937 | prevState = state;
|
938 | state = 1 ;
|
939 | currentOpenBracketCount++;
|
940 | }
|
941 | else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
|
942 | return false;
|
943 | }
|
944 | break;
|
945 | case 1 :
|
946 | if (char === `'` || char === `"` || char === '`') {
|
947 | prevState = state;
|
948 | state = 2 ;
|
949 | currentStringType = char;
|
950 | }
|
951 | else if (char === `[`) {
|
952 | currentOpenBracketCount++;
|
953 | }
|
954 | else if (char === `]`) {
|
955 | if (!--currentOpenBracketCount) {
|
956 | state = prevState;
|
957 | }
|
958 | }
|
959 | break;
|
960 | case 2 :
|
961 | if (char === currentStringType) {
|
962 | state = prevState;
|
963 | currentStringType = null;
|
964 | }
|
965 | break;
|
966 | }
|
967 | }
|
968 | return !currentOpenBracketCount;
|
969 | };
|
970 | function getInnerRange(loc, offset, length) {
|
971 | const source = loc.source.substr(offset, length);
|
972 | const newLoc = {
|
973 | source,
|
974 | start: advancePositionWithClone(loc.start, loc.source, offset),
|
975 | end: loc.end
|
976 | };
|
977 | if (length != null) {
|
978 | newLoc.end = advancePositionWithClone(loc.start, loc.source, offset + length);
|
979 | }
|
980 | return newLoc;
|
981 | }
|
982 | function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
|
983 | return advancePositionWithMutation(extend({}, pos), source, numberOfCharacters);
|
984 | }
|
985 |
|
986 |
|
987 | function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {
|
988 | let linesCount = 0;
|
989 | let lastNewLinePos = -1;
|
990 | for (let i = 0; i < numberOfCharacters; i++) {
|
991 | if (source.charCodeAt(i) === 10 ) {
|
992 | linesCount++;
|
993 | lastNewLinePos = i;
|
994 | }
|
995 | }
|
996 | pos.offset += numberOfCharacters;
|
997 | pos.line += linesCount;
|
998 | pos.column =
|
999 | lastNewLinePos === -1
|
1000 | ? pos.column + numberOfCharacters
|
1001 | : numberOfCharacters - lastNewLinePos;
|
1002 | return pos;
|
1003 | }
|
1004 | function assert(condition, msg) {
|
1005 |
|
1006 | if (!condition) {
|
1007 | throw new Error(msg || `unexpected compiler condition`);
|
1008 | }
|
1009 | }
|
1010 | function findDir(node, name, allowEmpty = false) {
|
1011 | for (let i = 0; i < node.props.length; i++) {
|
1012 | const p = node.props[i];
|
1013 | if (p.type === 7 &&
|
1014 | (allowEmpty || p.exp) &&
|
1015 | (isString(name) ? p.name === name : name.test(p.name))) {
|
1016 | return p;
|
1017 | }
|
1018 | }
|
1019 | }
|
1020 | function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
|
1021 | for (let i = 0; i < node.props.length; i++) {
|
1022 | const p = node.props[i];
|
1023 | if (p.type === 6 ) {
|
1024 | if (dynamicOnly)
|
1025 | continue;
|
1026 | if (p.name === name && (p.value || allowEmpty)) {
|
1027 | return p;
|
1028 | }
|
1029 | }
|
1030 | else if (p.name === 'bind' &&
|
1031 | (p.exp || allowEmpty) &&
|
1032 | isBindKey(p.arg, name)) {
|
1033 | return p;
|
1034 | }
|
1035 | }
|
1036 | }
|
1037 | function isBindKey(arg, name) {
|
1038 | return !!(arg && isStaticExp(arg) && arg.content === name);
|
1039 | }
|
1040 | function hasDynamicKeyVBind(node) {
|
1041 | return node.props.some(p => p.type === 7 &&
|
1042 | p.name === 'bind' &&
|
1043 | (!p.arg ||
|
1044 | p.arg.type !== 4 ||
|
1045 | !p.arg.isStatic)
|
1046 | );
|
1047 | }
|
1048 | function isText(node) {
|
1049 | return node.type === 5 || node.type === 2 ;
|
1050 | }
|
1051 | function isVSlot(p) {
|
1052 | return p.type === 7 && p.name === 'slot';
|
1053 | }
|
1054 | function isTemplateNode(node) {
|
1055 | return (node.type === 1 && node.tagType === 3 );
|
1056 | }
|
1057 | function isSlotOutlet(node) {
|
1058 | return node.type === 1 && node.tagType === 2 ;
|
1059 | }
|
1060 | function injectProp(node, prop, context) {
|
1061 | let propsWithInjection;
|
1062 | const props = node.type === 13 ? node.props : node.arguments[2];
|
1063 | if (props == null || isString(props)) {
|
1064 | propsWithInjection = createObjectExpression([prop]);
|
1065 | }
|
1066 | else if (props.type === 14 ) {
|
1067 |
|
1068 |
|
1069 |
|
1070 | const first = props.arguments[0];
|
1071 | if (!isString(first) && first.type === 15 ) {
|
1072 | first.properties.unshift(prop);
|
1073 | }
|
1074 | else {
|
1075 | if (props.callee === TO_HANDLERS) {
|
1076 |
|
1077 | propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
|
1078 | createObjectExpression([prop]),
|
1079 | props
|
1080 | ]);
|
1081 | }
|
1082 | else {
|
1083 | props.arguments.unshift(createObjectExpression([prop]));
|
1084 | }
|
1085 | }
|
1086 | !propsWithInjection && (propsWithInjection = props);
|
1087 | }
|
1088 | else if (props.type === 15 ) {
|
1089 | let alreadyExists = false;
|
1090 |
|
1091 | if (prop.key.type === 4 ) {
|
1092 | const propKeyName = prop.key.content;
|
1093 | alreadyExists = props.properties.some(p => p.key.type === 4 &&
|
1094 | p.key.content === propKeyName);
|
1095 | }
|
1096 | if (!alreadyExists) {
|
1097 | props.properties.unshift(prop);
|
1098 | }
|
1099 | propsWithInjection = props;
|
1100 | }
|
1101 | else {
|
1102 |
|
1103 | propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
|
1104 | createObjectExpression([prop]),
|
1105 | props
|
1106 | ]);
|
1107 | }
|
1108 | if (node.type === 13 ) {
|
1109 | node.props = propsWithInjection;
|
1110 | }
|
1111 | else {
|
1112 | node.arguments[2] = propsWithInjection;
|
1113 | }
|
1114 | }
|
1115 | function toValidAssetId(name, type) {
|
1116 | return `_${type}_${name.replace(/[^\w]/g, '_')}`;
|
1117 | }
|
1118 |
|
1119 | function hasScopeRef(node, ids) {
|
1120 | if (!node || Object.keys(ids).length === 0) {
|
1121 | return false;
|
1122 | }
|
1123 | switch (node.type) {
|
1124 | case 1 :
|
1125 | for (let i = 0; i < node.props.length; i++) {
|
1126 | const p = node.props[i];
|
1127 | if (p.type === 7 &&
|
1128 | (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
|
1129 | return true;
|
1130 | }
|
1131 | }
|
1132 | return node.children.some(c => hasScopeRef(c, ids));
|
1133 | case 11 :
|
1134 | if (hasScopeRef(node.source, ids)) {
|
1135 | return true;
|
1136 | }
|
1137 | return node.children.some(c => hasScopeRef(c, ids));
|
1138 | case 9 :
|
1139 | return node.branches.some(b => hasScopeRef(b, ids));
|
1140 | case 10 :
|
1141 | if (hasScopeRef(node.condition, ids)) {
|
1142 | return true;
|
1143 | }
|
1144 | return node.children.some(c => hasScopeRef(c, ids));
|
1145 | case 4 :
|
1146 | return (!node.isStatic &&
|
1147 | isSimpleIdentifier(node.content) &&
|
1148 | !!ids[node.content]);
|
1149 | case 8 :
|
1150 | return node.children.some(c => isObject(c) && hasScopeRef(c, ids));
|
1151 | case 5 :
|
1152 | case 12 :
|
1153 | return hasScopeRef(node.content, ids);
|
1154 | case 2 :
|
1155 | case 3 :
|
1156 | return false;
|
1157 | default:
|
1158 | if ((process.env.NODE_ENV !== 'production')) ;
|
1159 | return false;
|
1160 | }
|
1161 | }
|
1162 |
|
1163 | const deprecationData = {
|
1164 | ["COMPILER_IS_ON_ELEMENT" ]: {
|
1165 | message: `Platform-native elements with "is" prop will no longer be ` +
|
1166 | `treated as components in Vue 3 unless the "is" value is explicitly ` +
|
1167 | `prefixed with "vue:".`,
|
1168 | link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`
|
1169 | },
|
1170 | ["COMPILER_V_BIND_SYNC" ]: {
|
1171 | message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +
|
1172 | `argument instead. \`v-bind:${key}.sync\` should be changed to ` +
|
1173 | `\`v-model:${key}\`.`,
|
1174 | link: `https://v3.vuejs.org/guide/migration/v-model.html`
|
1175 | },
|
1176 | ["COMPILER_V_BIND_PROP" ]: {
|
1177 | message: `.prop modifier for v-bind has been removed and no longer necessary. ` +
|
1178 | `Vue 3 will automatically set a binding as DOM property when appropriate.`
|
1179 | },
|
1180 | ["COMPILER_V_BIND_OBJECT_ORDER" ]: {
|
1181 | message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript ` +
|
1182 | `object spread: it will now overwrite an existing non-mergeable attribute ` +
|
1183 | `that appears before v-bind in the case of conflict. ` +
|
1184 | `To retain 2.x behavior, move v-bind to make it the first attribute. ` +
|
1185 | `You can also suppress this warning if the usage is intended.`,
|
1186 | link: `https://v3.vuejs.org/guide/migration/v-bind.html`
|
1187 | },
|
1188 | ["COMPILER_V_ON_NATIVE" ]: {
|
1189 | message: `.native modifier for v-on has been removed as is no longer necessary.`,
|
1190 | link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`
|
1191 | },
|
1192 | ["COMPILER_V_IF_V_FOR_PRECEDENCE" ]: {
|
1193 | message: `v-if / v-for precedence when used on the same element has changed ` +
|
1194 | `in Vue 3: v-if now takes higher precedence and will no longer have ` +
|
1195 | `access to v-for scope variables. It is best to avoid the ambiguity ` +
|
1196 | `with <template> tags or use a computed property that filters v-for ` +
|
1197 | `data source.`,
|
1198 | link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`
|
1199 | },
|
1200 | ["COMPILER_V_FOR_REF" ]: {
|
1201 | message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
|
1202 | `Consider using function refs or refactor to avoid ref usage altogether.`,
|
1203 | link: `https://v3.vuejs.org/guide/migration/array-refs.html`
|
1204 | },
|
1205 | ["COMPILER_NATIVE_TEMPLATE" ]: {
|
1206 | message: `<template> with no special directives will render as a native template ` +
|
1207 | `element instead of its inner content in Vue 3.`
|
1208 | },
|
1209 | ["COMPILER_INLINE_TEMPLATE" ]: {
|
1210 | message: `"inline-template" has been removed in Vue 3.`,
|
1211 | link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`
|
1212 | },
|
1213 | ["COMPILER_FILTER" ]: {
|
1214 | message: `filters have been removed in Vue 3. ` +
|
1215 | `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
|
1216 | `Use method calls or computed properties instead.`,
|
1217 | link: `https://v3.vuejs.org/guide/migration/filters.html`
|
1218 | }
|
1219 | };
|
1220 | function getCompatValue(key, context) {
|
1221 | const config = context.options
|
1222 | ? context.options.compatConfig
|
1223 | : context.compatConfig;
|
1224 | const value = config && config[key];
|
1225 | if (key === 'MODE') {
|
1226 | return value || 3;
|
1227 | }
|
1228 | else {
|
1229 | return value;
|
1230 | }
|
1231 | }
|
1232 | function isCompatEnabled(key, context) {
|
1233 | const mode = getCompatValue('MODE', context);
|
1234 | const value = getCompatValue(key, context);
|
1235 |
|
1236 |
|
1237 | return mode === 3 ? value === true : value !== false;
|
1238 | }
|
1239 | function checkCompatEnabled(key, context, loc, ...args) {
|
1240 | const enabled = isCompatEnabled(key, context);
|
1241 | if ((process.env.NODE_ENV !== 'production') && enabled) {
|
1242 | warnDeprecation(key, context, loc, ...args);
|
1243 | }
|
1244 | return enabled;
|
1245 | }
|
1246 | function warnDeprecation(key, context, loc, ...args) {
|
1247 | const val = getCompatValue(key, context);
|
1248 | if (val === 'suppress-warning') {
|
1249 | return;
|
1250 | }
|
1251 | const { message, link } = deprecationData[key];
|
1252 | const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
|
1253 | const err = new SyntaxError(msg);
|
1254 | err.code = key;
|
1255 | if (loc)
|
1256 | err.loc = loc;
|
1257 | context.onWarn(err);
|
1258 | }
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 | const decodeRE = /&(gt|lt|amp|apos|quot);/g;
|
1264 | const decodeMap = {
|
1265 | gt: '>',
|
1266 | lt: '<',
|
1267 | amp: '&',
|
1268 | apos: "'",
|
1269 | quot: '"'
|
1270 | };
|
1271 | const defaultParserOptions = {
|
1272 | delimiters: [`{{`, `}}`],
|
1273 | getNamespace: () => 0 ,
|
1274 | getTextMode: () => 0 ,
|
1275 | isVoidTag: NO,
|
1276 | isPreTag: NO,
|
1277 | isCustomElement: NO,
|
1278 | decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),
|
1279 | onError: defaultOnError,
|
1280 | onWarn: defaultOnWarn,
|
1281 | comments: false
|
1282 | };
|
1283 | function baseParse(content, options = {}) {
|
1284 | const context = createParserContext(content, options);
|
1285 | const start = getCursor(context);
|
1286 | return createRoot(parseChildren(context, 0 , []), getSelection(context, start));
|
1287 | }
|
1288 | function createParserContext(content, rawOptions) {
|
1289 | const options = extend({}, defaultParserOptions);
|
1290 | for (const key in rawOptions) {
|
1291 |
|
1292 | options[key] = rawOptions[key] || defaultParserOptions[key];
|
1293 | }
|
1294 | return {
|
1295 | options,
|
1296 | column: 1,
|
1297 | line: 1,
|
1298 | offset: 0,
|
1299 | originalSource: content,
|
1300 | source: content,
|
1301 | inPre: false,
|
1302 | inVPre: false,
|
1303 | onWarn: options.onWarn
|
1304 | };
|
1305 | }
|
1306 | function parseChildren(context, mode, ancestors) {
|
1307 | const parent = last(ancestors);
|
1308 | const ns = parent ? parent.ns : 0 ;
|
1309 | const nodes = [];
|
1310 | while (!isEnd(context, mode, ancestors)) {
|
1311 | const s = context.source;
|
1312 | let node = undefined;
|
1313 | if (mode === 0 || mode === 1 ) {
|
1314 | if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
|
1315 |
|
1316 | node = parseInterpolation(context, mode);
|
1317 | }
|
1318 | else if (mode === 0 && s[0] === '<') {
|
1319 |
|
1320 | if (s.length === 1) {
|
1321 | emitError(context, 5 , 1);
|
1322 | }
|
1323 | else if (s[1] === '!') {
|
1324 |
|
1325 | if (startsWith(s, '<!--')) {
|
1326 | node = parseComment(context);
|
1327 | }
|
1328 | else if (startsWith(s, '<!DOCTYPE')) {
|
1329 |
|
1330 | node = parseBogusComment(context);
|
1331 | }
|
1332 | else if (startsWith(s, '<![CDATA[')) {
|
1333 | if (ns !== 0 ) {
|
1334 | node = parseCDATA(context, ancestors);
|
1335 | }
|
1336 | else {
|
1337 | emitError(context, 1 );
|
1338 | node = parseBogusComment(context);
|
1339 | }
|
1340 | }
|
1341 | else {
|
1342 | emitError(context, 11 );
|
1343 | node = parseBogusComment(context);
|
1344 | }
|
1345 | }
|
1346 | else if (s[1] === '/') {
|
1347 |
|
1348 | if (s.length === 2) {
|
1349 | emitError(context, 5 , 2);
|
1350 | }
|
1351 | else if (s[2] === '>') {
|
1352 | emitError(context, 14 , 2);
|
1353 | advanceBy(context, 3);
|
1354 | continue;
|
1355 | }
|
1356 | else if (/[a-z]/i.test(s[2])) {
|
1357 | emitError(context, 23 );
|
1358 | parseTag(context, 1 , parent);
|
1359 | continue;
|
1360 | }
|
1361 | else {
|
1362 | emitError(context, 12 , 2);
|
1363 | node = parseBogusComment(context);
|
1364 | }
|
1365 | }
|
1366 | else if (/[a-z]/i.test(s[1])) {
|
1367 | node = parseElement(context, ancestors);
|
1368 |
|
1369 | if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" , context) &&
|
1370 | node &&
|
1371 | node.tag === 'template' &&
|
1372 | !node.props.some(p => p.type === 7 &&
|
1373 | isSpecialTemplateDirective(p.name))) {
|
1374 | (process.env.NODE_ENV !== 'production') &&
|
1375 | warnDeprecation("COMPILER_NATIVE_TEMPLATE" , context, node.loc);
|
1376 | node = node.children;
|
1377 | }
|
1378 | }
|
1379 | else if (s[1] === '?') {
|
1380 | emitError(context, 21 , 1);
|
1381 | node = parseBogusComment(context);
|
1382 | }
|
1383 | else {
|
1384 | emitError(context, 12 , 1);
|
1385 | }
|
1386 | }
|
1387 | }
|
1388 | if (!node) {
|
1389 | node = parseText(context, mode);
|
1390 | }
|
1391 | if (isArray(node)) {
|
1392 | for (let i = 0; i < node.length; i++) {
|
1393 | pushNode(nodes, node[i]);
|
1394 | }
|
1395 | }
|
1396 | else {
|
1397 | pushNode(nodes, node);
|
1398 | }
|
1399 | }
|
1400 |
|
1401 | let removedWhitespace = false;
|
1402 | if (mode !== 2 && mode !== 1 ) {
|
1403 | const preserve = context.options.whitespace === 'preserve';
|
1404 | for (let i = 0; i < nodes.length; i++) {
|
1405 | const node = nodes[i];
|
1406 | if (!context.inPre && node.type === 2 ) {
|
1407 | if (!/[^\t\r\n\f ]/.test(node.content)) {
|
1408 | const prev = nodes[i - 1];
|
1409 | const next = nodes[i + 1];
|
1410 |
|
1411 |
|
1412 |
|
1413 |
|
1414 | if (!prev ||
|
1415 | !next ||
|
1416 | (!preserve &&
|
1417 | (prev.type === 3 ||
|
1418 | next.type === 3 ||
|
1419 | (prev.type === 1 &&
|
1420 | next.type === 1 &&
|
1421 | /[\r\n]/.test(node.content))))) {
|
1422 | removedWhitespace = true;
|
1423 | nodes[i] = null;
|
1424 | }
|
1425 | else {
|
1426 |
|
1427 | node.content = ' ';
|
1428 | }
|
1429 | }
|
1430 | else if (!preserve) {
|
1431 |
|
1432 |
|
1433 | node.content = node.content.replace(/[\t\r\n\f ]+/g, ' ');
|
1434 | }
|
1435 | }
|
1436 |
|
1437 | if (!(process.env.NODE_ENV !== 'production') &&
|
1438 | node.type === 3 &&
|
1439 | !context.options.comments) {
|
1440 | removedWhitespace = true;
|
1441 | nodes[i] = null;
|
1442 | }
|
1443 | }
|
1444 | if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
|
1445 |
|
1446 |
|
1447 | const first = nodes[0];
|
1448 | if (first && first.type === 2 ) {
|
1449 | first.content = first.content.replace(/^\r?\n/, '');
|
1450 | }
|
1451 | }
|
1452 | }
|
1453 | return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
1454 | }
|
1455 | function pushNode(nodes, node) {
|
1456 | if (node.type === 2 ) {
|
1457 | const prev = last(nodes);
|
1458 |
|
1459 |
|
1460 | if (prev &&
|
1461 | prev.type === 2 &&
|
1462 | prev.loc.end.offset === node.loc.start.offset) {
|
1463 | prev.content += node.content;
|
1464 | prev.loc.end = node.loc.end;
|
1465 | prev.loc.source += node.loc.source;
|
1466 | return;
|
1467 | }
|
1468 | }
|
1469 | nodes.push(node);
|
1470 | }
|
1471 | function parseCDATA(context, ancestors) {
|
1472 | advanceBy(context, 9);
|
1473 | const nodes = parseChildren(context, 3 , ancestors);
|
1474 | if (context.source.length === 0) {
|
1475 | emitError(context, 6 );
|
1476 | }
|
1477 | else {
|
1478 | advanceBy(context, 3);
|
1479 | }
|
1480 | return nodes;
|
1481 | }
|
1482 | function parseComment(context) {
|
1483 | const start = getCursor(context);
|
1484 | let content;
|
1485 |
|
1486 | const match = /--(\!)?>/.exec(context.source);
|
1487 | if (!match) {
|
1488 | content = context.source.slice(4);
|
1489 | advanceBy(context, context.source.length);
|
1490 | emitError(context, 7 );
|
1491 | }
|
1492 | else {
|
1493 | if (match.index <= 3) {
|
1494 | emitError(context, 0 );
|
1495 | }
|
1496 | if (match[1]) {
|
1497 | emitError(context, 10 );
|
1498 | }
|
1499 | content = context.source.slice(4, match.index);
|
1500 |
|
1501 | const s = context.source.slice(0, match.index);
|
1502 | let prevIndex = 1, nestedIndex = 0;
|
1503 | while ((nestedIndex = s.indexOf('<!--', prevIndex)) !== -1) {
|
1504 | advanceBy(context, nestedIndex - prevIndex + 1);
|
1505 | if (nestedIndex + 4 < s.length) {
|
1506 | emitError(context, 16 );
|
1507 | }
|
1508 | prevIndex = nestedIndex + 1;
|
1509 | }
|
1510 | advanceBy(context, match.index + match[0].length - prevIndex + 1);
|
1511 | }
|
1512 | return {
|
1513 | type: 3 ,
|
1514 | content,
|
1515 | loc: getSelection(context, start)
|
1516 | };
|
1517 | }
|
1518 | function parseBogusComment(context) {
|
1519 | const start = getCursor(context);
|
1520 | const contentStart = context.source[1] === '?' ? 1 : 2;
|
1521 | let content;
|
1522 | const closeIndex = context.source.indexOf('>');
|
1523 | if (closeIndex === -1) {
|
1524 | content = context.source.slice(contentStart);
|
1525 | advanceBy(context, context.source.length);
|
1526 | }
|
1527 | else {
|
1528 | content = context.source.slice(contentStart, closeIndex);
|
1529 | advanceBy(context, closeIndex + 1);
|
1530 | }
|
1531 | return {
|
1532 | type: 3 ,
|
1533 | content,
|
1534 | loc: getSelection(context, start)
|
1535 | };
|
1536 | }
|
1537 | function parseElement(context, ancestors) {
|
1538 |
|
1539 | const wasInPre = context.inPre;
|
1540 | const wasInVPre = context.inVPre;
|
1541 | const parent = last(ancestors);
|
1542 | const element = parseTag(context, 0 , parent);
|
1543 | const isPreBoundary = context.inPre && !wasInPre;
|
1544 | const isVPreBoundary = context.inVPre && !wasInVPre;
|
1545 | if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
|
1546 |
|
1547 | if (context.options.isPreTag(element.tag)) {
|
1548 | context.inPre = false;
|
1549 | }
|
1550 | return element;
|
1551 | }
|
1552 |
|
1553 | ancestors.push(element);
|
1554 | const mode = context.options.getTextMode(element, parent);
|
1555 | const children = parseChildren(context, mode, ancestors);
|
1556 | ancestors.pop();
|
1557 |
|
1558 | {
|
1559 | const inlineTemplateProp = element.props.find(p => p.type === 6 && p.name === 'inline-template');
|
1560 | if (inlineTemplateProp &&
|
1561 | checkCompatEnabled("COMPILER_INLINE_TEMPLATE" , context, inlineTemplateProp.loc)) {
|
1562 | const loc = getSelection(context, element.loc.end);
|
1563 | inlineTemplateProp.value = {
|
1564 | type: 2 ,
|
1565 | content: loc.source,
|
1566 | loc
|
1567 | };
|
1568 | }
|
1569 | }
|
1570 | element.children = children;
|
1571 |
|
1572 | if (startsWithEndTagOpen(context.source, element.tag)) {
|
1573 | parseTag(context, 1 , parent);
|
1574 | }
|
1575 | else {
|
1576 | emitError(context, 24 , 0, element.loc.start);
|
1577 | if (context.source.length === 0 && element.tag.toLowerCase() === 'script') {
|
1578 | const first = children[0];
|
1579 | if (first && startsWith(first.loc.source, '<!--')) {
|
1580 | emitError(context, 8 );
|
1581 | }
|
1582 | }
|
1583 | }
|
1584 | element.loc = getSelection(context, element.loc.start);
|
1585 | if (isPreBoundary) {
|
1586 | context.inPre = false;
|
1587 | }
|
1588 | if (isVPreBoundary) {
|
1589 | context.inVPre = false;
|
1590 | }
|
1591 | return element;
|
1592 | }
|
1593 | const isSpecialTemplateDirective = makeMap(`if,else,else-if,for,slot`);
|
1594 | function parseTag(context, type, parent) {
|
1595 |
|
1596 | const start = getCursor(context);
|
1597 | const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
|
1598 | const tag = match[1];
|
1599 | const ns = context.options.getNamespace(tag, parent);
|
1600 | advanceBy(context, match[0].length);
|
1601 | advanceSpaces(context);
|
1602 |
|
1603 | const cursor = getCursor(context);
|
1604 | const currentSource = context.source;
|
1605 |
|
1606 | const isPreTag = context.options.isPreTag(tag);
|
1607 | if (isPreTag) {
|
1608 | context.inPre = true;
|
1609 | }
|
1610 |
|
1611 | let props = parseAttributes(context, type);
|
1612 |
|
1613 | if (type === 0 &&
|
1614 | !context.inVPre &&
|
1615 | props.some(p => p.type === 7 && p.name === 'pre')) {
|
1616 | context.inVPre = true;
|
1617 |
|
1618 | extend(context, cursor);
|
1619 | context.source = currentSource;
|
1620 |
|
1621 | props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');
|
1622 | }
|
1623 |
|
1624 | let isSelfClosing = false;
|
1625 | if (context.source.length === 0) {
|
1626 | emitError(context, 9 );
|
1627 | }
|
1628 | else {
|
1629 | isSelfClosing = startsWith(context.source, '/>');
|
1630 | if (type === 1 && isSelfClosing) {
|
1631 | emitError(context, 4 );
|
1632 | }
|
1633 | advanceBy(context, isSelfClosing ? 2 : 1);
|
1634 | }
|
1635 | if (type === 1 ) {
|
1636 | return;
|
1637 | }
|
1638 |
|
1639 | if ((process.env.NODE_ENV !== 'production') &&
|
1640 | isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" , context)) {
|
1641 | let hasIf = false;
|
1642 | let hasFor = false;
|
1643 | for (let i = 0; i < props.length; i++) {
|
1644 | const p = props[i];
|
1645 | if (p.type === 7 ) {
|
1646 | if (p.name === 'if') {
|
1647 | hasIf = true;
|
1648 | }
|
1649 | else if (p.name === 'for') {
|
1650 | hasFor = true;
|
1651 | }
|
1652 | }
|
1653 | if (hasIf && hasFor) {
|
1654 | warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" , context, getSelection(context, start));
|
1655 | }
|
1656 | }
|
1657 | }
|
1658 | let tagType = 0 ;
|
1659 | if (!context.inVPre) {
|
1660 | if (tag === 'slot') {
|
1661 | tagType = 2 ;
|
1662 | }
|
1663 | else if (tag === 'template') {
|
1664 | if (props.some(p => p.type === 7 && isSpecialTemplateDirective(p.name))) {
|
1665 | tagType = 3 ;
|
1666 | }
|
1667 | }
|
1668 | else if (isComponent(tag, props, context)) {
|
1669 | tagType = 1 ;
|
1670 | }
|
1671 | }
|
1672 | return {
|
1673 | type: 1 ,
|
1674 | ns,
|
1675 | tag,
|
1676 | tagType,
|
1677 | props,
|
1678 | isSelfClosing,
|
1679 | children: [],
|
1680 | loc: getSelection(context, start),
|
1681 | codegenNode: undefined
|
1682 | };
|
1683 | }
|
1684 | function isComponent(tag, props, context) {
|
1685 | const options = context.options;
|
1686 | if (options.isCustomElement(tag)) {
|
1687 | return false;
|
1688 | }
|
1689 | if (tag === 'component' ||
|
1690 | /^[A-Z]/.test(tag) ||
|
1691 | isCoreComponent(tag) ||
|
1692 | (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||
|
1693 | (options.isNativeTag && !options.isNativeTag(tag))) {
|
1694 | return true;
|
1695 | }
|
1696 |
|
1697 |
|
1698 | for (let i = 0; i < props.length; i++) {
|
1699 | const p = props[i];
|
1700 | if (p.type === 6 ) {
|
1701 | if (p.name === 'is' && p.value) {
|
1702 | if (p.value.content.startsWith('vue:')) {
|
1703 | return true;
|
1704 | }
|
1705 | else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" , context, p.loc)) {
|
1706 | return true;
|
1707 | }
|
1708 | }
|
1709 | }
|
1710 | else {
|
1711 |
|
1712 |
|
1713 | if (p.name === 'is') {
|
1714 | return true;
|
1715 | }
|
1716 | else if (
|
1717 |
|
1718 | p.name === 'bind' &&
|
1719 | isBindKey(p.arg, 'is') &&
|
1720 | true &&
|
1721 | checkCompatEnabled("COMPILER_IS_ON_ELEMENT" , context, p.loc)) {
|
1722 | return true;
|
1723 | }
|
1724 | }
|
1725 | }
|
1726 | }
|
1727 | function parseAttributes(context, type) {
|
1728 | const props = [];
|
1729 | const attributeNames = new Set();
|
1730 | while (context.source.length > 0 &&
|
1731 | !startsWith(context.source, '>') &&
|
1732 | !startsWith(context.source, '/>')) {
|
1733 | if (startsWith(context.source, '/')) {
|
1734 | emitError(context, 22 );
|
1735 | advanceBy(context, 1);
|
1736 | advanceSpaces(context);
|
1737 | continue;
|
1738 | }
|
1739 | if (type === 1 ) {
|
1740 | emitError(context, 3 );
|
1741 | }
|
1742 | const attr = parseAttribute(context, attributeNames);
|
1743 | if (type === 0 ) {
|
1744 | props.push(attr);
|
1745 | }
|
1746 | if (/^[^\t\r\n\f />]/.test(context.source)) {
|
1747 | emitError(context, 15 );
|
1748 | }
|
1749 | advanceSpaces(context);
|
1750 | }
|
1751 | return props;
|
1752 | }
|
1753 | function parseAttribute(context, nameSet) {
|
1754 |
|
1755 | const start = getCursor(context);
|
1756 | const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
|
1757 | const name = match[0];
|
1758 | if (nameSet.has(name)) {
|
1759 | emitError(context, 2 );
|
1760 | }
|
1761 | nameSet.add(name);
|
1762 | if (name[0] === '=') {
|
1763 | emitError(context, 19 );
|
1764 | }
|
1765 | {
|
1766 | const pattern = /["'<]/g;
|
1767 | let m;
|
1768 | while ((m = pattern.exec(name))) {
|
1769 | emitError(context, 17 , m.index);
|
1770 | }
|
1771 | }
|
1772 | advanceBy(context, name.length);
|
1773 |
|
1774 | let value = undefined;
|
1775 | if (/^[\t\r\n\f ]*=/.test(context.source)) {
|
1776 | advanceSpaces(context);
|
1777 | advanceBy(context, 1);
|
1778 | advanceSpaces(context);
|
1779 | value = parseAttributeValue(context);
|
1780 | if (!value) {
|
1781 | emitError(context, 13 );
|
1782 | }
|
1783 | }
|
1784 | const loc = getSelection(context, start);
|
1785 | if (!context.inVPre && /^(v-|:|@|#)/.test(name)) {
|
1786 | const match = /(?:^v-([a-z0-9-]+))?(?:(?::|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(name);
|
1787 | let dirName = match[1] ||
|
1788 | (startsWith(name, ':') ? 'bind' : startsWith(name, '@') ? 'on' : 'slot');
|
1789 | let arg;
|
1790 | if (match[2]) {
|
1791 | const isSlot = dirName === 'slot';
|
1792 | const startOffset = name.lastIndexOf(match[2]);
|
1793 | const loc = getSelection(context, getNewPosition(context, start, startOffset), getNewPosition(context, start, startOffset + match[2].length + ((isSlot && match[3]) || '').length));
|
1794 | let content = match[2];
|
1795 | let isStatic = true;
|
1796 | if (content.startsWith('[')) {
|
1797 | isStatic = false;
|
1798 | if (!content.endsWith(']')) {
|
1799 | emitError(context, 26 );
|
1800 | }
|
1801 | content = content.substr(1, content.length - 2);
|
1802 | }
|
1803 | else if (isSlot) {
|
1804 |
|
1805 |
|
1806 |
|
1807 | content += match[3] || '';
|
1808 | }
|
1809 | arg = {
|
1810 | type: 4 ,
|
1811 | content,
|
1812 | isStatic,
|
1813 | constType: isStatic
|
1814 | ? 3
|
1815 | : 0 ,
|
1816 | loc
|
1817 | };
|
1818 | }
|
1819 | if (value && value.isQuoted) {
|
1820 | const valueLoc = value.loc;
|
1821 | valueLoc.start.offset++;
|
1822 | valueLoc.start.column++;
|
1823 | valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
|
1824 | valueLoc.source = valueLoc.source.slice(1, -1);
|
1825 | }
|
1826 | const modifiers = match[3] ? match[3].substr(1).split('.') : [];
|
1827 |
|
1828 | if (dirName === 'bind' && arg) {
|
1829 | if (modifiers.includes('sync') &&
|
1830 | checkCompatEnabled("COMPILER_V_BIND_SYNC" , context, loc, arg.loc.source)) {
|
1831 | dirName = 'model';
|
1832 | modifiers.splice(modifiers.indexOf('sync'), 1);
|
1833 | }
|
1834 | if ((process.env.NODE_ENV !== 'production') && modifiers.includes('prop')) {
|
1835 | checkCompatEnabled("COMPILER_V_BIND_PROP" , context, loc);
|
1836 | }
|
1837 | }
|
1838 | return {
|
1839 | type: 7 ,
|
1840 | name: dirName,
|
1841 | exp: value && {
|
1842 | type: 4 ,
|
1843 | content: value.content,
|
1844 | isStatic: false,
|
1845 |
|
1846 |
|
1847 | constType: 0 ,
|
1848 | loc: value.loc
|
1849 | },
|
1850 | arg,
|
1851 | modifiers,
|
1852 | loc
|
1853 | };
|
1854 | }
|
1855 | return {
|
1856 | type: 6 ,
|
1857 | name,
|
1858 | value: value && {
|
1859 | type: 2 ,
|
1860 | content: value.content,
|
1861 | loc: value.loc
|
1862 | },
|
1863 | loc
|
1864 | };
|
1865 | }
|
1866 | function parseAttributeValue(context) {
|
1867 | const start = getCursor(context);
|
1868 | let content;
|
1869 | const quote = context.source[0];
|
1870 | const isQuoted = quote === `"` || quote === `'`;
|
1871 | if (isQuoted) {
|
1872 |
|
1873 | advanceBy(context, 1);
|
1874 | const endIndex = context.source.indexOf(quote);
|
1875 | if (endIndex === -1) {
|
1876 | content = parseTextData(context, context.source.length, 4 );
|
1877 | }
|
1878 | else {
|
1879 | content = parseTextData(context, endIndex, 4 );
|
1880 | advanceBy(context, 1);
|
1881 | }
|
1882 | }
|
1883 | else {
|
1884 |
|
1885 | const match = /^[^\t\r\n\f >]+/.exec(context.source);
|
1886 | if (!match) {
|
1887 | return undefined;
|
1888 | }
|
1889 | const unexpectedChars = /["'<=`]/g;
|
1890 | let m;
|
1891 | while ((m = unexpectedChars.exec(match[0]))) {
|
1892 | emitError(context, 18 , m.index);
|
1893 | }
|
1894 | content = parseTextData(context, match[0].length, 4 );
|
1895 | }
|
1896 | return { content, isQuoted, loc: getSelection(context, start) };
|
1897 | }
|
1898 | function parseInterpolation(context, mode) {
|
1899 | const [open, close] = context.options.delimiters;
|
1900 | const closeIndex = context.source.indexOf(close, open.length);
|
1901 | if (closeIndex === -1) {
|
1902 | emitError(context, 25 );
|
1903 | return undefined;
|
1904 | }
|
1905 | const start = getCursor(context);
|
1906 | advanceBy(context, open.length);
|
1907 | const innerStart = getCursor(context);
|
1908 | const innerEnd = getCursor(context);
|
1909 | const rawContentLength = closeIndex - open.length;
|
1910 | const rawContent = context.source.slice(0, rawContentLength);
|
1911 | const preTrimContent = parseTextData(context, rawContentLength, mode);
|
1912 | const content = preTrimContent.trim();
|
1913 | const startOffset = preTrimContent.indexOf(content);
|
1914 | if (startOffset > 0) {
|
1915 | advancePositionWithMutation(innerStart, rawContent, startOffset);
|
1916 | }
|
1917 | const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);
|
1918 | advancePositionWithMutation(innerEnd, rawContent, endOffset);
|
1919 | advanceBy(context, close.length);
|
1920 | return {
|
1921 | type: 5 ,
|
1922 | content: {
|
1923 | type: 4 ,
|
1924 | isStatic: false,
|
1925 |
|
1926 | constType: 0 ,
|
1927 | content,
|
1928 | loc: getSelection(context, innerStart, innerEnd)
|
1929 | },
|
1930 | loc: getSelection(context, start)
|
1931 | };
|
1932 | }
|
1933 | function parseText(context, mode) {
|
1934 | const endTokens = ['<', context.options.delimiters[0]];
|
1935 | if (mode === 3 ) {
|
1936 | endTokens.push(']]>');
|
1937 | }
|
1938 | let endIndex = context.source.length;
|
1939 | for (let i = 0; i < endTokens.length; i++) {
|
1940 | const index = context.source.indexOf(endTokens[i], 1);
|
1941 | if (index !== -1 && endIndex > index) {
|
1942 | endIndex = index;
|
1943 | }
|
1944 | }
|
1945 | const start = getCursor(context);
|
1946 | const content = parseTextData(context, endIndex, mode);
|
1947 | return {
|
1948 | type: 2 ,
|
1949 | content,
|
1950 | loc: getSelection(context, start)
|
1951 | };
|
1952 | }
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 | function parseTextData(context, length, mode) {
|
1958 | const rawText = context.source.slice(0, length);
|
1959 | advanceBy(context, length);
|
1960 | if (mode === 2 ||
|
1961 | mode === 3 ||
|
1962 | rawText.indexOf('&') === -1) {
|
1963 | return rawText;
|
1964 | }
|
1965 | else {
|
1966 |
|
1967 | return context.options.decodeEntities(rawText, mode === 4 );
|
1968 | }
|
1969 | }
|
1970 | function getCursor(context) {
|
1971 | const { column, line, offset } = context;
|
1972 | return { column, line, offset };
|
1973 | }
|
1974 | function getSelection(context, start, end) {
|
1975 | end = end || getCursor(context);
|
1976 | return {
|
1977 | start,
|
1978 | end,
|
1979 | source: context.originalSource.slice(start.offset, end.offset)
|
1980 | };
|
1981 | }
|
1982 | function last(xs) {
|
1983 | return xs[xs.length - 1];
|
1984 | }
|
1985 | function startsWith(source, searchString) {
|
1986 | return source.startsWith(searchString);
|
1987 | }
|
1988 | function advanceBy(context, numberOfCharacters) {
|
1989 | const { source } = context;
|
1990 | advancePositionWithMutation(context, source, numberOfCharacters);
|
1991 | context.source = source.slice(numberOfCharacters);
|
1992 | }
|
1993 | function advanceSpaces(context) {
|
1994 | const match = /^[\t\r\n\f ]+/.exec(context.source);
|
1995 | if (match) {
|
1996 | advanceBy(context, match[0].length);
|
1997 | }
|
1998 | }
|
1999 | function getNewPosition(context, start, numberOfCharacters) {
|
2000 | return advancePositionWithClone(start, context.originalSource.slice(start.offset, numberOfCharacters), numberOfCharacters);
|
2001 | }
|
2002 | function emitError(context, code, offset, loc = getCursor(context)) {
|
2003 | if (offset) {
|
2004 | loc.offset += offset;
|
2005 | loc.column += offset;
|
2006 | }
|
2007 | context.options.onError(createCompilerError(code, {
|
2008 | start: loc,
|
2009 | end: loc,
|
2010 | source: ''
|
2011 | }));
|
2012 | }
|
2013 | function isEnd(context, mode, ancestors) {
|
2014 | const s = context.source;
|
2015 | switch (mode) {
|
2016 | case 0 :
|
2017 | if (startsWith(s, '</')) {
|
2018 |
|
2019 | for (let i = ancestors.length - 1; i >= 0; --i) {
|
2020 | if (startsWithEndTagOpen(s, ancestors[i].tag)) {
|
2021 | return true;
|
2022 | }
|
2023 | }
|
2024 | }
|
2025 | break;
|
2026 | case 1 :
|
2027 | case 2 : {
|
2028 | const parent = last(ancestors);
|
2029 | if (parent && startsWithEndTagOpen(s, parent.tag)) {
|
2030 | return true;
|
2031 | }
|
2032 | break;
|
2033 | }
|
2034 | case 3 :
|
2035 | if (startsWith(s, ']]>')) {
|
2036 | return true;
|
2037 | }
|
2038 | break;
|
2039 | }
|
2040 | return !s;
|
2041 | }
|
2042 | function startsWithEndTagOpen(source, tag) {
|
2043 | return (startsWith(source, '</') &&
|
2044 | source.substr(2, tag.length).toLowerCase() === tag.toLowerCase() &&
|
2045 | /[\t\r\n\f />]/.test(source[2 + tag.length] || '>'));
|
2046 | }
|
2047 |
|
2048 | function hoistStatic(root, context) {
|
2049 | walk(root, context,
|
2050 |
|
2051 |
|
2052 | isSingleElementRoot(root, root.children[0]));
|
2053 | }
|
2054 | function isSingleElementRoot(root, child) {
|
2055 | const { children } = root;
|
2056 | return (children.length === 1 &&
|
2057 | child.type === 1 &&
|
2058 | !isSlotOutlet(child));
|
2059 | }
|
2060 | function walk(node, context, doNotHoistNode = false) {
|
2061 | let hasHoistedNode = false;
|
2062 |
|
2063 |
|
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 | let canStringify = true;
|
2071 | const { children } = node;
|
2072 | for (let i = 0; i < children.length; i++) {
|
2073 | const child = children[i];
|
2074 |
|
2075 | if (child.type === 1 &&
|
2076 | child.tagType === 0 ) {
|
2077 | const constantType = doNotHoistNode
|
2078 | ? 0
|
2079 | : getConstantType(child, context);
|
2080 | if (constantType > 0 ) {
|
2081 | if (constantType < 3 ) {
|
2082 | canStringify = false;
|
2083 | }
|
2084 | if (constantType >= 2 ) {
|
2085 | child.codegenNode.patchFlag =
|
2086 | -1 + ((process.env.NODE_ENV !== 'production') ? ` /* HOISTED */` : ``);
|
2087 | child.codegenNode = context.hoist(child.codegenNode);
|
2088 | hasHoistedNode = true;
|
2089 | continue;
|
2090 | }
|
2091 | }
|
2092 | else {
|
2093 |
|
2094 |
|
2095 | const codegenNode = child.codegenNode;
|
2096 | if (codegenNode.type === 13 ) {
|
2097 | const flag = getPatchFlag(codegenNode);
|
2098 | if ((!flag ||
|
2099 | flag === 512 ||
|
2100 | flag === 1 ) &&
|
2101 | getGeneratedPropsConstantType(child, context) >=
|
2102 | 2 ) {
|
2103 | const props = getNodeProps(child);
|
2104 | if (props) {
|
2105 | codegenNode.props = context.hoist(props);
|
2106 | }
|
2107 | }
|
2108 | }
|
2109 | }
|
2110 | }
|
2111 | else if (child.type === 12 ) {
|
2112 | const contentType = getConstantType(child.content, context);
|
2113 | if (contentType > 0) {
|
2114 | if (contentType < 3 ) {
|
2115 | canStringify = false;
|
2116 | }
|
2117 | if (contentType >= 2 ) {
|
2118 | child.codegenNode = context.hoist(child.codegenNode);
|
2119 | hasHoistedNode = true;
|
2120 | }
|
2121 | }
|
2122 | }
|
2123 |
|
2124 | if (child.type === 1 ) {
|
2125 | const isComponent = child.tagType === 1 ;
|
2126 | if (isComponent) {
|
2127 | context.scopes.vSlot++;
|
2128 | }
|
2129 | walk(child, context);
|
2130 | if (isComponent) {
|
2131 | context.scopes.vSlot--;
|
2132 | }
|
2133 | }
|
2134 | else if (child.type === 11 ) {
|
2135 |
|
2136 | walk(child, context, child.children.length === 1);
|
2137 | }
|
2138 | else if (child.type === 9 ) {
|
2139 | for (let i = 0; i < child.branches.length; i++) {
|
2140 |
|
2141 | walk(child.branches[i], context, child.branches[i].children.length === 1);
|
2142 | }
|
2143 | }
|
2144 | }
|
2145 | if (canStringify && hasHoistedNode && context.transformHoist) {
|
2146 | context.transformHoist(children, context, node);
|
2147 | }
|
2148 | }
|
2149 | function getConstantType(node, context) {
|
2150 | const { constantCache } = context;
|
2151 | switch (node.type) {
|
2152 | case 1 :
|
2153 | if (node.tagType !== 0 ) {
|
2154 | return 0 ;
|
2155 | }
|
2156 | const cached = constantCache.get(node);
|
2157 | if (cached !== undefined) {
|
2158 | return cached;
|
2159 | }
|
2160 | const codegenNode = node.codegenNode;
|
2161 | if (codegenNode.type !== 13 ) {
|
2162 | return 0 ;
|
2163 | }
|
2164 | const flag = getPatchFlag(codegenNode);
|
2165 | if (!flag) {
|
2166 | let returnType = 3 ;
|
2167 |
|
2168 |
|
2169 |
|
2170 |
|
2171 |
|
2172 | const generatedPropsType = getGeneratedPropsConstantType(node, context);
|
2173 | if (generatedPropsType === 0 ) {
|
2174 | constantCache.set(node, 0 );
|
2175 | return 0 ;
|
2176 | }
|
2177 | if (generatedPropsType < returnType) {
|
2178 | returnType = generatedPropsType;
|
2179 | }
|
2180 |
|
2181 | for (let i = 0; i < node.children.length; i++) {
|
2182 | const childType = getConstantType(node.children[i], context);
|
2183 | if (childType === 0 ) {
|
2184 | constantCache.set(node, 0 );
|
2185 | return 0 ;
|
2186 | }
|
2187 | if (childType < returnType) {
|
2188 | returnType = childType;
|
2189 | }
|
2190 | }
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 | if (returnType > 1 ) {
|
2196 | for (let i = 0; i < node.props.length; i++) {
|
2197 | const p = node.props[i];
|
2198 | if (p.type === 7 && p.name === 'bind' && p.exp) {
|
2199 | const expType = getConstantType(p.exp, context);
|
2200 | if (expType === 0 ) {
|
2201 | constantCache.set(node, 0 );
|
2202 | return 0 ;
|
2203 | }
|
2204 | if (expType < returnType) {
|
2205 | returnType = expType;
|
2206 | }
|
2207 | }
|
2208 | }
|
2209 | }
|
2210 |
|
2211 |
|
2212 |
|
2213 | if (codegenNode.isBlock) {
|
2214 | context.removeHelper(OPEN_BLOCK);
|
2215 | context.removeHelper(CREATE_BLOCK);
|
2216 | codegenNode.isBlock = false;
|
2217 | context.helper(CREATE_VNODE);
|
2218 | }
|
2219 | constantCache.set(node, returnType);
|
2220 | return returnType;
|
2221 | }
|
2222 | else {
|
2223 | constantCache.set(node, 0 );
|
2224 | return 0 ;
|
2225 | }
|
2226 | case 2 :
|
2227 | case 3 :
|
2228 | return 3 ;
|
2229 | case 9 :
|
2230 | case 11 :
|
2231 | case 10 :
|
2232 | return 0 ;
|
2233 | case 5 :
|
2234 | case 12 :
|
2235 | return getConstantType(node.content, context);
|
2236 | case 4 :
|
2237 | return node.constType;
|
2238 | case 8 :
|
2239 | let returnType = 3 ;
|
2240 | for (let i = 0; i < node.children.length; i++) {
|
2241 | const child = node.children[i];
|
2242 | if (isString(child) || isSymbol(child)) {
|
2243 | continue;
|
2244 | }
|
2245 | const childType = getConstantType(child, context);
|
2246 | if (childType === 0 ) {
|
2247 | return 0 ;
|
2248 | }
|
2249 | else if (childType < returnType) {
|
2250 | returnType = childType;
|
2251 | }
|
2252 | }
|
2253 | return returnType;
|
2254 | default:
|
2255 | if ((process.env.NODE_ENV !== 'production')) ;
|
2256 | return 0 ;
|
2257 | }
|
2258 | }
|
2259 | function getGeneratedPropsConstantType(node, context) {
|
2260 | let returnType = 3 ;
|
2261 | const props = getNodeProps(node);
|
2262 | if (props && props.type === 15 ) {
|
2263 | const { properties } = props;
|
2264 | for (let i = 0; i < properties.length; i++) {
|
2265 | const { key, value } = properties[i];
|
2266 | const keyType = getConstantType(key, context);
|
2267 | if (keyType === 0 ) {
|
2268 | return keyType;
|
2269 | }
|
2270 | if (keyType < returnType) {
|
2271 | returnType = keyType;
|
2272 | }
|
2273 | if (value.type !== 4 ) {
|
2274 | return 0 ;
|
2275 | }
|
2276 | const valueType = getConstantType(value, context);
|
2277 | if (valueType === 0 ) {
|
2278 | return valueType;
|
2279 | }
|
2280 | if (valueType < returnType) {
|
2281 | returnType = valueType;
|
2282 | }
|
2283 | }
|
2284 | }
|
2285 | return returnType;
|
2286 | }
|
2287 | function getNodeProps(node) {
|
2288 | const codegenNode = node.codegenNode;
|
2289 | if (codegenNode.type === 13 ) {
|
2290 | return codegenNode.props;
|
2291 | }
|
2292 | }
|
2293 | function getPatchFlag(node) {
|
2294 | const flag = node.patchFlag;
|
2295 | return flag ? parseInt(flag, 10) : undefined;
|
2296 | }
|
2297 |
|
2298 | function createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
|
2299 | const nameMatch = filename.replace(/\?.*$/, '').match(/([^/\\]+)\.\w+$/);
|
2300 | const context = {
|
2301 |
|
2302 | selfName: nameMatch && capitalize(camelize$1(nameMatch[1])),
|
2303 | prefixIdentifiers,
|
2304 | hoistStatic,
|
2305 | cacheHandlers,
|
2306 | nodeTransforms,
|
2307 | directiveTransforms,
|
2308 | transformHoist,
|
2309 | isBuiltInComponent,
|
2310 | isCustomElement,
|
2311 | expressionPlugins,
|
2312 | scopeId,
|
2313 | slotted,
|
2314 | ssr,
|
2315 | ssrCssVars,
|
2316 | bindingMetadata,
|
2317 | inline,
|
2318 | isTS,
|
2319 | onError,
|
2320 | onWarn,
|
2321 | compatConfig,
|
2322 |
|
2323 | root,
|
2324 | helpers: new Map(),
|
2325 | components: new Set(),
|
2326 | directives: new Set(),
|
2327 | hoists: [],
|
2328 | imports: [],
|
2329 | constantCache: new Map(),
|
2330 | temps: 0,
|
2331 | cached: 0,
|
2332 | identifiers: Object.create(null),
|
2333 | scopes: {
|
2334 | vFor: 0,
|
2335 | vSlot: 0,
|
2336 | vPre: 0,
|
2337 | vOnce: 0
|
2338 | },
|
2339 | parent: null,
|
2340 | currentNode: root,
|
2341 | childIndex: 0,
|
2342 |
|
2343 | helper(name) {
|
2344 | const count = context.helpers.get(name) || 0;
|
2345 | context.helpers.set(name, count + 1);
|
2346 | return name;
|
2347 | },
|
2348 | removeHelper(name) {
|
2349 | const count = context.helpers.get(name);
|
2350 | if (count) {
|
2351 | const currentCount = count - 1;
|
2352 | if (!currentCount) {
|
2353 | context.helpers.delete(name);
|
2354 | }
|
2355 | else {
|
2356 | context.helpers.set(name, currentCount);
|
2357 | }
|
2358 | }
|
2359 | },
|
2360 | helperString(name) {
|
2361 | return `_${helperNameMap[context.helper(name)]}`;
|
2362 | },
|
2363 | replaceNode(node) {
|
2364 |
|
2365 | if ((process.env.NODE_ENV !== 'production')) {
|
2366 | if (!context.currentNode) {
|
2367 | throw new Error(`Node being replaced is already removed.`);
|
2368 | }
|
2369 | if (!context.parent) {
|
2370 | throw new Error(`Cannot replace root node.`);
|
2371 | }
|
2372 | }
|
2373 | context.parent.children[context.childIndex] = context.currentNode = node;
|
2374 | },
|
2375 | removeNode(node) {
|
2376 | if ((process.env.NODE_ENV !== 'production') && !context.parent) {
|
2377 | throw new Error(`Cannot remove root node.`);
|
2378 | }
|
2379 | const list = context.parent.children;
|
2380 | const removalIndex = node
|
2381 | ? list.indexOf(node)
|
2382 | : context.currentNode
|
2383 | ? context.childIndex
|
2384 | : -1;
|
2385 |
|
2386 | if ((process.env.NODE_ENV !== 'production') && removalIndex < 0) {
|
2387 | throw new Error(`node being removed is not a child of current parent`);
|
2388 | }
|
2389 | if (!node || node === context.currentNode) {
|
2390 |
|
2391 | context.currentNode = null;
|
2392 | context.onNodeRemoved();
|
2393 | }
|
2394 | else {
|
2395 |
|
2396 | if (context.childIndex > removalIndex) {
|
2397 | context.childIndex--;
|
2398 | context.onNodeRemoved();
|
2399 | }
|
2400 | }
|
2401 | context.parent.children.splice(removalIndex, 1);
|
2402 | },
|
2403 | onNodeRemoved: () => { },
|
2404 | addIdentifiers(exp) {
|
2405 | },
|
2406 | removeIdentifiers(exp) {
|
2407 | },
|
2408 | hoist(exp) {
|
2409 | context.hoists.push(exp);
|
2410 | const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2 );
|
2411 | identifier.hoisted = exp;
|
2412 | return identifier;
|
2413 | },
|
2414 | cache(exp, isVNode = false) {
|
2415 | return createCacheExpression(++context.cached, exp, isVNode);
|
2416 | }
|
2417 | };
|
2418 | {
|
2419 | context.filters = new Set();
|
2420 | }
|
2421 | return context;
|
2422 | }
|
2423 | function transform(root, options) {
|
2424 | const context = createTransformContext(root, options);
|
2425 | traverseNode(root, context);
|
2426 | if (options.hoistStatic) {
|
2427 | hoistStatic(root, context);
|
2428 | }
|
2429 | if (!options.ssr) {
|
2430 | createRootCodegen(root, context);
|
2431 | }
|
2432 |
|
2433 | root.helpers = [...context.helpers.keys()];
|
2434 | root.components = [...context.components];
|
2435 | root.directives = [...context.directives];
|
2436 | root.imports = context.imports;
|
2437 | root.hoists = context.hoists;
|
2438 | root.temps = context.temps;
|
2439 | root.cached = context.cached;
|
2440 | {
|
2441 | root.filters = [...context.filters];
|
2442 | }
|
2443 | }
|
2444 | function createRootCodegen(root, context) {
|
2445 | const { helper, removeHelper } = context;
|
2446 | const { children } = root;
|
2447 | if (children.length === 1) {
|
2448 | const child = children[0];
|
2449 |
|
2450 | if (isSingleElementRoot(root, child) && child.codegenNode) {
|
2451 |
|
2452 |
|
2453 | const codegenNode = child.codegenNode;
|
2454 | if (codegenNode.type === 13 ) {
|
2455 | if (!codegenNode.isBlock) {
|
2456 | removeHelper(CREATE_VNODE);
|
2457 | codegenNode.isBlock = true;
|
2458 | helper(OPEN_BLOCK);
|
2459 | helper(CREATE_BLOCK);
|
2460 | }
|
2461 | }
|
2462 | root.codegenNode = codegenNode;
|
2463 | }
|
2464 | else {
|
2465 |
|
2466 |
|
2467 |
|
2468 | root.codegenNode = child;
|
2469 | }
|
2470 | }
|
2471 | else if (children.length > 1) {
|
2472 |
|
2473 | let patchFlag = 64 ;
|
2474 | let patchFlagText = PatchFlagNames[64 ];
|
2475 |
|
2476 |
|
2477 | if ((process.env.NODE_ENV !== 'production') &&
|
2478 | children.filter(c => c.type !== 3 ).length === 1) {
|
2479 | patchFlag |= 2048 ;
|
2480 | patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
|
2481 | }
|
2482 | root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true);
|
2483 | }
|
2484 | else ;
|
2485 | }
|
2486 | function traverseChildren(parent, context) {
|
2487 | let i = 0;
|
2488 | const nodeRemoved = () => {
|
2489 | i--;
|
2490 | };
|
2491 | for (; i < parent.children.length; i++) {
|
2492 | const child = parent.children[i];
|
2493 | if (isString(child))
|
2494 | continue;
|
2495 | context.parent = parent;
|
2496 | context.childIndex = i;
|
2497 | context.onNodeRemoved = nodeRemoved;
|
2498 | traverseNode(child, context);
|
2499 | }
|
2500 | }
|
2501 | function traverseNode(node, context) {
|
2502 | context.currentNode = node;
|
2503 |
|
2504 | const { nodeTransforms } = context;
|
2505 | const exitFns = [];
|
2506 | for (let i = 0; i < nodeTransforms.length; i++) {
|
2507 | const onExit = nodeTransforms[i](node, context);
|
2508 | if (onExit) {
|
2509 | if (isArray(onExit)) {
|
2510 | exitFns.push(...onExit);
|
2511 | }
|
2512 | else {
|
2513 | exitFns.push(onExit);
|
2514 | }
|
2515 | }
|
2516 | if (!context.currentNode) {
|
2517 |
|
2518 | return;
|
2519 | }
|
2520 | else {
|
2521 |
|
2522 | node = context.currentNode;
|
2523 | }
|
2524 | }
|
2525 | switch (node.type) {
|
2526 | case 3 :
|
2527 | if (!context.ssr) {
|
2528 |
|
2529 |
|
2530 | context.helper(CREATE_COMMENT);
|
2531 | }
|
2532 | break;
|
2533 | case 5 :
|
2534 |
|
2535 | if (!context.ssr) {
|
2536 | context.helper(TO_DISPLAY_STRING);
|
2537 | }
|
2538 | break;
|
2539 |
|
2540 | case 9 :
|
2541 | for (let i = 0; i < node.branches.length; i++) {
|
2542 | traverseNode(node.branches[i], context);
|
2543 | }
|
2544 | break;
|
2545 | case 10 :
|
2546 | case 11 :
|
2547 | case 1 :
|
2548 | case 0 :
|
2549 | traverseChildren(node, context);
|
2550 | break;
|
2551 | }
|
2552 |
|
2553 | context.currentNode = node;
|
2554 | let i = exitFns.length;
|
2555 | while (i--) {
|
2556 | exitFns[i]();
|
2557 | }
|
2558 | }
|
2559 | function createStructuralDirectiveTransform(name, fn) {
|
2560 | const matches = isString(name)
|
2561 | ? (n) => n === name
|
2562 | : (n) => name.test(n);
|
2563 | return (node, context) => {
|
2564 | if (node.type === 1 ) {
|
2565 | const { props } = node;
|
2566 |
|
2567 |
|
2568 | if (node.tagType === 3 && props.some(isVSlot)) {
|
2569 | return;
|
2570 | }
|
2571 | const exitFns = [];
|
2572 | for (let i = 0; i < props.length; i++) {
|
2573 | const prop = props[i];
|
2574 | if (prop.type === 7 && matches(prop.name)) {
|
2575 |
|
2576 |
|
2577 |
|
2578 | props.splice(i, 1);
|
2579 | i--;
|
2580 | const onExit = fn(node, prop, context);
|
2581 | if (onExit)
|
2582 | exitFns.push(onExit);
|
2583 | }
|
2584 | }
|
2585 | return exitFns;
|
2586 | }
|
2587 | };
|
2588 | }
|
2589 |
|
2590 | const PURE_ANNOTATION = `/*#__PURE__*/`;
|
2591 | function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssr = false, isTS = false }) {
|
2592 | const context = {
|
2593 | mode,
|
2594 | prefixIdentifiers,
|
2595 | sourceMap,
|
2596 | filename,
|
2597 | scopeId,
|
2598 | optimizeImports,
|
2599 | runtimeGlobalName,
|
2600 | runtimeModuleName,
|
2601 | ssr,
|
2602 | isTS,
|
2603 | source: ast.loc.source,
|
2604 | code: ``,
|
2605 | column: 1,
|
2606 | line: 1,
|
2607 | offset: 0,
|
2608 | indentLevel: 0,
|
2609 | pure: false,
|
2610 | map: undefined,
|
2611 | helper(key) {
|
2612 | return `_${helperNameMap[key]}`;
|
2613 | },
|
2614 | push(code, node) {
|
2615 | context.code += code;
|
2616 | },
|
2617 | indent() {
|
2618 | newline(++context.indentLevel);
|
2619 | },
|
2620 | deindent(withoutNewLine = false) {
|
2621 | if (withoutNewLine) {
|
2622 | --context.indentLevel;
|
2623 | }
|
2624 | else {
|
2625 | newline(--context.indentLevel);
|
2626 | }
|
2627 | },
|
2628 | newline() {
|
2629 | newline(context.indentLevel);
|
2630 | }
|
2631 | };
|
2632 | function newline(n) {
|
2633 | context.push('\n' + ` `.repeat(n));
|
2634 | }
|
2635 | return context;
|
2636 | }
|
2637 | function generate(ast, options = {}) {
|
2638 | const context = createCodegenContext(ast, options);
|
2639 | if (options.onContextCreated)
|
2640 | options.onContextCreated(context);
|
2641 | const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
|
2642 | const hasHelpers = ast.helpers.length > 0;
|
2643 | const useWithBlock = !prefixIdentifiers && mode !== 'module';
|
2644 |
|
2645 |
|
2646 |
|
2647 | const preambleContext = context;
|
2648 | {
|
2649 | genFunctionPreamble(ast, preambleContext);
|
2650 | }
|
2651 |
|
2652 | const functionName = ssr ? `ssrRender` : `render`;
|
2653 | const args = ssr ? ['_ctx', '_push', '_parent', '_attrs'] : ['_ctx', '_cache'];
|
2654 | const signature = args.join(', ');
|
2655 | {
|
2656 | push(`function ${functionName}(${signature}) {`);
|
2657 | }
|
2658 | indent();
|
2659 | if (useWithBlock) {
|
2660 | push(`with (_ctx) {`);
|
2661 | indent();
|
2662 |
|
2663 |
|
2664 | if (hasHelpers) {
|
2665 | push(`const { ${ast.helpers
|
2666 | .map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)
|
2667 | .join(', ')} } = _Vue`);
|
2668 | push(`\n`);
|
2669 | newline();
|
2670 | }
|
2671 | }
|
2672 |
|
2673 | if (ast.components.length) {
|
2674 | genAssets(ast.components, 'component', context);
|
2675 | if (ast.directives.length || ast.temps > 0) {
|
2676 | newline();
|
2677 | }
|
2678 | }
|
2679 | if (ast.directives.length) {
|
2680 | genAssets(ast.directives, 'directive', context);
|
2681 | if (ast.temps > 0) {
|
2682 | newline();
|
2683 | }
|
2684 | }
|
2685 | if (ast.filters && ast.filters.length) {
|
2686 | newline();
|
2687 | genAssets(ast.filters, 'filter', context);
|
2688 | newline();
|
2689 | }
|
2690 | if (ast.temps > 0) {
|
2691 | push(`let `);
|
2692 | for (let i = 0; i < ast.temps; i++) {
|
2693 | push(`${i > 0 ? `, ` : ``}_temp${i}`);
|
2694 | }
|
2695 | }
|
2696 | if (ast.components.length || ast.directives.length || ast.temps) {
|
2697 | push(`\n`);
|
2698 | newline();
|
2699 | }
|
2700 |
|
2701 | if (!ssr) {
|
2702 | push(`return `);
|
2703 | }
|
2704 | if (ast.codegenNode) {
|
2705 | genNode(ast.codegenNode, context);
|
2706 | }
|
2707 | else {
|
2708 | push(`null`);
|
2709 | }
|
2710 | if (useWithBlock) {
|
2711 | deindent();
|
2712 | push(`}`);
|
2713 | }
|
2714 | deindent();
|
2715 | push(`}`);
|
2716 | return {
|
2717 | ast,
|
2718 | code: context.code,
|
2719 | preamble: ``,
|
2720 |
|
2721 | map: context.map ? context.map.toJSON() : undefined
|
2722 | };
|
2723 | }
|
2724 | function genFunctionPreamble(ast, context) {
|
2725 | const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;
|
2726 | const VueBinding = runtimeGlobalName;
|
2727 | const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 | if (ast.helpers.length > 0) {
|
2733 | {
|
2734 |
|
2735 |
|
2736 | push(`const _Vue = ${VueBinding}\n`);
|
2737 |
|
2738 |
|
2739 |
|
2740 | if (ast.hoists.length) {
|
2741 | const staticHelpers = [
|
2742 | CREATE_VNODE,
|
2743 | CREATE_COMMENT,
|
2744 | CREATE_TEXT,
|
2745 | CREATE_STATIC
|
2746 | ]
|
2747 | .filter(helper => ast.helpers.includes(helper))
|
2748 | .map(aliasHelper)
|
2749 | .join(', ');
|
2750 | push(`const { ${staticHelpers} } = _Vue\n`);
|
2751 | }
|
2752 | }
|
2753 | }
|
2754 | genHoists(ast.hoists, context);
|
2755 | newline();
|
2756 | push(`return `);
|
2757 | }
|
2758 | function genAssets(assets, type, { helper, push, newline, isTS }) {
|
2759 | const resolver = helper(type === 'filter'
|
2760 | ? RESOLVE_FILTER
|
2761 | : type === 'component'
|
2762 | ? RESOLVE_COMPONENT
|
2763 | : RESOLVE_DIRECTIVE);
|
2764 | for (let i = 0; i < assets.length; i++) {
|
2765 | let id = assets[i];
|
2766 |
|
2767 | const maybeSelfReference = id.endsWith('__self');
|
2768 | if (maybeSelfReference) {
|
2769 | id = id.slice(0, -6);
|
2770 | }
|
2771 | push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);
|
2772 | if (i < assets.length - 1) {
|
2773 | newline();
|
2774 | }
|
2775 | }
|
2776 | }
|
2777 | function genHoists(hoists, context) {
|
2778 | if (!hoists.length) {
|
2779 | return;
|
2780 | }
|
2781 | context.pure = true;
|
2782 | const { push, newline, helper, scopeId, mode } = context;
|
2783 | newline();
|
2784 | hoists.forEach((exp, i) => {
|
2785 | if (exp) {
|
2786 | push(`const _hoisted_${i + 1} = `);
|
2787 | genNode(exp, context);
|
2788 | newline();
|
2789 | }
|
2790 | });
|
2791 | context.pure = false;
|
2792 | }
|
2793 | function isText$1(n) {
|
2794 | return (isString(n) ||
|
2795 | n.type === 4 ||
|
2796 | n.type === 2 ||
|
2797 | n.type === 5 ||
|
2798 | n.type === 8 );
|
2799 | }
|
2800 | function genNodeListAsArray(nodes, context) {
|
2801 | const multilines = nodes.length > 3 ||
|
2802 | (((process.env.NODE_ENV !== 'production')) && nodes.some(n => isArray(n) || !isText$1(n)));
|
2803 | context.push(`[`);
|
2804 | multilines && context.indent();
|
2805 | genNodeList(nodes, context, multilines);
|
2806 | multilines && context.deindent();
|
2807 | context.push(`]`);
|
2808 | }
|
2809 | function genNodeList(nodes, context, multilines = false, comma = true) {
|
2810 | const { push, newline } = context;
|
2811 | for (let i = 0; i < nodes.length; i++) {
|
2812 | const node = nodes[i];
|
2813 | if (isString(node)) {
|
2814 | push(node);
|
2815 | }
|
2816 | else if (isArray(node)) {
|
2817 | genNodeListAsArray(node, context);
|
2818 | }
|
2819 | else {
|
2820 | genNode(node, context);
|
2821 | }
|
2822 | if (i < nodes.length - 1) {
|
2823 | if (multilines) {
|
2824 | comma && push(',');
|
2825 | newline();
|
2826 | }
|
2827 | else {
|
2828 | comma && push(', ');
|
2829 | }
|
2830 | }
|
2831 | }
|
2832 | }
|
2833 | function genNode(node, context) {
|
2834 | if (isString(node)) {
|
2835 | context.push(node);
|
2836 | return;
|
2837 | }
|
2838 | if (isSymbol(node)) {
|
2839 | context.push(context.helper(node));
|
2840 | return;
|
2841 | }
|
2842 | switch (node.type) {
|
2843 | case 1 :
|
2844 | case 9 :
|
2845 | case 11 :
|
2846 | (process.env.NODE_ENV !== 'production') &&
|
2847 | assert(node.codegenNode != null, `Codegen node is missing for element/if/for node. ` +
|
2848 | `Apply appropriate transforms first.`);
|
2849 | genNode(node.codegenNode, context);
|
2850 | break;
|
2851 | case 2 :
|
2852 | genText(node, context);
|
2853 | break;
|
2854 | case 4 :
|
2855 | genExpression(node, context);
|
2856 | break;
|
2857 | case 5 :
|
2858 | genInterpolation(node, context);
|
2859 | break;
|
2860 | case 12 :
|
2861 | genNode(node.codegenNode, context);
|
2862 | break;
|
2863 | case 8 :
|
2864 | genCompoundExpression(node, context);
|
2865 | break;
|
2866 | case 3 :
|
2867 | genComment(node, context);
|
2868 | break;
|
2869 | case 13 :
|
2870 | genVNodeCall(node, context);
|
2871 | break;
|
2872 | case 14 :
|
2873 | genCallExpression(node, context);
|
2874 | break;
|
2875 | case 15 :
|
2876 | genObjectExpression(node, context);
|
2877 | break;
|
2878 | case 17 :
|
2879 | genArrayExpression(node, context);
|
2880 | break;
|
2881 | case 18 :
|
2882 | genFunctionExpression(node, context);
|
2883 | break;
|
2884 | case 19 :
|
2885 | genConditionalExpression(node, context);
|
2886 | break;
|
2887 | case 20 :
|
2888 | genCacheExpression(node, context);
|
2889 | break;
|
2890 |
|
2891 | case 21 :
|
2892 | break;
|
2893 | case 22 :
|
2894 | break;
|
2895 | case 23 :
|
2896 | break;
|
2897 | case 24 :
|
2898 | break;
|
2899 | case 25 :
|
2900 | break;
|
2901 | case 26 :
|
2902 | break;
|
2903 |
|
2904 | case 10 :
|
2905 |
|
2906 | break;
|
2907 | default:
|
2908 | if ((process.env.NODE_ENV !== 'production')) {
|
2909 | assert(false, `unhandled codegen node type: ${node.type}`);
|
2910 |
|
2911 | const exhaustiveCheck = node;
|
2912 | return exhaustiveCheck;
|
2913 | }
|
2914 | }
|
2915 | }
|
2916 | function genText(node, context) {
|
2917 | context.push(JSON.stringify(node.content), node);
|
2918 | }
|
2919 | function genExpression(node, context) {
|
2920 | const { content, isStatic } = node;
|
2921 | context.push(isStatic ? JSON.stringify(content) : content, node);
|
2922 | }
|
2923 | function genInterpolation(node, context) {
|
2924 | const { push, helper, pure } = context;
|
2925 | if (pure)
|
2926 | push(PURE_ANNOTATION);
|
2927 | push(`${helper(TO_DISPLAY_STRING)}(`);
|
2928 | genNode(node.content, context);
|
2929 | push(`)`);
|
2930 | }
|
2931 | function genCompoundExpression(node, context) {
|
2932 | for (let i = 0; i < node.children.length; i++) {
|
2933 | const child = node.children[i];
|
2934 | if (isString(child)) {
|
2935 | context.push(child);
|
2936 | }
|
2937 | else {
|
2938 | genNode(child, context);
|
2939 | }
|
2940 | }
|
2941 | }
|
2942 | function genExpressionAsPropertyKey(node, context) {
|
2943 | const { push } = context;
|
2944 | if (node.type === 8 ) {
|
2945 | push(`[`);
|
2946 | genCompoundExpression(node, context);
|
2947 | push(`]`);
|
2948 | }
|
2949 | else if (node.isStatic) {
|
2950 |
|
2951 | const text = isSimpleIdentifier(node.content)
|
2952 | ? node.content
|
2953 | : JSON.stringify(node.content);
|
2954 | push(text, node);
|
2955 | }
|
2956 | else {
|
2957 | push(`[${node.content}]`, node);
|
2958 | }
|
2959 | }
|
2960 | function genComment(node, context) {
|
2961 | const { push, helper, pure } = context;
|
2962 | if (pure) {
|
2963 | push(PURE_ANNOTATION);
|
2964 | }
|
2965 | push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);
|
2966 | }
|
2967 | function genVNodeCall(node, context) {
|
2968 | const { push, helper, pure } = context;
|
2969 | const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking } = node;
|
2970 | if (directives) {
|
2971 | push(helper(WITH_DIRECTIVES) + `(`);
|
2972 | }
|
2973 | if (isBlock) {
|
2974 | push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
|
2975 | }
|
2976 | if (pure) {
|
2977 | push(PURE_ANNOTATION);
|
2978 | }
|
2979 | push(helper(isBlock ? CREATE_BLOCK : CREATE_VNODE) + `(`, node);
|
2980 | genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);
|
2981 | push(`)`);
|
2982 | if (isBlock) {
|
2983 | push(`)`);
|
2984 | }
|
2985 | if (directives) {
|
2986 | push(`, `);
|
2987 | genNode(directives, context);
|
2988 | push(`)`);
|
2989 | }
|
2990 | }
|
2991 | function genNullableArgs(args) {
|
2992 | let i = args.length;
|
2993 | while (i--) {
|
2994 | if (args[i] != null)
|
2995 | break;
|
2996 | }
|
2997 | return args.slice(0, i + 1).map(arg => arg || `null`);
|
2998 | }
|
2999 |
|
3000 | function genCallExpression(node, context) {
|
3001 | const { push, helper, pure } = context;
|
3002 | const callee = isString(node.callee) ? node.callee : helper(node.callee);
|
3003 | if (pure) {
|
3004 | push(PURE_ANNOTATION);
|
3005 | }
|
3006 | push(callee + `(`, node);
|
3007 | genNodeList(node.arguments, context);
|
3008 | push(`)`);
|
3009 | }
|
3010 | function genObjectExpression(node, context) {
|
3011 | const { push, indent, deindent, newline } = context;
|
3012 | const { properties } = node;
|
3013 | if (!properties.length) {
|
3014 | push(`{}`, node);
|
3015 | return;
|
3016 | }
|
3017 | const multilines = properties.length > 1 ||
|
3018 | (((process.env.NODE_ENV !== 'production')) &&
|
3019 | properties.some(p => p.value.type !== 4 ));
|
3020 | push(multilines ? `{` : `{ `);
|
3021 | multilines && indent();
|
3022 | for (let i = 0; i < properties.length; i++) {
|
3023 | const { key, value } = properties[i];
|
3024 |
|
3025 | genExpressionAsPropertyKey(key, context);
|
3026 | push(`: `);
|
3027 |
|
3028 | genNode(value, context);
|
3029 | if (i < properties.length - 1) {
|
3030 |
|
3031 | push(`,`);
|
3032 | newline();
|
3033 | }
|
3034 | }
|
3035 | multilines && deindent();
|
3036 | push(multilines ? `}` : ` }`);
|
3037 | }
|
3038 | function genArrayExpression(node, context) {
|
3039 | genNodeListAsArray(node.elements, context);
|
3040 | }
|
3041 | function genFunctionExpression(node, context) {
|
3042 | const { push, indent, deindent, scopeId, mode } = context;
|
3043 | const { params, returns, body, newline, isSlot } = node;
|
3044 | if (isSlot) {
|
3045 |
|
3046 | push(`_${helperNameMap[WITH_CTX]}(`);
|
3047 | }
|
3048 | push(`(`, node);
|
3049 | if (isArray(params)) {
|
3050 | genNodeList(params, context);
|
3051 | }
|
3052 | else if (params) {
|
3053 | genNode(params, context);
|
3054 | }
|
3055 | push(`) => `);
|
3056 | if (newline || body) {
|
3057 | push(`{`);
|
3058 | indent();
|
3059 | }
|
3060 | if (returns) {
|
3061 | if (newline) {
|
3062 | push(`return `);
|
3063 | }
|
3064 | if (isArray(returns)) {
|
3065 | genNodeListAsArray(returns, context);
|
3066 | }
|
3067 | else {
|
3068 | genNode(returns, context);
|
3069 | }
|
3070 | }
|
3071 | else if (body) {
|
3072 | genNode(body, context);
|
3073 | }
|
3074 | if (newline || body) {
|
3075 | deindent();
|
3076 | push(`}`);
|
3077 | }
|
3078 | if (isSlot) {
|
3079 | if (node.isNonScopedSlot) {
|
3080 | push(`, undefined, true`);
|
3081 | }
|
3082 | push(`)`);
|
3083 | }
|
3084 | }
|
3085 | function genConditionalExpression(node, context) {
|
3086 | const { test, consequent, alternate, newline: needNewline } = node;
|
3087 | const { push, indent, deindent, newline } = context;
|
3088 | if (test.type === 4 ) {
|
3089 | const needsParens = !isSimpleIdentifier(test.content);
|
3090 | needsParens && push(`(`);
|
3091 | genExpression(test, context);
|
3092 | needsParens && push(`)`);
|
3093 | }
|
3094 | else {
|
3095 | push(`(`);
|
3096 | genNode(test, context);
|
3097 | push(`)`);
|
3098 | }
|
3099 | needNewline && indent();
|
3100 | context.indentLevel++;
|
3101 | needNewline || push(` `);
|
3102 | push(`? `);
|
3103 | genNode(consequent, context);
|
3104 | context.indentLevel--;
|
3105 | needNewline && newline();
|
3106 | needNewline || push(` `);
|
3107 | push(`: `);
|
3108 | const isNested = alternate.type === 19 ;
|
3109 | if (!isNested) {
|
3110 | context.indentLevel++;
|
3111 | }
|
3112 | genNode(alternate, context);
|
3113 | if (!isNested) {
|
3114 | context.indentLevel--;
|
3115 | }
|
3116 | needNewline && deindent(true );
|
3117 | }
|
3118 | function genCacheExpression(node, context) {
|
3119 | const { push, helper, indent, deindent, newline } = context;
|
3120 | push(`_cache[${node.index}] || (`);
|
3121 | if (node.isVNode) {
|
3122 | indent();
|
3123 | push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
|
3124 | newline();
|
3125 | }
|
3126 | push(`_cache[${node.index}] = `);
|
3127 | genNode(node.value, context);
|
3128 | if (node.isVNode) {
|
3129 | push(`,`);
|
3130 | newline();
|
3131 | push(`${helper(SET_BLOCK_TRACKING)}(1),`);
|
3132 | newline();
|
3133 | push(`_cache[${node.index}]`);
|
3134 | deindent();
|
3135 | }
|
3136 | push(`)`);
|
3137 | }
|
3138 |
|
3139 |
|
3140 |
|
3141 | const prohibitedKeywordRE = new RegExp('\\b' +
|
3142 | ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
|
3143 | 'super,throw,while,yield,delete,export,import,return,switch,default,' +
|
3144 | 'extends,finally,continue,debugger,function,arguments,typeof,void')
|
3145 | .split(',')
|
3146 | .join('\\b|\\b') +
|
3147 | '\\b');
|
3148 |
|
3149 | const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
|
3150 |
|
3151 |
|
3152 |
|
3153 |
|
3154 |
|
3155 | function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {
|
3156 | const exp = node.content;
|
3157 |
|
3158 |
|
3159 | if (!exp.trim()) {
|
3160 | return;
|
3161 | }
|
3162 | try {
|
3163 | new Function(asRawStatements
|
3164 | ? ` ${exp} `
|
3165 | : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`);
|
3166 | }
|
3167 | catch (e) {
|
3168 | let message = e.message;
|
3169 | const keywordMatch = exp
|
3170 | .replace(stripStringRE, '')
|
3171 | .match(prohibitedKeywordRE);
|
3172 | if (keywordMatch) {
|
3173 | message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
|
3174 | }
|
3175 | context.onError(createCompilerError(43 , node.loc, undefined, message));
|
3176 | }
|
3177 | }
|
3178 |
|
3179 | const transformExpression = (node, context) => {
|
3180 | if (node.type === 5 ) {
|
3181 | node.content = processExpression(node.content, context);
|
3182 | }
|
3183 | else if (node.type === 1 ) {
|
3184 |
|
3185 | for (let i = 0; i < node.props.length; i++) {
|
3186 | const dir = node.props[i];
|
3187 |
|
3188 | if (dir.type === 7 && dir.name !== 'for') {
|
3189 | const exp = dir.exp;
|
3190 | const arg = dir.arg;
|
3191 |
|
3192 |
|
3193 | if (exp &&
|
3194 | exp.type === 4 &&
|
3195 | !(dir.name === 'on' && arg)) {
|
3196 | dir.exp = processExpression(exp, context,
|
3197 |
|
3198 | dir.name === 'slot');
|
3199 | }
|
3200 | if (arg && arg.type === 4 && !arg.isStatic) {
|
3201 | dir.arg = processExpression(arg, context);
|
3202 | }
|
3203 | }
|
3204 | }
|
3205 | }
|
3206 | };
|
3207 |
|
3208 |
|
3209 |
|
3210 | function processExpression(node, context,
|
3211 | // some expressions like v-slot props & v-for aliases should be parsed as
|
3212 | // function params
|
3213 | asParams = false,
|
3214 | // v-on handler values may contain multiple statements
|
3215 | asRawStatements = false) {
|
3216 | {
|
3217 | if ((process.env.NODE_ENV !== 'production')) {
|
3218 |
|
3219 | validateBrowserExpression(node, context, asParams, asRawStatements);
|
3220 | }
|
3221 | return node;
|
3222 | }
|
3223 | }
|
3224 |
|
3225 | const transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {
|
3226 | return processIf(node, dir, context, (ifNode, branch, isRoot) => {
|
3227 |
|
3228 |
|
3229 |
|
3230 | const siblings = context.parent.children;
|
3231 | let i = siblings.indexOf(ifNode);
|
3232 | let key = 0;
|
3233 | while (i-- >= 0) {
|
3234 | const sibling = siblings[i];
|
3235 | if (sibling && sibling.type === 9 ) {
|
3236 | key += sibling.branches.length;
|
3237 | }
|
3238 | }
|
3239 |
|
3240 |
|
3241 | return () => {
|
3242 | if (isRoot) {
|
3243 | ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);
|
3244 | }
|
3245 | else {
|
3246 |
|
3247 | const parentCondition = getParentCondition(ifNode.codegenNode);
|
3248 | parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);
|
3249 | }
|
3250 | };
|
3251 | });
|
3252 | });
|
3253 |
|
3254 | function processIf(node, dir, context, processCodegen) {
|
3255 | if (dir.name !== 'else' &&
|
3256 | (!dir.exp || !dir.exp.content.trim())) {
|
3257 | const loc = dir.exp ? dir.exp.loc : node.loc;
|
3258 | context.onError(createCompilerError(27 , dir.loc));
|
3259 | dir.exp = createSimpleExpression(`true`, false, loc);
|
3260 | }
|
3261 | if ((process.env.NODE_ENV !== 'production') && true && dir.exp) {
|
3262 | validateBrowserExpression(dir.exp, context);
|
3263 | }
|
3264 | if (dir.name === 'if') {
|
3265 | const branch = createIfBranch(node, dir);
|
3266 | const ifNode = {
|
3267 | type: 9 ,
|
3268 | loc: node.loc,
|
3269 | branches: [branch]
|
3270 | };
|
3271 | context.replaceNode(ifNode);
|
3272 | if (processCodegen) {
|
3273 | return processCodegen(ifNode, branch, true);
|
3274 | }
|
3275 | }
|
3276 | else {
|
3277 |
|
3278 | const siblings = context.parent.children;
|
3279 | const comments = [];
|
3280 | let i = siblings.indexOf(node);
|
3281 | while (i-- >= -1) {
|
3282 | const sibling = siblings[i];
|
3283 | if ((process.env.NODE_ENV !== 'production') && sibling && sibling.type === 3 ) {
|
3284 | context.removeNode(sibling);
|
3285 | comments.unshift(sibling);
|
3286 | continue;
|
3287 | }
|
3288 | if (sibling &&
|
3289 | sibling.type === 2 &&
|
3290 | !sibling.content.trim().length) {
|
3291 | context.removeNode(sibling);
|
3292 | continue;
|
3293 | }
|
3294 | if (sibling && sibling.type === 9 ) {
|
3295 |
|
3296 | context.removeNode();
|
3297 | const branch = createIfBranch(node, dir);
|
3298 | if ((process.env.NODE_ENV !== 'production') &&
|
3299 | comments.length &&
|
3300 |
|
3301 | !(context.parent &&
|
3302 | context.parent.type === 1 &&
|
3303 | isBuiltInType(context.parent.tag, 'transition'))) {
|
3304 | branch.children = [...comments, ...branch.children];
|
3305 | }
|
3306 |
|
3307 | if ((process.env.NODE_ENV !== 'production') || !true) {
|
3308 | const key = branch.userKey;
|
3309 | if (key) {
|
3310 | sibling.branches.forEach(({ userKey }) => {
|
3311 | if (isSameKey(userKey, key)) {
|
3312 | context.onError(createCompilerError(28 , branch.userKey.loc));
|
3313 | }
|
3314 | });
|
3315 | }
|
3316 | }
|
3317 | sibling.branches.push(branch);
|
3318 | const onExit = processCodegen && processCodegen(sibling, branch, false);
|
3319 |
|
3320 |
|
3321 | traverseNode(branch, context);
|
3322 |
|
3323 | if (onExit)
|
3324 | onExit();
|
3325 |
|
3326 |
|
3327 | context.currentNode = null;
|
3328 | }
|
3329 | else {
|
3330 | context.onError(createCompilerError(29 , node.loc));
|
3331 | }
|
3332 | break;
|
3333 | }
|
3334 | }
|
3335 | }
|
3336 | function createIfBranch(node, dir) {
|
3337 | return {
|
3338 | type: 10 ,
|
3339 | loc: node.loc,
|
3340 | condition: dir.name === 'else' ? undefined : dir.exp,
|
3341 | children: node.tagType === 3 && !findDir(node, 'for')
|
3342 | ? node.children
|
3343 | : [node],
|
3344 | userKey: findProp(node, `key`)
|
3345 | };
|
3346 | }
|
3347 | function createCodegenNodeForBranch(branch, keyIndex, context) {
|
3348 | if (branch.condition) {
|
3349 | return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context),
|
3350 |
|
3351 |
|
3352 | createCallExpression(context.helper(CREATE_COMMENT), [
|
3353 | (process.env.NODE_ENV !== 'production') ? '"v-if"' : '""',
|
3354 | 'true'
|
3355 | ]));
|
3356 | }
|
3357 | else {
|
3358 | return createChildrenCodegenNode(branch, keyIndex, context);
|
3359 | }
|
3360 | }
|
3361 | function createChildrenCodegenNode(branch, keyIndex, context) {
|
3362 | const { helper, removeHelper } = context;
|
3363 | const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 ));
|
3364 | const { children } = branch;
|
3365 | const firstChild = children[0];
|
3366 | const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 ;
|
3367 | if (needFragmentWrapper) {
|
3368 | if (children.length === 1 && firstChild.type === 11 ) {
|
3369 |
|
3370 | const vnodeCall = firstChild.codegenNode;
|
3371 | injectProp(vnodeCall, keyProperty, context);
|
3372 | return vnodeCall;
|
3373 | }
|
3374 | else {
|
3375 | let patchFlag = 64 ;
|
3376 | let patchFlagText = PatchFlagNames[64 ];
|
3377 |
|
3378 |
|
3379 | if ((process.env.NODE_ENV !== 'production') &&
|
3380 | children.filter(c => c.type !== 3 ).length === 1) {
|
3381 | patchFlag |= 2048 ;
|
3382 | patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
|
3383 | }
|
3384 | return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true, false, branch.loc);
|
3385 | }
|
3386 | }
|
3387 | else {
|
3388 | const vnodeCall = firstChild
|
3389 | .codegenNode;
|
3390 |
|
3391 | if (vnodeCall.type === 13 && !vnodeCall.isBlock) {
|
3392 | removeHelper(CREATE_VNODE);
|
3393 | vnodeCall.isBlock = true;
|
3394 | helper(OPEN_BLOCK);
|
3395 | helper(CREATE_BLOCK);
|
3396 | }
|
3397 |
|
3398 | injectProp(vnodeCall, keyProperty, context);
|
3399 | return vnodeCall;
|
3400 | }
|
3401 | }
|
3402 | function isSameKey(a, b) {
|
3403 | if (!a || a.type !== b.type) {
|
3404 | return false;
|
3405 | }
|
3406 | if (a.type === 6 ) {
|
3407 | if (a.value.content !== b.value.content) {
|
3408 | return false;
|
3409 | }
|
3410 | }
|
3411 | else {
|
3412 |
|
3413 | const exp = a.exp;
|
3414 | const branchExp = b.exp;
|
3415 | if (exp.type !== branchExp.type) {
|
3416 | return false;
|
3417 | }
|
3418 | if (exp.type !== 4 ||
|
3419 | (exp.isStatic !== branchExp.isStatic ||
|
3420 | exp.content !== branchExp.content)) {
|
3421 | return false;
|
3422 | }
|
3423 | }
|
3424 | return true;
|
3425 | }
|
3426 | function getParentCondition(node) {
|
3427 | while (true) {
|
3428 | if (node.type === 19 ) {
|
3429 | if (node.alternate.type === 19 ) {
|
3430 | node = node.alternate;
|
3431 | }
|
3432 | else {
|
3433 | return node;
|
3434 | }
|
3435 | }
|
3436 | else if (node.type === 20 ) {
|
3437 | node = node.value;
|
3438 | }
|
3439 | }
|
3440 | }
|
3441 |
|
3442 | const transformFor = createStructuralDirectiveTransform('for', (node, dir, context) => {
|
3443 | const { helper, removeHelper } = context;
|
3444 | return processFor(node, dir, context, forNode => {
|
3445 |
|
3446 |
|
3447 | const renderExp = createCallExpression(helper(RENDER_LIST), [
|
3448 | forNode.source
|
3449 | ]);
|
3450 | const keyProp = findProp(node, `key`);
|
3451 | const keyProperty = keyProp
|
3452 | ? createObjectProperty(`key`, keyProp.type === 6
|
3453 | ? createSimpleExpression(keyProp.value.content, true)
|
3454 | : keyProp.exp)
|
3455 | : null;
|
3456 | const isStableFragment = forNode.source.type === 4 &&
|
3457 | forNode.source.constType > 0 ;
|
3458 | const fragmentFlag = isStableFragment
|
3459 | ? 64
|
3460 | : keyProp
|
3461 | ? 128
|
3462 | : 256 ;
|
3463 | forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +
|
3464 | ((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``), undefined, undefined, true , !isStableFragment , node.loc);
|
3465 | return () => {
|
3466 |
|
3467 | let childBlock;
|
3468 | const isTemplate = isTemplateNode(node);
|
3469 | const { children } = forNode;
|
3470 |
|
3471 | if (((process.env.NODE_ENV !== 'production') || !true) && isTemplate) {
|
3472 | node.children.some(c => {
|
3473 | if (c.type === 1 ) {
|
3474 | const key = findProp(c, 'key');
|
3475 | if (key) {
|
3476 | context.onError(createCompilerError(32 , key.loc));
|
3477 | return true;
|
3478 | }
|
3479 | }
|
3480 | });
|
3481 | }
|
3482 | const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 ;
|
3483 | const slotOutlet = isSlotOutlet(node)
|
3484 | ? node
|
3485 | : isTemplate &&
|
3486 | node.children.length === 1 &&
|
3487 | isSlotOutlet(node.children[0])
|
3488 | ? node.children[0]
|
3489 | : null;
|
3490 | if (slotOutlet) {
|
3491 |
|
3492 | childBlock = slotOutlet.codegenNode;
|
3493 | if (isTemplate && keyProperty) {
|
3494 |
|
3495 |
|
3496 |
|
3497 | injectProp(childBlock, keyProperty, context);
|
3498 | }
|
3499 | }
|
3500 | else if (needFragmentWrapper) {
|
3501 |
|
3502 |
|
3503 | childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 +
|
3504 | ((process.env.NODE_ENV !== 'production')
|
3505 | ? ` /* ${PatchFlagNames[64 /* STABLE_FRAGMENT */]} */`
|
3506 | : ``), undefined, undefined, true);
|
3507 | }
|
3508 | else {
|
3509 |
|
3510 |
|
3511 | childBlock = children[0]
|
3512 | .codegenNode;
|
3513 | if (isTemplate && keyProperty) {
|
3514 | injectProp(childBlock, keyProperty, context);
|
3515 | }
|
3516 | if (childBlock.isBlock !== !isStableFragment) {
|
3517 | if (childBlock.isBlock) {
|
3518 |
|
3519 | removeHelper(OPEN_BLOCK);
|
3520 | removeHelper(CREATE_BLOCK);
|
3521 | }
|
3522 | else {
|
3523 |
|
3524 | removeHelper(CREATE_VNODE);
|
3525 | }
|
3526 | }
|
3527 | childBlock.isBlock = !isStableFragment;
|
3528 | if (childBlock.isBlock) {
|
3529 | helper(OPEN_BLOCK);
|
3530 | helper(CREATE_BLOCK);
|
3531 | }
|
3532 | else {
|
3533 | helper(CREATE_VNODE);
|
3534 | }
|
3535 | }
|
3536 | renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true ));
|
3537 | };
|
3538 | });
|
3539 | });
|
3540 |
|
3541 | function processFor(node, dir, context, processCodegen) {
|
3542 | if (!dir.exp) {
|
3543 | context.onError(createCompilerError(30 , dir.loc));
|
3544 | return;
|
3545 | }
|
3546 | const parseResult = parseForExpression(
|
3547 |
|
3548 |
|
3549 | dir.exp, context);
|
3550 | if (!parseResult) {
|
3551 | context.onError(createCompilerError(31 , dir.loc));
|
3552 | return;
|
3553 | }
|
3554 | const { addIdentifiers, removeIdentifiers, scopes } = context;
|
3555 | const { source, value, key, index } = parseResult;
|
3556 | const forNode = {
|
3557 | type: 11 ,
|
3558 | loc: dir.loc,
|
3559 | source,
|
3560 | valueAlias: value,
|
3561 | keyAlias: key,
|
3562 | objectIndexAlias: index,
|
3563 | parseResult,
|
3564 | children: isTemplateNode(node) ? node.children : [node]
|
3565 | };
|
3566 | context.replaceNode(forNode);
|
3567 |
|
3568 | scopes.vFor++;
|
3569 | const onExit = processCodegen && processCodegen(forNode);
|
3570 | return () => {
|
3571 | scopes.vFor--;
|
3572 | if (onExit)
|
3573 | onExit();
|
3574 | };
|
3575 | }
|
3576 | const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
|
3577 |
|
3578 |
|
3579 | const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
|
3580 | const stripParensRE = /^\(|\)$/g;
|
3581 | function parseForExpression(input, context) {
|
3582 | const loc = input.loc;
|
3583 | const exp = input.content;
|
3584 | const inMatch = exp.match(forAliasRE);
|
3585 | if (!inMatch)
|
3586 | return;
|
3587 | const [, LHS, RHS] = inMatch;
|
3588 | const result = {
|
3589 | source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),
|
3590 | value: undefined,
|
3591 | key: undefined,
|
3592 | index: undefined
|
3593 | };
|
3594 | if ((process.env.NODE_ENV !== 'production') && true) {
|
3595 | validateBrowserExpression(result.source, context);
|
3596 | }
|
3597 | let valueContent = LHS.trim()
|
3598 | .replace(stripParensRE, '')
|
3599 | .trim();
|
3600 | const trimmedOffset = LHS.indexOf(valueContent);
|
3601 | const iteratorMatch = valueContent.match(forIteratorRE);
|
3602 | if (iteratorMatch) {
|
3603 | valueContent = valueContent.replace(forIteratorRE, '').trim();
|
3604 | const keyContent = iteratorMatch[1].trim();
|
3605 | let keyOffset;
|
3606 | if (keyContent) {
|
3607 | keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
|
3608 | result.key = createAliasExpression(loc, keyContent, keyOffset);
|
3609 | if ((process.env.NODE_ENV !== 'production') && true) {
|
3610 | validateBrowserExpression(result.key, context, true);
|
3611 | }
|
3612 | }
|
3613 | if (iteratorMatch[2]) {
|
3614 | const indexContent = iteratorMatch[2].trim();
|
3615 | if (indexContent) {
|
3616 | result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key
|
3617 | ? keyOffset + keyContent.length
|
3618 | : trimmedOffset + valueContent.length));
|
3619 | if ((process.env.NODE_ENV !== 'production') && true) {
|
3620 | validateBrowserExpression(result.index, context, true);
|
3621 | }
|
3622 | }
|
3623 | }
|
3624 | }
|
3625 | if (valueContent) {
|
3626 | result.value = createAliasExpression(loc, valueContent, trimmedOffset);
|
3627 | if ((process.env.NODE_ENV !== 'production') && true) {
|
3628 | validateBrowserExpression(result.value, context, true);
|
3629 | }
|
3630 | }
|
3631 | return result;
|
3632 | }
|
3633 | function createAliasExpression(range, content, offset) {
|
3634 | return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));
|
3635 | }
|
3636 | function createForLoopParams({ value, key, index }) {
|
3637 | const params = [];
|
3638 | if (value) {
|
3639 | params.push(value);
|
3640 | }
|
3641 | if (key) {
|
3642 | if (!value) {
|
3643 | params.push(createSimpleExpression(`_`, false));
|
3644 | }
|
3645 | params.push(key);
|
3646 | }
|
3647 | if (index) {
|
3648 | if (!key) {
|
3649 | if (!value) {
|
3650 | params.push(createSimpleExpression(`_`, false));
|
3651 | }
|
3652 | params.push(createSimpleExpression(`__`, false));
|
3653 | }
|
3654 | params.push(index);
|
3655 | }
|
3656 | return params;
|
3657 | }
|
3658 |
|
3659 | const defaultFallback = createSimpleExpression(`undefined`, false);
|
3660 |
|
3661 |
|
3662 |
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 | const trackSlotScopes = (node, context) => {
|
3668 | if (node.type === 1 &&
|
3669 | (node.tagType === 1 ||
|
3670 | node.tagType === 3 )) {
|
3671 |
|
3672 |
|
3673 | const vSlot = findDir(node, 'slot');
|
3674 | if (vSlot) {
|
3675 | context.scopes.vSlot++;
|
3676 | return () => {
|
3677 | context.scopes.vSlot--;
|
3678 | };
|
3679 | }
|
3680 | }
|
3681 | };
|
3682 |
|
3683 |
|
3684 | const trackVForSlotScopes = (node, context) => {
|
3685 | let vFor;
|
3686 | if (isTemplateNode(node) &&
|
3687 | node.props.some(isVSlot) &&
|
3688 | (vFor = findDir(node, 'for'))) {
|
3689 | const result = (vFor.parseResult = parseForExpression(vFor.exp, context));
|
3690 | if (result) {
|
3691 | const { value, key, index } = result;
|
3692 | const { addIdentifiers, removeIdentifiers } = context;
|
3693 | value && addIdentifiers(value);
|
3694 | key && addIdentifiers(key);
|
3695 | index && addIdentifiers(index);
|
3696 | return () => {
|
3697 | value && removeIdentifiers(value);
|
3698 | key && removeIdentifiers(key);
|
3699 | index && removeIdentifiers(index);
|
3700 | };
|
3701 | }
|
3702 | }
|
3703 | };
|
3704 | const buildClientSlotFn = (props, children, loc) => createFunctionExpression(props, children, false , true , children.length ? children[0].loc : loc);
|
3705 |
|
3706 |
|
3707 | function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
3708 | context.helper(WITH_CTX);
|
3709 | const { children, loc } = node;
|
3710 | const slotsProperties = [];
|
3711 | const dynamicSlots = [];
|
3712 |
|
3713 |
|
3714 | let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
|
3715 |
|
3716 |
|
3717 | const onComponentSlot = findDir(node, 'slot', true);
|
3718 | if (onComponentSlot) {
|
3719 | const { arg, exp } = onComponentSlot;
|
3720 | if (arg && !isStaticExp(arg)) {
|
3721 | hasDynamicSlots = true;
|
3722 | }
|
3723 | slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));
|
3724 | }
|
3725 |
|
3726 |
|
3727 | let hasTemplateSlots = false;
|
3728 | let hasNamedDefaultSlot = false;
|
3729 | const implicitDefaultChildren = [];
|
3730 | const seenSlotNames = new Set();
|
3731 | for (let i = 0; i < children.length; i++) {
|
3732 | const slotElement = children[i];
|
3733 | let slotDir;
|
3734 | if (!isTemplateNode(slotElement) ||
|
3735 | !(slotDir = findDir(slotElement, 'slot', true))) {
|
3736 |
|
3737 | if (slotElement.type !== 3 ) {
|
3738 | implicitDefaultChildren.push(slotElement);
|
3739 | }
|
3740 | continue;
|
3741 | }
|
3742 | if (onComponentSlot) {
|
3743 |
|
3744 | context.onError(createCompilerError(36 , slotDir.loc));
|
3745 | break;
|
3746 | }
|
3747 | hasTemplateSlots = true;
|
3748 | const { children: slotChildren, loc: slotLoc } = slotElement;
|
3749 | const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;
|
3750 |
|
3751 | let staticSlotName;
|
3752 | if (isStaticExp(slotName)) {
|
3753 | staticSlotName = slotName ? slotName.content : `default`;
|
3754 | }
|
3755 | else {
|
3756 | hasDynamicSlots = true;
|
3757 | }
|
3758 | const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
|
3759 |
|
3760 | let vIf;
|
3761 | let vElse;
|
3762 | let vFor;
|
3763 | if ((vIf = findDir(slotElement, 'if'))) {
|
3764 | hasDynamicSlots = true;
|
3765 | dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));
|
3766 | }
|
3767 | else if ((vElse = findDir(slotElement, /^else(-if)?$/, true ))) {
|
3768 |
|
3769 | let j = i;
|
3770 | let prev;
|
3771 | while (j--) {
|
3772 | prev = children[j];
|
3773 | if (prev.type !== 3 ) {
|
3774 | break;
|
3775 | }
|
3776 | }
|
3777 | if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {
|
3778 |
|
3779 | children.splice(i, 1);
|
3780 | i--;
|
3781 |
|
3782 | let conditional = dynamicSlots[dynamicSlots.length - 1];
|
3783 | while (conditional.alternate.type === 19 ) {
|
3784 | conditional = conditional.alternate;
|
3785 | }
|
3786 | conditional.alternate = vElse.exp
|
3787 | ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)
|
3788 | : buildDynamicSlot(slotName, slotFunction);
|
3789 | }
|
3790 | else {
|
3791 | context.onError(createCompilerError(29 , vElse.loc));
|
3792 | }
|
3793 | }
|
3794 | else if ((vFor = findDir(slotElement, 'for'))) {
|
3795 | hasDynamicSlots = true;
|
3796 | const parseResult = vFor.parseResult ||
|
3797 | parseForExpression(vFor.exp, context);
|
3798 | if (parseResult) {
|
3799 |
|
3800 |
|
3801 | dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [
|
3802 | parseResult.source,
|
3803 | createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true )
|
3804 | ]));
|
3805 | }
|
3806 | else {
|
3807 | context.onError(createCompilerError(31 , vFor.loc));
|
3808 | }
|
3809 | }
|
3810 | else {
|
3811 |
|
3812 | if (staticSlotName) {
|
3813 | if (seenSlotNames.has(staticSlotName)) {
|
3814 | context.onError(createCompilerError(37 , dirLoc));
|
3815 | continue;
|
3816 | }
|
3817 | seenSlotNames.add(staticSlotName);
|
3818 | if (staticSlotName === 'default') {
|
3819 | hasNamedDefaultSlot = true;
|
3820 | }
|
3821 | }
|
3822 | slotsProperties.push(createObjectProperty(slotName, slotFunction));
|
3823 | }
|
3824 | }
|
3825 | if (!onComponentSlot) {
|
3826 | const buildDefaultSlotProperty = (props, children) => {
|
3827 | const fn = buildSlotFn(props, children, loc);
|
3828 | if (context.compatConfig) {
|
3829 | fn.isNonScopedSlot = true;
|
3830 | }
|
3831 | return createObjectProperty(`default`, fn);
|
3832 | };
|
3833 | if (!hasTemplateSlots) {
|
3834 |
|
3835 | slotsProperties.push(buildDefaultSlotProperty(undefined, children));
|
3836 | }
|
3837 | else if (implicitDefaultChildren.length &&
|
3838 |
|
3839 |
|
3840 |
|
3841 | implicitDefaultChildren.some(node => isNonWhitespaceContent(node))) {
|
3842 |
|
3843 | if (hasNamedDefaultSlot) {
|
3844 | context.onError(createCompilerError(38 , implicitDefaultChildren[0].loc));
|
3845 | }
|
3846 | else {
|
3847 | slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));
|
3848 | }
|
3849 | }
|
3850 | }
|
3851 | const slotFlag = hasDynamicSlots
|
3852 | ? 2
|
3853 | : hasForwardedSlots(node.children)
|
3854 | ? 3
|
3855 | : 1 ;
|
3856 | let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`,
|
3857 |
|
3858 |
|
3859 | createSimpleExpression(slotFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${slotFlagsText[slotFlag]} */` : ``), false))), loc);
|
3860 | if (dynamicSlots.length) {
|
3861 | slots = createCallExpression(context.helper(CREATE_SLOTS), [
|
3862 | slots,
|
3863 | createArrayExpression(dynamicSlots)
|
3864 | ]);
|
3865 | }
|
3866 | return {
|
3867 | slots,
|
3868 | hasDynamicSlots
|
3869 | };
|
3870 | }
|
3871 | function buildDynamicSlot(name, fn) {
|
3872 | return createObjectExpression([
|
3873 | createObjectProperty(`name`, name),
|
3874 | createObjectProperty(`fn`, fn)
|
3875 | ]);
|
3876 | }
|
3877 | function hasForwardedSlots(children) {
|
3878 | for (let i = 0; i < children.length; i++) {
|
3879 | const child = children[i];
|
3880 | switch (child.type) {
|
3881 | case 1 :
|
3882 | if (child.tagType === 2 ||
|
3883 | (child.tagType === 0 &&
|
3884 | hasForwardedSlots(child.children))) {
|
3885 | return true;
|
3886 | }
|
3887 | break;
|
3888 | case 9 :
|
3889 | if (hasForwardedSlots(child.branches))
|
3890 | return true;
|
3891 | break;
|
3892 | case 10 :
|
3893 | case 11 :
|
3894 | if (hasForwardedSlots(child.children))
|
3895 | return true;
|
3896 | break;
|
3897 | }
|
3898 | }
|
3899 | return false;
|
3900 | }
|
3901 | function isNonWhitespaceContent(node) {
|
3902 | if (node.type !== 2 && node.type !== 12 )
|
3903 | return true;
|
3904 | return node.type === 2
|
3905 | ? !!node.content.trim()
|
3906 | : isNonWhitespaceContent(node.content);
|
3907 | }
|
3908 |
|
3909 |
|
3910 |
|
3911 | const directiveImportMap = new WeakMap();
|
3912 |
|
3913 | const transformElement = (node, context) => {
|
3914 |
|
3915 |
|
3916 | return function postTransformElement() {
|
3917 | node = context.currentNode;
|
3918 | if (!(node.type === 1 &&
|
3919 | (node.tagType === 0 ||
|
3920 | node.tagType === 1 ))) {
|
3921 | return;
|
3922 | }
|
3923 | const { tag, props } = node;
|
3924 | const isComponent = node.tagType === 1 ;
|
3925 |
|
3926 |
|
3927 | let vnodeTag = isComponent
|
3928 | ? resolveComponentType(node, context)
|
3929 | : `"${tag}"`;
|
3930 | const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
|
3931 | let vnodeProps;
|
3932 | let vnodeChildren;
|
3933 | let vnodePatchFlag;
|
3934 | let patchFlag = 0;
|
3935 | let vnodeDynamicProps;
|
3936 | let dynamicPropNames;
|
3937 | let vnodeDirectives;
|
3938 | let shouldUseBlock =
|
3939 |
|
3940 | isDynamicComponent ||
|
3941 | vnodeTag === TELEPORT ||
|
3942 | vnodeTag === SUSPENSE ||
|
3943 | (!isComponent &&
|
3944 |
|
3945 |
|
3946 |
|
3947 |
|
3948 | (tag === 'svg' ||
|
3949 | tag === 'foreignObject' ||
|
3950 |
|
3951 | findProp(node, 'key', true)));
|
3952 |
|
3953 | if (props.length > 0) {
|
3954 | const propsBuildResult = buildProps(node, context);
|
3955 | vnodeProps = propsBuildResult.props;
|
3956 | patchFlag = propsBuildResult.patchFlag;
|
3957 | dynamicPropNames = propsBuildResult.dynamicPropNames;
|
3958 | const directives = propsBuildResult.directives;
|
3959 | vnodeDirectives =
|
3960 | directives && directives.length
|
3961 | ? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))
|
3962 | : undefined;
|
3963 | }
|
3964 |
|
3965 | if (node.children.length > 0) {
|
3966 | if (vnodeTag === KEEP_ALIVE) {
|
3967 |
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 | shouldUseBlock = true;
|
3974 |
|
3975 | patchFlag |= 1024 ;
|
3976 | if ((process.env.NODE_ENV !== 'production') && node.children.length > 1) {
|
3977 | context.onError(createCompilerError(44 , {
|
3978 | start: node.children[0].loc.start,
|
3979 | end: node.children[node.children.length - 1].loc.end,
|
3980 | source: ''
|
3981 | }));
|
3982 | }
|
3983 | }
|
3984 | const shouldBuildAsSlots = isComponent &&
|
3985 |
|
3986 | vnodeTag !== TELEPORT &&
|
3987 |
|
3988 | vnodeTag !== KEEP_ALIVE;
|
3989 | if (shouldBuildAsSlots) {
|
3990 | const { slots, hasDynamicSlots } = buildSlots(node, context);
|
3991 | vnodeChildren = slots;
|
3992 | if (hasDynamicSlots) {
|
3993 | patchFlag |= 1024 ;
|
3994 | }
|
3995 | }
|
3996 | else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
|
3997 | const child = node.children[0];
|
3998 | const type = child.type;
|
3999 |
|
4000 | const hasDynamicTextChild = type === 5 ||
|
4001 | type === 8 ;
|
4002 | if (hasDynamicTextChild &&
|
4003 | getConstantType(child, context) === 0 ) {
|
4004 | patchFlag |= 1 ;
|
4005 | }
|
4006 |
|
4007 |
|
4008 | if (hasDynamicTextChild || type === 2 ) {
|
4009 | vnodeChildren = child;
|
4010 | }
|
4011 | else {
|
4012 | vnodeChildren = node.children;
|
4013 | }
|
4014 | }
|
4015 | else {
|
4016 | vnodeChildren = node.children;
|
4017 | }
|
4018 | }
|
4019 |
|
4020 | if (patchFlag !== 0) {
|
4021 | if ((process.env.NODE_ENV !== 'production')) {
|
4022 | if (patchFlag < 0) {
|
4023 |
|
4024 | vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
|
4025 | }
|
4026 | else {
|
4027 |
|
4028 | const flagNames = Object.keys(PatchFlagNames)
|
4029 | .map(Number)
|
4030 | .filter(n => n > 0 && patchFlag & n)
|
4031 | .map(n => PatchFlagNames[n])
|
4032 | .join(`, `);
|
4033 | vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
|
4034 | }
|
4035 | }
|
4036 | else {
|
4037 | vnodePatchFlag = String(patchFlag);
|
4038 | }
|
4039 | if (dynamicPropNames && dynamicPropNames.length) {
|
4040 | vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
|
4041 | }
|
4042 | }
|
4043 | node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false , node.loc);
|
4044 | };
|
4045 | };
|
4046 | function resolveComponentType(node, context, ssr = false) {
|
4047 | let { tag } = node;
|
4048 |
|
4049 | const isExplicitDynamic = isComponentTag(tag);
|
4050 | const isProp = findProp(node, 'is');
|
4051 | if (isProp) {
|
4052 | if (isExplicitDynamic ||
|
4053 | (isCompatEnabled("COMPILER_IS_ON_ELEMENT" , context))) {
|
4054 | const exp = isProp.type === 6
|
4055 | ? isProp.value && createSimpleExpression(isProp.value.content, true)
|
4056 | : isProp.exp;
|
4057 | if (exp) {
|
4058 | return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
4059 | exp
|
4060 | ]);
|
4061 | }
|
4062 | }
|
4063 | else if (isProp.type === 6 &&
|
4064 | isProp.value.content.startsWith('vue:')) {
|
4065 |
|
4066 |
|
4067 |
|
4068 |
|
4069 | tag = isProp.value.content.slice(4);
|
4070 | }
|
4071 | }
|
4072 |
|
4073 | const isDir = !isExplicitDynamic && findDir(node, 'is');
|
4074 | if (isDir && isDir.exp) {
|
4075 | return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
4076 | isDir.exp
|
4077 | ]);
|
4078 | }
|
4079 |
|
4080 | const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
|
4081 | if (builtIn) {
|
4082 |
|
4083 |
|
4084 | if (!ssr)
|
4085 | context.helper(builtIn);
|
4086 | return builtIn;
|
4087 | }
|
4088 |
|
4089 | context.helper(RESOLVE_COMPONENT);
|
4090 | context.components.add(tag);
|
4091 | return toValidAssetId(tag, `component`);
|
4092 | }
|
4093 | function buildProps(node, context, props = node.props, ssr = false) {
|
4094 | const { tag, loc: elementLoc } = node;
|
4095 | const isComponent = node.tagType === 1 ;
|
4096 | let properties = [];
|
4097 | const mergeArgs = [];
|
4098 | const runtimeDirectives = [];
|
4099 |
|
4100 | let patchFlag = 0;
|
4101 | let hasRef = false;
|
4102 | let hasClassBinding = false;
|
4103 | let hasStyleBinding = false;
|
4104 | let hasHydrationEventBinding = false;
|
4105 | let hasDynamicKeys = false;
|
4106 | let hasVnodeHook = false;
|
4107 | const dynamicPropNames = [];
|
4108 | const analyzePatchFlag = ({ key, value }) => {
|
4109 | if (isStaticExp(key)) {
|
4110 | const name = key.content;
|
4111 | const isEventHandler = isOn(name);
|
4112 | if (!isComponent &&
|
4113 | isEventHandler &&
|
4114 |
|
4115 |
|
4116 | name.toLowerCase() !== 'onclick' &&
|
4117 |
|
4118 | name !== 'onUpdate:modelValue' &&
|
4119 |
|
4120 | !isReservedProp(name)) {
|
4121 | hasHydrationEventBinding = true;
|
4122 | }
|
4123 | if (isEventHandler && isReservedProp(name)) {
|
4124 | hasVnodeHook = true;
|
4125 | }
|
4126 | if (value.type === 20 ||
|
4127 | ((value.type === 4 ||
|
4128 | value.type === 8 ) &&
|
4129 | getConstantType(value, context) > 0)) {
|
4130 |
|
4131 | return;
|
4132 | }
|
4133 | if (name === 'ref') {
|
4134 | hasRef = true;
|
4135 | }
|
4136 | else if (name === 'class' && !isComponent) {
|
4137 | hasClassBinding = true;
|
4138 | }
|
4139 | else if (name === 'style' && !isComponent) {
|
4140 | hasStyleBinding = true;
|
4141 | }
|
4142 | else if (name !== 'key' && !dynamicPropNames.includes(name)) {
|
4143 | dynamicPropNames.push(name);
|
4144 | }
|
4145 | }
|
4146 | else {
|
4147 | hasDynamicKeys = true;
|
4148 | }
|
4149 | };
|
4150 | for (let i = 0; i < props.length; i++) {
|
4151 |
|
4152 | const prop = props[i];
|
4153 | if (prop.type === 6 ) {
|
4154 | const { loc, name, value } = prop;
|
4155 | let isStatic = true;
|
4156 | if (name === 'ref') {
|
4157 | hasRef = true;
|
4158 | }
|
4159 |
|
4160 | if (name === 'is' &&
|
4161 | (isComponentTag(tag) ||
|
4162 | (value && value.content.startsWith('vue:')) ||
|
4163 | (isCompatEnabled("COMPILER_IS_ON_ELEMENT" , context)))) {
|
4164 | continue;
|
4165 | }
|
4166 | properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
|
4167 | }
|
4168 | else {
|
4169 |
|
4170 | const { name, arg, exp, loc } = prop;
|
4171 | const isVBind = name === 'bind';
|
4172 | const isVOn = name === 'on';
|
4173 |
|
4174 | if (name === 'slot') {
|
4175 | if (!isComponent) {
|
4176 | context.onError(createCompilerError(39 , loc));
|
4177 | }
|
4178 | continue;
|
4179 | }
|
4180 |
|
4181 | if (name === 'once') {
|
4182 | continue;
|
4183 | }
|
4184 |
|
4185 | if (name === 'is' ||
|
4186 | (isVBind &&
|
4187 | isBindKey(arg, 'is') &&
|
4188 | (isComponentTag(tag) ||
|
4189 | (isCompatEnabled("COMPILER_IS_ON_ELEMENT" , context))))) {
|
4190 | continue;
|
4191 | }
|
4192 |
|
4193 | if (isVOn && ssr) {
|
4194 | continue;
|
4195 | }
|
4196 |
|
4197 | if (!arg && (isVBind || isVOn)) {
|
4198 | hasDynamicKeys = true;
|
4199 | if (exp) {
|
4200 | if (properties.length) {
|
4201 | mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
|
4202 | properties = [];
|
4203 | }
|
4204 | if (isVBind) {
|
4205 | {
|
4206 |
|
4207 | if ((process.env.NODE_ENV !== 'production')) {
|
4208 | const hasOverridableKeys = mergeArgs.some(arg => {
|
4209 | if (arg.type === 15 ) {
|
4210 | return arg.properties.some(({ key }) => {
|
4211 | if (key.type !== 4 ||
|
4212 | !key.isStatic) {
|
4213 | return true;
|
4214 | }
|
4215 | return (key.content !== 'class' &&
|
4216 | key.content !== 'style' &&
|
4217 | !isOn(key.content));
|
4218 | });
|
4219 | }
|
4220 | else {
|
4221 |
|
4222 | return true;
|
4223 | }
|
4224 | });
|
4225 | if (hasOverridableKeys) {
|
4226 | checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" , context, loc);
|
4227 | }
|
4228 | }
|
4229 | if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" , context)) {
|
4230 | mergeArgs.unshift(exp);
|
4231 | continue;
|
4232 | }
|
4233 | }
|
4234 | mergeArgs.push(exp);
|
4235 | }
|
4236 | else {
|
4237 |
|
4238 | mergeArgs.push({
|
4239 | type: 14 ,
|
4240 | loc,
|
4241 | callee: context.helper(TO_HANDLERS),
|
4242 | arguments: [exp]
|
4243 | });
|
4244 | }
|
4245 | }
|
4246 | else {
|
4247 | context.onError(createCompilerError(isVBind
|
4248 | ? 33
|
4249 | : 34 , loc));
|
4250 | }
|
4251 | continue;
|
4252 | }
|
4253 | const directiveTransform = context.directiveTransforms[name];
|
4254 | if (directiveTransform) {
|
4255 |
|
4256 | const { props, needRuntime } = directiveTransform(prop, node, context);
|
4257 | !ssr && props.forEach(analyzePatchFlag);
|
4258 | properties.push(...props);
|
4259 | if (needRuntime) {
|
4260 | runtimeDirectives.push(prop);
|
4261 | if (isSymbol(needRuntime)) {
|
4262 | directiveImportMap.set(prop, needRuntime);
|
4263 | }
|
4264 | }
|
4265 | }
|
4266 | else {
|
4267 |
|
4268 | runtimeDirectives.push(prop);
|
4269 | }
|
4270 | }
|
4271 | if (prop.type === 6 &&
|
4272 | prop.name === 'ref' &&
|
4273 | context.scopes.vFor > 0 &&
|
4274 | checkCompatEnabled("COMPILER_V_FOR_REF" , context, prop.loc)) {
|
4275 | properties.push(createObjectProperty(createSimpleExpression('refInFor', true), createSimpleExpression('true', false)));
|
4276 | }
|
4277 | }
|
4278 | let propsExpression = undefined;
|
4279 |
|
4280 | if (mergeArgs.length) {
|
4281 | if (properties.length) {
|
4282 | mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
|
4283 | }
|
4284 | if (mergeArgs.length > 1) {
|
4285 | propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);
|
4286 | }
|
4287 | else {
|
4288 |
|
4289 | propsExpression = mergeArgs[0];
|
4290 | }
|
4291 | }
|
4292 | else if (properties.length) {
|
4293 | propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);
|
4294 | }
|
4295 |
|
4296 | if (hasDynamicKeys) {
|
4297 | patchFlag |= 16 ;
|
4298 | }
|
4299 | else {
|
4300 | if (hasClassBinding) {
|
4301 | patchFlag |= 2 ;
|
4302 | }
|
4303 | if (hasStyleBinding) {
|
4304 | patchFlag |= 4 ;
|
4305 | }
|
4306 | if (dynamicPropNames.length) {
|
4307 | patchFlag |= 8 ;
|
4308 | }
|
4309 | if (hasHydrationEventBinding) {
|
4310 | patchFlag |= 32 ;
|
4311 | }
|
4312 | }
|
4313 | if ((patchFlag === 0 || patchFlag === 32 ) &&
|
4314 | (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
|
4315 | patchFlag |= 512 ;
|
4316 | }
|
4317 | return {
|
4318 | props: propsExpression,
|
4319 | directives: runtimeDirectives,
|
4320 | patchFlag,
|
4321 | dynamicPropNames
|
4322 | };
|
4323 | }
|
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 |
|
4329 |
|
4330 | function dedupeProperties(properties) {
|
4331 | const knownProps = new Map();
|
4332 | const deduped = [];
|
4333 | for (let i = 0; i < properties.length; i++) {
|
4334 | const prop = properties[i];
|
4335 |
|
4336 | if (prop.key.type === 8 || !prop.key.isStatic) {
|
4337 | deduped.push(prop);
|
4338 | continue;
|
4339 | }
|
4340 | const name = prop.key.content;
|
4341 | const existing = knownProps.get(name);
|
4342 | if (existing) {
|
4343 | if (name === 'style' || name === 'class' || name.startsWith('on')) {
|
4344 | mergeAsArray(existing, prop);
|
4345 | }
|
4346 |
|
4347 | }
|
4348 | else {
|
4349 | knownProps.set(name, prop);
|
4350 | deduped.push(prop);
|
4351 | }
|
4352 | }
|
4353 | return deduped;
|
4354 | }
|
4355 | function mergeAsArray(existing, incoming) {
|
4356 | if (existing.value.type === 17 ) {
|
4357 | existing.value.elements.push(incoming.value);
|
4358 | }
|
4359 | else {
|
4360 | existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);
|
4361 | }
|
4362 | }
|
4363 | function buildDirectiveArgs(dir, context) {
|
4364 | const dirArgs = [];
|
4365 | const runtime = directiveImportMap.get(dir);
|
4366 | if (runtime) {
|
4367 |
|
4368 | dirArgs.push(context.helperString(runtime));
|
4369 | }
|
4370 | else {
|
4371 | {
|
4372 |
|
4373 | context.helper(RESOLVE_DIRECTIVE);
|
4374 | context.directives.add(dir.name);
|
4375 | dirArgs.push(toValidAssetId(dir.name, `directive`));
|
4376 | }
|
4377 | }
|
4378 | const { loc } = dir;
|
4379 | if (dir.exp)
|
4380 | dirArgs.push(dir.exp);
|
4381 | if (dir.arg) {
|
4382 | if (!dir.exp) {
|
4383 | dirArgs.push(`void 0`);
|
4384 | }
|
4385 | dirArgs.push(dir.arg);
|
4386 | }
|
4387 | if (Object.keys(dir.modifiers).length) {
|
4388 | if (!dir.arg) {
|
4389 | if (!dir.exp) {
|
4390 | dirArgs.push(`void 0`);
|
4391 | }
|
4392 | dirArgs.push(`void 0`);
|
4393 | }
|
4394 | const trueExpression = createSimpleExpression(`true`, false, loc);
|
4395 | dirArgs.push(createObjectExpression(dir.modifiers.map(modifier => createObjectProperty(modifier, trueExpression)), loc));
|
4396 | }
|
4397 | return createArrayExpression(dirArgs, dir.loc);
|
4398 | }
|
4399 | function stringifyDynamicPropNames(props) {
|
4400 | let propsNamesString = `[`;
|
4401 | for (let i = 0, l = props.length; i < l; i++) {
|
4402 | propsNamesString += JSON.stringify(props[i]);
|
4403 | if (i < l - 1)
|
4404 | propsNamesString += ', ';
|
4405 | }
|
4406 | return propsNamesString + `]`;
|
4407 | }
|
4408 | function isComponentTag(tag) {
|
4409 | return tag[0].toLowerCase() + tag.slice(1) === 'component';
|
4410 | }
|
4411 |
|
4412 | (process.env.NODE_ENV !== 'production')
|
4413 | ? Object.freeze({})
|
4414 | : {};
|
4415 | (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
|
4416 | const cacheStringFunction = (fn) => {
|
4417 | const cache = Object.create(null);
|
4418 | return ((str) => {
|
4419 | const hit = cache[str];
|
4420 | return hit || (cache[str] = fn(str));
|
4421 | });
|
4422 | };
|
4423 | const camelizeRE = /-(\w)/g;
|
4424 |
|
4425 |
|
4426 |
|
4427 | const camelize = cacheStringFunction((str) => {
|
4428 | return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));
|
4429 | });
|
4430 |
|
4431 | const transformSlotOutlet = (node, context) => {
|
4432 | if (isSlotOutlet(node)) {
|
4433 | const { children, loc } = node;
|
4434 | const { slotName, slotProps } = processSlotOutlet(node, context);
|
4435 | const slotArgs = [
|
4436 | context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
|
4437 | slotName
|
4438 | ];
|
4439 | if (slotProps) {
|
4440 | slotArgs.push(slotProps);
|
4441 | }
|
4442 | if (children.length) {
|
4443 | if (!slotProps) {
|
4444 | slotArgs.push(`{}`);
|
4445 | }
|
4446 | slotArgs.push(createFunctionExpression([], children, false, false, loc));
|
4447 | }
|
4448 | if (context.scopeId && !context.slotted) {
|
4449 | if (!slotProps) {
|
4450 | slotArgs.push(`{}`);
|
4451 | }
|
4452 | if (!children.length) {
|
4453 | slotArgs.push(`undefined`);
|
4454 | }
|
4455 | slotArgs.push(`true`);
|
4456 | }
|
4457 | node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);
|
4458 | }
|
4459 | };
|
4460 | function processSlotOutlet(node, context) {
|
4461 | let slotName = `"default"`;
|
4462 | let slotProps = undefined;
|
4463 | const nonNameProps = [];
|
4464 | for (let i = 0; i < node.props.length; i++) {
|
4465 | const p = node.props[i];
|
4466 | if (p.type === 6 ) {
|
4467 | if (p.value) {
|
4468 | if (p.name === 'name') {
|
4469 | slotName = JSON.stringify(p.value.content);
|
4470 | }
|
4471 | else {
|
4472 | p.name = camelize(p.name);
|
4473 | nonNameProps.push(p);
|
4474 | }
|
4475 | }
|
4476 | }
|
4477 | else {
|
4478 | if (p.name === 'bind' && isBindKey(p.arg, 'name')) {
|
4479 | if (p.exp)
|
4480 | slotName = p.exp;
|
4481 | }
|
4482 | else {
|
4483 | if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {
|
4484 | p.arg.content = camelize(p.arg.content);
|
4485 | }
|
4486 | nonNameProps.push(p);
|
4487 | }
|
4488 | }
|
4489 | }
|
4490 | if (nonNameProps.length > 0) {
|
4491 | const { props, directives } = buildProps(node, context, nonNameProps);
|
4492 | slotProps = props;
|
4493 | if (directives.length) {
|
4494 | context.onError(createCompilerError(35 , directives[0].loc));
|
4495 | }
|
4496 | }
|
4497 | return {
|
4498 | slotName,
|
4499 | slotProps
|
4500 | };
|
4501 | }
|
4502 |
|
4503 | const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/;
|
4504 | const transformOn = (dir, node, context, augmentor) => {
|
4505 | const { loc, modifiers, arg } = dir;
|
4506 | if (!dir.exp && !modifiers.length) {
|
4507 | context.onError(createCompilerError(34 , loc));
|
4508 | }
|
4509 | let eventName;
|
4510 | if (arg.type === 4 ) {
|
4511 | if (arg.isStatic) {
|
4512 | const rawName = arg.content;
|
4513 |
|
4514 | eventName = createSimpleExpression(toHandlerKey(camelize$1(rawName)), true, arg.loc);
|
4515 | }
|
4516 | else {
|
4517 |
|
4518 | eventName = createCompoundExpression([
|
4519 | `${context.helperString(TO_HANDLER_KEY)}(`,
|
4520 | arg,
|
4521 | `)`
|
4522 | ]);
|
4523 | }
|
4524 | }
|
4525 | else {
|
4526 |
|
4527 | eventName = arg;
|
4528 | eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
|
4529 | eventName.children.push(`)`);
|
4530 | }
|
4531 |
|
4532 | let exp = dir.exp;
|
4533 | if (exp && !exp.content.trim()) {
|
4534 | exp = undefined;
|
4535 | }
|
4536 | let shouldCache = context.cacheHandlers && !exp;
|
4537 | if (exp) {
|
4538 | const isMemberExp = isMemberExpression(exp.content);
|
4539 | const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
|
4540 | const hasMultipleStatements = exp.content.includes(`;`);
|
4541 | if ((process.env.NODE_ENV !== 'production') && true) {
|
4542 | validateBrowserExpression(exp, context, false, hasMultipleStatements);
|
4543 | }
|
4544 | if (isInlineStatement || (shouldCache && isMemberExp)) {
|
4545 |
|
4546 | exp = createCompoundExpression([
|
4547 | `${isInlineStatement
|
4548 | ? `$event`
|
4549 | : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
|
4550 | exp,
|
4551 | hasMultipleStatements ? `}` : `)`
|
4552 | ]);
|
4553 | }
|
4554 | }
|
4555 | let ret = {
|
4556 | props: [
|
4557 | createObjectProperty(eventName, exp || createSimpleExpression(`() => {}`, false, loc))
|
4558 | ]
|
4559 | };
|
4560 |
|
4561 | if (augmentor) {
|
4562 | ret = augmentor(ret);
|
4563 | }
|
4564 | if (shouldCache) {
|
4565 |
|
4566 |
|
4567 |
|
4568 | ret.props[0].value = context.cache(ret.props[0].value);
|
4569 | }
|
4570 | return ret;
|
4571 | };
|
4572 |
|
4573 |
|
4574 |
|
4575 |
|
4576 | const transformBind = (dir, _node, context) => {
|
4577 | const { exp, modifiers, loc } = dir;
|
4578 | const arg = dir.arg;
|
4579 | if (arg.type !== 4 ) {
|
4580 | arg.children.unshift(`(`);
|
4581 | arg.children.push(`) || ""`);
|
4582 | }
|
4583 | else if (!arg.isStatic) {
|
4584 | arg.content = `${arg.content} || ""`;
|
4585 | }
|
4586 |
|
4587 |
|
4588 | if (modifiers.includes('camel')) {
|
4589 | if (arg.type === 4 ) {
|
4590 | if (arg.isStatic) {
|
4591 | arg.content = camelize$1(arg.content);
|
4592 | }
|
4593 | else {
|
4594 | arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
4595 | }
|
4596 | }
|
4597 | else {
|
4598 | arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
4599 | arg.children.push(`)`);
|
4600 | }
|
4601 | }
|
4602 | if (!exp ||
|
4603 | (exp.type === 4 && !exp.content.trim())) {
|
4604 | context.onError(createCompilerError(33 , loc));
|
4605 | return {
|
4606 | props: [createObjectProperty(arg, createSimpleExpression('', true, loc))]
|
4607 | };
|
4608 | }
|
4609 | return {
|
4610 | props: [createObjectProperty(arg, exp)]
|
4611 | };
|
4612 | };
|
4613 |
|
4614 |
|
4615 |
|
4616 | const transformText = (node, context) => {
|
4617 | if (node.type === 0 ||
|
4618 | node.type === 1 ||
|
4619 | node.type === 11 ||
|
4620 | node.type === 10 ) {
|
4621 |
|
4622 |
|
4623 | return () => {
|
4624 | const children = node.children;
|
4625 | let currentContainer = undefined;
|
4626 | let hasText = false;
|
4627 | for (let i = 0; i < children.length; i++) {
|
4628 | const child = children[i];
|
4629 | if (isText(child)) {
|
4630 | hasText = true;
|
4631 | for (let j = i + 1; j < children.length; j++) {
|
4632 | const next = children[j];
|
4633 | if (isText(next)) {
|
4634 | if (!currentContainer) {
|
4635 | currentContainer = children[i] = {
|
4636 | type: 8 ,
|
4637 | loc: child.loc,
|
4638 | children: [child]
|
4639 | };
|
4640 | }
|
4641 |
|
4642 | currentContainer.children.push(` + `, next);
|
4643 | children.splice(j, 1);
|
4644 | j--;
|
4645 | }
|
4646 | else {
|
4647 | currentContainer = undefined;
|
4648 | break;
|
4649 | }
|
4650 | }
|
4651 | }
|
4652 | }
|
4653 | if (!hasText ||
|
4654 |
|
4655 |
|
4656 |
|
4657 |
|
4658 | (children.length === 1 &&
|
4659 | (node.type === 0 ||
|
4660 | (node.type === 1 &&
|
4661 | node.tagType === 0 &&
|
4662 |
|
4663 |
|
4664 |
|
4665 |
|
4666 |
|
4667 | !node.props.find(p => p.type === 7 &&
|
4668 | !context.directiveTransforms[p.name]) &&
|
4669 |
|
4670 |
|
4671 |
|
4672 | !(node.tag === 'template'))))) {
|
4673 | return;
|
4674 | }
|
4675 |
|
4676 |
|
4677 | for (let i = 0; i < children.length; i++) {
|
4678 | const child = children[i];
|
4679 | if (isText(child) || child.type === 8 ) {
|
4680 | const callArgs = [];
|
4681 |
|
4682 |
|
4683 | if (child.type !== 2 || child.content !== ' ') {
|
4684 | callArgs.push(child);
|
4685 | }
|
4686 |
|
4687 | if (!context.ssr &&
|
4688 | getConstantType(child, context) === 0 ) {
|
4689 | callArgs.push(1 +
|
4690 | ((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[1 /* TEXT */]} */` : ``));
|
4691 | }
|
4692 | children[i] = {
|
4693 | type: 12 ,
|
4694 | content: child,
|
4695 | loc: child.loc,
|
4696 | codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)
|
4697 | };
|
4698 | }
|
4699 | }
|
4700 | };
|
4701 | }
|
4702 | };
|
4703 |
|
4704 | const seen = new WeakSet();
|
4705 | const transformOnce = (node, context) => {
|
4706 | if (node.type === 1 && findDir(node, 'once', true)) {
|
4707 | if (seen.has(node)) {
|
4708 | return;
|
4709 | }
|
4710 | seen.add(node);
|
4711 | context.helper(SET_BLOCK_TRACKING);
|
4712 | return () => {
|
4713 | const cur = context.currentNode;
|
4714 | if (cur.codegenNode) {
|
4715 | cur.codegenNode = context.cache(cur.codegenNode, true );
|
4716 | }
|
4717 | };
|
4718 | }
|
4719 | };
|
4720 |
|
4721 | const transformModel = (dir, node, context) => {
|
4722 | const { exp, arg } = dir;
|
4723 | if (!exp) {
|
4724 | context.onError(createCompilerError(40 , dir.loc));
|
4725 | return createTransformProps();
|
4726 | }
|
4727 | const rawExp = exp.loc.source;
|
4728 | const expString = exp.type === 4 ? exp.content : rawExp;
|
4729 | const maybeRef = !true ;
|
4730 | if (!expString.trim() || (!isMemberExpression(expString) && !maybeRef)) {
|
4731 | context.onError(createCompilerError(41 , exp.loc));
|
4732 | return createTransformProps();
|
4733 | }
|
4734 | const propName = arg ? arg : createSimpleExpression('modelValue', true);
|
4735 | const eventName = arg
|
4736 | ? isStaticExp(arg)
|
4737 | ? `onUpdate:${arg.content}`
|
4738 | : createCompoundExpression(['"onUpdate:" + ', arg])
|
4739 | : `onUpdate:modelValue`;
|
4740 | let assignmentExp;
|
4741 | const eventArg = context.isTS ? `($event: any)` : `$event`;
|
4742 | {
|
4743 | assignmentExp = createCompoundExpression([
|
4744 | `${eventArg} => (`,
|
4745 | exp,
|
4746 | ` = $event)`
|
4747 | ]);
|
4748 | }
|
4749 | const props = [
|
4750 |
|
4751 | createObjectProperty(propName, dir.exp),
|
4752 |
|
4753 | createObjectProperty(eventName, assignmentExp)
|
4754 | ];
|
4755 |
|
4756 | if (dir.modifiers.length && node.tagType === 1 ) {
|
4757 | const modifiers = dir.modifiers
|
4758 | .map(m => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`)
|
4759 | .join(`, `);
|
4760 | const modifiersKey = arg
|
4761 | ? isStaticExp(arg)
|
4762 | ? `${arg.content}Modifiers`
|
4763 | : createCompoundExpression([arg, ' + "Modifiers"'])
|
4764 | : `modelModifiers`;
|
4765 | props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2 )));
|
4766 | }
|
4767 | return createTransformProps(props);
|
4768 | };
|
4769 | function createTransformProps(props = []) {
|
4770 | return { props };
|
4771 | }
|
4772 |
|
4773 | const validDivisionCharRE = /[\w).+\-_$\]]/;
|
4774 | const transformFilter = (node, context) => {
|
4775 | if (!isCompatEnabled("COMPILER_FILTER" , context)) {
|
4776 | return;
|
4777 | }
|
4778 | if (node.type === 5 ) {
|
4779 |
|
4780 |
|
4781 | rewriteFilter(node.content, context);
|
4782 | }
|
4783 | if (node.type === 1 ) {
|
4784 | node.props.forEach((prop) => {
|
4785 | if (prop.type === 7 &&
|
4786 | prop.name !== 'for' &&
|
4787 | prop.exp) {
|
4788 | rewriteFilter(prop.exp, context);
|
4789 | }
|
4790 | });
|
4791 | }
|
4792 | };
|
4793 | function rewriteFilter(node, context) {
|
4794 | if (node.type === 4 ) {
|
4795 | parseFilter(node, context);
|
4796 | }
|
4797 | else {
|
4798 | for (let i = 0; i < node.children.length; i++) {
|
4799 | const child = node.children[i];
|
4800 | if (typeof child !== 'object')
|
4801 | continue;
|
4802 | if (child.type === 4 ) {
|
4803 | parseFilter(child, context);
|
4804 | }
|
4805 | else if (child.type === 8 ) {
|
4806 | rewriteFilter(node, context);
|
4807 | }
|
4808 | else if (child.type === 5 ) {
|
4809 | rewriteFilter(child.content, context);
|
4810 | }
|
4811 | }
|
4812 | }
|
4813 | }
|
4814 | function parseFilter(node, context) {
|
4815 | const exp = node.content;
|
4816 | let inSingle = false;
|
4817 | let inDouble = false;
|
4818 | let inTemplateString = false;
|
4819 | let inRegex = false;
|
4820 | let curly = 0;
|
4821 | let square = 0;
|
4822 | let paren = 0;
|
4823 | let lastFilterIndex = 0;
|
4824 | let c, prev, i, expression, filters = [];
|
4825 | for (i = 0; i < exp.length; i++) {
|
4826 | prev = c;
|
4827 | c = exp.charCodeAt(i);
|
4828 | if (inSingle) {
|
4829 | if (c === 0x27 && prev !== 0x5c)
|
4830 | inSingle = false;
|
4831 | }
|
4832 | else if (inDouble) {
|
4833 | if (c === 0x22 && prev !== 0x5c)
|
4834 | inDouble = false;
|
4835 | }
|
4836 | else if (inTemplateString) {
|
4837 | if (c === 0x60 && prev !== 0x5c)
|
4838 | inTemplateString = false;
|
4839 | }
|
4840 | else if (inRegex) {
|
4841 | if (c === 0x2f && prev !== 0x5c)
|
4842 | inRegex = false;
|
4843 | }
|
4844 | else if (c === 0x7c &&
|
4845 | exp.charCodeAt(i + 1) !== 0x7c &&
|
4846 | exp.charCodeAt(i - 1) !== 0x7c &&
|
4847 | !curly &&
|
4848 | !square &&
|
4849 | !paren) {
|
4850 | if (expression === undefined) {
|
4851 |
|
4852 | lastFilterIndex = i + 1;
|
4853 | expression = exp.slice(0, i).trim();
|
4854 | }
|
4855 | else {
|
4856 | pushFilter();
|
4857 | }
|
4858 | }
|
4859 | else {
|
4860 | switch (c) {
|
4861 | case 0x22:
|
4862 | inDouble = true;
|
4863 | break;
|
4864 | case 0x27:
|
4865 | inSingle = true;
|
4866 | break;
|
4867 | case 0x60:
|
4868 | inTemplateString = true;
|
4869 | break;
|
4870 | case 0x28:
|
4871 | paren++;
|
4872 | break;
|
4873 | case 0x29:
|
4874 | paren--;
|
4875 | break;
|
4876 | case 0x5b:
|
4877 | square++;
|
4878 | break;
|
4879 | case 0x5d:
|
4880 | square--;
|
4881 | break;
|
4882 | case 0x7b:
|
4883 | curly++;
|
4884 | break;
|
4885 | case 0x7d:
|
4886 | curly--;
|
4887 | break;
|
4888 | }
|
4889 | if (c === 0x2f) {
|
4890 |
|
4891 | let j = i - 1;
|
4892 | let p;
|
4893 |
|
4894 | for (; j >= 0; j--) {
|
4895 | p = exp.charAt(j);
|
4896 | if (p !== ' ')
|
4897 | break;
|
4898 | }
|
4899 | if (!p || !validDivisionCharRE.test(p)) {
|
4900 | inRegex = true;
|
4901 | }
|
4902 | }
|
4903 | }
|
4904 | }
|
4905 | if (expression === undefined) {
|
4906 | expression = exp.slice(0, i).trim();
|
4907 | }
|
4908 | else if (lastFilterIndex !== 0) {
|
4909 | pushFilter();
|
4910 | }
|
4911 | function pushFilter() {
|
4912 | filters.push(exp.slice(lastFilterIndex, i).trim());
|
4913 | lastFilterIndex = i + 1;
|
4914 | }
|
4915 | if (filters.length) {
|
4916 | (process.env.NODE_ENV !== 'production') &&
|
4917 | warnDeprecation("COMPILER_FILTER" , context, node.loc);
|
4918 | for (i = 0; i < filters.length; i++) {
|
4919 | expression = wrapFilter(expression, filters[i], context);
|
4920 | }
|
4921 | node.content = expression;
|
4922 | }
|
4923 | }
|
4924 | function wrapFilter(exp, filter, context) {
|
4925 | context.helper(RESOLVE_FILTER);
|
4926 | const i = filter.indexOf('(');
|
4927 | if (i < 0) {
|
4928 | context.filters.add(filter);
|
4929 | return `${toValidAssetId(filter, 'filter')}(${exp})`;
|
4930 | }
|
4931 | else {
|
4932 | const name = filter.slice(0, i);
|
4933 | const args = filter.slice(i + 1);
|
4934 | context.filters.add(name);
|
4935 | return `${toValidAssetId(name, 'filter')}(${exp}${args !== ')' ? ',' + args : args}`;
|
4936 | }
|
4937 | }
|
4938 |
|
4939 | function getBaseTransformPreset(prefixIdentifiers) {
|
4940 | return [
|
4941 | [
|
4942 | transformOnce,
|
4943 | transformIf,
|
4944 | transformFor,
|
4945 | ...([transformFilter] ),
|
4946 | ...((process.env.NODE_ENV !== 'production')
|
4947 | ? [transformExpression]
|
4948 | : []),
|
4949 | transformSlotOutlet,
|
4950 | transformElement,
|
4951 | trackSlotScopes,
|
4952 | transformText
|
4953 | ],
|
4954 | {
|
4955 | on: transformOn,
|
4956 | bind: transformBind,
|
4957 | model: transformModel
|
4958 | }
|
4959 | ];
|
4960 | }
|
4961 |
|
4962 |
|
4963 | function baseCompile(template, options = {}) {
|
4964 | const onError = options.onError || defaultOnError;
|
4965 | const isModuleMode = options.mode === 'module';
|
4966 |
|
4967 | {
|
4968 | if (options.prefixIdentifiers === true) {
|
4969 | onError(createCompilerError(45 ));
|
4970 | }
|
4971 | else if (isModuleMode) {
|
4972 | onError(createCompilerError(46 ));
|
4973 | }
|
4974 | }
|
4975 | const prefixIdentifiers = !true ;
|
4976 | if (options.cacheHandlers) {
|
4977 | onError(createCompilerError(47 ));
|
4978 | }
|
4979 | if (options.scopeId && !isModuleMode) {
|
4980 | onError(createCompilerError(48 ));
|
4981 | }
|
4982 | const ast = isString(template) ? baseParse(template, options) : template;
|
4983 | const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
4984 | transform(ast, extend({}, options, {
|
4985 | prefixIdentifiers,
|
4986 | nodeTransforms: [
|
4987 | ...nodeTransforms,
|
4988 | ...(options.nodeTransforms || [])
|
4989 | ],
|
4990 | directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {}
|
4991 | )
|
4992 | }));
|
4993 | return generate(ast, extend({}, options, {
|
4994 | prefixIdentifiers
|
4995 | }));
|
4996 | }
|
4997 |
|
4998 | const noopDirectiveTransform = () => ({ props: [] });
|
4999 |
|
5000 | var compilerCore_esmBundler = {
|
5001 | __proto__: null,
|
5002 | BASE_TRANSITION: BASE_TRANSITION,
|
5003 | CAMELIZE: CAMELIZE,
|
5004 | CAPITALIZE: CAPITALIZE,
|
5005 | CREATE_BLOCK: CREATE_BLOCK,
|
5006 | CREATE_COMMENT: CREATE_COMMENT,
|
5007 | CREATE_SLOTS: CREATE_SLOTS,
|
5008 | CREATE_STATIC: CREATE_STATIC,
|
5009 | CREATE_TEXT: CREATE_TEXT,
|
5010 | CREATE_VNODE: CREATE_VNODE,
|
5011 | FRAGMENT: FRAGMENT,
|
5012 | IS_REF: IS_REF,
|
5013 | KEEP_ALIVE: KEEP_ALIVE,
|
5014 | MERGE_PROPS: MERGE_PROPS,
|
5015 | OPEN_BLOCK: OPEN_BLOCK,
|
5016 | POP_SCOPE_ID: POP_SCOPE_ID,
|
5017 | PUSH_SCOPE_ID: PUSH_SCOPE_ID,
|
5018 | RENDER_LIST: RENDER_LIST,
|
5019 | RENDER_SLOT: RENDER_SLOT,
|
5020 | RESOLVE_COMPONENT: RESOLVE_COMPONENT,
|
5021 | RESOLVE_DIRECTIVE: RESOLVE_DIRECTIVE,
|
5022 | RESOLVE_DYNAMIC_COMPONENT: RESOLVE_DYNAMIC_COMPONENT,
|
5023 | RESOLVE_FILTER: RESOLVE_FILTER,
|
5024 | SET_BLOCK_TRACKING: SET_BLOCK_TRACKING,
|
5025 | SUSPENSE: SUSPENSE,
|
5026 | TELEPORT: TELEPORT,
|
5027 | TO_DISPLAY_STRING: TO_DISPLAY_STRING,
|
5028 | TO_HANDLERS: TO_HANDLERS,
|
5029 | TO_HANDLER_KEY: TO_HANDLER_KEY,
|
5030 | UNREF: UNREF,
|
5031 | WITH_CTX: WITH_CTX,
|
5032 | WITH_DIRECTIVES: WITH_DIRECTIVES,
|
5033 | WITH_SCOPE_ID: WITH_SCOPE_ID,
|
5034 | advancePositionWithClone: advancePositionWithClone,
|
5035 | advancePositionWithMutation: advancePositionWithMutation,
|
5036 | assert: assert,
|
5037 | baseCompile: baseCompile,
|
5038 | baseParse: baseParse,
|
5039 | buildProps: buildProps,
|
5040 | buildSlots: buildSlots,
|
5041 | checkCompatEnabled: checkCompatEnabled,
|
5042 | createArrayExpression: createArrayExpression,
|
5043 | createAssignmentExpression: createAssignmentExpression,
|
5044 | createBlockStatement: createBlockStatement,
|
5045 | createCacheExpression: createCacheExpression,
|
5046 | createCallExpression: createCallExpression,
|
5047 | createCompilerError: createCompilerError,
|
5048 | createCompoundExpression: createCompoundExpression,
|
5049 | createConditionalExpression: createConditionalExpression,
|
5050 | createForLoopParams: createForLoopParams,
|
5051 | createFunctionExpression: createFunctionExpression,
|
5052 | createIfStatement: createIfStatement,
|
5053 | createInterpolation: createInterpolation,
|
5054 | createObjectExpression: createObjectExpression,
|
5055 | createObjectProperty: createObjectProperty,
|
5056 | createReturnStatement: createReturnStatement,
|
5057 | createRoot: createRoot,
|
5058 | createSequenceExpression: createSequenceExpression,
|
5059 | createSimpleExpression: createSimpleExpression,
|
5060 | createStructuralDirectiveTransform: createStructuralDirectiveTransform,
|
5061 | createTemplateLiteral: createTemplateLiteral,
|
5062 | createTransformContext: createTransformContext,
|
5063 | createVNodeCall: createVNodeCall,
|
5064 | findDir: findDir,
|
5065 | findProp: findProp,
|
5066 | generate: generate,
|
5067 | getBaseTransformPreset: getBaseTransformPreset,
|
5068 | getInnerRange: getInnerRange,
|
5069 | hasDynamicKeyVBind: hasDynamicKeyVBind,
|
5070 | hasScopeRef: hasScopeRef,
|
5071 | helperNameMap: helperNameMap,
|
5072 | injectProp: injectProp,
|
5073 | isBindKey: isBindKey,
|
5074 | isBuiltInType: isBuiltInType,
|
5075 | isCoreComponent: isCoreComponent,
|
5076 | isMemberExpression: isMemberExpression,
|
5077 | isSimpleIdentifier: isSimpleIdentifier,
|
5078 | isSlotOutlet: isSlotOutlet,
|
5079 | isStaticExp: isStaticExp,
|
5080 | isTemplateNode: isTemplateNode,
|
5081 | isText: isText,
|
5082 | isVSlot: isVSlot,
|
5083 | locStub: locStub,
|
5084 | noopDirectiveTransform: noopDirectiveTransform,
|
5085 | processExpression: processExpression,
|
5086 | processFor: processFor,
|
5087 | processIf: processIf,
|
5088 | processSlotOutlet: processSlotOutlet,
|
5089 | registerRuntimeHelpers: registerRuntimeHelpers,
|
5090 | resolveComponentType: resolveComponentType,
|
5091 | toValidAssetId: toValidAssetId,
|
5092 | trackSlotScopes: trackSlotScopes,
|
5093 | trackVForSlotScopes: trackVForSlotScopes,
|
5094 | transform: transform,
|
5095 | transformBind: transformBind,
|
5096 | transformElement: transformElement,
|
5097 | transformExpression: transformExpression,
|
5098 | transformModel: transformModel,
|
5099 | transformOn: transformOn,
|
5100 | traverseNode: traverseNode,
|
5101 | warnDeprecation: warnDeprecation,
|
5102 | generateCodeFrame: generateCodeFrame
|
5103 | };
|
5104 |
|
5105 | var require$$0 = build.getAugmentedNamespace(compilerCore_esmBundler);
|
5106 |
|
5107 | var require$$1 = build.getAugmentedNamespace(shared_esmBundler);
|
5108 |
|
5109 | (function (exports) {
|
5110 |
|
5111 | Object.defineProperty(exports, '__esModule', { value: true });
|
5112 |
|
5113 | var compilerCore = require$$0;
|
5114 | var shared = require$$1;
|
5115 |
|
5116 | const V_MODEL_RADIO = Symbol(`vModelRadio` );
|
5117 | const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
|
5118 | const V_MODEL_TEXT = Symbol(`vModelText` );
|
5119 | const V_MODEL_SELECT = Symbol(`vModelSelect` );
|
5120 | const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
|
5121 | const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
|
5122 | const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
|
5123 | const V_SHOW = Symbol(`vShow` );
|
5124 | const TRANSITION = Symbol(`Transition` );
|
5125 | const TRANSITION_GROUP = Symbol(`TransitionGroup` );
|
5126 | compilerCore.registerRuntimeHelpers({
|
5127 | [V_MODEL_RADIO]: `vModelRadio`,
|
5128 | [V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
5129 | [V_MODEL_TEXT]: `vModelText`,
|
5130 | [V_MODEL_SELECT]: `vModelSelect`,
|
5131 | [V_MODEL_DYNAMIC]: `vModelDynamic`,
|
5132 | [V_ON_WITH_MODIFIERS]: `withModifiers`,
|
5133 | [V_ON_WITH_KEYS]: `withKeys`,
|
5134 | [V_SHOW]: `vShow`,
|
5135 | [TRANSITION]: `Transition`,
|
5136 | [TRANSITION_GROUP]: `TransitionGroup`
|
5137 | });
|
5138 |
|
5139 | var namedCharacterReferences = {
|
5140 | GT: ">",
|
5141 | gt: ">",
|
5142 | LT: "<",
|
5143 | lt: "<",
|
5144 | "ac;": "∾",
|
5145 | "af;": "",
|
5146 | AMP: "&",
|
5147 | amp: "&",
|
5148 | "ap;": "≈",
|
5149 | "DD;": "ⅅ",
|
5150 | "dd;": "ⅆ",
|
5151 | deg: "°",
|
5152 | "ee;": "ⅇ",
|
5153 | "eg;": "⪚",
|
5154 | "el;": "⪙",
|
5155 | ETH: "Ð",
|
5156 | eth: "ð",
|
5157 | "gE;": "≧",
|
5158 | "ge;": "≥",
|
5159 | "Gg;": "⋙",
|
5160 | "gg;": "≫",
|
5161 | "gl;": "≷",
|
5162 | "GT;": ">",
|
5163 | "Gt;": "≫",
|
5164 | "gt;": ">",
|
5165 | "ic;": "",
|
5166 | "ii;": "ⅈ",
|
5167 | "Im;": "ℑ",
|
5168 | "in;": "∈",
|
5169 | "it;": "",
|
5170 | "lE;": "≦",
|
5171 | "le;": "≤",
|
5172 | "lg;": "≶",
|
5173 | "Ll;": "⋘",
|
5174 | "ll;": "≪",
|
5175 | "LT;": "<",
|
5176 | "Lt;": "≪",
|
5177 | "lt;": "<",
|
5178 | "mp;": "∓",
|
5179 | "Mu;": "Μ",
|
5180 | "mu;": "μ",
|
5181 | "ne;": "≠",
|
5182 | "ni;": "∋",
|
5183 | not: "¬",
|
5184 | "Nu;": "Ν",
|
5185 | "nu;": "ν",
|
5186 | "Or;": "⩔",
|
5187 | "or;": "∨",
|
5188 | "oS;": "Ⓢ",
|
5189 | "Pi;": "Π",
|
5190 | "pi;": "π",
|
5191 | "pm;": "±",
|
5192 | "Pr;": "⪻",
|
5193 | "pr;": "≺",
|
5194 | "Re;": "ℜ",
|
5195 | REG: "®",
|
5196 | reg: "®",
|
5197 | "rx;": "℞",
|
5198 | "Sc;": "⪼",
|
5199 | "sc;": "≻",
|
5200 | shy: "",
|
5201 | uml: "¨",
|
5202 | "wp;": "℘",
|
5203 | "wr;": "≀",
|
5204 | "Xi;": "Ξ",
|
5205 | "xi;": "ξ",
|
5206 | yen: "¥",
|
5207 | "acd;": "∿",
|
5208 | "acE;": "∾̳",
|
5209 | "Acy;": "А",
|
5210 | "acy;": "а",
|
5211 | "Afr;": "𝔄",
|
5212 | "afr;": "𝔞",
|
5213 | "AMP;": "&",
|
5214 | "amp;": "&",
|
5215 | "And;": "⩓",
|
5216 | "and;": "∧",
|
5217 | "ang;": "∠",
|
5218 | "apE;": "⩰",
|
5219 | "ape;": "≊",
|
5220 | "ast;": "*",
|
5221 | Auml: "Ä",
|
5222 | auml: "ä",
|
5223 | "Bcy;": "Б",
|
5224 | "bcy;": "б",
|
5225 | "Bfr;": "𝔅",
|
5226 | "bfr;": "𝔟",
|
5227 | "bne;": "=⃥",
|
5228 | "bot;": "⊥",
|
5229 | "Cap;": "⋒",
|
5230 | "cap;": "∩",
|
5231 | cent: "¢",
|
5232 | "Cfr;": "ℭ",
|
5233 | "cfr;": "𝔠",
|
5234 | "Chi;": "Χ",
|
5235 | "chi;": "χ",
|
5236 | "cir;": "○",
|
5237 | COPY: "©",
|
5238 | copy: "©",
|
5239 | "Cup;": "⋓",
|
5240 | "cup;": "∪",
|
5241 | "Dcy;": "Д",
|
5242 | "dcy;": "д",
|
5243 | "deg;": "°",
|
5244 | "Del;": "∇",
|
5245 | "Dfr;": "𝔇",
|
5246 | "dfr;": "𝔡",
|
5247 | "die;": "¨",
|
5248 | "div;": "÷",
|
5249 | "Dot;": "¨",
|
5250 | "dot;": "˙",
|
5251 | "Ecy;": "Э",
|
5252 | "ecy;": "э",
|
5253 | "Efr;": "𝔈",
|
5254 | "efr;": "𝔢",
|
5255 | "egs;": "⪖",
|
5256 | "ell;": "ℓ",
|
5257 | "els;": "⪕",
|
5258 | "ENG;": "Ŋ",
|
5259 | "eng;": "ŋ",
|
5260 | "Eta;": "Η",
|
5261 | "eta;": "η",
|
5262 | "ETH;": "Ð",
|
5263 | "eth;": "ð",
|
5264 | Euml: "Ë",
|
5265 | euml: "ë",
|
5266 | "Fcy;": "Ф",
|
5267 | "fcy;": "ф",
|
5268 | "Ffr;": "𝔉",
|
5269 | "ffr;": "𝔣",
|
5270 | "gap;": "⪆",
|
5271 | "Gcy;": "Г",
|
5272 | "gcy;": "г",
|
5273 | "gEl;": "⪌",
|
5274 | "gel;": "⋛",
|
5275 | "geq;": "≥",
|
5276 | "ges;": "⩾",
|
5277 | "Gfr;": "𝔊",
|
5278 | "gfr;": "𝔤",
|
5279 | "ggg;": "⋙",
|
5280 | "gla;": "⪥",
|
5281 | "glE;": "⪒",
|
5282 | "glj;": "⪤",
|
5283 | "gnE;": "≩",
|
5284 | "gne;": "⪈",
|
5285 | "Hat;": "^",
|
5286 | "Hfr;": "ℌ",
|
5287 | "hfr;": "𝔥",
|
5288 | "Icy;": "И",
|
5289 | "icy;": "и",
|
5290 | "iff;": "⇔",
|
5291 | "Ifr;": "ℑ",
|
5292 | "ifr;": "𝔦",
|
5293 | "Int;": "∬",
|
5294 | "int;": "∫",
|
5295 | Iuml: "Ï",
|
5296 | iuml: "ï",
|
5297 | "Jcy;": "Й",
|
5298 | "jcy;": "й",
|
5299 | "Jfr;": "𝔍",
|
5300 | "jfr;": "𝔧",
|
5301 | "Kcy;": "К",
|
5302 | "kcy;": "к",
|
5303 | "Kfr;": "𝔎",
|
5304 | "kfr;": "𝔨",
|
5305 | "lap;": "⪅",
|
5306 | "lat;": "⪫",
|
5307 | "Lcy;": "Л",
|
5308 | "lcy;": "л",
|
5309 | "lEg;": "⪋",
|
5310 | "leg;": "⋚",
|
5311 | "leq;": "≤",
|
5312 | "les;": "⩽",
|
5313 | "Lfr;": "𝔏",
|
5314 | "lfr;": "𝔩",
|
5315 | "lgE;": "⪑",
|
5316 | "lnE;": "≨",
|
5317 | "lne;": "⪇",
|
5318 | "loz;": "◊",
|
5319 | "lrm;": "",
|
5320 | "Lsh;": "↰",
|
5321 | "lsh;": "↰",
|
5322 | macr: "¯",
|
5323 | "Map;": "⤅",
|
5324 | "map;": "↦",
|
5325 | "Mcy;": "М",
|
5326 | "mcy;": "м",
|
5327 | "Mfr;": "𝔐",
|
5328 | "mfr;": "𝔪",
|
5329 | "mho;": "℧",
|
5330 | "mid;": "∣",
|
5331 | "nap;": "≉",
|
5332 | nbsp: " ",
|
5333 | "Ncy;": "Н",
|
5334 | "ncy;": "н",
|
5335 | "Nfr;": "𝔑",
|
5336 | "nfr;": "𝔫",
|
5337 | "ngE;": "≧̸",
|
5338 | "nge;": "≱",
|
5339 | "nGg;": "⋙̸",
|
5340 | "nGt;": "≫⃒",
|
5341 | "ngt;": "≯",
|
5342 | "nis;": "⋼",
|
5343 | "niv;": "∋",
|
5344 | "nlE;": "≦̸",
|
5345 | "nle;": "≰",
|
5346 | "nLl;": "⋘̸",
|
5347 | "nLt;": "≪⃒",
|
5348 | "nlt;": "≮",
|
5349 | "Not;": "⫬",
|
5350 | "not;": "¬",
|
5351 | "npr;": "⊀",
|
5352 | "nsc;": "⊁",
|
5353 | "num;": "#",
|
5354 | "Ocy;": "О",
|
5355 | "ocy;": "о",
|
5356 | "Ofr;": "𝔒",
|
5357 | "ofr;": "𝔬",
|
5358 | "ogt;": "⧁",
|
5359 | "ohm;": "Ω",
|
5360 | "olt;": "⧀",
|
5361 | "ord;": "⩝",
|
5362 | ordf: "ª",
|
5363 | ordm: "º",
|
5364 | "orv;": "⩛",
|
5365 | Ouml: "Ö",
|
5366 | ouml: "ö",
|
5367 | "par;": "∥",
|
5368 | para: "¶",
|
5369 | "Pcy;": "П",
|
5370 | "pcy;": "п",
|
5371 | "Pfr;": "𝔓",
|
5372 | "pfr;": "𝔭",
|
5373 | "Phi;": "Φ",
|
5374 | "phi;": "φ",
|
5375 | "piv;": "ϖ",
|
5376 | "prE;": "⪳",
|
5377 | "pre;": "⪯",
|
5378 | "Psi;": "Ψ",
|
5379 | "psi;": "ψ",
|
5380 | "Qfr;": "𝔔",
|
5381 | "qfr;": "𝔮",
|
5382 | QUOT: "\"",
|
5383 | quot: "\"",
|
5384 | "Rcy;": "Р",
|
5385 | "rcy;": "р",
|
5386 | "REG;": "®",
|
5387 | "reg;": "®",
|
5388 | "Rfr;": "ℜ",
|
5389 | "rfr;": "𝔯",
|
5390 | "Rho;": "Ρ",
|
5391 | "rho;": "ρ",
|
5392 | "rlm;": "",
|
5393 | "Rsh;": "↱",
|
5394 | "rsh;": "↱",
|
5395 | "scE;": "⪴",
|
5396 | "sce;": "⪰",
|
5397 | "Scy;": "С",
|
5398 | "scy;": "с",
|
5399 | sect: "§",
|
5400 | "Sfr;": "𝔖",
|
5401 | "sfr;": "𝔰",
|
5402 | "shy;": "",
|
5403 | "sim;": "∼",
|
5404 | "smt;": "⪪",
|
5405 | "sol;": "/",
|
5406 | "squ;": "□",
|
5407 | "Sub;": "⋐",
|
5408 | "sub;": "⊂",
|
5409 | "Sum;": "∑",
|
5410 | "sum;": "∑",
|
5411 | "Sup;": "⋑",
|
5412 | "sup;": "⊃",
|
5413 | sup1: "¹",
|
5414 | sup2: "²",
|
5415 | sup3: "³",
|
5416 | "Tab;": "\t",
|
5417 | "Tau;": "Τ",
|
5418 | "tau;": "τ",
|
5419 | "Tcy;": "Т",
|
5420 | "tcy;": "т",
|
5421 | "Tfr;": "𝔗",
|
5422 | "tfr;": "𝔱",
|
5423 | "top;": "⊤",
|
5424 | "Ucy;": "У",
|
5425 | "ucy;": "у",
|
5426 | "Ufr;": "𝔘",
|
5427 | "ufr;": "𝔲",
|
5428 | "uml;": "¨",
|
5429 | Uuml: "Ü",
|
5430 | uuml: "ü",
|
5431 | "Vcy;": "В",
|
5432 | "vcy;": "в",
|
5433 | "Vee;": "⋁",
|
5434 | "vee;": "∨",
|
5435 | "Vfr;": "𝔙",
|
5436 | "vfr;": "𝔳",
|
5437 | "Wfr;": "𝔚",
|
5438 | "wfr;": "𝔴",
|
5439 | "Xfr;": "𝔛",
|
5440 | "xfr;": "𝔵",
|
5441 | "Ycy;": "Ы",
|
5442 | "ycy;": "ы",
|
5443 | "yen;": "¥",
|
5444 | "Yfr;": "𝔜",
|
5445 | "yfr;": "𝔶",
|
5446 | yuml: "ÿ",
|
5447 | "Zcy;": "З",
|
5448 | "zcy;": "з",
|
5449 | "Zfr;": "ℨ",
|
5450 | "zfr;": "𝔷",
|
5451 | "zwj;": "",
|
5452 | Acirc: "Â",
|
5453 | acirc: "â",
|
5454 | acute: "´",
|
5455 | AElig: "Æ",
|
5456 | aelig: "æ",
|
5457 | "andd;": "⩜",
|
5458 | "andv;": "⩚",
|
5459 | "ange;": "⦤",
|
5460 | "Aopf;": "𝔸",
|
5461 | "aopf;": "𝕒",
|
5462 | "apid;": "≋",
|
5463 | "apos;": "'",
|
5464 | Aring: "Å",
|
5465 | aring: "å",
|
5466 | "Ascr;": "𝒜",
|
5467 | "ascr;": "𝒶",
|
5468 | "Auml;": "Ä",
|
5469 | "auml;": "ä",
|
5470 | "Barv;": "⫧",
|
5471 | "bbrk;": "⎵",
|
5472 | "Beta;": "Β",
|
5473 | "beta;": "β",
|
5474 | "beth;": "ℶ",
|
5475 | "bNot;": "⫭",
|
5476 | "bnot;": "⌐",
|
5477 | "Bopf;": "𝔹",
|
5478 | "bopf;": "𝕓",
|
5479 | "boxH;": "═",
|
5480 | "boxh;": "─",
|
5481 | "boxV;": "║",
|
5482 | "boxv;": "│",
|
5483 | "Bscr;": "ℬ",
|
5484 | "bscr;": "𝒷",
|
5485 | "bsim;": "∽",
|
5486 | "bsol;": "\\",
|
5487 | "bull;": "•",
|
5488 | "bump;": "≎",
|
5489 | "caps;": "∩︀",
|
5490 | "Cdot;": "Ċ",
|
5491 | "cdot;": "ċ",
|
5492 | cedil: "¸",
|
5493 | "cent;": "¢",
|
5494 | "CHcy;": "Ч",
|
5495 | "chcy;": "ч",
|
5496 | "circ;": "ˆ",
|
5497 | "cirE;": "⧃",
|
5498 | "cire;": "≗",
|
5499 | "comp;": "∁",
|
5500 | "cong;": "≅",
|
5501 | "Copf;": "ℂ",
|
5502 | "copf;": "𝕔",
|
5503 | "COPY;": "©",
|
5504 | "copy;": "©",
|
5505 | "Cscr;": "𝒞",
|
5506 | "cscr;": "𝒸",
|
5507 | "csub;": "⫏",
|
5508 | "csup;": "⫐",
|
5509 | "cups;": "∪︀",
|
5510 | "Darr;": "↡",
|
5511 | "dArr;": "⇓",
|
5512 | "darr;": "↓",
|
5513 | "dash;": "‐",
|
5514 | "dHar;": "⥥",
|
5515 | "diam;": "⋄",
|
5516 | "DJcy;": "Ђ",
|
5517 | "djcy;": "ђ",
|
5518 | "Dopf;": "𝔻",
|
5519 | "dopf;": "𝕕",
|
5520 | "Dscr;": "𝒟",
|
5521 | "dscr;": "𝒹",
|
5522 | "DScy;": "Ѕ",
|
5523 | "dscy;": "ѕ",
|
5524 | "dsol;": "⧶",
|
5525 | "dtri;": "▿",
|
5526 | "DZcy;": "Џ",
|
5527 | "dzcy;": "џ",
|
5528 | "ecir;": "≖",
|
5529 | Ecirc: "Ê",
|
5530 | ecirc: "ê",
|
5531 | "Edot;": "Ė",
|
5532 | "eDot;": "≑",
|
5533 | "edot;": "ė",
|
5534 | "emsp;": " ",
|
5535 | "ensp;": " ",
|
5536 | "Eopf;": "𝔼",
|
5537 | "eopf;": "𝕖",
|
5538 | "epar;": "⋕",
|
5539 | "epsi;": "ε",
|
5540 | "Escr;": "ℰ",
|
5541 | "escr;": "ℯ",
|
5542 | "Esim;": "⩳",
|
5543 | "esim;": "≂",
|
5544 | "Euml;": "Ë",
|
5545 | "euml;": "ë",
|
5546 | "euro;": "€",
|
5547 | "excl;": "!",
|
5548 | "flat;": "♭",
|
5549 | "fnof;": "ƒ",
|
5550 | "Fopf;": "𝔽",
|
5551 | "fopf;": "𝕗",
|
5552 | "fork;": "⋔",
|
5553 | "Fscr;": "ℱ",
|
5554 | "fscr;": "𝒻",
|
5555 | "Gdot;": "Ġ",
|
5556 | "gdot;": "ġ",
|
5557 | "geqq;": "≧",
|
5558 | "gesl;": "⋛︀",
|
5559 | "GJcy;": "Ѓ",
|
5560 | "gjcy;": "ѓ",
|
5561 | "gnap;": "⪊",
|
5562 | "gneq;": "⪈",
|
5563 | "Gopf;": "𝔾",
|
5564 | "gopf;": "𝕘",
|
5565 | "Gscr;": "𝒢",
|
5566 | "gscr;": "ℊ",
|
5567 | "gsim;": "≳",
|
5568 | "gtcc;": "⪧",
|
5569 | "gvnE;": "≩︀",
|
5570 | "half;": "½",
|
5571 | "hArr;": "⇔",
|
5572 | "harr;": "↔",
|
5573 | "hbar;": "ℏ",
|
5574 | "Hopf;": "ℍ",
|
5575 | "hopf;": "𝕙",
|
5576 | "Hscr;": "ℋ",
|
5577 | "hscr;": "𝒽",
|
5578 | Icirc: "Î",
|
5579 | icirc: "î",
|
5580 | "Idot;": "İ",
|
5581 | "IEcy;": "Е",
|
5582 | "iecy;": "е",
|
5583 | iexcl: "¡",
|
5584 | "imof;": "⊷",
|
5585 | "IOcy;": "Ё",
|
5586 | "iocy;": "ё",
|
5587 | "Iopf;": "𝕀",
|
5588 | "iopf;": "𝕚",
|
5589 | "Iota;": "Ι",
|
5590 | "iota;": "ι",
|
5591 | "Iscr;": "ℐ",
|
5592 | "iscr;": "𝒾",
|
5593 | "isin;": "∈",
|
5594 | "Iuml;": "Ï",
|
5595 | "iuml;": "ï",
|
5596 | "Jopf;": "𝕁",
|
5597 | "jopf;": "𝕛",
|
5598 | "Jscr;": "𝒥",
|
5599 | "jscr;": "𝒿",
|
5600 | "KHcy;": "Х",
|
5601 | "khcy;": "х",
|
5602 | "KJcy;": "Ќ",
|
5603 | "kjcy;": "ќ",
|
5604 | "Kopf;": "𝕂",
|
5605 | "kopf;": "𝕜",
|
5606 | "Kscr;": "𝒦",
|
5607 | "kscr;": "𝓀",
|
5608 | "Lang;": "⟪",
|
5609 | "lang;": "⟨",
|
5610 | laquo: "«",
|
5611 | "Larr;": "↞",
|
5612 | "lArr;": "⇐",
|
5613 | "larr;": "←",
|
5614 | "late;": "⪭",
|
5615 | "lcub;": "{",
|
5616 | "ldca;": "⤶",
|
5617 | "ldsh;": "↲",
|
5618 | "leqq;": "≦",
|
5619 | "lesg;": "⋚︀",
|
5620 | "lHar;": "⥢",
|
5621 | "LJcy;": "Љ",
|
5622 | "ljcy;": "љ",
|
5623 | "lnap;": "⪉",
|
5624 | "lneq;": "⪇",
|
5625 | "Lopf;": "𝕃",
|
5626 | "lopf;": "𝕝",
|
5627 | "lozf;": "⧫",
|
5628 | "lpar;": "(",
|
5629 | "Lscr;": "ℒ",
|
5630 | "lscr;": "𝓁",
|
5631 | "lsim;": "≲",
|
5632 | "lsqb;": "[",
|
5633 | "ltcc;": "⪦",
|
5634 | "ltri;": "◃",
|
5635 | "lvnE;": "≨︀",
|
5636 | "macr;": "¯",
|
5637 | "male;": "♂",
|
5638 | "malt;": "✠",
|
5639 | micro: "µ",
|
5640 | "mlcp;": "⫛",
|
5641 | "mldr;": "…",
|
5642 | "Mopf;": "𝕄",
|
5643 | "mopf;": "𝕞",
|
5644 | "Mscr;": "ℳ",
|
5645 | "mscr;": "𝓂",
|
5646 | "nang;": "∠⃒",
|
5647 | "napE;": "⩰̸",
|
5648 | "nbsp;": " ",
|
5649 | "ncap;": "⩃",
|
5650 | "ncup;": "⩂",
|
5651 | "ngeq;": "≱",
|
5652 | "nges;": "⩾̸",
|
5653 | "ngtr;": "≯",
|
5654 | "nGtv;": "≫̸",
|
5655 | "nisd;": "⋺",
|
5656 | "NJcy;": "Њ",
|
5657 | "njcy;": "њ",
|
5658 | "nldr;": "‥",
|
5659 | "nleq;": "≰",
|
5660 | "nles;": "⩽̸",
|
5661 | "nLtv;": "≪̸",
|
5662 | "nmid;": "∤",
|
5663 | "Nopf;": "ℕ",
|
5664 | "nopf;": "𝕟",
|
5665 | "npar;": "∦",
|
5666 | "npre;": "⪯̸",
|
5667 | "nsce;": "⪰̸",
|
5668 | "Nscr;": "𝒩",
|
5669 | "nscr;": "𝓃",
|
5670 | "nsim;": "≁",
|
5671 | "nsub;": "⊄",
|
5672 | "nsup;": "⊅",
|
5673 | "ntgl;": "≹",
|
5674 | "ntlg;": "≸",
|
5675 | "nvap;": "≍⃒",
|
5676 | "nvge;": "≥⃒",
|
5677 | "nvgt;": ">⃒",
|
5678 | "nvle;": "≤⃒",
|
5679 | "nvlt;": "<⃒",
|
5680 | "oast;": "⊛",
|
5681 | "ocir;": "⊚",
|
5682 | Ocirc: "Ô",
|
5683 | ocirc: "ô",
|
5684 | "odiv;": "⨸",
|
5685 | "odot;": "⊙",
|
5686 | "ogon;": "˛",
|
5687 | "oint;": "∮",
|
5688 | "omid;": "⦶",
|
5689 | "Oopf;": "𝕆",
|
5690 | "oopf;": "𝕠",
|
5691 | "opar;": "⦷",
|
5692 | "ordf;": "ª",
|
5693 | "ordm;": "º",
|
5694 | "oror;": "⩖",
|
5695 | "Oscr;": "𝒪",
|
5696 | "oscr;": "ℴ",
|
5697 | "osol;": "⊘",
|
5698 | "Ouml;": "Ö",
|
5699 | "ouml;": "ö",
|
5700 | "para;": "¶",
|
5701 | "part;": "∂",
|
5702 | "perp;": "⊥",
|
5703 | "phiv;": "ϕ",
|
5704 | "plus;": "+",
|
5705 | "Popf;": "ℙ",
|
5706 | "popf;": "𝕡",
|
5707 | pound: "£",
|
5708 | "prap;": "⪷",
|
5709 | "prec;": "≺",
|
5710 | "prnE;": "⪵",
|
5711 | "prod;": "∏",
|
5712 | "prop;": "∝",
|
5713 | "Pscr;": "𝒫",
|
5714 | "pscr;": "𝓅",
|
5715 | "qint;": "⨌",
|
5716 | "Qopf;": "ℚ",
|
5717 | "qopf;": "𝕢",
|
5718 | "Qscr;": "𝒬",
|
5719 | "qscr;": "𝓆",
|
5720 | "QUOT;": "\"",
|
5721 | "quot;": "\"",
|
5722 | "race;": "∽̱",
|
5723 | "Rang;": "⟫",
|
5724 | "rang;": "⟩",
|
5725 | raquo: "»",
|
5726 | "Rarr;": "↠",
|
5727 | "rArr;": "⇒",
|
5728 | "rarr;": "→",
|
5729 | "rcub;": "}",
|
5730 | "rdca;": "⤷",
|
5731 | "rdsh;": "↳",
|
5732 | "real;": "ℜ",
|
5733 | "rect;": "▭",
|
5734 | "rHar;": "⥤",
|
5735 | "rhov;": "ϱ",
|
5736 | "ring;": "˚",
|
5737 | "Ropf;": "ℝ",
|
5738 | "ropf;": "𝕣",
|
5739 | "rpar;": ")",
|
5740 | "Rscr;": "ℛ",
|
5741 | "rscr;": "𝓇",
|
5742 | "rsqb;": "]",
|
5743 | "rtri;": "▹",
|
5744 | "scap;": "⪸",
|
5745 | "scnE;": "⪶",
|
5746 | "sdot;": "⋅",
|
5747 | "sect;": "§",
|
5748 | "semi;": ";",
|
5749 | "sext;": "✶",
|
5750 | "SHcy;": "Ш",
|
5751 | "shcy;": "ш",
|
5752 | "sime;": "≃",
|
5753 | "simg;": "⪞",
|
5754 | "siml;": "⪝",
|
5755 | "smid;": "∣",
|
5756 | "smte;": "⪬",
|
5757 | "solb;": "⧄",
|
5758 | "Sopf;": "𝕊",
|
5759 | "sopf;": "𝕤",
|
5760 | "spar;": "∥",
|
5761 | "Sqrt;": "√",
|
5762 | "squf;": "▪",
|
5763 | "Sscr;": "𝒮",
|
5764 | "sscr;": "𝓈",
|
5765 | "Star;": "⋆",
|
5766 | "star;": "☆",
|
5767 | "subE;": "⫅",
|
5768 | "sube;": "⊆",
|
5769 | "succ;": "≻",
|
5770 | "sung;": "♪",
|
5771 | "sup1;": "¹",
|
5772 | "sup2;": "²",
|
5773 | "sup3;": "³",
|
5774 | "supE;": "⫆",
|
5775 | "supe;": "⊇",
|
5776 | szlig: "ß",
|
5777 | "tbrk;": "⎴",
|
5778 | "tdot;": "⃛",
|
5779 | THORN: "Þ",
|
5780 | thorn: "þ",
|
5781 | times: "×",
|
5782 | "tint;": "∭",
|
5783 | "toea;": "⤨",
|
5784 | "Topf;": "𝕋",
|
5785 | "topf;": "𝕥",
|
5786 | "tosa;": "⤩",
|
5787 | "trie;": "≜",
|
5788 | "Tscr;": "𝒯",
|
5789 | "tscr;": "𝓉",
|
5790 | "TScy;": "Ц",
|
5791 | "tscy;": "ц",
|
5792 | "Uarr;": "↟",
|
5793 | "uArr;": "⇑",
|
5794 | "uarr;": "↑",
|
5795 | Ucirc: "Û",
|
5796 | ucirc: "û",
|
5797 | "uHar;": "⥣",
|
5798 | "Uopf;": "𝕌",
|
5799 | "uopf;": "𝕦",
|
5800 | "Upsi;": "ϒ",
|
5801 | "upsi;": "υ",
|
5802 | "Uscr;": "𝒰",
|
5803 | "uscr;": "𝓊",
|
5804 | "utri;": "▵",
|
5805 | "Uuml;": "Ü",
|
5806 | "uuml;": "ü",
|
5807 | "vArr;": "⇕",
|
5808 | "varr;": "↕",
|
5809 | "Vbar;": "⫫",
|
5810 | "vBar;": "⫨",
|
5811 | "Vert;": "‖",
|
5812 | "vert;": "|",
|
5813 | "Vopf;": "𝕍",
|
5814 | "vopf;": "𝕧",
|
5815 | "Vscr;": "𝒱",
|
5816 | "vscr;": "𝓋",
|
5817 | "Wopf;": "𝕎",
|
5818 | "wopf;": "𝕨",
|
5819 | "Wscr;": "𝒲",
|
5820 | "wscr;": "𝓌",
|
5821 | "xcap;": "⋂",
|
5822 | "xcup;": "⋃",
|
5823 | "xmap;": "⟼",
|
5824 | "xnis;": "⋻",
|
5825 | "Xopf;": "𝕏",
|
5826 | "xopf;": "𝕩",
|
5827 | "Xscr;": "𝒳",
|
5828 | "xscr;": "𝓍",
|
5829 | "xvee;": "⋁",
|
5830 | "YAcy;": "Я",
|
5831 | "yacy;": "я",
|
5832 | "YIcy;": "Ї",
|
5833 | "yicy;": "ї",
|
5834 | "Yopf;": "𝕐",
|
5835 | "yopf;": "𝕪",
|
5836 | "Yscr;": "𝒴",
|
5837 | "yscr;": "𝓎",
|
5838 | "YUcy;": "Ю",
|
5839 | "yucy;": "ю",
|
5840 | "Yuml;": "Ÿ",
|
5841 | "yuml;": "ÿ",
|
5842 | "Zdot;": "Ż",
|
5843 | "zdot;": "ż",
|
5844 | "Zeta;": "Ζ",
|
5845 | "zeta;": "ζ",
|
5846 | "ZHcy;": "Ж",
|
5847 | "zhcy;": "ж",
|
5848 | "Zopf;": "ℤ",
|
5849 | "zopf;": "𝕫",
|
5850 | "Zscr;": "𝒵",
|
5851 | "zscr;": "𝓏",
|
5852 | "zwnj;": "",
|
5853 | Aacute: "Á",
|
5854 | aacute: "á",
|
5855 | "Acirc;": "Â",
|
5856 | "acirc;": "â",
|
5857 | "acute;": "´",
|
5858 | "AElig;": "Æ",
|
5859 | "aelig;": "æ",
|
5860 | Agrave: "À",
|
5861 | agrave: "à",
|
5862 | "aleph;": "ℵ",
|
5863 | "Alpha;": "Α",
|
5864 | "alpha;": "α",
|
5865 | "Amacr;": "Ā",
|
5866 | "amacr;": "ā",
|
5867 | "amalg;": "⨿",
|
5868 | "angle;": "∠",
|
5869 | "angrt;": "∟",
|
5870 | "angst;": "Å",
|
5871 | "Aogon;": "Ą",
|
5872 | "aogon;": "ą",
|
5873 | "Aring;": "Å",
|
5874 | "aring;": "å",
|
5875 | "asymp;": "≈",
|
5876 | Atilde: "Ã",
|
5877 | atilde: "ã",
|
5878 | "awint;": "⨑",
|
5879 | "bcong;": "≌",
|
5880 | "bdquo;": "„",
|
5881 | "bepsi;": "϶",
|
5882 | "blank;": "␣",
|
5883 | "blk12;": "▒",
|
5884 | "blk14;": "░",
|
5885 | "blk34;": "▓",
|
5886 | "block;": "█",
|
5887 | "boxDL;": "╗",
|
5888 | "boxDl;": "╖",
|
5889 | "boxdL;": "╕",
|
5890 | "boxdl;": "┐",
|
5891 | "boxDR;": "╔",
|
5892 | "boxDr;": "╓",
|
5893 | "boxdR;": "╒",
|
5894 | "boxdr;": "┌",
|
5895 | "boxHD;": "╦",
|
5896 | "boxHd;": "╤",
|
5897 | "boxhD;": "╥",
|
5898 | "boxhd;": "┬",
|
5899 | "boxHU;": "╩",
|
5900 | "boxHu;": "╧",
|
5901 | "boxhU;": "╨",
|
5902 | "boxhu;": "┴",
|
5903 | "boxUL;": "╝",
|
5904 | "boxUl;": "╜",
|
5905 | "boxuL;": "╛",
|
5906 | "boxul;": "┘",
|
5907 | "boxUR;": "╚",
|
5908 | "boxUr;": "╙",
|
5909 | "boxuR;": "╘",
|
5910 | "boxur;": "└",
|
5911 | "boxVH;": "╬",
|
5912 | "boxVh;": "╫",
|
5913 | "boxvH;": "╪",
|
5914 | "boxvh;": "┼",
|
5915 | "boxVL;": "╣",
|
5916 | "boxVl;": "╢",
|
5917 | "boxvL;": "╡",
|
5918 | "boxvl;": "┤",
|
5919 | "boxVR;": "╠",
|
5920 | "boxVr;": "╟",
|
5921 | "boxvR;": "╞",
|
5922 | "boxvr;": "├",
|
5923 | "Breve;": "˘",
|
5924 | "breve;": "˘",
|
5925 | brvbar: "¦",
|
5926 | "bsemi;": "⁏",
|
5927 | "bsime;": "⋍",
|
5928 | "bsolb;": "⧅",
|
5929 | "bumpE;": "⪮",
|
5930 | "bumpe;": "≏",
|
5931 | "caret;": "⁁",
|
5932 | "caron;": "ˇ",
|
5933 | "ccaps;": "⩍",
|
5934 | Ccedil: "Ç",
|
5935 | ccedil: "ç",
|
5936 | "Ccirc;": "Ĉ",
|
5937 | "ccirc;": "ĉ",
|
5938 | "ccups;": "⩌",
|
5939 | "cedil;": "¸",
|
5940 | "check;": "✓",
|
5941 | "clubs;": "♣",
|
5942 | "Colon;": "∷",
|
5943 | "colon;": ":",
|
5944 | "comma;": ",",
|
5945 | "crarr;": "↵",
|
5946 | "Cross;": "⨯",
|
5947 | "cross;": "✗",
|
5948 | "csube;": "⫑",
|
5949 | "csupe;": "⫒",
|
5950 | "ctdot;": "⋯",
|
5951 | "cuepr;": "⋞",
|
5952 | "cuesc;": "⋟",
|
5953 | "cupor;": "⩅",
|
5954 | curren: "¤",
|
5955 | "cuvee;": "⋎",
|
5956 | "cuwed;": "⋏",
|
5957 | "cwint;": "∱",
|
5958 | "Dashv;": "⫤",
|
5959 | "dashv;": "⊣",
|
5960 | "dblac;": "˝",
|
5961 | "ddarr;": "⇊",
|
5962 | "Delta;": "Δ",
|
5963 | "delta;": "δ",
|
5964 | "dharl;": "⇃",
|
5965 | "dharr;": "⇂",
|
5966 | "diams;": "♦",
|
5967 | "disin;": "⋲",
|
5968 | divide: "÷",
|
5969 | "doteq;": "≐",
|
5970 | "dtdot;": "⋱",
|
5971 | "dtrif;": "▾",
|
5972 | "duarr;": "⇵",
|
5973 | "duhar;": "⥯",
|
5974 | Eacute: "É",
|
5975 | eacute: "é",
|
5976 | "Ecirc;": "Ê",
|
5977 | "ecirc;": "ê",
|
5978 | "eDDot;": "⩷",
|
5979 | "efDot;": "≒",
|
5980 | Egrave: "È",
|
5981 | egrave: "è",
|
5982 | "Emacr;": "Ē",
|
5983 | "emacr;": "ē",
|
5984 | "empty;": "∅",
|
5985 | "Eogon;": "Ę",
|
5986 | "eogon;": "ę",
|
5987 | "eplus;": "⩱",
|
5988 | "epsiv;": "ϵ",
|
5989 | "eqsim;": "≂",
|
5990 | "Equal;": "⩵",
|
5991 | "equiv;": "≡",
|
5992 | "erarr;": "⥱",
|
5993 | "erDot;": "≓",
|
5994 | "esdot;": "≐",
|
5995 | "exist;": "∃",
|
5996 | "fflig;": "ff",
|
5997 | "filig;": "fi",
|
5998 | "fjlig;": "fj",
|
5999 | "fllig;": "fl",
|
6000 | "fltns;": "▱",
|
6001 | "forkv;": "⫙",
|
6002 | frac12: "½",
|
6003 | frac14: "¼",
|
6004 | frac34: "¾",
|
6005 | "frasl;": "⁄",
|
6006 | "frown;": "⌢",
|
6007 | "Gamma;": "Γ",
|
6008 | "gamma;": "γ",
|
6009 | "Gcirc;": "Ĝ",
|
6010 | "gcirc;": "ĝ",
|
6011 | "gescc;": "⪩",
|
6012 | "gimel;": "ℷ",
|
6013 | "gneqq;": "≩",
|
6014 | "gnsim;": "⋧",
|
6015 | "grave;": "`",
|
6016 | "gsime;": "⪎",
|
6017 | "gsiml;": "⪐",
|
6018 | "gtcir;": "⩺",
|
6019 | "gtdot;": "⋗",
|
6020 | "Hacek;": "ˇ",
|
6021 | "harrw;": "↭",
|
6022 | "Hcirc;": "Ĥ",
|
6023 | "hcirc;": "ĥ",
|
6024 | "hoarr;": "⇿",
|
6025 | Iacute: "Í",
|
6026 | iacute: "í",
|
6027 | "Icirc;": "Î",
|
6028 | "icirc;": "î",
|
6029 | "iexcl;": "¡",
|
6030 | Igrave: "Ì",
|
6031 | igrave: "ì",
|
6032 | "iiint;": "∭",
|
6033 | "iiota;": "℩",
|
6034 | "IJlig;": "IJ",
|
6035 | "ijlig;": "ij",
|
6036 | "Imacr;": "Ī",
|
6037 | "imacr;": "ī",
|
6038 | "image;": "ℑ",
|
6039 | "imath;": "ı",
|
6040 | "imped;": "Ƶ",
|
6041 | "infin;": "∞",
|
6042 | "Iogon;": "Į",
|
6043 | "iogon;": "į",
|
6044 | "iprod;": "⨼",
|
6045 | iquest: "¿",
|
6046 | "isinE;": "⋹",
|
6047 | "isins;": "⋴",
|
6048 | "isinv;": "∈",
|
6049 | "Iukcy;": "І",
|
6050 | "iukcy;": "і",
|
6051 | "Jcirc;": "Ĵ",
|
6052 | "jcirc;": "ĵ",
|
6053 | "jmath;": "ȷ",
|
6054 | "Jukcy;": "Є",
|
6055 | "jukcy;": "є",
|
6056 | "Kappa;": "Κ",
|
6057 | "kappa;": "κ",
|
6058 | "lAarr;": "⇚",
|
6059 | "langd;": "⦑",
|
6060 | "laquo;": "«",
|
6061 | "larrb;": "⇤",
|
6062 | "lates;": "⪭︀",
|
6063 | "lBarr;": "⤎",
|
6064 | "lbarr;": "⤌",
|
6065 | "lbbrk;": "❲",
|
6066 | "lbrke;": "⦋",
|
6067 | "lceil;": "⌈",
|
6068 | "ldquo;": "“",
|
6069 | "lescc;": "⪨",
|
6070 | "lhard;": "↽",
|
6071 | "lharu;": "↼",
|
6072 | "lhblk;": "▄",
|
6073 | "llarr;": "⇇",
|
6074 | "lltri;": "◺",
|
6075 | "lneqq;": "≨",
|
6076 | "lnsim;": "⋦",
|
6077 | "loang;": "⟬",
|
6078 | "loarr;": "⇽",
|
6079 | "lobrk;": "⟦",
|
6080 | "lopar;": "⦅",
|
6081 | "lrarr;": "⇆",
|
6082 | "lrhar;": "⇋",
|
6083 | "lrtri;": "⊿",
|
6084 | "lsime;": "⪍",
|
6085 | "lsimg;": "⪏",
|
6086 | "lsquo;": "‘",
|
6087 | "ltcir;": "⩹",
|
6088 | "ltdot;": "⋖",
|
6089 | "ltrie;": "⊴",
|
6090 | "ltrif;": "◂",
|
6091 | "mdash;": "—",
|
6092 | "mDDot;": "∺",
|
6093 | "micro;": "µ",
|
6094 | middot: "·",
|
6095 | "minus;": "−",
|
6096 | "mumap;": "⊸",
|
6097 | "nabla;": "∇",
|
6098 | "napid;": "≋̸",
|
6099 | "napos;": "ʼn",
|
6100 | "natur;": "♮",
|
6101 | "nbump;": "≎̸",
|
6102 | "ncong;": "≇",
|
6103 | "ndash;": "–",
|
6104 | "neArr;": "⇗",
|
6105 | "nearr;": "↗",
|
6106 | "nedot;": "≐̸",
|
6107 | "nesim;": "≂̸",
|
6108 | "ngeqq;": "≧̸",
|
6109 | "ngsim;": "≵",
|
6110 | "nhArr;": "⇎",
|
6111 | "nharr;": "↮",
|
6112 | "nhpar;": "⫲",
|
6113 | "nlArr;": "⇍",
|
6114 | "nlarr;": "↚",
|
6115 | "nleqq;": "≦̸",
|
6116 | "nless;": "≮",
|
6117 | "nlsim;": "≴",
|
6118 | "nltri;": "⋪",
|
6119 | "notin;": "∉",
|
6120 | "notni;": "∌",
|
6121 | "npart;": "∂̸",
|
6122 | "nprec;": "⊀",
|
6123 | "nrArr;": "⇏",
|
6124 | "nrarr;": "↛",
|
6125 | "nrtri;": "⋫",
|
6126 | "nsime;": "≄",
|
6127 | "nsmid;": "∤",
|
6128 | "nspar;": "∦",
|
6129 | "nsubE;": "⫅̸",
|
6130 | "nsube;": "⊈",
|
6131 | "nsucc;": "⊁",
|
6132 | "nsupE;": "⫆̸",
|
6133 | "nsupe;": "⊉",
|
6134 | Ntilde: "Ñ",
|
6135 | ntilde: "ñ",
|
6136 | "numsp;": " ",
|
6137 | "nvsim;": "∼⃒",
|
6138 | "nwArr;": "⇖",
|
6139 | "nwarr;": "↖",
|
6140 | Oacute: "Ó",
|
6141 | oacute: "ó",
|
6142 | "Ocirc;": "Ô",
|
6143 | "ocirc;": "ô",
|
6144 | "odash;": "⊝",
|
6145 | "OElig;": "Œ",
|
6146 | "oelig;": "œ",
|
6147 | "ofcir;": "⦿",
|
6148 | Ograve: "Ò",
|
6149 | ograve: "ò",
|
6150 | "ohbar;": "⦵",
|
6151 | "olarr;": "↺",
|
6152 | "olcir;": "⦾",
|
6153 | "oline;": "‾",
|
6154 | "Omacr;": "Ō",
|
6155 | "omacr;": "ō",
|
6156 | "Omega;": "Ω",
|
6157 | "omega;": "ω",
|
6158 | "operp;": "⦹",
|
6159 | "oplus;": "⊕",
|
6160 | "orarr;": "↻",
|
6161 | "order;": "ℴ",
|
6162 | Oslash: "Ø",
|
6163 | oslash: "ø",
|
6164 | Otilde: "Õ",
|
6165 | otilde: "õ",
|
6166 | "ovbar;": "⌽",
|
6167 | "parsl;": "⫽",
|
6168 | "phone;": "☎",
|
6169 | "plusb;": "⊞",
|
6170 | "pluse;": "⩲",
|
6171 | plusmn: "±",
|
6172 | "pound;": "£",
|
6173 | "prcue;": "≼",
|
6174 | "Prime;": "″",
|
6175 | "prime;": "′",
|
6176 | "prnap;": "⪹",
|
6177 | "prsim;": "≾",
|
6178 | "quest;": "?",
|
6179 | "rAarr;": "⇛",
|
6180 | "radic;": "√",
|
6181 | "rangd;": "⦒",
|
6182 | "range;": "⦥",
|
6183 | "raquo;": "»",
|
6184 | "rarrb;": "⇥",
|
6185 | "rarrc;": "⤳",
|
6186 | "rarrw;": "↝",
|
6187 | "ratio;": "∶",
|
6188 | "RBarr;": "⤐",
|
6189 | "rBarr;": "⤏",
|
6190 | "rbarr;": "⤍",
|
6191 | "rbbrk;": "❳",
|
6192 | "rbrke;": "⦌",
|
6193 | "rceil;": "⌉",
|
6194 | "rdquo;": "”",
|
6195 | "reals;": "ℝ",
|
6196 | "rhard;": "⇁",
|
6197 | "rharu;": "⇀",
|
6198 | "rlarr;": "⇄",
|
6199 | "rlhar;": "⇌",
|
6200 | "rnmid;": "⫮",
|
6201 | "roang;": "⟭",
|
6202 | "roarr;": "⇾",
|
6203 | "robrk;": "⟧",
|
6204 | "ropar;": "⦆",
|
6205 | "rrarr;": "⇉",
|
6206 | "rsquo;": "’",
|
6207 | "rtrie;": "⊵",
|
6208 | "rtrif;": "▸",
|
6209 | "sbquo;": "‚",
|
6210 | "sccue;": "≽",
|
6211 | "Scirc;": "Ŝ",
|
6212 | "scirc;": "ŝ",
|
6213 | "scnap;": "⪺",
|
6214 | "scsim;": "≿",
|
6215 | "sdotb;": "⊡",
|
6216 | "sdote;": "⩦",
|
6217 | "seArr;": "⇘",
|
6218 | "searr;": "↘",
|
6219 | "setmn;": "∖",
|
6220 | "sharp;": "♯",
|
6221 | "Sigma;": "Σ",
|
6222 | "sigma;": "σ",
|
6223 | "simeq;": "≃",
|
6224 | "simgE;": "⪠",
|
6225 | "simlE;": "⪟",
|
6226 | "simne;": "≆",
|
6227 | "slarr;": "←",
|
6228 | "smile;": "⌣",
|
6229 | "smtes;": "⪬︀",
|
6230 | "sqcap;": "⊓",
|
6231 | "sqcup;": "⊔",
|
6232 | "sqsub;": "⊏",
|
6233 | "sqsup;": "⊐",
|
6234 | "srarr;": "→",
|
6235 | "starf;": "★",
|
6236 | "strns;": "¯",
|
6237 | "subnE;": "⫋",
|
6238 | "subne;": "⊊",
|
6239 | "supnE;": "⫌",
|
6240 | "supne;": "⊋",
|
6241 | "swArr;": "⇙",
|
6242 | "swarr;": "↙",
|
6243 | "szlig;": "ß",
|
6244 | "Theta;": "Θ",
|
6245 | "theta;": "θ",
|
6246 | "thkap;": "≈",
|
6247 | "THORN;": "Þ",
|
6248 | "thorn;": "þ",
|
6249 | "Tilde;": "∼",
|
6250 | "tilde;": "˜",
|
6251 | "times;": "×",
|
6252 | "TRADE;": "™",
|
6253 | "trade;": "™",
|
6254 | "trisb;": "⧍",
|
6255 | "TSHcy;": "Ћ",
|
6256 | "tshcy;": "ћ",
|
6257 | "twixt;": "≬",
|
6258 | Uacute: "Ú",
|
6259 | uacute: "ú",
|
6260 | "Ubrcy;": "Ў",
|
6261 | "ubrcy;": "ў",
|
6262 | "Ucirc;": "Û",
|
6263 | "ucirc;": "û",
|
6264 | "udarr;": "⇅",
|
6265 | "udhar;": "⥮",
|
6266 | Ugrave: "Ù",
|
6267 | ugrave: "ù",
|
6268 | "uharl;": "↿",
|
6269 | "uharr;": "↾",
|
6270 | "uhblk;": "▀",
|
6271 | "ultri;": "◸",
|
6272 | "Umacr;": "Ū",
|
6273 | "umacr;": "ū",
|
6274 | "Union;": "⋃",
|
6275 | "Uogon;": "Ų",
|
6276 | "uogon;": "ų",
|
6277 | "uplus;": "⊎",
|
6278 | "upsih;": "ϒ",
|
6279 | "UpTee;": "⊥",
|
6280 | "Uring;": "Ů",
|
6281 | "uring;": "ů",
|
6282 | "urtri;": "◹",
|
6283 | "utdot;": "⋰",
|
6284 | "utrif;": "▴",
|
6285 | "uuarr;": "⇈",
|
6286 | "varpi;": "ϖ",
|
6287 | "vBarv;": "⫩",
|
6288 | "VDash;": "⊫",
|
6289 | "Vdash;": "⊩",
|
6290 | "vDash;": "⊨",
|
6291 | "vdash;": "⊢",
|
6292 | "veeeq;": "≚",
|
6293 | "vltri;": "⊲",
|
6294 | "vnsub;": "⊂⃒",
|
6295 | "vnsup;": "⊃⃒",
|
6296 | "vprop;": "∝",
|
6297 | "vrtri;": "⊳",
|
6298 | "Wcirc;": "Ŵ",
|
6299 | "wcirc;": "ŵ",
|
6300 | "Wedge;": "⋀",
|
6301 | "wedge;": "∧",
|
6302 | "xcirc;": "◯",
|
6303 | "xdtri;": "▽",
|
6304 | "xhArr;": "⟺",
|
6305 | "xharr;": "⟷",
|
6306 | "xlArr;": "⟸",
|
6307 | "xlarr;": "⟵",
|
6308 | "xodot;": "⨀",
|
6309 | "xrArr;": "⟹",
|
6310 | "xrarr;": "⟶",
|
6311 | "xutri;": "△",
|
6312 | Yacute: "Ý",
|
6313 | yacute: "ý",
|
6314 | "Ycirc;": "Ŷ",
|
6315 | "ycirc;": "ŷ",
|
6316 | "Aacute;": "Á",
|
6317 | "aacute;": "á",
|
6318 | "Abreve;": "Ă",
|
6319 | "abreve;": "ă",
|
6320 | "Agrave;": "À",
|
6321 | "agrave;": "à",
|
6322 | "andand;": "⩕",
|
6323 | "angmsd;": "∡",
|
6324 | "angsph;": "∢",
|
6325 | "apacir;": "⩯",
|
6326 | "approx;": "≈",
|
6327 | "Assign;": "≔",
|
6328 | "Atilde;": "Ã",
|
6329 | "atilde;": "ã",
|
6330 | "barvee;": "⊽",
|
6331 | "Barwed;": "⌆",
|
6332 | "barwed;": "⌅",
|
6333 | "becaus;": "∵",
|
6334 | "bernou;": "ℬ",
|
6335 | "bigcap;": "⋂",
|
6336 | "bigcup;": "⋃",
|
6337 | "bigvee;": "⋁",
|
6338 | "bkarow;": "⤍",
|
6339 | "bottom;": "⊥",
|
6340 | "bowtie;": "⋈",
|
6341 | "boxbox;": "⧉",
|
6342 | "bprime;": "‵",
|
6343 | "brvbar;": "¦",
|
6344 | "bullet;": "•",
|
6345 | "Bumpeq;": "≎",
|
6346 | "bumpeq;": "≏",
|
6347 | "Cacute;": "Ć",
|
6348 | "cacute;": "ć",
|
6349 | "capand;": "⩄",
|
6350 | "capcap;": "⩋",
|
6351 | "capcup;": "⩇",
|
6352 | "capdot;": "⩀",
|
6353 | "Ccaron;": "Č",
|
6354 | "ccaron;": "č",
|
6355 | "Ccedil;": "Ç",
|
6356 | "ccedil;": "ç",
|
6357 | "circeq;": "≗",
|
6358 | "cirmid;": "⫯",
|
6359 | "Colone;": "⩴",
|
6360 | "colone;": "≔",
|
6361 | "commat;": "@",
|
6362 | "compfn;": "∘",
|
6363 | "Conint;": "∯",
|
6364 | "conint;": "∮",
|
6365 | "coprod;": "∐",
|
6366 | "copysr;": "℗",
|
6367 | "cularr;": "↶",
|
6368 | "CupCap;": "≍",
|
6369 | "cupcap;": "⩆",
|
6370 | "cupcup;": "⩊",
|
6371 | "cupdot;": "⊍",
|
6372 | "curarr;": "↷",
|
6373 | "curren;": "¤",
|
6374 | "cylcty;": "⌭",
|
6375 | "Dagger;": "‡",
|
6376 | "dagger;": "†",
|
6377 | "daleth;": "ℸ",
|
6378 | "Dcaron;": "Ď",
|
6379 | "dcaron;": "ď",
|
6380 | "dfisht;": "⥿",
|
6381 | "divide;": "÷",
|
6382 | "divonx;": "⋇",
|
6383 | "dlcorn;": "⌞",
|
6384 | "dlcrop;": "⌍",
|
6385 | "dollar;": "$",
|
6386 | "DotDot;": "⃜",
|
6387 | "drcorn;": "⌟",
|
6388 | "drcrop;": "⌌",
|
6389 | "Dstrok;": "Đ",
|
6390 | "dstrok;": "đ",
|
6391 | "Eacute;": "É",
|
6392 | "eacute;": "é",
|
6393 | "easter;": "⩮",
|
6394 | "Ecaron;": "Ě",
|
6395 | "ecaron;": "ě",
|
6396 | "ecolon;": "≕",
|
6397 | "Egrave;": "È",
|
6398 | "egrave;": "è",
|
6399 | "egsdot;": "⪘",
|
6400 | "elsdot;": "⪗",
|
6401 | "emptyv;": "∅",
|
6402 | "emsp13;": " ",
|
6403 | "emsp14;": " ",
|
6404 | "eparsl;": "⧣",
|
6405 | "eqcirc;": "≖",
|
6406 | "equals;": "=",
|
6407 | "equest;": "≟",
|
6408 | "Exists;": "∃",
|
6409 | "female;": "♀",
|
6410 | "ffilig;": "ffi",
|
6411 | "ffllig;": "ffl",
|
6412 | "ForAll;": "∀",
|
6413 | "forall;": "∀",
|
6414 | "frac12;": "½",
|
6415 | "frac13;": "⅓",
|
6416 | "frac14;": "¼",
|
6417 | "frac15;": "⅕",
|
6418 | "frac16;": "⅙",
|
6419 | "frac18;": "⅛",
|
6420 | "frac23;": "⅔",
|
6421 | "frac25;": "⅖",
|
6422 | "frac34;": "¾",
|
6423 | "frac35;": "⅗",
|
6424 | "frac38;": "⅜",
|
6425 | "frac45;": "⅘",
|
6426 | "frac56;": "⅚",
|
6427 | "frac58;": "⅝",
|
6428 | "frac78;": "⅞",
|
6429 | "gacute;": "ǵ",
|
6430 | "Gammad;": "Ϝ",
|
6431 | "gammad;": "ϝ",
|
6432 | "Gbreve;": "Ğ",
|
6433 | "gbreve;": "ğ",
|
6434 | "Gcedil;": "Ģ",
|
6435 | "gesdot;": "⪀",
|
6436 | "gesles;": "⪔",
|
6437 | "gtlPar;": "⦕",
|
6438 | "gtrarr;": "⥸",
|
6439 | "gtrdot;": "⋗",
|
6440 | "gtrsim;": "≳",
|
6441 | "hairsp;": " ",
|
6442 | "hamilt;": "ℋ",
|
6443 | "HARDcy;": "Ъ",
|
6444 | "hardcy;": "ъ",
|
6445 | "hearts;": "♥",
|
6446 | "hellip;": "…",
|
6447 | "hercon;": "⊹",
|
6448 | "homtht;": "∻",
|
6449 | "horbar;": "―",
|
6450 | "hslash;": "ℏ",
|
6451 | "Hstrok;": "Ħ",
|
6452 | "hstrok;": "ħ",
|
6453 | "hybull;": "⁃",
|
6454 | "hyphen;": "‐",
|
6455 | "Iacute;": "Í",
|
6456 | "iacute;": "í",
|
6457 | "Igrave;": "Ì",
|
6458 | "igrave;": "ì",
|
6459 | "iiiint;": "⨌",
|
6460 | "iinfin;": "⧜",
|
6461 | "incare;": "℅",
|
6462 | "inodot;": "ı",
|
6463 | "intcal;": "⊺",
|
6464 | "iquest;": "¿",
|
6465 | "isinsv;": "⋳",
|
6466 | "Itilde;": "Ĩ",
|
6467 | "itilde;": "ĩ",
|
6468 | "Jsercy;": "Ј",
|
6469 | "jsercy;": "ј",
|
6470 | "kappav;": "ϰ",
|
6471 | "Kcedil;": "Ķ",
|
6472 | "kcedil;": "ķ",
|
6473 | "kgreen;": "ĸ",
|
6474 | "Lacute;": "Ĺ",
|
6475 | "lacute;": "ĺ",
|
6476 | "lagran;": "ℒ",
|
6477 | "Lambda;": "Λ",
|
6478 | "lambda;": "λ",
|
6479 | "langle;": "⟨",
|
6480 | "larrfs;": "⤝",
|
6481 | "larrhk;": "↩",
|
6482 | "larrlp;": "↫",
|
6483 | "larrpl;": "⤹",
|
6484 | "larrtl;": "↢",
|
6485 | "lAtail;": "⤛",
|
6486 | "latail;": "⤙",
|
6487 | "lbrace;": "{",
|
6488 | "lbrack;": "[",
|
6489 | "Lcaron;": "Ľ",
|
6490 | "lcaron;": "ľ",
|
6491 | "Lcedil;": "Ļ",
|
6492 | "lcedil;": "ļ",
|
6493 | "ldquor;": "„",
|
6494 | "lesdot;": "⩿",
|
6495 | "lesges;": "⪓",
|
6496 | "lfisht;": "⥼",
|
6497 | "lfloor;": "⌊",
|
6498 | "lharul;": "⥪",
|
6499 | "llhard;": "⥫",
|
6500 | "Lmidot;": "Ŀ",
|
6501 | "lmidot;": "ŀ",
|
6502 | "lmoust;": "⎰",
|
6503 | "loplus;": "⨭",
|
6504 | "lowast;": "∗",
|
6505 | "lowbar;": "_",
|
6506 | "lparlt;": "⦓",
|
6507 | "lrhard;": "⥭",
|
6508 | "lsaquo;": "‹",
|
6509 | "lsquor;": "‚",
|
6510 | "Lstrok;": "Ł",
|
6511 | "lstrok;": "ł",
|
6512 | "lthree;": "⋋",
|
6513 | "ltimes;": "⋉",
|
6514 | "ltlarr;": "⥶",
|
6515 | "ltrPar;": "⦖",
|
6516 | "mapsto;": "↦",
|
6517 | "marker;": "▮",
|
6518 | "mcomma;": "⨩",
|
6519 | "midast;": "*",
|
6520 | "midcir;": "⫰",
|
6521 | "middot;": "·",
|
6522 | "minusb;": "⊟",
|
6523 | "minusd;": "∸",
|
6524 | "mnplus;": "∓",
|
6525 | "models;": "⊧",
|
6526 | "mstpos;": "∾",
|
6527 | "Nacute;": "Ń",
|
6528 | "nacute;": "ń",
|
6529 | "nbumpe;": "≏̸",
|
6530 | "Ncaron;": "Ň",
|
6531 | "ncaron;": "ň",
|
6532 | "Ncedil;": "Ņ",
|
6533 | "ncedil;": "ņ",
|
6534 | "nearhk;": "⤤",
|
6535 | "nequiv;": "≢",
|
6536 | "nesear;": "⤨",
|
6537 | "nexist;": "∄",
|
6538 | "nltrie;": "⋬",
|
6539 | "notinE;": "⋹̸",
|
6540 | "nparsl;": "⫽⃥",
|
6541 | "nprcue;": "⋠",
|
6542 | "nrarrc;": "⤳̸",
|
6543 | "nrarrw;": "↝̸",
|
6544 | "nrtrie;": "⋭",
|
6545 | "nsccue;": "⋡",
|
6546 | "nsimeq;": "≄",
|
6547 | "Ntilde;": "Ñ",
|
6548 | "ntilde;": "ñ",
|
6549 | "numero;": "№",
|
6550 | "nVDash;": "⊯",
|
6551 | "nVdash;": "⊮",
|
6552 | "nvDash;": "⊭",
|
6553 | "nvdash;": "⊬",
|
6554 | "nvHarr;": "⤄",
|
6555 | "nvlArr;": "⤂",
|
6556 | "nvrArr;": "⤃",
|
6557 | "nwarhk;": "⤣",
|
6558 | "nwnear;": "⤧",
|
6559 | "Oacute;": "Ó",
|
6560 | "oacute;": "ó",
|
6561 | "Odblac;": "Ő",
|
6562 | "odblac;": "ő",
|
6563 | "odsold;": "⦼",
|
6564 | "Ograve;": "Ò",
|
6565 | "ograve;": "ò",
|
6566 | "ominus;": "⊖",
|
6567 | "origof;": "⊶",
|
6568 | "Oslash;": "Ø",
|
6569 | "oslash;": "ø",
|
6570 | "Otilde;": "Õ",
|
6571 | "otilde;": "õ",
|
6572 | "Otimes;": "⨷",
|
6573 | "otimes;": "⊗",
|
6574 | "parsim;": "⫳",
|
6575 | "percnt;": "%",
|
6576 | "period;": ".",
|
6577 | "permil;": "‰",
|
6578 | "phmmat;": "ℳ",
|
6579 | "planck;": "ℏ",
|
6580 | "plankv;": "ℏ",
|
6581 | "plusdo;": "∔",
|
6582 | "plusdu;": "⨥",
|
6583 | "plusmn;": "±",
|
6584 | "preceq;": "⪯",
|
6585 | "primes;": "ℙ",
|
6586 | "prnsim;": "⋨",
|
6587 | "propto;": "∝",
|
6588 | "prurel;": "⊰",
|
6589 | "puncsp;": " ",
|
6590 | "qprime;": "⁗",
|
6591 | "Racute;": "Ŕ",
|
6592 | "racute;": "ŕ",
|
6593 | "rangle;": "⟩",
|
6594 | "rarrap;": "⥵",
|
6595 | "rarrfs;": "⤞",
|
6596 | "rarrhk;": "↪",
|
6597 | "rarrlp;": "↬",
|
6598 | "rarrpl;": "⥅",
|
6599 | "Rarrtl;": "⤖",
|
6600 | "rarrtl;": "↣",
|
6601 | "rAtail;": "⤜",
|
6602 | "ratail;": "⤚",
|
6603 | "rbrace;": "}",
|
6604 | "rbrack;": "]",
|
6605 | "Rcaron;": "Ř",
|
6606 | "rcaron;": "ř",
|
6607 | "Rcedil;": "Ŗ",
|
6608 | "rcedil;": "ŗ",
|
6609 | "rdquor;": "”",
|
6610 | "rfisht;": "⥽",
|
6611 | "rfloor;": "⌋",
|
6612 | "rharul;": "⥬",
|
6613 | "rmoust;": "⎱",
|
6614 | "roplus;": "⨮",
|
6615 | "rpargt;": "⦔",
|
6616 | "rsaquo;": "›",
|
6617 | "rsquor;": "’",
|
6618 | "rthree;": "⋌",
|
6619 | "rtimes;": "⋊",
|
6620 | "Sacute;": "Ś",
|
6621 | "sacute;": "ś",
|
6622 | "Scaron;": "Š",
|
6623 | "scaron;": "š",
|
6624 | "Scedil;": "Ş",
|
6625 | "scedil;": "ş",
|
6626 | "scnsim;": "⋩",
|
6627 | "searhk;": "⤥",
|
6628 | "seswar;": "⤩",
|
6629 | "sfrown;": "⌢",
|
6630 | "SHCHcy;": "Щ",
|
6631 | "shchcy;": "щ",
|
6632 | "sigmaf;": "ς",
|
6633 | "sigmav;": "ς",
|
6634 | "simdot;": "⩪",
|
6635 | "smashp;": "⨳",
|
6636 | "SOFTcy;": "Ь",
|
6637 | "softcy;": "ь",
|
6638 | "solbar;": "⌿",
|
6639 | "spades;": "♠",
|
6640 | "sqcaps;": "⊓︀",
|
6641 | "sqcups;": "⊔︀",
|
6642 | "sqsube;": "⊑",
|
6643 | "sqsupe;": "⊒",
|
6644 | "Square;": "□",
|
6645 | "square;": "□",
|
6646 | "squarf;": "▪",
|
6647 | "ssetmn;": "∖",
|
6648 | "ssmile;": "⌣",
|
6649 | "sstarf;": "⋆",
|
6650 | "subdot;": "⪽",
|
6651 | "Subset;": "⋐",
|
6652 | "subset;": "⊂",
|
6653 | "subsim;": "⫇",
|
6654 | "subsub;": "⫕",
|
6655 | "subsup;": "⫓",
|
6656 | "succeq;": "⪰",
|
6657 | "supdot;": "⪾",
|
6658 | "Supset;": "⋑",
|
6659 | "supset;": "⊃",
|
6660 | "supsim;": "⫈",
|
6661 | "supsub;": "⫔",
|
6662 | "supsup;": "⫖",
|
6663 | "swarhk;": "⤦",
|
6664 | "swnwar;": "⤪",
|
6665 | "target;": "⌖",
|
6666 | "Tcaron;": "Ť",
|
6667 | "tcaron;": "ť",
|
6668 | "Tcedil;": "Ţ",
|
6669 | "tcedil;": "ţ",
|
6670 | "telrec;": "⌕",
|
6671 | "there4;": "∴",
|
6672 | "thetav;": "ϑ",
|
6673 | "thinsp;": " ",
|
6674 | "thksim;": "∼",
|
6675 | "timesb;": "⊠",
|
6676 | "timesd;": "⨰",
|
6677 | "topbot;": "⌶",
|
6678 | "topcir;": "⫱",
|
6679 | "tprime;": "‴",
|
6680 | "tridot;": "◬",
|
6681 | "Tstrok;": "Ŧ",
|
6682 | "tstrok;": "ŧ",
|
6683 | "Uacute;": "Ú",
|
6684 | "uacute;": "ú",
|
6685 | "Ubreve;": "Ŭ",
|
6686 | "ubreve;": "ŭ",
|
6687 | "Udblac;": "Ű",
|
6688 | "udblac;": "ű",
|
6689 | "ufisht;": "⥾",
|
6690 | "Ugrave;": "Ù",
|
6691 | "ugrave;": "ù",
|
6692 | "ulcorn;": "⌜",
|
6693 | "ulcrop;": "⌏",
|
6694 | "urcorn;": "⌝",
|
6695 | "urcrop;": "⌎",
|
6696 | "Utilde;": "Ũ",
|
6697 | "utilde;": "ũ",
|
6698 | "vangrt;": "⦜",
|
6699 | "varphi;": "ϕ",
|
6700 | "varrho;": "ϱ",
|
6701 | "Vdashl;": "⫦",
|
6702 | "veebar;": "⊻",
|
6703 | "vellip;": "⋮",
|
6704 | "Verbar;": "‖",
|
6705 | "verbar;": "|",
|
6706 | "vsubnE;": "⫋︀",
|
6707 | "vsubne;": "⊊︀",
|
6708 | "vsupnE;": "⫌︀",
|
6709 | "vsupne;": "⊋︀",
|
6710 | "Vvdash;": "⊪",
|
6711 | "wedbar;": "⩟",
|
6712 | "wedgeq;": "≙",
|
6713 | "weierp;": "℘",
|
6714 | "wreath;": "≀",
|
6715 | "xoplus;": "⨁",
|
6716 | "xotime;": "⨂",
|
6717 | "xsqcup;": "⨆",
|
6718 | "xuplus;": "⨄",
|
6719 | "xwedge;": "⋀",
|
6720 | "Yacute;": "Ý",
|
6721 | "yacute;": "ý",
|
6722 | "Zacute;": "Ź",
|
6723 | "zacute;": "ź",
|
6724 | "Zcaron;": "Ž",
|
6725 | "zcaron;": "ž",
|
6726 | "zeetrf;": "ℨ",
|
6727 | "alefsym;": "ℵ",
|
6728 | "angrtvb;": "⊾",
|
6729 | "angzarr;": "⍼",
|
6730 | "asympeq;": "≍",
|
6731 | "backsim;": "∽",
|
6732 | "Because;": "∵",
|
6733 | "because;": "∵",
|
6734 | "bemptyv;": "⦰",
|
6735 | "between;": "≬",
|
6736 | "bigcirc;": "◯",
|
6737 | "bigodot;": "⨀",
|
6738 | "bigstar;": "★",
|
6739 | "bnequiv;": "≡⃥",
|
6740 | "boxplus;": "⊞",
|
6741 | "Cayleys;": "ℭ",
|
6742 | "Cconint;": "∰",
|
6743 | "ccupssm;": "⩐",
|
6744 | "Cedilla;": "¸",
|
6745 | "cemptyv;": "⦲",
|
6746 | "cirscir;": "⧂",
|
6747 | "coloneq;": "≔",
|
6748 | "congdot;": "⩭",
|
6749 | "cudarrl;": "⤸",
|
6750 | "cudarrr;": "⤵",
|
6751 | "cularrp;": "⤽",
|
6752 | "curarrm;": "⤼",
|
6753 | "dbkarow;": "⤏",
|
6754 | "ddagger;": "‡",
|
6755 | "ddotseq;": "⩷",
|
6756 | "demptyv;": "⦱",
|
6757 | "Diamond;": "⋄",
|
6758 | "diamond;": "⋄",
|
6759 | "digamma;": "ϝ",
|
6760 | "dotplus;": "∔",
|
6761 | "DownTee;": "⊤",
|
6762 | "dwangle;": "⦦",
|
6763 | "Element;": "∈",
|
6764 | "Epsilon;": "Ε",
|
6765 | "epsilon;": "ε",
|
6766 | "eqcolon;": "≕",
|
6767 | "equivDD;": "⩸",
|
6768 | "gesdoto;": "⪂",
|
6769 | "gtquest;": "⩼",
|
6770 | "gtrless;": "≷",
|
6771 | "harrcir;": "⥈",
|
6772 | "Implies;": "⇒",
|
6773 | "intprod;": "⨼",
|
6774 | "isindot;": "⋵",
|
6775 | "larrbfs;": "⤟",
|
6776 | "larrsim;": "⥳",
|
6777 | "lbrksld;": "⦏",
|
6778 | "lbrkslu;": "⦍",
|
6779 | "ldrdhar;": "⥧",
|
6780 | "LeftTee;": "⊣",
|
6781 | "lesdoto;": "⪁",
|
6782 | "lessdot;": "⋖",
|
6783 | "lessgtr;": "≶",
|
6784 | "lesssim;": "≲",
|
6785 | "lotimes;": "⨴",
|
6786 | "lozenge;": "◊",
|
6787 | "ltquest;": "⩻",
|
6788 | "luruhar;": "⥦",
|
6789 | "maltese;": "✠",
|
6790 | "minusdu;": "⨪",
|
6791 | "napprox;": "≉",
|
6792 | "natural;": "♮",
|
6793 | "nearrow;": "↗",
|
6794 | "NewLine;": "\n",
|
6795 | "nexists;": "∄",
|
6796 | "NoBreak;": "",
|
6797 | "notinva;": "∉",
|
6798 | "notinvb;": "⋷",
|
6799 | "notinvc;": "⋶",
|
6800 | "NotLess;": "≮",
|
6801 | "notniva;": "∌",
|
6802 | "notnivb;": "⋾",
|
6803 | "notnivc;": "⋽",
|
6804 | "npolint;": "⨔",
|
6805 | "npreceq;": "⪯̸",
|
6806 | "nsqsube;": "⋢",
|
6807 | "nsqsupe;": "⋣",
|
6808 | "nsubset;": "⊂⃒",
|
6809 | "nsucceq;": "⪰̸",
|
6810 | "nsupset;": "⊃⃒",
|
6811 | "nvinfin;": "⧞",
|
6812 | "nvltrie;": "⊴⃒",
|
6813 | "nvrtrie;": "⊵⃒",
|
6814 | "nwarrow;": "↖",
|
6815 | "olcross;": "⦻",
|
6816 | "Omicron;": "Ο",
|
6817 | "omicron;": "ο",
|
6818 | "orderof;": "ℴ",
|
6819 | "orslope;": "⩗",
|
6820 | "OverBar;": "‾",
|
6821 | "pertenk;": "‱",
|
6822 | "planckh;": "ℎ",
|
6823 | "pluscir;": "⨢",
|
6824 | "plussim;": "⨦",
|
6825 | "plustwo;": "⨧",
|
6826 | "precsim;": "≾",
|
6827 | "Product;": "∏",
|
6828 | "quatint;": "⨖",
|
6829 | "questeq;": "≟",
|
6830 | "rarrbfs;": "⤠",
|
6831 | "rarrsim;": "⥴",
|
6832 | "rbrksld;": "⦎",
|
6833 | "rbrkslu;": "⦐",
|
6834 | "rdldhar;": "⥩",
|
6835 | "realine;": "ℛ",
|
6836 | "rotimes;": "⨵",
|
6837 | "ruluhar;": "⥨",
|
6838 | "searrow;": "↘",
|
6839 | "simplus;": "⨤",
|
6840 | "simrarr;": "⥲",
|
6841 | "subedot;": "⫃",
|
6842 | "submult;": "⫁",
|
6843 | "subplus;": "⪿",
|
6844 | "subrarr;": "⥹",
|
6845 | "succsim;": "≿",
|
6846 | "supdsub;": "⫘",
|
6847 | "supedot;": "⫄",
|
6848 | "suphsol;": "⟉",
|
6849 | "suphsub;": "⫗",
|
6850 | "suplarr;": "⥻",
|
6851 | "supmult;": "⫂",
|
6852 | "supplus;": "⫀",
|
6853 | "swarrow;": "↙",
|
6854 | "topfork;": "⫚",
|
6855 | "triplus;": "⨹",
|
6856 | "tritime;": "⨻",
|
6857 | "UpArrow;": "↑",
|
6858 | "Uparrow;": "⇑",
|
6859 | "uparrow;": "↑",
|
6860 | "Upsilon;": "Υ",
|
6861 | "upsilon;": "υ",
|
6862 | "uwangle;": "⦧",
|
6863 | "vzigzag;": "⦚",
|
6864 | "zigrarr;": "⇝",
|
6865 | "andslope;": "⩘",
|
6866 | "angmsdaa;": "⦨",
|
6867 | "angmsdab;": "⦩",
|
6868 | "angmsdac;": "⦪",
|
6869 | "angmsdad;": "⦫",
|
6870 | "angmsdae;": "⦬",
|
6871 | "angmsdaf;": "⦭",
|
6872 | "angmsdag;": "⦮",
|
6873 | "angmsdah;": "⦯",
|
6874 | "angrtvbd;": "⦝",
|
6875 | "approxeq;": "≊",
|
6876 | "awconint;": "∳",
|
6877 | "backcong;": "≌",
|
6878 | "barwedge;": "⌅",
|
6879 | "bbrktbrk;": "⎶",
|
6880 | "bigoplus;": "⨁",
|
6881 | "bigsqcup;": "⨆",
|
6882 | "biguplus;": "⨄",
|
6883 | "bigwedge;": "⋀",
|
6884 | "boxminus;": "⊟",
|
6885 | "boxtimes;": "⊠",
|
6886 | "bsolhsub;": "⟈",
|
6887 | "capbrcup;": "⩉",
|
6888 | "circledR;": "®",
|
6889 | "circledS;": "Ⓢ",
|
6890 | "cirfnint;": "⨐",
|
6891 | "clubsuit;": "♣",
|
6892 | "cupbrcap;": "⩈",
|
6893 | "curlyvee;": "⋎",
|
6894 | "cwconint;": "∲",
|
6895 | "DDotrahd;": "⤑",
|
6896 | "doteqdot;": "≑",
|
6897 | "DotEqual;": "≐",
|
6898 | "dotminus;": "∸",
|
6899 | "drbkarow;": "⤐",
|
6900 | "dzigrarr;": "⟿",
|
6901 | "elinters;": "⏧",
|
6902 | "emptyset;": "∅",
|
6903 | "eqvparsl;": "⧥",
|
6904 | "fpartint;": "⨍",
|
6905 | "geqslant;": "⩾",
|
6906 | "gesdotol;": "⪄",
|
6907 | "gnapprox;": "⪊",
|
6908 | "hksearow;": "⤥",
|
6909 | "hkswarow;": "⤦",
|
6910 | "imagline;": "ℐ",
|
6911 | "imagpart;": "ℑ",
|
6912 | "infintie;": "⧝",
|
6913 | "integers;": "ℤ",
|
6914 | "Integral;": "∫",
|
6915 | "intercal;": "⊺",
|
6916 | "intlarhk;": "⨗",
|
6917 | "laemptyv;": "⦴",
|
6918 | "ldrushar;": "⥋",
|
6919 | "leqslant;": "⩽",
|
6920 | "lesdotor;": "⪃",
|
6921 | "LessLess;": "⪡",
|
6922 | "llcorner;": "⌞",
|
6923 | "lnapprox;": "⪉",
|
6924 | "lrcorner;": "⌟",
|
6925 | "lurdshar;": "⥊",
|
6926 | "mapstoup;": "↥",
|
6927 | "multimap;": "⊸",
|
6928 | "naturals;": "ℕ",
|
6929 | "ncongdot;": "⩭̸",
|
6930 | "NotEqual;": "≠",
|
6931 | "notindot;": "⋵̸",
|
6932 | "NotTilde;": "≁",
|
6933 | "otimesas;": "⨶",
|
6934 | "parallel;": "∥",
|
6935 | "PartialD;": "∂",
|
6936 | "plusacir;": "⨣",
|
6937 | "pointint;": "⨕",
|
6938 | "Precedes;": "≺",
|
6939 | "precneqq;": "⪵",
|
6940 | "precnsim;": "⋨",
|
6941 | "profalar;": "⌮",
|
6942 | "profline;": "⌒",
|
6943 | "profsurf;": "⌓",
|
6944 | "raemptyv;": "⦳",
|
6945 | "realpart;": "ℜ",
|
6946 | "RightTee;": "⊢",
|
6947 | "rppolint;": "⨒",
|
6948 | "rtriltri;": "⧎",
|
6949 | "scpolint;": "⨓",
|
6950 | "setminus;": "∖",
|
6951 | "shortmid;": "∣",
|
6952 | "smeparsl;": "⧤",
|
6953 | "sqsubset;": "⊏",
|
6954 | "sqsupset;": "⊐",
|
6955 | "subseteq;": "⊆",
|
6956 | "Succeeds;": "≻",
|
6957 | "succneqq;": "⪶",
|
6958 | "succnsim;": "⋩",
|
6959 | "SuchThat;": "∋",
|
6960 | "Superset;": "⊃",
|
6961 | "supseteq;": "⊇",
|
6962 | "thetasym;": "ϑ",
|
6963 | "thicksim;": "∼",
|
6964 | "timesbar;": "⨱",
|
6965 | "triangle;": "▵",
|
6966 | "triminus;": "⨺",
|
6967 | "trpezium;": "⏢",
|
6968 | "Uarrocir;": "⥉",
|
6969 | "ulcorner;": "⌜",
|
6970 | "UnderBar;": "_",
|
6971 | "urcorner;": "⌝",
|
6972 | "varkappa;": "ϰ",
|
6973 | "varsigma;": "ς",
|
6974 | "vartheta;": "ϑ",
|
6975 | "backprime;": "‵",
|
6976 | "backsimeq;": "⋍",
|
6977 | "Backslash;": "∖",
|
6978 | "bigotimes;": "⨂",
|
6979 | "CenterDot;": "·",
|
6980 | "centerdot;": "·",
|
6981 | "checkmark;": "✓",
|
6982 | "CircleDot;": "⊙",
|
6983 | "complexes;": "ℂ",
|
6984 | "Congruent;": "≡",
|
6985 | "Coproduct;": "∐",
|
6986 | "dotsquare;": "⊡",
|
6987 | "DoubleDot;": "¨",
|
6988 | "DownArrow;": "↓",
|
6989 | "Downarrow;": "⇓",
|
6990 | "downarrow;": "↓",
|
6991 | "DownBreve;": "̑",
|
6992 | "gtrapprox;": "⪆",
|
6993 | "gtreqless;": "⋛",
|
6994 | "gvertneqq;": "≩︀",
|
6995 | "heartsuit;": "♥",
|
6996 | "HumpEqual;": "≏",
|
6997 | "LeftArrow;": "←",
|
6998 | "Leftarrow;": "⇐",
|
6999 | "leftarrow;": "←",
|
7000 | "LeftFloor;": "⌊",
|
7001 | "lesseqgtr;": "⋚",
|
7002 | "LessTilde;": "≲",
|
7003 | "lvertneqq;": "≨︀",
|
7004 | "Mellintrf;": "ℳ",
|
7005 | "MinusPlus;": "∓",
|
7006 | "ngeqslant;": "⩾̸",
|
7007 | "nleqslant;": "⩽̸",
|
7008 | "NotCupCap;": "≭",
|
7009 | "NotExists;": "∄",
|
7010 | "NotSubset;": "⊂⃒",
|
7011 | "nparallel;": "∦",
|
7012 | "nshortmid;": "∤",
|
7013 | "nsubseteq;": "⊈",
|
7014 | "nsupseteq;": "⊉",
|
7015 | "OverBrace;": "⏞",
|
7016 | "pitchfork;": "⋔",
|
7017 | "PlusMinus;": "±",
|
7018 | "rationals;": "ℚ",
|
7019 | "spadesuit;": "♠",
|
7020 | "subseteqq;": "⫅",
|
7021 | "subsetneq;": "⊊",
|
7022 | "supseteqq;": "⫆",
|
7023 | "supsetneq;": "⊋",
|
7024 | "Therefore;": "∴",
|
7025 | "therefore;": "∴",
|
7026 | "ThinSpace;": " ",
|
7027 | "triangleq;": "≜",
|
7028 | "TripleDot;": "⃛",
|
7029 | "UnionPlus;": "⊎",
|
7030 | "varpropto;": "∝",
|
7031 | "Bernoullis;": "ℬ",
|
7032 | "circledast;": "⊛",
|
7033 | "CirclePlus;": "⊕",
|
7034 | "complement;": "∁",
|
7035 | "curlywedge;": "⋏",
|
7036 | "eqslantgtr;": "⪖",
|
7037 | "EqualTilde;": "≂",
|
7038 | "Fouriertrf;": "ℱ",
|
7039 | "gtreqqless;": "⪌",
|
7040 | "ImaginaryI;": "ⅈ",
|
7041 | "Laplacetrf;": "ℒ",
|
7042 | "LeftVector;": "↼",
|
7043 | "lessapprox;": "⪅",
|
7044 | "lesseqqgtr;": "⪋",
|
7045 | "Lleftarrow;": "⇚",
|
7046 | "lmoustache;": "⎰",
|
7047 | "longmapsto;": "⟼",
|
7048 | "mapstodown;": "↧",
|
7049 | "mapstoleft;": "↤",
|
7050 | "nLeftarrow;": "⇍",
|
7051 | "nleftarrow;": "↚",
|
7052 | "NotElement;": "∉",
|
7053 | "NotGreater;": "≯",
|
7054 | "nsubseteqq;": "⫅̸",
|
7055 | "nsupseteqq;": "⫆̸",
|
7056 | "precapprox;": "⪷",
|
7057 | "Proportion;": "∷",
|
7058 | "RightArrow;": "→",
|
7059 | "Rightarrow;": "⇒",
|
7060 | "rightarrow;": "→",
|
7061 | "RightFloor;": "⌋",
|
7062 | "rmoustache;": "⎱",
|
7063 | "sqsubseteq;": "⊑",
|
7064 | "sqsupseteq;": "⊒",
|
7065 | "subsetneqq;": "⫋",
|
7066 | "succapprox;": "⪸",
|
7067 | "supsetneqq;": "⫌",
|
7068 | "ThickSpace;": " ",
|
7069 | "TildeEqual;": "≃",
|
7070 | "TildeTilde;": "≈",
|
7071 | "UnderBrace;": "⏟",
|
7072 | "UpArrowBar;": "⤒",
|
7073 | "UpTeeArrow;": "↥",
|
7074 | "upuparrows;": "⇈",
|
7075 | "varepsilon;": "ϵ",
|
7076 | "varnothing;": "∅",
|
7077 | "backepsilon;": "϶",
|
7078 | "blacksquare;": "▪",
|
7079 | "circledcirc;": "⊚",
|
7080 | "circleddash;": "⊝",
|
7081 | "CircleMinus;": "⊖",
|
7082 | "CircleTimes;": "⊗",
|
7083 | "curlyeqprec;": "⋞",
|
7084 | "curlyeqsucc;": "⋟",
|
7085 | "diamondsuit;": "♦",
|
7086 | "eqslantless;": "⪕",
|
7087 | "Equilibrium;": "⇌",
|
7088 | "expectation;": "ℰ",
|
7089 | "GreaterLess;": "≷",
|
7090 | "LeftCeiling;": "⌈",
|
7091 | "LessGreater;": "≶",
|
7092 | "MediumSpace;": " ",
|
7093 | "NotLessLess;": "≪̸",
|
7094 | "NotPrecedes;": "⊀",
|
7095 | "NotSucceeds;": "⊁",
|
7096 | "NotSuperset;": "⊃⃒",
|
7097 | "nRightarrow;": "⇏",
|
7098 | "nrightarrow;": "↛",
|
7099 | "OverBracket;": "⎴",
|
7100 | "preccurlyeq;": "≼",
|
7101 | "precnapprox;": "⪹",
|
7102 | "quaternions;": "ℍ",
|
7103 | "RightVector;": "⇀",
|
7104 | "Rrightarrow;": "⇛",
|
7105 | "RuleDelayed;": "⧴",
|
7106 | "SmallCircle;": "∘",
|
7107 | "SquareUnion;": "⊔",
|
7108 | "straightphi;": "ϕ",
|
7109 | "SubsetEqual;": "⊆",
|
7110 | "succcurlyeq;": "≽",
|
7111 | "succnapprox;": "⪺",
|
7112 | "thickapprox;": "≈",
|
7113 | "UpDownArrow;": "↕",
|
7114 | "Updownarrow;": "⇕",
|
7115 | "updownarrow;": "↕",
|
7116 | "VerticalBar;": "∣",
|
7117 | "blacklozenge;": "⧫",
|
7118 | "DownArrowBar;": "⤓",
|
7119 | "DownTeeArrow;": "↧",
|
7120 | "ExponentialE;": "ⅇ",
|
7121 | "exponentiale;": "ⅇ",
|
7122 | "GreaterEqual;": "≥",
|
7123 | "GreaterTilde;": "≳",
|
7124 | "HilbertSpace;": "ℋ",
|
7125 | "HumpDownHump;": "≎",
|
7126 | "Intersection;": "⋂",
|
7127 | "LeftArrowBar;": "⇤",
|
7128 | "LeftTeeArrow;": "↤",
|
7129 | "LeftTriangle;": "⊲",
|
7130 | "LeftUpVector;": "↿",
|
7131 | "NotCongruent;": "≢",
|
7132 | "NotHumpEqual;": "≏̸",
|
7133 | "NotLessEqual;": "≰",
|
7134 | "NotLessTilde;": "≴",
|
7135 | "Proportional;": "∝",
|
7136 | "RightCeiling;": "⌉",
|
7137 | "risingdotseq;": "≓",
|
7138 | "RoundImplies;": "⥰",
|
7139 | "ShortUpArrow;": "↑",
|
7140 | "SquareSubset;": "⊏",
|
7141 | "triangledown;": "▿",
|
7142 | "triangleleft;": "◃",
|
7143 | "UnderBracket;": "⎵",
|
7144 | "varsubsetneq;": "⊊︀",
|
7145 | "varsupsetneq;": "⊋︀",
|
7146 | "VerticalLine;": "|",
|
7147 | "ApplyFunction;": "",
|
7148 | "bigtriangleup;": "△",
|
7149 | "blacktriangle;": "▴",
|
7150 | "DifferentialD;": "ⅆ",
|
7151 | "divideontimes;": "⋇",
|
7152 | "DoubleLeftTee;": "⫤",
|
7153 | "DoubleUpArrow;": "⇑",
|
7154 | "fallingdotseq;": "≒",
|
7155 | "hookleftarrow;": "↩",
|
7156 | "leftarrowtail;": "↢",
|
7157 | "leftharpoonup;": "↼",
|
7158 | "LeftTeeVector;": "⥚",
|
7159 | "LeftVectorBar;": "⥒",
|
7160 | "LessFullEqual;": "≦",
|
7161 | "LongLeftArrow;": "⟵",
|
7162 | "Longleftarrow;": "⟸",
|
7163 | "longleftarrow;": "⟵",
|
7164 | "looparrowleft;": "↫",
|
7165 | "measuredangle;": "∡",
|
7166 | "NotEqualTilde;": "≂̸",
|
7167 | "NotTildeEqual;": "≄",
|
7168 | "NotTildeTilde;": "≉",
|
7169 | "ntriangleleft;": "⋪",
|
7170 | "Poincareplane;": "ℌ",
|
7171 | "PrecedesEqual;": "⪯",
|
7172 | "PrecedesTilde;": "≾",
|
7173 | "RightArrowBar;": "⇥",
|
7174 | "RightTeeArrow;": "↦",
|
7175 | "RightTriangle;": "⊳",
|
7176 | "RightUpVector;": "↾",
|
7177 | "shortparallel;": "∥",
|
7178 | "smallsetminus;": "∖",
|
7179 | "SucceedsEqual;": "⪰",
|
7180 | "SucceedsTilde;": "≿",
|
7181 | "SupersetEqual;": "⊇",
|
7182 | "triangleright;": "▹",
|
7183 | "UpEquilibrium;": "⥮",
|
7184 | "upharpoonleft;": "↿",
|
7185 | "varsubsetneqq;": "⫋︀",
|
7186 | "varsupsetneqq;": "⫌︀",
|
7187 | "VerticalTilde;": "≀",
|
7188 | "VeryThinSpace;": " ",
|
7189 | "curvearrowleft;": "↶",
|
7190 | "DiacriticalDot;": "˙",
|
7191 | "doublebarwedge;": "⌆",
|
7192 | "DoubleRightTee;": "⊨",
|
7193 | "downdownarrows;": "⇊",
|
7194 | "DownLeftVector;": "↽",
|
7195 | "GreaterGreater;": "⪢",
|
7196 | "hookrightarrow;": "↪",
|
7197 | "HorizontalLine;": "─",
|
7198 | "InvisibleComma;": "",
|
7199 | "InvisibleTimes;": "",
|
7200 | "LeftDownVector;": "⇃",
|
7201 | "leftleftarrows;": "⇇",
|
7202 | "LeftRightArrow;": "↔",
|
7203 | "Leftrightarrow;": "⇔",
|
7204 | "leftrightarrow;": "↔",
|
7205 | "leftthreetimes;": "⋋",
|
7206 | "LessSlantEqual;": "⩽",
|
7207 | "LongRightArrow;": "⟶",
|
7208 | "Longrightarrow;": "⟹",
|
7209 | "longrightarrow;": "⟶",
|
7210 | "looparrowright;": "↬",
|
7211 | "LowerLeftArrow;": "↙",
|
7212 | "NestedLessLess;": "≪",
|
7213 | "NotGreaterLess;": "≹",
|
7214 | "NotLessGreater;": "≸",
|
7215 | "NotSubsetEqual;": "⊈",
|
7216 | "NotVerticalBar;": "∤",
|
7217 | "nshortparallel;": "∦",
|
7218 | "ntriangleright;": "⋫",
|
7219 | "OpenCurlyQuote;": "‘",
|
7220 | "ReverseElement;": "∋",
|
7221 | "rightarrowtail;": "↣",
|
7222 | "rightharpoonup;": "⇀",
|
7223 | "RightTeeVector;": "⥛",
|
7224 | "RightVectorBar;": "⥓",
|
7225 | "ShortDownArrow;": "↓",
|
7226 | "ShortLeftArrow;": "←",
|
7227 | "SquareSuperset;": "⊐",
|
7228 | "TildeFullEqual;": "≅",
|
7229 | "trianglelefteq;": "⊴",
|
7230 | "upharpoonright;": "↾",
|
7231 | "UpperLeftArrow;": "↖",
|
7232 | "ZeroWidthSpace;": "",
|
7233 | "bigtriangledown;": "▽",
|
7234 | "circlearrowleft;": "↺",
|
7235 | "CloseCurlyQuote;": "’",
|
7236 | "ContourIntegral;": "∮",
|
7237 | "curvearrowright;": "↷",
|
7238 | "DoubleDownArrow;": "⇓",
|
7239 | "DoubleLeftArrow;": "⇐",
|
7240 | "downharpoonleft;": "⇃",
|
7241 | "DownRightVector;": "⇁",
|
7242 | "leftharpoondown;": "↽",
|
7243 | "leftrightarrows;": "⇆",
|
7244 | "LeftRightVector;": "⥎",
|
7245 | "LeftTriangleBar;": "⧏",
|
7246 | "LeftUpTeeVector;": "⥠",
|
7247 | "LeftUpVectorBar;": "⥘",
|
7248 | "LowerRightArrow;": "↘",
|
7249 | "nLeftrightarrow;": "⇎",
|
7250 | "nleftrightarrow;": "↮",
|
7251 | "NotGreaterEqual;": "≱",
|
7252 | "NotGreaterTilde;": "≵",
|
7253 | "NotHumpDownHump;": "≎̸",
|
7254 | "NotLeftTriangle;": "⋪",
|
7255 | "NotSquareSubset;": "⊏̸",
|
7256 | "ntrianglelefteq;": "⋬",
|
7257 | "OverParenthesis;": "⏜",
|
7258 | "RightDownVector;": "⇂",
|
7259 | "rightleftarrows;": "⇄",
|
7260 | "rightsquigarrow;": "↝",
|
7261 | "rightthreetimes;": "⋌",
|
7262 | "ShortRightArrow;": "→",
|
7263 | "straightepsilon;": "ϵ",
|
7264 | "trianglerighteq;": "⊵",
|
7265 | "UpperRightArrow;": "↗",
|
7266 | "vartriangleleft;": "⊲",
|
7267 | "circlearrowright;": "↻",
|
7268 | "DiacriticalAcute;": "´",
|
7269 | "DiacriticalGrave;": "`",
|
7270 | "DiacriticalTilde;": "˜",
|
7271 | "DoubleRightArrow;": "⇒",
|
7272 | "DownArrowUpArrow;": "⇵",
|
7273 | "downharpoonright;": "⇂",
|
7274 | "EmptySmallSquare;": "◻",
|
7275 | "GreaterEqualLess;": "⋛",
|
7276 | "GreaterFullEqual;": "≧",
|
7277 | "LeftAngleBracket;": "⟨",
|
7278 | "LeftUpDownVector;": "⥑",
|
7279 | "LessEqualGreater;": "⋚",
|
7280 | "NonBreakingSpace;": " ",
|
7281 | "NotPrecedesEqual;": "⪯̸",
|
7282 | "NotRightTriangle;": "⋫",
|
7283 | "NotSucceedsEqual;": "⪰̸",
|
7284 | "NotSucceedsTilde;": "≿̸",
|
7285 | "NotSupersetEqual;": "⊉",
|
7286 | "ntrianglerighteq;": "⋭",
|
7287 | "rightharpoondown;": "⇁",
|
7288 | "rightrightarrows;": "⇉",
|
7289 | "RightTriangleBar;": "⧐",
|
7290 | "RightUpTeeVector;": "⥜",
|
7291 | "RightUpVectorBar;": "⥔",
|
7292 | "twoheadleftarrow;": "↞",
|
7293 | "UnderParenthesis;": "⏝",
|
7294 | "UpArrowDownArrow;": "⇅",
|
7295 | "vartriangleright;": "⊳",
|
7296 | "blacktriangledown;": "▾",
|
7297 | "blacktriangleleft;": "◂",
|
7298 | "DoubleUpDownArrow;": "⇕",
|
7299 | "DoubleVerticalBar;": "∥",
|
7300 | "DownLeftTeeVector;": "⥞",
|
7301 | "DownLeftVectorBar;": "⥖",
|
7302 | "FilledSmallSquare;": "◼",
|
7303 | "GreaterSlantEqual;": "⩾",
|
7304 | "LeftDoubleBracket;": "⟦",
|
7305 | "LeftDownTeeVector;": "⥡",
|
7306 | "LeftDownVectorBar;": "⥙",
|
7307 | "leftrightharpoons;": "⇋",
|
7308 | "LeftTriangleEqual;": "⊴",
|
7309 | "NegativeThinSpace;": "",
|
7310 | "NotGreaterGreater;": "≫̸",
|
7311 | "NotLessSlantEqual;": "⩽̸",
|
7312 | "NotNestedLessLess;": "⪡̸",
|
7313 | "NotReverseElement;": "∌",
|
7314 | "NotSquareSuperset;": "⊐̸",
|
7315 | "NotTildeFullEqual;": "≇",
|
7316 | "RightAngleBracket;": "⟩",
|
7317 | "rightleftharpoons;": "⇌",
|
7318 | "RightUpDownVector;": "⥏",
|
7319 | "SquareSubsetEqual;": "⊑",
|
7320 | "twoheadrightarrow;": "↠",
|
7321 | "VerticalSeparator;": "❘",
|
7322 | "blacktriangleright;": "▸",
|
7323 | "DownRightTeeVector;": "⥟",
|
7324 | "DownRightVectorBar;": "⥗",
|
7325 | "LongLeftRightArrow;": "⟷",
|
7326 | "Longleftrightarrow;": "⟺",
|
7327 | "longleftrightarrow;": "⟷",
|
7328 | "NegativeThickSpace;": "",
|
7329 | "NotLeftTriangleBar;": "⧏̸",
|
7330 | "PrecedesSlantEqual;": "≼",
|
7331 | "ReverseEquilibrium;": "⇋",
|
7332 | "RightDoubleBracket;": "⟧",
|
7333 | "RightDownTeeVector;": "⥝",
|
7334 | "RightDownVectorBar;": "⥕",
|
7335 | "RightTriangleEqual;": "⊵",
|
7336 | "SquareIntersection;": "⊓",
|
7337 | "SucceedsSlantEqual;": "≽",
|
7338 | "DoubleLongLeftArrow;": "⟸",
|
7339 | "DownLeftRightVector;": "⥐",
|
7340 | "LeftArrowRightArrow;": "⇆",
|
7341 | "leftrightsquigarrow;": "↭",
|
7342 | "NegativeMediumSpace;": "",
|
7343 | "NotGreaterFullEqual;": "≧̸",
|
7344 | "NotRightTriangleBar;": "⧐̸",
|
7345 | "RightArrowLeftArrow;": "⇄",
|
7346 | "SquareSupersetEqual;": "⊒",
|
7347 | "CapitalDifferentialD;": "ⅅ",
|
7348 | "DoubleLeftRightArrow;": "⇔",
|
7349 | "DoubleLongRightArrow;": "⟹",
|
7350 | "EmptyVerySmallSquare;": "▫",
|
7351 | "NestedGreaterGreater;": "≫",
|
7352 | "NotDoubleVerticalBar;": "∦",
|
7353 | "NotGreaterSlantEqual;": "⩾̸",
|
7354 | "NotLeftTriangleEqual;": "⋬",
|
7355 | "NotSquareSubsetEqual;": "⋢",
|
7356 | "OpenCurlyDoubleQuote;": "“",
|
7357 | "ReverseUpEquilibrium;": "⥯",
|
7358 | "CloseCurlyDoubleQuote;": "”",
|
7359 | "DoubleContourIntegral;": "∯",
|
7360 | "FilledVerySmallSquare;": "▪",
|
7361 | "NegativeVeryThinSpace;": "",
|
7362 | "NotPrecedesSlantEqual;": "⋠",
|
7363 | "NotRightTriangleEqual;": "⋭",
|
7364 | "NotSucceedsSlantEqual;": "⋡",
|
7365 | "DiacriticalDoubleAcute;": "˝",
|
7366 | "NotSquareSupersetEqual;": "⋣",
|
7367 | "NotNestedGreaterGreater;": "⪢̸",
|
7368 | "ClockwiseContourIntegral;": "∲",
|
7369 | "DoubleLongLeftRightArrow;": "⟺",
|
7370 | "CounterClockwiseContourIntegral;": "∳"
|
7371 | };
|
7372 |
|
7373 |
|
7374 | let maxCRNameLength;
|
7375 | const decodeHtml = (rawText, asAttr) => {
|
7376 | let offset = 0;
|
7377 | const end = rawText.length;
|
7378 | let decodedText = '';
|
7379 | function advance(length) {
|
7380 | offset += length;
|
7381 | rawText = rawText.slice(length);
|
7382 | }
|
7383 | while (offset < end) {
|
7384 | const head = /&(?:#x?)?/i.exec(rawText);
|
7385 | if (!head || offset + head.index >= end) {
|
7386 | const remaining = end - offset;
|
7387 | decodedText += rawText.slice(0, remaining);
|
7388 | advance(remaining);
|
7389 | break;
|
7390 | }
|
7391 |
|
7392 | decodedText += rawText.slice(0, head.index);
|
7393 | advance(head.index);
|
7394 | if (head[0] === '&') {
|
7395 |
|
7396 | let name = '';
|
7397 | let value = undefined;
|
7398 | if (/[0-9a-z]/i.test(rawText[1])) {
|
7399 | if (!maxCRNameLength) {
|
7400 | maxCRNameLength = Object.keys(namedCharacterReferences).reduce((max, name) => Math.max(max, name.length), 0);
|
7401 | }
|
7402 | for (let length = maxCRNameLength; !value && length > 0; --length) {
|
7403 | name = rawText.substr(1, length);
|
7404 | value = namedCharacterReferences[name];
|
7405 | }
|
7406 | if (value) {
|
7407 | const semi = name.endsWith(';');
|
7408 | if (asAttr &&
|
7409 | !semi &&
|
7410 | /[=a-z0-9]/i.test(rawText[name.length + 1] || '')) {
|
7411 | decodedText += '&' + name;
|
7412 | advance(1 + name.length);
|
7413 | }
|
7414 | else {
|
7415 | decodedText += value;
|
7416 | advance(1 + name.length);
|
7417 | }
|
7418 | }
|
7419 | else {
|
7420 | decodedText += '&' + name;
|
7421 | advance(1 + name.length);
|
7422 | }
|
7423 | }
|
7424 | else {
|
7425 | decodedText += '&';
|
7426 | advance(1);
|
7427 | }
|
7428 | }
|
7429 | else {
|
7430 |
|
7431 | const hex = head[0] === '&#x';
|
7432 | const pattern = hex ? /^&#x([0-9a-f]+);?/i : /^&#([0-9]+);?/;
|
7433 | const body = pattern.exec(rawText);
|
7434 | if (!body) {
|
7435 | decodedText += head[0];
|
7436 | advance(head[0].length);
|
7437 | }
|
7438 | else {
|
7439 |
|
7440 | let cp = Number.parseInt(body[1], hex ? 16 : 10);
|
7441 | if (cp === 0) {
|
7442 | cp = 0xfffd;
|
7443 | }
|
7444 | else if (cp > 0x10ffff) {
|
7445 | cp = 0xfffd;
|
7446 | }
|
7447 | else if (cp >= 0xd800 && cp <= 0xdfff) {
|
7448 | cp = 0xfffd;
|
7449 | }
|
7450 | else if ((cp >= 0xfdd0 && cp <= 0xfdef) || (cp & 0xfffe) === 0xfffe) ;
|
7451 | else if ((cp >= 0x01 && cp <= 0x08) ||
|
7452 | cp === 0x0b ||
|
7453 | (cp >= 0x0d && cp <= 0x1f) ||
|
7454 | (cp >= 0x7f && cp <= 0x9f)) {
|
7455 | cp = CCR_REPLACEMENTS[cp] || cp;
|
7456 | }
|
7457 | decodedText += String.fromCodePoint(cp);
|
7458 | advance(body[0].length);
|
7459 | }
|
7460 | }
|
7461 | }
|
7462 | return decodedText;
|
7463 | };
|
7464 |
|
7465 | const CCR_REPLACEMENTS = {
|
7466 | 0x80: 0x20ac,
|
7467 | 0x82: 0x201a,
|
7468 | 0x83: 0x0192,
|
7469 | 0x84: 0x201e,
|
7470 | 0x85: 0x2026,
|
7471 | 0x86: 0x2020,
|
7472 | 0x87: 0x2021,
|
7473 | 0x88: 0x02c6,
|
7474 | 0x89: 0x2030,
|
7475 | 0x8a: 0x0160,
|
7476 | 0x8b: 0x2039,
|
7477 | 0x8c: 0x0152,
|
7478 | 0x8e: 0x017d,
|
7479 | 0x91: 0x2018,
|
7480 | 0x92: 0x2019,
|
7481 | 0x93: 0x201c,
|
7482 | 0x94: 0x201d,
|
7483 | 0x95: 0x2022,
|
7484 | 0x96: 0x2013,
|
7485 | 0x97: 0x2014,
|
7486 | 0x98: 0x02dc,
|
7487 | 0x99: 0x2122,
|
7488 | 0x9a: 0x0161,
|
7489 | 0x9b: 0x203a,
|
7490 | 0x9c: 0x0153,
|
7491 | 0x9e: 0x017e,
|
7492 | 0x9f: 0x0178
|
7493 | };
|
7494 |
|
7495 | const isRawTextContainer = shared.makeMap('style,iframe,script,noscript', true);
|
7496 | const parserOptions = {
|
7497 | isVoidTag: shared.isVoidTag,
|
7498 | isNativeTag: tag => shared.isHTMLTag(tag) || shared.isSVGTag(tag),
|
7499 | isPreTag: tag => tag === 'pre',
|
7500 | decodeEntities: decodeHtml,
|
7501 | isBuiltInComponent: (tag) => {
|
7502 | if (compilerCore.isBuiltInType(tag, `Transition`)) {
|
7503 | return TRANSITION;
|
7504 | }
|
7505 | else if (compilerCore.isBuiltInType(tag, `TransitionGroup`)) {
|
7506 | return TRANSITION_GROUP;
|
7507 | }
|
7508 | },
|
7509 |
|
7510 | getNamespace(tag, parent) {
|
7511 | let ns = parent ? parent.ns : 0 ;
|
7512 | if (parent && ns === 2 ) {
|
7513 | if (parent.tag === 'annotation-xml') {
|
7514 | if (tag === 'svg') {
|
7515 | return 1 ;
|
7516 | }
|
7517 | if (parent.props.some(a => a.type === 6 &&
|
7518 | a.name === 'encoding' &&
|
7519 | a.value != null &&
|
7520 | (a.value.content === 'text/html' ||
|
7521 | a.value.content === 'application/xhtml+xml'))) {
|
7522 | ns = 0 ;
|
7523 | }
|
7524 | }
|
7525 | else if (/^m(?:[ions]|text)$/.test(parent.tag) &&
|
7526 | tag !== 'mglyph' &&
|
7527 | tag !== 'malignmark') {
|
7528 | ns = 0 ;
|
7529 | }
|
7530 | }
|
7531 | else if (parent && ns === 1 ) {
|
7532 | if (parent.tag === 'foreignObject' ||
|
7533 | parent.tag === 'desc' ||
|
7534 | parent.tag === 'title') {
|
7535 | ns = 0 ;
|
7536 | }
|
7537 | }
|
7538 | if (ns === 0 ) {
|
7539 | if (tag === 'svg') {
|
7540 | return 1 ;
|
7541 | }
|
7542 | if (tag === 'math') {
|
7543 | return 2 ;
|
7544 | }
|
7545 | }
|
7546 | return ns;
|
7547 | },
|
7548 |
|
7549 | getTextMode({ tag, ns }) {
|
7550 | if (ns === 0 ) {
|
7551 | if (tag === 'textarea' || tag === 'title') {
|
7552 | return 1 ;
|
7553 | }
|
7554 | if (isRawTextContainer(tag)) {
|
7555 | return 2 ;
|
7556 | }
|
7557 | }
|
7558 | return 0 ;
|
7559 | }
|
7560 | };
|
7561 |
|
7562 |
|
7563 |
|
7564 |
|
7565 |
|
7566 |
|
7567 |
|
7568 | const transformStyle = node => {
|
7569 | if (node.type === 1 ) {
|
7570 | node.props.forEach((p, i) => {
|
7571 | if (p.type === 6 && p.name === 'style' && p.value) {
|
7572 |
|
7573 | node.props[i] = {
|
7574 | type: 7 ,
|
7575 | name: `bind`,
|
7576 | arg: compilerCore.createSimpleExpression(`style`, true, p.loc),
|
7577 | exp: parseInlineCSS(p.value.content, p.loc),
|
7578 | modifiers: [],
|
7579 | loc: p.loc
|
7580 | };
|
7581 | }
|
7582 | });
|
7583 | }
|
7584 | };
|
7585 | const parseInlineCSS = (cssText, loc) => {
|
7586 | const normalized = shared.parseStringStyle(cssText);
|
7587 | return compilerCore.createSimpleExpression(JSON.stringify(normalized), false, loc, 3 );
|
7588 | };
|
7589 |
|
7590 | function createDOMCompilerError(code, loc) {
|
7591 | return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
|
7592 | }
|
7593 | const DOMErrorMessages = {
|
7594 | [49 ]: `v-html is missing expression.`,
|
7595 | [50 ]: `v-html will override element children.`,
|
7596 | [51 ]: `v-text is missing expression.`,
|
7597 | [52 ]: `v-text will override element children.`,
|
7598 | [53 ]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
7599 | [54 ]: `v-model argument is not supported on plain elements.`,
|
7600 | [55 ]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
7601 | [56 ]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
7602 | [57 ]: `v-show is missing expression.`,
|
7603 | [58 ]: `<Transition> expects exactly one child element or component.`,
|
7604 | [59 ]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
7605 | };
|
7606 |
|
7607 | const transformVHtml = (dir, node, context) => {
|
7608 | const { exp, loc } = dir;
|
7609 | if (!exp) {
|
7610 | context.onError(createDOMCompilerError(49 , loc));
|
7611 | }
|
7612 | if (node.children.length) {
|
7613 | context.onError(createDOMCompilerError(50 , loc));
|
7614 | node.children.length = 0;
|
7615 | }
|
7616 | return {
|
7617 | props: [
|
7618 | compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`innerHTML`, true, loc), exp || compilerCore.createSimpleExpression('', true))
|
7619 | ]
|
7620 | };
|
7621 | };
|
7622 |
|
7623 | const transformVText = (dir, node, context) => {
|
7624 | const { exp, loc } = dir;
|
7625 | if (!exp) {
|
7626 | context.onError(createDOMCompilerError(51 , loc));
|
7627 | }
|
7628 | if (node.children.length) {
|
7629 | context.onError(createDOMCompilerError(52 , loc));
|
7630 | node.children.length = 0;
|
7631 | }
|
7632 | return {
|
7633 | props: [
|
7634 | compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`textContent`, true), exp
|
7635 | ? compilerCore.createCallExpression(context.helperString(compilerCore.TO_DISPLAY_STRING), [exp], loc)
|
7636 | : compilerCore.createSimpleExpression('', true))
|
7637 | ]
|
7638 | };
|
7639 | };
|
7640 |
|
7641 | const transformModel = (dir, node, context) => {
|
7642 | const baseResult = compilerCore.transformModel(dir, node, context);
|
7643 |
|
7644 | if (!baseResult.props.length || node.tagType === 1 ) {
|
7645 | return baseResult;
|
7646 | }
|
7647 | if (dir.arg) {
|
7648 | context.onError(createDOMCompilerError(54 , dir.arg.loc));
|
7649 | }
|
7650 | function checkDuplicatedValue() {
|
7651 | const value = compilerCore.findProp(node, 'value');
|
7652 | if (value) {
|
7653 | context.onError(createDOMCompilerError(56 , value.loc));
|
7654 | }
|
7655 | }
|
7656 | const { tag } = node;
|
7657 | const isCustomElement = context.isCustomElement(tag);
|
7658 | if (tag === 'input' ||
|
7659 | tag === 'textarea' ||
|
7660 | tag === 'select' ||
|
7661 | isCustomElement) {
|
7662 | let directiveToUse = V_MODEL_TEXT;
|
7663 | let isInvalidType = false;
|
7664 | if (tag === 'input' || isCustomElement) {
|
7665 | const type = compilerCore.findProp(node, `type`);
|
7666 | if (type) {
|
7667 | if (type.type === 7 ) {
|
7668 |
|
7669 | directiveToUse = V_MODEL_DYNAMIC;
|
7670 | }
|
7671 | else if (type.value) {
|
7672 | switch (type.value.content) {
|
7673 | case 'radio':
|
7674 | directiveToUse = V_MODEL_RADIO;
|
7675 | break;
|
7676 | case 'checkbox':
|
7677 | directiveToUse = V_MODEL_CHECKBOX;
|
7678 | break;
|
7679 | case 'file':
|
7680 | isInvalidType = true;
|
7681 | context.onError(createDOMCompilerError(55 , dir.loc));
|
7682 | break;
|
7683 | default:
|
7684 |
|
7685 | checkDuplicatedValue();
|
7686 | break;
|
7687 | }
|
7688 | }
|
7689 | }
|
7690 | else if (compilerCore.hasDynamicKeyVBind(node)) {
|
7691 |
|
7692 |
|
7693 | directiveToUse = V_MODEL_DYNAMIC;
|
7694 | }
|
7695 | else {
|
7696 |
|
7697 | checkDuplicatedValue();
|
7698 | }
|
7699 | }
|
7700 | else if (tag === 'select') {
|
7701 | directiveToUse = V_MODEL_SELECT;
|
7702 | }
|
7703 | else {
|
7704 |
|
7705 | checkDuplicatedValue();
|
7706 | }
|
7707 |
|
7708 |
|
7709 |
|
7710 | if (!isInvalidType) {
|
7711 | baseResult.needRuntime = context.helper(directiveToUse);
|
7712 | }
|
7713 | }
|
7714 | else {
|
7715 | context.onError(createDOMCompilerError(53 , dir.loc));
|
7716 | }
|
7717 |
|
7718 |
|
7719 | baseResult.props = baseResult.props.filter(p => !(p.key.type === 4 &&
|
7720 | p.key.content === 'modelValue'));
|
7721 | return baseResult;
|
7722 | };
|
7723 |
|
7724 | const isEventOptionModifier = shared.makeMap(`passive,once,capture`);
|
7725 | const isNonKeyModifier = shared.makeMap(
|
7726 |
|
7727 | `stop,prevent,self,` +
|
7728 |
|
7729 | `ctrl,shift,alt,meta,exact,` +
|
7730 |
|
7731 | `middle`);
|
7732 |
|
7733 | const maybeKeyModifier = shared.makeMap('left,right');
|
7734 | const isKeyboardEvent = shared.makeMap(`onkeyup,onkeydown,onkeypress`, true);
|
7735 | const resolveModifiers = (key, modifiers, context, loc) => {
|
7736 | const keyModifiers = [];
|
7737 | const nonKeyModifiers = [];
|
7738 | const eventOptionModifiers = [];
|
7739 | for (let i = 0; i < modifiers.length; i++) {
|
7740 | const modifier = modifiers[i];
|
7741 | if (modifier === 'native' &&
|
7742 | compilerCore.checkCompatEnabled("COMPILER_V_ON_NATIVE" , context, loc)) {
|
7743 | eventOptionModifiers.push(modifier);
|
7744 | }
|
7745 | else if (isEventOptionModifier(modifier)) {
|
7746 |
|
7747 |
|
7748 | eventOptionModifiers.push(modifier);
|
7749 | }
|
7750 | else {
|
7751 |
|
7752 | if (maybeKeyModifier(modifier)) {
|
7753 | if (compilerCore.isStaticExp(key)) {
|
7754 | if (isKeyboardEvent(key.content)) {
|
7755 | keyModifiers.push(modifier);
|
7756 | }
|
7757 | else {
|
7758 | nonKeyModifiers.push(modifier);
|
7759 | }
|
7760 | }
|
7761 | else {
|
7762 | keyModifiers.push(modifier);
|
7763 | nonKeyModifiers.push(modifier);
|
7764 | }
|
7765 | }
|
7766 | else {
|
7767 | if (isNonKeyModifier(modifier)) {
|
7768 | nonKeyModifiers.push(modifier);
|
7769 | }
|
7770 | else {
|
7771 | keyModifiers.push(modifier);
|
7772 | }
|
7773 | }
|
7774 | }
|
7775 | }
|
7776 | return {
|
7777 | keyModifiers,
|
7778 | nonKeyModifiers,
|
7779 | eventOptionModifiers
|
7780 | };
|
7781 | };
|
7782 | const transformClick = (key, event) => {
|
7783 | const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === 'onclick';
|
7784 | return isStaticClick
|
7785 | ? compilerCore.createSimpleExpression(event, true)
|
7786 | : key.type !== 4
|
7787 | ? compilerCore.createCompoundExpression([
|
7788 | `(`,
|
7789 | key,
|
7790 | `) === "onClick" ? "${event}" : (`,
|
7791 | key,
|
7792 | `)`
|
7793 | ])
|
7794 | : key;
|
7795 | };
|
7796 | const transformOn = (dir, node, context) => {
|
7797 | return compilerCore.transformOn(dir, node, context, baseResult => {
|
7798 | const { modifiers } = dir;
|
7799 | if (!modifiers.length)
|
7800 | return baseResult;
|
7801 | let { key, value: handlerExp } = baseResult.props[0];
|
7802 | const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
|
7803 |
|
7804 | if (nonKeyModifiers.includes('right')) {
|
7805 | key = transformClick(key, `onContextmenu`);
|
7806 | }
|
7807 | if (nonKeyModifiers.includes('middle')) {
|
7808 | key = transformClick(key, `onMouseup`);
|
7809 | }
|
7810 | if (nonKeyModifiers.length) {
|
7811 | handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
|
7812 | handlerExp,
|
7813 | JSON.stringify(nonKeyModifiers)
|
7814 | ]);
|
7815 | }
|
7816 | if (keyModifiers.length &&
|
7817 |
|
7818 | (!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content))) {
|
7819 | handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
|
7820 | handlerExp,
|
7821 | JSON.stringify(keyModifiers)
|
7822 | ]);
|
7823 | }
|
7824 | if (eventOptionModifiers.length) {
|
7825 | const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join('');
|
7826 | key = compilerCore.isStaticExp(key)
|
7827 | ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true)
|
7828 | : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
|
7829 | }
|
7830 | return {
|
7831 | props: [compilerCore.createObjectProperty(key, handlerExp)]
|
7832 | };
|
7833 | });
|
7834 | };
|
7835 |
|
7836 | const transformShow = (dir, node, context) => {
|
7837 | const { exp, loc } = dir;
|
7838 | if (!exp) {
|
7839 | context.onError(createDOMCompilerError(57 , loc));
|
7840 | }
|
7841 | return {
|
7842 | props: [],
|
7843 | needRuntime: context.helper(V_SHOW)
|
7844 | };
|
7845 | };
|
7846 |
|
7847 | const warnTransitionChildren = (node, context) => {
|
7848 | if (node.type === 1 &&
|
7849 | node.tagType === 1 ) {
|
7850 | const component = context.isBuiltInComponent(node.tag);
|
7851 | if (component === TRANSITION) {
|
7852 | return () => {
|
7853 | if (node.children.length && hasMultipleChildren(node)) {
|
7854 | context.onError(createDOMCompilerError(58 , {
|
7855 | start: node.children[0].loc.start,
|
7856 | end: node.children[node.children.length - 1].loc.end,
|
7857 | source: ''
|
7858 | }));
|
7859 | }
|
7860 | };
|
7861 | }
|
7862 | }
|
7863 | };
|
7864 | function hasMultipleChildren(node) {
|
7865 |
|
7866 | const children = (node.children = node.children.filter(c => c.type !== 3 ));
|
7867 | const child = children[0];
|
7868 | return (children.length !== 1 ||
|
7869 | child.type === 11 ||
|
7870 | (child.type === 9 && child.branches.some(hasMultipleChildren)));
|
7871 | }
|
7872 |
|
7873 |
|
7874 |
|
7875 |
|
7876 |
|
7877 |
|
7878 |
|
7879 |
|
7880 |
|
7881 |
|
7882 |
|
7883 |
|
7884 |
|
7885 |
|
7886 |
|
7887 |
|
7888 |
|
7889 |
|
7890 |
|
7891 |
|
7892 |
|
7893 |
|
7894 |
|
7895 |
|
7896 |
|
7897 |
|
7898 |
|
7899 | const stringifyStatic = (children, context, parent) => {
|
7900 |
|
7901 | if (context.scopes.vSlot > 0) {
|
7902 | return;
|
7903 | }
|
7904 | let nc = 0;
|
7905 | let ec = 0;
|
7906 | const currentChunk = [];
|
7907 | const stringifyCurrentChunk = (currentIndex) => {
|
7908 | if (nc >= 20 ||
|
7909 | ec >= 5 ) {
|
7910 |
|
7911 | const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
|
7912 | JSON.stringify(currentChunk.map(node => stringifyNode(node, context)).join('')),
|
7913 |
|
7914 |
|
7915 | String(currentChunk.length)
|
7916 | ]);
|
7917 |
|
7918 | replaceHoist(currentChunk[0], staticCall, context);
|
7919 | if (currentChunk.length > 1) {
|
7920 | for (let i = 1; i < currentChunk.length; i++) {
|
7921 |
|
7922 | replaceHoist(currentChunk[i], null, context);
|
7923 | }
|
7924 |
|
7925 | const deleteCount = currentChunk.length - 1;
|
7926 | children.splice(currentIndex - currentChunk.length + 1, deleteCount);
|
7927 | return deleteCount;
|
7928 | }
|
7929 | }
|
7930 | return 0;
|
7931 | };
|
7932 | let i = 0;
|
7933 | for (; i < children.length; i++) {
|
7934 | const child = children[i];
|
7935 | const hoisted = getHoistedNode(child);
|
7936 | if (hoisted) {
|
7937 |
|
7938 | const node = child;
|
7939 | const result = analyzeNode(node);
|
7940 | if (result) {
|
7941 |
|
7942 | nc += result[0];
|
7943 | ec += result[1];
|
7944 | currentChunk.push(node);
|
7945 | continue;
|
7946 | }
|
7947 | }
|
7948 |
|
7949 |
|
7950 |
|
7951 | i -= stringifyCurrentChunk(i);
|
7952 |
|
7953 | nc = 0;
|
7954 | ec = 0;
|
7955 | currentChunk.length = 0;
|
7956 | }
|
7957 |
|
7958 | stringifyCurrentChunk(i);
|
7959 | };
|
7960 | const getHoistedNode = (node) => ((node.type === 1 && node.tagType === 0 ) ||
|
7961 | node.type == 12 ) &&
|
7962 | node.codegenNode &&
|
7963 | node.codegenNode.type === 4 &&
|
7964 | node.codegenNode.hoisted;
|
7965 | const dataAriaRE = /^(data|aria)-/;
|
7966 | const isStringifiableAttr = (name) => {
|
7967 | return shared.isKnownAttr(name) || dataAriaRE.test(name);
|
7968 | };
|
7969 | const replaceHoist = (node, replacement, context) => {
|
7970 | const hoistToReplace = node.codegenNode.hoisted;
|
7971 | context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement;
|
7972 | };
|
7973 | const isNonStringifiable = shared.makeMap(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
|
7974 |
|
7975 |
|
7976 |
|
7977 |
|
7978 |
|
7979 |
|
7980 |
|
7981 | function analyzeNode(node) {
|
7982 | if (node.type === 1 && isNonStringifiable(node.tag)) {
|
7983 | return false;
|
7984 | }
|
7985 | if (node.type === 12 ) {
|
7986 | return [1, 0];
|
7987 | }
|
7988 | let nc = 1;
|
7989 | let ec = node.props.length > 0 ? 1 : 0;
|
7990 | let bailed = false;
|
7991 | const bail = () => {
|
7992 | bailed = true;
|
7993 | return false;
|
7994 | };
|
7995 |
|
7996 |
|
7997 |
|
7998 |
|
7999 | function walk(node) {
|
8000 | for (let i = 0; i < node.props.length; i++) {
|
8001 | const p = node.props[i];
|
8002 |
|
8003 | if (p.type === 6 && !isStringifiableAttr(p.name)) {
|
8004 | return bail();
|
8005 | }
|
8006 | if (p.type === 7 && p.name === 'bind') {
|
8007 |
|
8008 | if (p.arg &&
|
8009 | (p.arg.type === 8 ||
|
8010 | (p.arg.isStatic && !isStringifiableAttr(p.arg.content)))) {
|
8011 | return bail();
|
8012 | }
|
8013 | }
|
8014 | }
|
8015 | for (let i = 0; i < node.children.length; i++) {
|
8016 | nc++;
|
8017 | const child = node.children[i];
|
8018 | if (child.type === 1 ) {
|
8019 | if (child.props.length > 0) {
|
8020 | ec++;
|
8021 | }
|
8022 | walk(child);
|
8023 | if (bailed) {
|
8024 | return false;
|
8025 | }
|
8026 | }
|
8027 | }
|
8028 | return true;
|
8029 | }
|
8030 | return walk(node) ? [nc, ec] : false;
|
8031 | }
|
8032 | function stringifyNode(node, context) {
|
8033 | if (shared.isString(node)) {
|
8034 | return node;
|
8035 | }
|
8036 | if (shared.isSymbol(node)) {
|
8037 | return ``;
|
8038 | }
|
8039 | switch (node.type) {
|
8040 | case 1 :
|
8041 | return stringifyElement(node, context);
|
8042 | case 2 :
|
8043 | return shared.escapeHtml(node.content);
|
8044 | case 3 :
|
8045 | return `<!--${shared.escapeHtml(node.content)}-->`;
|
8046 | case 5 :
|
8047 | return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
|
8048 | case 8 :
|
8049 | return shared.escapeHtml(evaluateConstant(node));
|
8050 | case 12 :
|
8051 | return stringifyNode(node.content, context);
|
8052 | default:
|
8053 |
|
8054 | return '';
|
8055 | }
|
8056 | }
|
8057 | function stringifyElement(node, context) {
|
8058 | let res = `<${node.tag}`;
|
8059 | for (let i = 0; i < node.props.length; i++) {
|
8060 | const p = node.props[i];
|
8061 | if (p.type === 6 ) {
|
8062 | res += ` ${p.name}`;
|
8063 | if (p.value) {
|
8064 | res += `="${shared.escapeHtml(p.value.content)}"`;
|
8065 | }
|
8066 | }
|
8067 | else if (p.type === 7 && p.name === 'bind') {
|
8068 |
|
8069 | let evaluated = evaluateConstant(p.exp);
|
8070 | if (evaluated != null) {
|
8071 | const arg = p.arg && p.arg.content;
|
8072 | if (arg === 'class') {
|
8073 | evaluated = shared.normalizeClass(evaluated);
|
8074 | }
|
8075 | else if (arg === 'style') {
|
8076 | evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
|
8077 | }
|
8078 | res += ` ${p.arg.content}="${shared.escapeHtml(evaluated)}"`;
|
8079 | }
|
8080 | }
|
8081 | }
|
8082 | if (context.scopeId) {
|
8083 | res += ` ${context.scopeId}`;
|
8084 | }
|
8085 | res += `>`;
|
8086 | for (let i = 0; i < node.children.length; i++) {
|
8087 | res += stringifyNode(node.children[i], context);
|
8088 | }
|
8089 | if (!shared.isVoidTag(node.tag)) {
|
8090 | res += `</${node.tag}>`;
|
8091 | }
|
8092 | return res;
|
8093 | }
|
8094 |
|
8095 |
|
8096 |
|
8097 |
|
8098 |
|
8099 |
|
8100 |
|
8101 | function evaluateConstant(exp) {
|
8102 | if (exp.type === 4 ) {
|
8103 | return new Function(`return ${exp.content}`)();
|
8104 | }
|
8105 | else {
|
8106 |
|
8107 | let res = ``;
|
8108 | exp.children.forEach(c => {
|
8109 | if (shared.isString(c) || shared.isSymbol(c)) {
|
8110 | return;
|
8111 | }
|
8112 | if (c.type === 2 ) {
|
8113 | res += c.content;
|
8114 | }
|
8115 | else if (c.type === 5 ) {
|
8116 | res += shared.toDisplayString(evaluateConstant(c.content));
|
8117 | }
|
8118 | else {
|
8119 | res += evaluateConstant(c);
|
8120 | }
|
8121 | });
|
8122 | return res;
|
8123 | }
|
8124 | }
|
8125 |
|
8126 | const ignoreSideEffectTags = (node, context) => {
|
8127 | if (node.type === 1 &&
|
8128 | node.tagType === 0 &&
|
8129 | (node.tag === 'script' || node.tag === 'style')) {
|
8130 | context.onError(createDOMCompilerError(59 , node.loc));
|
8131 | context.removeNode();
|
8132 | }
|
8133 | };
|
8134 |
|
8135 | const DOMNodeTransforms = [
|
8136 | transformStyle,
|
8137 | ...([warnTransitionChildren] )
|
8138 | ];
|
8139 | const DOMDirectiveTransforms = {
|
8140 | cloak: compilerCore.noopDirectiveTransform,
|
8141 | html: transformVHtml,
|
8142 | text: transformVText,
|
8143 | model: transformModel,
|
8144 | on: transformOn,
|
8145 | show: transformShow
|
8146 | };
|
8147 | function compile(template, options = {}) {
|
8148 | return compilerCore.baseCompile(template, shared.extend({}, parserOptions, options, {
|
8149 | nodeTransforms: [
|
8150 |
|
8151 |
|
8152 |
|
8153 | ignoreSideEffectTags,
|
8154 | ...DOMNodeTransforms,
|
8155 | ...(options.nodeTransforms || [])
|
8156 | ],
|
8157 | directiveTransforms: shared.extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
|
8158 | transformHoist: stringifyStatic
|
8159 | }));
|
8160 | }
|
8161 | function parse(template, options = {}) {
|
8162 | return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
|
8163 | }
|
8164 |
|
8165 | Object.keys(compilerCore).forEach(function (k) {
|
8166 | if (k !== 'default') exports[k] = compilerCore[k];
|
8167 | });
|
8168 | exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
|
8169 | exports.DOMNodeTransforms = DOMNodeTransforms;
|
8170 | exports.TRANSITION = TRANSITION;
|
8171 | exports.TRANSITION_GROUP = TRANSITION_GROUP;
|
8172 | exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
|
8173 | exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
|
8174 | exports.V_MODEL_RADIO = V_MODEL_RADIO;
|
8175 | exports.V_MODEL_SELECT = V_MODEL_SELECT;
|
8176 | exports.V_MODEL_TEXT = V_MODEL_TEXT;
|
8177 | exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
|
8178 | exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
|
8179 | exports.V_SHOW = V_SHOW;
|
8180 | exports.compile = compile;
|
8181 | exports.createDOMCompilerError = createDOMCompilerError;
|
8182 | exports.parse = parse;
|
8183 | exports.parserOptions = parserOptions;
|
8184 | exports.transformStyle = transformStyle;
|
8185 | }(compilerDom_cjs$2));
|
8186 |
|
8187 | var compilerDom_cjs = build.getDefaultExportFromCjs(compilerDom_cjs$2);
|
8188 |
|
8189 | var compilerDom_cjs$1 = Object.assign(Object.create(null), compilerDom_cjs$2, {
|
8190 | 'default': compilerDom_cjs
|
8191 | });
|
8192 |
|
8193 | exports.compilerDom_cjs = compilerDom_cjs$1;
|
8194 |
|