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

reactivity.cjs.js 53KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055
  1. /**
  2. * @vue/reactivity v3.5.38
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. 'use strict';
  7. Object.defineProperty(exports, '__esModule', { value: true });
  8. var shared = require('@vue/shared');
  9. function warn(msg, ...args) {
  10. console.warn(`[Vue warn] ${msg}`, ...args);
  11. }
  12. let activeEffectScope;
  13. class EffectScope {
  14. // TODO isolatedDeclarations "__v_skip"
  15. constructor(detached = false) {
  16. this.detached = detached;
  17. /**
  18. * @internal
  19. */
  20. this._active = true;
  21. /**
  22. * @internal track `on` calls, allow `on` call multiple times
  23. */
  24. this._on = 0;
  25. /**
  26. * @internal
  27. */
  28. this.effects = [];
  29. /**
  30. * @internal
  31. */
  32. this.cleanups = [];
  33. this._isPaused = false;
  34. this._warnOnRun = true;
  35. this.__v_skip = true;
  36. if (!detached && activeEffectScope) {
  37. if (activeEffectScope.active) {
  38. this.parent = activeEffectScope;
  39. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  40. this
  41. ) - 1;
  42. } else {
  43. this._active = false;
  44. this._warnOnRun = false;
  45. }
  46. }
  47. }
  48. get active() {
  49. return this._active;
  50. }
  51. pause() {
  52. if (this._active) {
  53. this._isPaused = true;
  54. let i, l;
  55. if (this.scopes) {
  56. for (i = 0, l = this.scopes.length; i < l; i++) {
  57. this.scopes[i].pause();
  58. }
  59. }
  60. for (i = 0, l = this.effects.length; i < l; i++) {
  61. this.effects[i].pause();
  62. }
  63. }
  64. }
  65. /**
  66. * Resumes the effect scope, including all child scopes and effects.
  67. */
  68. resume() {
  69. if (this._active) {
  70. if (this._isPaused) {
  71. this._isPaused = false;
  72. let i, l;
  73. if (this.scopes) {
  74. for (i = 0, l = this.scopes.length; i < l; i++) {
  75. this.scopes[i].resume();
  76. }
  77. }
  78. for (i = 0, l = this.effects.length; i < l; i++) {
  79. this.effects[i].resume();
  80. }
  81. }
  82. }
  83. }
  84. run(fn) {
  85. if (this._active) {
  86. const currentEffectScope = activeEffectScope;
  87. try {
  88. activeEffectScope = this;
  89. return fn();
  90. } finally {
  91. activeEffectScope = currentEffectScope;
  92. }
  93. } else if (this._warnOnRun) {
  94. warn(`cannot run an inactive effect scope.`);
  95. }
  96. }
  97. /**
  98. * This should only be called on non-detached scopes
  99. * @internal
  100. */
  101. on() {
  102. if (++this._on === 1) {
  103. this.prevScope = activeEffectScope;
  104. activeEffectScope = this;
  105. }
  106. }
  107. /**
  108. * This should only be called on non-detached scopes
  109. * @internal
  110. */
  111. off() {
  112. if (this._on > 0 && --this._on === 0) {
  113. if (activeEffectScope === this) {
  114. activeEffectScope = this.prevScope;
  115. } else {
  116. let current = activeEffectScope;
  117. while (current) {
  118. if (current.prevScope === this) {
  119. current.prevScope = this.prevScope;
  120. break;
  121. }
  122. current = current.prevScope;
  123. }
  124. }
  125. this.prevScope = void 0;
  126. }
  127. }
  128. stop(fromParent) {
  129. if (this._active) {
  130. this._active = false;
  131. let i, l;
  132. for (i = 0, l = this.effects.length; i < l; i++) {
  133. this.effects[i].stop();
  134. }
  135. this.effects.length = 0;
  136. for (i = 0, l = this.cleanups.length; i < l; i++) {
  137. this.cleanups[i]();
  138. }
  139. this.cleanups.length = 0;
  140. if (this.scopes) {
  141. for (i = 0, l = this.scopes.length; i < l; i++) {
  142. this.scopes[i].stop(true);
  143. }
  144. this.scopes.length = 0;
  145. }
  146. if (!this.detached && this.parent && !fromParent) {
  147. const last = this.parent.scopes.pop();
  148. if (last && last !== this) {
  149. this.parent.scopes[this.index] = last;
  150. last.index = this.index;
  151. }
  152. }
  153. this.parent = void 0;
  154. }
  155. }
  156. }
  157. function effectScope(detached) {
  158. return new EffectScope(detached);
  159. }
  160. function getCurrentScope() {
  161. return activeEffectScope;
  162. }
  163. function onScopeDispose(fn, failSilently = false) {
  164. if (activeEffectScope) {
  165. activeEffectScope.cleanups.push(fn);
  166. } else if (!failSilently) {
  167. warn(
  168. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  169. );
  170. }
  171. }
  172. let activeSub;
  173. const EffectFlags = {
  174. "ACTIVE": 1,
  175. "1": "ACTIVE",
  176. "RUNNING": 2,
  177. "2": "RUNNING",
  178. "TRACKING": 4,
  179. "4": "TRACKING",
  180. "NOTIFIED": 8,
  181. "8": "NOTIFIED",
  182. "DIRTY": 16,
  183. "16": "DIRTY",
  184. "ALLOW_RECURSE": 32,
  185. "32": "ALLOW_RECURSE",
  186. "PAUSED": 64,
  187. "64": "PAUSED",
  188. "EVALUATED": 128,
  189. "128": "EVALUATED"
  190. };
  191. const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
  192. class ReactiveEffect {
  193. constructor(fn) {
  194. this.fn = fn;
  195. /**
  196. * @internal
  197. */
  198. this.deps = void 0;
  199. /**
  200. * @internal
  201. */
  202. this.depsTail = void 0;
  203. /**
  204. * @internal
  205. */
  206. this.flags = 1 | 4;
  207. /**
  208. * @internal
  209. */
  210. this.next = void 0;
  211. /**
  212. * @internal
  213. */
  214. this.cleanup = void 0;
  215. this.scheduler = void 0;
  216. if (activeEffectScope) {
  217. if (activeEffectScope.active) {
  218. activeEffectScope.effects.push(this);
  219. } else {
  220. this.flags &= -2;
  221. }
  222. }
  223. }
  224. pause() {
  225. this.flags |= 64;
  226. }
  227. resume() {
  228. if (this.flags & 64) {
  229. this.flags &= -65;
  230. if (pausedQueueEffects.has(this)) {
  231. pausedQueueEffects.delete(this);
  232. this.trigger();
  233. }
  234. }
  235. }
  236. /**
  237. * @internal
  238. */
  239. notify() {
  240. if (this.flags & 2 && !(this.flags & 32)) {
  241. return;
  242. }
  243. if (!(this.flags & 8)) {
  244. batch(this);
  245. }
  246. }
  247. run() {
  248. if (!(this.flags & 1)) {
  249. return this.fn();
  250. }
  251. this.flags |= 2;
  252. cleanupEffect(this);
  253. prepareDeps(this);
  254. const prevEffect = activeSub;
  255. const prevShouldTrack = shouldTrack;
  256. activeSub = this;
  257. shouldTrack = true;
  258. try {
  259. return this.fn();
  260. } finally {
  261. if (activeSub !== this) {
  262. warn(
  263. "Active effect was not restored correctly - this is likely a Vue internal bug."
  264. );
  265. }
  266. cleanupDeps(this);
  267. activeSub = prevEffect;
  268. shouldTrack = prevShouldTrack;
  269. this.flags &= -3;
  270. }
  271. }
  272. stop() {
  273. if (this.flags & 1) {
  274. for (let link = this.deps; link; link = link.nextDep) {
  275. removeSub(link);
  276. }
  277. this.deps = this.depsTail = void 0;
  278. cleanupEffect(this);
  279. this.onStop && this.onStop();
  280. this.flags &= -2;
  281. }
  282. }
  283. trigger() {
  284. if (this.flags & 64) {
  285. pausedQueueEffects.add(this);
  286. } else if (this.scheduler) {
  287. this.scheduler();
  288. } else {
  289. this.runIfDirty();
  290. }
  291. }
  292. /**
  293. * @internal
  294. */
  295. runIfDirty() {
  296. if (isDirty(this)) {
  297. this.run();
  298. }
  299. }
  300. get dirty() {
  301. return isDirty(this);
  302. }
  303. }
  304. let batchDepth = 0;
  305. let batchedSub;
  306. let batchedComputed;
  307. function batch(sub, isComputed = false) {
  308. sub.flags |= 8;
  309. if (isComputed) {
  310. sub.next = batchedComputed;
  311. batchedComputed = sub;
  312. return;
  313. }
  314. sub.next = batchedSub;
  315. batchedSub = sub;
  316. }
  317. function startBatch() {
  318. batchDepth++;
  319. }
  320. function endBatch() {
  321. if (--batchDepth > 0) {
  322. return;
  323. }
  324. if (batchedComputed) {
  325. let e = batchedComputed;
  326. batchedComputed = void 0;
  327. while (e) {
  328. const next = e.next;
  329. e.next = void 0;
  330. e.flags &= -9;
  331. e = next;
  332. }
  333. }
  334. let error;
  335. while (batchedSub) {
  336. let e = batchedSub;
  337. batchedSub = void 0;
  338. while (e) {
  339. const next = e.next;
  340. e.next = void 0;
  341. e.flags &= -9;
  342. if (e.flags & 1) {
  343. try {
  344. ;
  345. e.trigger();
  346. } catch (err) {
  347. if (!error) error = err;
  348. }
  349. }
  350. e = next;
  351. }
  352. }
  353. if (error) throw error;
  354. }
  355. function prepareDeps(sub) {
  356. for (let link = sub.deps; link; link = link.nextDep) {
  357. link.version = -1;
  358. link.prevActiveLink = link.dep.activeLink;
  359. link.dep.activeLink = link;
  360. }
  361. }
  362. function cleanupDeps(sub) {
  363. let head;
  364. let tail = sub.depsTail;
  365. let link = tail;
  366. while (link) {
  367. const prev = link.prevDep;
  368. if (link.version === -1) {
  369. if (link === tail) tail = prev;
  370. removeSub(link);
  371. removeDep(link);
  372. } else {
  373. head = link;
  374. }
  375. link.dep.activeLink = link.prevActiveLink;
  376. link.prevActiveLink = void 0;
  377. link = prev;
  378. }
  379. sub.deps = head;
  380. sub.depsTail = tail;
  381. }
  382. function isDirty(sub) {
  383. for (let link = sub.deps; link; link = link.nextDep) {
  384. if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
  385. return true;
  386. }
  387. }
  388. if (sub._dirty) {
  389. return true;
  390. }
  391. return false;
  392. }
  393. function refreshComputed(computed) {
  394. if (computed.flags & 4 && !(computed.flags & 16)) {
  395. return;
  396. }
  397. computed.flags &= -17;
  398. if (computed.globalVersion === globalVersion) {
  399. return;
  400. }
  401. computed.globalVersion = globalVersion;
  402. if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
  403. return;
  404. }
  405. computed.flags |= 2;
  406. const dep = computed.dep;
  407. const prevSub = activeSub;
  408. const prevShouldTrack = shouldTrack;
  409. activeSub = computed;
  410. shouldTrack = true;
  411. try {
  412. prepareDeps(computed);
  413. const value = computed.fn(computed._value);
  414. if (dep.version === 0 || shared.hasChanged(value, computed._value)) {
  415. computed.flags |= 128;
  416. computed._value = value;
  417. dep.version++;
  418. }
  419. } catch (err) {
  420. dep.version++;
  421. throw err;
  422. } finally {
  423. activeSub = prevSub;
  424. shouldTrack = prevShouldTrack;
  425. cleanupDeps(computed);
  426. computed.flags &= -3;
  427. }
  428. }
  429. function removeSub(link, soft = false) {
  430. const { dep, prevSub, nextSub } = link;
  431. if (prevSub) {
  432. prevSub.nextSub = nextSub;
  433. link.prevSub = void 0;
  434. }
  435. if (nextSub) {
  436. nextSub.prevSub = prevSub;
  437. link.nextSub = void 0;
  438. }
  439. if (dep.subsHead === link) {
  440. dep.subsHead = nextSub;
  441. }
  442. if (dep.subs === link) {
  443. dep.subs = prevSub;
  444. if (!prevSub && dep.computed) {
  445. dep.computed.flags &= -5;
  446. for (let l = dep.computed.deps; l; l = l.nextDep) {
  447. removeSub(l, true);
  448. }
  449. }
  450. }
  451. if (!soft && !--dep.sc && dep.map) {
  452. dep.map.delete(dep.key);
  453. }
  454. }
  455. function removeDep(link) {
  456. const { prevDep, nextDep } = link;
  457. if (prevDep) {
  458. prevDep.nextDep = nextDep;
  459. link.prevDep = void 0;
  460. }
  461. if (nextDep) {
  462. nextDep.prevDep = prevDep;
  463. link.nextDep = void 0;
  464. }
  465. }
  466. function effect(fn, options) {
  467. if (fn.effect instanceof ReactiveEffect) {
  468. fn = fn.effect.fn;
  469. }
  470. const e = new ReactiveEffect(fn);
  471. if (options) {
  472. shared.extend(e, options);
  473. }
  474. try {
  475. e.run();
  476. } catch (err) {
  477. e.stop();
  478. throw err;
  479. }
  480. const runner = e.run.bind(e);
  481. runner.effect = e;
  482. return runner;
  483. }
  484. function stop(runner) {
  485. runner.effect.stop();
  486. }
  487. let shouldTrack = true;
  488. const trackStack = [];
  489. function pauseTracking() {
  490. trackStack.push(shouldTrack);
  491. shouldTrack = false;
  492. }
  493. function enableTracking() {
  494. trackStack.push(shouldTrack);
  495. shouldTrack = true;
  496. }
  497. function resetTracking() {
  498. const last = trackStack.pop();
  499. shouldTrack = last === void 0 ? true : last;
  500. }
  501. function onEffectCleanup(fn, failSilently = false) {
  502. if (activeSub instanceof ReactiveEffect) {
  503. activeSub.cleanup = fn;
  504. } else if (!failSilently) {
  505. warn(
  506. `onEffectCleanup() was called when there was no active effect to associate with.`
  507. );
  508. }
  509. }
  510. function cleanupEffect(e) {
  511. const { cleanup } = e;
  512. e.cleanup = void 0;
  513. if (cleanup) {
  514. const prevSub = activeSub;
  515. activeSub = void 0;
  516. try {
  517. cleanup();
  518. } finally {
  519. activeSub = prevSub;
  520. }
  521. }
  522. }
  523. let globalVersion = 0;
  524. class Link {
  525. constructor(sub, dep) {
  526. this.sub = sub;
  527. this.dep = dep;
  528. this.version = dep.version;
  529. this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  530. }
  531. }
  532. class Dep {
  533. // TODO isolatedDeclarations "__v_skip"
  534. constructor(computed) {
  535. this.computed = computed;
  536. this.version = 0;
  537. /**
  538. * Link between this dep and the current active effect
  539. */
  540. this.activeLink = void 0;
  541. /**
  542. * Doubly linked list representing the subscribing effects (tail)
  543. */
  544. this.subs = void 0;
  545. /**
  546. * For object property deps cleanup
  547. */
  548. this.map = void 0;
  549. this.key = void 0;
  550. /**
  551. * Subscriber counter
  552. */
  553. this.sc = 0;
  554. /**
  555. * @internal
  556. */
  557. this.__v_skip = true;
  558. {
  559. this.subsHead = void 0;
  560. }
  561. }
  562. track(debugInfo) {
  563. if (!activeSub || !shouldTrack || activeSub === this.computed) {
  564. return;
  565. }
  566. let link = this.activeLink;
  567. if (link === void 0 || link.sub !== activeSub) {
  568. link = this.activeLink = new Link(activeSub, this);
  569. if (!activeSub.deps) {
  570. activeSub.deps = activeSub.depsTail = link;
  571. } else {
  572. link.prevDep = activeSub.depsTail;
  573. activeSub.depsTail.nextDep = link;
  574. activeSub.depsTail = link;
  575. }
  576. addSub(link);
  577. } else if (link.version === -1) {
  578. link.version = this.version;
  579. if (link.nextDep) {
  580. const next = link.nextDep;
  581. next.prevDep = link.prevDep;
  582. if (link.prevDep) {
  583. link.prevDep.nextDep = next;
  584. }
  585. link.prevDep = activeSub.depsTail;
  586. link.nextDep = void 0;
  587. activeSub.depsTail.nextDep = link;
  588. activeSub.depsTail = link;
  589. if (activeSub.deps === link) {
  590. activeSub.deps = next;
  591. }
  592. }
  593. }
  594. if (activeSub.onTrack) {
  595. activeSub.onTrack(
  596. shared.extend(
  597. {
  598. effect: activeSub
  599. },
  600. debugInfo
  601. )
  602. );
  603. }
  604. return link;
  605. }
  606. trigger(debugInfo) {
  607. this.version++;
  608. globalVersion++;
  609. this.notify(debugInfo);
  610. }
  611. notify(debugInfo) {
  612. startBatch();
  613. try {
  614. if (true) {
  615. for (let head = this.subsHead; head; head = head.nextSub) {
  616. if (head.sub.onTrigger && !(head.sub.flags & 8)) {
  617. head.sub.onTrigger(
  618. shared.extend(
  619. {
  620. effect: head.sub
  621. },
  622. debugInfo
  623. )
  624. );
  625. }
  626. }
  627. }
  628. for (let link = this.subs; link; link = link.prevSub) {
  629. if (link.sub.notify()) {
  630. ;
  631. link.sub.dep.notify();
  632. }
  633. }
  634. } finally {
  635. endBatch();
  636. }
  637. }
  638. }
  639. function addSub(link) {
  640. link.dep.sc++;
  641. if (link.sub.flags & 4) {
  642. const computed = link.dep.computed;
  643. if (computed && !link.dep.subs) {
  644. computed.flags |= 4 | 16;
  645. for (let l = computed.deps; l; l = l.nextDep) {
  646. addSub(l);
  647. }
  648. }
  649. const currentTail = link.dep.subs;
  650. if (currentTail !== link) {
  651. link.prevSub = currentTail;
  652. if (currentTail) currentTail.nextSub = link;
  653. }
  654. if (link.dep.subsHead === void 0) {
  655. link.dep.subsHead = link;
  656. }
  657. link.dep.subs = link;
  658. }
  659. }
  660. const targetMap = /* @__PURE__ */ new WeakMap();
  661. const ITERATE_KEY = /* @__PURE__ */ Symbol(
  662. "Object iterate"
  663. );
  664. const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  665. "Map keys iterate"
  666. );
  667. const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  668. "Array iterate"
  669. );
  670. function track(target, type, key) {
  671. if (shouldTrack && activeSub) {
  672. let depsMap = targetMap.get(target);
  673. if (!depsMap) {
  674. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  675. }
  676. let dep = depsMap.get(key);
  677. if (!dep) {
  678. depsMap.set(key, dep = new Dep());
  679. dep.map = depsMap;
  680. dep.key = key;
  681. }
  682. {
  683. dep.track({
  684. target,
  685. type,
  686. key
  687. });
  688. }
  689. }
  690. }
  691. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  692. const depsMap = targetMap.get(target);
  693. if (!depsMap) {
  694. globalVersion++;
  695. return;
  696. }
  697. const run = (dep) => {
  698. if (dep) {
  699. {
  700. dep.trigger({
  701. target,
  702. type,
  703. key,
  704. newValue,
  705. oldValue,
  706. oldTarget
  707. });
  708. }
  709. }
  710. };
  711. startBatch();
  712. if (type === "clear") {
  713. depsMap.forEach(run);
  714. } else {
  715. const targetIsArray = shared.isArray(target);
  716. const isArrayIndex = targetIsArray && shared.isIntegerKey(key);
  717. if (targetIsArray && key === "length") {
  718. const newLength = Number(newValue);
  719. depsMap.forEach((dep, key2) => {
  720. if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !shared.isSymbol(key2) && key2 >= newLength) {
  721. run(dep);
  722. }
  723. });
  724. } else {
  725. if (key !== void 0 || depsMap.has(void 0)) {
  726. run(depsMap.get(key));
  727. }
  728. if (isArrayIndex) {
  729. run(depsMap.get(ARRAY_ITERATE_KEY));
  730. }
  731. switch (type) {
  732. case "add":
  733. if (!targetIsArray) {
  734. run(depsMap.get(ITERATE_KEY));
  735. if (shared.isMap(target)) {
  736. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  737. }
  738. } else if (isArrayIndex) {
  739. run(depsMap.get("length"));
  740. }
  741. break;
  742. case "delete":
  743. if (!targetIsArray) {
  744. run(depsMap.get(ITERATE_KEY));
  745. if (shared.isMap(target)) {
  746. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  747. }
  748. }
  749. break;
  750. case "set":
  751. if (shared.isMap(target)) {
  752. run(depsMap.get(ITERATE_KEY));
  753. }
  754. break;
  755. }
  756. }
  757. }
  758. endBatch();
  759. }
  760. function getDepFromReactive(object, key) {
  761. const depMap = targetMap.get(object);
  762. return depMap && depMap.get(key);
  763. }
  764. function reactiveReadArray(array) {
  765. const raw = toRaw(array);
  766. if (raw === array) return raw;
  767. track(raw, "iterate", ARRAY_ITERATE_KEY);
  768. return isShallow(array) ? raw : raw.map(toReactive);
  769. }
  770. function shallowReadArray(arr) {
  771. track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
  772. return arr;
  773. }
  774. function toWrapped(target, item) {
  775. if (isReadonly(target)) {
  776. return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
  777. }
  778. return toReactive(item);
  779. }
  780. const arrayInstrumentations = {
  781. __proto__: null,
  782. [Symbol.iterator]() {
  783. return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
  784. },
  785. concat(...args) {
  786. return reactiveReadArray(this).concat(
  787. ...args.map((x) => shared.isArray(x) ? reactiveReadArray(x) : x)
  788. );
  789. },
  790. entries() {
  791. return iterator(this, "entries", (value) => {
  792. value[1] = toWrapped(this, value[1]);
  793. return value;
  794. });
  795. },
  796. every(fn, thisArg) {
  797. return apply(this, "every", fn, thisArg, void 0, arguments);
  798. },
  799. filter(fn, thisArg) {
  800. return apply(
  801. this,
  802. "filter",
  803. fn,
  804. thisArg,
  805. (v) => v.map((item) => toWrapped(this, item)),
  806. arguments
  807. );
  808. },
  809. find(fn, thisArg) {
  810. return apply(
  811. this,
  812. "find",
  813. fn,
  814. thisArg,
  815. (item) => toWrapped(this, item),
  816. arguments
  817. );
  818. },
  819. findIndex(fn, thisArg) {
  820. return apply(this, "findIndex", fn, thisArg, void 0, arguments);
  821. },
  822. findLast(fn, thisArg) {
  823. return apply(
  824. this,
  825. "findLast",
  826. fn,
  827. thisArg,
  828. (item) => toWrapped(this, item),
  829. arguments
  830. );
  831. },
  832. findLastIndex(fn, thisArg) {
  833. return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
  834. },
  835. // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  836. forEach(fn, thisArg) {
  837. return apply(this, "forEach", fn, thisArg, void 0, arguments);
  838. },
  839. includes(...args) {
  840. return searchProxy(this, "includes", args);
  841. },
  842. indexOf(...args) {
  843. return searchProxy(this, "indexOf", args);
  844. },
  845. join(separator) {
  846. return reactiveReadArray(this).join(separator);
  847. },
  848. // keys() iterator only reads `length`, no optimization required
  849. lastIndexOf(...args) {
  850. return searchProxy(this, "lastIndexOf", args);
  851. },
  852. map(fn, thisArg) {
  853. return apply(this, "map", fn, thisArg, void 0, arguments);
  854. },
  855. pop() {
  856. return noTracking(this, "pop");
  857. },
  858. push(...args) {
  859. return noTracking(this, "push", args);
  860. },
  861. reduce(fn, ...args) {
  862. return reduce(this, "reduce", fn, args);
  863. },
  864. reduceRight(fn, ...args) {
  865. return reduce(this, "reduceRight", fn, args);
  866. },
  867. shift() {
  868. return noTracking(this, "shift");
  869. },
  870. // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  871. some(fn, thisArg) {
  872. return apply(this, "some", fn, thisArg, void 0, arguments);
  873. },
  874. splice(...args) {
  875. return noTracking(this, "splice", args);
  876. },
  877. toReversed() {
  878. return reactiveReadArray(this).toReversed();
  879. },
  880. toSorted(comparer) {
  881. return reactiveReadArray(this).toSorted(comparer);
  882. },
  883. toSpliced(...args) {
  884. return reactiveReadArray(this).toSpliced(...args);
  885. },
  886. unshift(...args) {
  887. return noTracking(this, "unshift", args);
  888. },
  889. values() {
  890. return iterator(this, "values", (item) => toWrapped(this, item));
  891. }
  892. };
  893. function iterator(self, method, wrapValue) {
  894. const arr = shallowReadArray(self);
  895. const iter = arr[method]();
  896. if (arr !== self && !isShallow(self)) {
  897. iter._next = iter.next;
  898. iter.next = () => {
  899. const result = iter._next();
  900. if (!result.done) {
  901. result.value = wrapValue(result.value);
  902. }
  903. return result;
  904. };
  905. }
  906. return iter;
  907. }
  908. const arrayProto = Array.prototype;
  909. function apply(self, method, fn, thisArg, wrappedRetFn, args) {
  910. const arr = shallowReadArray(self);
  911. const needsWrap = arr !== self && !isShallow(self);
  912. const methodFn = arr[method];
  913. if (methodFn !== arrayProto[method]) {
  914. const result2 = methodFn.apply(self, args);
  915. return needsWrap ? toReactive(result2) : result2;
  916. }
  917. let wrappedFn = fn;
  918. if (arr !== self) {
  919. if (needsWrap) {
  920. wrappedFn = function(item, index) {
  921. return fn.call(this, toWrapped(self, item), index, self);
  922. };
  923. } else if (fn.length > 2) {
  924. wrappedFn = function(item, index) {
  925. return fn.call(this, item, index, self);
  926. };
  927. }
  928. }
  929. const result = methodFn.call(arr, wrappedFn, thisArg);
  930. return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
  931. }
  932. function reduce(self, method, fn, args) {
  933. const arr = shallowReadArray(self);
  934. const needsWrap = arr !== self && !isShallow(self);
  935. let wrappedFn = fn;
  936. let wrapInitialAccumulator = false;
  937. if (arr !== self) {
  938. if (needsWrap) {
  939. wrapInitialAccumulator = args.length === 0;
  940. wrappedFn = function(acc, item, index) {
  941. if (wrapInitialAccumulator) {
  942. wrapInitialAccumulator = false;
  943. acc = toWrapped(self, acc);
  944. }
  945. return fn.call(this, acc, toWrapped(self, item), index, self);
  946. };
  947. } else if (fn.length > 3) {
  948. wrappedFn = function(acc, item, index) {
  949. return fn.call(this, acc, item, index, self);
  950. };
  951. }
  952. }
  953. const result = arr[method](wrappedFn, ...args);
  954. return wrapInitialAccumulator ? toWrapped(self, result) : result;
  955. }
  956. function searchProxy(self, method, args) {
  957. const arr = toRaw(self);
  958. track(arr, "iterate", ARRAY_ITERATE_KEY);
  959. const res = arr[method](...args);
  960. if ((res === -1 || res === false) && isProxy(args[0])) {
  961. args[0] = toRaw(args[0]);
  962. return arr[method](...args);
  963. }
  964. return res;
  965. }
  966. function noTracking(self, method, args = []) {
  967. pauseTracking();
  968. startBatch();
  969. const res = toRaw(self)[method].apply(self, args);
  970. endBatch();
  971. resetTracking();
  972. return res;
  973. }
  974. const isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`);
  975. const builtInSymbols = new Set(
  976. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(shared.isSymbol)
  977. );
  978. function hasOwnProperty(key) {
  979. if (!shared.isSymbol(key)) key = String(key);
  980. const obj = toRaw(this);
  981. track(obj, "has", key);
  982. return obj.hasOwnProperty(key);
  983. }
  984. class BaseReactiveHandler {
  985. constructor(_isReadonly = false, _isShallow = false) {
  986. this._isReadonly = _isReadonly;
  987. this._isShallow = _isShallow;
  988. }
  989. get(target, key, receiver) {
  990. if (key === "__v_skip") return target["__v_skip"];
  991. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  992. if (key === "__v_isReactive") {
  993. return !isReadonly2;
  994. } else if (key === "__v_isReadonly") {
  995. return isReadonly2;
  996. } else if (key === "__v_isShallow") {
  997. return isShallow2;
  998. } else if (key === "__v_raw") {
  999. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1000. // this means the receiver is a user proxy of the reactive proxy
  1001. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1002. return target;
  1003. }
  1004. return;
  1005. }
  1006. const targetIsArray = shared.isArray(target);
  1007. if (!isReadonly2) {
  1008. let fn;
  1009. if (targetIsArray && (fn = arrayInstrumentations[key])) {
  1010. return fn;
  1011. }
  1012. if (key === "hasOwnProperty") {
  1013. return hasOwnProperty;
  1014. }
  1015. }
  1016. const res = Reflect.get(
  1017. target,
  1018. key,
  1019. // if this is a proxy wrapping a ref, return methods using the raw ref
  1020. // as receiver so that we don't have to call `toRaw` on the ref in all
  1021. // its class methods
  1022. isRef(target) ? target : receiver
  1023. );
  1024. if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1025. return res;
  1026. }
  1027. if (!isReadonly2) {
  1028. track(target, "get", key);
  1029. }
  1030. if (isShallow2) {
  1031. return res;
  1032. }
  1033. if (isRef(res)) {
  1034. const value = targetIsArray && shared.isIntegerKey(key) ? res : res.value;
  1035. return isReadonly2 && shared.isObject(value) ? readonly(value) : value;
  1036. }
  1037. if (shared.isObject(res)) {
  1038. return isReadonly2 ? readonly(res) : reactive(res);
  1039. }
  1040. return res;
  1041. }
  1042. }
  1043. class MutableReactiveHandler extends BaseReactiveHandler {
  1044. constructor(isShallow2 = false) {
  1045. super(false, isShallow2);
  1046. }
  1047. set(target, key, value, receiver) {
  1048. let oldValue = target[key];
  1049. const isArrayWithIntegerKey = shared.isArray(target) && shared.isIntegerKey(key);
  1050. if (!this._isShallow) {
  1051. const isOldValueReadonly = isReadonly(oldValue);
  1052. if (!isShallow(value) && !isReadonly(value)) {
  1053. oldValue = toRaw(oldValue);
  1054. value = toRaw(value);
  1055. }
  1056. if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) {
  1057. if (isOldValueReadonly) {
  1058. {
  1059. warn(
  1060. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1061. target[key]
  1062. );
  1063. }
  1064. return true;
  1065. } else {
  1066. oldValue.value = value;
  1067. return true;
  1068. }
  1069. }
  1070. }
  1071. const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : shared.hasOwn(target, key);
  1072. const result = Reflect.set(
  1073. target,
  1074. key,
  1075. value,
  1076. isRef(target) ? target : receiver
  1077. );
  1078. if (target === toRaw(receiver)) {
  1079. if (!hadKey) {
  1080. trigger(target, "add", key, value);
  1081. } else if (shared.hasChanged(value, oldValue)) {
  1082. trigger(target, "set", key, value, oldValue);
  1083. }
  1084. }
  1085. return result;
  1086. }
  1087. deleteProperty(target, key) {
  1088. const hadKey = shared.hasOwn(target, key);
  1089. const oldValue = target[key];
  1090. const result = Reflect.deleteProperty(target, key);
  1091. if (result && hadKey) {
  1092. trigger(target, "delete", key, void 0, oldValue);
  1093. }
  1094. return result;
  1095. }
  1096. has(target, key) {
  1097. const result = Reflect.has(target, key);
  1098. if (!shared.isSymbol(key) || !builtInSymbols.has(key)) {
  1099. track(target, "has", key);
  1100. }
  1101. return result;
  1102. }
  1103. ownKeys(target) {
  1104. track(
  1105. target,
  1106. "iterate",
  1107. shared.isArray(target) ? "length" : ITERATE_KEY
  1108. );
  1109. return Reflect.ownKeys(target);
  1110. }
  1111. }
  1112. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1113. constructor(isShallow2 = false) {
  1114. super(true, isShallow2);
  1115. }
  1116. set(target, key) {
  1117. {
  1118. warn(
  1119. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1120. target
  1121. );
  1122. }
  1123. return true;
  1124. }
  1125. deleteProperty(target, key) {
  1126. {
  1127. warn(
  1128. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  1129. target
  1130. );
  1131. }
  1132. return true;
  1133. }
  1134. }
  1135. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1136. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1137. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
  1138. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1139. const toShallow = (value) => value;
  1140. const getProto = (v) => Reflect.getPrototypeOf(v);
  1141. function createIterableMethod(method, isReadonly2, isShallow2) {
  1142. return function(...args) {
  1143. const target = this["__v_raw"];
  1144. const rawTarget = toRaw(target);
  1145. const targetIsMap = shared.isMap(rawTarget);
  1146. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1147. const isKeyOnly = method === "keys" && targetIsMap;
  1148. const innerIterator = target[method](...args);
  1149. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1150. !isReadonly2 && track(
  1151. rawTarget,
  1152. "iterate",
  1153. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1154. );
  1155. return shared.extend(
  1156. // inheriting all iterator properties
  1157. Object.create(innerIterator),
  1158. {
  1159. // iterator protocol
  1160. next() {
  1161. const { value, done } = innerIterator.next();
  1162. return done ? { value, done } : {
  1163. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1164. done
  1165. };
  1166. }
  1167. }
  1168. );
  1169. };
  1170. }
  1171. function createReadonlyMethod(type) {
  1172. return function(...args) {
  1173. {
  1174. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1175. warn(
  1176. `${shared.capitalize(type)} operation ${key}failed: target is readonly.`,
  1177. toRaw(this)
  1178. );
  1179. }
  1180. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1181. };
  1182. }
  1183. function createInstrumentations(readonly, shallow) {
  1184. const instrumentations = {
  1185. get(key) {
  1186. const target = this["__v_raw"];
  1187. const rawTarget = toRaw(target);
  1188. const rawKey = toRaw(key);
  1189. if (!readonly) {
  1190. if (shared.hasChanged(key, rawKey)) {
  1191. track(rawTarget, "get", key);
  1192. }
  1193. track(rawTarget, "get", rawKey);
  1194. }
  1195. const { has } = getProto(rawTarget);
  1196. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1197. if (has.call(rawTarget, key)) {
  1198. return wrap(target.get(key));
  1199. } else if (has.call(rawTarget, rawKey)) {
  1200. return wrap(target.get(rawKey));
  1201. } else if (target !== rawTarget) {
  1202. target.get(key);
  1203. }
  1204. },
  1205. get size() {
  1206. const target = this["__v_raw"];
  1207. !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
  1208. return target.size;
  1209. },
  1210. has(key) {
  1211. const target = this["__v_raw"];
  1212. const rawTarget = toRaw(target);
  1213. const rawKey = toRaw(key);
  1214. if (!readonly) {
  1215. if (shared.hasChanged(key, rawKey)) {
  1216. track(rawTarget, "has", key);
  1217. }
  1218. track(rawTarget, "has", rawKey);
  1219. }
  1220. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1221. },
  1222. forEach(callback, thisArg) {
  1223. const observed = this;
  1224. const target = observed["__v_raw"];
  1225. const rawTarget = toRaw(target);
  1226. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1227. !readonly && track(rawTarget, "iterate", ITERATE_KEY);
  1228. return target.forEach((value, key) => {
  1229. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1230. });
  1231. }
  1232. };
  1233. shared.extend(
  1234. instrumentations,
  1235. readonly ? {
  1236. add: createReadonlyMethod("add"),
  1237. set: createReadonlyMethod("set"),
  1238. delete: createReadonlyMethod("delete"),
  1239. clear: createReadonlyMethod("clear")
  1240. } : {
  1241. add(value) {
  1242. const target = toRaw(this);
  1243. const proto = getProto(target);
  1244. const rawValue = toRaw(value);
  1245. const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value;
  1246. const hadKey = proto.has.call(target, valueToAdd) || shared.hasChanged(value, valueToAdd) && proto.has.call(target, value) || shared.hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue);
  1247. if (!hadKey) {
  1248. target.add(valueToAdd);
  1249. trigger(target, "add", valueToAdd, valueToAdd);
  1250. }
  1251. return this;
  1252. },
  1253. set(key, value) {
  1254. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1255. value = toRaw(value);
  1256. }
  1257. const target = toRaw(this);
  1258. const { has, get } = getProto(target);
  1259. let hadKey = has.call(target, key);
  1260. if (!hadKey) {
  1261. key = toRaw(key);
  1262. hadKey = has.call(target, key);
  1263. } else {
  1264. checkIdentityKeys(target, has, key);
  1265. }
  1266. const oldValue = get.call(target, key);
  1267. target.set(key, value);
  1268. if (!hadKey) {
  1269. trigger(target, "add", key, value);
  1270. } else if (shared.hasChanged(value, oldValue)) {
  1271. trigger(target, "set", key, value, oldValue);
  1272. }
  1273. return this;
  1274. },
  1275. delete(key) {
  1276. const target = toRaw(this);
  1277. const { has, get } = getProto(target);
  1278. let hadKey = has.call(target, key);
  1279. if (!hadKey) {
  1280. key = toRaw(key);
  1281. hadKey = has.call(target, key);
  1282. } else {
  1283. checkIdentityKeys(target, has, key);
  1284. }
  1285. const oldValue = get ? get.call(target, key) : void 0;
  1286. const result = target.delete(key);
  1287. if (hadKey) {
  1288. trigger(target, "delete", key, void 0, oldValue);
  1289. }
  1290. return result;
  1291. },
  1292. clear() {
  1293. const target = toRaw(this);
  1294. const hadItems = target.size !== 0;
  1295. const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target) ;
  1296. const result = target.clear();
  1297. if (hadItems) {
  1298. trigger(
  1299. target,
  1300. "clear",
  1301. void 0,
  1302. void 0,
  1303. oldTarget
  1304. );
  1305. }
  1306. return result;
  1307. }
  1308. }
  1309. );
  1310. const iteratorMethods = [
  1311. "keys",
  1312. "values",
  1313. "entries",
  1314. Symbol.iterator
  1315. ];
  1316. iteratorMethods.forEach((method) => {
  1317. instrumentations[method] = createIterableMethod(method, readonly, shallow);
  1318. });
  1319. return instrumentations;
  1320. }
  1321. function createInstrumentationGetter(isReadonly2, shallow) {
  1322. const instrumentations = createInstrumentations(isReadonly2, shallow);
  1323. return (target, key, receiver) => {
  1324. if (key === "__v_isReactive") {
  1325. return !isReadonly2;
  1326. } else if (key === "__v_isReadonly") {
  1327. return isReadonly2;
  1328. } else if (key === "__v_raw") {
  1329. return target;
  1330. }
  1331. return Reflect.get(
  1332. shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1333. key,
  1334. receiver
  1335. );
  1336. };
  1337. }
  1338. const mutableCollectionHandlers = {
  1339. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1340. };
  1341. const shallowCollectionHandlers = {
  1342. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1343. };
  1344. const readonlyCollectionHandlers = {
  1345. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1346. };
  1347. const shallowReadonlyCollectionHandlers = {
  1348. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1349. };
  1350. function checkIdentityKeys(target, has, key) {
  1351. const rawKey = toRaw(key);
  1352. if (rawKey !== key && has.call(target, rawKey)) {
  1353. const type = shared.toRawType(target);
  1354. warn(
  1355. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1356. );
  1357. }
  1358. }
  1359. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1360. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1361. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1362. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1363. function targetTypeMap(rawType) {
  1364. switch (rawType) {
  1365. case "Object":
  1366. case "Array":
  1367. return 1 /* COMMON */;
  1368. case "Map":
  1369. case "Set":
  1370. case "WeakMap":
  1371. case "WeakSet":
  1372. return 2 /* COLLECTION */;
  1373. default:
  1374. return 0 /* INVALID */;
  1375. }
  1376. }
  1377. // @__NO_SIDE_EFFECTS__
  1378. function reactive(target) {
  1379. if (/* @__PURE__ */ isReadonly(target)) {
  1380. return target;
  1381. }
  1382. return createReactiveObject(
  1383. target,
  1384. false,
  1385. mutableHandlers,
  1386. mutableCollectionHandlers,
  1387. reactiveMap
  1388. );
  1389. }
  1390. // @__NO_SIDE_EFFECTS__
  1391. function shallowReactive(target) {
  1392. return createReactiveObject(
  1393. target,
  1394. false,
  1395. shallowReactiveHandlers,
  1396. shallowCollectionHandlers,
  1397. shallowReactiveMap
  1398. );
  1399. }
  1400. // @__NO_SIDE_EFFECTS__
  1401. function readonly(target) {
  1402. return createReactiveObject(
  1403. target,
  1404. true,
  1405. readonlyHandlers,
  1406. readonlyCollectionHandlers,
  1407. readonlyMap
  1408. );
  1409. }
  1410. // @__NO_SIDE_EFFECTS__
  1411. function shallowReadonly(target) {
  1412. return createReactiveObject(
  1413. target,
  1414. true,
  1415. shallowReadonlyHandlers,
  1416. shallowReadonlyCollectionHandlers,
  1417. shallowReadonlyMap
  1418. );
  1419. }
  1420. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1421. if (!shared.isObject(target)) {
  1422. {
  1423. warn(
  1424. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1425. target
  1426. )}`
  1427. );
  1428. }
  1429. return target;
  1430. }
  1431. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1432. return target;
  1433. }
  1434. if (target["__v_skip"] || !Object.isExtensible(target)) {
  1435. return target;
  1436. }
  1437. const existingProxy = proxyMap.get(target);
  1438. if (existingProxy) {
  1439. return existingProxy;
  1440. }
  1441. const targetType = targetTypeMap(shared.toRawType(target));
  1442. if (targetType === 0 /* INVALID */) {
  1443. return target;
  1444. }
  1445. const proxy = new Proxy(
  1446. target,
  1447. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1448. );
  1449. proxyMap.set(target, proxy);
  1450. return proxy;
  1451. }
  1452. // @__NO_SIDE_EFFECTS__
  1453. function isReactive(value) {
  1454. if (/* @__PURE__ */ isReadonly(value)) {
  1455. return /* @__PURE__ */ isReactive(value["__v_raw"]);
  1456. }
  1457. return !!(value && value["__v_isReactive"]);
  1458. }
  1459. // @__NO_SIDE_EFFECTS__
  1460. function isReadonly(value) {
  1461. return !!(value && value["__v_isReadonly"]);
  1462. }
  1463. // @__NO_SIDE_EFFECTS__
  1464. function isShallow(value) {
  1465. return !!(value && value["__v_isShallow"]);
  1466. }
  1467. // @__NO_SIDE_EFFECTS__
  1468. function isProxy(value) {
  1469. return value ? !!value["__v_raw"] : false;
  1470. }
  1471. // @__NO_SIDE_EFFECTS__
  1472. function toRaw(observed) {
  1473. const raw = observed && observed["__v_raw"];
  1474. return raw ? /* @__PURE__ */ toRaw(raw) : observed;
  1475. }
  1476. function markRaw(value) {
  1477. if (!shared.hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
  1478. shared.def(value, "__v_skip", true);
  1479. }
  1480. return value;
  1481. }
  1482. const toReactive = (value) => shared.isObject(value) ? /* @__PURE__ */ reactive(value) : value;
  1483. const toReadonly = (value) => shared.isObject(value) ? /* @__PURE__ */ readonly(value) : value;
  1484. // @__NO_SIDE_EFFECTS__
  1485. function isRef(r) {
  1486. return r ? r["__v_isRef"] === true : false;
  1487. }
  1488. // @__NO_SIDE_EFFECTS__
  1489. function ref(value) {
  1490. return createRef(value, false);
  1491. }
  1492. // @__NO_SIDE_EFFECTS__
  1493. function shallowRef(value) {
  1494. return createRef(value, true);
  1495. }
  1496. function createRef(rawValue, shallow) {
  1497. if (/* @__PURE__ */ isRef(rawValue)) {
  1498. return rawValue;
  1499. }
  1500. return new RefImpl(rawValue, shallow);
  1501. }
  1502. class RefImpl {
  1503. constructor(value, isShallow2) {
  1504. this.dep = new Dep();
  1505. this["__v_isRef"] = true;
  1506. this["__v_isShallow"] = false;
  1507. this._rawValue = isShallow2 ? value : toRaw(value);
  1508. this._value = isShallow2 ? value : toReactive(value);
  1509. this["__v_isShallow"] = isShallow2;
  1510. }
  1511. get value() {
  1512. {
  1513. this.dep.track({
  1514. target: this,
  1515. type: "get",
  1516. key: "value"
  1517. });
  1518. }
  1519. return this._value;
  1520. }
  1521. set value(newValue) {
  1522. const oldValue = this._rawValue;
  1523. const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
  1524. newValue = useDirectValue ? newValue : toRaw(newValue);
  1525. if (shared.hasChanged(newValue, oldValue)) {
  1526. this._rawValue = newValue;
  1527. this._value = useDirectValue ? newValue : toReactive(newValue);
  1528. {
  1529. this.dep.trigger({
  1530. target: this,
  1531. type: "set",
  1532. key: "value",
  1533. newValue,
  1534. oldValue
  1535. });
  1536. }
  1537. }
  1538. }
  1539. }
  1540. function triggerRef(ref2) {
  1541. if (ref2.dep) {
  1542. {
  1543. ref2.dep.trigger({
  1544. target: ref2,
  1545. type: "set",
  1546. key: "value",
  1547. newValue: ref2._value
  1548. });
  1549. }
  1550. }
  1551. }
  1552. function unref(ref2) {
  1553. return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
  1554. }
  1555. function toValue(source) {
  1556. return shared.isFunction(source) ? source() : unref(source);
  1557. }
  1558. const shallowUnwrapHandlers = {
  1559. get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
  1560. set: (target, key, value, receiver) => {
  1561. const oldValue = target[key];
  1562. if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
  1563. oldValue.value = value;
  1564. return true;
  1565. } else {
  1566. return Reflect.set(target, key, value, receiver);
  1567. }
  1568. }
  1569. };
  1570. function proxyRefs(objectWithRefs) {
  1571. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1572. }
  1573. class CustomRefImpl {
  1574. constructor(factory) {
  1575. this["__v_isRef"] = true;
  1576. this._value = void 0;
  1577. const dep = this.dep = new Dep();
  1578. const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
  1579. this._get = get;
  1580. this._set = set;
  1581. }
  1582. get value() {
  1583. return this._value = this._get();
  1584. }
  1585. set value(newVal) {
  1586. this._set(newVal);
  1587. }
  1588. }
  1589. function customRef(factory) {
  1590. return new CustomRefImpl(factory);
  1591. }
  1592. // @__NO_SIDE_EFFECTS__
  1593. function toRefs(object) {
  1594. if (!isProxy(object)) {
  1595. warn(`toRefs() expects a reactive object but received a plain one.`);
  1596. }
  1597. const ret = shared.isArray(object) ? new Array(object.length) : {};
  1598. for (const key in object) {
  1599. ret[key] = propertyToRef(object, key);
  1600. }
  1601. return ret;
  1602. }
  1603. class ObjectRefImpl {
  1604. constructor(_object, key, _defaultValue) {
  1605. this._object = _object;
  1606. this._defaultValue = _defaultValue;
  1607. this["__v_isRef"] = true;
  1608. this._value = void 0;
  1609. this._key = shared.isSymbol(key) ? key : String(key);
  1610. this._raw = toRaw(_object);
  1611. let shallow = true;
  1612. let obj = _object;
  1613. if (!shared.isArray(_object) || shared.isSymbol(this._key) || !shared.isIntegerKey(this._key)) {
  1614. do {
  1615. shallow = !isProxy(obj) || isShallow(obj);
  1616. } while (shallow && (obj = obj["__v_raw"]));
  1617. }
  1618. this._shallow = shallow;
  1619. }
  1620. get value() {
  1621. let val = this._object[this._key];
  1622. if (this._shallow) {
  1623. val = unref(val);
  1624. }
  1625. return this._value = val === void 0 ? this._defaultValue : val;
  1626. }
  1627. set value(newVal) {
  1628. if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
  1629. const nestedRef = this._object[this._key];
  1630. if (/* @__PURE__ */ isRef(nestedRef)) {
  1631. nestedRef.value = newVal;
  1632. return;
  1633. }
  1634. }
  1635. this._object[this._key] = newVal;
  1636. }
  1637. get dep() {
  1638. return getDepFromReactive(this._raw, this._key);
  1639. }
  1640. }
  1641. class GetterRefImpl {
  1642. constructor(_getter) {
  1643. this._getter = _getter;
  1644. this["__v_isRef"] = true;
  1645. this["__v_isReadonly"] = true;
  1646. this._value = void 0;
  1647. }
  1648. get value() {
  1649. return this._value = this._getter();
  1650. }
  1651. }
  1652. // @__NO_SIDE_EFFECTS__
  1653. function toRef(source, key, defaultValue) {
  1654. if (/* @__PURE__ */ isRef(source)) {
  1655. return source;
  1656. } else if (shared.isFunction(source)) {
  1657. return new GetterRefImpl(source);
  1658. } else if (shared.isObject(source) && arguments.length > 1) {
  1659. return propertyToRef(source, key, defaultValue);
  1660. } else {
  1661. return /* @__PURE__ */ ref(source);
  1662. }
  1663. }
  1664. function propertyToRef(source, key, defaultValue) {
  1665. return new ObjectRefImpl(source, key, defaultValue);
  1666. }
  1667. class ComputedRefImpl {
  1668. constructor(fn, setter, isSSR) {
  1669. this.fn = fn;
  1670. this.setter = setter;
  1671. /**
  1672. * @internal
  1673. */
  1674. this._value = void 0;
  1675. /**
  1676. * @internal
  1677. */
  1678. this.dep = new Dep(this);
  1679. /**
  1680. * @internal
  1681. */
  1682. this.__v_isRef = true;
  1683. // TODO isolatedDeclarations "__v_isReadonly"
  1684. // A computed is also a subscriber that tracks other deps
  1685. /**
  1686. * @internal
  1687. */
  1688. this.deps = void 0;
  1689. /**
  1690. * @internal
  1691. */
  1692. this.depsTail = void 0;
  1693. /**
  1694. * @internal
  1695. */
  1696. this.flags = 16;
  1697. /**
  1698. * @internal
  1699. */
  1700. this.globalVersion = globalVersion - 1;
  1701. /**
  1702. * @internal
  1703. */
  1704. this.next = void 0;
  1705. // for backwards compat
  1706. this.effect = this;
  1707. this["__v_isReadonly"] = !setter;
  1708. this.isSSR = isSSR;
  1709. }
  1710. /**
  1711. * @internal
  1712. */
  1713. notify() {
  1714. this.flags |= 16;
  1715. if (!(this.flags & 8) && // avoid infinite self recursion
  1716. activeSub !== this) {
  1717. batch(this, true);
  1718. return true;
  1719. }
  1720. }
  1721. get value() {
  1722. const link = this.dep.track({
  1723. target: this,
  1724. type: "get",
  1725. key: "value"
  1726. }) ;
  1727. refreshComputed(this);
  1728. if (link) {
  1729. link.version = this.dep.version;
  1730. }
  1731. return this._value;
  1732. }
  1733. set value(newValue) {
  1734. if (this.setter) {
  1735. this.setter(newValue);
  1736. } else {
  1737. warn("Write operation failed: computed value is readonly");
  1738. }
  1739. }
  1740. }
  1741. // @__NO_SIDE_EFFECTS__
  1742. function computed(getterOrOptions, debugOptions, isSSR = false) {
  1743. let getter;
  1744. let setter;
  1745. if (shared.isFunction(getterOrOptions)) {
  1746. getter = getterOrOptions;
  1747. } else {
  1748. getter = getterOrOptions.get;
  1749. setter = getterOrOptions.set;
  1750. }
  1751. const cRef = new ComputedRefImpl(getter, setter, isSSR);
  1752. if (debugOptions && !isSSR) {
  1753. cRef.onTrack = debugOptions.onTrack;
  1754. cRef.onTrigger = debugOptions.onTrigger;
  1755. }
  1756. return cRef;
  1757. }
  1758. const TrackOpTypes = {
  1759. "GET": "get",
  1760. "HAS": "has",
  1761. "ITERATE": "iterate"
  1762. };
  1763. const TriggerOpTypes = {
  1764. "SET": "set",
  1765. "ADD": "add",
  1766. "DELETE": "delete",
  1767. "CLEAR": "clear"
  1768. };
  1769. const ReactiveFlags = {
  1770. "SKIP": "__v_skip",
  1771. "IS_REACTIVE": "__v_isReactive",
  1772. "IS_READONLY": "__v_isReadonly",
  1773. "IS_SHALLOW": "__v_isShallow",
  1774. "RAW": "__v_raw",
  1775. "IS_REF": "__v_isRef"
  1776. };
  1777. const WatchErrorCodes = {
  1778. "WATCH_GETTER": 2,
  1779. "2": "WATCH_GETTER",
  1780. "WATCH_CALLBACK": 3,
  1781. "3": "WATCH_CALLBACK",
  1782. "WATCH_CLEANUP": 4,
  1783. "4": "WATCH_CLEANUP"
  1784. };
  1785. const INITIAL_WATCHER_VALUE = {};
  1786. const cleanupMap = /* @__PURE__ */ new WeakMap();
  1787. let activeWatcher = void 0;
  1788. function getCurrentWatcher() {
  1789. return activeWatcher;
  1790. }
  1791. function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
  1792. if (owner) {
  1793. let cleanups = cleanupMap.get(owner);
  1794. if (!cleanups) cleanupMap.set(owner, cleanups = []);
  1795. cleanups.push(cleanupFn);
  1796. } else if (!failSilently) {
  1797. warn(
  1798. `onWatcherCleanup() was called when there was no active watcher to associate with.`
  1799. );
  1800. }
  1801. }
  1802. function watch(source, cb, options = shared.EMPTY_OBJ) {
  1803. const { immediate, deep, once, scheduler, augmentJob, call } = options;
  1804. const warnInvalidSource = (s) => {
  1805. (options.onWarn || warn)(
  1806. `Invalid watch source: `,
  1807. s,
  1808. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  1809. );
  1810. };
  1811. const reactiveGetter = (source2) => {
  1812. if (deep) return source2;
  1813. if (isShallow(source2) || deep === false || deep === 0)
  1814. return traverse(source2, 1);
  1815. return traverse(source2);
  1816. };
  1817. let effect;
  1818. let getter;
  1819. let cleanup;
  1820. let boundCleanup;
  1821. let forceTrigger = false;
  1822. let isMultiSource = false;
  1823. if (isRef(source)) {
  1824. getter = () => source.value;
  1825. forceTrigger = isShallow(source);
  1826. } else if (isReactive(source)) {
  1827. getter = () => reactiveGetter(source);
  1828. forceTrigger = true;
  1829. } else if (shared.isArray(source)) {
  1830. isMultiSource = true;
  1831. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  1832. getter = () => source.map((s) => {
  1833. if (isRef(s)) {
  1834. return s.value;
  1835. } else if (isReactive(s)) {
  1836. return reactiveGetter(s);
  1837. } else if (shared.isFunction(s)) {
  1838. return call ? call(s, 2) : s();
  1839. } else {
  1840. warnInvalidSource(s);
  1841. }
  1842. });
  1843. } else if (shared.isFunction(source)) {
  1844. if (cb) {
  1845. getter = call ? () => call(source, 2) : source;
  1846. } else {
  1847. getter = () => {
  1848. if (cleanup) {
  1849. pauseTracking();
  1850. try {
  1851. cleanup();
  1852. } finally {
  1853. resetTracking();
  1854. }
  1855. }
  1856. const currentEffect = activeWatcher;
  1857. activeWatcher = effect;
  1858. try {
  1859. return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
  1860. } finally {
  1861. activeWatcher = currentEffect;
  1862. }
  1863. };
  1864. }
  1865. } else {
  1866. getter = shared.NOOP;
  1867. warnInvalidSource(source);
  1868. }
  1869. if (cb && deep) {
  1870. const baseGetter = getter;
  1871. const depth = deep === true ? Infinity : deep;
  1872. getter = () => traverse(baseGetter(), depth);
  1873. }
  1874. const scope = getCurrentScope();
  1875. const watchHandle = () => {
  1876. effect.stop();
  1877. if (scope && scope.active) {
  1878. shared.remove(scope.effects, effect);
  1879. }
  1880. };
  1881. if (once && cb) {
  1882. const _cb = cb;
  1883. cb = (...args) => {
  1884. const res = _cb(...args);
  1885. watchHandle();
  1886. return res;
  1887. };
  1888. }
  1889. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  1890. const job = (immediateFirstRun) => {
  1891. if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
  1892. return;
  1893. }
  1894. if (cb) {
  1895. const newValue = effect.run();
  1896. if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => shared.hasChanged(v, oldValue[i])) : shared.hasChanged(newValue, oldValue))) {
  1897. if (cleanup) {
  1898. cleanup();
  1899. }
  1900. const currentWatcher = activeWatcher;
  1901. activeWatcher = effect;
  1902. try {
  1903. const args = [
  1904. newValue,
  1905. // pass undefined as the old value when it's changed for the first time
  1906. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  1907. boundCleanup
  1908. ];
  1909. oldValue = newValue;
  1910. call ? call(cb, 3, args) : (
  1911. // @ts-expect-error
  1912. cb(...args)
  1913. );
  1914. } finally {
  1915. activeWatcher = currentWatcher;
  1916. }
  1917. }
  1918. } else {
  1919. effect.run();
  1920. }
  1921. };
  1922. if (augmentJob) {
  1923. augmentJob(job);
  1924. }
  1925. effect = new ReactiveEffect(getter);
  1926. effect.scheduler = scheduler ? () => scheduler(job, false) : job;
  1927. boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
  1928. cleanup = effect.onStop = () => {
  1929. const cleanups = cleanupMap.get(effect);
  1930. if (cleanups) {
  1931. if (call) {
  1932. call(cleanups, 4);
  1933. } else {
  1934. for (const cleanup2 of cleanups) cleanup2();
  1935. }
  1936. cleanupMap.delete(effect);
  1937. }
  1938. };
  1939. {
  1940. effect.onTrack = options.onTrack;
  1941. effect.onTrigger = options.onTrigger;
  1942. }
  1943. if (cb) {
  1944. if (immediate) {
  1945. job(true);
  1946. } else {
  1947. oldValue = effect.run();
  1948. }
  1949. } else if (scheduler) {
  1950. scheduler(job.bind(null, true), true);
  1951. } else {
  1952. effect.run();
  1953. }
  1954. watchHandle.pause = effect.pause.bind(effect);
  1955. watchHandle.resume = effect.resume.bind(effect);
  1956. watchHandle.stop = watchHandle;
  1957. return watchHandle;
  1958. }
  1959. function traverse(value, depth = Infinity, seen) {
  1960. if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) {
  1961. return value;
  1962. }
  1963. seen = seen || /* @__PURE__ */ new Map();
  1964. if ((seen.get(value) || 0) >= depth) {
  1965. return value;
  1966. }
  1967. seen.set(value, depth);
  1968. depth--;
  1969. if (isRef(value)) {
  1970. traverse(value.value, depth, seen);
  1971. } else if (shared.isArray(value)) {
  1972. for (let i = 0; i < value.length; i++) {
  1973. traverse(value[i], depth, seen);
  1974. }
  1975. } else if (shared.isSet(value) || shared.isMap(value)) {
  1976. value.forEach((v) => {
  1977. traverse(v, depth, seen);
  1978. });
  1979. } else if (shared.isPlainObject(value)) {
  1980. for (const key in value) {
  1981. traverse(value[key], depth, seen);
  1982. }
  1983. for (const key of Object.getOwnPropertySymbols(value)) {
  1984. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  1985. traverse(value[key], depth, seen);
  1986. }
  1987. }
  1988. }
  1989. return value;
  1990. }
  1991. exports.ARRAY_ITERATE_KEY = ARRAY_ITERATE_KEY;
  1992. exports.EffectFlags = EffectFlags;
  1993. exports.EffectScope = EffectScope;
  1994. exports.ITERATE_KEY = ITERATE_KEY;
  1995. exports.MAP_KEY_ITERATE_KEY = MAP_KEY_ITERATE_KEY;
  1996. exports.ReactiveEffect = ReactiveEffect;
  1997. exports.ReactiveFlags = ReactiveFlags;
  1998. exports.TrackOpTypes = TrackOpTypes;
  1999. exports.TriggerOpTypes = TriggerOpTypes;
  2000. exports.WatchErrorCodes = WatchErrorCodes;
  2001. exports.computed = computed;
  2002. exports.customRef = customRef;
  2003. exports.effect = effect;
  2004. exports.effectScope = effectScope;
  2005. exports.enableTracking = enableTracking;
  2006. exports.getCurrentScope = getCurrentScope;
  2007. exports.getCurrentWatcher = getCurrentWatcher;
  2008. exports.isProxy = isProxy;
  2009. exports.isReactive = isReactive;
  2010. exports.isReadonly = isReadonly;
  2011. exports.isRef = isRef;
  2012. exports.isShallow = isShallow;
  2013. exports.markRaw = markRaw;
  2014. exports.onEffectCleanup = onEffectCleanup;
  2015. exports.onScopeDispose = onScopeDispose;
  2016. exports.onWatcherCleanup = onWatcherCleanup;
  2017. exports.pauseTracking = pauseTracking;
  2018. exports.proxyRefs = proxyRefs;
  2019. exports.reactive = reactive;
  2020. exports.reactiveReadArray = reactiveReadArray;
  2021. exports.readonly = readonly;
  2022. exports.ref = ref;
  2023. exports.resetTracking = resetTracking;
  2024. exports.shallowReactive = shallowReactive;
  2025. exports.shallowReadArray = shallowReadArray;
  2026. exports.shallowReadonly = shallowReadonly;
  2027. exports.shallowRef = shallowRef;
  2028. exports.stop = stop;
  2029. exports.toRaw = toRaw;
  2030. exports.toReactive = toReactive;
  2031. exports.toReadonly = toReadonly;
  2032. exports.toRef = toRef;
  2033. exports.toRefs = toRefs;
  2034. exports.toValue = toValue;
  2035. exports.track = track;
  2036. exports.traverse = traverse;
  2037. exports.trigger = trigger;
  2038. exports.triggerRef = triggerRef;
  2039. exports.unref = unref;
  2040. exports.watch = watch;