@vue/shared 3.2.47 → 3.3.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,602 +2,411 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- /**
6
- * Make a map and return a function for checking if a key
7
- * is in that map.
8
- * IMPORTANT: all calls of this function must be prefixed with
9
- * \/\*#\_\_PURE\_\_\*\/
10
- * So that rollup can tree-shake them if necessary.
11
- */
12
5
  function makeMap(str, expectsLowerCase) {
13
- const map = Object.create(null);
14
- const list = str.split(',');
15
- for (let i = 0; i < list.length; i++) {
16
- map[list[i]] = true;
17
- }
18
- return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];
6
+ const map = /* @__PURE__ */ Object.create(null);
7
+ const list = str.split(",");
8
+ for (let i = 0; i < list.length; i++) {
9
+ map[list[i]] = true;
10
+ }
11
+ return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
19
12
  }
20
13
 
21
- /**
22
- * dev only flag -> name mapping
23
- */
24
14
  const PatchFlagNames = {
25
- [1 /* PatchFlags.TEXT */]: `TEXT`,
26
- [2 /* PatchFlags.CLASS */]: `CLASS`,
27
- [4 /* PatchFlags.STYLE */]: `STYLE`,
28
- [8 /* PatchFlags.PROPS */]: `PROPS`,
29
- [16 /* PatchFlags.FULL_PROPS */]: `FULL_PROPS`,
30
- [32 /* PatchFlags.HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,
31
- [64 /* PatchFlags.STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,
32
- [128 /* PatchFlags.KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,
33
- [256 /* PatchFlags.UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,
34
- [512 /* PatchFlags.NEED_PATCH */]: `NEED_PATCH`,
35
- [1024 /* PatchFlags.DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,
36
- [2048 /* PatchFlags.DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,
37
- [-1 /* PatchFlags.HOISTED */]: `HOISTED`,
38
- [-2 /* PatchFlags.BAIL */]: `BAIL`
15
+ [1]: `TEXT`,
16
+ [2]: `CLASS`,
17
+ [4]: `STYLE`,
18
+ [8]: `PROPS`,
19
+ [16]: `FULL_PROPS`,
20
+ [32]: `HYDRATE_EVENTS`,
21
+ [64]: `STABLE_FRAGMENT`,
22
+ [128]: `KEYED_FRAGMENT`,
23
+ [256]: `UNKEYED_FRAGMENT`,
24
+ [512]: `NEED_PATCH`,
25
+ [1024]: `DYNAMIC_SLOTS`,
26
+ [2048]: `DEV_ROOT_FRAGMENT`,
27
+ [-1]: `HOISTED`,
28
+ [-2]: `BAIL`
39
29
  };
40
30
 
41
- /**
42
- * Dev only
43
- */
44
31
  const slotFlagsText = {
45
- [1 /* SlotFlags.STABLE */]: 'STABLE',
46
- [2 /* SlotFlags.DYNAMIC */]: 'DYNAMIC',
47
- [3 /* SlotFlags.FORWARDED */]: 'FORWARDED'
32
+ [1]: "STABLE",
33
+ [2]: "DYNAMIC",
34
+ [3]: "FORWARDED"
48
35
  };
49
36
 
50
- const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
51
- 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
52
- 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
53
- const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
37
+ const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
38
+ const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
54
39
 
55
40
  const range = 2;
56
41
  function generateCodeFrame(source, start = 0, end = source.length) {
57
- // Split the content into individual lines but capture the newline sequence
58
- // that separated each line. This is important because the actual sequence is
59
- // needed to properly take into account the full line length for offset
60
- // comparison
61
- let lines = source.split(/(\r?\n)/);
62
- // Separate the lines and newline sequences into separate arrays for easier referencing
63
- const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
64
- lines = lines.filter((_, idx) => idx % 2 === 0);
65
- let count = 0;
66
- const res = [];
67
- for (let i = 0; i < lines.length; i++) {
68
- count +=
69
- lines[i].length +
70
- ((newlineSequences[i] && newlineSequences[i].length) || 0);
71
- if (count >= start) {
72
- for (let j = i - range; j <= i + range || end > count; j++) {
73
- if (j < 0 || j >= lines.length)
74
- continue;
75
- const line = j + 1;
76
- res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
77
- const lineLength = lines[j].length;
78
- const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;
79
- if (j === i) {
80
- // push underline
81
- const pad = start - (count - (lineLength + newLineSeqLength));
82
- const length = Math.max(1, end > count ? lineLength - pad : end - start);
83
- res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
84
- }
85
- else if (j > i) {
86
- if (end > count) {
87
- const length = Math.max(Math.min(end - count, lineLength), 1);
88
- res.push(` | ` + '^'.repeat(length));
89
- }
90
- count += lineLength + newLineSeqLength;
91
- }
92
- }
93
- break;
42
+ let lines = source.split(/(\r?\n)/);
43
+ const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
44
+ lines = lines.filter((_, idx) => idx % 2 === 0);
45
+ let count = 0;
46
+ const res = [];
47
+ for (let i = 0; i < lines.length; i++) {
48
+ count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
49
+ if (count >= start) {
50
+ for (let j = i - range; j <= i + range || end > count; j++) {
51
+ if (j < 0 || j >= lines.length)
52
+ continue;
53
+ const line = j + 1;
54
+ res.push(
55
+ `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
56
+ );
57
+ const lineLength = lines[j].length;
58
+ const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
59
+ if (j === i) {
60
+ const pad = start - (count - (lineLength + newLineSeqLength));
61
+ const length = Math.max(
62
+ 1,
63
+ end > count ? lineLength - pad : end - start
64
+ );
65
+ res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
66
+ } else if (j > i) {
67
+ if (end > count) {
68
+ const length = Math.max(Math.min(end - count, lineLength), 1);
69
+ res.push(` | ` + "^".repeat(length));
70
+ }
71
+ count += lineLength + newLineSeqLength;
94
72
  }
73
+ }
74
+ break;
95
75
  }
96
- return res.join('\n');
76
+ }
77
+ return res.join("\n");
97
78
  }
98
79
 
99
80
  function normalizeStyle(value) {
100
- if (isArray(value)) {
101
- const res = {};
102
- for (let i = 0; i < value.length; i++) {
103
- const item = value[i];
104
- const normalized = isString(item)
105
- ? parseStringStyle(item)
106
- : normalizeStyle(item);
107
- if (normalized) {
108
- for (const key in normalized) {
109
- res[key] = normalized[key];
110
- }
111
- }
81
+ if (isArray(value)) {
82
+ const res = {};
83
+ for (let i = 0; i < value.length; i++) {
84
+ const item = value[i];
85
+ const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
86
+ if (normalized) {
87
+ for (const key in normalized) {
88
+ res[key] = normalized[key];
112
89
  }
113
- return res;
114
- }
115
- else if (isString(value)) {
116
- return value;
117
- }
118
- else if (isObject(value)) {
119
- return value;
90
+ }
120
91
  }
92
+ return res;
93
+ } else if (isString(value)) {
94
+ return value;
95
+ } else if (isObject(value)) {
96
+ return value;
97
+ }
121
98
  }
122
99
  const listDelimiterRE = /;(?![^(]*\))/g;
123
100
  const propertyDelimiterRE = /:([^]+)/;
124
101
  const styleCommentRE = /\/\*.*?\*\//gs;
125
102
  function parseStringStyle(cssText) {
126
- const ret = {};
127
- cssText
128
- .replace(styleCommentRE, '')
129
- .split(listDelimiterRE)
130
- .forEach(item => {
131
- if (item) {
132
- const tmp = item.split(propertyDelimiterRE);
133
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
134
- }
135
- });
136
- return ret;
103
+ const ret = {};
104
+ cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
105
+ if (item) {
106
+ const tmp = item.split(propertyDelimiterRE);
107
+ tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
108
+ }
109
+ });
110
+ return ret;
137
111
  }
138
112
  function stringifyStyle(styles) {
139
- let ret = '';
140
- if (!styles || isString(styles)) {
141
- return ret;
142
- }
143
- for (const key in styles) {
144
- const value = styles[key];
145
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
146
- if (isString(value) || typeof value === 'number') {
147
- // only render valid values
148
- ret += `${normalizedKey}:${value};`;
149
- }
150
- }
113
+ let ret = "";
114
+ if (!styles || isString(styles)) {
151
115
  return ret;
116
+ }
117
+ for (const key in styles) {
118
+ const value = styles[key];
119
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
120
+ if (isString(value) || typeof value === "number") {
121
+ ret += `${normalizedKey}:${value};`;
122
+ }
123
+ }
124
+ return ret;
152
125
  }
153
126
  function normalizeClass(value) {
154
- let res = '';
155
- if (isString(value)) {
156
- res = value;
157
- }
158
- else if (isArray(value)) {
159
- for (let i = 0; i < value.length; i++) {
160
- const normalized = normalizeClass(value[i]);
161
- if (normalized) {
162
- res += normalized + ' ';
163
- }
164
- }
127
+ let res = "";
128
+ if (isString(value)) {
129
+ res = value;
130
+ } else if (isArray(value)) {
131
+ for (let i = 0; i < value.length; i++) {
132
+ const normalized = normalizeClass(value[i]);
133
+ if (normalized) {
134
+ res += normalized + " ";
135
+ }
165
136
  }
166
- else if (isObject(value)) {
167
- for (const name in value) {
168
- if (value[name]) {
169
- res += name + ' ';
170
- }
171
- }
137
+ } else if (isObject(value)) {
138
+ for (const name in value) {
139
+ if (value[name]) {
140
+ res += name + " ";
141
+ }
172
142
  }
173
- return res.trim();
143
+ }
144
+ return res.trim();
174
145
  }
175
146
  function normalizeProps(props) {
176
- if (!props)
177
- return null;
178
- let { class: klass, style } = props;
179
- if (klass && !isString(klass)) {
180
- props.class = normalizeClass(klass);
181
- }
182
- if (style) {
183
- props.style = normalizeStyle(style);
184
- }
185
- return props;
147
+ if (!props)
148
+ return null;
149
+ let { class: klass, style } = props;
150
+ if (klass && !isString(klass)) {
151
+ props.class = normalizeClass(klass);
152
+ }
153
+ if (style) {
154
+ props.style = normalizeStyle(style);
155
+ }
156
+ return props;
186
157
  }
187
158
 
188
- // These tag configs are shared between compiler-dom and runtime-dom, so they
189
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
190
- const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
191
- 'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
192
- 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
193
- 'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
194
- 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
195
- 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +
196
- 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +
197
- 'option,output,progress,select,textarea,details,dialog,menu,' +
198
- 'summary,template,blockquote,iframe,tfoot';
199
- // https://developer.mozilla.org/en-US/docs/Web/SVG/Element
200
- const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
201
- 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
202
- 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
203
- 'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
204
- 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
205
- 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
206
- 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
207
- 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +
208
- 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
209
- 'text,textPath,title,tspan,unknown,use,view';
210
- const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
211
- /**
212
- * Compiler only.
213
- * Do NOT use in runtime code paths unless behind `true` flag.
214
- */
215
- const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
216
- /**
217
- * Compiler only.
218
- * Do NOT use in runtime code paths unless behind `true` flag.
219
- */
220
- const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
221
- /**
222
- * Compiler only.
223
- * Do NOT use in runtime code paths unless behind `true` flag.
224
- */
225
- const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
159
+ const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
160
+ const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
161
+ const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
162
+ const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
163
+ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
164
+ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
226
165
 
227
- /**
228
- * On the client we only need to offer special cases for boolean attributes that
229
- * have different names from their corresponding dom properties:
230
- * - itemscope -> N/A
231
- * - allowfullscreen -> allowFullscreen
232
- * - formnovalidate -> formNoValidate
233
- * - ismap -> isMap
234
- * - nomodule -> noModule
235
- * - novalidate -> noValidate
236
- * - readonly -> readOnly
237
- */
238
166
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
239
- const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
240
- /**
241
- * The full list is needed during SSR to produce the correct initial markup.
242
- */
243
- const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
244
- `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
245
- `loop,open,required,reversed,scoped,seamless,` +
246
- `checked,muted,multiple,selected`);
247
- /**
248
- * Boolean attributes should be included if the value is truthy or ''.
249
- * e.g. `<select multiple>` compiles to `{ multiple: '' }`
250
- */
167
+ const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
168
+ const isBooleanAttr = /* @__PURE__ */ makeMap(
169
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
170
+ );
251
171
  function includeBooleanAttr(value) {
252
- return !!value || value === '';
172
+ return !!value || value === "";
253
173
  }
254
174
  const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
255
175
  const attrValidationCache = {};
256
176
  function isSSRSafeAttrName(name) {
257
- if (attrValidationCache.hasOwnProperty(name)) {
258
- return attrValidationCache[name];
259
- }
260
- const isUnsafe = unsafeAttrCharRE.test(name);
261
- if (isUnsafe) {
262
- console.error(`unsafe attribute name: ${name}`);
263
- }
264
- return (attrValidationCache[name] = !isUnsafe);
177
+ if (attrValidationCache.hasOwnProperty(name)) {
178
+ return attrValidationCache[name];
179
+ }
180
+ const isUnsafe = unsafeAttrCharRE.test(name);
181
+ if (isUnsafe) {
182
+ console.error(`unsafe attribute name: ${name}`);
183
+ }
184
+ return attrValidationCache[name] = !isUnsafe;
265
185
  }
266
186
  const propsToAttrMap = {
267
- acceptCharset: 'accept-charset',
268
- className: 'class',
269
- htmlFor: 'for',
270
- httpEquiv: 'http-equiv'
187
+ acceptCharset: "accept-charset",
188
+ className: "class",
189
+ htmlFor: "for",
190
+ httpEquiv: "http-equiv"
271
191
  };
272
- /**
273
- * Known attributes, this is used for stringification of runtime static nodes
274
- * so that we don't stringify bindings that cannot be set from HTML.
275
- * Don't also forget to allow `data-*` and `aria-*`!
276
- * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
277
- */
278
- const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
279
- `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
280
- `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
281
- `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
282
- `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
283
- `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
284
- `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
285
- `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
286
- `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
287
- `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
288
- `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
289
- `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
290
- `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
291
- `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
292
- `value,width,wrap`);
293
- /**
294
- * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
295
- */
296
- const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
297
- `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
298
- `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
299
- `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
300
- `color-interpolation-filters,color-profile,color-rendering,` +
301
- `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
302
- `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
303
- `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
304
- `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
305
- `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
306
- `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
307
- `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
308
- `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
309
- `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
310
- `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
311
- `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
312
- `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
313
- `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
314
- `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
315
- `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
316
- `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
317
- `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
318
- `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
319
- `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
320
- `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
321
- `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
322
- `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
323
- `strikethrough-position,strikethrough-thickness,string,stroke,` +
324
- `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
325
- `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
326
- `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
327
- `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
328
- `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
329
- `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
330
- `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
331
- `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
332
- `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
333
- `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
334
- `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
192
+ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
193
+ `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
194
+ );
195
+ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
196
+ `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
197
+ );
335
198
 
336
199
  const escapeRE = /["'&<>]/;
337
200
  function escapeHtml(string) {
338
- const str = '' + string;
339
- const match = escapeRE.exec(str);
340
- if (!match) {
341
- return str;
201
+ const str = "" + string;
202
+ const match = escapeRE.exec(str);
203
+ if (!match) {
204
+ return str;
205
+ }
206
+ let html = "";
207
+ let escaped;
208
+ let index;
209
+ let lastIndex = 0;
210
+ for (index = match.index; index < str.length; index++) {
211
+ switch (str.charCodeAt(index)) {
212
+ case 34:
213
+ escaped = "&quot;";
214
+ break;
215
+ case 38:
216
+ escaped = "&amp;";
217
+ break;
218
+ case 39:
219
+ escaped = "&#39;";
220
+ break;
221
+ case 60:
222
+ escaped = "&lt;";
223
+ break;
224
+ case 62:
225
+ escaped = "&gt;";
226
+ break;
227
+ default:
228
+ continue;
342
229
  }
343
- let html = '';
344
- let escaped;
345
- let index;
346
- let lastIndex = 0;
347
- for (index = match.index; index < str.length; index++) {
348
- switch (str.charCodeAt(index)) {
349
- case 34: // "
350
- escaped = '&quot;';
351
- break;
352
- case 38: // &
353
- escaped = '&amp;';
354
- break;
355
- case 39: // '
356
- escaped = '&#39;';
357
- break;
358
- case 60: // <
359
- escaped = '&lt;';
360
- break;
361
- case 62: // >
362
- escaped = '&gt;';
363
- break;
364
- default:
365
- continue;
366
- }
367
- if (lastIndex !== index) {
368
- html += str.slice(lastIndex, index);
369
- }
370
- lastIndex = index + 1;
371
- html += escaped;
230
+ if (lastIndex !== index) {
231
+ html += str.slice(lastIndex, index);
372
232
  }
373
- return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
233
+ lastIndex = index + 1;
234
+ html += escaped;
235
+ }
236
+ return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
374
237
  }
375
- // https://www.w3.org/TR/html52/syntax.html#comments
376
238
  const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
377
239
  function escapeHtmlComment(src) {
378
- return src.replace(commentStripRE, '');
240
+ return src.replace(commentStripRE, "");
379
241
  }
380
242
 
381
243
  function looseCompareArrays(a, b) {
382
- if (a.length !== b.length)
383
- return false;
384
- let equal = true;
385
- for (let i = 0; equal && i < a.length; i++) {
386
- equal = looseEqual(a[i], b[i]);
387
- }
388
- return equal;
244
+ if (a.length !== b.length)
245
+ return false;
246
+ let equal = true;
247
+ for (let i = 0; equal && i < a.length; i++) {
248
+ equal = looseEqual(a[i], b[i]);
249
+ }
250
+ return equal;
389
251
  }
390
252
  function looseEqual(a, b) {
391
- if (a === b)
392
- return true;
393
- let aValidType = isDate(a);
394
- let bValidType = isDate(b);
395
- if (aValidType || bValidType) {
396
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
253
+ if (a === b)
254
+ return true;
255
+ let aValidType = isDate(a);
256
+ let bValidType = isDate(b);
257
+ if (aValidType || bValidType) {
258
+ return aValidType && bValidType ? a.getTime() === b.getTime() : false;
259
+ }
260
+ aValidType = isSymbol(a);
261
+ bValidType = isSymbol(b);
262
+ if (aValidType || bValidType) {
263
+ return a === b;
264
+ }
265
+ aValidType = isArray(a);
266
+ bValidType = isArray(b);
267
+ if (aValidType || bValidType) {
268
+ return aValidType && bValidType ? looseCompareArrays(a, b) : false;
269
+ }
270
+ aValidType = isObject(a);
271
+ bValidType = isObject(b);
272
+ if (aValidType || bValidType) {
273
+ if (!aValidType || !bValidType) {
274
+ return false;
397
275
  }
398
- aValidType = isSymbol(a);
399
- bValidType = isSymbol(b);
400
- if (aValidType || bValidType) {
401
- return a === b;
276
+ const aKeysCount = Object.keys(a).length;
277
+ const bKeysCount = Object.keys(b).length;
278
+ if (aKeysCount !== bKeysCount) {
279
+ return false;
402
280
  }
403
- aValidType = isArray(a);
404
- bValidType = isArray(b);
405
- if (aValidType || bValidType) {
406
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
407
- }
408
- aValidType = isObject(a);
409
- bValidType = isObject(b);
410
- if (aValidType || bValidType) {
411
- /* istanbul ignore if: this if will probably never be called */
412
- if (!aValidType || !bValidType) {
413
- return false;
414
- }
415
- const aKeysCount = Object.keys(a).length;
416
- const bKeysCount = Object.keys(b).length;
417
- if (aKeysCount !== bKeysCount) {
418
- return false;
419
- }
420
- for (const key in a) {
421
- const aHasKey = a.hasOwnProperty(key);
422
- const bHasKey = b.hasOwnProperty(key);
423
- if ((aHasKey && !bHasKey) ||
424
- (!aHasKey && bHasKey) ||
425
- !looseEqual(a[key], b[key])) {
426
- return false;
427
- }
428
- }
281
+ for (const key in a) {
282
+ const aHasKey = a.hasOwnProperty(key);
283
+ const bHasKey = b.hasOwnProperty(key);
284
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
285
+ return false;
286
+ }
429
287
  }
430
- return String(a) === String(b);
288
+ }
289
+ return String(a) === String(b);
431
290
  }
432
291
  function looseIndexOf(arr, val) {
433
- return arr.findIndex(item => looseEqual(item, val));
292
+ return arr.findIndex((item) => looseEqual(item, val));
434
293
  }
435
294
 
436
- /**
437
- * For converting {{ interpolation }} values to displayed strings.
438
- * @private
439
- */
440
295
  const toDisplayString = (val) => {
441
- return isString(val)
442
- ? val
443
- : val == null
444
- ? ''
445
- : isArray(val) ||
446
- (isObject(val) &&
447
- (val.toString === objectToString || !isFunction(val.toString)))
448
- ? JSON.stringify(val, replacer, 2)
449
- : String(val);
296
+ return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
450
297
  };
451
298
  const replacer = (_key, val) => {
452
- // can't use isRef here since @vue/shared has no deps
453
- if (val && val.__v_isRef) {
454
- return replacer(_key, val.value);
455
- }
456
- else if (isMap(val)) {
457
- return {
458
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
459
- entries[`${key} =>`] = val;
460
- return entries;
461
- }, {})
462
- };
463
- }
464
- else if (isSet(val)) {
465
- return {
466
- [`Set(${val.size})`]: [...val.values()]
467
- };
468
- }
469
- else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
470
- return String(val);
471
- }
472
- return val;
299
+ if (val && val.__v_isRef) {
300
+ return replacer(_key, val.value);
301
+ } else if (isMap(val)) {
302
+ return {
303
+ [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
304
+ entries[`${key} =>`] = val2;
305
+ return entries;
306
+ }, {})
307
+ };
308
+ } else if (isSet(val)) {
309
+ return {
310
+ [`Set(${val.size})`]: [...val.values()]
311
+ };
312
+ } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
313
+ return String(val);
314
+ }
315
+ return val;
473
316
  };
474
317
 
475
- const EMPTY_OBJ = Object.freeze({})
476
- ;
318
+ const EMPTY_OBJ = Object.freeze({}) ;
477
319
  const EMPTY_ARR = Object.freeze([]) ;
478
- const NOOP = () => { };
479
- /**
480
- * Always return false.
481
- */
320
+ const NOOP = () => {
321
+ };
482
322
  const NO = () => false;
483
323
  const onRE = /^on[^a-z]/;
484
324
  const isOn = (key) => onRE.test(key);
485
- const isModelListener = (key) => key.startsWith('onUpdate:');
325
+ const isModelListener = (key) => key.startsWith("onUpdate:");
486
326
  const extend = Object.assign;
487
327
  const remove = (arr, el) => {
488
- const i = arr.indexOf(el);
489
- if (i > -1) {
490
- arr.splice(i, 1);
491
- }
328
+ const i = arr.indexOf(el);
329
+ if (i > -1) {
330
+ arr.splice(i, 1);
331
+ }
492
332
  };
493
333
  const hasOwnProperty = Object.prototype.hasOwnProperty;
494
334
  const hasOwn = (val, key) => hasOwnProperty.call(val, key);
495
335
  const isArray = Array.isArray;
496
- const isMap = (val) => toTypeString(val) === '[object Map]';
497
- const isSet = (val) => toTypeString(val) === '[object Set]';
498
- const isDate = (val) => toTypeString(val) === '[object Date]';
499
- const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
500
- const isFunction = (val) => typeof val === 'function';
501
- const isString = (val) => typeof val === 'string';
502
- const isSymbol = (val) => typeof val === 'symbol';
503
- const isObject = (val) => val !== null && typeof val === 'object';
336
+ const isMap = (val) => toTypeString(val) === "[object Map]";
337
+ const isSet = (val) => toTypeString(val) === "[object Set]";
338
+ const isDate = (val) => toTypeString(val) === "[object Date]";
339
+ const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
340
+ const isFunction = (val) => typeof val === "function";
341
+ const isString = (val) => typeof val === "string";
342
+ const isSymbol = (val) => typeof val === "symbol";
343
+ const isObject = (val) => val !== null && typeof val === "object";
504
344
  const isPromise = (val) => {
505
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
345
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
506
346
  };
507
347
  const objectToString = Object.prototype.toString;
508
348
  const toTypeString = (value) => objectToString.call(value);
509
349
  const toRawType = (value) => {
510
- // extract "RawType" from strings like "[object RawType]"
511
- return toTypeString(value).slice(8, -1);
350
+ return toTypeString(value).slice(8, -1);
512
351
  };
513
- const isPlainObject = (val) => toTypeString(val) === '[object Object]';
514
- const isIntegerKey = (key) => isString(key) &&
515
- key !== 'NaN' &&
516
- key[0] !== '-' &&
517
- '' + parseInt(key, 10) === key;
518
- const isReservedProp = /*#__PURE__*/ makeMap(
519
- // the leading comma is intentional so empty string "" is also included
520
- ',key,ref,ref_for,ref_key,' +
521
- 'onVnodeBeforeMount,onVnodeMounted,' +
522
- 'onVnodeBeforeUpdate,onVnodeUpdated,' +
523
- 'onVnodeBeforeUnmount,onVnodeUnmounted');
524
- const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
352
+ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
353
+ const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
354
+ const isReservedProp = /* @__PURE__ */ makeMap(
355
+ // the leading comma is intentional so empty string "" is also included
356
+ ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
357
+ );
358
+ const isBuiltInDirective = /* @__PURE__ */ makeMap(
359
+ "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
360
+ );
525
361
  const cacheStringFunction = (fn) => {
526
- const cache = Object.create(null);
527
- return ((str) => {
528
- const hit = cache[str];
529
- return hit || (cache[str] = fn(str));
530
- });
362
+ const cache = /* @__PURE__ */ Object.create(null);
363
+ return (str) => {
364
+ const hit = cache[str];
365
+ return hit || (cache[str] = fn(str));
366
+ };
531
367
  };
532
368
  const camelizeRE = /-(\w)/g;
533
- /**
534
- * @private
535
- */
536
369
  const camelize = cacheStringFunction((str) => {
537
- return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));
370
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
538
371
  });
539
372
  const hyphenateRE = /\B([A-Z])/g;
540
- /**
541
- * @private
542
- */
543
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());
544
- /**
545
- * @private
546
- */
547
- const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
548
- /**
549
- * @private
550
- */
551
- const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
552
- // compare whether a value has changed, accounting for NaN.
373
+ const hyphenate = cacheStringFunction(
374
+ (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
375
+ );
376
+ const capitalize = cacheStringFunction(
377
+ (str) => str.charAt(0).toUpperCase() + str.slice(1)
378
+ );
379
+ const toHandlerKey = cacheStringFunction(
380
+ (str) => str ? `on${capitalize(str)}` : ``
381
+ );
553
382
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
554
383
  const invokeArrayFns = (fns, arg) => {
555
- for (let i = 0; i < fns.length; i++) {
556
- fns[i](arg);
557
- }
384
+ for (let i = 0; i < fns.length; i++) {
385
+ fns[i](arg);
386
+ }
558
387
  };
559
388
  const def = (obj, key, value) => {
560
- Object.defineProperty(obj, key, {
561
- configurable: true,
562
- enumerable: false,
563
- value
564
- });
389
+ Object.defineProperty(obj, key, {
390
+ configurable: true,
391
+ enumerable: false,
392
+ value
393
+ });
565
394
  };
566
- /**
567
- * "123-foo" will be parsed to 123
568
- * This is used for the .number modifier in v-model
569
- */
570
395
  const looseToNumber = (val) => {
571
- const n = parseFloat(val);
572
- return isNaN(n) ? val : n;
396
+ const n = parseFloat(val);
397
+ return isNaN(n) ? val : n;
573
398
  };
574
- /**
575
- * Only conerces number-like strings
576
- * "123-foo" will be returned as-is
577
- */
578
399
  const toNumber = (val) => {
579
- const n = isString(val) ? Number(val) : NaN;
580
- return isNaN(n) ? val : n;
400
+ const n = isString(val) ? Number(val) : NaN;
401
+ return isNaN(n) ? val : n;
581
402
  };
582
403
  let _globalThis;
583
404
  const getGlobalThis = () => {
584
- return (_globalThis ||
585
- (_globalThis =
586
- typeof globalThis !== 'undefined'
587
- ? globalThis
588
- : typeof self !== 'undefined'
589
- ? self
590
- : typeof window !== 'undefined'
591
- ? window
592
- : typeof global !== 'undefined'
593
- ? global
594
- : {}));
405
+ return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
595
406
  };
596
407
  const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
597
408
  function genPropsAccessExp(name) {
598
- return identRE.test(name)
599
- ? `__props.${name}`
600
- : `__props[${JSON.stringify(name)}]`;
409
+ return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
601
410
  }
602
411
 
603
412
  exports.EMPTY_ARR = EMPTY_ARR;