Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

shared.esm-bundler.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. /**
  2. * @vue/shared v3.4.38
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. /*! #__NO_SIDE_EFFECTS__ */
  7. // @__NO_SIDE_EFFECTS__
  8. function makeMap(str, expectsLowerCase) {
  9. const set = new Set(str.split(","));
  10. return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
  11. }
  12. const EMPTY_OBJ = !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
  13. const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
  14. const NOOP = () => {
  15. };
  16. const NO = () => false;
  17. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  18. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  19. const isModelListener = (key) => key.startsWith("onUpdate:");
  20. const extend = Object.assign;
  21. const remove = (arr, el) => {
  22. const i = arr.indexOf(el);
  23. if (i > -1) {
  24. arr.splice(i, 1);
  25. }
  26. };
  27. const hasOwnProperty = Object.prototype.hasOwnProperty;
  28. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  29. const isArray = Array.isArray;
  30. const isMap = (val) => toTypeString(val) === "[object Map]";
  31. const isSet = (val) => toTypeString(val) === "[object Set]";
  32. const isDate = (val) => toTypeString(val) === "[object Date]";
  33. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  34. const isFunction = (val) => typeof val === "function";
  35. const isString = (val) => typeof val === "string";
  36. const isSymbol = (val) => typeof val === "symbol";
  37. const isObject = (val) => val !== null && typeof val === "object";
  38. const isPromise = (val) => {
  39. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  40. };
  41. const objectToString = Object.prototype.toString;
  42. const toTypeString = (value) => objectToString.call(value);
  43. const toRawType = (value) => {
  44. return toTypeString(value).slice(8, -1);
  45. };
  46. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  47. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  48. const isReservedProp = /* @__PURE__ */ makeMap(
  49. // the leading comma is intentional so empty string "" is also included
  50. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  51. );
  52. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  53. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  54. );
  55. const cacheStringFunction = (fn) => {
  56. const cache = /* @__PURE__ */ Object.create(null);
  57. return (str) => {
  58. const hit = cache[str];
  59. return hit || (cache[str] = fn(str));
  60. };
  61. };
  62. const camelizeRE = /-(\w)/g;
  63. const camelize = cacheStringFunction((str) => {
  64. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  65. });
  66. const hyphenateRE = /\B([A-Z])/g;
  67. const hyphenate = cacheStringFunction(
  68. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  69. );
  70. const capitalize = cacheStringFunction((str) => {
  71. return str.charAt(0).toUpperCase() + str.slice(1);
  72. });
  73. const toHandlerKey = cacheStringFunction((str) => {
  74. const s = str ? `on${capitalize(str)}` : ``;
  75. return s;
  76. });
  77. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  78. const invokeArrayFns = (fns, ...arg) => {
  79. for (let i = 0; i < fns.length; i++) {
  80. fns[i](...arg);
  81. }
  82. };
  83. const def = (obj, key, value, writable = false) => {
  84. Object.defineProperty(obj, key, {
  85. configurable: true,
  86. enumerable: false,
  87. writable,
  88. value
  89. });
  90. };
  91. const looseToNumber = (val) => {
  92. const n = parseFloat(val);
  93. return isNaN(n) ? val : n;
  94. };
  95. const toNumber = (val) => {
  96. const n = isString(val) ? Number(val) : NaN;
  97. return isNaN(n) ? val : n;
  98. };
  99. let _globalThis;
  100. const getGlobalThis = () => {
  101. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  102. };
  103. const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
  104. function genPropsAccessExp(name) {
  105. return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
  106. }
  107. const PatchFlags = {
  108. "TEXT": 1,
  109. "1": "TEXT",
  110. "CLASS": 2,
  111. "2": "CLASS",
  112. "STYLE": 4,
  113. "4": "STYLE",
  114. "PROPS": 8,
  115. "8": "PROPS",
  116. "FULL_PROPS": 16,
  117. "16": "FULL_PROPS",
  118. "NEED_HYDRATION": 32,
  119. "32": "NEED_HYDRATION",
  120. "STABLE_FRAGMENT": 64,
  121. "64": "STABLE_FRAGMENT",
  122. "KEYED_FRAGMENT": 128,
  123. "128": "KEYED_FRAGMENT",
  124. "UNKEYED_FRAGMENT": 256,
  125. "256": "UNKEYED_FRAGMENT",
  126. "NEED_PATCH": 512,
  127. "512": "NEED_PATCH",
  128. "DYNAMIC_SLOTS": 1024,
  129. "1024": "DYNAMIC_SLOTS",
  130. "DEV_ROOT_FRAGMENT": 2048,
  131. "2048": "DEV_ROOT_FRAGMENT",
  132. "HOISTED": -1,
  133. "-1": "HOISTED",
  134. "BAIL": -2,
  135. "-2": "BAIL"
  136. };
  137. const PatchFlagNames = {
  138. [1]: `TEXT`,
  139. [2]: `CLASS`,
  140. [4]: `STYLE`,
  141. [8]: `PROPS`,
  142. [16]: `FULL_PROPS`,
  143. [32]: `NEED_HYDRATION`,
  144. [64]: `STABLE_FRAGMENT`,
  145. [128]: `KEYED_FRAGMENT`,
  146. [256]: `UNKEYED_FRAGMENT`,
  147. [512]: `NEED_PATCH`,
  148. [1024]: `DYNAMIC_SLOTS`,
  149. [2048]: `DEV_ROOT_FRAGMENT`,
  150. [-1]: `HOISTED`,
  151. [-2]: `BAIL`
  152. };
  153. const ShapeFlags = {
  154. "ELEMENT": 1,
  155. "1": "ELEMENT",
  156. "FUNCTIONAL_COMPONENT": 2,
  157. "2": "FUNCTIONAL_COMPONENT",
  158. "STATEFUL_COMPONENT": 4,
  159. "4": "STATEFUL_COMPONENT",
  160. "TEXT_CHILDREN": 8,
  161. "8": "TEXT_CHILDREN",
  162. "ARRAY_CHILDREN": 16,
  163. "16": "ARRAY_CHILDREN",
  164. "SLOTS_CHILDREN": 32,
  165. "32": "SLOTS_CHILDREN",
  166. "TELEPORT": 64,
  167. "64": "TELEPORT",
  168. "SUSPENSE": 128,
  169. "128": "SUSPENSE",
  170. "COMPONENT_SHOULD_KEEP_ALIVE": 256,
  171. "256": "COMPONENT_SHOULD_KEEP_ALIVE",
  172. "COMPONENT_KEPT_ALIVE": 512,
  173. "512": "COMPONENT_KEPT_ALIVE",
  174. "COMPONENT": 6,
  175. "6": "COMPONENT"
  176. };
  177. const SlotFlags = {
  178. "STABLE": 1,
  179. "1": "STABLE",
  180. "DYNAMIC": 2,
  181. "2": "DYNAMIC",
  182. "FORWARDED": 3,
  183. "3": "FORWARDED"
  184. };
  185. const slotFlagsText = {
  186. [1]: "STABLE",
  187. [2]: "DYNAMIC",
  188. [3]: "FORWARDED"
  189. };
  190. const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
  191. const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
  192. const isGloballyWhitelisted = isGloballyAllowed;
  193. const range = 2;
  194. function generateCodeFrame(source, start = 0, end = source.length) {
  195. start = Math.max(0, Math.min(start, source.length));
  196. end = Math.max(0, Math.min(end, source.length));
  197. if (start > end) return "";
  198. let lines = source.split(/(\r?\n)/);
  199. const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
  200. lines = lines.filter((_, idx) => idx % 2 === 0);
  201. let count = 0;
  202. const res = [];
  203. for (let i = 0; i < lines.length; i++) {
  204. count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
  205. if (count >= start) {
  206. for (let j = i - range; j <= i + range || end > count; j++) {
  207. if (j < 0 || j >= lines.length) continue;
  208. const line = j + 1;
  209. res.push(
  210. `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
  211. );
  212. const lineLength = lines[j].length;
  213. const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
  214. if (j === i) {
  215. const pad = start - (count - (lineLength + newLineSeqLength));
  216. const length = Math.max(
  217. 1,
  218. end > count ? lineLength - pad : end - start
  219. );
  220. res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
  221. } else if (j > i) {
  222. if (end > count) {
  223. const length = Math.max(Math.min(end - count, lineLength), 1);
  224. res.push(` | ` + "^".repeat(length));
  225. }
  226. count += lineLength + newLineSeqLength;
  227. }
  228. }
  229. break;
  230. }
  231. }
  232. return res.join("\n");
  233. }
  234. function normalizeStyle(value) {
  235. if (isArray(value)) {
  236. const res = {};
  237. for (let i = 0; i < value.length; i++) {
  238. const item = value[i];
  239. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  240. if (normalized) {
  241. for (const key in normalized) {
  242. res[key] = normalized[key];
  243. }
  244. }
  245. }
  246. return res;
  247. } else if (isString(value) || isObject(value)) {
  248. return value;
  249. }
  250. }
  251. const listDelimiterRE = /;(?![^(]*\))/g;
  252. const propertyDelimiterRE = /:([^]+)/;
  253. const styleCommentRE = /\/\*[^]*?\*\//g;
  254. function parseStringStyle(cssText) {
  255. const ret = {};
  256. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  257. if (item) {
  258. const tmp = item.split(propertyDelimiterRE);
  259. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  260. }
  261. });
  262. return ret;
  263. }
  264. function stringifyStyle(styles) {
  265. let ret = "";
  266. if (!styles || isString(styles)) {
  267. return ret;
  268. }
  269. for (const key in styles) {
  270. const value = styles[key];
  271. if (isString(value) || typeof value === "number") {
  272. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  273. ret += `${normalizedKey}:${value};`;
  274. }
  275. }
  276. return ret;
  277. }
  278. function normalizeClass(value) {
  279. let res = "";
  280. if (isString(value)) {
  281. res = value;
  282. } else if (isArray(value)) {
  283. for (let i = 0; i < value.length; i++) {
  284. const normalized = normalizeClass(value[i]);
  285. if (normalized) {
  286. res += normalized + " ";
  287. }
  288. }
  289. } else if (isObject(value)) {
  290. for (const name in value) {
  291. if (value[name]) {
  292. res += name + " ";
  293. }
  294. }
  295. }
  296. return res.trim();
  297. }
  298. function normalizeProps(props) {
  299. if (!props) return null;
  300. let { class: klass, style } = props;
  301. if (klass && !isString(klass)) {
  302. props.class = normalizeClass(klass);
  303. }
  304. if (style) {
  305. props.style = normalizeStyle(style);
  306. }
  307. return props;
  308. }
  309. 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";
  310. 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";
  311. const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
  312. const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
  313. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  314. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  315. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  316. const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
  317. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  318. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  319. const isBooleanAttr = /* @__PURE__ */ makeMap(
  320. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  321. );
  322. function includeBooleanAttr(value) {
  323. return !!value || value === "";
  324. }
  325. const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
  326. const attrValidationCache = {};
  327. function isSSRSafeAttrName(name) {
  328. if (attrValidationCache.hasOwnProperty(name)) {
  329. return attrValidationCache[name];
  330. }
  331. const isUnsafe = unsafeAttrCharRE.test(name);
  332. if (isUnsafe) {
  333. console.error(`unsafe attribute name: ${name}`);
  334. }
  335. return attrValidationCache[name] = !isUnsafe;
  336. }
  337. const propsToAttrMap = {
  338. acceptCharset: "accept-charset",
  339. className: "class",
  340. htmlFor: "for",
  341. httpEquiv: "http-equiv"
  342. };
  343. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  344. `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,inert,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`
  345. );
  346. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  347. `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,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
  348. );
  349. function isRenderableAttrValue(value) {
  350. if (value == null) {
  351. return false;
  352. }
  353. const type = typeof value;
  354. return type === "string" || type === "number" || type === "boolean";
  355. }
  356. const escapeRE = /["'&<>]/;
  357. function escapeHtml(string) {
  358. const str = "" + string;
  359. const match = escapeRE.exec(str);
  360. if (!match) {
  361. return str;
  362. }
  363. let html = "";
  364. let escaped;
  365. let index;
  366. let lastIndex = 0;
  367. for (index = match.index; index < str.length; index++) {
  368. switch (str.charCodeAt(index)) {
  369. case 34:
  370. escaped = "&quot;";
  371. break;
  372. case 38:
  373. escaped = "&amp;";
  374. break;
  375. case 39:
  376. escaped = "&#39;";
  377. break;
  378. case 60:
  379. escaped = "&lt;";
  380. break;
  381. case 62:
  382. escaped = "&gt;";
  383. break;
  384. default:
  385. continue;
  386. }
  387. if (lastIndex !== index) {
  388. html += str.slice(lastIndex, index);
  389. }
  390. lastIndex = index + 1;
  391. html += escaped;
  392. }
  393. return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
  394. }
  395. const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
  396. function escapeHtmlComment(src) {
  397. return src.replace(commentStripRE, "");
  398. }
  399. function looseCompareArrays(a, b) {
  400. if (a.length !== b.length) return false;
  401. let equal = true;
  402. for (let i = 0; equal && i < a.length; i++) {
  403. equal = looseEqual(a[i], b[i]);
  404. }
  405. return equal;
  406. }
  407. function looseEqual(a, b) {
  408. if (a === b) return true;
  409. let aValidType = isDate(a);
  410. let bValidType = isDate(b);
  411. if (aValidType || bValidType) {
  412. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  413. }
  414. aValidType = isSymbol(a);
  415. bValidType = isSymbol(b);
  416. if (aValidType || bValidType) {
  417. return a === b;
  418. }
  419. aValidType = isArray(a);
  420. bValidType = isArray(b);
  421. if (aValidType || bValidType) {
  422. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  423. }
  424. aValidType = isObject(a);
  425. bValidType = isObject(b);
  426. if (aValidType || bValidType) {
  427. if (!aValidType || !bValidType) {
  428. return false;
  429. }
  430. const aKeysCount = Object.keys(a).length;
  431. const bKeysCount = Object.keys(b).length;
  432. if (aKeysCount !== bKeysCount) {
  433. return false;
  434. }
  435. for (const key in a) {
  436. const aHasKey = a.hasOwnProperty(key);
  437. const bHasKey = b.hasOwnProperty(key);
  438. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  439. return false;
  440. }
  441. }
  442. }
  443. return String(a) === String(b);
  444. }
  445. function looseIndexOf(arr, val) {
  446. return arr.findIndex((item) => looseEqual(item, val));
  447. }
  448. const isRef = (val) => {
  449. return !!(val && val.__v_isRef === true);
  450. };
  451. const toDisplayString = (val) => {
  452. return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
  453. };
  454. const replacer = (_key, val) => {
  455. if (isRef(val)) {
  456. return replacer(_key, val.value);
  457. } else if (isMap(val)) {
  458. return {
  459. [`Map(${val.size})`]: [...val.entries()].reduce(
  460. (entries, [key, val2], i) => {
  461. entries[stringifySymbol(key, i) + " =>"] = val2;
  462. return entries;
  463. },
  464. {}
  465. )
  466. };
  467. } else if (isSet(val)) {
  468. return {
  469. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  470. };
  471. } else if (isSymbol(val)) {
  472. return stringifySymbol(val);
  473. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  474. return String(val);
  475. }
  476. return val;
  477. };
  478. const stringifySymbol = (v, i = "") => {
  479. var _a;
  480. return (
  481. // Symbol.description in es2019+ so we need to cast here to pass
  482. // the lib: es2016 check
  483. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  484. );
  485. };
  486. export { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, genPropsAccessExp, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };