document-model 1.0.21 → 1.0.23

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 (187) hide show
  1. package/dist/browser/document-model.cjs +1 -0
  2. package/dist/browser/document-model.d.ts +1 -0
  3. package/dist/browser/document-model.js +16 -0
  4. package/dist/browser/document.cjs +1 -0
  5. package/dist/browser/document.d.ts +1 -0
  6. package/dist/browser/document.js +14 -0
  7. package/dist/browser/index.cjs +1 -0
  8. package/dist/browser/index.d.ts +3 -0
  9. package/dist/browser/index.js +17 -0
  10. package/dist/browser/internal/index-8aac3662.js +1928 -0
  11. package/dist/browser/internal/index-8fceb2dc.js +1 -0
  12. package/dist/browser/internal/index-cd28e4ab.js +22 -0
  13. package/dist/browser/internal/index-e127ba7e.js +36 -0
  14. package/dist/browser/internal/object-67d1240b.js +1831 -0
  15. package/dist/browser/internal/object-ba4e810d.js +6 -0
  16. package/dist/browser/jest.config.d.ts +8 -0
  17. package/dist/browser/src/document/actions/creators.d.ts +47 -0
  18. package/dist/browser/src/document/actions/index.d.ts +10 -0
  19. package/dist/browser/src/document/actions/types.d.ts +8 -0
  20. package/dist/browser/src/document/index.d.ts +6 -0
  21. package/dist/browser/src/document/object.d.ts +447 -0
  22. package/dist/browser/src/document/reducer.d.ts +16 -0
  23. package/dist/browser/src/document/schema/index.d.ts +2 -0
  24. package/dist/browser/src/document/schema/types.d.ts +180 -0
  25. package/dist/browser/src/document/schema/zod.d.ts +113 -0
  26. package/dist/browser/src/document/signal.d.ts +28 -0
  27. package/dist/browser/src/document/types.d.ts +201 -0
  28. package/dist/browser/src/document/utils/base.d.ts +74 -0
  29. package/dist/browser/src/document/utils/file.d.ts +47 -0
  30. package/dist/browser/src/document/utils/index.d.ts +2 -0
  31. package/dist/browser/src/document/utils/node.d.ts +9 -0
  32. package/dist/browser/src/document-model/custom/reducers/header.d.ts +2 -0
  33. package/dist/browser/src/document-model/custom/reducers/module.d.ts +2 -0
  34. package/dist/browser/src/document-model/custom/reducers/operation-error.d.ts +2 -0
  35. package/dist/browser/src/document-model/custom/reducers/operation-example.d.ts +2 -0
  36. package/dist/browser/src/document-model/custom/reducers/operation.d.ts +2 -0
  37. package/dist/browser/src/document-model/custom/reducers/state.d.ts +2 -0
  38. package/dist/browser/src/document-model/custom/reducers/versioning.d.ts +7 -0
  39. package/dist/browser/src/document-model/custom/utils.d.ts +1 -0
  40. package/dist/browser/src/document-model/gen/actions.d.ts +15 -0
  41. package/dist/browser/src/document-model/gen/creators.d.ts +7 -0
  42. package/dist/browser/src/document-model/gen/document-model.d.ts +2 -0
  43. package/dist/browser/src/document-model/gen/header/actions.d.ts +9 -0
  44. package/dist/browser/src/document-model/gen/header/creators.d.ts +8 -0
  45. package/dist/browser/src/document-model/gen/header/object.d.ts +12 -0
  46. package/dist/browser/src/document-model/gen/header/operations.d.ts +10 -0
  47. package/dist/browser/src/document-model/gen/index.d.ts +5 -0
  48. package/dist/browser/src/document-model/gen/module/actions.d.ts +8 -0
  49. package/dist/browser/src/document-model/gen/module/creators.d.ts +7 -0
  50. package/dist/browser/src/document-model/gen/module/object.d.ts +11 -0
  51. package/dist/browser/src/document-model/gen/module/operations.d.ts +9 -0
  52. package/dist/browser/src/document-model/gen/object.d.ts +28 -0
  53. package/dist/browser/src/document-model/gen/operation/actions.d.ts +13 -0
  54. package/dist/browser/src/document-model/gen/operation/creators.d.ts +12 -0
  55. package/dist/browser/src/document-model/gen/operation/object.d.ts +16 -0
  56. package/dist/browser/src/document-model/gen/operation/operations.d.ts +14 -0
  57. package/dist/browser/src/document-model/gen/operation-error/actions.d.ts +10 -0
  58. package/dist/browser/src/document-model/gen/operation-error/creators.d.ts +9 -0
  59. package/dist/browser/src/document-model/gen/operation-error/object.d.ts +13 -0
  60. package/dist/browser/src/document-model/gen/operation-error/operations.d.ts +11 -0
  61. package/dist/browser/src/document-model/gen/operation-example/actions.d.ts +7 -0
  62. package/dist/browser/src/document-model/gen/operation-example/creators.d.ts +6 -0
  63. package/dist/browser/src/document-model/gen/operation-example/object.d.ts +10 -0
  64. package/dist/browser/src/document-model/gen/operation-example/operations.d.ts +8 -0
  65. package/dist/browser/src/document-model/gen/reducer.d.ts +5 -0
  66. package/dist/browser/src/document-model/gen/schema/index.d.ts +2 -0
  67. package/dist/browser/src/document-model/gen/schema/types.d.ts +453 -0
  68. package/dist/browser/src/document-model/gen/schema/zod.d.ts +453 -0
  69. package/dist/browser/src/document-model/gen/state/actions.d.ts +9 -0
  70. package/dist/browser/src/document-model/gen/state/creators.d.ts +8 -0
  71. package/dist/browser/src/document-model/gen/state/object.d.ts +12 -0
  72. package/dist/browser/src/document-model/gen/state/operations.d.ts +10 -0
  73. package/dist/browser/src/document-model/gen/types.d.ts +8 -0
  74. package/dist/browser/src/document-model/gen/utils.d.ts +6 -0
  75. package/dist/browser/src/document-model/gen/versioning/actions.d.ts +8 -0
  76. package/dist/browser/src/document-model/gen/versioning/creators.d.ts +7 -0
  77. package/dist/browser/src/document-model/gen/versioning/object.d.ts +11 -0
  78. package/dist/browser/src/document-model/gen/versioning/operations.d.ts +9 -0
  79. package/dist/browser/src/document-model/index.d.ts +75 -0
  80. package/dist/browser/src/index.d.ts +25 -0
  81. package/dist/browser/test/document/local.test.d.ts +1 -0
  82. package/dist/browser/test/document/object.test.d.ts +1 -0
  83. package/dist/browser/test/document/prune.test.d.ts +1 -0
  84. package/dist/browser/test/document/redo.test.d.ts +1 -0
  85. package/dist/browser/test/document/reducer.test.d.ts +1 -0
  86. package/dist/browser/test/document/skip-operations.test.d.ts +1 -0
  87. package/dist/browser/test/document/undo.test.d.ts +1 -0
  88. package/dist/browser/test/document/utils.test.d.ts +1 -0
  89. package/dist/browser/test/document-model/object.test.d.ts +1 -0
  90. package/dist/browser/test/document-model/skip-operations.test.d.ts +1 -0
  91. package/dist/browser/test/document-model/zip.test.d.ts +1 -0
  92. package/dist/browser/test/helpers.d.ts +32 -0
  93. package/dist/browser/vite.config.d.ts +2 -0
  94. package/dist/node/document-model.cjs +1 -0
  95. package/dist/node/document-model.d.ts +1 -0
  96. package/dist/node/document-model.js +20 -0
  97. package/dist/node/document.cjs +1 -0
  98. package/dist/node/document.d.ts +1 -0
  99. package/dist/node/document.js +18 -0
  100. package/dist/node/index.cjs +1 -0
  101. package/dist/node/index.d.ts +3 -0
  102. package/dist/node/index.js +21 -0
  103. package/dist/node/internal/index-ac24dd92.js +36 -0
  104. package/dist/node/internal/index-c75a9c7a.js +1 -0
  105. package/dist/node/internal/index-e9f12d45.js +1932 -0
  106. package/dist/node/internal/index-f04f94a6.js +22 -0
  107. package/dist/node/internal/object-10b89c54.js +1 -0
  108. package/dist/node/internal/object-cb276649.js +833 -0
  109. package/dist/node/jest.config.d.ts +8 -0
  110. package/dist/node/src/document/actions/creators.d.ts +47 -0
  111. package/dist/node/src/document/actions/index.d.ts +10 -0
  112. package/dist/node/src/document/actions/types.d.ts +8 -0
  113. package/dist/node/src/document/index.d.ts +6 -0
  114. package/dist/node/src/document/object.d.ts +447 -0
  115. package/dist/node/src/document/reducer.d.ts +16 -0
  116. package/dist/node/src/document/schema/index.d.ts +2 -0
  117. package/dist/node/src/document/schema/types.d.ts +180 -0
  118. package/dist/node/src/document/schema/zod.d.ts +113 -0
  119. package/dist/node/src/document/signal.d.ts +28 -0
  120. package/dist/node/src/document/types.d.ts +201 -0
  121. package/dist/node/src/document/utils/base.d.ts +74 -0
  122. package/dist/node/src/document/utils/file.d.ts +47 -0
  123. package/dist/node/src/document/utils/index.d.ts +2 -0
  124. package/dist/node/src/document/utils/node.d.ts +9 -0
  125. package/dist/node/src/document-model/custom/reducers/header.d.ts +2 -0
  126. package/dist/node/src/document-model/custom/reducers/module.d.ts +2 -0
  127. package/dist/node/src/document-model/custom/reducers/operation-error.d.ts +2 -0
  128. package/dist/node/src/document-model/custom/reducers/operation-example.d.ts +2 -0
  129. package/dist/node/src/document-model/custom/reducers/operation.d.ts +2 -0
  130. package/dist/node/src/document-model/custom/reducers/state.d.ts +2 -0
  131. package/dist/node/src/document-model/custom/reducers/versioning.d.ts +7 -0
  132. package/dist/node/src/document-model/custom/utils.d.ts +1 -0
  133. package/dist/node/src/document-model/gen/actions.d.ts +15 -0
  134. package/dist/node/src/document-model/gen/creators.d.ts +7 -0
  135. package/dist/node/src/document-model/gen/document-model.d.ts +2 -0
  136. package/dist/node/src/document-model/gen/header/actions.d.ts +9 -0
  137. package/dist/node/src/document-model/gen/header/creators.d.ts +8 -0
  138. package/dist/node/src/document-model/gen/header/object.d.ts +12 -0
  139. package/dist/node/src/document-model/gen/header/operations.d.ts +10 -0
  140. package/dist/node/src/document-model/gen/index.d.ts +5 -0
  141. package/dist/node/src/document-model/gen/module/actions.d.ts +8 -0
  142. package/dist/node/src/document-model/gen/module/creators.d.ts +7 -0
  143. package/dist/node/src/document-model/gen/module/object.d.ts +11 -0
  144. package/dist/node/src/document-model/gen/module/operations.d.ts +9 -0
  145. package/dist/node/src/document-model/gen/object.d.ts +28 -0
  146. package/dist/node/src/document-model/gen/operation/actions.d.ts +13 -0
  147. package/dist/node/src/document-model/gen/operation/creators.d.ts +12 -0
  148. package/dist/node/src/document-model/gen/operation/object.d.ts +16 -0
  149. package/dist/node/src/document-model/gen/operation/operations.d.ts +14 -0
  150. package/dist/node/src/document-model/gen/operation-error/actions.d.ts +10 -0
  151. package/dist/node/src/document-model/gen/operation-error/creators.d.ts +9 -0
  152. package/dist/node/src/document-model/gen/operation-error/object.d.ts +13 -0
  153. package/dist/node/src/document-model/gen/operation-error/operations.d.ts +11 -0
  154. package/dist/node/src/document-model/gen/operation-example/actions.d.ts +7 -0
  155. package/dist/node/src/document-model/gen/operation-example/creators.d.ts +6 -0
  156. package/dist/node/src/document-model/gen/operation-example/object.d.ts +10 -0
  157. package/dist/node/src/document-model/gen/operation-example/operations.d.ts +8 -0
  158. package/dist/node/src/document-model/gen/reducer.d.ts +5 -0
  159. package/dist/node/src/document-model/gen/schema/index.d.ts +2 -0
  160. package/dist/node/src/document-model/gen/schema/types.d.ts +453 -0
  161. package/dist/node/src/document-model/gen/schema/zod.d.ts +453 -0
  162. package/dist/node/src/document-model/gen/state/actions.d.ts +9 -0
  163. package/dist/node/src/document-model/gen/state/creators.d.ts +8 -0
  164. package/dist/node/src/document-model/gen/state/object.d.ts +12 -0
  165. package/dist/node/src/document-model/gen/state/operations.d.ts +10 -0
  166. package/dist/node/src/document-model/gen/types.d.ts +8 -0
  167. package/dist/node/src/document-model/gen/utils.d.ts +6 -0
  168. package/dist/node/src/document-model/gen/versioning/actions.d.ts +8 -0
  169. package/dist/node/src/document-model/gen/versioning/creators.d.ts +7 -0
  170. package/dist/node/src/document-model/gen/versioning/object.d.ts +11 -0
  171. package/dist/node/src/document-model/gen/versioning/operations.d.ts +9 -0
  172. package/dist/node/src/document-model/index.d.ts +75 -0
  173. package/dist/node/src/index.d.ts +25 -0
  174. package/dist/node/test/document/local.test.d.ts +1 -0
  175. package/dist/node/test/document/object.test.d.ts +1 -0
  176. package/dist/node/test/document/prune.test.d.ts +1 -0
  177. package/dist/node/test/document/redo.test.d.ts +1 -0
  178. package/dist/node/test/document/reducer.test.d.ts +1 -0
  179. package/dist/node/test/document/skip-operations.test.d.ts +1 -0
  180. package/dist/node/test/document/undo.test.d.ts +1 -0
  181. package/dist/node/test/document/utils.test.d.ts +1 -0
  182. package/dist/node/test/document-model/object.test.d.ts +1 -0
  183. package/dist/node/test/document-model/skip-operations.test.d.ts +1 -0
  184. package/dist/node/test/document-model/zip.test.d.ts +1 -0
  185. package/dist/node/test/helpers.d.ts +32 -0
  186. package/dist/node/vite.config.d.ts +2 -0
  187. package/package.json +1 -1
@@ -0,0 +1,1928 @@
1
+ var ut = Object.defineProperty;
2
+ var mt = (t, e, r) => e in t ? ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var ce = (t, e, r) => (mt(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ import { c as Et, i as ht, a as Ot, b as gt, s as St, d as bt, l as ft, e as _t, f as s, B as l, g as It, h as Tt } from "./object-67d1240b.js";
5
+ import "json-stringify-deterministic";
6
+ import "immer";
7
+ import "jszip";
8
+ import { z as o } from "zod";
9
+ const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10
+ __proto__: null
11
+ }, Symbol.toStringTag, { value: "Module" })), de = {
12
+ id: "powerhouse/document-model",
13
+ name: "DocumentModel",
14
+ extension: "phdm",
15
+ description: "The Powerhouse Document Model describes the state and operations of a document type.",
16
+ author: {
17
+ name: "Powerhouse",
18
+ website: "https://www.powerhouse.inc/"
19
+ },
20
+ specifications: [
21
+ {
22
+ version: 1,
23
+ changeLog: [],
24
+ modules: [
25
+ {
26
+ name: "header",
27
+ operations: [
28
+ {
29
+ name: "SetModelName",
30
+ id: "",
31
+ description: "",
32
+ schema: "",
33
+ template: "",
34
+ reducer: "",
35
+ examples: [],
36
+ errors: [],
37
+ scope: "global"
38
+ },
39
+ {
40
+ name: "SetModelId",
41
+ id: "",
42
+ description: "",
43
+ schema: "",
44
+ template: "",
45
+ reducer: "",
46
+ examples: [],
47
+ errors: [],
48
+ scope: "global"
49
+ },
50
+ {
51
+ name: "SetModelExtension",
52
+ id: "",
53
+ description: "",
54
+ schema: "",
55
+ template: "",
56
+ reducer: "",
57
+ examples: [],
58
+ errors: [],
59
+ scope: "global"
60
+ },
61
+ {
62
+ name: "SetModelDescription",
63
+ id: "",
64
+ description: "",
65
+ schema: "",
66
+ template: "",
67
+ reducer: "",
68
+ examples: [],
69
+ errors: [],
70
+ scope: "global"
71
+ },
72
+ {
73
+ name: "SetAuthorName",
74
+ id: "",
75
+ description: "",
76
+ schema: "",
77
+ template: "",
78
+ reducer: "",
79
+ examples: [],
80
+ errors: [],
81
+ scope: "global"
82
+ },
83
+ {
84
+ name: "SetAuthorWebsite",
85
+ id: "",
86
+ description: "",
87
+ schema: "",
88
+ template: "",
89
+ reducer: "",
90
+ examples: [],
91
+ errors: [],
92
+ scope: "global"
93
+ }
94
+ ],
95
+ id: "",
96
+ description: ""
97
+ },
98
+ {
99
+ name: "versioning",
100
+ operations: [
101
+ {
102
+ name: "AddChangeLogItem",
103
+ id: "",
104
+ description: "",
105
+ schema: "",
106
+ template: "",
107
+ reducer: "",
108
+ examples: [],
109
+ errors: [],
110
+ scope: "global"
111
+ },
112
+ {
113
+ name: "UpdateChangeLogItem",
114
+ id: "",
115
+ description: "",
116
+ schema: "",
117
+ template: "",
118
+ reducer: "",
119
+ examples: [],
120
+ errors: [],
121
+ scope: "global"
122
+ },
123
+ {
124
+ name: "DeleteChangeLogItem",
125
+ id: "",
126
+ description: "",
127
+ schema: "",
128
+ template: "",
129
+ reducer: "",
130
+ examples: [],
131
+ errors: [],
132
+ scope: "global"
133
+ },
134
+ {
135
+ name: "ReorderChangeLogItems",
136
+ id: "",
137
+ description: "",
138
+ schema: "",
139
+ template: "",
140
+ reducer: "",
141
+ examples: [],
142
+ errors: [],
143
+ scope: "global"
144
+ },
145
+ {
146
+ name: "ReleaseNewVersion",
147
+ schema: null,
148
+ id: "",
149
+ description: "",
150
+ template: "",
151
+ reducer: "",
152
+ examples: [],
153
+ errors: [],
154
+ scope: "global"
155
+ }
156
+ ],
157
+ id: "",
158
+ description: ""
159
+ },
160
+ {
161
+ name: "module",
162
+ operations: [
163
+ {
164
+ name: "AddModule",
165
+ id: "",
166
+ description: "",
167
+ schema: "",
168
+ template: "",
169
+ reducer: "",
170
+ examples: [],
171
+ errors: [],
172
+ scope: "global"
173
+ },
174
+ {
175
+ name: "SetModuleName",
176
+ id: "",
177
+ description: "",
178
+ schema: "",
179
+ template: "",
180
+ reducer: "",
181
+ examples: [],
182
+ errors: [],
183
+ scope: "global"
184
+ },
185
+ {
186
+ name: "SetModuleDescription",
187
+ id: "",
188
+ description: "",
189
+ schema: "",
190
+ template: "",
191
+ reducer: "",
192
+ examples: [],
193
+ errors: [],
194
+ scope: "global"
195
+ },
196
+ {
197
+ name: "DeleteModule",
198
+ id: "",
199
+ description: "",
200
+ schema: "",
201
+ template: "",
202
+ reducer: "",
203
+ examples: [],
204
+ errors: [],
205
+ scope: "global"
206
+ },
207
+ {
208
+ name: "ReorderModules",
209
+ id: "",
210
+ description: "",
211
+ schema: "",
212
+ template: "",
213
+ reducer: "",
214
+ examples: [],
215
+ errors: [],
216
+ scope: "global"
217
+ }
218
+ ],
219
+ id: "",
220
+ description: ""
221
+ },
222
+ {
223
+ name: "operation-error",
224
+ operations: [
225
+ {
226
+ name: "AddOperationError",
227
+ id: "",
228
+ description: "",
229
+ schema: "",
230
+ template: "",
231
+ reducer: "",
232
+ examples: [],
233
+ errors: [],
234
+ scope: "global"
235
+ },
236
+ {
237
+ name: "SetOperationErrorCode",
238
+ id: "",
239
+ description: "",
240
+ schema: "",
241
+ template: "",
242
+ reducer: "",
243
+ examples: [],
244
+ errors: [],
245
+ scope: "global"
246
+ },
247
+ {
248
+ name: "SetOperationErrorName",
249
+ id: "",
250
+ description: "",
251
+ schema: "",
252
+ template: "",
253
+ reducer: "",
254
+ examples: [],
255
+ errors: [],
256
+ scope: "global"
257
+ },
258
+ {
259
+ name: "SetOperationErrorDescription",
260
+ id: "",
261
+ description: "",
262
+ schema: "",
263
+ template: "",
264
+ reducer: "",
265
+ examples: [],
266
+ errors: [],
267
+ scope: "global"
268
+ },
269
+ {
270
+ name: "SetOperationErrorTemplate",
271
+ id: "",
272
+ description: "",
273
+ schema: "",
274
+ template: "",
275
+ reducer: "",
276
+ examples: [],
277
+ errors: [],
278
+ scope: "global"
279
+ },
280
+ {
281
+ name: "DeleteOperationError",
282
+ id: "",
283
+ description: "",
284
+ schema: "",
285
+ template: "",
286
+ reducer: "",
287
+ examples: [],
288
+ errors: [],
289
+ scope: "global"
290
+ },
291
+ {
292
+ name: "ReorderOperationErrors",
293
+ id: "",
294
+ description: "",
295
+ schema: "",
296
+ template: "",
297
+ reducer: "",
298
+ examples: [],
299
+ errors: [],
300
+ scope: "global"
301
+ }
302
+ ],
303
+ id: "",
304
+ description: ""
305
+ },
306
+ {
307
+ name: "operation-example",
308
+ operations: [
309
+ {
310
+ name: "AddOperationExample",
311
+ id: "",
312
+ description: "",
313
+ schema: "",
314
+ template: "",
315
+ reducer: "",
316
+ examples: [],
317
+ errors: [],
318
+ scope: "global"
319
+ },
320
+ {
321
+ name: "UpdateOperationExample",
322
+ id: "",
323
+ description: "",
324
+ schema: "",
325
+ template: "",
326
+ reducer: "",
327
+ examples: [],
328
+ errors: [],
329
+ scope: "global"
330
+ },
331
+ {
332
+ name: "DeleteOperationExample",
333
+ id: "",
334
+ description: "",
335
+ schema: "",
336
+ template: "",
337
+ reducer: "",
338
+ examples: [],
339
+ errors: [],
340
+ scope: "global"
341
+ },
342
+ {
343
+ name: "ReorderOperationExamples",
344
+ id: "",
345
+ description: "",
346
+ schema: "",
347
+ template: "",
348
+ reducer: "",
349
+ examples: [],
350
+ errors: [],
351
+ scope: "global"
352
+ }
353
+ ],
354
+ id: "",
355
+ description: ""
356
+ },
357
+ {
358
+ name: "operation",
359
+ operations: [
360
+ {
361
+ name: "AddOperation",
362
+ id: "",
363
+ description: "",
364
+ schema: "",
365
+ template: "",
366
+ reducer: "",
367
+ examples: [],
368
+ errors: [],
369
+ scope: "global"
370
+ },
371
+ {
372
+ name: "SetOperationName",
373
+ id: "",
374
+ description: "",
375
+ schema: "",
376
+ template: "",
377
+ reducer: "",
378
+ examples: [],
379
+ errors: [],
380
+ scope: "global"
381
+ },
382
+ {
383
+ name: "SetOperationSchema",
384
+ id: "",
385
+ description: "",
386
+ schema: "",
387
+ template: "",
388
+ reducer: "",
389
+ examples: [],
390
+ errors: [],
391
+ scope: "global"
392
+ },
393
+ {
394
+ name: "SetOperationDescription",
395
+ id: "",
396
+ description: "",
397
+ schema: "",
398
+ template: "",
399
+ reducer: "",
400
+ examples: [],
401
+ errors: [],
402
+ scope: "global"
403
+ },
404
+ {
405
+ name: "SetOperationTemplate",
406
+ id: "",
407
+ description: "",
408
+ schema: "",
409
+ template: "",
410
+ reducer: "",
411
+ examples: [],
412
+ errors: [],
413
+ scope: "global"
414
+ },
415
+ {
416
+ name: "SetOperationReducer",
417
+ id: "",
418
+ description: "",
419
+ schema: "",
420
+ template: "",
421
+ reducer: "",
422
+ examples: [],
423
+ errors: [],
424
+ scope: "global"
425
+ },
426
+ {
427
+ name: "MoveOperation",
428
+ id: "",
429
+ description: "",
430
+ schema: "",
431
+ template: "",
432
+ reducer: "",
433
+ examples: [],
434
+ errors: [],
435
+ scope: "global"
436
+ },
437
+ {
438
+ name: "DeleteOperation",
439
+ id: "",
440
+ description: "",
441
+ schema: "",
442
+ template: "",
443
+ reducer: "",
444
+ examples: [],
445
+ errors: [],
446
+ scope: "global"
447
+ },
448
+ {
449
+ name: "ReorderModuleOperations",
450
+ id: "",
451
+ description: "",
452
+ schema: "",
453
+ template: "",
454
+ reducer: "",
455
+ examples: [],
456
+ errors: [],
457
+ scope: "global"
458
+ }
459
+ ],
460
+ id: "",
461
+ description: ""
462
+ },
463
+ {
464
+ name: "state",
465
+ operations: [
466
+ {
467
+ name: "SetStateSchema",
468
+ id: "",
469
+ description: "",
470
+ schema: "",
471
+ template: "",
472
+ reducer: "",
473
+ examples: [],
474
+ errors: [],
475
+ scope: "global"
476
+ },
477
+ {
478
+ name: "SetInitialState",
479
+ id: "",
480
+ description: "",
481
+ schema: "",
482
+ template: "",
483
+ reducer: "",
484
+ examples: [],
485
+ errors: [],
486
+ scope: "global"
487
+ },
488
+ {
489
+ name: "AddStateExample",
490
+ id: "",
491
+ description: "",
492
+ schema: "",
493
+ template: "",
494
+ reducer: "",
495
+ examples: [],
496
+ errors: [],
497
+ scope: "global"
498
+ },
499
+ {
500
+ name: "UpdateStateExample",
501
+ id: "",
502
+ description: "",
503
+ schema: "",
504
+ template: "",
505
+ reducer: "",
506
+ examples: [],
507
+ errors: [],
508
+ scope: "global"
509
+ },
510
+ {
511
+ name: "DeleteStateExample",
512
+ id: "",
513
+ description: "",
514
+ schema: "",
515
+ template: "",
516
+ reducer: "",
517
+ examples: [],
518
+ errors: [],
519
+ scope: "global"
520
+ },
521
+ {
522
+ name: "ReorderStateExamples",
523
+ id: "",
524
+ description: "",
525
+ schema: "",
526
+ template: "",
527
+ reducer: "",
528
+ examples: [],
529
+ errors: [],
530
+ scope: "global"
531
+ }
532
+ ],
533
+ id: "",
534
+ description: ""
535
+ }
536
+ ],
537
+ state: {
538
+ global: {
539
+ schema: "",
540
+ initialValue: `{
541
+ "id": "",
542
+ "name": "",
543
+ "extension": "",
544
+ "description": "",
545
+ "author": {
546
+ "name": "",
547
+ "website": ""
548
+ },
549
+ "specifications": [
550
+ {
551
+ "version": 1,
552
+ "changeLog": [],
553
+ "state": {
554
+ "schema": "",
555
+ "initialValue": "",
556
+ "examples": []
557
+ },
558
+ "modules": []
559
+ }
560
+ ]
561
+ }`,
562
+ examples: []
563
+ },
564
+ local: {
565
+ schema: "",
566
+ initialValue: "{}",
567
+ examples: []
568
+ }
569
+ }
570
+ }
571
+ ]
572
+ }, ue = (t) => t != null, At = o.any().refine((t) => ue(t));
573
+ function _() {
574
+ return o.object({
575
+ __typename: o.literal("AddChangeLogItemInput").optional(),
576
+ content: o.string(),
577
+ id: o.string(),
578
+ insertBefore: o.string().nullable()
579
+ });
580
+ }
581
+ function I() {
582
+ return o.object({
583
+ description: o.string().nullish(),
584
+ id: o.string(),
585
+ name: o.string()
586
+ });
587
+ }
588
+ function T() {
589
+ return o.object({
590
+ errorCode: o.string().nullish(),
591
+ errorDescription: o.string().nullish(),
592
+ errorName: o.string().nullish(),
593
+ errorTemplate: o.string().nullish(),
594
+ id: o.string(),
595
+ operationId: o.string()
596
+ });
597
+ }
598
+ function R() {
599
+ return o.object({
600
+ example: o.string(),
601
+ id: o.string(),
602
+ operationId: o.string()
603
+ });
604
+ }
605
+ function A() {
606
+ return o.object({
607
+ description: o.string().nullish(),
608
+ id: o.string(),
609
+ moduleId: o.string(),
610
+ name: o.string(),
611
+ reducer: o.string().nullish(),
612
+ schema: o.string().nullish(),
613
+ template: o.string().nullish(),
614
+ scope: b().nullish()
615
+ });
616
+ }
617
+ function x() {
618
+ return o.object({
619
+ scope: o.string(),
620
+ example: o.string(),
621
+ id: o.string(),
622
+ insertBefore: o.string().nullish()
623
+ });
624
+ }
625
+ function me() {
626
+ return o.object({
627
+ __typename: o.literal("Author").optional(),
628
+ name: o.string(),
629
+ website: o.string().nullable()
630
+ });
631
+ }
632
+ function D() {
633
+ return o.object({
634
+ __typename: o.literal("CodeExample").optional(),
635
+ id: o.string(),
636
+ value: o.string()
637
+ });
638
+ }
639
+ function M() {
640
+ return o.object({
641
+ __typename: o.literal("DeleteChangeLogItemInput").optional(),
642
+ id: o.string()
643
+ });
644
+ }
645
+ function N() {
646
+ return o.object({
647
+ id: o.string()
648
+ });
649
+ }
650
+ function L() {
651
+ return o.object({
652
+ id: o.string()
653
+ });
654
+ }
655
+ function P() {
656
+ return o.object({
657
+ id: o.string()
658
+ });
659
+ }
660
+ function j() {
661
+ return o.object({
662
+ id: o.string()
663
+ });
664
+ }
665
+ function C() {
666
+ return o.object({
667
+ scope: o.string(),
668
+ id: o.string()
669
+ });
670
+ }
671
+ function b() {
672
+ return o.literal("global").or(o.literal("local"));
673
+ }
674
+ function xt() {
675
+ return o.union([
676
+ _(),
677
+ I(),
678
+ T(),
679
+ R(),
680
+ A(),
681
+ x(),
682
+ M(),
683
+ N(),
684
+ L(),
685
+ P(),
686
+ j(),
687
+ C(),
688
+ k(),
689
+ y(),
690
+ w(),
691
+ v(),
692
+ U(),
693
+ V(),
694
+ F(),
695
+ H(),
696
+ X(),
697
+ G(),
698
+ $(),
699
+ W(),
700
+ z(),
701
+ B(),
702
+ q(),
703
+ J(),
704
+ K(),
705
+ Q(),
706
+ Y(),
707
+ Z(),
708
+ ee(),
709
+ te(),
710
+ re(),
711
+ oe(),
712
+ ne(),
713
+ ie(),
714
+ se(),
715
+ ae(),
716
+ pe()
717
+ ]);
718
+ }
719
+ function Dt() {
720
+ return o.object({
721
+ __typename: o.literal("DocumentModelState").optional(),
722
+ author: me(),
723
+ description: o.string(),
724
+ extension: o.string(),
725
+ id: o.string(),
726
+ name: o.string(),
727
+ specifications: o.array(Ee())
728
+ });
729
+ }
730
+ function Ee() {
731
+ return o.object({
732
+ __typename: o.literal("DocumentSpecification").optional(),
733
+ changeLog: o.array(o.string()),
734
+ modules: o.array(he()),
735
+ state: be(),
736
+ version: o.number()
737
+ });
738
+ }
739
+ function he() {
740
+ return o.object({
741
+ __typename: o.literal("Module").optional(),
742
+ description: o.string().nullable(),
743
+ id: o.string(),
744
+ name: o.string(),
745
+ operations: o.array(Oe())
746
+ });
747
+ }
748
+ function k() {
749
+ return o.object({
750
+ newModuleId: o.string(),
751
+ operationId: o.string()
752
+ });
753
+ }
754
+ function Oe() {
755
+ return o.object({
756
+ __typename: o.literal("Operation").optional(),
757
+ description: o.string().nullable(),
758
+ errors: o.array(ge()),
759
+ examples: o.array(D()),
760
+ id: o.string(),
761
+ name: o.string().nullable(),
762
+ reducer: o.string().nullable(),
763
+ schema: o.string().nullable(),
764
+ template: o.string().nullable(),
765
+ scope: b()
766
+ });
767
+ }
768
+ function ge() {
769
+ return o.object({
770
+ __typename: o.literal("OperationError").optional(),
771
+ code: o.string().nullable(),
772
+ description: o.string().nullable(),
773
+ id: o.string(),
774
+ name: o.string().nullable(),
775
+ template: o.string().nullable()
776
+ });
777
+ }
778
+ function y() {
779
+ return o.object({
780
+ __typename: o.literal("ReorderChangeLogItemsInput").optional(),
781
+ order: o.array(o.string())
782
+ });
783
+ }
784
+ function w() {
785
+ return o.object({
786
+ moduleId: o.string(),
787
+ order: o.array(o.string())
788
+ });
789
+ }
790
+ function v() {
791
+ return o.object({
792
+ order: o.array(o.string())
793
+ });
794
+ }
795
+ function U() {
796
+ return o.object({
797
+ operationId: o.string(),
798
+ order: o.array(o.string())
799
+ });
800
+ }
801
+ function V() {
802
+ return o.object({
803
+ operationId: o.string(),
804
+ order: o.array(o.string())
805
+ });
806
+ }
807
+ function F() {
808
+ return o.object({
809
+ scope: o.string(),
810
+ order: o.array(o.string())
811
+ });
812
+ }
813
+ function H() {
814
+ return o.object({
815
+ authorName: o.string()
816
+ });
817
+ }
818
+ function X() {
819
+ return o.object({
820
+ authorWebsite: o.string()
821
+ });
822
+ }
823
+ function G() {
824
+ return o.object({
825
+ scope: o.string(),
826
+ initialValue: o.string()
827
+ });
828
+ }
829
+ function $() {
830
+ return o.object({
831
+ description: o.string()
832
+ });
833
+ }
834
+ function W() {
835
+ return o.object({
836
+ extension: o.string()
837
+ });
838
+ }
839
+ function z() {
840
+ return o.object({
841
+ id: o.string()
842
+ });
843
+ }
844
+ function B() {
845
+ return o.object({
846
+ name: o.string()
847
+ });
848
+ }
849
+ function q() {
850
+ return o.object({
851
+ description: o.string().nullish(),
852
+ id: o.string()
853
+ });
854
+ }
855
+ function J() {
856
+ return o.object({
857
+ id: o.string(),
858
+ name: o.string().nullish()
859
+ });
860
+ }
861
+ function K() {
862
+ return o.object({
863
+ description: o.string().nullish(),
864
+ id: o.string()
865
+ });
866
+ }
867
+ function Q() {
868
+ return o.object({
869
+ errorCode: o.string().nullish(),
870
+ id: o.string()
871
+ });
872
+ }
873
+ function Y() {
874
+ return o.object({
875
+ errorDescription: o.string().nullish(),
876
+ id: o.string()
877
+ });
878
+ }
879
+ function Z() {
880
+ return o.object({
881
+ errorName: o.string().nullish(),
882
+ id: o.string()
883
+ });
884
+ }
885
+ function ee() {
886
+ return o.object({
887
+ errorTemplate: o.string().nullish(),
888
+ id: o.string()
889
+ });
890
+ }
891
+ function te() {
892
+ return o.object({
893
+ id: o.string(),
894
+ name: o.string().nullish()
895
+ });
896
+ }
897
+ function Se() {
898
+ return o.object({
899
+ id: o.string(),
900
+ scope: b()
901
+ });
902
+ }
903
+ function re() {
904
+ return o.object({
905
+ id: o.string(),
906
+ reducer: o.string().nullish()
907
+ });
908
+ }
909
+ function oe() {
910
+ return o.object({
911
+ id: o.string(),
912
+ schema: o.string().nullish()
913
+ });
914
+ }
915
+ function ne() {
916
+ return o.object({
917
+ id: o.string(),
918
+ template: o.string().nullish()
919
+ });
920
+ }
921
+ function ie() {
922
+ return o.object({
923
+ scope: o.string(),
924
+ schema: o.string()
925
+ });
926
+ }
927
+ function f() {
928
+ return o.object({
929
+ __typename: o.literal("State").optional(),
930
+ examples: o.array(D()),
931
+ initialValue: o.string(),
932
+ schema: o.string()
933
+ });
934
+ }
935
+ function be() {
936
+ return o.object({
937
+ global: f(),
938
+ local: f()
939
+ });
940
+ }
941
+ function se() {
942
+ return o.object({
943
+ __typename: o.literal("UpdateChangeLogItemInput").optional(),
944
+ id: o.string(),
945
+ newContent: o.string()
946
+ });
947
+ }
948
+ function ae() {
949
+ return o.object({
950
+ example: o.string(),
951
+ id: o.string()
952
+ });
953
+ }
954
+ function pe() {
955
+ return o.object({
956
+ scope: o.string(),
957
+ id: o.string(),
958
+ newExample: o.string()
959
+ });
960
+ }
961
+ const Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
962
+ __proto__: null,
963
+ AddChangeLogItemInputSchema: _,
964
+ AddModuleInputSchema: I,
965
+ AddOperationErrorInputSchema: T,
966
+ AddOperationExampleInputSchema: R,
967
+ AddOperationInputSchema: A,
968
+ AddStateExampleInputSchema: x,
969
+ AuthorSchema: me,
970
+ CodeExampleSchema: D,
971
+ DeleteChangeLogItemInputSchema: M,
972
+ DeleteModuleInputSchema: N,
973
+ DeleteOperationErrorInputSchema: L,
974
+ DeleteOperationExampleInputSchema: P,
975
+ DeleteOperationInputSchema: j,
976
+ DeleteStateExampleInputSchema: C,
977
+ DocumentModelInputSchema: xt,
978
+ DocumentModelStateSchema: Dt,
979
+ DocumentSpecificationSchema: Ee,
980
+ ModuleSchema: he,
981
+ MoveOperationInputSchema: k,
982
+ OperationErrorSchema: ge,
983
+ OperationSchema: Oe,
984
+ OperationScopeSchema: b,
985
+ ReorderChangeLogItemsInputSchema: y,
986
+ ReorderModuleOperationsInputSchema: w,
987
+ ReorderModulesInputSchema: v,
988
+ ReorderOperationErrorsInputSchema: U,
989
+ ReorderOperationExamplesInputSchema: V,
990
+ ReorderStateExamplesInputSchema: F,
991
+ ScopeStateSchema: be,
992
+ SetAuthorNameInputSchema: H,
993
+ SetAuthorWebsiteInputSchema: X,
994
+ SetInitialStateInputSchema: G,
995
+ SetModelDescriptionInputSchema: $,
996
+ SetModelExtensionInputSchema: W,
997
+ SetModelIdInputSchema: z,
998
+ SetModelNameInputSchema: B,
999
+ SetModuleDescriptionInputSchema: q,
1000
+ SetModuleNameInputSchema: J,
1001
+ SetOperationDescriptionInputSchema: K,
1002
+ SetOperationErrorCodeInputSchema: Q,
1003
+ SetOperationErrorDescriptionInputSchema: Y,
1004
+ SetOperationErrorNameInputSchema: Z,
1005
+ SetOperationErrorTemplateInputSchema: ee,
1006
+ SetOperationNameInputSchema: te,
1007
+ SetOperationReducerInputSchema: re,
1008
+ SetOperationSchemaInputSchema: oe,
1009
+ SetOperationScopeInputSchema: Se,
1010
+ SetOperationTemplateInputSchema: ne,
1011
+ SetStateSchemaInputSchema: ie,
1012
+ StateSchema: f,
1013
+ UpdateChangeLogItemInputSchema: se,
1014
+ UpdateOperationExampleInputSchema: ae,
1015
+ UpdateStateExampleInputSchema: pe,
1016
+ definedNonNullAnySchema: At,
1017
+ isDefinedNonNullAny: ue
1018
+ }, Symbol.toStringTag, { value: "Module" })), d = {
1019
+ setModelNameOperation(t, e) {
1020
+ t.name = e.input.name;
1021
+ },
1022
+ setModelIdOperation(t, e) {
1023
+ t.id = e.input.id;
1024
+ },
1025
+ setModelExtensionOperation(t, e) {
1026
+ t.extension = e.input.extension;
1027
+ },
1028
+ setModelDescriptionOperation(t, e) {
1029
+ t.description = e.input.description;
1030
+ },
1031
+ setAuthorNameOperation(t, e) {
1032
+ t.author = t.author || { name: "", website: null }, t.author.name = e.input.authorName;
1033
+ },
1034
+ setAuthorWebsiteOperation(t, e) {
1035
+ t.author = t.author || { name: "", website: null }, t.author.website = e.input.authorWebsite;
1036
+ }
1037
+ }, E = {
1038
+ addChangeLogItemOperation(t, e) {
1039
+ throw new Error('Reducer "addChangeLogItemOperation" not yet implemented');
1040
+ },
1041
+ updateChangeLogItemOperation(t, e) {
1042
+ throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented');
1043
+ },
1044
+ deleteChangeLogItemOperation(t, e) {
1045
+ throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented');
1046
+ },
1047
+ reorderChangeLogItemsOperation(t, e) {
1048
+ throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented');
1049
+ },
1050
+ releaseNewVersionOperation(t, e) {
1051
+ throw new Error('Reducer "releaseNewVersionOperation" not yet implemented');
1052
+ }
1053
+ }, Nt = (t) => {
1054
+ const e = {};
1055
+ return t.forEach((r, n) => e[r] = n), (r, n) => (e[n.id] || 999999) - (e[r.id] || 999999);
1056
+ }, h = {
1057
+ addModuleOperation(t, e) {
1058
+ t.specifications[t.specifications.length - 1].modules.push({
1059
+ id: e.input.id,
1060
+ name: e.input.name,
1061
+ description: e.input.description || "",
1062
+ operations: []
1063
+ });
1064
+ },
1065
+ setModuleNameOperation(t, e) {
1066
+ const r = t.specifications[t.specifications.length - 1];
1067
+ for (let n = 0; n < r.modules.length; n++)
1068
+ r.modules[n].id === e.input.id && (r.modules[n].name = e.input.name || "");
1069
+ },
1070
+ setModuleDescriptionOperation(t, e) {
1071
+ const r = t.specifications[t.specifications.length - 1];
1072
+ for (let n = 0; n < r.modules.length; n++)
1073
+ r.modules[n].id === e.input.id && (r.modules[n].description = e.input.description || "");
1074
+ },
1075
+ deleteModuleOperation(t, e) {
1076
+ const r = t.specifications[t.specifications.length - 1];
1077
+ r.modules = r.modules.filter(
1078
+ (n) => n.id != e.input.id
1079
+ );
1080
+ },
1081
+ reorderModulesOperation(t, e) {
1082
+ t.specifications[t.specifications.length - 1].modules.sort(Nt(e.input.order));
1083
+ }
1084
+ }, Lt = (t) => {
1085
+ const e = {};
1086
+ return t.forEach((r, n) => e[r] = n), (r, n) => (e[n.id] || 999999) - (e[r.id] || 999999);
1087
+ }, c = {
1088
+ addOperationErrorOperation(t, e) {
1089
+ const r = t.specifications[t.specifications.length - 1];
1090
+ for (let n = 0; n < r.modules.length; n++)
1091
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1092
+ r.modules[n].operations[i].id == e.input.operationId && r.modules[n].operations[i].errors.push({
1093
+ id: e.input.id,
1094
+ name: e.input.errorName || "",
1095
+ code: e.input.errorCode || "",
1096
+ description: e.input.errorDescription || "",
1097
+ template: e.input.errorTemplate || ""
1098
+ });
1099
+ },
1100
+ setOperationErrorCodeOperation(t, e) {
1101
+ const r = t.specifications[t.specifications.length - 1];
1102
+ for (let n = 0; n < r.modules.length; n++)
1103
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1104
+ for (let a = 0; a < r.modules[n].operations[i].errors.length; a++)
1105
+ r.modules[n].operations[i].errors[a].id == e.input.id && (r.modules[n].operations[i].errors[a].code = e.input.errorCode || "");
1106
+ },
1107
+ setOperationErrorNameOperation(t, e) {
1108
+ const r = t.specifications[t.specifications.length - 1];
1109
+ for (let n = 0; n < r.modules.length; n++)
1110
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1111
+ for (let a = 0; a < r.modules[n].operations[i].errors.length; a++)
1112
+ r.modules[n].operations[i].errors[a].id == e.input.id && (r.modules[n].operations[i].errors[a].name = e.input.errorName || "");
1113
+ },
1114
+ setOperationErrorDescriptionOperation(t, e) {
1115
+ const r = t.specifications[t.specifications.length - 1];
1116
+ for (let n = 0; n < r.modules.length; n++)
1117
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1118
+ for (let a = 0; a < r.modules[n].operations[i].errors.length; a++)
1119
+ r.modules[n].operations[i].errors[a].id == e.input.id && (r.modules[n].operations[i].errors[a].description = e.input.errorDescription || "");
1120
+ },
1121
+ setOperationErrorTemplateOperation(t, e) {
1122
+ const r = t.specifications[t.specifications.length - 1];
1123
+ for (let n = 0; n < r.modules.length; n++)
1124
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1125
+ for (let a = 0; a < r.modules[n].operations[i].errors.length; a++)
1126
+ r.modules[n].operations[i].errors[a].id == e.input.id && (r.modules[n].operations[i].errors[a].template = e.input.errorTemplate || "");
1127
+ },
1128
+ deleteOperationErrorOperation(t, e) {
1129
+ const r = t.specifications[t.specifications.length - 1];
1130
+ for (let n = 0; n < r.modules.length; n++)
1131
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1132
+ r.modules[n].operations[i].errors = r.modules[n].operations[i].errors.filter((a) => a.id != e.input.id);
1133
+ },
1134
+ reorderOperationErrorsOperation(t, e) {
1135
+ const r = t.specifications[t.specifications.length - 1];
1136
+ for (let n = 0; n < r.modules.length; n++)
1137
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1138
+ r.modules[n].operations[i].id == e.input.operationId && r.modules[n].operations[i].errors.sort(
1139
+ Lt(e.input.order)
1140
+ );
1141
+ }
1142
+ }, Pt = (t) => {
1143
+ const e = {};
1144
+ return t.forEach((r, n) => e[r] = n), (r, n) => (e[n.id] || 999999) - (e[r.id] || 999999);
1145
+ }, S = {
1146
+ addOperationExampleOperation(t, e) {
1147
+ const r = t.specifications[t.specifications.length - 1];
1148
+ for (let n = 0; n < r.modules.length; n++)
1149
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1150
+ r.modules[n].operations[i].id == e.input.operationId && r.modules[n].operations[i].examples.push({
1151
+ id: e.input.id,
1152
+ value: e.input.example
1153
+ });
1154
+ },
1155
+ updateOperationExampleOperation(t, e) {
1156
+ const r = t.specifications[t.specifications.length - 1];
1157
+ for (let n = 0; n < r.modules.length; n++)
1158
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1159
+ for (let a = 0; a < r.modules[n].operations[i].examples.length; a++)
1160
+ r.modules[n].operations[i].examples[a].id == e.input.id && (r.modules[n].operations[i].examples[a].value = e.input.example);
1161
+ },
1162
+ deleteOperationExampleOperation(t, e) {
1163
+ const r = t.specifications[t.specifications.length - 1];
1164
+ for (let n = 0; n < r.modules.length; n++)
1165
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1166
+ r.modules[n].operations[i].examples = r.modules[n].operations[i].examples.filter(
1167
+ (a) => a.id != e.input.id
1168
+ );
1169
+ },
1170
+ reorderOperationExamplesOperation(t, e) {
1171
+ const r = t.specifications[t.specifications.length - 1];
1172
+ for (let n = 0; n < r.modules.length; n++)
1173
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1174
+ r.modules[n].operations[i].id == e.input.operationId && r.modules[n].operations[i].examples.sort(
1175
+ Pt(e.input.order)
1176
+ );
1177
+ }
1178
+ }, jt = (t) => {
1179
+ const e = {};
1180
+ return t.forEach((r, n) => e[r] = n), (r, n) => (e[n.id] || 999999) - (e[r.id] || 999999);
1181
+ }, p = {
1182
+ addOperationOperation(t, e) {
1183
+ const r = t.specifications[t.specifications.length - 1];
1184
+ for (let n = 0; n < r.modules.length; n++)
1185
+ r.modules[n].id == e.input.moduleId && r.modules[n].operations.push({
1186
+ id: e.input.id,
1187
+ name: e.input.name,
1188
+ description: e.input.description || "",
1189
+ schema: e.input.schema || "",
1190
+ template: e.input.template || e.input.description || "",
1191
+ reducer: e.input.reducer || "",
1192
+ errors: [],
1193
+ examples: [],
1194
+ scope: e.input.scope || "global"
1195
+ });
1196
+ },
1197
+ setOperationNameOperation(t, e) {
1198
+ const r = t.specifications[t.specifications.length - 1];
1199
+ for (let n = 0; n < r.modules.length; n++)
1200
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1201
+ r.modules[n].operations[i].id == e.input.id && (r.modules[n].operations[i].name = e.input.name || "");
1202
+ },
1203
+ setOperationScopeOperation(t, e) {
1204
+ const r = t.specifications[t.specifications.length - 1];
1205
+ for (let n = 0; n < r.modules.length; n++)
1206
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1207
+ r.modules[n].operations[i].id == e.input.id && (r.modules[n].operations[i].scope = e.input.scope || "global");
1208
+ },
1209
+ setOperationSchemaOperation(t, e) {
1210
+ const r = t.specifications[t.specifications.length - 1];
1211
+ for (let n = 0; n < r.modules.length; n++)
1212
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1213
+ r.modules[n].operations[i].id == e.input.id && (r.modules[n].operations[i].schema = e.input.schema || "");
1214
+ },
1215
+ setOperationDescriptionOperation(t, e) {
1216
+ const r = t.specifications[t.specifications.length - 1];
1217
+ for (let n = 0; n < r.modules.length; n++)
1218
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1219
+ r.modules[n].operations[i].id == e.input.id && (r.modules[n].operations[i].description = e.input.description || "");
1220
+ },
1221
+ setOperationTemplateOperation(t, e) {
1222
+ const r = t.specifications[t.specifications.length - 1];
1223
+ for (let n = 0; n < r.modules.length; n++)
1224
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1225
+ r.modules[n].operations[i].id == e.input.id && (r.modules[n].operations[i].template = e.input.template || "");
1226
+ },
1227
+ setOperationReducerOperation(t, e) {
1228
+ const r = t.specifications[t.specifications.length - 1];
1229
+ for (let n = 0; n < r.modules.length; n++)
1230
+ for (let i = 0; i < r.modules[n].operations.length; i++)
1231
+ r.modules[n].operations[i].id == e.input.id && (r.modules[n].operations[i].reducer = e.input.reducer || "");
1232
+ },
1233
+ moveOperationOperation(t, e) {
1234
+ const r = [], n = t.specifications[t.specifications.length - 1];
1235
+ for (let i = 0; i < n.modules.length; i++)
1236
+ n.modules[i].operations = n.modules[i].operations.filter((a) => a.id == e.input.operationId ? (r.push(a), !1) : !0);
1237
+ for (let i = 0; i < n.modules.length; i++)
1238
+ n.modules[i].id == e.input.newModuleId && n.modules[i].operations.push(...r);
1239
+ },
1240
+ deleteOperationOperation(t, e) {
1241
+ const r = t.specifications[t.specifications.length - 1];
1242
+ for (let n = 0; n < r.modules.length; n++)
1243
+ r.modules[n].operations = r.modules[n].operations.filter((i) => i.id != e.input.id);
1244
+ },
1245
+ reorderModuleOperationsOperation(t, e) {
1246
+ const r = t.specifications[t.specifications.length - 1];
1247
+ for (let n = 0; n < r.modules.length; n++)
1248
+ r.modules[n].id == e.input.moduleId && r.modules[n].operations.sort(
1249
+ jt(e.input.order)
1250
+ );
1251
+ }
1252
+ }, Ct = (t) => {
1253
+ const e = {};
1254
+ return t.forEach((r, n) => e[r] = n), (r, n) => (e[n.id] || 999999) - (e[r.id] || 999999);
1255
+ }, u = {
1256
+ setStateSchemaOperation(t, e) {
1257
+ const r = t.specifications[t.specifications.length - 1];
1258
+ if (Object.keys(r.state).includes(e.input.scope))
1259
+ r.state[e.input.scope].schema = e.input.schema;
1260
+ else
1261
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1262
+ },
1263
+ setInitialStateOperation(t, e) {
1264
+ const r = t.specifications[t.specifications.length - 1];
1265
+ if (Object.keys(r.state).includes(e.input.scope))
1266
+ r.state[e.input.scope].initialValue = e.input.initialValue;
1267
+ else
1268
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1269
+ },
1270
+ addStateExampleOperation(t, e) {
1271
+ const r = t.specifications[t.specifications.length - 1];
1272
+ if (Object.keys(r.state).includes(e.input.scope))
1273
+ r.state[e.input.scope].examples.push({
1274
+ id: e.input.id,
1275
+ value: e.input.example
1276
+ });
1277
+ else
1278
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1279
+ },
1280
+ updateStateExampleOperation(t, e) {
1281
+ const r = t.specifications[t.specifications.length - 1];
1282
+ if (!Object.keys(r.state).includes(e.input.scope))
1283
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1284
+ const n = r.state[e.input.scope].examples;
1285
+ for (let i = 0; i < n.length; i++)
1286
+ n[i].id == e.input.id && (n[i].value = e.input.newExample);
1287
+ },
1288
+ deleteStateExampleOperation(t, e) {
1289
+ const r = t.specifications[t.specifications.length - 1];
1290
+ if (Object.keys(r.state).includes(e.input.scope))
1291
+ r.state[e.input.scope].examples = r.state[e.input.scope].examples.filter((n) => n.id != e.input.id);
1292
+ else
1293
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1294
+ },
1295
+ reorderStateExamplesOperation(t, e) {
1296
+ const r = t.specifications[t.specifications.length - 1];
1297
+ if (Object.keys(r.state).includes(e.input.scope))
1298
+ r.state[e.input.scope].examples.sort(Ct(e.input.order));
1299
+ else
1300
+ throw new Error(`Invalid scope: ${e.input.scope}`);
1301
+ }
1302
+ }, kt = (t, e) => {
1303
+ if (ht(e))
1304
+ return t;
1305
+ switch (e.type) {
1306
+ case "SET_MODEL_NAME":
1307
+ B().parse(e.input), d.setModelNameOperation(t.global, e);
1308
+ break;
1309
+ case "SET_MODEL_ID":
1310
+ z().parse(e.input), d.setModelIdOperation(t.global, e);
1311
+ break;
1312
+ case "SET_MODEL_EXTENSION":
1313
+ W().parse(e.input), d.setModelExtensionOperation(t.global, e);
1314
+ break;
1315
+ case "SET_MODEL_DESCRIPTION":
1316
+ $().parse(e.input), d.setModelDescriptionOperation(t.global, e);
1317
+ break;
1318
+ case "SET_AUTHOR_NAME":
1319
+ H().parse(e.input), d.setAuthorNameOperation(t.global, e);
1320
+ break;
1321
+ case "SET_AUTHOR_WEBSITE":
1322
+ X().parse(e.input), d.setAuthorWebsiteOperation(t.global, e);
1323
+ break;
1324
+ case "ADD_CHANGE_LOG_ITEM":
1325
+ _().parse(e.input), E.addChangeLogItemOperation(t.global, e);
1326
+ break;
1327
+ case "UPDATE_CHANGE_LOG_ITEM":
1328
+ se().parse(e.input), E.updateChangeLogItemOperation(
1329
+ t.global,
1330
+ e
1331
+ );
1332
+ break;
1333
+ case "DELETE_CHANGE_LOG_ITEM":
1334
+ M().parse(e.input), E.deleteChangeLogItemOperation(
1335
+ t.global,
1336
+ e
1337
+ );
1338
+ break;
1339
+ case "REORDER_CHANGE_LOG_ITEMS":
1340
+ y().parse(e.input), E.reorderChangeLogItemsOperation(
1341
+ t.global,
1342
+ e
1343
+ );
1344
+ break;
1345
+ case "RELEASE_NEW_VERSION":
1346
+ if (Object.keys(e.input).length > 0)
1347
+ throw new Error(
1348
+ "Expected empty input for action RELEASE_NEW_VERSION"
1349
+ );
1350
+ E.releaseNewVersionOperation(t.global, e);
1351
+ break;
1352
+ case "ADD_MODULE":
1353
+ I().parse(e.input), h.addModuleOperation(t.global, e);
1354
+ break;
1355
+ case "SET_MODULE_NAME":
1356
+ J().parse(e.input), h.setModuleNameOperation(t.global, e);
1357
+ break;
1358
+ case "SET_MODULE_DESCRIPTION":
1359
+ q().parse(e.input), h.setModuleDescriptionOperation(t.global, e);
1360
+ break;
1361
+ case "DELETE_MODULE":
1362
+ N().parse(e.input), h.deleteModuleOperation(t.global, e);
1363
+ break;
1364
+ case "REORDER_MODULES":
1365
+ v().parse(e.input), h.reorderModulesOperation(t.global, e);
1366
+ break;
1367
+ case "ADD_OPERATION_ERROR":
1368
+ T().parse(e.input), c.addOperationErrorOperation(
1369
+ t.global,
1370
+ e
1371
+ );
1372
+ break;
1373
+ case "SET_OPERATION_ERROR_CODE":
1374
+ Q().parse(e.input), c.setOperationErrorCodeOperation(
1375
+ t.global,
1376
+ e
1377
+ );
1378
+ break;
1379
+ case "SET_OPERATION_ERROR_NAME":
1380
+ Z().parse(e.input), c.setOperationErrorNameOperation(
1381
+ t.global,
1382
+ e
1383
+ );
1384
+ break;
1385
+ case "SET_OPERATION_ERROR_DESCRIPTION":
1386
+ Y().parse(e.input), c.setOperationErrorDescriptionOperation(
1387
+ t.global,
1388
+ e
1389
+ );
1390
+ break;
1391
+ case "SET_OPERATION_ERROR_TEMPLATE":
1392
+ ee().parse(e.input), c.setOperationErrorTemplateOperation(
1393
+ t.global,
1394
+ e
1395
+ );
1396
+ break;
1397
+ case "DELETE_OPERATION_ERROR":
1398
+ L().parse(e.input), c.deleteOperationErrorOperation(
1399
+ t.global,
1400
+ e
1401
+ );
1402
+ break;
1403
+ case "REORDER_OPERATION_ERRORS":
1404
+ U().parse(e.input), c.reorderOperationErrorsOperation(
1405
+ t.global,
1406
+ e
1407
+ );
1408
+ break;
1409
+ case "ADD_OPERATION_EXAMPLE":
1410
+ R().parse(e.input), S.addOperationExampleOperation(
1411
+ t.global,
1412
+ e
1413
+ );
1414
+ break;
1415
+ case "UPDATE_OPERATION_EXAMPLE":
1416
+ ae().parse(e.input), S.updateOperationExampleOperation(
1417
+ t.global,
1418
+ e
1419
+ );
1420
+ break;
1421
+ case "DELETE_OPERATION_EXAMPLE":
1422
+ P().parse(e.input), S.deleteOperationExampleOperation(
1423
+ t.global,
1424
+ e
1425
+ );
1426
+ break;
1427
+ case "REORDER_OPERATION_EXAMPLES":
1428
+ V().parse(e.input), S.reorderOperationExamplesOperation(
1429
+ t.global,
1430
+ e
1431
+ );
1432
+ break;
1433
+ case "ADD_OPERATION":
1434
+ A().parse(e.input), p.addOperationOperation(t.global, e);
1435
+ break;
1436
+ case "SET_OPERATION_NAME":
1437
+ te().parse(e.input), p.setOperationNameOperation(t.global, e);
1438
+ break;
1439
+ case "SET_OPERATION_SCOPE":
1440
+ Se().parse(e.input), p.setOperationScopeOperation(t.global, e);
1441
+ break;
1442
+ case "SET_OPERATION_SCHEMA":
1443
+ oe().parse(e.input), p.setOperationSchemaOperation(t.global, e);
1444
+ break;
1445
+ case "SET_OPERATION_DESCRIPTION":
1446
+ K().parse(e.input), p.setOperationDescriptionOperation(
1447
+ t.global,
1448
+ e
1449
+ );
1450
+ break;
1451
+ case "SET_OPERATION_TEMPLATE":
1452
+ ne().parse(e.input), p.setOperationTemplateOperation(
1453
+ t.global,
1454
+ e
1455
+ );
1456
+ break;
1457
+ case "SET_OPERATION_REDUCER":
1458
+ re().parse(e.input), p.setOperationReducerOperation(t.global, e);
1459
+ break;
1460
+ case "MOVE_OPERATION":
1461
+ k().parse(e.input), p.moveOperationOperation(t.global, e);
1462
+ break;
1463
+ case "DELETE_OPERATION":
1464
+ j().parse(e.input), p.deleteOperationOperation(t.global, e);
1465
+ break;
1466
+ case "REORDER_MODULE_OPERATIONS":
1467
+ w().parse(e.input), p.reorderModuleOperationsOperation(
1468
+ t.global,
1469
+ e
1470
+ );
1471
+ break;
1472
+ case "SET_STATE_SCHEMA":
1473
+ ie().parse(e.input), u.setStateSchemaOperation(t.global, e);
1474
+ break;
1475
+ case "SET_INITIAL_STATE":
1476
+ G().parse(e.input), u.setInitialStateOperation(t.global, e);
1477
+ break;
1478
+ case "ADD_STATE_EXAMPLE":
1479
+ x().parse(e.input), u.addStateExampleOperation(t.global, e);
1480
+ break;
1481
+ case "UPDATE_STATE_EXAMPLE":
1482
+ pe().parse(e.input), u.updateStateExampleOperation(t.global, e);
1483
+ break;
1484
+ case "DELETE_STATE_EXAMPLE":
1485
+ C().parse(e.input), u.deleteStateExampleOperation(t.global, e);
1486
+ break;
1487
+ case "REORDER_STATE_EXAMPLES":
1488
+ F().parse(e.input), u.reorderStateExamplesOperation(t.global, e);
1489
+ break;
1490
+ default:
1491
+ return t;
1492
+ }
1493
+ }, g = Et(kt), yt = {
1494
+ id: "",
1495
+ name: "",
1496
+ extension: "",
1497
+ description: "",
1498
+ author: {
1499
+ name: "",
1500
+ website: ""
1501
+ },
1502
+ specifications: [
1503
+ {
1504
+ version: 1,
1505
+ changeLog: [],
1506
+ state: {
1507
+ global: {
1508
+ schema: "",
1509
+ initialValue: "",
1510
+ examples: []
1511
+ },
1512
+ local: {
1513
+ schema: "",
1514
+ initialValue: "",
1515
+ examples: []
1516
+ }
1517
+ },
1518
+ modules: []
1519
+ }
1520
+ ]
1521
+ }, wt = {}, O = {
1522
+ fileExtension: "phdm",
1523
+ createState(t) {
1524
+ return {
1525
+ global: { ...yt, ...t == null ? void 0 : t.global },
1526
+ local: { ...wt, ...t == null ? void 0 : t.local }
1527
+ };
1528
+ },
1529
+ createExtendedState(t) {
1530
+ return Ot(
1531
+ { ...t, documentType: "powerhouse/document-model" },
1532
+ O.createState
1533
+ );
1534
+ },
1535
+ createDocument(t) {
1536
+ return gt(
1537
+ O.createExtendedState(t),
1538
+ O.createState
1539
+ );
1540
+ },
1541
+ saveToFile(t, e, r) {
1542
+ return St(t, e, "phdm", r);
1543
+ },
1544
+ saveToFileHandle(t, e) {
1545
+ return bt(t, e);
1546
+ },
1547
+ loadFromFile(t) {
1548
+ return ft(t, g);
1549
+ },
1550
+ loadFromInput(t) {
1551
+ return _t(t, g);
1552
+ }
1553
+ }, fe = (t) => s(
1554
+ "SET_MODEL_NAME",
1555
+ { ...t }
1556
+ ), _e = (t) => s(
1557
+ "SET_MODEL_ID",
1558
+ { ...t }
1559
+ ), Ie = (t) => s(
1560
+ "SET_MODEL_EXTENSION",
1561
+ { ...t }
1562
+ ), Te = (t) => s(
1563
+ "SET_MODEL_DESCRIPTION",
1564
+ { ...t }
1565
+ ), Re = (t) => s(
1566
+ "SET_AUTHOR_NAME",
1567
+ { ...t }
1568
+ ), Ae = (t) => s(
1569
+ "SET_AUTHOR_WEBSITE",
1570
+ { ...t }
1571
+ );
1572
+ class vt extends l {
1573
+ setModelName(e, r) {
1574
+ return this.dispatch(fe(e), r);
1575
+ }
1576
+ setModelId(e, r) {
1577
+ return this.dispatch(_e(e), r);
1578
+ }
1579
+ setModelExtension(e, r) {
1580
+ return this.dispatch(Ie(e), r);
1581
+ }
1582
+ setModelDescription(e, r) {
1583
+ return this.dispatch(Te(e), r);
1584
+ }
1585
+ setAuthorName(e, r) {
1586
+ return this.dispatch(Re(e), r);
1587
+ }
1588
+ setAuthorWebsite(e, r) {
1589
+ return this.dispatch(Ae(e), r);
1590
+ }
1591
+ }
1592
+ const xe = (t) => s(
1593
+ "ADD_CHANGE_LOG_ITEM",
1594
+ { ...t }
1595
+ ), De = (t) => s(
1596
+ "UPDATE_CHANGE_LOG_ITEM",
1597
+ { ...t }
1598
+ ), Me = (t) => s(
1599
+ "DELETE_CHANGE_LOG_ITEM",
1600
+ { ...t }
1601
+ ), Ne = (t) => s(
1602
+ "REORDER_CHANGE_LOG_ITEMS",
1603
+ { ...t }
1604
+ ), Le = () => s(
1605
+ "RELEASE_NEW_VERSION"
1606
+ );
1607
+ class Ut extends l {
1608
+ addChangeLogItem(e, r) {
1609
+ return this.dispatch(xe(e), r);
1610
+ }
1611
+ updateChangeLogItem(e, r) {
1612
+ return this.dispatch(De(e), r);
1613
+ }
1614
+ deleteChangeLogItem(e, r) {
1615
+ return this.dispatch(Me(e), r);
1616
+ }
1617
+ reorderChangeLogItems(e, r) {
1618
+ return this.dispatch(Ne(e), r);
1619
+ }
1620
+ releaseNewVersion(e) {
1621
+ return this.dispatch(Le(), e);
1622
+ }
1623
+ }
1624
+ const Pe = (t) => s(
1625
+ "ADD_MODULE",
1626
+ { ...t }
1627
+ ), je = (t) => s(
1628
+ "SET_MODULE_NAME",
1629
+ { ...t }
1630
+ ), Ce = (t) => s(
1631
+ "SET_MODULE_DESCRIPTION",
1632
+ { ...t }
1633
+ ), ke = (t) => s(
1634
+ "DELETE_MODULE",
1635
+ { ...t }
1636
+ ), ye = (t) => s(
1637
+ "REORDER_MODULES",
1638
+ { ...t }
1639
+ );
1640
+ class Vt extends l {
1641
+ addModule(e, r) {
1642
+ return this.dispatch(Pe(e), r);
1643
+ }
1644
+ setModuleName(e, r) {
1645
+ return this.dispatch(je(e), r);
1646
+ }
1647
+ setModuleDescription(e, r) {
1648
+ return this.dispatch(Ce(e), r);
1649
+ }
1650
+ deleteModule(e, r) {
1651
+ return this.dispatch(ke(e), r);
1652
+ }
1653
+ reorderModules(e, r) {
1654
+ return this.dispatch(ye(e), r);
1655
+ }
1656
+ }
1657
+ const we = (t) => s(
1658
+ "ADD_OPERATION_ERROR",
1659
+ { ...t }
1660
+ ), ve = (t) => s(
1661
+ "SET_OPERATION_ERROR_CODE",
1662
+ { ...t }
1663
+ ), Ue = (t) => s(
1664
+ "SET_OPERATION_ERROR_NAME",
1665
+ { ...t }
1666
+ ), Ve = (t) => s(
1667
+ "SET_OPERATION_ERROR_DESCRIPTION",
1668
+ { ...t }
1669
+ ), Fe = (t) => s(
1670
+ "SET_OPERATION_ERROR_TEMPLATE",
1671
+ { ...t }
1672
+ ), He = (t) => s(
1673
+ "DELETE_OPERATION_ERROR",
1674
+ { ...t }
1675
+ ), Xe = (t) => s(
1676
+ "REORDER_OPERATION_ERRORS",
1677
+ { ...t }
1678
+ );
1679
+ class Ft extends l {
1680
+ addOperationError(e, r) {
1681
+ return this.dispatch(we(e), r);
1682
+ }
1683
+ setOperationErrorCode(e, r) {
1684
+ return this.dispatch(ve(e), r);
1685
+ }
1686
+ setOperationErrorName(e, r) {
1687
+ return this.dispatch(Ue(e), r);
1688
+ }
1689
+ setOperationErrorDescription(e, r) {
1690
+ return this.dispatch(Ve(e), r);
1691
+ }
1692
+ setOperationErrorTemplate(e, r) {
1693
+ return this.dispatch(Fe(e), r);
1694
+ }
1695
+ deleteOperationError(e, r) {
1696
+ return this.dispatch(He(e), r);
1697
+ }
1698
+ reorderOperationErrors(e, r) {
1699
+ return this.dispatch(Xe(e), r);
1700
+ }
1701
+ }
1702
+ const Ge = (t) => s(
1703
+ "ADD_OPERATION_EXAMPLE",
1704
+ { ...t }
1705
+ ), $e = (t) => s(
1706
+ "UPDATE_OPERATION_EXAMPLE",
1707
+ { ...t }
1708
+ ), We = (t) => s(
1709
+ "DELETE_OPERATION_EXAMPLE",
1710
+ { ...t }
1711
+ ), ze = (t) => s(
1712
+ "REORDER_OPERATION_EXAMPLES",
1713
+ { ...t }
1714
+ );
1715
+ class Ht extends l {
1716
+ addOperationExample(e, r) {
1717
+ return this.dispatch(Ge(e), r);
1718
+ }
1719
+ updateOperationExample(e, r) {
1720
+ return this.dispatch($e(e), r);
1721
+ }
1722
+ deleteOperationExample(e, r) {
1723
+ return this.dispatch(We(e), r);
1724
+ }
1725
+ reorderOperationExamples(e, r) {
1726
+ return this.dispatch(ze(e), r);
1727
+ }
1728
+ }
1729
+ const Be = (t) => s(
1730
+ "ADD_OPERATION",
1731
+ { ...t }
1732
+ ), qe = (t) => s(
1733
+ "SET_OPERATION_NAME",
1734
+ { ...t }
1735
+ ), Je = (t) => s(
1736
+ "SET_OPERATION_SCOPE",
1737
+ { ...t }
1738
+ ), Ke = (t) => s(
1739
+ "SET_OPERATION_SCHEMA",
1740
+ { ...t }
1741
+ ), Qe = (t) => s(
1742
+ "SET_OPERATION_DESCRIPTION",
1743
+ { ...t }
1744
+ ), Ye = (t) => s(
1745
+ "SET_OPERATION_TEMPLATE",
1746
+ { ...t }
1747
+ ), Ze = (t) => s(
1748
+ "SET_OPERATION_REDUCER",
1749
+ { ...t }
1750
+ ), et = (t) => s(
1751
+ "MOVE_OPERATION",
1752
+ { ...t }
1753
+ ), tt = (t) => s(
1754
+ "DELETE_OPERATION",
1755
+ { ...t }
1756
+ ), rt = (t) => s(
1757
+ "REORDER_MODULE_OPERATIONS",
1758
+ { ...t }
1759
+ );
1760
+ class Xt extends l {
1761
+ addOperation(e, r) {
1762
+ return this.dispatch(Be(e), r);
1763
+ }
1764
+ setOperationName(e, r) {
1765
+ return this.dispatch(qe(e), r);
1766
+ }
1767
+ setOperationScope(e, r) {
1768
+ return this.dispatch(Je(e), r);
1769
+ }
1770
+ setOperationSchema(e, r) {
1771
+ return this.dispatch(Ke(e), r);
1772
+ }
1773
+ setOperationDescription(e, r) {
1774
+ return this.dispatch(Qe(e), r);
1775
+ }
1776
+ setOperationTemplate(e, r) {
1777
+ return this.dispatch(Ye(e), r);
1778
+ }
1779
+ setOperationReducer(e, r) {
1780
+ return this.dispatch(Ze(e), r);
1781
+ }
1782
+ moveOperation(e, r) {
1783
+ return this.dispatch(et(e), r);
1784
+ }
1785
+ deleteOperation(e, r) {
1786
+ return this.dispatch(tt(e), r);
1787
+ }
1788
+ reorderModuleOperations(e, r) {
1789
+ return this.dispatch(rt(e), r);
1790
+ }
1791
+ }
1792
+ const ot = (t) => s(
1793
+ "SET_STATE_SCHEMA",
1794
+ { ...t }
1795
+ ), nt = (t) => s(
1796
+ "SET_INITIAL_STATE",
1797
+ { ...t }
1798
+ ), it = (t) => s(
1799
+ "ADD_STATE_EXAMPLE",
1800
+ { ...t }
1801
+ ), st = (t) => s(
1802
+ "UPDATE_STATE_EXAMPLE",
1803
+ { ...t }
1804
+ ), at = (t) => s(
1805
+ "DELETE_STATE_EXAMPLE",
1806
+ { ...t }
1807
+ ), pt = (t) => s(
1808
+ "REORDER_STATE_EXAMPLES",
1809
+ { ...t }
1810
+ );
1811
+ class Gt extends l {
1812
+ setStateSchema(e, r) {
1813
+ return this.dispatch(ot(e), r);
1814
+ }
1815
+ setInitialState(e, r) {
1816
+ return this.dispatch(nt(e), r);
1817
+ }
1818
+ addStateExample(e, r) {
1819
+ return this.dispatch(it(e), r);
1820
+ }
1821
+ updateStateExample(e, r) {
1822
+ return this.dispatch(st(e), r);
1823
+ }
1824
+ deleteStateExample(e, r) {
1825
+ return this.dispatch(at(e), r);
1826
+ }
1827
+ reorderStateExamples(e, r) {
1828
+ return this.dispatch(pt(e), r);
1829
+ }
1830
+ }
1831
+ var m;
1832
+ let le = (m = class extends l {
1833
+ constructor(e, r) {
1834
+ super(g, O.createDocument(e), r);
1835
+ }
1836
+ saveToFile(e, r) {
1837
+ return super.saveToFile(e, m.fileExtension, r);
1838
+ }
1839
+ loadFromFile(e) {
1840
+ return super.loadFromFile(e);
1841
+ }
1842
+ static async fromFile(e) {
1843
+ const r = new this();
1844
+ return await r.loadFromFile(e), r;
1845
+ }
1846
+ }, ce(m, "fileExtension", "phdm"), m);
1847
+ It(le, [
1848
+ vt,
1849
+ Ut,
1850
+ Vt,
1851
+ Ft,
1852
+ Ht,
1853
+ Xt,
1854
+ Gt
1855
+ ]);
1856
+ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1857
+ __proto__: null,
1858
+ addChangeLogItem: xe,
1859
+ addModule: Pe,
1860
+ addOperation: Be,
1861
+ addOperationError: we,
1862
+ addOperationExample: Ge,
1863
+ addStateExample: it,
1864
+ deleteChangeLogItem: Me,
1865
+ deleteModule: ke,
1866
+ deleteOperation: tt,
1867
+ deleteOperationError: He,
1868
+ deleteOperationExample: We,
1869
+ deleteStateExample: at,
1870
+ moveOperation: et,
1871
+ releaseNewVersion: Le,
1872
+ reorderChangeLogItems: Ne,
1873
+ reorderModuleOperations: rt,
1874
+ reorderModules: ye,
1875
+ reorderOperationErrors: Xe,
1876
+ reorderOperationExamples: ze,
1877
+ reorderStateExamples: pt,
1878
+ setAuthorName: Re,
1879
+ setAuthorWebsite: Ae,
1880
+ setInitialState: nt,
1881
+ setModelDescription: Te,
1882
+ setModelExtension: Ie,
1883
+ setModelId: _e,
1884
+ setModelName: fe,
1885
+ setModuleDescription: Ce,
1886
+ setModuleName: je,
1887
+ setOperationDescription: Qe,
1888
+ setOperationErrorCode: ve,
1889
+ setOperationErrorDescription: Ve,
1890
+ setOperationErrorName: Ue,
1891
+ setOperationErrorTemplate: Fe,
1892
+ setOperationName: qe,
1893
+ setOperationReducer: Ze,
1894
+ setOperationSchema: Ke,
1895
+ setOperationScope: Je,
1896
+ setOperationTemplate: Ye,
1897
+ setStateSchema: ot,
1898
+ updateChangeLogItem: De,
1899
+ updateOperationExample: $e,
1900
+ updateStateExample: st
1901
+ }, Symbol.toStringTag, { value: "Module" })), lt = le, ct = { ...O, ...Rt }, dt = { ...Tt, ...$t }, Wt = {
1902
+ Document: lt,
1903
+ reducer: g,
1904
+ actions: dt,
1905
+ utils: ct,
1906
+ documentModel: de
1907
+ }, Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1908
+ __proto__: null,
1909
+ Document: lt,
1910
+ DocumentModel: le,
1911
+ actions: dt,
1912
+ documentModel: de,
1913
+ module: Wt,
1914
+ reducer: g,
1915
+ utils: ct,
1916
+ z: Mt
1917
+ }, Symbol.toStringTag, { value: "Module" }));
1918
+ export {
1919
+ Yt as D,
1920
+ le as a,
1921
+ lt as b,
1922
+ dt as c,
1923
+ de as d,
1924
+ Wt as m,
1925
+ g as r,
1926
+ ct as u,
1927
+ Mt as z
1928
+ };