runtime-dom.esm-bundler.js 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860
  1. /**
  2. * @vue/runtime-dom v3.5.13
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. import { warn, h, BaseTransition, assertNumber, BaseTransitionPropsValidators, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core';
  7. export * from '@vue/runtime-core';
  8. import { extend, isObject, toNumber, isArray, NOOP, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, 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") {
  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. if (!this._def.__asyncLoader) {
  879. this._resolveProps(this._def);
  880. }
  881. }
  882. connectedCallback() {
  883. if (!this.isConnected) return;
  884. if (!this.shadowRoot) {
  885. this._parseSlots();
  886. }
  887. this._connected = true;
  888. let parent = this;
  889. while (parent = parent && (parent.parentNode || parent.host)) {
  890. if (parent instanceof VueElement) {
  891. this._parent = parent;
  892. break;
  893. }
  894. }
  895. if (!this._instance) {
  896. if (this._resolved) {
  897. this._setParent();
  898. this._update();
  899. } else {
  900. if (parent && parent._pendingResolve) {
  901. this._pendingResolve = parent._pendingResolve.then(() => {
  902. this._pendingResolve = void 0;
  903. this._resolveDef();
  904. });
  905. } else {
  906. this._resolveDef();
  907. }
  908. }
  909. }
  910. }
  911. _setParent(parent = this._parent) {
  912. if (parent) {
  913. this._instance.parent = parent._instance;
  914. this._instance.provides = parent._instance.provides;
  915. }
  916. }
  917. disconnectedCallback() {
  918. this._connected = false;
  919. nextTick(() => {
  920. if (!this._connected) {
  921. if (this._ob) {
  922. this._ob.disconnect();
  923. this._ob = null;
  924. }
  925. this._app && this._app.unmount();
  926. if (this._instance) this._instance.ce = void 0;
  927. this._app = this._instance = null;
  928. }
  929. });
  930. }
  931. /**
  932. * resolve inner component definition (handle possible async component)
  933. */
  934. _resolveDef() {
  935. if (this._pendingResolve) {
  936. return;
  937. }
  938. for (let i = 0; i < this.attributes.length; i++) {
  939. this._setAttr(this.attributes[i].name);
  940. }
  941. this._ob = new MutationObserver((mutations) => {
  942. for (const m of mutations) {
  943. this._setAttr(m.attributeName);
  944. }
  945. });
  946. this._ob.observe(this, { attributes: true });
  947. const resolve = (def, isAsync = false) => {
  948. this._resolved = true;
  949. this._pendingResolve = void 0;
  950. const { props, styles } = def;
  951. let numberProps;
  952. if (props && !isArray(props)) {
  953. for (const key in props) {
  954. const opt = props[key];
  955. if (opt === Number || opt && opt.type === Number) {
  956. if (key in this._props) {
  957. this._props[key] = toNumber(this._props[key]);
  958. }
  959. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize$1(key)] = true;
  960. }
  961. }
  962. }
  963. this._numberProps = numberProps;
  964. if (isAsync) {
  965. this._resolveProps(def);
  966. }
  967. if (this.shadowRoot) {
  968. this._applyStyles(styles);
  969. } else if (!!(process.env.NODE_ENV !== "production") && styles) {
  970. warn(
  971. "Custom element style injection is not supported when using shadowRoot: false"
  972. );
  973. }
  974. this._mount(def);
  975. };
  976. const asyncDef = this._def.__asyncLoader;
  977. if (asyncDef) {
  978. this._pendingResolve = asyncDef().then(
  979. (def) => resolve(this._def = def, true)
  980. );
  981. } else {
  982. resolve(this._def);
  983. }
  984. }
  985. _mount(def) {
  986. if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def.name) {
  987. def.name = "VueElement";
  988. }
  989. this._app = this._createApp(def);
  990. if (def.configureApp) {
  991. def.configureApp(this._app);
  992. }
  993. this._app._ceVNode = this._createVNode();
  994. this._app.mount(this._root);
  995. const exposed = this._instance && this._instance.exposed;
  996. if (!exposed) return;
  997. for (const key in exposed) {
  998. if (!hasOwn(this, key)) {
  999. Object.defineProperty(this, key, {
  1000. // unwrap ref to be consistent with public instance behavior
  1001. get: () => unref(exposed[key])
  1002. });
  1003. } else if (!!(process.env.NODE_ENV !== "production")) {
  1004. warn(`Exposed property "${key}" already exists on custom element.`);
  1005. }
  1006. }
  1007. }
  1008. _resolveProps(def) {
  1009. const { props } = def;
  1010. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  1011. for (const key of Object.keys(this)) {
  1012. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  1013. this._setProp(key, this[key]);
  1014. }
  1015. }
  1016. for (const key of declaredPropKeys.map(camelize$1)) {
  1017. Object.defineProperty(this, key, {
  1018. get() {
  1019. return this._getProp(key);
  1020. },
  1021. set(val) {
  1022. this._setProp(key, val, true, true);
  1023. }
  1024. });
  1025. }
  1026. }
  1027. _setAttr(key) {
  1028. if (key.startsWith("data-v-")) return;
  1029. const has = this.hasAttribute(key);
  1030. let value = has ? this.getAttribute(key) : REMOVAL;
  1031. const camelKey = camelize$1(key);
  1032. if (has && this._numberProps && this._numberProps[camelKey]) {
  1033. value = toNumber(value);
  1034. }
  1035. this._setProp(camelKey, value, false, true);
  1036. }
  1037. /**
  1038. * @internal
  1039. */
  1040. _getProp(key) {
  1041. return this._props[key];
  1042. }
  1043. /**
  1044. * @internal
  1045. */
  1046. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  1047. if (val !== this._props[key]) {
  1048. if (val === REMOVAL) {
  1049. delete this._props[key];
  1050. } else {
  1051. this._props[key] = val;
  1052. if (key === "key" && this._app) {
  1053. this._app._ceVNode.key = val;
  1054. }
  1055. }
  1056. if (shouldUpdate && this._instance) {
  1057. this._update();
  1058. }
  1059. if (shouldReflect) {
  1060. const ob = this._ob;
  1061. ob && ob.disconnect();
  1062. if (val === true) {
  1063. this.setAttribute(hyphenate(key), "");
  1064. } else if (typeof val === "string" || typeof val === "number") {
  1065. this.setAttribute(hyphenate(key), val + "");
  1066. } else if (!val) {
  1067. this.removeAttribute(hyphenate(key));
  1068. }
  1069. ob && ob.observe(this, { attributes: true });
  1070. }
  1071. }
  1072. }
  1073. _update() {
  1074. render(this._createVNode(), this._root);
  1075. }
  1076. _createVNode() {
  1077. const baseProps = {};
  1078. if (!this.shadowRoot) {
  1079. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  1080. }
  1081. const vnode = createVNode(this._def, extend(baseProps, this._props));
  1082. if (!this._instance) {
  1083. vnode.ce = (instance) => {
  1084. this._instance = instance;
  1085. instance.ce = this;
  1086. instance.isCE = true;
  1087. if (!!(process.env.NODE_ENV !== "production")) {
  1088. instance.ceReload = (newStyles) => {
  1089. if (this._styles) {
  1090. this._styles.forEach((s) => this._root.removeChild(s));
  1091. this._styles.length = 0;
  1092. }
  1093. this._applyStyles(newStyles);
  1094. this._instance = null;
  1095. this._update();
  1096. };
  1097. }
  1098. const dispatch = (event, args) => {
  1099. this.dispatchEvent(
  1100. new CustomEvent(
  1101. event,
  1102. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  1103. )
  1104. );
  1105. };
  1106. instance.emit = (event, ...args) => {
  1107. dispatch(event, args);
  1108. if (hyphenate(event) !== event) {
  1109. dispatch(hyphenate(event), args);
  1110. }
  1111. };
  1112. this._setParent();
  1113. };
  1114. }
  1115. return vnode;
  1116. }
  1117. _applyStyles(styles, owner) {
  1118. if (!styles) return;
  1119. if (owner) {
  1120. if (owner === this._def || this._styleChildren.has(owner)) {
  1121. return;
  1122. }
  1123. this._styleChildren.add(owner);
  1124. }
  1125. const nonce = this._nonce;
  1126. for (let i = styles.length - 1; i >= 0; i--) {
  1127. const s = document.createElement("style");
  1128. if (nonce) s.setAttribute("nonce", nonce);
  1129. s.textContent = styles[i];
  1130. this.shadowRoot.prepend(s);
  1131. if (!!(process.env.NODE_ENV !== "production")) {
  1132. if (owner) {
  1133. if (owner.__hmrId) {
  1134. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  1135. let entry = this._childStyles.get(owner.__hmrId);
  1136. if (!entry) {
  1137. this._childStyles.set(owner.__hmrId, entry = []);
  1138. }
  1139. entry.push(s);
  1140. }
  1141. } else {
  1142. (this._styles || (this._styles = [])).push(s);
  1143. }
  1144. }
  1145. }
  1146. }
  1147. /**
  1148. * Only called when shadowRoot is false
  1149. */
  1150. _parseSlots() {
  1151. const slots = this._slots = {};
  1152. let n;
  1153. while (n = this.firstChild) {
  1154. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  1155. (slots[slotName] || (slots[slotName] = [])).push(n);
  1156. this.removeChild(n);
  1157. }
  1158. }
  1159. /**
  1160. * Only called when shadowRoot is false
  1161. */
  1162. _renderSlots() {
  1163. const outlets = (this._teleportTarget || this).querySelectorAll("slot");
  1164. const scopeId = this._instance.type.__scopeId;
  1165. for (let i = 0; i < outlets.length; i++) {
  1166. const o = outlets[i];
  1167. const slotName = o.getAttribute("name") || "default";
  1168. const content = this._slots[slotName];
  1169. const parent = o.parentNode;
  1170. if (content) {
  1171. for (const n of content) {
  1172. if (scopeId && n.nodeType === 1) {
  1173. const id = scopeId + "-s";
  1174. const walker = document.createTreeWalker(n, 1);
  1175. n.setAttribute(id, "");
  1176. let child;
  1177. while (child = walker.nextNode()) {
  1178. child.setAttribute(id, "");
  1179. }
  1180. }
  1181. parent.insertBefore(n, o);
  1182. }
  1183. } else {
  1184. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  1185. }
  1186. parent.removeChild(o);
  1187. }
  1188. }
  1189. /**
  1190. * @internal
  1191. */
  1192. _injectChildStyle(comp) {
  1193. this._applyStyles(comp.styles, comp);
  1194. }
  1195. /**
  1196. * @internal
  1197. */
  1198. _removeChildStyle(comp) {
  1199. if (!!(process.env.NODE_ENV !== "production")) {
  1200. this._styleChildren.delete(comp);
  1201. if (this._childStyles && comp.__hmrId) {
  1202. const oldStyles = this._childStyles.get(comp.__hmrId);
  1203. if (oldStyles) {
  1204. oldStyles.forEach((s) => this._root.removeChild(s));
  1205. oldStyles.length = 0;
  1206. }
  1207. }
  1208. }
  1209. }
  1210. }
  1211. function useHost(caller) {
  1212. const instance = getCurrentInstance();
  1213. const el = instance && instance.ce;
  1214. if (el) {
  1215. return el;
  1216. } else if (!!(process.env.NODE_ENV !== "production")) {
  1217. if (!instance) {
  1218. warn(
  1219. `${caller || "useHost"} called without an active component instance.`
  1220. );
  1221. } else {
  1222. warn(
  1223. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  1224. );
  1225. }
  1226. }
  1227. return null;
  1228. }
  1229. function useShadowRoot() {
  1230. const el = !!(process.env.NODE_ENV !== "production") ? useHost("useShadowRoot") : useHost();
  1231. return el && el.shadowRoot;
  1232. }
  1233. function useCssModule(name = "$style") {
  1234. {
  1235. const instance = getCurrentInstance();
  1236. if (!instance) {
  1237. !!(process.env.NODE_ENV !== "production") && warn(`useCssModule must be called inside setup()`);
  1238. return EMPTY_OBJ;
  1239. }
  1240. const modules = instance.type.__cssModules;
  1241. if (!modules) {
  1242. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS modules injected.`);
  1243. return EMPTY_OBJ;
  1244. }
  1245. const mod = modules[name];
  1246. if (!mod) {
  1247. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS module named "${name}".`);
  1248. return EMPTY_OBJ;
  1249. }
  1250. return mod;
  1251. }
  1252. }
  1253. const positionMap = /* @__PURE__ */ new WeakMap();
  1254. const newPositionMap = /* @__PURE__ */ new WeakMap();
  1255. const moveCbKey = Symbol("_moveCb");
  1256. const enterCbKey = Symbol("_enterCb");
  1257. const decorate = (t) => {
  1258. delete t.props.mode;
  1259. return t;
  1260. };
  1261. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  1262. name: "TransitionGroup",
  1263. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  1264. tag: String,
  1265. moveClass: String
  1266. }),
  1267. setup(props, { slots }) {
  1268. const instance = getCurrentInstance();
  1269. const state = useTransitionState();
  1270. let prevChildren;
  1271. let children;
  1272. onUpdated(() => {
  1273. if (!prevChildren.length) {
  1274. return;
  1275. }
  1276. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  1277. if (!hasCSSTransform(
  1278. prevChildren[0].el,
  1279. instance.vnode.el,
  1280. moveClass
  1281. )) {
  1282. return;
  1283. }
  1284. prevChildren.forEach(callPendingCbs);
  1285. prevChildren.forEach(recordPosition);
  1286. const movedChildren = prevChildren.filter(applyTranslation);
  1287. forceReflow();
  1288. movedChildren.forEach((c) => {
  1289. const el = c.el;
  1290. const style = el.style;
  1291. addTransitionClass(el, moveClass);
  1292. style.transform = style.webkitTransform = style.transitionDuration = "";
  1293. const cb = el[moveCbKey] = (e) => {
  1294. if (e && e.target !== el) {
  1295. return;
  1296. }
  1297. if (!e || /transform$/.test(e.propertyName)) {
  1298. el.removeEventListener("transitionend", cb);
  1299. el[moveCbKey] = null;
  1300. removeTransitionClass(el, moveClass);
  1301. }
  1302. };
  1303. el.addEventListener("transitionend", cb);
  1304. });
  1305. });
  1306. return () => {
  1307. const rawProps = toRaw(props);
  1308. const cssTransitionProps = resolveTransitionProps(rawProps);
  1309. let tag = rawProps.tag || Fragment;
  1310. prevChildren = [];
  1311. if (children) {
  1312. for (let i = 0; i < children.length; i++) {
  1313. const child = children[i];
  1314. if (child.el && child.el instanceof Element) {
  1315. prevChildren.push(child);
  1316. setTransitionHooks(
  1317. child,
  1318. resolveTransitionHooks(
  1319. child,
  1320. cssTransitionProps,
  1321. state,
  1322. instance
  1323. )
  1324. );
  1325. positionMap.set(
  1326. child,
  1327. child.el.getBoundingClientRect()
  1328. );
  1329. }
  1330. }
  1331. }
  1332. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  1333. for (let i = 0; i < children.length; i++) {
  1334. const child = children[i];
  1335. if (child.key != null) {
  1336. setTransitionHooks(
  1337. child,
  1338. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  1339. );
  1340. } else if (!!(process.env.NODE_ENV !== "production") && child.type !== Text) {
  1341. warn(`<TransitionGroup> children must be keyed.`);
  1342. }
  1343. }
  1344. return createVNode(tag, null, children);
  1345. };
  1346. }
  1347. });
  1348. const TransitionGroup = TransitionGroupImpl;
  1349. function callPendingCbs(c) {
  1350. const el = c.el;
  1351. if (el[moveCbKey]) {
  1352. el[moveCbKey]();
  1353. }
  1354. if (el[enterCbKey]) {
  1355. el[enterCbKey]();
  1356. }
  1357. }
  1358. function recordPosition(c) {
  1359. newPositionMap.set(c, c.el.getBoundingClientRect());
  1360. }
  1361. function applyTranslation(c) {
  1362. const oldPos = positionMap.get(c);
  1363. const newPos = newPositionMap.get(c);
  1364. const dx = oldPos.left - newPos.left;
  1365. const dy = oldPos.top - newPos.top;
  1366. if (dx || dy) {
  1367. const s = c.el.style;
  1368. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  1369. s.transitionDuration = "0s";
  1370. return c;
  1371. }
  1372. }
  1373. function hasCSSTransform(el, root, moveClass) {
  1374. const clone = el.cloneNode();
  1375. const _vtc = el[vtcKey];
  1376. if (_vtc) {
  1377. _vtc.forEach((cls) => {
  1378. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  1379. });
  1380. }
  1381. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  1382. clone.style.display = "none";
  1383. const container = root.nodeType === 1 ? root : root.parentNode;
  1384. container.appendChild(clone);
  1385. const { hasTransform } = getTransitionInfo(clone);
  1386. container.removeChild(clone);
  1387. return hasTransform;
  1388. }
  1389. const getModelAssigner = (vnode) => {
  1390. const fn = vnode.props["onUpdate:modelValue"] || false;
  1391. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  1392. };
  1393. function onCompositionStart(e) {
  1394. e.target.composing = true;
  1395. }
  1396. function onCompositionEnd(e) {
  1397. const target = e.target;
  1398. if (target.composing) {
  1399. target.composing = false;
  1400. target.dispatchEvent(new Event("input"));
  1401. }
  1402. }
  1403. const assignKey = Symbol("_assign");
  1404. const vModelText = {
  1405. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  1406. el[assignKey] = getModelAssigner(vnode);
  1407. const castToNumber = number || vnode.props && vnode.props.type === "number";
  1408. addEventListener(el, lazy ? "change" : "input", (e) => {
  1409. if (e.target.composing) return;
  1410. let domValue = el.value;
  1411. if (trim) {
  1412. domValue = domValue.trim();
  1413. }
  1414. if (castToNumber) {
  1415. domValue = looseToNumber(domValue);
  1416. }
  1417. el[assignKey](domValue);
  1418. });
  1419. if (trim) {
  1420. addEventListener(el, "change", () => {
  1421. el.value = el.value.trim();
  1422. });
  1423. }
  1424. if (!lazy) {
  1425. addEventListener(el, "compositionstart", onCompositionStart);
  1426. addEventListener(el, "compositionend", onCompositionEnd);
  1427. addEventListener(el, "change", onCompositionEnd);
  1428. }
  1429. },
  1430. // set value on mounted so it's after min/max for type="range"
  1431. mounted(el, { value }) {
  1432. el.value = value == null ? "" : value;
  1433. },
  1434. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  1435. el[assignKey] = getModelAssigner(vnode);
  1436. if (el.composing) return;
  1437. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  1438. const newValue = value == null ? "" : value;
  1439. if (elValue === newValue) {
  1440. return;
  1441. }
  1442. if (document.activeElement === el && el.type !== "range") {
  1443. if (lazy && value === oldValue) {
  1444. return;
  1445. }
  1446. if (trim && el.value.trim() === newValue) {
  1447. return;
  1448. }
  1449. }
  1450. el.value = newValue;
  1451. }
  1452. };
  1453. const vModelCheckbox = {
  1454. // #4096 array checkboxes need to be deep traversed
  1455. deep: true,
  1456. created(el, _, vnode) {
  1457. el[assignKey] = getModelAssigner(vnode);
  1458. addEventListener(el, "change", () => {
  1459. const modelValue = el._modelValue;
  1460. const elementValue = getValue(el);
  1461. const checked = el.checked;
  1462. const assign = el[assignKey];
  1463. if (isArray(modelValue)) {
  1464. const index = looseIndexOf(modelValue, elementValue);
  1465. const found = index !== -1;
  1466. if (checked && !found) {
  1467. assign(modelValue.concat(elementValue));
  1468. } else if (!checked && found) {
  1469. const filtered = [...modelValue];
  1470. filtered.splice(index, 1);
  1471. assign(filtered);
  1472. }
  1473. } else if (isSet(modelValue)) {
  1474. const cloned = new Set(modelValue);
  1475. if (checked) {
  1476. cloned.add(elementValue);
  1477. } else {
  1478. cloned.delete(elementValue);
  1479. }
  1480. assign(cloned);
  1481. } else {
  1482. assign(getCheckboxValue(el, checked));
  1483. }
  1484. });
  1485. },
  1486. // set initial checked on mount to wait for true-value/false-value
  1487. mounted: setChecked,
  1488. beforeUpdate(el, binding, vnode) {
  1489. el[assignKey] = getModelAssigner(vnode);
  1490. setChecked(el, binding, vnode);
  1491. }
  1492. };
  1493. function setChecked(el, { value, oldValue }, vnode) {
  1494. el._modelValue = value;
  1495. let checked;
  1496. if (isArray(value)) {
  1497. checked = looseIndexOf(value, vnode.props.value) > -1;
  1498. } else if (isSet(value)) {
  1499. checked = value.has(vnode.props.value);
  1500. } else {
  1501. if (value === oldValue) return;
  1502. checked = looseEqual(value, getCheckboxValue(el, true));
  1503. }
  1504. if (el.checked !== checked) {
  1505. el.checked = checked;
  1506. }
  1507. }
  1508. const vModelRadio = {
  1509. created(el, { value }, vnode) {
  1510. el.checked = looseEqual(value, vnode.props.value);
  1511. el[assignKey] = getModelAssigner(vnode);
  1512. addEventListener(el, "change", () => {
  1513. el[assignKey](getValue(el));
  1514. });
  1515. },
  1516. beforeUpdate(el, { value, oldValue }, vnode) {
  1517. el[assignKey] = getModelAssigner(vnode);
  1518. if (value !== oldValue) {
  1519. el.checked = looseEqual(value, vnode.props.value);
  1520. }
  1521. }
  1522. };
  1523. const vModelSelect = {
  1524. // <select multiple> value need to be deep traversed
  1525. deep: true,
  1526. created(el, { value, modifiers: { number } }, vnode) {
  1527. const isSetModel = isSet(value);
  1528. addEventListener(el, "change", () => {
  1529. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  1530. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  1531. );
  1532. el[assignKey](
  1533. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  1534. );
  1535. el._assigning = true;
  1536. nextTick(() => {
  1537. el._assigning = false;
  1538. });
  1539. });
  1540. el[assignKey] = getModelAssigner(vnode);
  1541. },
  1542. // set value in mounted & updated because <select> relies on its children
  1543. // <option>s.
  1544. mounted(el, { value }) {
  1545. setSelected(el, value);
  1546. },
  1547. beforeUpdate(el, _binding, vnode) {
  1548. el[assignKey] = getModelAssigner(vnode);
  1549. },
  1550. updated(el, { value }) {
  1551. if (!el._assigning) {
  1552. setSelected(el, value);
  1553. }
  1554. }
  1555. };
  1556. function setSelected(el, value) {
  1557. const isMultiple = el.multiple;
  1558. const isArrayValue = isArray(value);
  1559. if (isMultiple && !isArrayValue && !isSet(value)) {
  1560. !!(process.env.NODE_ENV !== "production") && warn(
  1561. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  1562. );
  1563. return;
  1564. }
  1565. for (let i = 0, l = el.options.length; i < l; i++) {
  1566. const option = el.options[i];
  1567. const optionValue = getValue(option);
  1568. if (isMultiple) {
  1569. if (isArrayValue) {
  1570. const optionType = typeof optionValue;
  1571. if (optionType === "string" || optionType === "number") {
  1572. option.selected = value.some((v) => String(v) === String(optionValue));
  1573. } else {
  1574. option.selected = looseIndexOf(value, optionValue) > -1;
  1575. }
  1576. } else {
  1577. option.selected = value.has(optionValue);
  1578. }
  1579. } else if (looseEqual(getValue(option), value)) {
  1580. if (el.selectedIndex !== i) el.selectedIndex = i;
  1581. return;
  1582. }
  1583. }
  1584. if (!isMultiple && el.selectedIndex !== -1) {
  1585. el.selectedIndex = -1;
  1586. }
  1587. }
  1588. function getValue(el) {
  1589. return "_value" in el ? el._value : el.value;
  1590. }
  1591. function getCheckboxValue(el, checked) {
  1592. const key = checked ? "_trueValue" : "_falseValue";
  1593. return key in el ? el[key] : checked;
  1594. }
  1595. const vModelDynamic = {
  1596. created(el, binding, vnode) {
  1597. callModelHook(el, binding, vnode, null, "created");
  1598. },
  1599. mounted(el, binding, vnode) {
  1600. callModelHook(el, binding, vnode, null, "mounted");
  1601. },
  1602. beforeUpdate(el, binding, vnode, prevVNode) {
  1603. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  1604. },
  1605. updated(el, binding, vnode, prevVNode) {
  1606. callModelHook(el, binding, vnode, prevVNode, "updated");
  1607. }
  1608. };
  1609. function resolveDynamicModel(tagName, type) {
  1610. switch (tagName) {
  1611. case "SELECT":
  1612. return vModelSelect;
  1613. case "TEXTAREA":
  1614. return vModelText;
  1615. default:
  1616. switch (type) {
  1617. case "checkbox":
  1618. return vModelCheckbox;
  1619. case "radio":
  1620. return vModelRadio;
  1621. default:
  1622. return vModelText;
  1623. }
  1624. }
  1625. }
  1626. function callModelHook(el, binding, vnode, prevVNode, hook) {
  1627. const modelToUse = resolveDynamicModel(
  1628. el.tagName,
  1629. vnode.props && vnode.props.type
  1630. );
  1631. const fn = modelToUse[hook];
  1632. fn && fn(el, binding, vnode, prevVNode);
  1633. }
  1634. function initVModelForSSR() {
  1635. vModelText.getSSRProps = ({ value }) => ({ value });
  1636. vModelRadio.getSSRProps = ({ value }, vnode) => {
  1637. if (vnode.props && looseEqual(vnode.props.value, value)) {
  1638. return { checked: true };
  1639. }
  1640. };
  1641. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  1642. if (isArray(value)) {
  1643. if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {
  1644. return { checked: true };
  1645. }
  1646. } else if (isSet(value)) {
  1647. if (vnode.props && value.has(vnode.props.value)) {
  1648. return { checked: true };
  1649. }
  1650. } else if (value) {
  1651. return { checked: true };
  1652. }
  1653. };
  1654. vModelDynamic.getSSRProps = (binding, vnode) => {
  1655. if (typeof vnode.type !== "string") {
  1656. return;
  1657. }
  1658. const modelToUse = resolveDynamicModel(
  1659. // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
  1660. vnode.type.toUpperCase(),
  1661. vnode.props && vnode.props.type
  1662. );
  1663. if (modelToUse.getSSRProps) {
  1664. return modelToUse.getSSRProps(binding, vnode);
  1665. }
  1666. };
  1667. }
  1668. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  1669. const modifierGuards = {
  1670. stop: (e) => e.stopPropagation(),
  1671. prevent: (e) => e.preventDefault(),
  1672. self: (e) => e.target !== e.currentTarget,
  1673. ctrl: (e) => !e.ctrlKey,
  1674. shift: (e) => !e.shiftKey,
  1675. alt: (e) => !e.altKey,
  1676. meta: (e) => !e.metaKey,
  1677. left: (e) => "button" in e && e.button !== 0,
  1678. middle: (e) => "button" in e && e.button !== 1,
  1679. right: (e) => "button" in e && e.button !== 2,
  1680. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  1681. };
  1682. const withModifiers = (fn, modifiers) => {
  1683. const cache = fn._withMods || (fn._withMods = {});
  1684. const cacheKey = modifiers.join(".");
  1685. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  1686. for (let i = 0; i < modifiers.length; i++) {
  1687. const guard = modifierGuards[modifiers[i]];
  1688. if (guard && guard(event, modifiers)) return;
  1689. }
  1690. return fn(event, ...args);
  1691. });
  1692. };
  1693. const keyNames = {
  1694. esc: "escape",
  1695. space: " ",
  1696. up: "arrow-up",
  1697. left: "arrow-left",
  1698. right: "arrow-right",
  1699. down: "arrow-down",
  1700. delete: "backspace"
  1701. };
  1702. const withKeys = (fn, modifiers) => {
  1703. const cache = fn._withKeys || (fn._withKeys = {});
  1704. const cacheKey = modifiers.join(".");
  1705. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  1706. if (!("key" in event)) {
  1707. return;
  1708. }
  1709. const eventKey = hyphenate(event.key);
  1710. if (modifiers.some(
  1711. (k) => k === eventKey || keyNames[k] === eventKey
  1712. )) {
  1713. return fn(event);
  1714. }
  1715. });
  1716. };
  1717. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  1718. let renderer;
  1719. let enabledHydration = false;
  1720. function ensureRenderer() {
  1721. return renderer || (renderer = createRenderer(rendererOptions));
  1722. }
  1723. function ensureHydrationRenderer() {
  1724. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  1725. enabledHydration = true;
  1726. return renderer;
  1727. }
  1728. const render = (...args) => {
  1729. ensureRenderer().render(...args);
  1730. };
  1731. const hydrate = (...args) => {
  1732. ensureHydrationRenderer().hydrate(...args);
  1733. };
  1734. const createApp = (...args) => {
  1735. const app = ensureRenderer().createApp(...args);
  1736. if (!!(process.env.NODE_ENV !== "production")) {
  1737. injectNativeTagCheck(app);
  1738. injectCompilerOptionsCheck(app);
  1739. }
  1740. const { mount } = app;
  1741. app.mount = (containerOrSelector) => {
  1742. const container = normalizeContainer(containerOrSelector);
  1743. if (!container) return;
  1744. const component = app._component;
  1745. if (!isFunction(component) && !component.render && !component.template) {
  1746. component.template = container.innerHTML;
  1747. }
  1748. if (container.nodeType === 1) {
  1749. container.textContent = "";
  1750. }
  1751. const proxy = mount(container, false, resolveRootNamespace(container));
  1752. if (container instanceof Element) {
  1753. container.removeAttribute("v-cloak");
  1754. container.setAttribute("data-v-app", "");
  1755. }
  1756. return proxy;
  1757. };
  1758. return app;
  1759. };
  1760. const createSSRApp = (...args) => {
  1761. const app = ensureHydrationRenderer().createApp(...args);
  1762. if (!!(process.env.NODE_ENV !== "production")) {
  1763. injectNativeTagCheck(app);
  1764. injectCompilerOptionsCheck(app);
  1765. }
  1766. const { mount } = app;
  1767. app.mount = (containerOrSelector) => {
  1768. const container = normalizeContainer(containerOrSelector);
  1769. if (container) {
  1770. return mount(container, true, resolveRootNamespace(container));
  1771. }
  1772. };
  1773. return app;
  1774. };
  1775. function resolveRootNamespace(container) {
  1776. if (container instanceof SVGElement) {
  1777. return "svg";
  1778. }
  1779. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  1780. return "mathml";
  1781. }
  1782. }
  1783. function injectNativeTagCheck(app) {
  1784. Object.defineProperty(app.config, "isNativeTag", {
  1785. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  1786. writable: false
  1787. });
  1788. }
  1789. function injectCompilerOptionsCheck(app) {
  1790. if (isRuntimeOnly()) {
  1791. const isCustomElement = app.config.isCustomElement;
  1792. Object.defineProperty(app.config, "isCustomElement", {
  1793. get() {
  1794. return isCustomElement;
  1795. },
  1796. set() {
  1797. warn(
  1798. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  1799. );
  1800. }
  1801. });
  1802. const compilerOptions = app.config.compilerOptions;
  1803. 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.
  1804. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  1805. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  1806. - 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`;
  1807. Object.defineProperty(app.config, "compilerOptions", {
  1808. get() {
  1809. warn(msg);
  1810. return compilerOptions;
  1811. },
  1812. set() {
  1813. warn(msg);
  1814. }
  1815. });
  1816. }
  1817. }
  1818. function normalizeContainer(container) {
  1819. if (isString(container)) {
  1820. const res = document.querySelector(container);
  1821. if (!!(process.env.NODE_ENV !== "production") && !res) {
  1822. warn(
  1823. `Failed to mount app: mount target selector "${container}" returned null.`
  1824. );
  1825. }
  1826. return res;
  1827. }
  1828. if (!!(process.env.NODE_ENV !== "production") && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  1829. warn(
  1830. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  1831. );
  1832. }
  1833. return container;
  1834. }
  1835. let ssrDirectiveInitialized = false;
  1836. const initDirectivesForSSR = () => {
  1837. if (!ssrDirectiveInitialized) {
  1838. ssrDirectiveInitialized = true;
  1839. initVModelForSSR();
  1840. initVShowForSSR();
  1841. }
  1842. } ;
  1843. export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, render, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };