pict-section-form 1.0.155 → 1.0.157

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-form",
3
- "version": "1.0.155",
3
+ "version": "1.0.157",
4
4
  "description": "Pict dynamic form sections",
5
5
  "main": "source/Pict-Section-Form.js",
6
6
  "directories": {
@@ -290,6 +290,8 @@ class PictFormMetacontroller extends libPictViewClass
290
290
  */
291
291
  createDistinctManifest(pManifest, pUUID)
292
292
  {
293
+ const tmpDescriptorHashes = Object.keys(pManifest?.Descriptors || {});
294
+ const tmpDescriptorHashSet = new Set(tmpDescriptorHashes);
293
295
  const tmpUUID = pUUID != null ? pUUID : this.pict.getUUID().replace(/-/g, '');
294
296
  const tmpManifest = JSON.parse(JSON.stringify(pManifest));
295
297
  for (const tmpSection of tmpManifest.Sections || [])
@@ -305,8 +307,37 @@ class PictFormMetacontroller extends libPictViewClass
305
307
  const tmpNewDescriptors = {};
306
308
  for (const [ tmpKey, tmpDescriptor ] of Object.entries(tmpManifest.Descriptors || {}))
307
309
  {
308
- //FIXME: do we want to allow prefixing the data address? (ex. nesting it under a parent object) - caller can still do this themselves.
309
- tmpDescriptor.DataAddress = `${tmpDescriptor.DataAddress || tmpKey}_${tmpUUID}`;
310
+ if (!tmpDescriptor.DataAddress)
311
+ {
312
+ tmpDescriptor.DataAddress = tmpKey;
313
+ }
314
+ tmpDescriptor.OriginalDataAddress = tmpDescriptor.DataAddress;
315
+ // we only make distinct top level properties to keep things as tidy as possible so do a split to isoloate that
316
+ //TODO: if we have .. dereferences (for example) in the data address, this will not work properly
317
+
318
+ let tmpArrayIndex = tmpDescriptor.DataAddress.indexOf('[');
319
+ let tmpDotIndex = tmpDescriptor.DataAddress.indexOf('.');
320
+ if (tmpDotIndex >= 0 && (tmpDotIndex < tmpArrayIndex || tmpArrayIndex < 0))
321
+ {
322
+ const tmpPrefixPart = tmpDescriptor.DataAddress.substring(0, tmpDotIndex);
323
+ const tmpPostfixPart = tmpDescriptor.DataAddress.substring(tmpDotIndex);
324
+ tmpDescriptor.DataAddress = `${tmpPrefixPart}_${tmpUUID}${tmpPostfixPart}`;
325
+ }
326
+ else if (tmpArrayIndex >= 0 && (tmpArrayIndex < tmpDotIndex || tmpDotIndex < 0))
327
+ {
328
+ const tmpArrayPart = tmpDescriptor.DataAddress.substring(0, tmpArrayIndex);
329
+ const tmpPostfixPart = tmpDescriptor.DataAddress.substring(tmpArrayIndex);
330
+ tmpDescriptor.DataAddress = `${tmpArrayPart}_${tmpUUID}${tmpPostfixPart}`;
331
+ }
332
+ else
333
+ {
334
+ //FIXME: do we want to allow prefixing the data address? (ex. nesting it under a parent object) - caller can still do this themselves.
335
+ tmpDescriptor.DataAddress = `${tmpDescriptor.OriginalDataAddress}_${tmpUUID}`;
336
+ }
337
+ if (tmpDescriptor.Address != null)
338
+ {
339
+ tmpDescriptor.Address = tmpDescriptor.DataAddress;
340
+ }
310
341
  if (tmpDescriptor.Hash)
311
342
  {
312
343
  tmpDescriptor.OriginalHash = tmpDescriptor.Hash;
@@ -323,9 +354,166 @@ class PictFormMetacontroller extends libPictViewClass
323
354
  tmpDescriptor.PictForm.Group = `${tmpDescriptor.PictForm.Group}_${tmpUUID}`;
324
355
  }
325
356
  }
326
- tmpNewDescriptors[`${tmpKey}_${tmpUUID}`] = tmpDescriptor;
357
+ tmpNewDescriptors[tmpDescriptor.DataAddress] = tmpDescriptor;
327
358
  }
328
359
  tmpManifest.Descriptors = tmpNewDescriptors;
360
+ const tmpAddressTranslation = {};
361
+ const tmpHashTranslation = {};
362
+ for (const tmpDescriptor of Object.values(tmpManifest?.Descriptors || {}))
363
+ {
364
+ if (tmpDescriptor.OriginalDataAddress)
365
+ {
366
+ tmpAddressTranslation[tmpDescriptor.OriginalDataAddress] = tmpDescriptor.DataAddress;
367
+ }
368
+ if (tmpDescriptor.OriginalHash)
369
+ {
370
+ tmpHashTranslation[tmpDescriptor.OriginalHash] = tmpDescriptor.Hash;
371
+ }
372
+ }
373
+ for (const [ tmpOriginalAddress, tmpUpdatedAddress ] of Object.entries(tmpAddressTranslation))
374
+ {
375
+ for (const tmpIterAddress of Object.keys(tmpAddressTranslation))
376
+ {
377
+ if (tmpIterAddress === tmpOriginalAddress)
378
+ {
379
+ continue;
380
+ }
381
+ const tmpTranslatedAddress = tmpAddressTranslation[tmpIterAddress].replace(new RegExp(`^${tmpOriginalAddress}\\b`, 'g'), tmpUpdatedAddress);
382
+ if (tmpTranslatedAddress !== tmpAddressTranslation[tmpIterAddress])
383
+ {
384
+ //this.pict.log.info(`DocumentDynamicSectionManager._addTestSections: Updated address translation for "${tmpIterAddress}" from "${tmpAddressTranslation[tmpIterAddress]}" to "${tmpTranslatedAddress}".`);
385
+ tmpAddressTranslation[tmpIterAddress] = tmpTranslatedAddress;
386
+ const [ tmpCurrentKey, tmpOriginalDescriptor ] = Object.entries(tmpManifest.Descriptors).find(([ pKey, pDescriptor ]) => pDescriptor.OriginalDataAddress === tmpIterAddress);
387
+ tmpManifest.Descriptors[tmpCurrentKey].DataAddress = tmpTranslatedAddress;
388
+ if (tmpManifest.Descriptors[tmpCurrentKey].Address != null)
389
+ {
390
+ tmpManifest.Descriptors[tmpCurrentKey].Address = tmpManifest.Descriptors[tmpCurrentKey].DataAddress;
391
+ }
392
+ tmpManifest.Descriptors[tmpTranslatedAddress] = tmpManifest.Descriptors[tmpCurrentKey];
393
+ delete tmpManifest.Descriptors[tmpCurrentKey];
394
+ }
395
+ }
396
+ }
397
+ //TODO: should we merge these two together for solvers?
398
+ const tmpAddressMappings = Object.entries(tmpAddressTranslation).map(([ pOldAddress, pNewAddress ]) => ({ From: pOldAddress, To: pNewAddress }));
399
+ tmpAddressMappings.sort((a, b) => b.From.length - a.From.length);
400
+ const tmpHashMappings = Object.entries(tmpHashTranslation).map(([ pOldHash, pNewHash ]) => ({ From: pOldHash, To: pNewHash }));
401
+ tmpHashMappings.sort((a, b) => b.From.length - a.From.length);
402
+ const escapeRegExp = (string) =>
403
+ {
404
+ return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
405
+ }
406
+ for (const tmpSection of tmpManifest.Sections || [])
407
+ {
408
+ if (Array.isArray(tmpSection.Solvers) && tmpSection.Solvers.length > 0)
409
+ {
410
+ for (let i = 0; i < tmpSection.Solvers.length; i++)
411
+ {
412
+ const tmpSolver = tmpSection.Solvers[i];
413
+ const tmpSolverExpression = typeof tmpSolver === 'string' ? tmpSolver : tmpSolver.Expression;
414
+ if (!tmpSolverExpression)
415
+ {
416
+ continue;
417
+ }
418
+ let tmpUpdatedSolver = tmpSolverExpression;
419
+ //FIXME: what if there is a collision in a suffix-part and we replace too much?
420
+ for (const tmpMapping of tmpAddressMappings)
421
+ {
422
+ tmpUpdatedSolver = tmpUpdatedSolver.replace(new RegExp(`\\b${escapeRegExp(tmpMapping.From)}\\b`, 'g'), tmpMapping.To);
423
+ }
424
+ for (const tmpMapping of tmpHashMappings)
425
+ {
426
+ tmpUpdatedSolver = tmpUpdatedSolver.replace(new RegExp(`\\b${escapeRegExp(tmpMapping.From)}\\b`, 'g'), tmpMapping.To);
427
+ }
428
+ if (tmpUpdatedSolver !== tmpSolver)
429
+ {
430
+ //this.pict.log.info(`DocumentDynamicSectionManager._addTestSections: Updated section solver reference ${i} from "${tmpSolverExpression}" to "${tmpUpdatedSolver}".`);
431
+ if (typeof tmpSolver === 'string')
432
+ {
433
+ tmpSection.Solvers[i] = tmpUpdatedSolver;
434
+ }
435
+ else
436
+ {
437
+ tmpSection.Solvers[i].Expression = tmpUpdatedSolver;
438
+ }
439
+ }
440
+ }
441
+ }
442
+ for (const tmpGroup of tmpSection.Groups || [])
443
+ {
444
+ if (tmpGroup.RecordSetAddress)
445
+ {
446
+ let tmpRecordSetAddress = tmpGroup.RecordSetAddress;
447
+ for (const tmpMapping of tmpAddressMappings)
448
+ {
449
+ tmpRecordSetAddress = tmpRecordSetAddress.replace(new RegExp(`^${escapeRegExp(tmpMapping.From)}\\b`, 'g'), tmpMapping.To);
450
+ }
451
+ if (tmpRecordSetAddress !== tmpGroup.RecordSetAddress)
452
+ {
453
+ //this.pict.log.info(`DocumentDynamicSectionManager._addTestSections: Updated group record set address from "${tmpGroup.RecordSetAddress}" to "${tmpRecordSetAddress}".`);
454
+ }
455
+ else
456
+ {
457
+ let tmpArrayIndex = tmpRecordSetAddress.indexOf('[');
458
+ let tmpDotIndex = tmpRecordSetAddress.indexOf('.');
459
+ if (tmpDotIndex >= 0 && (tmpDotIndex < tmpArrayIndex || tmpArrayIndex < 0))
460
+ {
461
+ const tmpPrefixPart = tmpRecordSetAddress.substring(0, tmpDotIndex);
462
+ const tmpPostfixPart = tmpRecordSetAddress.substring(tmpDotIndex);
463
+ tmpRecordSetAddress = `${tmpPrefixPart}_${tmpUUID}${tmpPostfixPart}`;
464
+ }
465
+ else if (tmpArrayIndex >= 0 && (tmpArrayIndex < tmpDotIndex || tmpDotIndex < 0))
466
+ {
467
+ const tmpArrayPart = tmpRecordSetAddress.substring(0, tmpArrayIndex);
468
+ const tmpPostfixPart = tmpRecordSetAddress.substring(tmpArrayIndex);
469
+ tmpRecordSetAddress = `${tmpArrayPart}_${tmpUUID}${tmpPostfixPart}`;
470
+ }
471
+ else
472
+ {
473
+ //FIXME: do we want to allow prefixing the data address? (ex. nesting it under a parent object) - caller can still do this themselves.
474
+ tmpRecordSetAddress = `${tmpGroup.RecordSetAddress}_${tmpUUID}`;
475
+ }
476
+ //TODO: does this need to go into the mappings?
477
+ tmpGroup.RecordSetAddress = tmpRecordSetAddress;
478
+ }
479
+
480
+ }
481
+ if (Array.isArray(tmpGroup.RecordSetSolvers) && tmpGroup.RecordSetSolvers.length > 0)
482
+ {
483
+ for (let i = 0; i < tmpGroup.RecordSetSolvers.length; i++)
484
+ {
485
+ const tmpSolver = tmpGroup.RecordSetSolvers[i];
486
+ const tmpSolverExpression = typeof tmpSolver === 'string' ? tmpSolver : tmpSolver.Expression;
487
+ if (!tmpSolverExpression)
488
+ {
489
+ continue;
490
+ }
491
+ let tmpUpdatedSolver = tmpSolverExpression;
492
+ //FIXME: what if there is a collision in a suffix-part and we replace too much?
493
+ for (const tmpMapping of tmpAddressMappings)
494
+ {
495
+ tmpUpdatedSolver = tmpUpdatedSolver.replace(new RegExp(`\\b${escapeRegExp(tmpMapping.From)}\\b`, 'g'), tmpMapping.To);
496
+ }
497
+ for (const tmpMapping of tmpHashMappings)
498
+ {
499
+ tmpUpdatedSolver = tmpUpdatedSolver.replace(new RegExp(`\\b${escapeRegExp(tmpMapping.From)}\\b`, 'g'), tmpMapping.To);
500
+ }
501
+ if (tmpUpdatedSolver !== tmpSolver)
502
+ {
503
+ //this.pict.log.info(`DocumentDynamicSectionManager._addTestSections: Updated group solver reference ${i} from "${tmpSolver}" to "${tmpUpdatedSolver}".`);
504
+ if (typeof tmpSolver === 'string')
505
+ {
506
+ tmpGroup.RecordSetSolvers[i] = tmpUpdatedSolver;
507
+ }
508
+ else
509
+ {
510
+ tmpGroup.RecordSetSolvers[i].Expression = tmpUpdatedSolver;
511
+ }
512
+ }
513
+ }
514
+ }
515
+ }
516
+ }
329
517
  return tmpManifest;
330
518
  }
331
519
 
@@ -64,7 +64,7 @@ class OrderedSolverApplication extends DoNothingApplication
64
64
  {
65
65
  super.onAfterSolve();
66
66
  this.pict.log.info('OrderedSolverApplication onAfterSolve called.');
67
- this?._testDone?.();
67
+ this._testDone?.();
68
68
  }
69
69
 
70
70
  onAfterInitialize()
@@ -188,6 +188,509 @@ suite
188
188
  });
189
189
  }
190
190
  );
191
+ test(
192
+ 'Distinct Array Test',
193
+ (fDone) =>
194
+ {
195
+ //NOTE: code is a clone of Pict.safeLoadPictApplication
196
+ let _Pict;
197
+ const tmpApplicationClass = OrderedSolverApplication;
198
+ if (tmpApplicationClass && ('default_configuration' in tmpApplicationClass) && ('pict_configuration' in tmpApplicationClass.default_configuration))
199
+ {
200
+ _Pict = new libPict(tmpApplicationClass.default_configuration.pict_configuration);
201
+ }
202
+ else
203
+ {
204
+ _Pict = new libPict();
205
+ }
206
+
207
+ //_Pict.LogNoisiness = 0;
208
+
209
+ let tmpApplicationHash = 'DefaultApplication';
210
+ let tmpDefaultConfiguration = {};
211
+
212
+ if ('default_configuration' in tmpApplicationClass)
213
+ {
214
+ tmpDefaultConfiguration = tmpApplicationClass.default_configuration;
215
+
216
+ if ('Hash' in tmpApplicationClass.default_configuration)
217
+ {
218
+ tmpDefaultConfiguration = tmpApplicationClass.default_configuration;
219
+ tmpApplicationHash = tmpApplicationClass.default_configuration.Hash;
220
+ }
221
+ }
222
+ _Pict.log.info(`Loading the pict application [${tmpApplicationHash}] and associated views.`);
223
+
224
+ _Pict.addApplication(tmpApplicationHash, tmpDefaultConfiguration, tmpApplicationClass);
225
+
226
+ // Add the pict form service
227
+ _Pict.addServiceType('PictSectionForm', libPictSectionForm);
228
+
229
+ // Add the pict form metacontroller service, which provides programmaatic view construction from manifests and render/marshal methods.
230
+ _Pict.addView('PictFormMetacontroller', {}, libPictSectionForm.PictFormMetacontroller);
231
+
232
+ const tmpManifest =
233
+ {
234
+ Scope: 'OrderedSolverApplicationForm',
235
+ Descriptors:
236
+ {
237
+ DataTableAddress:
238
+ {
239
+ Hash: 'DataTable',
240
+ Name: 'Data Table',
241
+ DataAddress: 'DataTableAddress',
242
+ DataType: 'Array',
243
+ FormGroup: 'DataTableGroup',
244
+ FormSection: 'DataTableSection',
245
+ },
246
+ 'DataTableAddress[].ValueAddress':
247
+ {
248
+ Hash: 'ValueArray',
249
+ Name: 'Data Value',
250
+ DataAddress: 'DataTableAddress[].ValueAddress',
251
+ DataType: 'Array',
252
+ FormGroup: 'DataTableGroup',
253
+ FormSection: 'DataTableSection',
254
+ },
255
+ AggregateValueAddress:
256
+ {
257
+ Hash: 'AggregateValue',
258
+ Name: 'Aggregate Value',
259
+ DataAddress: 'AggregateValueAddress',
260
+ DataType: 'PreciseNumber',
261
+ FormGroup: 'DataTableGroup',
262
+ FormSection: 'DataTableSection',
263
+ },
264
+ AggregateValueAddress2:
265
+ {
266
+ Hash: 'AggregateValue2',
267
+ Name: 'Aggregate Value 2',
268
+ DataAddress: 'AggregateValueAddress2',
269
+ DataType: 'PreciseNumber',
270
+ FormGroup: 'DataTableGroup',
271
+ FormSection: 'DataTableSection',
272
+ },
273
+ },
274
+ Sections:
275
+ [
276
+ {
277
+ Name: 'Ordered Solver Section',
278
+ Hash: 'OrderedSolverSection',
279
+ Solvers:
280
+ [
281
+ { Ordinal: 5, Expression: 'AggregateValue = SUM(ValueArray)' },
282
+ { Ordinal: 40, Expression: 'AggregateValue2 = SUM(DataTableAddress[].ValueAddress)' },
283
+ ],
284
+ },
285
+ ],
286
+ };
287
+
288
+ let tmpHashedAggregateValue = null;
289
+ let tmpHashedAggregateValue2 = null;
290
+ _Pict.PictApplication.initializeAsync(
291
+ function (pError)
292
+ {
293
+ if (pError)
294
+ {
295
+ _Pict.log.info('Error initializing the pict application: '+pError)
296
+ }
297
+
298
+ try
299
+ {
300
+ _Pict.log.info('Loading the Application and associated views.');
301
+ const tmpDistinctManifest = _Pict.views.PictFormMetacontroller.createDistinctManifest(tmpManifest);
302
+ _Pict.log.info('Distinct Manifest:', tmpDistinctManifest);
303
+ tmpHashedAggregateValue = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pValue]) => pValue.OriginalHash == 'AggregateValue')[0];
304
+ tmpHashedAggregateValue2 = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pValue]) => pValue.OriginalHash == 'AggregateValue2')[0];
305
+ const tmpInjectedSecionViews = _Pict.views.PictFormMetacontroller.injectManifest(tmpDistinctManifest);
306
+ _Pict.log.info('Injected Section Views:', tmpInjectedSecionViews.length);
307
+ _Pict.views.PictFormMetacontroller.updateMetatemplateInDOM();
308
+ setTimeout(() =>
309
+ {
310
+ for (const tmpView of tmpInjectedSecionViews)
311
+ {
312
+ tmpView.render();
313
+ }
314
+ for (const tmpView of tmpInjectedSecionViews)
315
+ {
316
+ tmpView.marshalToView();
317
+ }
318
+ //TODO: do we need to trigger a solve here?
319
+ }, 0);
320
+ _Pict.PictApplication.testDone = () =>
321
+ {
322
+ try
323
+ {
324
+ _Pict.log.info(`AppData after`, { AppData: _Pict.AppData, tmpHashedAggregateValue, tmpHashedAggregateValue2 });
325
+ Expect(_Pict.AppData[tmpHashedAggregateValue]).to.equal('15', 'AggregateValue should equal 15 (SUM of ValueArray via hash)');
326
+ Expect(_Pict.AppData[tmpHashedAggregateValue2]).to.equal('15', 'AggregateValue should equal 15 (SUM of ValueArray via address)');
327
+ }
328
+ catch (pError)
329
+ {
330
+ return fDone(pError);
331
+ }
332
+ fDone();
333
+ };
334
+ const [ tmpValueArrayKey, tmpValueArrayDescriptor ] = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pDescriptor]) => pDescriptor.OriginalHash == 'ValueArray');
335
+ const tmpAddress = tmpValueArrayDescriptor.DataAddress;
336
+ _Pict.log.info('Setting up Distinct Array Test with address:', { tmpValueArrayKey, tmpValueArrayDescriptor, tmpAddress });
337
+ const tmpArrayAddress = tmpAddress.substring(0, tmpAddress.indexOf('[]'));
338
+ const tmpPropertyAddress = tmpAddress.substring(tmpAddress.indexOf('[]') + 3);
339
+ _Pict.manifest.setValueByHash(_Pict.AppData, tmpArrayAddress,
340
+ [
341
+ { [tmpPropertyAddress]: '1' },
342
+ { [tmpPropertyAddress]: '2' },
343
+ { [tmpPropertyAddress]: '3' },
344
+ { [tmpPropertyAddress]: '4' },
345
+ { [tmpPropertyAddress]: '5' },
346
+ ]);
347
+ _Pict.PictApplication.solve();
348
+ }
349
+ catch (pError)
350
+ {
351
+ _Pict.log.error('Error during Distinct Array Test:', pError);
352
+ return fDone(pError);
353
+ }
354
+ });
355
+ }
356
+ );
357
+ test(
358
+ 'Distinct Array Test 2',
359
+ (fDone) =>
360
+ {
361
+ //NOTE: code is a clone of Pict.safeLoadPictApplication
362
+ let _Pict;
363
+ const tmpApplicationClass = OrderedSolverApplication;
364
+ if (tmpApplicationClass && ('default_configuration' in tmpApplicationClass) && ('pict_configuration' in tmpApplicationClass.default_configuration))
365
+ {
366
+ _Pict = new libPict(tmpApplicationClass.default_configuration.pict_configuration);
367
+ }
368
+ else
369
+ {
370
+ _Pict = new libPict();
371
+ }
372
+
373
+ //_Pict.LogNoisiness = 0;
374
+
375
+ let tmpApplicationHash = 'DefaultApplication';
376
+ let tmpDefaultConfiguration = {};
377
+
378
+ if ('default_configuration' in tmpApplicationClass)
379
+ {
380
+ tmpDefaultConfiguration = tmpApplicationClass.default_configuration;
381
+
382
+ if ('Hash' in tmpApplicationClass.default_configuration)
383
+ {
384
+ tmpDefaultConfiguration = tmpApplicationClass.default_configuration;
385
+ tmpApplicationHash = tmpApplicationClass.default_configuration.Hash;
386
+ }
387
+ }
388
+ _Pict.log.info(`Loading the pict application [${tmpApplicationHash}] and associated views.`);
389
+
390
+ _Pict.addApplication(tmpApplicationHash, tmpDefaultConfiguration, tmpApplicationClass);
391
+
392
+ // Add the pict form service
393
+ _Pict.addServiceType('PictSectionForm', libPictSectionForm);
394
+
395
+ // Add the pict form metacontroller service, which provides programmaatic view construction from manifests and render/marshal methods.
396
+ _Pict.addView('PictFormMetacontroller', {}, libPictSectionForm.PictFormMetacontroller);
397
+
398
+ const tmpManifest =
399
+ {
400
+ Scope: 'OrderedSolverApplicationForm',
401
+ Descriptors:
402
+ {
403
+ 'DataTableAddress[].ValueAddress':
404
+ {
405
+ Hash: 'ValueArray',
406
+ Name: 'Data Value',
407
+ DataAddress: 'DataTableAddress[].ValueAddress',
408
+ DataType: 'Array',
409
+ FormGroup: 'DataTableGroup',
410
+ FormSection: 'DataTableSection',
411
+ },
412
+ AggregateValueAddress:
413
+ {
414
+ Hash: 'AggregateValue',
415
+ Name: 'Aggregate Value',
416
+ DataAddress: 'AggregateValueAddress',
417
+ DataType: 'PreciseNumber',
418
+ FormGroup: 'DataTableGroup',
419
+ FormSection: 'DataTableSection',
420
+ },
421
+ AggregateValueAddress2:
422
+ {
423
+ Hash: 'AggregateValue2',
424
+ Name: 'Aggregate Value 2',
425
+ DataAddress: 'AggregateValueAddress2',
426
+ DataType: 'PreciseNumber',
427
+ FormGroup: 'DataTableGroup',
428
+ FormSection: 'DataTableSection',
429
+ },
430
+ },
431
+ Sections:
432
+ [
433
+ {
434
+ Name: 'Ordered Solver Section',
435
+ Hash: 'OrderedSolverSection',
436
+ Solvers:
437
+ [
438
+ { Ordinal: 5, Expression: 'AggregateValue = SUM(ValueArray)' },
439
+ { Ordinal: 40, Expression: 'AggregateValue2 = SUM(DataTableAddress[].ValueAddress)' },
440
+ ],
441
+ },
442
+ ],
443
+ };
444
+
445
+ let tmpHashedAggregateValue = null;
446
+ let tmpHashedAggregateValue2 = null;
447
+ _Pict.PictApplication.initializeAsync(
448
+ function (pError)
449
+ {
450
+ if (pError)
451
+ {
452
+ _Pict.log.info('Error initializing the pict application: '+pError)
453
+ }
454
+
455
+ try
456
+ {
457
+ _Pict.log.info('Loading the Application and associated views.');
458
+ const tmpDistinctManifest = _Pict.views.PictFormMetacontroller.createDistinctManifest(tmpManifest);
459
+ _Pict.log.info('Distinct Manifest:', tmpDistinctManifest);
460
+ tmpHashedAggregateValue = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pValue]) => pValue.OriginalHash == 'AggregateValue')[0];
461
+ tmpHashedAggregateValue2 = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pValue]) => pValue.OriginalHash == 'AggregateValue2')[0];
462
+ const tmpInjectedSecionViews = _Pict.views.PictFormMetacontroller.injectManifest(tmpDistinctManifest);
463
+ _Pict.log.info('Injected Section Views:', tmpInjectedSecionViews.length);
464
+ _Pict.views.PictFormMetacontroller.updateMetatemplateInDOM();
465
+ setTimeout(() =>
466
+ {
467
+ for (const tmpView of tmpInjectedSecionViews)
468
+ {
469
+ tmpView.render();
470
+ }
471
+ for (const tmpView of tmpInjectedSecionViews)
472
+ {
473
+ tmpView.marshalToView();
474
+ }
475
+ //TODO: do we need to trigger a solve here?
476
+ }, 0);
477
+ _Pict.PictApplication.testDone = () =>
478
+ {
479
+ try
480
+ {
481
+ _Pict.log.info(`AppData after`, { AppData: _Pict.AppData, tmpHashedAggregateValue, tmpHashedAggregateValue2 });
482
+ Expect(_Pict.AppData[tmpHashedAggregateValue]).to.equal('15', 'AggregateValue should equal 15 (SUM of ValueArray via hash)');
483
+ Expect(_Pict.AppData[tmpHashedAggregateValue2]).to.equal('15', 'AggregateValue should equal 15 (SUM of ValueArray via address)');
484
+ }
485
+ catch (pError)
486
+ {
487
+ return fDone(pError);
488
+ }
489
+ fDone();
490
+ };
491
+ const [ tmpValueArrayKey, tmpValueArrayDescriptor ] = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pDescriptor]) => pDescriptor.OriginalHash == 'ValueArray');
492
+ const tmpAddress = tmpValueArrayDescriptor.DataAddress;
493
+ _Pict.log.info('Setting up Distinct Array Test with address:', { tmpValueArrayKey, tmpValueArrayDescriptor, tmpAddress });
494
+ const tmpArrayAddress = tmpAddress.substring(0, tmpAddress.indexOf('[]'));
495
+ const tmpPropertyAddress = tmpAddress.substring(tmpAddress.indexOf('[]') + 3);
496
+ _Pict.manifest.setValueByHash(_Pict.AppData, tmpArrayAddress,
497
+ [
498
+ { [tmpPropertyAddress]: '1' },
499
+ { [tmpPropertyAddress]: '2' },
500
+ { [tmpPropertyAddress]: '3' },
501
+ { [tmpPropertyAddress]: '4' },
502
+ { [tmpPropertyAddress]: '5' },
503
+ ]);
504
+ _Pict.PictApplication.solve();
505
+ }
506
+ catch (pError)
507
+ {
508
+ _Pict.log.error('Error during Distinct Array Test:', pError);
509
+ return fDone(pError);
510
+ }
511
+ });
512
+ }
513
+ );
514
+ test(
515
+ 'Distinct Array Test 3',
516
+ (fDone) =>
517
+ {
518
+ //NOTE: code is a clone of Pict.safeLoadPictApplication
519
+ let _Pict;
520
+ const tmpApplicationClass = OrderedSolverApplication;
521
+ if (tmpApplicationClass && ('default_configuration' in tmpApplicationClass) && ('pict_configuration' in tmpApplicationClass.default_configuration))
522
+ {
523
+ _Pict = new libPict(tmpApplicationClass.default_configuration.pict_configuration);
524
+ }
525
+ else
526
+ {
527
+ _Pict = new libPict();
528
+ }
529
+
530
+ //_Pict.LogNoisiness = 0;
531
+
532
+ let tmpApplicationHash = 'DefaultApplication';
533
+ let tmpDefaultConfiguration = {};
534
+
535
+ if ('default_configuration' in tmpApplicationClass)
536
+ {
537
+ tmpDefaultConfiguration = tmpApplicationClass.default_configuration;
538
+
539
+ if ('Hash' in tmpApplicationClass.default_configuration)
540
+ {
541
+ tmpDefaultConfiguration = tmpApplicationClass.default_configuration;
542
+ tmpApplicationHash = tmpApplicationClass.default_configuration.Hash;
543
+ }
544
+ }
545
+ _Pict.log.info(`Loading the pict application [${tmpApplicationHash}] and associated views.`);
546
+
547
+ _Pict.addApplication(tmpApplicationHash, tmpDefaultConfiguration, tmpApplicationClass);
548
+
549
+ // Add the pict form service
550
+ _Pict.addServiceType('PictSectionForm', libPictSectionForm);
551
+
552
+ // Add the pict form metacontroller service, which provides programmaatic view construction from manifests and render/marshal methods.
553
+ _Pict.addView('PictFormMetacontroller', {}, libPictSectionForm.PictFormMetacontroller);
554
+
555
+ const tmpManifest =
556
+ {
557
+ Scope: 'OrderedSolverApplicationForm',
558
+ Descriptors:
559
+ {
560
+ 'LevelOfIndirection.AggregateValueAddress':
561
+ {
562
+ Hash: 'IndirectAggregateValue',
563
+ Name: 'Indirect Aggregate Value',
564
+ DataAddress: 'LevelOfIndirection.AggregateValueAddress',
565
+ DataType: 'PreciseNumber',
566
+ FormGroup: 'DataTableGroup',
567
+ FormSection: 'DataTableSection',
568
+ },
569
+ 'LevelOfIndirection.DataTableAddress[].ValueAddress':
570
+ {
571
+ Hash: 'ValueArray',
572
+ Name: 'Data Value',
573
+ DataAddress: 'LevelOfIndirection.DataTableAddress[].ValueAddress',
574
+ DataType: 'Array',
575
+ FormGroup: 'DataTableGroup',
576
+ FormSection: 'DataTableSection',
577
+ },
578
+ AggregateValueAddress:
579
+ {
580
+ Hash: 'AggregateValue',
581
+ Name: 'Aggregate Value',
582
+ DataAddress: 'AggregateValueAddress',
583
+ DataType: 'PreciseNumber',
584
+ FormGroup: 'DataTableGroup',
585
+ FormSection: 'DataTableSection',
586
+ },
587
+ AggregateValueAddress2:
588
+ {
589
+ Hash: 'AggregateValue2',
590
+ Name: 'Aggregate Value 2',
591
+ DataAddress: 'AggregateValueAddress2',
592
+ DataType: 'PreciseNumber',
593
+ FormGroup: 'DataTableGroup',
594
+ FormSection: 'DataTableSection',
595
+ },
596
+ },
597
+ Sections:
598
+ [
599
+ {
600
+ Name: 'Ordered Solver Section',
601
+ Hash: 'OrderedSolverSection',
602
+ Groups:
603
+ [
604
+ {
605
+ Name: 'Group Name',
606
+ Hash: 'GroupHash',
607
+ RecordSetAddress: 'LevelOfIndirection.DataTableAddress',
608
+ },
609
+ ],
610
+ Solvers:
611
+ [
612
+ { Ordinal: 5, Expression: 'AggregateValue = SUM(ValueArray)' },
613
+ { Ordinal: 40, Expression: 'AggregateValue2 = SUM(LevelOfIndirection.DataTableAddress[].ValueAddress)' },
614
+ { Ordinal: 60, Expression: 'IndirectAggregateValue = AggregateValue' },
615
+ ],
616
+ },
617
+ ],
618
+ };
619
+
620
+ let tmpHashedAggregateValue = null;
621
+ let tmpHashedAggregateValue2 = null;
622
+ let tmpHashedAggregateValue3 = null;
623
+ _Pict.PictApplication.initializeAsync(
624
+ function (pError)
625
+ {
626
+ if (pError)
627
+ {
628
+ _Pict.log.info('Error initializing the pict application: '+pError)
629
+ }
630
+
631
+ try
632
+ {
633
+ _Pict.log.info('Loading the Application and associated views.');
634
+ const tmpUUID = _Pict.getUUID().substring(0, 8);
635
+ const tmpDistinctManifest = _Pict.views.PictFormMetacontroller.createDistinctManifest(tmpManifest, tmpUUID);
636
+ _Pict.log.info('Distinct Manifest:', tmpDistinctManifest);
637
+ Expect(tmpDistinctManifest.Sections[0].Groups[0].RecordSetAddress).to.equal(`LevelOfIndirection_${tmpUUID}.DataTableAddress`, 'Group RecordSetAddress should be preserved in distinct manifest.');
638
+ tmpHashedAggregateValue = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pValue]) => pValue.OriginalHash == 'AggregateValue')[0];
639
+ tmpHashedAggregateValue2 = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pValue]) => pValue.OriginalHash == 'AggregateValue2')[0];
640
+ tmpHashedAggregateValue3 = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pValue]) => pValue.OriginalHash == 'IndirectAggregateValue')[0];
641
+ const tmpInjectedSecionViews = _Pict.views.PictFormMetacontroller.injectManifest(tmpDistinctManifest);
642
+ _Pict.log.info('Injected Section Views:', tmpInjectedSecionViews.length);
643
+ _Pict.views.PictFormMetacontroller.updateMetatemplateInDOM();
644
+ setTimeout(() =>
645
+ {
646
+ for (const tmpView of tmpInjectedSecionViews)
647
+ {
648
+ tmpView.render();
649
+ }
650
+ for (const tmpView of tmpInjectedSecionViews)
651
+ {
652
+ tmpView.marshalToView();
653
+ }
654
+ //TODO: do we need to trigger a solve here?
655
+ }, 0);
656
+ _Pict.PictApplication.testDone = () =>
657
+ {
658
+ try
659
+ {
660
+ _Pict.log.info(`AppData after`, { AppData: _Pict.AppData, tmpHashedAggregateValue, tmpHashedAggregateValue2, tmpHashedAggregateValue3 });
661
+ Expect(_Pict.AppData[tmpHashedAggregateValue]).to.equal('15', 'AggregateValue should equal 15 (SUM of ValueArray via hash)');
662
+ Expect(_Pict.AppData[tmpHashedAggregateValue2]).to.equal('15', 'AggregateValue should equal 15 (SUM of ValueArray via address)');
663
+ Expect(_Pict.manifest.getValueByHash(_Pict.AppData, tmpHashedAggregateValue3)).to.equal('15', 'IndirectAggregateValue should equal 15 (via indirection) using manifest method');
664
+ }
665
+ catch (pError)
666
+ {
667
+ return fDone(pError);
668
+ }
669
+ fDone();
670
+ };
671
+ const [ tmpValueArrayKey, tmpValueArrayDescriptor ] = Object.entries(tmpDistinctManifest.Descriptors).find(([pKey, pDescriptor]) => pDescriptor.OriginalHash == 'ValueArray');
672
+ const tmpAddress = tmpValueArrayDescriptor.DataAddress;
673
+ _Pict.log.info('Setting up Distinct Array Test with address:', { tmpValueArrayKey, tmpValueArrayDescriptor, tmpAddress });
674
+ const tmpArrayAddress = tmpAddress.substring(0, tmpAddress.indexOf('[]'));
675
+ const tmpPropertyAddress = tmpAddress.substring(tmpAddress.indexOf('[]') + 3);
676
+ _Pict.manifest.setValueByHash(_Pict.AppData, tmpArrayAddress,
677
+ [
678
+ { [tmpPropertyAddress]: '1' },
679
+ { [tmpPropertyAddress]: '2' },
680
+ { [tmpPropertyAddress]: '3' },
681
+ { [tmpPropertyAddress]: '4' },
682
+ { [tmpPropertyAddress]: '5' },
683
+ ]);
684
+ _Pict.PictApplication.solve();
685
+ }
686
+ catch (pError)
687
+ {
688
+ _Pict.log.error('Error during Distinct Array Test:', pError);
689
+ return fDone(pError);
690
+ }
691
+ });
692
+ }
693
+ );
191
694
  test(
192
695
  'Solve Ordinals',
193
696
  (fDone) =>
@@ -242,7 +745,7 @@ suite
242
745
  {
243
746
  if (pError)
244
747
  {
245
- console.log('Error initializing the pict application: '+pError)
748
+ _Pict.log.info('Error initializing the pict application: '+pError)
246
749
  }
247
750
  _Pict.log.info('Loading the Application and associated views.');
248
751
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Pict-Provider-DynamicSolver.d.ts","sourceRoot":"","sources":["../../../source/providers/Pict-Provider-DynamicSolver.js"],"names":[],"mappings":";AA+BA;;GAEG;AACH;IAEC;;;;;;OAMG;IACH,oBAJW,MAAM,YACN,MAAM,gBACN,MAAM,EAqChB;IA9BA,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IACT,uHAAuH;IACvH,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,qCAAqC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC;QAAC,gBAAgB,EAAE,GAAG,CAAA;KAAE,CACzG;IA6BX,uCAoBC;IAED;;;;;;;;;OASG;IACH,qBALW,MAAM,GAAC,MAAM,cACb,OAAO,aACP,MAAM,GACJ,MAAM,GAAC,SAAS,CA8B5B;IAED;;;;;;;OAOG;IACH,wDAFW,MAAM,QAyDhB;IAED;;;;;OAKG;IACH,gEAFW,MAAM,QAgChB;IAED;;;;;OAKG;IACH,sDAFW,MAAM,QAwBhB;IAED;;;;;;;;OAQG;IACH,gCAJW,MAAM,yBAWhB;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,yBAFW,QAAM,MAAM,EAAE,QAiFxB;IADA;;;;;MAAuC;CAExC;;;;;AAvXD,kCAAkC;AAClC,6CADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAS3B"}
1
+ {"version":3,"file":"Pict-Provider-DynamicSolver.d.ts","sourceRoot":"","sources":["../../../source/providers/Pict-Provider-DynamicSolver.js"],"names":[],"mappings":";AA+BA;;GAEG;AACH;IAEC;;;;;;OAMG;IACH,oBAJW,MAAM,YACN,MAAM,gBACN,MAAM,EAqChB;IA9BA,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IACT,uHAAuH;IACvH,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,qCAAqC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC;QAAC,gBAAgB,EAAE,GAAG,CAAA;KAAE,CACzG;IA6BX,uCAoBC;IAED;;;;;;;;;OASG;IACH,qBALW,MAAM,GAAC,MAAM,cACb,OAAO,aACP,MAAM,GACJ,MAAM,GAAC,SAAS,CA8B5B;IAED;;;;;;;OAOG;IACH,wDAFW,MAAM,QAyDhB;IAED;;;;;OAKG;IACH,gEAFW,MAAM,QAgChB;IAED;;;;;OAKG;IACH,sDAFW,MAAM,QAwBhB;IAED;;;;;;;;OAQG;IACH,gCAJW,MAAM,yBAWhB;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,yBAFW,QAAM,MAAM,EAAE,QAwFxB;IADA;;;;;MAAuC;CAExC;;;;;AA9XD,kCAAkC;AAClC,6CADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAS3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AAaA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,2DAyBC;IAjBA,yBAA2B;IAE3B,wBAAsF;IAEtF,cAAkC;IAElC,gCAAkC;IAClC,8BAAiC;IAEjC;;;;;;MAOE;IAQH,wCAGC;IARD,kCAGC;IAOD;;;;OAIG;IACH,qBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mBAFa,GAAG,CAaf;IAED,yCAYC;IAED;;;;;OAKG;IACH,kCAHW,aAAa,GACX,IAAI,CAsBhB;IA8BD;;;;OAIG;IACH,WAFa,GAAG,CAMf;IAED,kCAGC;IAED,gDAGC;IAED,+CAGC;IAED;;;;OAIG;IACH,2DAJW,MAAM,GAEL,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAW9B;IAED;;;;;;OAMG;IACH,mCANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,MAAM,UACN,MAAM,GAEL,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAwBtD;IAED;;;;;OAKG;IACH,0BALW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,MAAM,GAEL,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAgCtD;IAED;;;;;;;;;OASG;IACH,kCALW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UACnB,MAAM,GAEL,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAyC9B;IAED;;;;OAIG;IACH,uCAJW,KAAK,CAAC,MAAM,CAAC,sBACb,MAAM,UACN,MAAM,QAuBhB;IAED;;;OAGG;IACH,6CAHW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,MAAM,SAehB;IAED;;;;;;;;OAQG;IACH,wDAHW,YAAY,SAoHtB;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAQhB;IAED;;;;;;;OAOG;IACH,+DAFW,YAAY,QAatB;IAED;;;;;;;OAOG;IACH,gEAFW,YAAY,QAatB;IAED;;;;;OAKG;IACH,8EAFW,YAAY,QAmBtB;IAED;;;;;;OAMG;IACH,oEAHW,YAAY,GACV,IAAI,CAkDhB;IAED;;;;;;;OAOG;IACH,uEAJW,YAAY,GAEX,IAAI,CAsFf;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED,+CAeC;IAED;;;;;;;OAOG;IACH,kFAJW,MAAM,GAEJ,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAoLtC;IA5JC,gCAA0D;IAC1D,yBAAiD;IA6JnD;;;;OAIG;IACH,gCAHW,MAAM,qBACN,MAAM,QA0BhB;IAED;;;OAGG;IACH,yDAHW,MAAM,uBACN,MAAM,QAKhB;IAED;;;;;OAKG;IACH,yDALW,MAAM,uBACN,MAAM,GAEL,OAAO,CAoDlB;IAED;;;;OAIG;IACH,sCAJW,MAAM,GAEL,OAAO,CA0ClB;IAED;;;OAGG;IACH,wDAHW,MAAM,6BAuBhB;IAED,oCAgBC;IAED;;;;OAIG;IACH,4BAFa,OAAO,CAKnB;CACD;;;;;qCAGU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;oBAvqCjB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM"}
1
+ {"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AAaA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,2DAyBC;IAjBA,yBAA2B;IAE3B,wBAAsF;IAEtF,cAAkC;IAElC,gCAAkC;IAClC,8BAAiC;IAEjC;;;;;;MAOE;IAQH,wCAGC;IARD,kCAGC;IAOD;;;;OAIG;IACH,qBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mBAFa,GAAG,CAaf;IAED,yCAYC;IAED;;;;;OAKG;IACH,kCAHW,aAAa,GACX,IAAI,CAsBhB;IA8BD;;;;OAIG;IACH,WAFa,GAAG,CAMf;IAED,kCAGC;IAED,gDAGC;IAED,+CAGC;IAED;;;;OAIG;IACH,2DAJW,MAAM,GAEL,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAW9B;IAED;;;;;;OAMG;IACH,mCANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,MAAM,UACN,MAAM,GAEL,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAwBtD;IAED;;;;;OAKG;IACH,0BALW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,MAAM,GAEL,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAgCtD;IAED;;;;;;;;;OASG;IACH,kCALW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UACnB,MAAM,GAEL,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA8L9B;IAED;;;;OAIG;IACH,uCAJW,KAAK,CAAC,MAAM,CAAC,sBACb,MAAM,UACN,MAAM,QAuBhB;IAED;;;OAGG;IACH,6CAHW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,MAAM,SAehB;IAED;;;;;;;;OAQG;IACH,wDAHW,YAAY,SAoHtB;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAQhB;IAED;;;;;;;OAOG;IACH,+DAFW,YAAY,QAatB;IAED;;;;;;;OAOG;IACH,gEAFW,YAAY,QAatB;IAED;;;;;OAKG;IACH,8EAFW,YAAY,QAmBtB;IAED;;;;;;OAMG;IACH,oEAHW,YAAY,GACV,IAAI,CAkDhB;IAED;;;;;;;OAOG;IACH,uEAJW,YAAY,GAEX,IAAI,CAsFf;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED,+CAeC;IAED;;;;;;;OAOG;IACH,kFAJW,MAAM,GAEJ,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAoLtC;IA5JC,gCAA0D;IAC1D,yBAAiD;IA6JnD;;;;OAIG;IACH,gCAHW,MAAM,qBACN,MAAM,QA0BhB;IAED;;;OAGG;IACH,yDAHW,MAAM,uBACN,MAAM,QAKhB;IAED;;;;;OAKG;IACH,yDALW,MAAM,uBACN,MAAM,GAEL,OAAO,CAoDlB;IAED;;;;OAIG;IACH,sCAJW,MAAM,GAEL,OAAO,CA0ClB;IAED;;;OAGG;IACH,wDAHW,MAAM,6BAuBhB;IAED,oCAgBC;IAED;;;;OAIG;IACH,4BAFa,OAAO,CAKnB;CACD;;;;;qCAGU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;oBA5zCjB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM"}