@ynput/ayon-frontend-shared 0.3.18 → 0.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/_virtual/index.cjs14.js +1 -1
  2. package/dist/_virtual/index.cjs22.js +1 -1
  3. package/dist/_virtual/index.cjs23.js +1 -1
  4. package/dist/_virtual/index.cjs24.js +1 -1
  5. package/dist/_virtual/index.cjs6.js +1 -1
  6. package/dist/_virtual/index.cjs8.js +1 -1
  7. package/dist/_virtual/index.cjs9.js +1 -1
  8. package/dist/_virtual/index.es10.js +2 -2
  9. package/dist/_virtual/index.es11.js +2 -2
  10. package/dist/_virtual/index.es13.js +2 -2
  11. package/dist/_virtual/index.es14.js +2 -5
  12. package/dist/_virtual/index.es14.js.map +1 -1
  13. package/dist/_virtual/index.es22.js +3 -3
  14. package/dist/_virtual/index.es23.js +5 -5
  15. package/dist/_virtual/index.es24.js +5 -5
  16. package/dist/_virtual/index.es6.js +2 -2
  17. package/dist/_virtual/index.es8.js +2 -2
  18. package/dist/_virtual/index.es9.js +5 -2
  19. package/dist/_virtual/index.es9.js.map +1 -1
  20. package/dist/node_modules/rehype/node_modules/unified/lib/index.cjs.js +1 -1
  21. package/dist/node_modules/rehype/node_modules/unified/lib/index.es.js +2 -2
  22. package/dist/node_modules/rehype/node_modules/vfile/lib/index.cjs.js +1 -1
  23. package/dist/node_modules/rehype/node_modules/vfile/lib/index.es.js +1 -1
  24. package/dist/node_modules/rehype-parse/lib/index.cjs.js +1 -1
  25. package/dist/node_modules/rehype-parse/lib/index.es.js +1 -1
  26. package/dist/node_modules/remove-accents/index.cjs.js +1 -1
  27. package/dist/node_modules/remove-accents/index.es.js +1 -1
  28. package/dist/shared/node_modules/@module-federation/error-codes/dist/index.cjs.js +1 -1
  29. package/dist/shared/node_modules/@module-federation/error-codes/dist/index.es.js +1 -1
  30. package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.cjs.js +1 -1
  31. package/dist/shared/node_modules/@module-federation/runtime-core/dist/index.es.js +1 -1
  32. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.cjs.js +1 -1
  33. package/dist/shared/node_modules/@module-federation/runtime-core/dist/module/index.es.js +1 -1
  34. package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.cjs.js +1 -1
  35. package/dist/shared/node_modules/@module-federation/runtime-core/dist/type/index.es.js +1 -1
  36. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.cjs.js +1 -1
  37. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/index.es.js +1 -1
  38. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js +1 -1
  39. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.cjs.js.map +1 -1
  40. package/dist/shared/node_modules/@module-federation/runtime-core/dist/utils/semver/index.es.js +1 -1
  41. package/dist/shared/node_modules/@module-federation/sdk/dist/index.cjs.js +1 -1
  42. package/dist/shared/node_modules/@module-federation/sdk/dist/index.es.js +1 -1
  43. package/dist/shared/node_modules/graphql-request/build/legacy/helpers/analyzeDocument.cjs.js +2 -0
  44. package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/analyzeDocument.cjs.js.map +1 -1
  45. package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/analyzeDocument.es.js +2 -2
  46. package/dist/shared/node_modules/graphql-request/build/legacy/helpers/runRequest.cjs.js +2 -0
  47. package/dist/shared/node_modules/graphql-request/build/legacy/helpers/runRequest.cjs.js.map +1 -0
  48. package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/runRequest.es.js +33 -35
  49. package/dist/shared/node_modules/graphql-request/build/legacy/helpers/runRequest.es.js.map +1 -0
  50. package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/lib/graphql.cjs.js +1 -1
  51. package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/lib/graphql.cjs.js.map +1 -1
  52. package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/lib/graphql.es.js +1 -1
  53. package/dist/shared/node_modules/immer/dist/immer.cjs.js +2 -0
  54. package/dist/shared/node_modules/immer/dist/immer.cjs.js.map +1 -0
  55. package/dist/shared/node_modules/immer/dist/immer.es.js +828 -0
  56. package/dist/shared/node_modules/immer/dist/immer.es.js.map +1 -0
  57. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
  58. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js.map +1 -1
  59. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
  60. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
  61. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js.map +1 -1
  62. package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
  63. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
  64. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js.map +1 -1
  65. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
  66. package/dist/shared/src/api/base/client.cjs.js +1 -1
  67. package/dist/shared/src/api/base/client.cjs.js.map +1 -1
  68. package/dist/shared/src/api/base/client.es.js +3 -3
  69. package/dist/shared/src/containers/ContextMenu/ContextMenuItem.cjs.js +1 -1
  70. package/dist/shared/src/containers/ContextMenu/ContextMenuItem.cjs.js.map +1 -1
  71. package/dist/shared/src/containers/ContextMenu/ContextMenuItem.es.js +33 -32
  72. package/dist/shared/src/containers/ContextMenu/ContextMenuItem.es.js.map +1 -1
  73. package/dist/types/containers/ContextMenu/ContextMenuItem.d.ts +1 -0
  74. package/dist/types/containers/DetailsPanel/DetailsPanel.styled.d.ts +2 -2
  75. package/package.json +5 -5
  76. package/dist/node_modules/graphql-request/build/legacy/helpers/analyzeDocument.cjs.js +0 -2
  77. package/dist/node_modules/graphql-request/build/legacy/helpers/runRequest.cjs.js +0 -2
  78. package/dist/node_modules/graphql-request/build/legacy/helpers/runRequest.cjs.js.map +0 -1
  79. package/dist/node_modules/graphql-request/build/legacy/helpers/runRequest.es.js.map +0 -1
  80. package/dist/node_modules/immer/dist/immer.cjs.js +0 -2
  81. package/dist/node_modules/immer/dist/immer.cjs.js.map +0 -1
  82. package/dist/node_modules/immer/dist/immer.es.js +0 -814
  83. package/dist/node_modules/immer/dist/immer.es.js.map +0 -1
  84. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.cjs.js +0 -0
  85. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.cjs.js.map +0 -0
  86. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.es.js +0 -0
  87. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.es.js.map +0 -0
  88. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/rtk-query.modern.cjs.js +0 -0
  89. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/rtk-query.modern.cjs.js.map +0 -0
  90. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/rtk-query.modern.es.js +0 -0
  91. /package/dist/{node_modules → shared/node_modules}/@reduxjs/toolkit/dist/query/rtk-query.modern.es.js.map +0 -0
  92. /package/dist/{node_modules → shared/node_modules}/@standard-schema/utils/dist/index.cjs.js +0 -0
  93. /package/dist/{node_modules → shared/node_modules}/@standard-schema/utils/dist/index.cjs.js.map +0 -0
  94. /package/dist/{node_modules → shared/node_modules}/@standard-schema/utils/dist/index.es.js +0 -0
  95. /package/dist/{node_modules → shared/node_modules}/@standard-schema/utils/dist/index.es.js.map +0 -0
  96. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/ClientError.cjs.js +0 -0
  97. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/ClientError.cjs.js.map +0 -0
  98. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/ClientError.es.js +0 -0
  99. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/ClientError.es.js.map +0 -0
  100. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/GraphQLClient.cjs.js +0 -0
  101. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/GraphQLClient.cjs.js.map +0 -0
  102. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/GraphQLClient.es.js +0 -0
  103. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/classes/GraphQLClient.es.js.map +0 -0
  104. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/batchRequests.cjs.js +0 -0
  105. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/batchRequests.cjs.js.map +0 -0
  106. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/batchRequests.es.js +0 -0
  107. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/batchRequests.es.js.map +0 -0
  108. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/rawRequest.cjs.js +0 -0
  109. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/rawRequest.cjs.js.map +0 -0
  110. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/rawRequest.es.js +0 -0
  111. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/rawRequest.es.js.map +0 -0
  112. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/request.cjs.js +0 -0
  113. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/request.cjs.js.map +0 -0
  114. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/request.es.js +0 -0
  115. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/functions/request.es.js.map +0 -0
  116. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/analyzeDocument.es.js.map +0 -0
  117. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/defaultJsonSerializer.cjs.js +0 -0
  118. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/defaultJsonSerializer.cjs.js.map +0 -0
  119. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/defaultJsonSerializer.es.js +0 -0
  120. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/helpers/defaultJsonSerializer.es.js.map +0 -0
  121. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/legacy/lib/graphql.es.js.map +0 -0
  122. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/http.cjs.js +0 -0
  123. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/http.cjs.js.map +0 -0
  124. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/http.es.js +0 -0
  125. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/http.es.js.map +0 -0
  126. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/prelude.cjs.js +0 -0
  127. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/prelude.cjs.js.map +0 -0
  128. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/prelude.es.js +0 -0
  129. /package/dist/{node_modules → shared/node_modules}/graphql-request/build/lib/prelude.es.js.map +0 -0
  130. /package/dist/{node_modules → shared/node_modules}/reselect/dist/reselect.cjs.js +0 -0
  131. /package/dist/{node_modules → shared/node_modules}/reselect/dist/reselect.cjs.js.map +0 -0
  132. /package/dist/{node_modules → shared/node_modules}/reselect/dist/reselect.es.js +0 -0
  133. /package/dist/{node_modules → shared/node_modules}/reselect/dist/reselect.es.js.map +0 -0
@@ -1,814 +0,0 @@
1
- var pe = Symbol.for("immer-nothing"), U = Symbol.for("immer-draftable"), g = Symbol.for("immer-state"), ze = process.env.NODE_ENV !== "production" ? [
2
- // All error codes, starting by 0:
3
- function(e) {
4
- return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
5
- },
6
- function(e) {
7
- return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`;
8
- },
9
- "This object has been frozen and should not be mutated",
10
- function(e) {
11
- return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e;
12
- },
13
- "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
14
- "Immer forbids circular references",
15
- "The first or second argument to `produce` must be a function",
16
- "The third argument to `produce` must be a function or undefined",
17
- "First argument to `createDraft` must be a plain object, an array, or an immerable object",
18
- "First argument to `finishDraft` must be a draft returned by `createDraft`",
19
- function(e) {
20
- return `'current' expects a draft, got: ${e}`;
21
- },
22
- "Object.defineProperty() cannot be used on an Immer draft",
23
- "Object.setPrototypeOf() cannot be used on an Immer draft",
24
- "Immer only supports deleting array indices",
25
- "Immer only supports setting array indices and the 'length' property",
26
- function(e) {
27
- return `'original' expects a draft, got: ${e}`;
28
- }
29
- // Note: if more errors are added, the errorOffset in Patches.ts should be increased
30
- // See Patches.ts for additional errors
31
- ] : [];
32
- function m(e, ...t) {
33
- if (process.env.NODE_ENV !== "production") {
34
- const r = ze[e], n = D(r) ? r.apply(null, t) : r;
35
- throw new Error(`[Immer] ${n}`);
36
- }
37
- throw new Error(
38
- `[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`
39
- );
40
- }
41
- var v = Object, I = v.getPrototypeOf, $ = "constructor", Y = "prototype", ae = "configurable", j = "enumerable", Q = "writable", W = "value", z = (e) => !!e && !!e[g];
42
- function C(e) {
43
- return e ? Ce(e) || H(e) || !!e[U] || !!e[$]?.[U] || X(e) || q(e) : !1;
44
- }
45
- var Ne = v[Y][$].toString(), ge = /* @__PURE__ */ new WeakMap();
46
- function Ce(e) {
47
- if (!e || !T(e))
48
- return !1;
49
- const t = I(e);
50
- if (t === null || t === v[Y])
51
- return !0;
52
- const r = v.hasOwnProperty.call(t, $) && t[$];
53
- if (r === Object)
54
- return !0;
55
- if (!D(r))
56
- return !1;
57
- let n = ge.get(r);
58
- return n === void 0 && (n = Function.toString.call(r), ge.set(r, n)), n === Ne;
59
- }
60
- function qe(e) {
61
- return z(e) || m(15, e), e[g].base_;
62
- }
63
- function V(e, t, r = !0) {
64
- A(e) === 0 ? (r ? Reflect.ownKeys(e) : v.keys(e)).forEach((i) => {
65
- t(i, e[i], e);
66
- }) : e.forEach((n, i) => t(i, n, e));
67
- }
68
- function A(e) {
69
- const t = e[g];
70
- return t ? t.type_ : H(e) ? 1 : X(e) ? 2 : q(e) ? 3 : 0;
71
- }
72
- var L = (e, t, r = A(e)) => r === 2 ? e.has(t) : v[Y].hasOwnProperty.call(e, t), E = (e, t, r = A(e)) => (
73
- // @ts-ignore
74
- r === 2 ? e.get(t) : e[t]
75
- ), ee = (e, t, r, n = A(e)) => {
76
- n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
77
- };
78
- function Re(e, t) {
79
- return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
80
- }
81
- var H = Array.isArray, X = (e) => e instanceof Map, q = (e) => e instanceof Set, T = (e) => typeof e == "object", D = (e) => typeof e == "function", ce = (e) => typeof e == "boolean", Te = (e) => T(e) ? e?.[g] : null, k = (e) => e.copy_ || e.base_, he = (e) => e.modified_ ? e.copy_ : e.base_;
82
- function fe(e, t) {
83
- if (X(e))
84
- return new Map(e);
85
- if (q(e))
86
- return new Set(e);
87
- if (H(e))
88
- return Array[Y].slice.call(e);
89
- const r = Ce(e);
90
- if (t === !0 || t === "class_only" && !r) {
91
- const n = v.getOwnPropertyDescriptors(e);
92
- delete n[g];
93
- let i = Reflect.ownKeys(n);
94
- for (let c = 0; c < i.length; c++) {
95
- const _ = i[c], p = n[_];
96
- p[Q] === !1 && (p[Q] = !0, p[ae] = !0), (p.get || p.set) && (n[_] = {
97
- [ae]: !0,
98
- [Q]: !0,
99
- // could live with !!desc.set as well here...
100
- [j]: p[j],
101
- [W]: e[_]
102
- });
103
- }
104
- return v.create(I(e), n);
105
- } else {
106
- const n = I(e);
107
- if (n !== null && r)
108
- return { ...e };
109
- const i = v.create(n);
110
- return v.assign(i, e);
111
- }
112
- }
113
- function ye(e, t = !1) {
114
- return ie(e) || z(e) || !C(e) || (A(e) > 1 && v.defineProperties(e, {
115
- set: J,
116
- add: J,
117
- clear: J,
118
- delete: J
119
- }), v.freeze(e), t && V(
120
- e,
121
- (r, n) => {
122
- ye(n, !0);
123
- },
124
- !1
125
- )), e;
126
- }
127
- function Me() {
128
- m(2);
129
- }
130
- var J = {
131
- [W]: Me
132
- };
133
- function ie(e) {
134
- return e === null || !T(e) ? !0 : v.isFrozen(e);
135
- }
136
- var te = "MapSet", re = "Patches", ne = {};
137
- function M(e) {
138
- const t = ne[e];
139
- return t || m(0, e), t;
140
- }
141
- var Ve = (e) => !!ne[e];
142
- function xe(e, t) {
143
- ne[e] || (ne[e] = t);
144
- }
145
- var B, Ee = () => B, Ue = (e, t) => ({
146
- drafts_: [],
147
- parent_: e,
148
- immer_: t,
149
- // Whenever the modified draft contains a draft from another scope, we
150
- // need to prevent auto-freezing so the unowned draft can be finalized.
151
- canAutoFreeze_: !0,
152
- unfinalizedDrafts_: 0,
153
- handledSet_: /* @__PURE__ */ new Set(),
154
- processedForPatches_: /* @__PURE__ */ new Set(),
155
- mapSetPlugin_: Ve(te) ? M(te) : void 0
156
- });
157
- function ve(e, t) {
158
- t && (e.patchPlugin_ = M(re), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
159
- }
160
- function ue(e) {
161
- le(e), e.drafts_.forEach(Le), e.drafts_ = null;
162
- }
163
- function le(e) {
164
- e === B && (B = e.parent_);
165
- }
166
- var Se = (e) => B = Ue(B, e);
167
- function Le(e) {
168
- const t = e[g];
169
- t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
170
- }
171
- function we(e, t) {
172
- t.unfinalizedDrafts_ = t.drafts_.length;
173
- const r = t.drafts_[0];
174
- if (e !== void 0 && e !== r) {
175
- r[g].modified_ && (ue(t), m(4)), C(e) && (e = Oe(t, e));
176
- const { patchPlugin_: i } = t;
177
- i && i.generateReplacementPatches_(
178
- r[g].base_,
179
- e,
180
- t
181
- );
182
- } else
183
- e = Oe(t, r);
184
- return $e(t, e, !0), ue(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== pe ? e : void 0;
185
- }
186
- function Oe(e, t) {
187
- if (ie(t))
188
- return t;
189
- const r = t[g];
190
- if (!r)
191
- return me(t, e.handledSet_, e);
192
- if (!oe(r, e))
193
- return t;
194
- if (!r.modified_)
195
- return r.base_;
196
- if (!r.finalized_) {
197
- const { callbacks_: n } = r;
198
- if (n)
199
- for (; n.length > 0; )
200
- n.pop()(e);
201
- De(r, e);
202
- }
203
- return r.copy_;
204
- }
205
- function $e(e, t, r = !1) {
206
- !e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && ye(t, r);
207
- }
208
- function ke(e) {
209
- e.finalized_ = !0, e.scope_.unfinalizedDrafts_--;
210
- }
211
- var oe = (e, t) => e.scope_ === t, We = [];
212
- function Fe(e, t, r, n) {
213
- const i = k(e), c = e.type_;
214
- if (n !== void 0 && E(i, n, c) === t) {
215
- ee(i, n, r, c);
216
- return;
217
- }
218
- if (!e.draftLocations_) {
219
- const p = e.draftLocations_ = /* @__PURE__ */ new Map();
220
- V(i, (S, w) => {
221
- if (z(w)) {
222
- const b = p.get(w) || [];
223
- b.push(S), p.set(w, b);
224
- }
225
- });
226
- }
227
- const _ = e.draftLocations_.get(t) ?? We;
228
- for (const p of _)
229
- ee(i, p, r, c);
230
- }
231
- function Be(e, t, r) {
232
- e.callbacks_.push(function(i) {
233
- const c = t;
234
- if (!c || !oe(c, i))
235
- return;
236
- i.mapSetPlugin_?.fixSetContents(c);
237
- const _ = he(c);
238
- Fe(e, c.draft_ ?? c, _, r), De(c, i);
239
- });
240
- }
241
- function De(e, t) {
242
- if (e.modified_ && !e.finalized_ && (e.type_ === 3 || (e.assigned_?.size ?? 0) > 0)) {
243
- const { patchPlugin_: n } = t;
244
- if (n) {
245
- const i = n.getPath(e);
246
- i && n.generatePatches_(e, i, t);
247
- }
248
- ke(e);
249
- }
250
- }
251
- function Ge(e, t, r) {
252
- const { scope_: n } = e;
253
- if (z(r)) {
254
- const i = r[g];
255
- oe(i, n) && i.callbacks_.push(function() {
256
- Z(e);
257
- const _ = he(i);
258
- Fe(e, r, _, t);
259
- });
260
- } else C(r) && e.callbacks_.push(function() {
261
- const c = k(e);
262
- E(c, t, e.type_) === r && n.drafts_.length > 1 && (e.assigned_.get(t) ?? !1) === !0 && e.copy_ && me(
263
- E(e.copy_, t, e.type_),
264
- n.handledSet_,
265
- n
266
- );
267
- });
268
- }
269
- function me(e, t, r) {
270
- return !r.immer_.autoFreeze_ && r.unfinalizedDrafts_ < 1 || z(e) || t.has(e) || !C(e) || ie(e) || (t.add(e), V(e, (n, i) => {
271
- if (z(i)) {
272
- const c = i[g];
273
- if (oe(c, r)) {
274
- const _ = he(c);
275
- ee(e, n, _, e.type_), ke(c);
276
- }
277
- } else C(i) && me(i, t, r);
278
- })), e;
279
- }
280
- function Ke(e, t) {
281
- const r = H(e), n = {
282
- type_: r ? 1 : 0,
283
- // Track which produce call this is associated with.
284
- scope_: t ? t.scope_ : Ee(),
285
- // True for both shallow and deep changes.
286
- modified_: !1,
287
- // Used during finalization.
288
- finalized_: !1,
289
- // Track which properties have been assigned (true) or deleted (false).
290
- // actually instantiated in `prepareCopy()`
291
- assigned_: void 0,
292
- // The parent draft state.
293
- parent_: t,
294
- // The base state.
295
- base_: e,
296
- // The base proxy.
297
- draft_: null,
298
- // set below
299
- // The base copy with any updated values.
300
- copy_: null,
301
- // Called by the `produce` function.
302
- revoke_: null,
303
- isManual_: !1,
304
- // `callbacks` actually gets assigned in `createProxy`
305
- callbacks_: void 0
306
- };
307
- let i = n, c = Pe;
308
- r && (i = [n], c = G);
309
- const { revoke: _, proxy: p } = Proxy.revocable(i, c);
310
- return n.draft_ = p, n.revoke_ = _, [p, n];
311
- }
312
- var Pe = {
313
- get(e, t) {
314
- if (t === g)
315
- return e;
316
- const r = k(e);
317
- if (!L(r, t, e.type_))
318
- return Ye(e, r, t);
319
- const n = r[t];
320
- if (e.finalized_ || !C(n))
321
- return n;
322
- if (n === se(e.base_, t)) {
323
- Z(e);
324
- const i = e.type_ === 1 ? +t : t, c = de(e.scope_, n, e, i);
325
- return e.copy_[i] = c;
326
- }
327
- return n;
328
- },
329
- has(e, t) {
330
- return t in k(e);
331
- },
332
- ownKeys(e) {
333
- return Reflect.ownKeys(k(e));
334
- },
335
- set(e, t, r) {
336
- const n = Ie(k(e), t);
337
- if (n?.set)
338
- return n.set.call(e.draft_, r), !0;
339
- if (!e.modified_) {
340
- const i = se(k(e), t), c = i?.[g];
341
- if (c && c.base_ === r)
342
- return e.copy_[t] = r, e.assigned_.set(t, !1), !0;
343
- if (Re(r, i) && (r !== void 0 || L(e.base_, t, e.type_)))
344
- return !0;
345
- Z(e), _e(e);
346
- }
347
- return e.copy_[t] === r && // special case: handle new props with value 'undefined'
348
- (r !== void 0 || t in e.copy_) || // special case: NaN
349
- Number.isNaN(r) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = r, e.assigned_.set(t, !0), Ge(e, t, r)), !0;
350
- },
351
- deleteProperty(e, t) {
352
- return Z(e), se(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_.set(t, !1), _e(e)) : e.assigned_.delete(t), e.copy_ && delete e.copy_[t], !0;
353
- },
354
- // Note: We never coerce `desc.value` into an Immer draft, because we can't make
355
- // the same guarantee in ES5 mode.
356
- getOwnPropertyDescriptor(e, t) {
357
- const r = k(e), n = Reflect.getOwnPropertyDescriptor(r, t);
358
- return n && {
359
- [Q]: !0,
360
- [ae]: e.type_ !== 1 || t !== "length",
361
- [j]: n[j],
362
- [W]: r[t]
363
- };
364
- },
365
- defineProperty() {
366
- m(11);
367
- },
368
- getPrototypeOf(e) {
369
- return I(e.base_);
370
- },
371
- setPrototypeOf() {
372
- m(12);
373
- }
374
- }, G = {};
375
- V(Pe, (e, t) => {
376
- G[e] = function() {
377
- const r = arguments;
378
- return r[0] = r[0][0], t.apply(this, r);
379
- };
380
- });
381
- G.deleteProperty = function(e, t) {
382
- return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && m(13), G.set.call(this, e, t, void 0);
383
- };
384
- G.set = function(e, t, r) {
385
- return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && m(14), Pe.set.call(this, e[0], t, r, e[0]);
386
- };
387
- function se(e, t) {
388
- const r = e[g];
389
- return (r ? k(r) : e)[t];
390
- }
391
- function Ye(e, t, r) {
392
- const n = Ie(t, r);
393
- return n ? W in n ? n[W] : (
394
- // This is a very special case, if the prop is a getter defined by the
395
- // prototype, we should invoke it with the draft as context!
396
- n.get?.call(e.draft_)
397
- ) : void 0;
398
- }
399
- function Ie(e, t) {
400
- if (!(t in e))
401
- return;
402
- let r = I(e);
403
- for (; r; ) {
404
- const n = Object.getOwnPropertyDescriptor(r, t);
405
- if (n)
406
- return n;
407
- r = I(r);
408
- }
409
- }
410
- function _e(e) {
411
- e.modified_ || (e.modified_ = !0, e.parent_ && _e(e.parent_));
412
- }
413
- function Z(e) {
414
- e.copy_ || (e.assigned_ = /* @__PURE__ */ new Map(), e.copy_ = fe(
415
- e.base_,
416
- e.scope_.immer_.useStrictShallowCopy_
417
- ));
418
- }
419
- var He = class {
420
- constructor(e) {
421
- this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !1, this.produce = (t, r, n) => {
422
- if (D(t) && !D(r)) {
423
- const c = r;
424
- r = t;
425
- const _ = this;
426
- return function(S = c, ...w) {
427
- return _.produce(S, (b) => r.call(this, b, ...w));
428
- };
429
- }
430
- D(r) || m(6), n !== void 0 && !D(n) && m(7);
431
- let i;
432
- if (C(t)) {
433
- const c = Se(this), _ = de(c, t, void 0);
434
- let p = !0;
435
- try {
436
- i = r(_), p = !1;
437
- } finally {
438
- p ? ue(c) : le(c);
439
- }
440
- return ve(c, n), we(i, c);
441
- } else if (!t || !T(t)) {
442
- if (i = r(t), i === void 0 && (i = t), i === pe && (i = void 0), this.autoFreeze_ && ye(i, !0), n) {
443
- const c = [], _ = [];
444
- M(re).generateReplacementPatches_(t, i, {
445
- patches_: c,
446
- inversePatches_: _
447
- }), n(c, _);
448
- }
449
- return i;
450
- } else
451
- m(1, t);
452
- }, this.produceWithPatches = (t, r) => {
453
- if (D(t))
454
- return (_, ...p) => this.produceWithPatches(_, (S) => t(S, ...p));
455
- let n, i;
456
- return [this.produce(t, r, (_, p) => {
457
- n = _, i = p;
458
- }), n, i];
459
- }, ce(e?.autoFreeze) && this.setAutoFreeze(e.autoFreeze), ce(e?.useStrictShallowCopy) && this.setUseStrictShallowCopy(e.useStrictShallowCopy), ce(e?.useStrictIteration) && this.setUseStrictIteration(e.useStrictIteration);
460
- }
461
- createDraft(e) {
462
- C(e) || m(8), z(e) && (e = Xe(e));
463
- const t = Se(this), r = de(t, e, void 0);
464
- return r[g].isManual_ = !0, le(t), r;
465
- }
466
- finishDraft(e, t) {
467
- const r = e && e[g];
468
- (!r || !r.isManual_) && m(9);
469
- const { scope_: n } = r;
470
- return ve(n, t), we(void 0, n);
471
- }
472
- /**
473
- * Pass true to automatically freeze all copies created by Immer.
474
- *
475
- * By default, auto-freezing is enabled.
476
- */
477
- setAutoFreeze(e) {
478
- this.autoFreeze_ = e;
479
- }
480
- /**
481
- * Pass true to enable strict shallow copy.
482
- *
483
- * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
484
- */
485
- setUseStrictShallowCopy(e) {
486
- this.useStrictShallowCopy_ = e;
487
- }
488
- /**
489
- * Pass false to use faster iteration that skips non-enumerable properties
490
- * but still handles symbols for compatibility.
491
- *
492
- * By default, strict iteration is enabled (includes all own properties).
493
- */
494
- setUseStrictIteration(e) {
495
- this.useStrictIteration_ = e;
496
- }
497
- shouldUseStrictIteration() {
498
- return this.useStrictIteration_;
499
- }
500
- applyPatches(e, t) {
501
- let r;
502
- for (r = t.length - 1; r >= 0; r--) {
503
- const i = t[r];
504
- if (i.path.length === 0 && i.op === "replace") {
505
- e = i.value;
506
- break;
507
- }
508
- }
509
- r > -1 && (t = t.slice(r + 1));
510
- const n = M(re).applyPatches_;
511
- return z(e) ? n(e, t) : this.produce(
512
- e,
513
- (i) => n(i, t)
514
- );
515
- }
516
- };
517
- function de(e, t, r, n) {
518
- const [i, c] = X(t) ? M(te).proxyMap_(t, r) : q(t) ? M(te).proxySet_(t, r) : Ke(t, r);
519
- return (r?.scope_ ?? Ee()).drafts_.push(i), c.callbacks_ = r?.callbacks_ ?? [], c.key_ = n, r && n !== void 0 ? Be(r, c, n) : c.callbacks_.push(function(S) {
520
- S.mapSetPlugin_?.fixSetContents(c);
521
- const { patchPlugin_: w } = S;
522
- c.modified_ && w && w.generatePatches_(c, [], S);
523
- }), i;
524
- }
525
- function Xe(e) {
526
- return z(e) || m(10, e), Ae(e);
527
- }
528
- function Ae(e) {
529
- if (!C(e) || ie(e))
530
- return e;
531
- const t = e[g];
532
- let r, n = !0;
533
- if (t) {
534
- if (!t.modified_)
535
- return t.base_;
536
- t.finalized_ = !0, r = fe(e, t.scope_.immer_.useStrictShallowCopy_), n = t.scope_.immer_.shouldUseStrictIteration();
537
- } else
538
- r = fe(e, !0);
539
- return V(
540
- r,
541
- (i, c) => {
542
- ee(r, i, Ae(c));
543
- },
544
- n
545
- ), t && (t.finalized_ = !1), r;
546
- }
547
- function Je() {
548
- process.env.NODE_ENV !== "production" && ze.push(
549
- 'Sets cannot have "replace" patches.',
550
- function(o) {
551
- return "Unsupported patch operation: " + o;
552
- },
553
- function(o) {
554
- return "Cannot apply patch, path doesn't resolve: " + o;
555
- },
556
- "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
557
- );
558
- function t(o, f = []) {
559
- if ("key_" in o && o.key_ !== void 0) {
560
- const a = o.parent_.copy_ ?? o.parent_.base_, u = Te(E(a, o.key_)), l = E(a, o.key_);
561
- if (l === void 0 || l !== o.draft_ && l !== o.base_ && l !== o.copy_ || u != null && u.base_ !== o.base_)
562
- return null;
563
- const d = o.parent_.type_ === 3;
564
- let h;
565
- if (d) {
566
- const s = o.parent_;
567
- h = Array.from(s.drafts_.keys()).indexOf(o.key_);
568
- } else
569
- h = o.key_;
570
- if (!(d && a.size > h || L(a, h)))
571
- return null;
572
- f.push(h);
573
- }
574
- if (o.parent_)
575
- return t(o.parent_, f);
576
- f.reverse();
577
- try {
578
- r(o.copy_, f);
579
- } catch {
580
- return null;
581
- }
582
- return f;
583
- }
584
- function r(o, f) {
585
- let a = o;
586
- for (let u = 0; u < f.length - 1; u++) {
587
- const l = f[u];
588
- if (a = E(a, l), !T(a) || a === null)
589
- throw new Error(`Cannot resolve path at '${f.join("/")}'`);
590
- }
591
- return a;
592
- }
593
- const n = "replace", i = "add", c = "remove";
594
- function _(o, f, a) {
595
- if (o.scope_.processedForPatches_.has(o))
596
- return;
597
- o.scope_.processedForPatches_.add(o);
598
- const { patches_: u, inversePatches_: l } = a;
599
- switch (o.type_) {
600
- case 0:
601
- case 2:
602
- return S(
603
- o,
604
- f,
605
- u,
606
- l
607
- );
608
- case 1:
609
- return p(
610
- o,
611
- f,
612
- u,
613
- l
614
- );
615
- case 3:
616
- return w(
617
- o,
618
- f,
619
- u,
620
- l
621
- );
622
- }
623
- }
624
- function p(o, f, a, u) {
625
- let { base_: l, assigned_: d } = o, h = o.copy_;
626
- h.length < l.length && ([l, h] = [h, l], [a, u] = [u, a]);
627
- for (let s = 0; s < l.length; s++) {
628
- const y = h[s], O = l[s];
629
- if (d?.get(s.toString()) && y !== O) {
630
- const F = y?.[g];
631
- if (F && F.modified_)
632
- continue;
633
- const P = f.concat([s]);
634
- a.push({
635
- op: n,
636
- path: P,
637
- // Need to maybe clone it, as it can in fact be the original value
638
- // due to the base/copy inversion at the start of this function
639
- value: R(y)
640
- }), u.push({
641
- op: n,
642
- path: P,
643
- value: R(O)
644
- });
645
- }
646
- }
647
- for (let s = l.length; s < h.length; s++) {
648
- const y = f.concat([s]);
649
- a.push({
650
- op: i,
651
- path: y,
652
- // Need to maybe clone it, as it can in fact be the original value
653
- // due to the base/copy inversion at the start of this function
654
- value: R(h[s])
655
- });
656
- }
657
- for (let s = h.length - 1; l.length <= s; --s) {
658
- const y = f.concat([s]);
659
- u.push({
660
- op: c,
661
- path: y
662
- });
663
- }
664
- }
665
- function S(o, f, a, u) {
666
- const { base_: l, copy_: d, type_: h } = o;
667
- V(o.assigned_, (s, y) => {
668
- const O = E(l, s, h), F = E(d, s, h), P = y ? L(l, s) ? n : i : c;
669
- if (O === F && P === n)
670
- return;
671
- const x = f.concat(s);
672
- a.push(
673
- P === c ? { op: P, path: x } : { op: P, path: x, value: R(F) }
674
- ), u.push(
675
- P === i ? { op: c, path: x } : P === c ? { op: i, path: x, value: R(O) } : { op: n, path: x, value: R(O) }
676
- );
677
- });
678
- }
679
- function w(o, f, a, u) {
680
- let { base_: l, copy_: d } = o, h = 0;
681
- l.forEach((s) => {
682
- if (!d.has(s)) {
683
- const y = f.concat([h]);
684
- a.push({
685
- op: c,
686
- path: y,
687
- value: s
688
- }), u.unshift({
689
- op: i,
690
- path: y,
691
- value: s
692
- });
693
- }
694
- h++;
695
- }), h = 0, d.forEach((s) => {
696
- if (!l.has(s)) {
697
- const y = f.concat([h]);
698
- a.push({
699
- op: i,
700
- path: y,
701
- value: s
702
- }), u.unshift({
703
- op: c,
704
- path: y,
705
- value: s
706
- });
707
- }
708
- h++;
709
- });
710
- }
711
- function b(o, f, a) {
712
- const { patches_: u, inversePatches_: l } = a;
713
- u.push({
714
- op: n,
715
- path: [],
716
- value: f === pe ? void 0 : f
717
- }), l.push({
718
- op: n,
719
- path: [],
720
- value: o
721
- });
722
- }
723
- function be(o, f) {
724
- return f.forEach((a) => {
725
- const { path: u, op: l } = a;
726
- let d = o;
727
- for (let O = 0; O < u.length - 1; O++) {
728
- const F = A(d);
729
- let P = u[O];
730
- typeof P != "string" && typeof P != "number" && (P = "" + P), (F === 0 || F === 1) && (P === "__proto__" || P === $) && m(19), D(d) && P === Y && m(19), d = E(d, P), T(d) || m(18, u.join("/"));
731
- }
732
- const h = A(d), s = N(a.value), y = u[u.length - 1];
733
- switch (l) {
734
- case n:
735
- switch (h) {
736
- case 2:
737
- return d.set(y, s);
738
- case 3:
739
- m(16);
740
- default:
741
- return d[y] = s;
742
- }
743
- case i:
744
- switch (h) {
745
- case 1:
746
- return y === "-" ? d.push(s) : d.splice(y, 0, s);
747
- case 2:
748
- return d.set(y, s);
749
- case 3:
750
- return d.add(s);
751
- default:
752
- return d[y] = s;
753
- }
754
- case c:
755
- switch (h) {
756
- case 1:
757
- return d.splice(y, 1);
758
- case 2:
759
- return d.delete(y);
760
- case 3:
761
- return d.delete(a.value);
762
- default:
763
- return delete d[y];
764
- }
765
- default:
766
- m(17, l);
767
- }
768
- }), o;
769
- }
770
- function N(o) {
771
- if (!C(o))
772
- return o;
773
- if (H(o))
774
- return o.map(N);
775
- if (X(o))
776
- return new Map(
777
- Array.from(o.entries()).map(([a, u]) => [a, N(u)])
778
- );
779
- if (q(o))
780
- return new Set(Array.from(o).map(N));
781
- const f = Object.create(I(o));
782
- for (const a in o)
783
- f[a] = N(o[a]);
784
- return L(o, U) && (f[U] = o[U]), f;
785
- }
786
- function R(o) {
787
- return z(o) ? N(o) : o;
788
- }
789
- xe(re, {
790
- applyPatches_: be,
791
- generatePatches_: _,
792
- generateReplacementPatches_: b,
793
- getPath: t
794
- });
795
- }
796
- var K = new He();
797
- K.produce;
798
- var Qe = /* @__PURE__ */ K.produceWithPatches.bind(
799
- K
800
- ), Ze = /* @__PURE__ */ K.applyPatches.bind(K);
801
- export {
802
- He as Immer,
803
- Ze as applyPatches,
804
- Xe as current,
805
- Je as enablePatches,
806
- ye as freeze,
807
- U as immerable,
808
- z as isDraft,
809
- C as isDraftable,
810
- pe as nothing,
811
- qe as original,
812
- Qe as produceWithPatches
813
- };
814
- //# sourceMappingURL=immer.es.js.map