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