智慧水务管理系统 - 精河县供水工程综合管理平台

runtime-dom.esm-bundler.js 61KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012
  1. /**
  2. * @vue/runtime-dom v3.5.38
  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, nextTick, unref, createVNode, defineComponent, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, createRenderer, isRuntimeOnly, createHydrationRenderer } from '@vue/runtime-core';
  7. export * from '@vue/runtime-core';
  8. import { extend, isObject, toNumber, isArray, NOOP, normalizeCssVarValue, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, isOn, isModelListener, camelize as camelize$1, hasOwn, isPlainObject, EMPTY_OBJ, looseIndexOf, isSet, looseEqual, looseToNumber, 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 = /* @__PURE__ */ 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(el);
  216. addTransitionClass(el, leaveActiveClass);
  217. } else {
  218. addTransitionClass(el, leaveActiveClass);
  219. forceReflow(el);
  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(el) {
  366. const targetDocument = el ? el.ownerDocument : document;
  367. return targetDocument.body.offsetHeight;
  368. }
  369. function patchClass(el, value, isSVG) {
  370. const transitionClasses = el[vtcKey];
  371. if (transitionClasses) {
  372. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  373. }
  374. if (value == null) {
  375. el.removeAttribute("class");
  376. } else if (isSVG) {
  377. el.setAttribute("class", value);
  378. } else {
  379. el.className = value;
  380. }
  381. }
  382. const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
  383. const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
  384. const vShow = {
  385. // used for prop mismatch check during hydration
  386. name: "show",
  387. beforeMount(el, { value }, { transition }) {
  388. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  389. if (transition && value) {
  390. transition.beforeEnter(el);
  391. } else {
  392. setDisplay(el, value);
  393. }
  394. },
  395. mounted(el, { value }, { transition }) {
  396. if (transition && value) {
  397. transition.enter(el);
  398. }
  399. },
  400. updated(el, { value, oldValue }, { transition }) {
  401. if (!value === !oldValue) return;
  402. if (transition) {
  403. if (value) {
  404. transition.beforeEnter(el);
  405. setDisplay(el, true);
  406. transition.enter(el);
  407. } else {
  408. transition.leave(el, () => {
  409. setDisplay(el, false);
  410. });
  411. }
  412. } else {
  413. setDisplay(el, value);
  414. }
  415. },
  416. beforeUnmount(el, { value }) {
  417. setDisplay(el, value);
  418. }
  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 = /* @__PURE__ */ 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. const value = normalizeCssVarValue(vars[key]);
  497. style.setProperty(`--${key}`, value);
  498. cssText += `--${key}: ${value};`;
  499. }
  500. style[CSS_VAR_TEXT] = cssText;
  501. }
  502. }
  503. const displayRE = /(?:^|;)\s*display\s*:/;
  504. function patchStyle(el, prev, next) {
  505. const style = el.style;
  506. const isCssString = isString(next);
  507. let hasControlledDisplay = false;
  508. if (next && !isCssString) {
  509. if (prev) {
  510. if (!isString(prev)) {
  511. for (const key in prev) {
  512. if (next[key] == null) {
  513. setStyle(style, key, "");
  514. }
  515. }
  516. } else {
  517. for (const prevStyle of prev.split(";")) {
  518. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  519. if (next[key] == null) {
  520. setStyle(style, key, "");
  521. }
  522. }
  523. }
  524. }
  525. for (const key in next) {
  526. if (key === "display") {
  527. hasControlledDisplay = true;
  528. }
  529. const value = next[key];
  530. if (value != null) {
  531. if (!shouldPreserveTextareaResizeStyle(
  532. el,
  533. key,
  534. !isString(prev) && prev ? prev[key] : void 0,
  535. value
  536. )) {
  537. setStyle(style, key, value);
  538. }
  539. } else {
  540. setStyle(style, key, "");
  541. }
  542. }
  543. } else {
  544. if (isCssString) {
  545. if (prev !== next) {
  546. const cssVarText = style[CSS_VAR_TEXT];
  547. if (cssVarText) {
  548. next += ";" + cssVarText;
  549. }
  550. style.cssText = next;
  551. hasControlledDisplay = displayRE.test(next);
  552. }
  553. } else if (prev) {
  554. el.removeAttribute("style");
  555. }
  556. }
  557. if (vShowOriginalDisplay in el) {
  558. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  559. if (el[vShowHidden]) {
  560. style.display = "none";
  561. }
  562. }
  563. }
  564. const semicolonRE = /[^\\];\s*$/;
  565. const importantRE = /\s*!important$/;
  566. function setStyle(style, name, val) {
  567. if (isArray(val)) {
  568. val.forEach((v) => setStyle(style, name, v));
  569. } else {
  570. if (val == null) val = "";
  571. if (!!(process.env.NODE_ENV !== "production")) {
  572. if (semicolonRE.test(val)) {
  573. warn(
  574. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  575. );
  576. }
  577. }
  578. if (name.startsWith("--")) {
  579. style.setProperty(name, val);
  580. } else {
  581. const prefixed = autoPrefix(style, name);
  582. if (importantRE.test(val)) {
  583. style.setProperty(
  584. hyphenate(prefixed),
  585. val.replace(importantRE, ""),
  586. "important"
  587. );
  588. } else {
  589. style[prefixed] = val;
  590. }
  591. }
  592. }
  593. }
  594. const prefixes = ["Webkit", "Moz", "ms"];
  595. const prefixCache = {};
  596. function autoPrefix(style, rawName) {
  597. const cached = prefixCache[rawName];
  598. if (cached) {
  599. return cached;
  600. }
  601. let name = camelize(rawName);
  602. if (name !== "filter" && name in style) {
  603. return prefixCache[rawName] = name;
  604. }
  605. name = capitalize(name);
  606. for (let i = 0; i < prefixes.length; i++) {
  607. const prefixed = prefixes[i] + name;
  608. if (prefixed in style) {
  609. return prefixCache[rawName] = prefixed;
  610. }
  611. }
  612. return rawName;
  613. }
  614. function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
  615. return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
  616. }
  617. const xlinkNS = "http://www.w3.org/1999/xlink";
  618. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  619. if (isSVG && key.startsWith("xlink:")) {
  620. if (value == null) {
  621. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  622. } else {
  623. el.setAttributeNS(xlinkNS, key, value);
  624. }
  625. } else {
  626. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  627. el.removeAttribute(key);
  628. } else {
  629. el.setAttribute(
  630. key,
  631. isBoolean ? "" : isSymbol(value) ? String(value) : value
  632. );
  633. }
  634. }
  635. }
  636. function patchDOMProp(el, key, value, parentComponent, attrName) {
  637. if (key === "innerHTML" || key === "textContent") {
  638. if (value != null) {
  639. el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
  640. }
  641. return;
  642. }
  643. const tag = el.tagName;
  644. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  645. !tag.includes("-")) {
  646. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  647. const newValue = value == null ? (
  648. // #11647: value should be set as empty string for null and undefined,
  649. // but <input type="checkbox"> should be set as 'on'.
  650. el.type === "checkbox" ? "on" : ""
  651. ) : String(value);
  652. if (oldValue !== newValue || !("_value" in el)) {
  653. el.value = newValue;
  654. }
  655. if (value == null) {
  656. el.removeAttribute(key);
  657. }
  658. el._value = value;
  659. return;
  660. }
  661. let needRemove = false;
  662. if (value === "" || value == null) {
  663. const type = typeof el[key];
  664. if (type === "boolean") {
  665. value = includeBooleanAttr(value);
  666. } else if (value == null && type === "string") {
  667. value = "";
  668. needRemove = true;
  669. } else if (type === "number") {
  670. value = 0;
  671. needRemove = true;
  672. }
  673. }
  674. try {
  675. el[key] = value;
  676. } catch (e) {
  677. if (!!(process.env.NODE_ENV !== "production") && !needRemove) {
  678. warn(
  679. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  680. e
  681. );
  682. }
  683. }
  684. needRemove && el.removeAttribute(attrName || key);
  685. }
  686. function addEventListener(el, event, handler, options) {
  687. el.addEventListener(event, handler, options);
  688. }
  689. function removeEventListener(el, event, handler, options) {
  690. el.removeEventListener(event, handler, options);
  691. }
  692. const veiKey = /* @__PURE__ */ Symbol("_vei");
  693. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  694. const invokers = el[veiKey] || (el[veiKey] = {});
  695. const existingInvoker = invokers[rawName];
  696. if (nextValue && existingInvoker) {
  697. existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
  698. } else {
  699. const [name, options] = parseName(rawName);
  700. if (nextValue) {
  701. const invoker = invokers[rawName] = createInvoker(
  702. !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue,
  703. instance
  704. );
  705. addEventListener(el, name, invoker, options);
  706. } else if (existingInvoker) {
  707. removeEventListener(el, name, existingInvoker, options);
  708. invokers[rawName] = void 0;
  709. }
  710. }
  711. }
  712. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  713. function parseName(name) {
  714. let options;
  715. if (optionsModifierRE.test(name)) {
  716. options = {};
  717. let m;
  718. while (m = name.match(optionsModifierRE)) {
  719. name = name.slice(0, name.length - m[0].length);
  720. options[m[0].toLowerCase()] = true;
  721. }
  722. }
  723. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  724. return [event, options];
  725. }
  726. let cachedNow = 0;
  727. const p = /* @__PURE__ */ Promise.resolve();
  728. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  729. function createInvoker(initialValue, instance) {
  730. const invoker = (e) => {
  731. if (!e._vts) {
  732. e._vts = Date.now();
  733. } else if (e._vts <= invoker.attached) {
  734. return;
  735. }
  736. const value = invoker.value;
  737. if (isArray(value)) {
  738. const originalStop = e.stopImmediatePropagation;
  739. e.stopImmediatePropagation = () => {
  740. originalStop.call(e);
  741. e._stopped = true;
  742. };
  743. const handlers = value.slice();
  744. const args = [e];
  745. for (let i = 0; i < handlers.length; i++) {
  746. if (e._stopped) {
  747. break;
  748. }
  749. const handler = handlers[i];
  750. if (handler) {
  751. callWithAsyncErrorHandling(
  752. handler,
  753. instance,
  754. 5,
  755. args
  756. );
  757. }
  758. }
  759. } else {
  760. callWithAsyncErrorHandling(
  761. value,
  762. instance,
  763. 5,
  764. [e]
  765. );
  766. }
  767. };
  768. invoker.value = initialValue;
  769. invoker.attached = getNow();
  770. return invoker;
  771. }
  772. function sanitizeEventValue(value, propName) {
  773. if (isFunction(value) || isArray(value)) {
  774. return value;
  775. }
  776. warn(
  777. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  778. Expected function or array of functions, received type ${typeof value}.`
  779. );
  780. return NOOP;
  781. }
  782. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  783. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  784. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  785. const isSVG = namespace === "svg";
  786. if (key === "class") {
  787. patchClass(el, nextValue, isSVG);
  788. } else if (key === "style") {
  789. patchStyle(el, prevValue, nextValue);
  790. } else if (isOn(key)) {
  791. if (!isModelListener(key)) {
  792. patchEvent(el, key, prevValue, nextValue, parentComponent);
  793. }
  794. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  795. patchDOMProp(el, key, nextValue);
  796. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  797. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  798. }
  799. } else if (
  800. // #11081 force set props for possible async custom element
  801. el._isVueCE && // #12408 check if it's declared prop or it's async custom element
  802. (shouldSetAsPropForVueCE(el, key) || // @ts-expect-error _def is private
  803. el._def.__asyncLoader && (/[A-Z]/.test(key) || !isString(nextValue)))
  804. ) {
  805. patchDOMProp(el, camelize$1(key), nextValue, parentComponent, key);
  806. } else {
  807. if (key === "true-value") {
  808. el._trueValue = nextValue;
  809. } else if (key === "false-value") {
  810. el._falseValue = nextValue;
  811. }
  812. patchAttr(el, key, nextValue, isSVG);
  813. }
  814. };
  815. function shouldSetAsProp(el, key, value, isSVG) {
  816. if (isSVG) {
  817. if (key === "innerHTML" || key === "textContent") {
  818. return true;
  819. }
  820. if (key in el && isNativeOn(key) && isFunction(value)) {
  821. return true;
  822. }
  823. return false;
  824. }
  825. if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
  826. return false;
  827. }
  828. if (key === "sandbox" && el.tagName === "IFRAME") {
  829. return false;
  830. }
  831. if (key === "form") {
  832. return false;
  833. }
  834. if (key === "list" && el.tagName === "INPUT") {
  835. return false;
  836. }
  837. if (key === "type" && el.tagName === "TEXTAREA") {
  838. return false;
  839. }
  840. if (key === "width" || key === "height") {
  841. const tag = el.tagName;
  842. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  843. return false;
  844. }
  845. }
  846. if (isNativeOn(key) && isString(value)) {
  847. return false;
  848. }
  849. return key in el;
  850. }
  851. function shouldSetAsPropForVueCE(el, key) {
  852. const props = (
  853. // @ts-expect-error _def is private
  854. el._def.props
  855. );
  856. if (!props) {
  857. return false;
  858. }
  859. const camelKey = camelize$1(key);
  860. return Array.isArray(props) ? props.some((prop) => camelize$1(prop) === camelKey) : Object.keys(props).some((prop) => camelize$1(prop) === camelKey);
  861. }
  862. const REMOVAL = {};
  863. // @__NO_SIDE_EFFECTS__
  864. function defineCustomElement(options, extraOptions, _createApp) {
  865. let Comp = defineComponent(options, extraOptions);
  866. if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
  867. class VueCustomElement extends VueElement {
  868. constructor(initialProps) {
  869. super(Comp, initialProps, _createApp);
  870. }
  871. }
  872. VueCustomElement.def = Comp;
  873. return VueCustomElement;
  874. }
  875. const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  876. return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
  877. });
  878. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  879. };
  880. class VueElement extends BaseClass {
  881. constructor(_def, _props = {}, _createApp = createApp) {
  882. super();
  883. this._def = _def;
  884. this._props = _props;
  885. this._createApp = _createApp;
  886. this._isVueCE = true;
  887. /**
  888. * @internal
  889. */
  890. this._instance = null;
  891. /**
  892. * @internal
  893. */
  894. this._app = null;
  895. /**
  896. * @internal
  897. */
  898. this._nonce = this._def.nonce;
  899. this._connected = false;
  900. this._resolved = false;
  901. this._patching = false;
  902. this._dirty = false;
  903. this._numberProps = null;
  904. this._styleChildren = /* @__PURE__ */ new WeakSet();
  905. this._styleAnchors = /* @__PURE__ */ new WeakMap();
  906. this._ob = null;
  907. if (this.shadowRoot && _createApp !== createApp) {
  908. this._root = this.shadowRoot;
  909. } else {
  910. if (!!(process.env.NODE_ENV !== "production") && this.shadowRoot) {
  911. warn(
  912. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  913. );
  914. }
  915. if (_def.shadowRoot !== false) {
  916. this.attachShadow(
  917. extend({}, _def.shadowRootOptions, {
  918. mode: "open"
  919. })
  920. );
  921. this._root = this.shadowRoot;
  922. } else {
  923. this._root = this;
  924. }
  925. }
  926. }
  927. connectedCallback() {
  928. if (!this.isConnected) return;
  929. if (!this.shadowRoot && !this._resolved) {
  930. this._parseSlots();
  931. }
  932. this._connected = true;
  933. let parent = this;
  934. while (parent = parent && // #12479 should check assignedSlot first to get correct parent
  935. (parent.assignedSlot || parent.parentNode || parent.host)) {
  936. if (parent instanceof VueElement) {
  937. this._parent = parent;
  938. break;
  939. }
  940. }
  941. if (!this._instance) {
  942. if (this._resolved) {
  943. this._mount(this._def);
  944. } else {
  945. if (parent && parent._pendingResolve) {
  946. this._pendingResolve = parent._pendingResolve.then(() => {
  947. this._pendingResolve = void 0;
  948. this._resolveDef();
  949. });
  950. } else {
  951. this._resolveDef();
  952. }
  953. }
  954. }
  955. }
  956. _setParent(parent = this._parent) {
  957. if (parent) {
  958. this._instance.parent = parent._instance;
  959. this._inheritParentContext(parent);
  960. }
  961. }
  962. _inheritParentContext(parent = this._parent) {
  963. if (parent && this._app) {
  964. Object.setPrototypeOf(
  965. this._app._context.provides,
  966. parent._instance.provides
  967. );
  968. }
  969. }
  970. disconnectedCallback() {
  971. this._connected = false;
  972. nextTick(() => {
  973. if (!this._connected) {
  974. if (this._ob) {
  975. this._ob.disconnect();
  976. this._ob = null;
  977. }
  978. this._app && this._app.unmount();
  979. if (this._instance) this._instance.ce = void 0;
  980. this._app = this._instance = null;
  981. if (this._teleportTargets) {
  982. this._teleportTargets.clear();
  983. this._teleportTargets = void 0;
  984. }
  985. }
  986. });
  987. }
  988. _processMutations(mutations) {
  989. for (const m of mutations) {
  990. this._setAttr(m.attributeName);
  991. }
  992. }
  993. /**
  994. * resolve inner component definition (handle possible async component)
  995. */
  996. _resolveDef() {
  997. if (this._pendingResolve) {
  998. return;
  999. }
  1000. for (let i = 0; i < this.attributes.length; i++) {
  1001. this._setAttr(this.attributes[i].name);
  1002. }
  1003. this._ob = new MutationObserver(this._processMutations.bind(this));
  1004. this._ob.observe(this, { attributes: true });
  1005. const resolve = (def, isAsync = false) => {
  1006. this._resolved = true;
  1007. this._pendingResolve = void 0;
  1008. const { props, styles } = def;
  1009. let numberProps;
  1010. if (props && !isArray(props)) {
  1011. for (const key in props) {
  1012. const opt = props[key];
  1013. if (opt === Number || opt && opt.type === Number) {
  1014. if (key in this._props) {
  1015. this._props[key] = toNumber(this._props[key]);
  1016. }
  1017. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize$1(key)] = true;
  1018. }
  1019. }
  1020. }
  1021. this._numberProps = numberProps;
  1022. this._resolveProps(def);
  1023. if (this.shadowRoot) {
  1024. this._applyStyles(styles);
  1025. } else if (!!(process.env.NODE_ENV !== "production") && styles) {
  1026. warn(
  1027. "Custom element style injection is not supported when using shadowRoot: false"
  1028. );
  1029. }
  1030. this._mount(def);
  1031. };
  1032. const asyncDef = this._def.__asyncLoader;
  1033. if (asyncDef) {
  1034. this._pendingResolve = asyncDef().then((def) => {
  1035. def.configureApp = this._def.configureApp;
  1036. resolve(this._def = def, true);
  1037. });
  1038. } else {
  1039. resolve(this._def);
  1040. }
  1041. }
  1042. _mount(def) {
  1043. if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def.name) {
  1044. def.name = "VueElement";
  1045. }
  1046. this._app = this._createApp(def);
  1047. this._inheritParentContext();
  1048. if (def.configureApp) {
  1049. def.configureApp(this._app);
  1050. }
  1051. this._app._ceVNode = this._createVNode();
  1052. this._app.mount(this._root);
  1053. const exposed = this._instance && this._instance.exposed;
  1054. if (!exposed) return;
  1055. for (const key in exposed) {
  1056. if (!hasOwn(this, key)) {
  1057. Object.defineProperty(this, key, {
  1058. // unwrap ref to be consistent with public instance behavior
  1059. get: () => unref(exposed[key])
  1060. });
  1061. } else if (!!(process.env.NODE_ENV !== "production")) {
  1062. warn(`Exposed property "${key}" already exists on custom element.`);
  1063. }
  1064. }
  1065. }
  1066. _resolveProps(def) {
  1067. const { props } = def;
  1068. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  1069. for (const key of Object.keys(this)) {
  1070. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  1071. this._setProp(key, this[key]);
  1072. }
  1073. }
  1074. for (const key of declaredPropKeys.map(camelize$1)) {
  1075. Object.defineProperty(this, key, {
  1076. get() {
  1077. return this._getProp(key);
  1078. },
  1079. set(val) {
  1080. this._setProp(key, val, true, !this._patching);
  1081. }
  1082. });
  1083. }
  1084. }
  1085. _setAttr(key) {
  1086. if (key.startsWith("data-v-")) return;
  1087. const has = this.hasAttribute(key);
  1088. let value = has ? this.getAttribute(key) : REMOVAL;
  1089. const camelKey = camelize$1(key);
  1090. if (has && this._numberProps && this._numberProps[camelKey]) {
  1091. value = toNumber(value);
  1092. }
  1093. this._setProp(camelKey, value, false, true);
  1094. }
  1095. /**
  1096. * @internal
  1097. */
  1098. _getProp(key) {
  1099. return this._props[key];
  1100. }
  1101. /**
  1102. * @internal
  1103. */
  1104. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  1105. if (val !== this._props[key]) {
  1106. this._dirty = true;
  1107. if (val === REMOVAL) {
  1108. delete this._props[key];
  1109. } else {
  1110. this._props[key] = val;
  1111. if (key === "key" && this._app) {
  1112. this._app._ceVNode.key = val;
  1113. }
  1114. }
  1115. if (shouldUpdate && this._instance) {
  1116. this._update();
  1117. }
  1118. if (shouldReflect) {
  1119. const ob = this._ob;
  1120. if (ob) {
  1121. this._processMutations(ob.takeRecords());
  1122. ob.disconnect();
  1123. }
  1124. if (val === true) {
  1125. this.setAttribute(hyphenate(key), "");
  1126. } else if (typeof val === "string" || typeof val === "number") {
  1127. this.setAttribute(hyphenate(key), val + "");
  1128. } else if (!val) {
  1129. this.removeAttribute(hyphenate(key));
  1130. }
  1131. ob && ob.observe(this, { attributes: true });
  1132. }
  1133. }
  1134. }
  1135. _update() {
  1136. const vnode = this._createVNode();
  1137. if (this._app) vnode.appContext = this._app._context;
  1138. render(vnode, this._root);
  1139. }
  1140. _createVNode() {
  1141. const baseProps = {};
  1142. if (!this.shadowRoot) {
  1143. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  1144. }
  1145. const vnode = createVNode(this._def, extend(baseProps, this._props));
  1146. if (!this._instance) {
  1147. vnode.ce = (instance) => {
  1148. this._instance = instance;
  1149. instance.ce = this;
  1150. instance.isCE = true;
  1151. if (!!(process.env.NODE_ENV !== "production")) {
  1152. instance.ceReload = (newStyles) => {
  1153. if (this._styles) {
  1154. this._styles.forEach((s) => this._root.removeChild(s));
  1155. this._styles.length = 0;
  1156. }
  1157. this._styleAnchors.delete(this._def);
  1158. this._applyStyles(newStyles);
  1159. this._instance = null;
  1160. this._update();
  1161. };
  1162. }
  1163. const dispatch = (event, args) => {
  1164. this.dispatchEvent(
  1165. new CustomEvent(
  1166. event,
  1167. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  1168. )
  1169. );
  1170. };
  1171. instance.emit = (event, ...args) => {
  1172. dispatch(event, args);
  1173. if (hyphenate(event) !== event) {
  1174. dispatch(hyphenate(event), args);
  1175. }
  1176. };
  1177. this._setParent();
  1178. };
  1179. }
  1180. return vnode;
  1181. }
  1182. _applyStyles(styles, owner, parentComp) {
  1183. if (!styles) return;
  1184. if (owner) {
  1185. if (owner === this._def || this._styleChildren.has(owner)) {
  1186. return;
  1187. }
  1188. this._styleChildren.add(owner);
  1189. }
  1190. const nonce = this._nonce;
  1191. const root = this.shadowRoot;
  1192. const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
  1193. let last = null;
  1194. for (let i = styles.length - 1; i >= 0; i--) {
  1195. const s = document.createElement("style");
  1196. if (nonce) s.setAttribute("nonce", nonce);
  1197. s.textContent = styles[i];
  1198. root.insertBefore(s, last || insertionAnchor);
  1199. last = s;
  1200. if (i === 0) {
  1201. if (!parentComp) this._styleAnchors.set(this._def, s);
  1202. if (owner) this._styleAnchors.set(owner, s);
  1203. }
  1204. if (!!(process.env.NODE_ENV !== "production")) {
  1205. if (owner) {
  1206. if (owner.__hmrId) {
  1207. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  1208. let entry = this._childStyles.get(owner.__hmrId);
  1209. if (!entry) {
  1210. this._childStyles.set(owner.__hmrId, entry = []);
  1211. }
  1212. entry.push(s);
  1213. }
  1214. } else {
  1215. (this._styles || (this._styles = [])).push(s);
  1216. }
  1217. }
  1218. }
  1219. }
  1220. _getStyleAnchor(comp) {
  1221. if (!comp) {
  1222. return null;
  1223. }
  1224. const anchor = this._styleAnchors.get(comp);
  1225. if (anchor && anchor.parentNode === this.shadowRoot) {
  1226. return anchor;
  1227. }
  1228. if (anchor) {
  1229. this._styleAnchors.delete(comp);
  1230. }
  1231. return null;
  1232. }
  1233. _getRootStyleInsertionAnchor(root) {
  1234. for (let i = 0; i < root.childNodes.length; i++) {
  1235. const node = root.childNodes[i];
  1236. if (!(node instanceof HTMLStyleElement)) {
  1237. return node;
  1238. }
  1239. }
  1240. return null;
  1241. }
  1242. /**
  1243. * Only called when shadowRoot is false
  1244. */
  1245. _parseSlots() {
  1246. const slots = this._slots = {};
  1247. let n;
  1248. while (n = this.firstChild) {
  1249. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  1250. (slots[slotName] || (slots[slotName] = [])).push(n);
  1251. this.removeChild(n);
  1252. }
  1253. }
  1254. /**
  1255. * Only called when shadowRoot is false
  1256. */
  1257. _renderSlots() {
  1258. const outlets = this._getSlots();
  1259. const scopeId = this._instance.type.__scopeId;
  1260. for (let i = 0; i < outlets.length; i++) {
  1261. const o = outlets[i];
  1262. const slotName = o.getAttribute("name") || "default";
  1263. const content = this._slots[slotName];
  1264. const parent = o.parentNode;
  1265. if (content) {
  1266. for (const n of content) {
  1267. if (scopeId && n.nodeType === 1) {
  1268. const id = scopeId + "-s";
  1269. const walker = document.createTreeWalker(n, 1);
  1270. n.setAttribute(id, "");
  1271. let child;
  1272. while (child = walker.nextNode()) {
  1273. child.setAttribute(id, "");
  1274. }
  1275. }
  1276. parent.insertBefore(n, o);
  1277. }
  1278. } else {
  1279. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  1280. }
  1281. parent.removeChild(o);
  1282. }
  1283. }
  1284. /**
  1285. * @internal
  1286. */
  1287. _getSlots() {
  1288. const roots = [this];
  1289. if (this._teleportTargets) {
  1290. roots.push(...this._teleportTargets);
  1291. }
  1292. const slots = /* @__PURE__ */ new Set();
  1293. for (const root of roots) {
  1294. const found = root.querySelectorAll("slot");
  1295. for (let i = 0; i < found.length; i++) {
  1296. slots.add(found[i]);
  1297. }
  1298. }
  1299. return Array.from(slots);
  1300. }
  1301. /**
  1302. * @internal
  1303. */
  1304. _injectChildStyle(comp, parentComp) {
  1305. this._applyStyles(comp.styles, comp, parentComp);
  1306. }
  1307. /**
  1308. * @internal
  1309. */
  1310. _beginPatch() {
  1311. this._patching = true;
  1312. this._dirty = false;
  1313. }
  1314. /**
  1315. * @internal
  1316. */
  1317. _endPatch() {
  1318. this._patching = false;
  1319. if (this._dirty && this._instance) {
  1320. this._update();
  1321. }
  1322. }
  1323. /**
  1324. * @internal
  1325. */
  1326. _hasShadowRoot() {
  1327. return this._def.shadowRoot !== false;
  1328. }
  1329. /**
  1330. * @internal
  1331. */
  1332. _removeChildStyle(comp) {
  1333. if (!!(process.env.NODE_ENV !== "production")) {
  1334. this._styleChildren.delete(comp);
  1335. this._styleAnchors.delete(comp);
  1336. if (this._childStyles && comp.__hmrId) {
  1337. const oldStyles = this._childStyles.get(comp.__hmrId);
  1338. if (oldStyles) {
  1339. oldStyles.forEach((s) => this._root.removeChild(s));
  1340. oldStyles.length = 0;
  1341. }
  1342. }
  1343. }
  1344. }
  1345. }
  1346. function useHost(caller) {
  1347. const instance = getCurrentInstance();
  1348. const el = instance && instance.ce;
  1349. if (el) {
  1350. return el;
  1351. } else if (!!(process.env.NODE_ENV !== "production")) {
  1352. if (!instance) {
  1353. warn(
  1354. `${caller || "useHost"} called without an active component instance.`
  1355. );
  1356. } else {
  1357. warn(
  1358. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  1359. );
  1360. }
  1361. }
  1362. return null;
  1363. }
  1364. function useShadowRoot() {
  1365. const el = !!(process.env.NODE_ENV !== "production") ? useHost("useShadowRoot") : useHost();
  1366. return el && el.shadowRoot;
  1367. }
  1368. function useCssModule(name = "$style") {
  1369. {
  1370. const instance = getCurrentInstance();
  1371. if (!instance) {
  1372. !!(process.env.NODE_ENV !== "production") && warn(`useCssModule must be called inside setup()`);
  1373. return EMPTY_OBJ;
  1374. }
  1375. const modules = instance.type.__cssModules;
  1376. if (!modules) {
  1377. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS modules injected.`);
  1378. return EMPTY_OBJ;
  1379. }
  1380. const mod = modules[name];
  1381. if (!mod) {
  1382. !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS module named "${name}".`);
  1383. return EMPTY_OBJ;
  1384. }
  1385. return mod;
  1386. }
  1387. }
  1388. const positionMap = /* @__PURE__ */ new WeakMap();
  1389. const newPositionMap = /* @__PURE__ */ new WeakMap();
  1390. const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
  1391. const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
  1392. const decorate = (t) => {
  1393. delete t.props.mode;
  1394. return t;
  1395. };
  1396. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  1397. name: "TransitionGroup",
  1398. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  1399. tag: String,
  1400. moveClass: String
  1401. }),
  1402. setup(props, { slots }) {
  1403. const instance = getCurrentInstance();
  1404. const state = useTransitionState();
  1405. let prevChildren;
  1406. let children;
  1407. onUpdated(() => {
  1408. if (!prevChildren.length) {
  1409. return;
  1410. }
  1411. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  1412. if (!hasCSSTransform(
  1413. prevChildren[0].el,
  1414. instance.vnode.el,
  1415. moveClass
  1416. )) {
  1417. prevChildren = [];
  1418. return;
  1419. }
  1420. prevChildren.forEach(callPendingCbs);
  1421. prevChildren.forEach(recordPosition);
  1422. const movedChildren = prevChildren.filter(applyTranslation);
  1423. forceReflow(instance.vnode.el);
  1424. movedChildren.forEach((c) => {
  1425. const el = c.el;
  1426. const style = el.style;
  1427. addTransitionClass(el, moveClass);
  1428. style.transform = style.webkitTransform = style.transitionDuration = "";
  1429. const cb = el[moveCbKey] = (e) => {
  1430. if (e && e.target !== el) {
  1431. return;
  1432. }
  1433. if (!e || e.propertyName.endsWith("transform")) {
  1434. el.removeEventListener("transitionend", cb);
  1435. el[moveCbKey] = null;
  1436. removeTransitionClass(el, moveClass);
  1437. }
  1438. };
  1439. el.addEventListener("transitionend", cb);
  1440. });
  1441. prevChildren = [];
  1442. });
  1443. return () => {
  1444. const rawProps = toRaw(props);
  1445. const cssTransitionProps = resolveTransitionProps(rawProps);
  1446. let tag = rawProps.tag || Fragment;
  1447. prevChildren = [];
  1448. if (children) {
  1449. for (let i = 0; i < children.length; i++) {
  1450. const child = children[i];
  1451. if (child.el && child.el instanceof Element && // Hidden v-show nodes have no previous layout box to animate from.
  1452. !child.el[vShowHidden]) {
  1453. prevChildren.push(child);
  1454. setTransitionHooks(
  1455. child,
  1456. resolveTransitionHooks(
  1457. child,
  1458. cssTransitionProps,
  1459. state,
  1460. instance
  1461. )
  1462. );
  1463. positionMap.set(child, getPosition(child.el));
  1464. }
  1465. }
  1466. }
  1467. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  1468. for (let i = 0; i < children.length; i++) {
  1469. const child = children[i];
  1470. if (child.key != null) {
  1471. setTransitionHooks(
  1472. child,
  1473. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  1474. );
  1475. } else if (!!(process.env.NODE_ENV !== "production") && child.type !== Text) {
  1476. warn(`<TransitionGroup> children must be keyed.`);
  1477. }
  1478. }
  1479. return createVNode(tag, null, children);
  1480. };
  1481. }
  1482. });
  1483. const TransitionGroup = TransitionGroupImpl;
  1484. function callPendingCbs(c) {
  1485. const el = c.el;
  1486. if (el[moveCbKey]) {
  1487. el[moveCbKey]();
  1488. }
  1489. if (el[enterCbKey]) {
  1490. el[enterCbKey]();
  1491. }
  1492. }
  1493. function recordPosition(c) {
  1494. newPositionMap.set(c, getPosition(c.el));
  1495. }
  1496. function applyTranslation(c) {
  1497. const oldPos = positionMap.get(c);
  1498. const newPos = newPositionMap.get(c);
  1499. const dx = oldPos.left - newPos.left;
  1500. const dy = oldPos.top - newPos.top;
  1501. if (dx || dy) {
  1502. const el = c.el;
  1503. const s = el.style;
  1504. const rect = el.getBoundingClientRect();
  1505. let scaleX = 1;
  1506. let scaleY = 1;
  1507. if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
  1508. if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
  1509. if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
  1510. if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
  1511. if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
  1512. if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
  1513. s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
  1514. s.transitionDuration = "0s";
  1515. return c;
  1516. }
  1517. }
  1518. function getPosition(el) {
  1519. const rect = el.getBoundingClientRect();
  1520. return {
  1521. left: rect.left,
  1522. top: rect.top
  1523. };
  1524. }
  1525. function hasCSSTransform(el, root, moveClass) {
  1526. const clone = el.cloneNode();
  1527. const _vtc = el[vtcKey];
  1528. if (_vtc) {
  1529. _vtc.forEach((cls) => {
  1530. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  1531. });
  1532. }
  1533. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  1534. clone.style.display = "none";
  1535. const container = root.nodeType === 1 ? root : root.parentNode;
  1536. container.appendChild(clone);
  1537. const { hasTransform } = getTransitionInfo(clone);
  1538. container.removeChild(clone);
  1539. return hasTransform;
  1540. }
  1541. const getModelAssigner = (vnode) => {
  1542. const fn = vnode.props["onUpdate:modelValue"] || false;
  1543. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  1544. };
  1545. function onCompositionStart(e) {
  1546. e.target.composing = true;
  1547. }
  1548. function onCompositionEnd(e) {
  1549. const target = e.target;
  1550. if (target.composing) {
  1551. target.composing = false;
  1552. target.dispatchEvent(new Event("input"));
  1553. }
  1554. }
  1555. const assignKey = /* @__PURE__ */ Symbol("_assign");
  1556. function castValue(value, trim, number) {
  1557. if (trim) value = value.trim();
  1558. if (number) value = looseToNumber(value);
  1559. return value;
  1560. }
  1561. const vModelText = {
  1562. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  1563. el[assignKey] = getModelAssigner(vnode);
  1564. const castToNumber = number || vnode.props && vnode.props.type === "number";
  1565. addEventListener(el, lazy ? "change" : "input", (e) => {
  1566. if (e.target.composing) return;
  1567. el[assignKey](castValue(el.value, trim, castToNumber));
  1568. });
  1569. if (trim || castToNumber) {
  1570. addEventListener(el, "change", () => {
  1571. el.value = castValue(el.value, trim, castToNumber);
  1572. });
  1573. }
  1574. if (!lazy) {
  1575. addEventListener(el, "compositionstart", onCompositionStart);
  1576. addEventListener(el, "compositionend", onCompositionEnd);
  1577. addEventListener(el, "change", onCompositionEnd);
  1578. }
  1579. },
  1580. // set value on mounted so it's after min/max for type="range"
  1581. mounted(el, { value }) {
  1582. el.value = value == null ? "" : value;
  1583. },
  1584. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  1585. el[assignKey] = getModelAssigner(vnode);
  1586. if (el.composing) return;
  1587. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  1588. const newValue = value == null ? "" : value;
  1589. if (elValue === newValue) {
  1590. return;
  1591. }
  1592. const rootNode = el.getRootNode();
  1593. if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
  1594. if (lazy && value === oldValue) {
  1595. return;
  1596. }
  1597. if (trim && el.value.trim() === newValue) {
  1598. return;
  1599. }
  1600. }
  1601. el.value = newValue;
  1602. }
  1603. };
  1604. const vModelCheckbox = {
  1605. // #4096 array checkboxes need to be deep traversed
  1606. deep: true,
  1607. created(el, _, vnode) {
  1608. el[assignKey] = getModelAssigner(vnode);
  1609. addEventListener(el, "change", () => {
  1610. const modelValue = el._modelValue;
  1611. const elementValue = getValue(el);
  1612. const checked = el.checked;
  1613. const assign = el[assignKey];
  1614. if (isArray(modelValue)) {
  1615. const index = looseIndexOf(modelValue, elementValue);
  1616. const found = index !== -1;
  1617. if (checked && !found) {
  1618. assign(modelValue.concat(elementValue));
  1619. } else if (!checked && found) {
  1620. const filtered = [...modelValue];
  1621. filtered.splice(index, 1);
  1622. assign(filtered);
  1623. }
  1624. } else if (isSet(modelValue)) {
  1625. const cloned = new Set(modelValue);
  1626. if (checked) {
  1627. cloned.add(elementValue);
  1628. } else {
  1629. cloned.delete(elementValue);
  1630. }
  1631. assign(cloned);
  1632. } else {
  1633. assign(getCheckboxValue(el, checked));
  1634. }
  1635. });
  1636. },
  1637. // set initial checked on mount to wait for true-value/false-value
  1638. mounted: setChecked,
  1639. beforeUpdate(el, binding, vnode) {
  1640. el[assignKey] = getModelAssigner(vnode);
  1641. setChecked(el, binding, vnode);
  1642. }
  1643. };
  1644. function setChecked(el, { value, oldValue }, vnode) {
  1645. el._modelValue = value;
  1646. let checked;
  1647. if (isArray(value)) {
  1648. checked = looseIndexOf(value, vnode.props.value) > -1;
  1649. } else if (isSet(value)) {
  1650. checked = value.has(vnode.props.value);
  1651. } else {
  1652. if (value === oldValue) return;
  1653. checked = looseEqual(value, getCheckboxValue(el, true));
  1654. }
  1655. if (el.checked !== checked) {
  1656. el.checked = checked;
  1657. }
  1658. }
  1659. const vModelRadio = {
  1660. created(el, { value }, vnode) {
  1661. el.checked = looseEqual(value, vnode.props.value);
  1662. el[assignKey] = getModelAssigner(vnode);
  1663. addEventListener(el, "change", () => {
  1664. el[assignKey](getValue(el));
  1665. });
  1666. },
  1667. beforeUpdate(el, { value, oldValue }, vnode) {
  1668. el[assignKey] = getModelAssigner(vnode);
  1669. if (value !== oldValue) {
  1670. el.checked = looseEqual(value, vnode.props.value);
  1671. }
  1672. }
  1673. };
  1674. const vModelSelect = {
  1675. // <select multiple> value need to be deep traversed
  1676. deep: true,
  1677. created(el, { value, modifiers: { number } }, vnode) {
  1678. const isSetModel = isSet(value);
  1679. addEventListener(el, "change", () => {
  1680. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  1681. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  1682. );
  1683. el[assignKey](
  1684. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  1685. );
  1686. el._assigning = true;
  1687. nextTick(() => {
  1688. el._assigning = false;
  1689. });
  1690. });
  1691. el[assignKey] = getModelAssigner(vnode);
  1692. },
  1693. // set value in mounted & updated because <select> relies on its children
  1694. // <option>s.
  1695. mounted(el, { value }) {
  1696. setSelected(el, value);
  1697. },
  1698. beforeUpdate(el, _binding, vnode) {
  1699. el[assignKey] = getModelAssigner(vnode);
  1700. },
  1701. updated(el, { value }) {
  1702. if (!el._assigning) {
  1703. setSelected(el, value);
  1704. }
  1705. }
  1706. };
  1707. function setSelected(el, value) {
  1708. const isMultiple = el.multiple;
  1709. const isArrayValue = isArray(value);
  1710. if (isMultiple && !isArrayValue && !isSet(value)) {
  1711. !!(process.env.NODE_ENV !== "production") && warn(
  1712. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  1713. );
  1714. return;
  1715. }
  1716. for (let i = 0, l = el.options.length; i < l; i++) {
  1717. const option = el.options[i];
  1718. const optionValue = getValue(option);
  1719. if (isMultiple) {
  1720. if (isArrayValue) {
  1721. const optionType = typeof optionValue;
  1722. if (optionType === "string" || optionType === "number") {
  1723. option.selected = value.some((v) => String(v) === String(optionValue));
  1724. } else {
  1725. option.selected = looseIndexOf(value, optionValue) > -1;
  1726. }
  1727. } else {
  1728. option.selected = value.has(optionValue);
  1729. }
  1730. } else if (looseEqual(getValue(option), value)) {
  1731. if (el.selectedIndex !== i) el.selectedIndex = i;
  1732. return;
  1733. }
  1734. }
  1735. if (!isMultiple && el.selectedIndex !== -1) {
  1736. el.selectedIndex = -1;
  1737. }
  1738. }
  1739. function getValue(el) {
  1740. return "_value" in el ? el._value : el.value;
  1741. }
  1742. function getCheckboxValue(el, checked) {
  1743. const key = checked ? "_trueValue" : "_falseValue";
  1744. return key in el ? el[key] : checked;
  1745. }
  1746. const vModelDynamic = {
  1747. created(el, binding, vnode) {
  1748. callModelHook(el, binding, vnode, null, "created");
  1749. },
  1750. mounted(el, binding, vnode) {
  1751. callModelHook(el, binding, vnode, null, "mounted");
  1752. },
  1753. beforeUpdate(el, binding, vnode, prevVNode) {
  1754. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  1755. },
  1756. updated(el, binding, vnode, prevVNode) {
  1757. callModelHook(el, binding, vnode, prevVNode, "updated");
  1758. }
  1759. };
  1760. function resolveDynamicModel(tagName, type) {
  1761. switch (tagName) {
  1762. case "SELECT":
  1763. return vModelSelect;
  1764. case "TEXTAREA":
  1765. return vModelText;
  1766. default:
  1767. switch (type) {
  1768. case "checkbox":
  1769. return vModelCheckbox;
  1770. case "radio":
  1771. return vModelRadio;
  1772. default:
  1773. return vModelText;
  1774. }
  1775. }
  1776. }
  1777. function callModelHook(el, binding, vnode, prevVNode, hook) {
  1778. const modelToUse = resolveDynamicModel(
  1779. el.tagName,
  1780. vnode.props && vnode.props.type
  1781. );
  1782. const fn = modelToUse[hook];
  1783. fn && fn(el, binding, vnode, prevVNode);
  1784. }
  1785. function initVModelForSSR() {
  1786. vModelText.getSSRProps = ({ value }) => ({ value });
  1787. vModelRadio.getSSRProps = ({ value }, vnode) => {
  1788. if (vnode.props && looseEqual(vnode.props.value, value)) {
  1789. return { checked: true };
  1790. }
  1791. };
  1792. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  1793. if (isArray(value)) {
  1794. if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {
  1795. return { checked: true };
  1796. }
  1797. } else if (isSet(value)) {
  1798. if (vnode.props && value.has(vnode.props.value)) {
  1799. return { checked: true };
  1800. }
  1801. } else if (value) {
  1802. return { checked: true };
  1803. }
  1804. };
  1805. vModelDynamic.getSSRProps = (binding, vnode) => {
  1806. if (typeof vnode.type !== "string") {
  1807. return;
  1808. }
  1809. const modelToUse = resolveDynamicModel(
  1810. // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
  1811. vnode.type.toUpperCase(),
  1812. vnode.props && vnode.props.type
  1813. );
  1814. if (modelToUse.getSSRProps) {
  1815. return modelToUse.getSSRProps(binding, vnode);
  1816. }
  1817. };
  1818. }
  1819. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  1820. const modifierGuards = {
  1821. stop: (e) => e.stopPropagation(),
  1822. prevent: (e) => e.preventDefault(),
  1823. self: (e) => e.target !== e.currentTarget,
  1824. ctrl: (e) => !e.ctrlKey,
  1825. shift: (e) => !e.shiftKey,
  1826. alt: (e) => !e.altKey,
  1827. meta: (e) => !e.metaKey,
  1828. left: (e) => "button" in e && e.button !== 0,
  1829. middle: (e) => "button" in e && e.button !== 1,
  1830. right: (e) => "button" in e && e.button !== 2,
  1831. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  1832. };
  1833. const withModifiers = (fn, modifiers) => {
  1834. if (!fn) return fn;
  1835. const cache = fn._withMods || (fn._withMods = {});
  1836. const cacheKey = modifiers.join(".");
  1837. return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
  1838. for (let i = 0; i < modifiers.length; i++) {
  1839. const guard = modifierGuards[modifiers[i]];
  1840. if (guard && guard(event, modifiers)) return;
  1841. }
  1842. return fn(event, ...args);
  1843. }));
  1844. };
  1845. const keyNames = {
  1846. esc: "escape",
  1847. space: " ",
  1848. up: "arrow-up",
  1849. left: "arrow-left",
  1850. right: "arrow-right",
  1851. down: "arrow-down",
  1852. delete: "backspace"
  1853. };
  1854. const withKeys = (fn, modifiers) => {
  1855. const cache = fn._withKeys || (fn._withKeys = {});
  1856. const cacheKey = modifiers.join(".");
  1857. return cache[cacheKey] || (cache[cacheKey] = ((event) => {
  1858. if (!("key" in event)) {
  1859. return;
  1860. }
  1861. const eventKey = hyphenate(event.key);
  1862. if (modifiers.some(
  1863. (k) => k === eventKey || keyNames[k] === eventKey
  1864. )) {
  1865. return fn(event);
  1866. }
  1867. }));
  1868. };
  1869. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  1870. let renderer;
  1871. let enabledHydration = false;
  1872. function ensureRenderer() {
  1873. return renderer || (renderer = createRenderer(rendererOptions));
  1874. }
  1875. function ensureHydrationRenderer() {
  1876. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  1877. enabledHydration = true;
  1878. return renderer;
  1879. }
  1880. const render = ((...args) => {
  1881. ensureRenderer().render(...args);
  1882. });
  1883. const hydrate = ((...args) => {
  1884. ensureHydrationRenderer().hydrate(...args);
  1885. });
  1886. const createApp = ((...args) => {
  1887. const app = ensureRenderer().createApp(...args);
  1888. if (!!(process.env.NODE_ENV !== "production")) {
  1889. injectNativeTagCheck(app);
  1890. injectCompilerOptionsCheck(app);
  1891. }
  1892. const { mount } = app;
  1893. app.mount = (containerOrSelector) => {
  1894. const container = normalizeContainer(containerOrSelector);
  1895. if (!container) return;
  1896. const component = app._component;
  1897. if (!isFunction(component) && !component.render && !component.template) {
  1898. component.template = container.innerHTML;
  1899. }
  1900. if (container.nodeType === 1) {
  1901. container.textContent = "";
  1902. }
  1903. const proxy = mount(container, false, resolveRootNamespace(container));
  1904. if (container instanceof Element) {
  1905. container.removeAttribute("v-cloak");
  1906. container.setAttribute("data-v-app", "");
  1907. }
  1908. return proxy;
  1909. };
  1910. return app;
  1911. });
  1912. const createSSRApp = ((...args) => {
  1913. const app = ensureHydrationRenderer().createApp(...args);
  1914. if (!!(process.env.NODE_ENV !== "production")) {
  1915. injectNativeTagCheck(app);
  1916. injectCompilerOptionsCheck(app);
  1917. }
  1918. const { mount } = app;
  1919. app.mount = (containerOrSelector) => {
  1920. const container = normalizeContainer(containerOrSelector);
  1921. if (container) {
  1922. return mount(container, true, resolveRootNamespace(container));
  1923. }
  1924. };
  1925. return app;
  1926. });
  1927. function resolveRootNamespace(container) {
  1928. if (container instanceof SVGElement) {
  1929. return "svg";
  1930. }
  1931. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  1932. return "mathml";
  1933. }
  1934. }
  1935. function injectNativeTagCheck(app) {
  1936. Object.defineProperty(app.config, "isNativeTag", {
  1937. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  1938. writable: false
  1939. });
  1940. }
  1941. function injectCompilerOptionsCheck(app) {
  1942. if (isRuntimeOnly()) {
  1943. const isCustomElement = app.config.isCustomElement;
  1944. Object.defineProperty(app.config, "isCustomElement", {
  1945. get() {
  1946. return isCustomElement;
  1947. },
  1948. set() {
  1949. warn(
  1950. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  1951. );
  1952. }
  1953. });
  1954. const compilerOptions = app.config.compilerOptions;
  1955. 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.
  1956. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  1957. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  1958. - 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`;
  1959. Object.defineProperty(app.config, "compilerOptions", {
  1960. get() {
  1961. warn(msg);
  1962. return compilerOptions;
  1963. },
  1964. set() {
  1965. warn(msg);
  1966. }
  1967. });
  1968. }
  1969. }
  1970. function normalizeContainer(container) {
  1971. if (isString(container)) {
  1972. const res = document.querySelector(container);
  1973. if (!!(process.env.NODE_ENV !== "production") && !res) {
  1974. warn(
  1975. `Failed to mount app: mount target selector "${container}" returned null.`
  1976. );
  1977. }
  1978. return res;
  1979. }
  1980. if (!!(process.env.NODE_ENV !== "production") && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  1981. warn(
  1982. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  1983. );
  1984. }
  1985. return container;
  1986. }
  1987. let ssrDirectiveInitialized = false;
  1988. const initDirectivesForSSR = () => {
  1989. if (!ssrDirectiveInitialized) {
  1990. ssrDirectiveInitialized = true;
  1991. initVModelForSSR();
  1992. initVShowForSSR();
  1993. }
  1994. } ;
  1995. export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, nodeOps, patchProp, render, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };