runtime-dom.esm-bundler.js 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867
  1. /**
  2. * @vue/runtime-dom v3.5.16
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. import { warn, BaseTransitionPropsValidators, h, BaseTransition, assertNumber, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, createRenderer, createHydrationRenderer, isRuntimeOnly } from '@vue/runtime-core';
  7. export * from '@vue/runtime-core';
  8. import { extend, isObject, toNumber, isArray, NOOP, isString, hyphenate, capitalize, isSpecialBooleanAttr, includeBooleanAttr, isSymbol, isFunction, isOn, isModelListener, camelize as camelize$1, isPlainObject, hasOwn, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
  9. let policy = void 0;
  10. const tt = typeof window !== "undefined" && window.trustedTypes;
  11. if (tt) {
  12. try {
  13. policy = /* @__PURE__ */ tt.createPolicy("vue", {
  14. createHTML: (val) => val
  15. });
  16. } catch (e) {
  17. !!(process.env.NODE_ENV !== "production") && warn(`Error creating trusted types policy: ${e}`);
  18. }
  19. }
  20. const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
  21. const svgNS = "http://www.w3.org/2000/svg";
  22. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  23. const doc = typeof document !== "undefined" ? document : null;
  24. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  25. const nodeOps = {
  26. insert: (child, parent, anchor) => {
  27. parent.insertBefore(child, anchor || null);
  28. },
  29. remove: (child) => {
  30. const parent = child.parentNode;
  31. if (parent) {
  32. parent.removeChild(child);
  33. }
  34. },
  35. createElement: (tag, namespace, is, props) => {
  36. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  37. if (tag === "select" && props && props.multiple != null) {
  38. el.setAttribute("multiple", props.multiple);
  39. }
  40. return el;
  41. },
  42. createText: (text) => doc.createTextNode(text),
  43. createComment: (text) => doc.createComment(text),
  44. setText: (node, text) => {
  45. node.nodeValue = text;
  46. },
  47. setElementText: (el, text) => {
  48. el.textContent = text;
  49. },
  50. parentNode: (node) => node.parentNode,
  51. nextSibling: (node) => node.nextSibling,
  52. querySelector: (selector) => doc.querySelector(selector),
  53. setScopeId(el, id) {
  54. el.setAttribute(id, "");
  55. },
  56. // __UNSAFE__
  57. // Reason: innerHTML.
  58. // Static content here can only come from compiled templates.
  59. // As long as the user only uses trusted templates, this is safe.
  60. insertStaticContent(content, parent, anchor, namespace, start, end) {
  61. const before = anchor ? anchor.previousSibling : parent.lastChild;
  62. if (start && (start === end || start.nextSibling)) {
  63. while (true) {
  64. parent.insertBefore(start.cloneNode(true), anchor);
  65. if (start === end || !(start = start.nextSibling)) break;
  66. }
  67. } else {
  68. templateContainer.innerHTML = unsafeToTrustedHTML(
  69. namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
  70. );
  71. const template = templateContainer.content;
  72. if (namespace === "svg" || namespace === "mathml") {
  73. const wrapper = template.firstChild;
  74. while (wrapper.firstChild) {
  75. template.appendChild(wrapper.firstChild);
  76. }
  77. template.removeChild(wrapper);
  78. }
  79. parent.insertBefore(template, anchor);
  80. }
  81. return [
  82. // first
  83. before ? before.nextSibling : parent.firstChild,
  84. // last
  85. anchor ? anchor.previousSibling : parent.lastChild
  86. ];
  87. }
  88. };
  89. const TRANSITION = "transition";
  90. const ANIMATION = "animation";
  91. const vtcKey = Symbol("_vtc");
  92. const DOMTransitionPropsValidators = {
  93. name: String,
  94. type: String,
  95. css: {
  96. type: Boolean,
  97. default: true
  98. },
  99. duration: [String, Number, Object],
  100. enterFromClass: String,
  101. enterActiveClass: String,
  102. enterToClass: String,
  103. appearFromClass: String,
  104. appearActiveClass: String,
  105. appearToClass: String,
  106. leaveFromClass: String,
  107. leaveActiveClass: String,
  108. leaveToClass: String
  109. };
  110. const TransitionPropsValidators = /* @__PURE__ */ extend(
  111. {},
  112. BaseTransitionPropsValidators,
  113. DOMTransitionPropsValidators
  114. );
  115. const decorate$1 = (t) => {
  116. t.displayName = "Transition";
  117. t.props = TransitionPropsValidators;
  118. return t;
  119. };
  120. const Transition = /* @__PURE__ */ decorate$1(
  121. (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
  122. );
  123. const callHook = (hook, args = []) => {
  124. if (isArray(hook)) {
  125. hook.forEach((h2) => h2(...args));
  126. } else if (hook) {
  127. hook(...args);
  128. }
  129. };
  130. const hasExplicitCallback = (hook) => {
  131. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  132. };
  133. function resolveTransitionProps(rawProps) {
  134. const baseProps = {};
  135. for (const key in rawProps) {
  136. if (!(key in DOMTransitionPropsValidators)) {
  137. baseProps[key] = rawProps[key];
  138. }
  139. }
  140. if (rawProps.css === false) {
  141. return baseProps;
  142. }
  143. const {
  144. name = "v",
  145. type,
  146. duration,
  147. enterFromClass = `${name}-enter-from`,
  148. enterActiveClass = `${name}-enter-active`,
  149. enterToClass = `${name}-enter-to`,
  150. appearFromClass = enterFromClass,
  151. appearActiveClass = enterActiveClass,
  152. appearToClass = enterToClass,
  153. leaveFromClass = `${name}-leave-from`,
  154. leaveActiveClass = `${name}-leave-active`,
  155. leaveToClass = `${name}-leave-to`
  156. } = rawProps;
  157. const durations = normalizeDuration(duration);
  158. const enterDuration = durations && durations[0];
  159. const leaveDuration = durations && durations[1];
  160. const {
  161. onBeforeEnter,
  162. onEnter,
  163. onEnterCancelled,
  164. onLeave,
  165. onLeaveCancelled,
  166. onBeforeAppear = onBeforeEnter,
  167. onAppear = onEnter,
  168. onAppearCancelled = onEnterCancelled
  169. } = baseProps;
  170. const finishEnter = (el, isAppear, done, isCancelled) => {
  171. el._enterCancelled = isCancelled;
  172. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  173. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  174. done && done();
  175. };
  176. const finishLeave = (el, done) => {
  177. el._isLeaving = false;
  178. removeTransitionClass(el, leaveFromClass);
  179. removeTransitionClass(el, leaveToClass);
  180. removeTransitionClass(el, leaveActiveClass);
  181. done && done();
  182. };
  183. const makeEnterHook = (isAppear) => {
  184. return (el, done) => {
  185. const hook = isAppear ? onAppear : onEnter;
  186. const resolve = () => finishEnter(el, isAppear, done);
  187. callHook(hook, [el, resolve]);
  188. nextFrame(() => {
  189. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  190. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  191. if (!hasExplicitCallback(hook)) {
  192. whenTransitionEnds(el, type, enterDuration, resolve);
  193. }
  194. });
  195. };
  196. };
  197. return extend(baseProps, {
  198. onBeforeEnter(el) {
  199. callHook(onBeforeEnter, [el]);
  200. addTransitionClass(el, enterFromClass);
  201. addTransitionClass(el, enterActiveClass);
  202. },
  203. onBeforeAppear(el) {
  204. callHook(onBeforeAppear, [el]);
  205. addTransitionClass(el, appearFromClass);
  206. addTransitionClass(el, appearActiveClass);
  207. },
  208. onEnter: makeEnterHook(false),
  209. onAppear: makeEnterHook(true),
  210. onLeave(el, done) {
  211. el._isLeaving = true;
  212. const resolve = () => finishLeave(el, done);
  213. addTransitionClass(el, leaveFromClass);
  214. if (!el._enterCancelled) {
  215. forceReflow();
  216. addTransitionClass(el, leaveActiveClass);
  217. } else {
  218. addTransitionClass(el, leaveActiveClass);
  219. forceReflow();
  220. }
  221. nextFrame(() => {
  222. if (!el._isLeaving) {
  223. return;
  224. }
  225. removeTransitionClass(el, leaveFromClass);
  226. addTransitionClass(el, leaveToClass);
  227. if (!hasExplicitCallback(onLeave)) {
  228. whenTransitionEnds(el, type, leaveDuration, resolve);
  229. }
  230. });
  231. callHook(onLeave, [el, resolve]);
  232. },
  233. onEnterCancelled(el) {
  234. finishEnter(el, false, void 0, true);
  235. callHook(onEnterCancelled, [el]);
  236. },
  237. onAppearCancelled(el) {
  238. finishEnter(el, true, void 0, true);
  239. callHook(onAppearCancelled, [el]);
  240. },
  241. onLeaveCancelled(el) {
  242. finishLeave(el);
  243. callHook(onLeaveCancelled, [el]);
  244. }
  245. });
  246. }
  247. function normalizeDuration(duration) {
  248. if (duration == null) {
  249. return null;
  250. } else if (isObject(duration)) {
  251. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  252. } else {
  253. const n = NumberOf(duration);
  254. return [n, n];
  255. }
  256. }
  257. function NumberOf(val) {
  258. const res = toNumber(val);
  259. if (!!(process.env.NODE_ENV !== "production")) {
  260. assertNumber(res, "<transition> explicit duration");
  261. }
  262. return res;
  263. }
  264. function addTransitionClass(el, cls) {
  265. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  266. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  267. }
  268. function removeTransitionClass(el, cls) {
  269. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  270. const _vtc = el[vtcKey];
  271. if (_vtc) {
  272. _vtc.delete(cls);
  273. if (!_vtc.size) {
  274. el[vtcKey] = void 0;
  275. }
  276. }
  277. }
  278. function nextFrame(cb) {
  279. requestAnimationFrame(() => {
  280. requestAnimationFrame(cb);
  281. });
  282. }
  283. let endId = 0;
  284. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  285. const id = el._endId = ++endId;
  286. const resolveIfNotStale = () => {
  287. if (id === el._endId) {
  288. resolve();
  289. }
  290. };
  291. if (explicitTimeout != null) {
  292. return setTimeout(resolveIfNotStale, explicitTimeout);
  293. }
  294. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  295. if (!type) {
  296. return resolve();
  297. }
  298. const endEvent = type + "end";
  299. let ended = 0;
  300. const end = () => {
  301. el.removeEventListener(endEvent, onEnd);
  302. resolveIfNotStale();
  303. };
  304. const onEnd = (e) => {
  305. if (e.target === el && ++ended >= propCount) {
  306. end();
  307. }
  308. };
  309. setTimeout(() => {
  310. if (ended < propCount) {
  311. end();
  312. }
  313. }, timeout + 1);
  314. el.addEventListener(endEvent, onEnd);
  315. }
  316. function getTransitionInfo(el, expectedType) {
  317. const styles = window.getComputedStyle(el);
  318. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  319. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  320. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  321. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  322. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  323. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  324. const animationTimeout = getTimeout(animationDelays, animationDurations);
  325. let type = null;
  326. let timeout = 0;
  327. let propCount = 0;
  328. if (expectedType === TRANSITION) {
  329. if (transitionTimeout > 0) {
  330. type = TRANSITION;
  331. timeout = transitionTimeout;
  332. propCount = transitionDurations.length;
  333. }
  334. } else if (expectedType === ANIMATION) {
  335. if (animationTimeout > 0) {
  336. type = ANIMATION;
  337. timeout = animationTimeout;
  338. propCount = animationDurations.length;
  339. }
  340. } else {
  341. timeout = Math.max(transitionTimeout, animationTimeout);
  342. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  343. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  344. }
  345. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  346. getStyleProperties(`${TRANSITION}Property`).toString()
  347. );
  348. return {
  349. type,
  350. timeout,
  351. propCount,
  352. hasTransform
  353. };
  354. }
  355. function getTimeout(delays, durations) {
  356. while (delays.length < durations.length) {
  357. delays = delays.concat(delays);
  358. }
  359. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  360. }
  361. function toMs(s) {
  362. if (s === "auto") return 0;
  363. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  364. }
  365. function forceReflow() {
  366. return document.body.offsetHeight;
  367. }
  368. function patchClass(el, value, isSVG) {
  369. const transitionClasses = el[vtcKey];
  370. if (transitionClasses) {
  371. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  372. }
  373. if (value == null) {
  374. el.removeAttribute("class");
  375. } else if (isSVG) {
  376. el.setAttribute("class", value);
  377. } else {
  378. el.className = value;
  379. }
  380. }
  381. const vShowOriginalDisplay = Symbol("_vod");
  382. const vShowHidden = Symbol("_vsh");
  383. const vShow = {
  384. beforeMount(el, { value }, { transition }) {
  385. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  386. if (transition && value) {
  387. transition.beforeEnter(el);
  388. } else {
  389. setDisplay(el, value);
  390. }
  391. },
  392. mounted(el, { value }, { transition }) {
  393. if (transition && value) {
  394. transition.enter(el);
  395. }
  396. },
  397. updated(el, { value, oldValue }, { transition }) {
  398. if (!value === !oldValue) return;
  399. if (transition) {
  400. if (value) {
  401. transition.beforeEnter(el);
  402. setDisplay(el, true);
  403. transition.enter(el);
  404. } else {
  405. transition.leave(el, () => {
  406. setDisplay(el, false);
  407. });
  408. }
  409. } else {
  410. setDisplay(el, value);
  411. }
  412. },
  413. beforeUnmount(el, { value }) {
  414. setDisplay(el, value);
  415. }
  416. };
  417. if (!!(process.env.NODE_ENV !== "production")) {
  418. vShow.name = "show";
  419. }
  420. function setDisplay(el, value) {
  421. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  422. el[vShowHidden] = !value;
  423. }
  424. function initVShowForSSR() {
  425. vShow.getSSRProps = ({ value }) => {
  426. if (!value) {
  427. return { style: { display: "none" } };
  428. }
  429. };
  430. }
  431. const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
  432. function useCssVars(getter) {
  433. const instance = getCurrentInstance();
  434. if (!instance) {
  435. !!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
  436. return;
  437. }
  438. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  439. Array.from(
  440. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  441. ).forEach((node) => setVarsOnNode(node, vars));
  442. };
  443. if (!!(process.env.NODE_ENV !== "production")) {
  444. instance.getCssVars = () => getter(instance.proxy);
  445. }
  446. const setVars = () => {
  447. const vars = getter(instance.proxy);
  448. if (instance.ce) {
  449. setVarsOnNode(instance.ce, vars);
  450. } else {
  451. setVarsOnVNode(instance.subTree, vars);
  452. }
  453. updateTeleports(vars);
  454. };
  455. onBeforeUpdate(() => {
  456. queuePostFlushCb(setVars);
  457. });
  458. onMounted(() => {
  459. watch(setVars, NOOP, { flush: "post" });
  460. const ob = new MutationObserver(setVars);
  461. ob.observe(instance.subTree.el.parentNode, { childList: true });
  462. onUnmounted(() => ob.disconnect());
  463. });
  464. }
  465. function setVarsOnVNode(vnode, vars) {
  466. if (vnode.shapeFlag & 128) {
  467. const suspense = vnode.suspense;
  468. vnode = suspense.activeBranch;
  469. if (suspense.pendingBranch && !suspense.isHydrating) {
  470. suspense.effects.push(() => {
  471. setVarsOnVNode(suspense.activeBranch, vars);
  472. });
  473. }
  474. }
  475. while (vnode.component) {
  476. vnode = vnode.component.subTree;
  477. }
  478. if (vnode.shapeFlag & 1 && vnode.el) {
  479. setVarsOnNode(vnode.el, vars);
  480. } else if (vnode.type === Fragment) {
  481. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  482. } else if (vnode.type === Static) {
  483. let { el, anchor } = vnode;
  484. while (el) {
  485. setVarsOnNode(el, vars);
  486. if (el === anchor) break;
  487. el = el.nextSibling;
  488. }
  489. }
  490. }
  491. function setVarsOnNode(el, vars) {
  492. if (el.nodeType === 1) {
  493. const style = el.style;
  494. let cssText = "";
  495. for (const key in vars) {
  496. style.setProperty(`--${key}`, vars[key]);
  497. cssText += `--${key}: ${vars[key]};`;
  498. }
  499. style[CSS_VAR_TEXT] = cssText;
  500. }
  501. }
  502. const displayRE = /(^|;)\s*display\s*:/;
  503. function patchStyle(el, prev, next) {
  504. const style = el.style;
  505. const isCssString = isString(next);
  506. let hasControlledDisplay = false;
  507. if (next && !isCssString) {
  508. if (prev) {
  509. if (!isString(prev)) {
  510. for (const key in prev) {
  511. if (next[key] == null) {
  512. setStyle(style, key, "");
  513. }
  514. }
  515. } else {
  516. for (const prevStyle of prev.split(";")) {
  517. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  518. if (next[key] == null) {
  519. setStyle(style, key, "");
  520. }
  521. }
  522. }
  523. }
  524. for (const key in next) {
  525. if (key === "display") {
  526. hasControlledDisplay = true;
  527. }
  528. setStyle(style, key, next[key]);
  529. }
  530. } else {
  531. if (isCssString) {
  532. if (prev !== next) {
  533. const cssVarText = style[CSS_VAR_TEXT];
  534. if (cssVarText) {
  535. next += ";" + cssVarText;
  536. }
  537. style.cssText = next;
  538. hasControlledDisplay = displayRE.test(next);
  539. }
  540. } else if (prev) {
  541. el.removeAttribute("style");
  542. }
  543. }
  544. if (vShowOriginalDisplay in el) {
  545. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  546. if (el[vShowHidden]) {
  547. style.display = "none";
  548. }
  549. }
  550. }
  551. const semicolonRE = /[^\\];\s*$/;
  552. const importantRE = /\s*!important$/;
  553. function setStyle(style, name, val) {
  554. if (isArray(val)) {
  555. val.forEach((v) => setStyle(style, name, v));
  556. } else {
  557. if (val == null) val = "";
  558. if (!!(process.env.NODE_ENV !== "production")) {
  559. if (semicolonRE.test(val)) {
  560. warn(
  561. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  562. );
  563. }
  564. }
  565. if (name.startsWith("--")) {
  566. style.setProperty(name, val);
  567. } else {
  568. const prefixed = autoPrefix(style, name);
  569. if (importantRE.test(val)) {
  570. style.setProperty(
  571. hyphenate(prefixed),
  572. val.replace(importantRE, ""),
  573. "important"
  574. );
  575. } else {
  576. style[prefixed] = val;
  577. }
  578. }
  579. }
  580. }
  581. const prefixes = ["Webkit", "Moz", "ms"];
  582. const prefixCache = {};
  583. function autoPrefix(style, rawName) {
  584. const cached = prefixCache[rawName];
  585. if (cached) {
  586. return cached;
  587. }
  588. let name = camelize(rawName);
  589. if (name !== "filter" && name in style) {
  590. return prefixCache[rawName] = name;
  591. }
  592. name = capitalize(name);
  593. for (let i = 0; i < prefixes.length; i++) {
  594. const prefixed = prefixes[i] + name;
  595. if (prefixed in style) {
  596. return prefixCache[rawName] = prefixed;
  597. }
  598. }
  599. return rawName;
  600. }
  601. const xlinkNS = "http://www.w3.org/1999/xlink";
  602. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  603. if (isSVG && key.startsWith("xlink:")) {
  604. if (value == null) {
  605. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  606. } else {
  607. el.setAttributeNS(xlinkNS, key, value);
  608. }
  609. } else {
  610. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  611. el.removeAttribute(key);
  612. } else {
  613. el.setAttribute(
  614. key,
  615. isBoolean ? "" : isSymbol(value) ? String(value) : value
  616. );
  617. }
  618. }
  619. }
  620. function patchDOMProp(el, key, value, parentComponent, attrName) {
  621. if (key === "innerHTML" || key === "textContent") {
  622. if (value != null) {
  623. el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
  624. }
  625. return;
  626. }
  627. const tag = el.tagName;
  628. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  629. !tag.includes("-")) {
  630. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  631. const newValue = value == null ? (
  632. // #11647: value should be set as empty string for null and undefined,
  633. // but <input type="checkbox"> should be set as 'on'.
  634. el.type === "checkbox" ? "on" : ""
  635. ) : String(value);
  636. if (oldValue !== newValue || !("_value" in el)) {
  637. el.value = newValue;
  638. }
  639. if (value == null) {
  640. el.removeAttribute(key);
  641. }
  642. el._value = value;
  643. return;
  644. }
  645. let needRemove = false;
  646. if (value === "" || value == null) {
  647. const type = typeof el[key];
  648. if (type === "boolean") {
  649. value = includeBooleanAttr(value);
  650. } else if (value == null && type === "string") {
  651. value = "";
  652. needRemove = true;
  653. } else if (type === "number") {
  654. value = 0;
  655. needRemove = true;
  656. }
  657. }
  658. try {
  659. el[key] = value;
  660. } catch (e) {
  661. if (!!(process.env.NODE_ENV !== "production") && !needRemove) {
  662. warn(
  663. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  664. e
  665. );
  666. }
  667. }
  668. needRemove && el.removeAttribute(attrName || key);
  669. }
  670. function addEventListener(el, event, handler, options) {
  671. el.addEventListener(event, handler, options);
  672. }
  673. function removeEventListener(el, event, handler, options) {
  674. el.removeEventListener(event, handler, options);
  675. }
  676. const veiKey = Symbol("_vei");
  677. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  678. const invokers = el[veiKey] || (el[veiKey] = {});
  679. const existingInvoker = invokers[rawName];
  680. if (nextValue && existingInvoker) {
  681. existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
  682. } else {
  683. const [name, options] = parseName(rawName);
  684. if (nextValue) {
  685. const invoker = invokers[rawName] = createInvoker(
  686. !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue,
  687. instance
  688. );
  689. addEventListener(el, name, invoker, options);
  690. } else if (existingInvoker) {
  691. removeEventListener(el, name, existingInvoker, options);
  692. invokers[rawName] = void 0;
  693. }
  694. }
  695. }
  696. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  697. function parseName(name) {
  698. let options;
  699. if (optionsModifierRE.test(name)) {
  700. options = {};
  701. let m;
  702. while (m = name.match(optionsModifierRE)) {
  703. name = name.slice(0, name.length - m[0].length);
  704. options[m[0].toLowerCase()] = true;
  705. }
  706. }
  707. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  708. return [event, options];
  709. }
  710. let cachedNow = 0;
  711. const p = /* @__PURE__ */ Promise.resolve();
  712. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  713. function createInvoker(initialValue, instance) {
  714. const invoker = (e) => {
  715. if (!e._vts) {
  716. e._vts = Date.now();
  717. } else if (e._vts <= invoker.attached) {
  718. return;
  719. }
  720. callWithAsyncErrorHandling(
  721. patchStopImmediatePropagation(e, invoker.value),
  722. instance,
  723. 5,
  724. [e]
  725. );
  726. };
  727. invoker.value = initialValue;
  728. invoker.attached = getNow();
  729. return invoker;
  730. }
  731. function sanitizeEventValue(value, propName) {
  732. if (isFunction(value) || isArray(value)) {
  733. return value;
  734. }
  735. warn(
  736. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  737. Expected function or array of functions, received type ${typeof value}.`
  738. );
  739. return NOOP;
  740. }
  741. function patchStopImmediatePropagation(e, value) {
  742. if (isArray(value)) {
  743. const originalStop = e.stopImmediatePropagation;
  744. e.stopImmediatePropagation = () => {
  745. originalStop.call(e);
  746. e._stopped = true;
  747. };
  748. return value.map(
  749. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  750. );
  751. } else {
  752. return value;
  753. }
  754. }
  755. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  756. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  757. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  758. const isSVG = namespace === "svg";
  759. if (key === "class") {
  760. patchClass(el, nextValue, isSVG);
  761. } else if (key === "style") {
  762. patchStyle(el, prevValue, nextValue);
  763. } else if (isOn(key)) {
  764. if (!isModelListener(key)) {
  765. patchEvent(el, key, prevValue, nextValue, parentComponent);
  766. }
  767. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  768. patchDOMProp(el, key, nextValue);
  769. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  770. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  771. }
  772. } else if (
  773. // #11081 force set props for possible async custom element
  774. el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
  775. ) {
  776. patchDOMProp(el, camelize$1(key), nextValue, parentComponent, key);
  777. } else {
  778. if (key === "true-value") {
  779. el._trueValue = nextValue;
  780. } else if (key === "false-value") {
  781. el._falseValue = nextValue;
  782. }
  783. patchAttr(el, key, nextValue, isSVG);
  784. }
  785. };
  786. function shouldSetAsProp(el, key, value, isSVG) {
  787. if (isSVG) {
  788. if (key === "innerHTML" || key === "textContent") {
  789. return true;
  790. }
  791. if (key in el && isNativeOn(key) && isFunction(value)) {
  792. return true;
  793. }
  794. return false;
  795. }
  796. if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
  797. return false;
  798. }
  799. if (key === "form") {
  800. return false;
  801. }
  802. if (key === "list" && el.tagName === "INPUT") {
  803. return false;
  804. }
  805. if (key === "type" && el.tagName === "TEXTAREA") {
  806. return false;
  807. }
  808. if (key === "width" || key === "height") {
  809. const tag = el.tagName;
  810. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  811. return false;
  812. }
  813. }
  814. if (isNativeOn(key) && isString(value)) {
  815. return false;
  816. }
  817. return key in el;
  818. }
  819. const REMOVAL = {};
  820. /*! #__NO_SIDE_EFFECTS__ */
  821. // @__NO_SIDE_EFFECTS__
  822. function defineCustomElement(options, extraOptions, _createApp) {
  823. const Comp = defineComponent(options, extraOptions);
  824. if (isPlainObject(Comp)) extend(Comp, extraOptions);
  825. class VueCustomElement extends VueElement {
  826. constructor(initialProps) {
  827. super(Comp, initialProps, _createApp);
  828. }
  829. }
  830. VueCustomElement.def = Comp;
  831. return VueCustomElement;
  832. }
  833. /*! #__NO_SIDE_EFFECTS__ */
  834. const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  835. return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
  836. };
  837. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  838. };
  839. class VueElement extends BaseClass {
  840. constructor(_def, _props = {}, _createApp = createApp) {
  841. super();
  842. this._def = _def;
  843. this._props = _props;
  844. this._createApp = _createApp;
  845. this._isVueCE = true;
  846. /**
  847. * @internal
  848. */
  849. this._instance = null;
  850. /**
  851. * @internal
  852. */
  853. this._app = null;
  854. /**
  855. * @internal
  856. */
  857. this._nonce = this._def.nonce;
  858. this._connected = false;
  859. this._resolved = false;
  860. this._numberProps = null;
  861. this._styleChildren = /* @__PURE__ */ new WeakSet();
  862. this._ob = null;
  863. if (this.shadowRoot && _createApp !== createApp) {
  864. this._root = this.shadowRoot;
  865. } else {
  866. if (!!(process.env.NODE_ENV !== "production") && this.shadowRoot) {
  867. warn(
  868. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  869. );
  870. }
  871. if (_def.shadowRoot !== false) {
  872. this.attachShadow({ mode: "open" });
  873. this._root = this.shadowRoot;
  874. } else {
  875. this._root = this;
  876. }
  877. }
  878. }
  879. connectedCallback() {
  880. if (!this.isConnected) return;
  881. if (!this.shadowRoot && !this._resolved) {
  882. this._parseSlots();
  883. }
  884. this._connected = true;
  885. let parent = this;
  886. while (parent = parent && (parent.parentNode || parent.host)) {
  887. if (parent instanceof VueElement) {
  888. this._parent = parent;
  889. break;
  890. }
  891. }
  892. if (!this._instance) {
  893. if (this._resolved) {
  894. this._mount(this._def);
  895. } else {
  896. if (parent && parent._pendingResolve) {
  897. this._pendingResolve = parent._pendingResolve.then(() => {
  898. this._pendingResolve = void 0;
  899. this._resolveDef();
  900. });
  901. } else {
  902. this._resolveDef();
  903. }
  904. }
  905. }
  906. }
  907. _setParent(parent = this._parent) {
  908. if (parent) {
  909. this._instance.parent = parent._instance;
  910. this._inheritParentContext(parent);
  911. }
  912. }
  913. _inheritParentContext(parent = this._parent) {
  914. if (parent && this._app) {
  915. Object.setPrototypeOf(
  916. this._app._context.provides,
  917. parent._instance.provides
  918. );
  919. }
  920. }
  921. disconnectedCallback() {
  922. this._connected = false;
  923. nextTick(() => {
  924. if (!this._connected) {
  925. if (this._ob) {
  926. this._ob.disconnect();
  927. this._ob = null;
  928. }
  929. this._app && this._app.unmount();
  930. if (this._instance) this._instance.ce = void 0;
  931. this._app = this._instance = null;
  932. }
  933. });
  934. }
  935. /**
  936. * resolve inner component definition (handle possible async component)
  937. */
  938. _resolveDef() {
  939. if (this._pendingResolve) {
  940. return;
  941. }
  942. for (let i = 0; i < this.attributes.length; i++) {
  943. this._setAttr(this.attributes[i].name);
  944. }
  945. this._ob = new MutationObserver((mutations) => {
  946. for (const m of mutations) {
  947. this._setAttr(m.attributeName);
  948. }
  949. });
  950. this._ob.observe(this, { attributes: true });
  951. const resolve = (def, isAsync = false) => {
  952. this._resolved = true;
  953. this._pendingResolve = void 0;
  954. const { props, styles } = def;
  955. let numberProps;
  956. if (props && !isArray(props)) {
  957. for (const key in props) {
  958. const opt = props[key];
  959. if (opt === Number || opt && opt.type === Number) {
  960. if (key in this._props) {
  961. this._props[key] = toNumber(this._props[key]);
  962. }
  963. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize$1(key)] = true;
  964. }
  965. }
  966. }
  967. this._numberProps = numberProps;
  968. this._resolveProps(def);
  969. if (this.shadowRoot) {
  970. this._applyStyles(styles);
  971. } else if (!!(process.env.NODE_ENV !== "production") && styles) {
  972. warn(
  973. "Custom element style injection is not supported when using shadowRoot: false"
  974. );
  975. }
  976. this._mount(def);
  977. };
  978. const asyncDef = this._def.__asyncLoader;
  979. if (asyncDef) {
  980. this._pendingResolve = asyncDef().then(
  981. (def) => resolve(this._def = def, true)
  982. );
  983. } else {
  984. resolve(this._def);
  985. }
  986. }
  987. _mount(def) {
  988. if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def.name) {
  989. def.name = "VueElement";
  990. }
  991. this._app = this._createApp(def);
  992. this._inheritParentContext();
  993. if (def.configureApp) {
  994. def.configureApp(this._app);
  995. }
  996. this._app._ceVNode = this._createVNode();
  997. this._app.mount(this._root);
  998. const exposed = this._instance && this._instance.exposed;
  999. if (!exposed) return;
  1000. for (const key in exposed) {
  1001. if (!hasOwn(this, key)) {
  1002. Object.defineProperty(this, key, {
  1003. // unwrap ref to be consistent with public instance behavior
  1004. get: () => unref(exposed[key])
  1005. });
  1006. } else if (!!(process.env.NODE_ENV !== "production")) {
  1007. warn(`Exposed property "${key}" already exists on custom element.`);
  1008. }
  1009. }
  1010. }
  1011. _resolveProps(def) {
  1012. const { props } = def;
  1013. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  1014. for (const key of Object.keys(this)) {
  1015. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  1016. this._setProp(key, this[key]);
  1017. }
  1018. }
  1019. for (const key of declaredPropKeys.map(camelize$1)) {
  1020. Object.defineProperty(this, key, {
  1021. get() {
  1022. return this._getProp(key);
  1023. },
  1024. set(val) {
  1025. this._setProp(key, val, true, true);
  1026. }
  1027. });
  1028. }
  1029. }
  1030. _setAttr(key) {
  1031. if (key.startsWith("data-v-")) return;
  1032. const has = this.hasAttribute(key);
  1033. let value = has ? this.getAttribute(key) : REMOVAL;
  1034. const camelKey = camelize$1(key);
  1035. if (has && this._numberProps && this._numberProps[camelKey]) {
  1036. value = toNumber(value);
  1037. }
  1038. this._setProp(camelKey, value, false, true);
  1039. }
  1040. /**
  1041. * @internal
  1042. */
  1043. _getProp(key) {
  1044. return this._props[key];
  1045. }
  1046. /**
  1047. * @internal
  1048. */
  1049. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  1050. if (val !== this._props[key]) {
  1051. if (val === REMOVAL) {
  1052. delete this._props[key];
  1053. } else {
  1054. this._props[key] = val;
  1055. if (key === "key" && this._app) {
  1056. this._app._ceVNode.key = val;
  1057. }
  1058. }
  1059. if (shouldUpdate && this._instance) {
  1060. this._update();
  1061. }
  1062. if (shouldReflect) {
  1063. const ob = this._ob;
  1064. ob && ob.disconnect();
  1065. if (val === true) {
  1066. this.setAttribute(hyphenate(key), "");
  1067. } else if (typeof val === "string" || typeof val === "number") {
  1068. this.setAttribute(hyphenate(key), val + "");
  1069. } else if (!val) {
  1070. this.removeAttribute(hyphenate(key));
  1071. }
  1072. ob && ob.observe(this, { attributes: true });
  1073. }
  1074. }
  1075. }
  1076. _update() {
  1077. const vnode = this._createVNode();
  1078. if (this._app) vnode.appContext = this._app._context;
  1079. render(vnode, this._root);
  1080. }
  1081. _createVNode() {
  1082. const baseProps = {};
  1083. if (!this.shadowRoot) {
  1084. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  1085. }
  1086. const vnode = createVNode(this._def, extend(baseProps, this._props));
  1087. if (!this._instance) {
  1088. vnode.ce = (instance) => {
  1089. this._instance = instance;
  1090. instance.ce = this;
  1091. instance.isCE = true;
  1092. if (!!(process.env.NODE_ENV !== "production")) {
  1093. instance.ceReload = (newStyles) => {
  1094. if (this._styles) {
  1095. this._styles.forEach((s) => this._root.removeChild(s));
  1096. this._styles.length = 0;
  1097. }
  1098. this._applyStyles(newStyles);
  1099. this._instance = null;
  1100. this._update();
  1101. };
  1102. }
  1103. const dispatch = (event, args) => {
  1104. this.dispatchEvent(
  1105. new CustomEvent(
  1106. event,
  1107. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  1108. )
  1109. );
  1110. };
  1111. instance.emit = (event, ...args) => {
  1112. dispatch(event, args);
  1113. if (hyphenate(event) !== event) {
  1114. dispatch(hyphenate(event), args);
  1115. }
  1116. };
  1117. this._setParent();
  1118. };
  1119. }
  1120. return vnode;
  1121. }
  1122. _applyStyles(styles, owner) {
  1123. if (!styles) return;
  1124. if (owner) {
  1125. if (owner === this._def || this._styleChildren.has(owner)) {
  1126. return;
  1127. }
  1128. this._styleChildren.add(owner);
  1129. }
  1130. const nonce = this._nonce;
  1131. for (let i = styles.length - 1; i >= 0; i--) {
  1132. const s = document.createElement("style");
  1133. if (nonce) s.setAttribute("nonce", nonce);
  1134. s.textContent = styles[i];
  1135. this.shadowRoot.prepend(s);
  1136. if (!!(process.env.NODE_ENV !== "production")) {
  1137. if (owner) {
  1138. if (owner.__hmrId) {
  1139. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  1140. let entry = this._childStyles.get(owner.__hmrId);
  1141. if (!entry) {
  1142. this._childStyles.set(owner.__hmrId, entry = []);
  1143. }
  1144. entry.push(s);
  1145. }
  1146. } else {
  1147. (this._styles || (this._styles = [])).push(s);
  1148. }
  1149. }
  1150. }
  1151. }
  1152. /**
  1153. * Only called when shadowRoot is false
  1154. */
  1155. _parseSlots() {
  1156. const slots = this._slots = {};
  1157. let n;
  1158. while (n = this.firstChild) {
  1159. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  1160. (slots[slotName] || (slots[slotName] = [])).push(n);
  1161. this.removeChild(n);
  1162. }
  1163. }
  1164. /**
  1165. * Only called when shadowRoot is false
  1166. */
  1167. _renderSlots() {
  1168. const outlets = (this._teleportTarget || this).querySelectorAll("slot");
  1169. const scopeId = this._instance.type.__scopeId;
  1170. for (let i = 0; i < outlets.length; i++) {
  1171. const o = outlets[i];
  1172. const slotName = o.getAttribute("name") || "default";
  1173. const content = this._slots[slotName];
  1174. const parent = o.parentNode;
  1175. if (content) {
  1176. for (const n of content) {
  1177. if (scopeId && n.nodeType === 1) {
  1178. const id = scopeId + "-s";
  1179. const walker = document.createTreeWalker(n, 1);
  1180. n.setAttribute(id, "");
  1181. let child;
  1182. while (child = walker.nextNode()) {
  1183. child.setAttribute(id, "");
  1184. }
  1185. }
  1186. parent.insertBefore(n, o);
  1187. }
  1188. } else {
  1189. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  1190. }
  1191. parent.removeChild(o);
  1192. }
  1193. }
  1194. /**
  1195. * @internal
  1196. */
  1197. _injectChildStyle(comp) {
  1198. this._applyStyles(comp.styles, comp);
  1199. }
  1200. /**
  1201. * @internal
  1202. */
  1203. _removeChildStyle(comp) {
  1204. if (!!(process.env.NODE_ENV !== "production")) {
  1205. this._styleChildren.delete(comp);
  1206. if (this._childStyles && comp.__hmrId) {
  1207. const oldStyles = this._childStyles.get(comp.__hmrId);
  1208. if (oldStyles) {
  1209. oldStyles.forEach((s) => this._root.removeChild(s));
  1210. oldStyles.length = 0;
  1211. }
  1212. }
  1213. }
  1214. }
  1215. }
  1216. function useHost(caller) {
  1217. const instance = getCurrentInstance();
  1218. const el = instance && instance.ce;
  1219. if (el) {
  1220. return el;
  1221. } else if (!!(process.env.NODE_ENV !== "production")) {
  1222. if (!instance) {
  1223. warn(
  1224. `${caller || "useHost"} called without an active component instance.`
  1225. );
  1226. } else {
  1227. warn(
  1228. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  1229. );
  1230. }
  1231. }
  1232. return null;
  1233. }
  1234. function useShadowRoot() {
  1235. const el = !!(process.env.NODE_ENV !== "production") ? useHost("useShadowRoot") : useHost();
  1236. return el && el.shadowRoot;
  1237. }
  1238. function useCssModule(name = "$style") {
  1239. {
  1240. const instance = getCurrentInstance();
  1241. if (!instance) {
  1242. !!(process.env.NODE_ENV !== "production") && warn(`useCssModule must be called inside setup()`);
  1243. return EMPTY_OBJ;
  1244. }
  1245. const modules = instance.type.__cssModules;
  1246. if (!modules) {
  1247. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS modules injected.`);
  1248. return EMPTY_OBJ;
  1249. }
  1250. const mod = modules[name];
  1251. if (!mod) {
  1252. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS module named "${name}".`);
  1253. return EMPTY_OBJ;
  1254. }
  1255. return mod;
  1256. }
  1257. }
  1258. const positionMap = /* @__PURE__ */ new WeakMap();
  1259. const newPositionMap = /* @__PURE__ */ new WeakMap();
  1260. const moveCbKey = Symbol("_moveCb");
  1261. const enterCbKey = Symbol("_enterCb");
  1262. const decorate = (t) => {
  1263. delete t.props.mode;
  1264. return t;
  1265. };
  1266. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  1267. name: "TransitionGroup",
  1268. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  1269. tag: String,
  1270. moveClass: String
  1271. }),
  1272. setup(props, { slots }) {
  1273. const instance = getCurrentInstance();
  1274. const state = useTransitionState();
  1275. let prevChildren;
  1276. let children;
  1277. onUpdated(() => {
  1278. if (!prevChildren.length) {
  1279. return;
  1280. }
  1281. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  1282. if (!hasCSSTransform(
  1283. prevChildren[0].el,
  1284. instance.vnode.el,
  1285. moveClass
  1286. )) {
  1287. prevChildren = [];
  1288. return;
  1289. }
  1290. prevChildren.forEach(callPendingCbs);
  1291. prevChildren.forEach(recordPosition);
  1292. const movedChildren = prevChildren.filter(applyTranslation);
  1293. forceReflow();
  1294. movedChildren.forEach((c) => {
  1295. const el = c.el;
  1296. const style = el.style;
  1297. addTransitionClass(el, moveClass);
  1298. style.transform = style.webkitTransform = style.transitionDuration = "";
  1299. const cb = el[moveCbKey] = (e) => {
  1300. if (e && e.target !== el) {
  1301. return;
  1302. }
  1303. if (!e || /transform$/.test(e.propertyName)) {
  1304. el.removeEventListener("transitionend", cb);
  1305. el[moveCbKey] = null;
  1306. removeTransitionClass(el, moveClass);
  1307. }
  1308. };
  1309. el.addEventListener("transitionend", cb);
  1310. });
  1311. prevChildren = [];
  1312. });
  1313. return () => {
  1314. const rawProps = toRaw(props);
  1315. const cssTransitionProps = resolveTransitionProps(rawProps);
  1316. let tag = rawProps.tag || Fragment;
  1317. prevChildren = [];
  1318. if (children) {
  1319. for (let i = 0; i < children.length; i++) {
  1320. const child = children[i];
  1321. if (child.el && child.el instanceof Element) {
  1322. prevChildren.push(child);
  1323. setTransitionHooks(
  1324. child,
  1325. resolveTransitionHooks(
  1326. child,
  1327. cssTransitionProps,
  1328. state,
  1329. instance
  1330. )
  1331. );
  1332. positionMap.set(
  1333. child,
  1334. child.el.getBoundingClientRect()
  1335. );
  1336. }
  1337. }
  1338. }
  1339. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  1340. for (let i = 0; i < children.length; i++) {
  1341. const child = children[i];
  1342. if (child.key != null) {
  1343. setTransitionHooks(
  1344. child,
  1345. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  1346. );
  1347. } else if (!!(process.env.NODE_ENV !== "production") && child.type !== Text) {
  1348. warn(`<TransitionGroup> children must be keyed.`);
  1349. }
  1350. }
  1351. return createVNode(tag, null, children);
  1352. };
  1353. }
  1354. });
  1355. const TransitionGroup = TransitionGroupImpl;
  1356. function callPendingCbs(c) {
  1357. const el = c.el;
  1358. if (el[moveCbKey]) {
  1359. el[moveCbKey]();
  1360. }
  1361. if (el[enterCbKey]) {
  1362. el[enterCbKey]();
  1363. }
  1364. }
  1365. function recordPosition(c) {
  1366. newPositionMap.set(c, c.el.getBoundingClientRect());
  1367. }
  1368. function applyTranslation(c) {
  1369. const oldPos = positionMap.get(c);
  1370. const newPos = newPositionMap.get(c);
  1371. const dx = oldPos.left - newPos.left;
  1372. const dy = oldPos.top - newPos.top;
  1373. if (dx || dy) {
  1374. const s = c.el.style;
  1375. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  1376. s.transitionDuration = "0s";
  1377. return c;
  1378. }
  1379. }
  1380. function hasCSSTransform(el, root, moveClass) {
  1381. const clone = el.cloneNode();
  1382. const _vtc = el[vtcKey];
  1383. if (_vtc) {
  1384. _vtc.forEach((cls) => {
  1385. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  1386. });
  1387. }
  1388. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  1389. clone.style.display = "none";
  1390. const container = root.nodeType === 1 ? root : root.parentNode;
  1391. container.appendChild(clone);
  1392. const { hasTransform } = getTransitionInfo(clone);
  1393. container.removeChild(clone);
  1394. return hasTransform;
  1395. }
  1396. const getModelAssigner = (vnode) => {
  1397. const fn = vnode.props["onUpdate:modelValue"] || false;
  1398. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  1399. };
  1400. function onCompositionStart(e) {
  1401. e.target.composing = true;
  1402. }
  1403. function onCompositionEnd(e) {
  1404. const target = e.target;
  1405. if (target.composing) {
  1406. target.composing = false;
  1407. target.dispatchEvent(new Event("input"));
  1408. }
  1409. }
  1410. const assignKey = Symbol("_assign");
  1411. const vModelText = {
  1412. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  1413. el[assignKey] = getModelAssigner(vnode);
  1414. const castToNumber = number || vnode.props && vnode.props.type === "number";
  1415. addEventListener(el, lazy ? "change" : "input", (e) => {
  1416. if (e.target.composing) return;
  1417. let domValue = el.value;
  1418. if (trim) {
  1419. domValue = domValue.trim();
  1420. }
  1421. if (castToNumber) {
  1422. domValue = looseToNumber(domValue);
  1423. }
  1424. el[assignKey](domValue);
  1425. });
  1426. if (trim) {
  1427. addEventListener(el, "change", () => {
  1428. el.value = el.value.trim();
  1429. });
  1430. }
  1431. if (!lazy) {
  1432. addEventListener(el, "compositionstart", onCompositionStart);
  1433. addEventListener(el, "compositionend", onCompositionEnd);
  1434. addEventListener(el, "change", onCompositionEnd);
  1435. }
  1436. },
  1437. // set value on mounted so it's after min/max for type="range"
  1438. mounted(el, { value }) {
  1439. el.value = value == null ? "" : value;
  1440. },
  1441. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  1442. el[assignKey] = getModelAssigner(vnode);
  1443. if (el.composing) return;
  1444. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  1445. const newValue = value == null ? "" : value;
  1446. if (elValue === newValue) {
  1447. return;
  1448. }
  1449. if (document.activeElement === el && el.type !== "range") {
  1450. if (lazy && value === oldValue) {
  1451. return;
  1452. }
  1453. if (trim && el.value.trim() === newValue) {
  1454. return;
  1455. }
  1456. }
  1457. el.value = newValue;
  1458. }
  1459. };
  1460. const vModelCheckbox = {
  1461. // #4096 array checkboxes need to be deep traversed
  1462. deep: true,
  1463. created(el, _, vnode) {
  1464. el[assignKey] = getModelAssigner(vnode);
  1465. addEventListener(el, "change", () => {
  1466. const modelValue = el._modelValue;
  1467. const elementValue = getValue(el);
  1468. const checked = el.checked;
  1469. const assign = el[assignKey];
  1470. if (isArray(modelValue)) {
  1471. const index = looseIndexOf(modelValue, elementValue);
  1472. const found = index !== -1;
  1473. if (checked && !found) {
  1474. assign(modelValue.concat(elementValue));
  1475. } else if (!checked && found) {
  1476. const filtered = [...modelValue];
  1477. filtered.splice(index, 1);
  1478. assign(filtered);
  1479. }
  1480. } else if (isSet(modelValue)) {
  1481. const cloned = new Set(modelValue);
  1482. if (checked) {
  1483. cloned.add(elementValue);
  1484. } else {
  1485. cloned.delete(elementValue);
  1486. }
  1487. assign(cloned);
  1488. } else {
  1489. assign(getCheckboxValue(el, checked));
  1490. }
  1491. });
  1492. },
  1493. // set initial checked on mount to wait for true-value/false-value
  1494. mounted: setChecked,
  1495. beforeUpdate(el, binding, vnode) {
  1496. el[assignKey] = getModelAssigner(vnode);
  1497. setChecked(el, binding, vnode);
  1498. }
  1499. };
  1500. function setChecked(el, { value, oldValue }, vnode) {
  1501. el._modelValue = value;
  1502. let checked;
  1503. if (isArray(value)) {
  1504. checked = looseIndexOf(value, vnode.props.value) > -1;
  1505. } else if (isSet(value)) {
  1506. checked = value.has(vnode.props.value);
  1507. } else {
  1508. if (value === oldValue) return;
  1509. checked = looseEqual(value, getCheckboxValue(el, true));
  1510. }
  1511. if (el.checked !== checked) {
  1512. el.checked = checked;
  1513. }
  1514. }
  1515. const vModelRadio = {
  1516. created(el, { value }, vnode) {
  1517. el.checked = looseEqual(value, vnode.props.value);
  1518. el[assignKey] = getModelAssigner(vnode);
  1519. addEventListener(el, "change", () => {
  1520. el[assignKey](getValue(el));
  1521. });
  1522. },
  1523. beforeUpdate(el, { value, oldValue }, vnode) {
  1524. el[assignKey] = getModelAssigner(vnode);
  1525. if (value !== oldValue) {
  1526. el.checked = looseEqual(value, vnode.props.value);
  1527. }
  1528. }
  1529. };
  1530. const vModelSelect = {
  1531. // <select multiple> value need to be deep traversed
  1532. deep: true,
  1533. created(el, { value, modifiers: { number } }, vnode) {
  1534. const isSetModel = isSet(value);
  1535. addEventListener(el, "change", () => {
  1536. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  1537. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  1538. );
  1539. el[assignKey](
  1540. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  1541. );
  1542. el._assigning = true;
  1543. nextTick(() => {
  1544. el._assigning = false;
  1545. });
  1546. });
  1547. el[assignKey] = getModelAssigner(vnode);
  1548. },
  1549. // set value in mounted & updated because <select> relies on its children
  1550. // <option>s.
  1551. mounted(el, { value }) {
  1552. setSelected(el, value);
  1553. },
  1554. beforeUpdate(el, _binding, vnode) {
  1555. el[assignKey] = getModelAssigner(vnode);
  1556. },
  1557. updated(el, { value }) {
  1558. if (!el._assigning) {
  1559. setSelected(el, value);
  1560. }
  1561. }
  1562. };
  1563. function setSelected(el, value) {
  1564. const isMultiple = el.multiple;
  1565. const isArrayValue = isArray(value);
  1566. if (isMultiple && !isArrayValue && !isSet(value)) {
  1567. !!(process.env.NODE_ENV !== "production") && warn(
  1568. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  1569. );
  1570. return;
  1571. }
  1572. for (let i = 0, l = el.options.length; i < l; i++) {
  1573. const option = el.options[i];
  1574. const optionValue = getValue(option);
  1575. if (isMultiple) {
  1576. if (isArrayValue) {
  1577. const optionType = typeof optionValue;
  1578. if (optionType === "string" || optionType === "number") {
  1579. option.selected = value.some((v) => String(v) === String(optionValue));
  1580. } else {
  1581. option.selected = looseIndexOf(value, optionValue) > -1;
  1582. }
  1583. } else {
  1584. option.selected = value.has(optionValue);
  1585. }
  1586. } else if (looseEqual(getValue(option), value)) {
  1587. if (el.selectedIndex !== i) el.selectedIndex = i;
  1588. return;
  1589. }
  1590. }
  1591. if (!isMultiple && el.selectedIndex !== -1) {
  1592. el.selectedIndex = -1;
  1593. }
  1594. }
  1595. function getValue(el) {
  1596. return "_value" in el ? el._value : el.value;
  1597. }
  1598. function getCheckboxValue(el, checked) {
  1599. const key = checked ? "_trueValue" : "_falseValue";
  1600. return key in el ? el[key] : checked;
  1601. }
  1602. const vModelDynamic = {
  1603. created(el, binding, vnode) {
  1604. callModelHook(el, binding, vnode, null, "created");
  1605. },
  1606. mounted(el, binding, vnode) {
  1607. callModelHook(el, binding, vnode, null, "mounted");
  1608. },
  1609. beforeUpdate(el, binding, vnode, prevVNode) {
  1610. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  1611. },
  1612. updated(el, binding, vnode, prevVNode) {
  1613. callModelHook(el, binding, vnode, prevVNode, "updated");
  1614. }
  1615. };
  1616. function resolveDynamicModel(tagName, type) {
  1617. switch (tagName) {
  1618. case "SELECT":
  1619. return vModelSelect;
  1620. case "TEXTAREA":
  1621. return vModelText;
  1622. default:
  1623. switch (type) {
  1624. case "checkbox":
  1625. return vModelCheckbox;
  1626. case "radio":
  1627. return vModelRadio;
  1628. default:
  1629. return vModelText;
  1630. }
  1631. }
  1632. }
  1633. function callModelHook(el, binding, vnode, prevVNode, hook) {
  1634. const modelToUse = resolveDynamicModel(
  1635. el.tagName,
  1636. vnode.props && vnode.props.type
  1637. );
  1638. const fn = modelToUse[hook];
  1639. fn && fn(el, binding, vnode, prevVNode);
  1640. }
  1641. function initVModelForSSR() {
  1642. vModelText.getSSRProps = ({ value }) => ({ value });
  1643. vModelRadio.getSSRProps = ({ value }, vnode) => {
  1644. if (vnode.props && looseEqual(vnode.props.value, value)) {
  1645. return { checked: true };
  1646. }
  1647. };
  1648. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  1649. if (isArray(value)) {
  1650. if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {
  1651. return { checked: true };
  1652. }
  1653. } else if (isSet(value)) {
  1654. if (vnode.props && value.has(vnode.props.value)) {
  1655. return { checked: true };
  1656. }
  1657. } else if (value) {
  1658. return { checked: true };
  1659. }
  1660. };
  1661. vModelDynamic.getSSRProps = (binding, vnode) => {
  1662. if (typeof vnode.type !== "string") {
  1663. return;
  1664. }
  1665. const modelToUse = resolveDynamicModel(
  1666. // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
  1667. vnode.type.toUpperCase(),
  1668. vnode.props && vnode.props.type
  1669. );
  1670. if (modelToUse.getSSRProps) {
  1671. return modelToUse.getSSRProps(binding, vnode);
  1672. }
  1673. };
  1674. }
  1675. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  1676. const modifierGuards = {
  1677. stop: (e) => e.stopPropagation(),
  1678. prevent: (e) => e.preventDefault(),
  1679. self: (e) => e.target !== e.currentTarget,
  1680. ctrl: (e) => !e.ctrlKey,
  1681. shift: (e) => !e.shiftKey,
  1682. alt: (e) => !e.altKey,
  1683. meta: (e) => !e.metaKey,
  1684. left: (e) => "button" in e && e.button !== 0,
  1685. middle: (e) => "button" in e && e.button !== 1,
  1686. right: (e) => "button" in e && e.button !== 2,
  1687. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  1688. };
  1689. const withModifiers = (fn, modifiers) => {
  1690. const cache = fn._withMods || (fn._withMods = {});
  1691. const cacheKey = modifiers.join(".");
  1692. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  1693. for (let i = 0; i < modifiers.length; i++) {
  1694. const guard = modifierGuards[modifiers[i]];
  1695. if (guard && guard(event, modifiers)) return;
  1696. }
  1697. return fn(event, ...args);
  1698. });
  1699. };
  1700. const keyNames = {
  1701. esc: "escape",
  1702. space: " ",
  1703. up: "arrow-up",
  1704. left: "arrow-left",
  1705. right: "arrow-right",
  1706. down: "arrow-down",
  1707. delete: "backspace"
  1708. };
  1709. const withKeys = (fn, modifiers) => {
  1710. const cache = fn._withKeys || (fn._withKeys = {});
  1711. const cacheKey = modifiers.join(".");
  1712. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  1713. if (!("key" in event)) {
  1714. return;
  1715. }
  1716. const eventKey = hyphenate(event.key);
  1717. if (modifiers.some(
  1718. (k) => k === eventKey || keyNames[k] === eventKey
  1719. )) {
  1720. return fn(event);
  1721. }
  1722. });
  1723. };
  1724. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  1725. let renderer;
  1726. let enabledHydration = false;
  1727. function ensureRenderer() {
  1728. return renderer || (renderer = createRenderer(rendererOptions));
  1729. }
  1730. function ensureHydrationRenderer() {
  1731. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  1732. enabledHydration = true;
  1733. return renderer;
  1734. }
  1735. const render = (...args) => {
  1736. ensureRenderer().render(...args);
  1737. };
  1738. const hydrate = (...args) => {
  1739. ensureHydrationRenderer().hydrate(...args);
  1740. };
  1741. const createApp = (...args) => {
  1742. const app = ensureRenderer().createApp(...args);
  1743. if (!!(process.env.NODE_ENV !== "production")) {
  1744. injectNativeTagCheck(app);
  1745. injectCompilerOptionsCheck(app);
  1746. }
  1747. const { mount } = app;
  1748. app.mount = (containerOrSelector) => {
  1749. const container = normalizeContainer(containerOrSelector);
  1750. if (!container) return;
  1751. const component = app._component;
  1752. if (!isFunction(component) && !component.render && !component.template) {
  1753. component.template = container.innerHTML;
  1754. }
  1755. if (container.nodeType === 1) {
  1756. container.textContent = "";
  1757. }
  1758. const proxy = mount(container, false, resolveRootNamespace(container));
  1759. if (container instanceof Element) {
  1760. container.removeAttribute("v-cloak");
  1761. container.setAttribute("data-v-app", "");
  1762. }
  1763. return proxy;
  1764. };
  1765. return app;
  1766. };
  1767. const createSSRApp = (...args) => {
  1768. const app = ensureHydrationRenderer().createApp(...args);
  1769. if (!!(process.env.NODE_ENV !== "production")) {
  1770. injectNativeTagCheck(app);
  1771. injectCompilerOptionsCheck(app);
  1772. }
  1773. const { mount } = app;
  1774. app.mount = (containerOrSelector) => {
  1775. const container = normalizeContainer(containerOrSelector);
  1776. if (container) {
  1777. return mount(container, true, resolveRootNamespace(container));
  1778. }
  1779. };
  1780. return app;
  1781. };
  1782. function resolveRootNamespace(container) {
  1783. if (container instanceof SVGElement) {
  1784. return "svg";
  1785. }
  1786. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  1787. return "mathml";
  1788. }
  1789. }
  1790. function injectNativeTagCheck(app) {
  1791. Object.defineProperty(app.config, "isNativeTag", {
  1792. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  1793. writable: false
  1794. });
  1795. }
  1796. function injectCompilerOptionsCheck(app) {
  1797. if (isRuntimeOnly()) {
  1798. const isCustomElement = app.config.isCustomElement;
  1799. Object.defineProperty(app.config, "isCustomElement", {
  1800. get() {
  1801. return isCustomElement;
  1802. },
  1803. set() {
  1804. warn(
  1805. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  1806. );
  1807. }
  1808. });
  1809. const compilerOptions = app.config.compilerOptions;
  1810. const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
  1811. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  1812. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  1813. - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
  1814. Object.defineProperty(app.config, "compilerOptions", {
  1815. get() {
  1816. warn(msg);
  1817. return compilerOptions;
  1818. },
  1819. set() {
  1820. warn(msg);
  1821. }
  1822. });
  1823. }
  1824. }
  1825. function normalizeContainer(container) {
  1826. if (isString(container)) {
  1827. const res = document.querySelector(container);
  1828. if (!!(process.env.NODE_ENV !== "production") && !res) {
  1829. warn(
  1830. `Failed to mount app: mount target selector "${container}" returned null.`
  1831. );
  1832. }
  1833. return res;
  1834. }
  1835. if (!!(process.env.NODE_ENV !== "production") && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  1836. warn(
  1837. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  1838. );
  1839. }
  1840. return container;
  1841. }
  1842. let ssrDirectiveInitialized = false;
  1843. const initDirectivesForSSR = () => {
  1844. if (!ssrDirectiveInitialized) {
  1845. ssrDirectiveInitialized = true;
  1846. initVModelForSSR();
  1847. initVShowForSSR();
  1848. }
  1849. } ;
  1850. export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, render, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };