diff --git a/packages/artplayer-template/react.js/src/App.jsx b/packages/artplayer-template/react.js/src/App.jsx index cc4e1843b..0585d1440 100644 --- a/packages/artplayer-template/react.js/src/App.jsx +++ b/packages/artplayer-template/react.js/src/App.jsx @@ -1,4 +1,4 @@ -import Artplayer from './ArtPlayer.jsx' +import Artplayer from './Artplayer.jsx' function App() { return ( @@ -13,7 +13,7 @@ function App() { height: '400px', margin: '60px auto 0', }} - getInstance={art => console.info(art)} + getInstance={art => console.log(art)} /> ) diff --git a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/@theme_index.js b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/@theme_index.js index c0898369c..aea9608fb 100644 --- a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/@theme_index.js +++ b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/@theme_index.js @@ -1,12 +1,12 @@ import { useMediaQuery -} from "./chunk-NAPQPQGA.js"; +} from "./chunk-4V7AASBK.js"; import { computed, ref, shallowRef, watch -} from "./chunk-XPVS2JNX.js"; +} from "./chunk-PYKB7VCN.js"; // ../../node_modules/vitepress/dist/client/theme-default/index.js import "/Users/zhaohaiwei/Desktop/github/ArtPlayer/node_modules/vitepress/dist/client/theme-default/styles/fonts.css"; diff --git a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/_metadata.json b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/_metadata.json index d9f515f1a..4feb5a0c0 100644 --- a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/_metadata.json +++ b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/_metadata.json @@ -1,40 +1,40 @@ { - "hash": "0bbe293f", - "configHash": "9dd5f99c", + "hash": "f505e736", + "configHash": "b7d2330b", "lockfileHash": "b7b1f3f6", - "browserHash": "a3359f9d", + "browserHash": "45c5fb1b", "optimized": { "vue": { - "src": "../../../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js", + "src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "a4d2dff8", + "fileHash": "69d6db4c", "needsInterop": false }, "vitepress > @vue/devtools-api": { "src": "../../../../../../node_modules/@vue/devtools-api/dist/index.js", "file": "vitepress___@vue_devtools-api.js", - "fileHash": "b6e16392", + "fileHash": "8a53d1df", "needsInterop": false }, "vitepress > @vueuse/core": { "src": "../../../../../../node_modules/@vueuse/core/index.mjs", "file": "vitepress___@vueuse_core.js", - "fileHash": "831bae46", + "fileHash": "ca279ebd", "needsInterop": false }, "@theme/index": { "src": "../../../../../../node_modules/vitepress/dist/client/theme-default/index.js", "file": "@theme_index.js", - "fileHash": "76dab5f5", + "fileHash": "c611f6d4", "needsInterop": false } }, "chunks": { - "chunk-NAPQPQGA": { - "file": "chunk-NAPQPQGA.js" + "chunk-4V7AASBK": { + "file": "chunk-4V7AASBK.js" }, - "chunk-XPVS2JNX": { - "file": "chunk-XPVS2JNX.js" + "chunk-PYKB7VCN": { + "file": "chunk-PYKB7VCN.js" } } } \ No newline at end of file diff --git a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-NAPQPQGA.js b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-4V7AASBK.js similarity index 99% rename from packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-NAPQPQGA.js rename to packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-4V7AASBK.js index c3f1fec25..e42d77907 100644 --- a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-NAPQPQGA.js +++ b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-4V7AASBK.js @@ -35,7 +35,7 @@ import { unref, watch, watchEffect -} from "./chunk-XPVS2JNX.js"; +} from "./chunk-PYKB7VCN.js"; // ../../node_modules/@vueuse/shared/index.mjs function computedEager(fn, options) { @@ -9716,4 +9716,4 @@ export { useWindowScroll, useWindowSize }; -//# sourceMappingURL=chunk-NAPQPQGA.js.map +//# sourceMappingURL=chunk-4V7AASBK.js.map diff --git a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-NAPQPQGA.js.map b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-4V7AASBK.js.map similarity index 100% rename from packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-NAPQPQGA.js.map rename to packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-4V7AASBK.js.map diff --git a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-XPVS2JNX.js b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-PYKB7VCN.js similarity index 92% rename from packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-XPVS2JNX.js rename to packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-PYKB7VCN.js index b08ba89c2..3ca7f1c74 100644 --- a/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-XPVS2JNX.js +++ b/packages/artplayer-vitepress/docs/.vitepress/cache/deps/chunk-PYKB7VCN.js @@ -1,4 +1,4 @@ -// ../../node_modules/@vue/shared/dist/shared.esm-bundler.js +// ../../node_modules/@vue/reactivity/node_modules/@vue/shared/dist/shared.esm-bundler.js function makeMap(str) { const map2 = /* @__PURE__ */ Object.create(null); for (const key of str.split(",")) map2[key] = 1; @@ -8,10 +8,6 @@ var EMPTY_OBJ = true ? Object.freeze({}) : {}; var EMPTY_ARR = true ? Object.freeze([]) : []; var NOOP = () => { }; -var NO = () => false; -var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter -(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); -var isModelListener = (key) => key.startsWith("onUpdate:"); var extend = Object.assign; var remove = (arr, el) => { const i = arr.indexOf(el); @@ -24,15 +20,10 @@ var hasOwn = (val, key) => hasOwnProperty.call(val, key); var isArray = Array.isArray; var isMap = (val) => toTypeString(val) === "[object Map]"; var isSet = (val) => toTypeString(val) === "[object Set]"; -var isDate = (val) => toTypeString(val) === "[object Date]"; -var isRegExp = (val) => toTypeString(val) === "[object RegExp]"; var isFunction = (val) => typeof val === "function"; var isString = (val) => typeof val === "string"; var isSymbol = (val) => typeof val === "symbol"; var isObject = (val) => val !== null && typeof val === "object"; -var isPromise = (val) => { - return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); -}; var objectToString = Object.prototype.toString; var toTypeString = (value) => objectToString.call(value); var toRawType = (value) => { @@ -74,11 +65,6 @@ var toHandlerKey = cacheStringFunction( } ); var hasChanged = (value, oldValue) => !Object.is(value, oldValue); -var invokeArrayFns = (fns, ...arg) => { - for (let i = 0; i < fns.length; i++) { - fns[i](...arg); - } -}; var def = (obj, key, value, writable = false) => { Object.defineProperty(obj, key, { configurable: true, @@ -87,94 +73,8 @@ var def = (obj, key, value, writable = false) => { value }); }; -var looseToNumber = (val) => { - const n = parseFloat(val); - return isNaN(n) ? val : n; -}; -var toNumber = (val) => { - const n = isString(val) ? Number(val) : NaN; - return isNaN(n) ? val : n; -}; -var _globalThis; -var getGlobalThis = () => { - return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); -}; var 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,Symbol"; var isGloballyAllowed = makeMap(GLOBALS_ALLOWED); -function normalizeStyle(value) { - if (isArray(value)) { - const res = {}; - for (let i = 0; i < value.length; i++) { - const item = value[i]; - const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); - if (normalized) { - for (const key in normalized) { - res[key] = normalized[key]; - } - } - } - return res; - } else if (isString(value) || isObject(value)) { - return value; - } -} -var listDelimiterRE = /;(?![^(]*\))/g; -var propertyDelimiterRE = /:([^]+)/; -var styleCommentRE = /\/\*[^]*?\*\//g; -function parseStringStyle(cssText) { - const ret = {}; - cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { - if (item) { - const tmp = item.split(propertyDelimiterRE); - tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); - } - }); - return ret; -} -function stringifyStyle(styles) { - if (!styles) return ""; - if (isString(styles)) return styles; - let ret = ""; - for (const key in styles) { - const value = styles[key]; - if (isString(value) || typeof value === "number") { - const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); - ret += `${normalizedKey}:${value};`; - } - } - return ret; -} -function normalizeClass(value) { - let res = ""; - if (isString(value)) { - res = value; - } else if (isArray(value)) { - for (let i = 0; i < value.length; i++) { - const normalized = normalizeClass(value[i]); - if (normalized) { - res += normalized + " "; - } - } - } else if (isObject(value)) { - for (const name in value) { - if (value[name]) { - res += name + " "; - } - } - } - return res.trim(); -} -function normalizeProps(props) { - if (!props) return null; - let { class: klass, style } = props; - if (klass && !isString(klass)) { - props.class = normalizeClass(klass); - } - if (style) { - props.style = normalizeStyle(style); - } - return props; -} var 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"; var 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"; var 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"; @@ -188,9 +88,6 @@ var isSpecialBooleanAttr = makeMap(specialBooleanAttrs); var isBooleanAttr = makeMap( specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` ); -function includeBooleanAttr(value) { - return !!value || value === ""; -} var isKnownHtmlAttr = makeMap( `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` ); @@ -200,107 +97,6 @@ var isKnownSvgAttr = makeMap( var isKnownMathMLAttr = makeMap( `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` ); -function isRenderableAttrValue(value) { - if (value == null) { - return false; - } - const type = typeof value; - return type === "string" || type === "number" || type === "boolean"; -} -var cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; -function getEscapedCssVarName(key, doubleEscape) { - return key.replace( - cssVarNameEscapeSymbolsRE, - (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` - ); -} -function looseCompareArrays(a, b) { - if (a.length !== b.length) return false; - let equal = true; - for (let i = 0; equal && i < a.length; i++) { - equal = looseEqual(a[i], b[i]); - } - return equal; -} -function looseEqual(a, b) { - if (a === b) return true; - let aValidType = isDate(a); - let bValidType = isDate(b); - if (aValidType || bValidType) { - return aValidType && bValidType ? a.getTime() === b.getTime() : false; - } - aValidType = isSymbol(a); - bValidType = isSymbol(b); - if (aValidType || bValidType) { - return a === b; - } - aValidType = isArray(a); - bValidType = isArray(b); - if (aValidType || bValidType) { - return aValidType && bValidType ? looseCompareArrays(a, b) : false; - } - aValidType = isObject(a); - bValidType = isObject(b); - if (aValidType || bValidType) { - if (!aValidType || !bValidType) { - return false; - } - const aKeysCount = Object.keys(a).length; - const bKeysCount = Object.keys(b).length; - if (aKeysCount !== bKeysCount) { - return false; - } - for (const key in a) { - const aHasKey = a.hasOwnProperty(key); - const bHasKey = b.hasOwnProperty(key); - if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { - return false; - } - } - } - return String(a) === String(b); -} -function looseIndexOf(arr, val) { - return arr.findIndex((item) => looseEqual(item, val)); -} -var isRef = (val) => { - return !!(val && val["__v_isRef"] === true); -}; -var toDisplayString = (val) => { - 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); -}; -var replacer = (_key, val) => { - if (isRef(val)) { - return replacer(_key, val.value); - } else if (isMap(val)) { - return { - [`Map(${val.size})`]: [...val.entries()].reduce( - (entries, [key, val2], i) => { - entries[stringifySymbol(key, i) + " =>"] = val2; - return entries; - }, - {} - ) - }; - } else if (isSet(val)) { - return { - [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) - }; - } else if (isSymbol(val)) { - return stringifySymbol(val); - } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { - return String(val); - } - return val; -}; -var stringifySymbol = (v, i = "") => { - var _a; - return ( - // Symbol.description in es2019+ so we need to cast here to pass - // the lib: es2016 check - isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v - ); -}; // ../../node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js function warn(msg, ...args) { @@ -1180,7 +976,7 @@ var BaseReactiveHandler = class { // if this is a proxy wrapping a ref, return methods using the raw ref // as receiver so that we don't have to call `toRaw` on the ref in all // its class methods - isRef2(target) ? target : receiver + isRef(target) ? target : receiver ); if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { return res; @@ -1191,7 +987,7 @@ var BaseReactiveHandler = class { if (isShallow2) { return res; } - if (isRef2(res)) { + if (isRef(res)) { return targetIsArray && isIntegerKey(key) ? res : res.value; } if (isObject(res)) { @@ -1212,7 +1008,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler { oldValue = toRaw(oldValue); value = toRaw(value); } - if (!isArray(target) && isRef2(oldValue) && !isRef2(value)) { + if (!isArray(target) && isRef(oldValue) && !isRef(value)) { if (isOldValueReadonly) { return false; } else { @@ -1226,7 +1022,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler { target, key, value, - isRef2(target) ? target : receiver + isRef(target) ? target : receiver ); if (target === toRaw(receiver)) { if (!hadKey) { @@ -1626,7 +1422,7 @@ function markRaw(value) { } var toReactive = (value) => isObject(value) ? reactive(value) : value; var toReadonly = (value) => isObject(value) ? readonly(value) : value; -function isRef2(r) { +function isRef(r) { return r ? r["__v_isRef"] === true : false; } function ref(value) { @@ -1636,7 +1432,7 @@ function shallowRef(value) { return createRef(value, true); } function createRef(rawValue, shallow) { - if (isRef2(rawValue)) { + if (isRef(rawValue)) { return rawValue; } return new RefImpl(rawValue, shallow); @@ -1698,7 +1494,7 @@ function triggerRef(ref2) { } } function unref(ref2) { - return isRef2(ref2) ? ref2.value : ref2; + return isRef(ref2) ? ref2.value : ref2; } function toValue(source) { return isFunction(source) ? source() : unref(source); @@ -1707,7 +1503,7 @@ var shallowUnwrapHandlers = { get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), set: (target, key, value, receiver) => { const oldValue = target[key]; - if (isRef2(oldValue) && !isRef2(value)) { + if (isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } else { @@ -1778,7 +1574,7 @@ var GetterRefImpl = class { } }; function toRef(source, key, defaultValue) { - if (isRef2(source)) { + if (isRef(source)) { return source; } else if (isFunction(source)) { return new GetterRefImpl(source); @@ -1790,7 +1586,7 @@ function toRef(source, key, defaultValue) { } function propertyToRef(source, key, defaultValue) { const val = source[key]; - return isRef2(val) ? val : new ObjectRefImpl(source, key, defaultValue); + return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); } var ComputedRefImpl = class { constructor(fn, setter, isSSR) { @@ -1904,7 +1700,7 @@ function watch(source, cb, options = EMPTY_OBJ) { let boundCleanup; let forceTrigger = false; let isMultiSource = false; - if (isRef2(source)) { + if (isRef(source)) { getter = () => source.value; forceTrigger = isShallow(source); } else if (isReactive(source)) { @@ -1914,7 +1710,7 @@ function watch(source, cb, options = EMPTY_OBJ) { isMultiSource = true; forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); getter = () => source.map((s) => { - if (isRef2(s)) { + if (isRef(s)) { return s.value; } else if (isReactive(s)) { return reactiveGetter(s); @@ -2049,7 +1845,7 @@ function traverse(value, depth = Infinity, seen) { } seen.add(value); depth--; - if (isRef2(value)) { + if (isRef(value)) { traverse(value.value, depth, seen); } else if (isArray(value)) { for (let i = 0; i < value.length; i++) { @@ -2072,7 +1868,310 @@ function traverse(value, depth = Infinity, seen) { return value; } -// ../../node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +// node_modules/@vue/shared/dist/shared.esm-bundler.js +function makeMap2(str) { + const map2 = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map2[key] = 1; + return (val) => val in map2; +} +var EMPTY_OBJ2 = true ? Object.freeze({}) : {}; +var EMPTY_ARR2 = true ? Object.freeze([]) : []; +var NOOP2 = () => { +}; +var NO = () => false; +var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +var isModelListener = (key) => key.startsWith("onUpdate:"); +var extend2 = Object.assign; +var remove2 = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +var hasOwnProperty3 = Object.prototype.hasOwnProperty; +var hasOwn2 = (val, key) => hasOwnProperty3.call(val, key); +var isArray2 = Array.isArray; +var isMap2 = (val) => toTypeString2(val) === "[object Map]"; +var isSet2 = (val) => toTypeString2(val) === "[object Set]"; +var isDate = (val) => toTypeString2(val) === "[object Date]"; +var isRegExp = (val) => toTypeString2(val) === "[object RegExp]"; +var isFunction2 = (val) => typeof val === "function"; +var isString2 = (val) => typeof val === "string"; +var isSymbol2 = (val) => typeof val === "symbol"; +var isObject2 = (val) => val !== null && typeof val === "object"; +var isPromise = (val) => { + return (isObject2(val) || isFunction2(val)) && isFunction2(val.then) && isFunction2(val.catch); +}; +var objectToString2 = Object.prototype.toString; +var toTypeString2 = (value) => objectToString2.call(value); +var toRawType2 = (value) => { + return toTypeString2(value).slice(8, -1); +}; +var isPlainObject2 = (val) => toTypeString2(val) === "[object Object]"; +var isReservedProp2 = makeMap2( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +var isBuiltInDirective2 = makeMap2( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +var cacheStringFunction2 = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +var camelizeRE2 = /-(\w)/g; +var camelize2 = cacheStringFunction2( + (str) => { + return str.replace(camelizeRE2, (_, c) => c ? c.toUpperCase() : ""); + } +); +var hyphenateRE2 = /\B([A-Z])/g; +var hyphenate2 = cacheStringFunction2( + (str) => str.replace(hyphenateRE2, "-$1").toLowerCase() +); +var capitalize2 = cacheStringFunction2((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +var toHandlerKey2 = cacheStringFunction2( + (str) => { + const s = str ? `on${capitalize2(str)}` : ``; + return s; + } +); +var hasChanged2 = (value, oldValue) => !Object.is(value, oldValue); +var invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +var def2 = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +var looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +var toNumber = (val) => { + const n = isString2(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +var _globalThis; +var getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; +var GLOBALS_ALLOWED2 = "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,Symbol"; +var isGloballyAllowed2 = makeMap2(GLOBALS_ALLOWED2); +function normalizeStyle(value) { + if (isArray2(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString2(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString2(value) || isObject2(value)) { + return value; + } +} +var listDelimiterRE = /;(?![^(]*\))/g; +var propertyDelimiterRE = /:([^]+)/; +var styleCommentRE = /\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString2(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString2(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate2(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString2(value)) { + res = value; + } else if (isArray2(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject2(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +function normalizeProps(props) { + if (!props) return null; + let { class: klass, style } = props; + if (klass && !isString2(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; +} +var HTML_TAGS2 = "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"; +var SVG_TAGS2 = "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"; +var MATH_TAGS2 = "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"; +var VOID_TAGS2 = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +var isHTMLTag2 = makeMap2(HTML_TAGS2); +var isSVGTag2 = makeMap2(SVG_TAGS2); +var isMathMLTag2 = makeMap2(MATH_TAGS2); +var isVoidTag2 = makeMap2(VOID_TAGS2); +var specialBooleanAttrs2 = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +var isSpecialBooleanAttr2 = makeMap2(specialBooleanAttrs2); +var isBooleanAttr2 = makeMap2( + specialBooleanAttrs2 + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +var isKnownHtmlAttr2 = makeMap2( + `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` +); +var isKnownSvgAttr2 = makeMap2( + `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` +); +var isKnownMathMLAttr2 = makeMap2( + `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` +); +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} +var cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` + ); +} +function looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i]); + } + return equal; +} +function looseEqual(a, b) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol2(a); + bValidType = isSymbol2(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray2(a); + bValidType = isArray2(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a, b) : false; + } + aValidType = isObject2(a); + bValidType = isObject2(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { + return false; + } + } + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} +var isRef2 = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +var toDisplayString = (val) => { + return isString2(val) ? val : val == null ? "" : isArray2(val) || isObject2(val) && (val.toString === objectToString2 || !isFunction2(val.toString)) ? isRef2(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +var replacer = (_key, val) => { + if (isRef2(val)) { + return replacer(_key, val.value); + } else if (isMap2(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet2(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol2(val)) { + return stringifySymbol(val); + } else if (isObject2(val) && !isArray2(val) && !isPlainObject2(val)) { + return String(val); + } + return val; +}; +var stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol2(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; + +// node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js var stack = []; function pushWarningContext(vnode) { stack.push(vnode); @@ -2170,15 +2269,15 @@ function formatProps(props) { return res; } function formatProp(key, value, raw) { - if (isString(value)) { + if (isString2(value)) { value = JSON.stringify(value); return raw ? value : [`${key}=${value}`]; } else if (typeof value === "number" || typeof value === "boolean" || value == null) { return raw ? value : [`${key}=${value}`]; - } else if (isRef2(value)) { + } else if (isRef(value)) { value = formatProp(key, toRaw(value.value), true); return raw ? value : [`${key}=Ref<`, value, `>`]; - } else if (isFunction(value)) { + } else if (isFunction2(value)) { return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; } else { value = toRaw(value); @@ -2266,7 +2365,7 @@ function callWithErrorHandling(fn, instance, type, args) { } } function callWithAsyncErrorHandling(fn, instance, type, args) { - if (isFunction(fn)) { + if (isFunction2(fn)) { const res = callWithErrorHandling(fn, instance, type, args); if (res && isPromise(res)) { res.catch((err) => { @@ -2275,7 +2374,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) { } return res; } - if (isArray(fn)) { + if (isArray2(fn)) { const values = []; for (let i = 0; i < fn.length; i++) { values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); @@ -2289,7 +2388,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) { } function handleError(err, instance, type, throwInDev = true) { const contextVNode = instance ? instance.vnode : null; - const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ2; if (instance) { let cur = instance.parent; const exposedInstance = instance.proxy; @@ -2386,7 +2485,7 @@ function queueFlush() { } } function queuePostFlushCb(cb) { - if (!isArray(cb)) { + if (!isArray2(cb)) { if (activePostFlushCbs && cb.id === -1) { activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); } else if (!(cb.flags & 1)) { @@ -2457,7 +2556,7 @@ function flushJobs(seen) { if (true) { seen = seen || /* @__PURE__ */ new Map(); } - const check = true ? (job) => checkRecursiveUpdates(seen, job) : NOOP; + const check = true ? (job) => checkRecursiveUpdates(seen, job) : NOOP2; try { for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; @@ -2610,7 +2709,7 @@ function reload(id, newComp) { }); } function updateComponentDef(oldComp, newComp) { - extend(oldComp, newComp); + extend2(oldComp, newComp); for (const key in oldComp) { if (key !== "__file" && !(key in newComp)) { delete oldComp[key]; @@ -2778,7 +2877,7 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { return renderFnWithContext; } function validateDirectiveName(name) { - if (isBuiltInDirective(name)) { + if (isBuiltInDirective2(name)) { warn$1("Do not use built-in directive ids as custom directive id: " + name); } } @@ -2790,9 +2889,9 @@ function withDirectives(vnode, directives) { const instance = getComponentPublicInstance(currentRenderingInstance); const bindings = vnode.dirs || (vnode.dirs = []); for (let i = 0; i < directives.length; i++) { - let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; + let [dir, value, arg, modifiers = EMPTY_OBJ2] = directives[i]; if (dir) { - if (isFunction(dir)) { + if (isFunction2(dir)) { dir = { mounted: dir, updated: dir @@ -2842,7 +2941,7 @@ var isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instan var isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; var resolveTarget = (props, select) => { const targetSelector = props && props.to; - if (isString(targetSelector)) { + if (isString2(targetSelector)) { if (!select) { warn$1( `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` @@ -3368,7 +3467,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) { const callAsyncHook = (hook, args) => { const done = args[1]; callHook3(hook, args); - if (isArray(hook)) { + if (isArray2(hook)) { if (hook.every((hook2) => hook2.length <= 1)) done(); } else if (hook.length <= 1) { done(); @@ -3431,7 +3530,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) { done(); } }, - leave(el, remove2) { + leave(el, remove3) { const key2 = String(vnode.key); if (el[enterCbKey]) { el[enterCbKey]( @@ -3440,14 +3539,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) { ); } if (state.isUnmounting) { - return remove2(); + return remove3(); } callHook3(onBeforeLeave, [el]); let called = false; const done = el[leaveCbKey] = (cancelled) => { if (called) return; called = true; - remove2(); + remove3(); if (cancelled) { callHook3(onLeaveCancelled, [el]); } else { @@ -3501,7 +3600,7 @@ function getInnerChild$1(vnode) { if (shapeFlag & 16) { return children[0]; } - if (shapeFlag & 32 && isFunction(children.default)) { + if (shapeFlag & 32 && isFunction2(children.default)) { return children.default(); } } @@ -3540,10 +3639,10 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) { return ret; } function defineComponent(options, extraOptions) { - return isFunction(options) ? ( + return isFunction2(options) ? ( // #8236: extend call and options.name access are considered side-effects // by Rollup, so we have to wrap it in a pure-annotated IIFE. - (() => extend({ name: options.name }, extraOptions, { setup: options }))() + (() => extend2({ name: options.name }, extraOptions, { setup: options }))() ) : options; } function useId() { @@ -3565,7 +3664,7 @@ function useTemplateRef(key) { const i = getCurrentInstance(); const r = shallowRef(null); if (i) { - const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs; + const refs = i.refs === EMPTY_OBJ2 ? i.refs = {} : i.refs; let desc; if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) { warn$1(`useTemplateRef('${key}') already exists.`); @@ -3588,11 +3687,11 @@ function useTemplateRef(key) { return ret; } function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { - if (isArray(rawRef)) { + if (isArray2(rawRef)) { rawRef.forEach( (r, i) => setRef( r, - oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + oldRawRef && (isArray2(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount @@ -3616,12 +3715,12 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { return; } const oldRef = oldRawRef && oldRawRef.r; - const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; + const refs = owner.refs === EMPTY_OBJ2 ? owner.refs = {} : owner.refs; const setupState = owner.setupState; const rawSetupState = toRaw(setupState); - const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => { + const canSetSetupRef = setupState === EMPTY_OBJ2 ? () => false : (key) => { if (true) { - if (hasOwn(rawSetupState, key) && !isRef2(rawSetupState[key])) { + if (hasOwn2(rawSetupState, key) && !isRef(rawSetupState[key])) { warn$1( `Template ref "${key}" used on a non-ref value. It will not work in the production build.` ); @@ -3630,31 +3729,31 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { return false; } } - return hasOwn(rawSetupState, key); + return hasOwn2(rawSetupState, key); }; if (oldRef != null && oldRef !== ref2) { - if (isString(oldRef)) { + if (isString2(oldRef)) { refs[oldRef] = null; if (canSetSetupRef(oldRef)) { setupState[oldRef] = null; } - } else if (isRef2(oldRef)) { + } else if (isRef(oldRef)) { oldRef.value = null; } } - if (isFunction(ref2)) { + if (isFunction2(ref2)) { callWithErrorHandling(ref2, owner, 12, [value, refs]); } else { - const _isString = isString(ref2); - const _isRef = isRef2(ref2); + const _isString = isString2(ref2); + const _isRef = isRef(ref2); if (_isString || _isRef) { const doSet = () => { if (rawRef.f) { const existing = _isString ? canSetSetupRef(ref2) ? setupState[ref2] : refs[ref2] : ref2.value; if (isUnmount) { - isArray(existing) && remove(existing, refValue); + isArray2(existing) && remove2(existing, refValue); } else { - if (!isArray(existing)) { + if (!isArray2(existing)) { if (_isString) { refs[ref2] = [refValue]; if (canSetSetupRef(ref2)) { @@ -3717,7 +3816,7 @@ function createHydrationFunctions(rendererInternals) { createText, nextSibling, parentNode, - remove: remove2, + remove: remove3, insert, createComment } @@ -3751,8 +3850,8 @@ function createHydrationFunctions(rendererInternals) { let domType = node.nodeType; vnode.el = node; if (true) { - def(node, "__vnode", vnode, true); - def(node, "__vueParentComponent", parentComponent, true); + def2(node, "__vnode", vnode, true); + def2(node, "__vueParentComponent", parentComponent, true); } if (patchFlag === -2) { optimized = false; @@ -3967,7 +4066,7 @@ Server rendered element contains more child nodes than client vdom.` } const cur = next; next = next.nextSibling; - remove2(cur); + remove3(cur); } } else if (shapeFlag & 8) { let clientText = vnode.children; @@ -4001,7 +4100,7 @@ Server rendered element contains more child nodes than client vdom.` !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { logMismatchError(); } - if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp2(key) || // force hydrate v-bind with .prop modifiers key[0] === "." || isCustomElement) { patchProp2(el, key, null, props[key], void 0, parentComponent); } @@ -4144,7 +4243,7 @@ Server rendered element contains fewer child nodes than client vdom.` while (true) { const next2 = nextSibling(node); if (next2 && next2 !== end) { - remove2(next2); + remove3(next2); } else { break; } @@ -4152,7 +4251,7 @@ Server rendered element contains fewer child nodes than client vdom.` } const next = nextSibling(node); const container = parentNode(node); - remove2(node); + remove3(node); patch( null, vnode, @@ -4218,7 +4317,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) { } } else if (key === "style") { actual = el.getAttribute("style") || ""; - expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); + expected = isString2(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); const actualMap = toStyleMap(actual); const expectedMap = toStyleMap(expected); if (vnode.dirs) { @@ -4235,8 +4334,8 @@ function propHasMismatch(el, key, clientValue, vnode, instance) { mismatchType = 3; mismatchKey = "style"; } - } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { - if (isBooleanAttr(key)) { + } else if (el instanceof SVGElement && isKnownSvgAttr2(key) || el instanceof HTMLElement && (isBooleanAttr2(key) || isKnownHtmlAttr2(key))) { + if (isBooleanAttr2(key)) { actual = el.hasAttribute(key); expected = includeBooleanAttr(clientValue); } else if (clientValue == null) { @@ -4409,7 +4508,7 @@ var hydrateOnMediaQuery = (query) => (hydrate2) => { } }; var hydrateOnInteraction = (interactions = []) => (hydrate2, forEach) => { - if (isString(interactions)) interactions = [interactions]; + if (isString2(interactions)) interactions = [interactions]; let hasHydrated = false; const doHydrate = (e) => { if (!hasHydrated) { @@ -4458,7 +4557,7 @@ function forEachElement(node, cb) { } var isAsyncWrapper = (i) => !!i.type.__asyncLoader; function defineAsyncComponent(source) { - if (isFunction(source)) { + if (isFunction2(source)) { source = { loader: source }; } const { @@ -4505,7 +4604,7 @@ function defineAsyncComponent(source) { if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { comp = comp.default; } - if (comp && !isObject(comp) && !isFunction(comp)) { + if (comp && !isObject2(comp) && !isFunction2(comp)) { throw new Error(`Invalid async component load result: ${comp}`); } resolvedComp = comp; @@ -4815,9 +4914,9 @@ var KeepAliveImpl = { }; var KeepAlive = KeepAliveImpl; function matches(pattern, name) { - if (isArray(pattern)) { + if (isArray2(pattern)) { return pattern.some((p2) => matches(p2, name)); - } else if (isString(pattern)) { + } else if (isString2(pattern)) { return pattern.split(",").includes(name); } else if (isRegExp(pattern)) { pattern.lastIndex = 0; @@ -4862,7 +4961,7 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { /* prepend */ ); onUnmounted(() => { - remove(keepAliveRoot[type], injected); + remove2(keepAliveRoot[type], injected); }, target); } function resetShapeFlag(vnode) { @@ -4890,7 +4989,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) { } return wrappedHook; } else if (true) { - const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + const apiName = toHandlerKey2(ErrorTypeStrings$1[type].replace(/ hook$/, "")); warn$1( `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ); @@ -4926,7 +5025,7 @@ function resolveComponent(name, maybeSelfReference) { } var NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); function resolveDynamicComponent(component) { - if (isString(component)) { + if (isString2(component)) { return resolveAsset(COMPONENTS, component, false) || component; } else { return component || NULL_DYNAMIC_COMPONENT; @@ -4944,7 +5043,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false Component, false ); - if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { + if (selfName && (selfName === name || selfName === camelize2(name) || selfName === capitalize2(camelize2(name)))) { return Component; } } @@ -4965,18 +5064,18 @@ If this is a native custom element, make sure to exclude it from component resol return res; } else if (true) { warn$1( - `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` + `resolve${capitalize2(type.slice(0, -1))} can only be used in render() or setup().` ); } } function resolve(registry, name) { - return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); + return registry && (registry[name] || registry[camelize2(name)] || registry[capitalize2(camelize2(name))]); } function renderList(source, renderItem, cache, index) { let ret; const cached = cache && cache[index]; - const sourceIsArray = isArray(source); - if (sourceIsArray || isString(source)) { + const sourceIsArray = isArray2(source); + if (sourceIsArray || isString2(source)) { const sourceIsReactiveArray = sourceIsArray && isReactive(source); let needsWrap = false; if (sourceIsReactiveArray) { @@ -5000,7 +5099,7 @@ function renderList(source, renderItem, cache, index) { for (let i = 0; i < source; i++) { ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); } - } else if (isObject(source)) { + } else if (isObject2(source)) { if (source[Symbol.iterator]) { ret = Array.from( source, @@ -5025,7 +5124,7 @@ function renderList(source, renderItem, cache, index) { function createSlots(slots, dynamicSlots) { for (let i = 0; i < dynamicSlots.length; i++) { const slot = dynamicSlots[i]; - if (isArray(slot)) { + if (isArray2(slot)) { for (let j = 0; j < slot.length; j++) { slots[slot[j].name] = slot[j].fn; } @@ -5067,7 +5166,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) { const rendered = createBlock( Fragment, { - key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + key: (slotKey && !isSymbol2(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), @@ -5092,12 +5191,12 @@ function ensureValidVNode(vnodes) { } function toHandlers(obj, preserveCaseIfNecessary) { const ret = {}; - if (!isObject(obj)) { + if (!isObject2(obj)) { warn$1(`v-on with no argument expects an object value.`); return ret; } for (const key in obj) { - ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey2(key)] = obj[key]; } return ret; } @@ -5109,7 +5208,7 @@ var getPublicInstance = (i) => { var publicPropertiesMap = ( // Move PURE marker to new line to workaround compiler discarding it // due to type annotation - extend(/* @__PURE__ */ Object.create(null), { + extend2(/* @__PURE__ */ Object.create(null), { $: (i) => i, $el: (i) => i.vnode.el, $data: (i) => i.data, @@ -5126,11 +5225,11 @@ var publicPropertiesMap = ( queueJob(i.update); }), $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), - $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP + $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP2 }) ); var isReservedPrefix = (key) => key === "_" || key === "$"; -var hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); +var hasSetupBinding = (state, key) => state !== EMPTY_OBJ2 && !state.__isScriptSetup && hasOwn2(state, key); var PublicInstanceProxyHandlers = { get({ _: instance }, key) { if (key === "__v_skip") { @@ -5157,17 +5256,17 @@ var PublicInstanceProxyHandlers = { } else if (hasSetupBinding(setupState, key)) { accessCache[key] = 1; return setupState[key]; - } else if (data !== EMPTY_OBJ && hasOwn(data, key)) { + } else if (data !== EMPTY_OBJ2 && hasOwn2(data, key)) { accessCache[key] = 2; return data[key]; } else if ( // only cache other properties when instance has declared (thus stable) // props - (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key) + (normalizedProps = instance.propsOptions[0]) && hasOwn2(normalizedProps, key) ) { accessCache[key] = 3; return props[key]; - } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + } else if (ctx !== EMPTY_OBJ2 && hasOwn2(ctx, key)) { accessCache[key] = 4; return ctx[key]; } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) { @@ -5189,20 +5288,20 @@ var PublicInstanceProxyHandlers = { (cssModule = type.__cssModules) && (cssModule = cssModule[key]) ) { return cssModule; - } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + } else if (ctx !== EMPTY_OBJ2 && hasOwn2(ctx, key)) { accessCache[key] = 4; return ctx[key]; } else if ( // global properties - globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + globalProperties = appContext.config.globalProperties, hasOwn2(globalProperties, key) ) { { return globalProperties[key]; } - } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + } else if (currentRenderingInstance && (!isString2(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading // to infinite warning loop key.indexOf("__v") !== 0)) { - if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { + if (data !== EMPTY_OBJ2 && isReservedPrefix(key[0]) && hasOwn2(data, key)) { warn$1( `Property ${JSON.stringify( key @@ -5220,13 +5319,13 @@ var PublicInstanceProxyHandlers = { if (hasSetupBinding(setupState, key)) { setupState[key] = value; return true; - } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { + } else if (setupState.__isScriptSetup && hasOwn2(setupState, key)) { warn$1(`Cannot mutate - - ``` ```vue [app.vue] - - + + ``` ::: + + ::: warning Artplayer Not Responsive: Modifying `option` directly in `Vue.js` will not change the player @@ -170,46 +160,41 @@ import Artplayer from 'artplayer' import { useEffect, useRef } from 'react' export default function Player({ option, getInstance, ...rest }) { - const artRef = useRef() + const $container = useRef() useEffect(() => { const art = new Artplayer({ ...option, - container: artRef.current, + container: $container.current, }) - if (getInstance && typeof getInstance === 'function') { + if (typeof getInstance === 'function') { getInstance(art) } - return () => { - if (art && art.destroy) { - art.destroy(false) - } - } + return () => art.destroy(false) }, []) - return
+ return
} ``` ```jsx [app.jsx] -import React from 'react' -import Artplayer from './ArtPlayer.jsx' +import Artplayer from './Artplayer.jsx' function App() { return (
console.info(art)} + getInstance={art => console.log(art)} />
) @@ -219,6 +204,7 @@ export default App ``` ::: + ::: warning Non-responsive Artplayer In `React.js`, directly modifying the `option` will not change the player diff --git a/packages/artplayer-vitepress/docs/index.md b/packages/artplayer-vitepress/docs/index.md index 1bebb359f..bd780564a 100644 --- a/packages/artplayer-vitepress/docs/index.md +++ b/packages/artplayer-vitepress/docs/index.md @@ -84,75 +84,63 @@ https://unpkg.com/artplayer/dist/artplayer.js ::: code-group ```vue [Artplayer.vue] + + - - ``` ```vue [app.vue] - - + + ``` ::: @@ -172,46 +160,41 @@ import Artplayer from 'artplayer' import { useEffect, useRef } from 'react' export default function Player({ option, getInstance, ...rest }) { - const artRef = useRef() + const $container = useRef() useEffect(() => { const art = new Artplayer({ ...option, - container: artRef.current, + container: $container.current, }) - if (getInstance && typeof getInstance === 'function') { + if (typeof getInstance === 'function') { getInstance(art) } - return () => { - if (art && art.destroy) { - art.destroy(false) - } - } + return () => art.destroy(false) }, []) - return
+ return
} ``` ```jsx [app.jsx] -import React from 'react' -import Artplayer from './ArtPlayer.jsx' +import Artplayer from './Artplayer.jsx' function App() { return (
console.info(art)} + getInstance={art => console.log(art)} />
)