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