@g9tm/lynxcontrols-foundation 0.0.0-stage → 1.4.0

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 (164) hide show
  1. package/README.md +4 -2
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/collections.d.ts +16 -0
  4. package/dist/collections.d.ts.map +1 -0
  5. package/dist/collections.js +40 -0
  6. package/dist/collections.js.map +1 -0
  7. package/dist/culture/calendar.d.ts +122 -0
  8. package/dist/culture/calendar.d.ts.map +1 -0
  9. package/dist/culture/calendar.js +379 -0
  10. package/dist/culture/calendar.js.map +1 -0
  11. package/dist/culture/culture.d.ts +91 -0
  12. package/dist/culture/culture.d.ts.map +1 -0
  13. package/dist/culture/culture.js +173 -0
  14. package/dist/culture/culture.js.map +1 -0
  15. package/dist/culture/date-format.d.ts +19 -0
  16. package/dist/culture/date-format.d.ts.map +1 -0
  17. package/dist/culture/date-format.js +101 -0
  18. package/dist/culture/date-format.js.map +1 -0
  19. package/dist/culture/digits.d.ts +29 -0
  20. package/dist/culture/digits.d.ts.map +1 -0
  21. package/dist/culture/digits.js +43 -0
  22. package/dist/culture/digits.js.map +1 -0
  23. package/dist/culture/duration.d.ts +38 -0
  24. package/dist/culture/duration.d.ts.map +1 -0
  25. package/dist/culture/duration.js +41 -0
  26. package/dist/culture/duration.js.map +1 -0
  27. package/dist/culture/index.d.ts +9 -0
  28. package/dist/culture/index.d.ts.map +1 -0
  29. package/dist/culture/index.js +8 -0
  30. package/dist/culture/numbers.d.ts +38 -0
  31. package/dist/culture/numbers.d.ts.map +1 -0
  32. package/dist/culture/numbers.js +64 -0
  33. package/dist/culture/numbers.js.map +1 -0
  34. package/dist/culture/relative-time.d.ts +50 -0
  35. package/dist/culture/relative-time.d.ts.map +1 -0
  36. package/dist/culture/relative-time.js +63 -0
  37. package/dist/culture/relative-time.js.map +1 -0
  38. package/dist/culture/strings.d.ts +145 -0
  39. package/dist/culture/strings.d.ts.map +1 -0
  40. package/dist/culture/strings.js +345 -0
  41. package/dist/culture/strings.js.map +1 -0
  42. package/dist/enums/index.d.ts +195 -0
  43. package/dist/enums/index.d.ts.map +1 -0
  44. package/dist/enums/index.js +130 -0
  45. package/dist/enums/index.js.map +1 -0
  46. package/dist/errors.d.ts +10 -0
  47. package/dist/errors.d.ts.map +1 -0
  48. package/dist/errors.js +21 -0
  49. package/dist/errors.js.map +1 -0
  50. package/dist/exec/diagnostics.d.ts +74 -0
  51. package/dist/exec/diagnostics.d.ts.map +1 -0
  52. package/dist/exec/diagnostics.js +73 -0
  53. package/dist/exec/diagnostics.js.map +1 -0
  54. package/dist/exec/index.d.ts +5 -0
  55. package/dist/exec/index.d.ts.map +1 -0
  56. package/dist/exec/index.js +4 -0
  57. package/dist/exec/options.d.ts +75 -0
  58. package/dist/exec/options.d.ts.map +1 -0
  59. package/dist/exec/options.js +107 -0
  60. package/dist/exec/options.js.map +1 -0
  61. package/dist/exec/safe-executor.d.ts +138 -0
  62. package/dist/exec/safe-executor.d.ts.map +1 -0
  63. package/dist/exec/safe-executor.js +401 -0
  64. package/dist/exec/safe-executor.js.map +1 -0
  65. package/dist/exec/trace.d.ts +59 -0
  66. package/dist/exec/trace.d.ts.map +1 -0
  67. package/dist/exec/trace.js +108 -0
  68. package/dist/exec/trace.js.map +1 -0
  69. package/dist/icons/generated/glyph-svg.d.ts +37 -0
  70. package/dist/icons/generated/glyph-svg.d.ts.map +1 -0
  71. package/dist/icons/generated/glyph-svg.js +33 -0
  72. package/dist/icons/generated/glyph-svg.js.map +1 -0
  73. package/dist/icons/glyph-slots.d.ts +79 -0
  74. package/dist/icons/glyph-slots.d.ts.map +1 -0
  75. package/dist/icons/glyph-slots.js +50 -0
  76. package/dist/icons/glyph-slots.js.map +1 -0
  77. package/dist/icons/glyph.d.ts +76 -0
  78. package/dist/icons/glyph.d.ts.map +1 -0
  79. package/dist/icons/glyph.js +42 -0
  80. package/dist/icons/glyph.js.map +1 -0
  81. package/dist/icons/icon-fonts.d.ts +55 -0
  82. package/dist/icons/icon-fonts.d.ts.map +1 -0
  83. package/dist/icons/icon-fonts.js +74 -0
  84. package/dist/icons/icon-fonts.js.map +1 -0
  85. package/dist/icons/icon.d.ts +102 -0
  86. package/dist/icons/icon.d.ts.map +1 -0
  87. package/dist/icons/icon.js +132 -0
  88. package/dist/icons/icon.js.map +1 -0
  89. package/dist/icons/index.d.ts +7 -0
  90. package/dist/icons/index.d.ts.map +1 -0
  91. package/dist/icons/index.js +6 -0
  92. package/dist/icons/svg.d.ts +28 -0
  93. package/dist/icons/svg.d.ts.map +1 -0
  94. package/dist/icons/svg.js +59 -0
  95. package/dist/icons/svg.js.map +1 -0
  96. package/dist/index.d.ts +10 -0
  97. package/dist/index.d.ts.map +1 -0
  98. package/dist/index.js +9 -0
  99. package/dist/services/abort.d.ts +31 -0
  100. package/dist/services/abort.d.ts.map +1 -0
  101. package/dist/services/abort.js +47 -0
  102. package/dist/services/abort.js.map +1 -0
  103. package/dist/services/clock.d.ts +35 -0
  104. package/dist/services/clock.d.ts.map +1 -0
  105. package/dist/services/clock.js +37 -0
  106. package/dist/services/clock.js.map +1 -0
  107. package/dist/services/contracts.d.ts +200 -0
  108. package/dist/services/contracts.d.ts.map +1 -0
  109. package/dist/services/contracts.js +37 -0
  110. package/dist/services/contracts.js.map +1 -0
  111. package/dist/services/index.d.ts +5 -0
  112. package/dist/services/index.d.ts.map +1 -0
  113. package/dist/services/index.js +4 -0
  114. package/dist/services/preferences.d.ts +105 -0
  115. package/dist/services/preferences.d.ts.map +1 -0
  116. package/dist/services/preferences.js +253 -0
  117. package/dist/services/preferences.js.map +1 -0
  118. package/dist/theme/color.d.ts +94 -0
  119. package/dist/theme/color.d.ts.map +1 -0
  120. package/dist/theme/color.js +150 -0
  121. package/dist/theme/color.js.map +1 -0
  122. package/dist/theme/control-colors.d.ts +46 -0
  123. package/dist/theme/control-colors.d.ts.map +1 -0
  124. package/dist/theme/control-colors.js +46 -0
  125. package/dist/theme/control-colors.js.map +1 -0
  126. package/dist/theme/index.d.ts +5 -0
  127. package/dist/theme/index.d.ts.map +1 -0
  128. package/dist/theme/index.js +4 -0
  129. package/dist/theme/theme.d.ts +88 -0
  130. package/dist/theme/theme.d.ts.map +1 -0
  131. package/dist/theme/theme.js +190 -0
  132. package/dist/theme/theme.js.map +1 -0
  133. package/dist/theme/variants.d.ts +33 -0
  134. package/dist/theme/variants.d.ts.map +1 -0
  135. package/dist/theme/variants.js +53 -0
  136. package/dist/theme/variants.js.map +1 -0
  137. package/dist/tokens/css-vars.d.ts +35 -0
  138. package/dist/tokens/css-vars.d.ts.map +1 -0
  139. package/dist/tokens/css-vars.js +49 -0
  140. package/dist/tokens/css-vars.js.map +1 -0
  141. package/dist/tokens/generated/metrics.d.ts +184 -0
  142. package/dist/tokens/generated/metrics.d.ts.map +1 -0
  143. package/dist/tokens/generated/metrics.js +349 -0
  144. package/dist/tokens/generated/metrics.js.map +1 -0
  145. package/dist/tokens/generated/palettes.d.ts +113 -0
  146. package/dist/tokens/generated/palettes.d.ts.map +1 -0
  147. package/dist/tokens/generated/palettes.js +391 -0
  148. package/dist/tokens/generated/palettes.js.map +1 -0
  149. package/dist/tokens/index.d.ts +5 -0
  150. package/dist/tokens/index.d.ts.map +1 -0
  151. package/dist/tokens/index.js +4 -0
  152. package/dist/tokens/layout-metrics.d.ts +120 -0
  153. package/dist/tokens/layout-metrics.d.ts.map +1 -0
  154. package/dist/tokens/layout-metrics.js +111 -0
  155. package/dist/tokens/layout-metrics.js.map +1 -0
  156. package/docs/api.md +368 -0
  157. package/docs/foundation.md +369 -0
  158. package/docs/migration/Core.Controls.Shared.md +475 -0
  159. package/docs/migration/Core.Helpers.md +132 -0
  160. package/docs/migration/Core.Icons.md +135 -0
  161. package/docs/migration/Core.Localization.md +118 -0
  162. package/docs/migration/Core.Storage.md +54 -0
  163. package/docs/migration/Core.Theming.md +328 -0
  164. package/package.json +59 -4
@@ -0,0 +1,130 @@
1
+ const G9ButtonVariant = {
2
+ Primary: 'primary',
3
+ Tonal: 'tonal',
4
+ Default: 'default',
5
+ Secondary: 'secondary',
6
+ Info: 'info',
7
+ Success: 'success',
8
+ Warning: 'warning',
9
+ Error: 'error',
10
+ ErrorTonal: 'errorTonal',
11
+ Surface: 'surface',
12
+ Outline: 'outline',
13
+ Text: 'text'
14
+ };
15
+ const G9ProgressType = {
16
+ Primary: 'primary',
17
+ Success: 'success',
18
+ Warning: 'warning',
19
+ Error: 'error'
20
+ };
21
+ const G9ControlSize = {
22
+ Small: 'small',
23
+ Medium: 'medium',
24
+ Large: 'large',
25
+ Hero: 'hero'
26
+ };
27
+ const G9TextInputDirection = {
28
+ MatchParent: 'matchParent',
29
+ LeftToRight: 'leftToRight',
30
+ RightToLeft: 'rightToLeft'
31
+ };
32
+ const G9FilledValueHighlight = {
33
+ Inherit: 'inherit',
34
+ Accent: 'accent',
35
+ Neutral: 'neutral'
36
+ };
37
+ const G9KeyboardType = {
38
+ Default: 'default',
39
+ Email: 'email',
40
+ Phone: 'phone',
41
+ Number: 'number',
42
+ Url: 'url',
43
+ Password: 'password'
44
+ };
45
+ const G9DateTimePickerMode = {
46
+ Date: 'date',
47
+ Time: 'time',
48
+ DateTime: 'dateTime'
49
+ };
50
+ const G9DateTimeDisplayFormat = {
51
+ ShortDate: 'shortDate',
52
+ LongDate: 'longDate',
53
+ TimeOnly: 'timeOnly',
54
+ ShortDateTime: 'shortDateTime',
55
+ LongDateTime: 'longDateTime',
56
+ Custom: 'custom'
57
+ };
58
+ const G9RangeSliderMode = {
59
+ Single: 'single',
60
+ Range: 'range'
61
+ };
62
+ const G9PinEntryType = {
63
+ Number: 'number',
64
+ Letters: 'letters',
65
+ Alphanumeric: 'alphanumeric',
66
+ Password: 'password'
67
+ };
68
+ const G9ChipGroupSelectionMode = {
69
+ MultiSelection: 'multiSelection',
70
+ SingleSelection: 'singleSelection'
71
+ };
72
+ const G9ChipGroupLayoutMode = {
73
+ Wrap: 'wrap',
74
+ SingleLineScroll: 'singleLineScroll'
75
+ };
76
+ const G9ProgressLabelPlacement = {
77
+ None: 'none',
78
+ Above: 'above',
79
+ End: 'end'
80
+ };
81
+ const G9SeparatorTitleAlignment = {
82
+ Auto: 'auto',
83
+ Start: 'start',
84
+ Center: 'center',
85
+ End: 'end'
86
+ };
87
+ const G9TabMode = {
88
+ Fixed: 'fixed',
89
+ Scrollable: 'scrollable'
90
+ };
91
+ const G9TabStyle = {
92
+ Underlined: 'underlined',
93
+ Pill: 'pill'
94
+ };
95
+ const G9CascadeDirection = {
96
+ Auto: 'auto',
97
+ LeftToRight: 'leftToRight',
98
+ RightToLeft: 'rightToLeft',
99
+ TopToBottom: 'topToBottom',
100
+ BottomToTop: 'bottomToTop'
101
+ };
102
+ const G9CascadeTransition = {
103
+ Overlay: 'overlay',
104
+ Push: 'push'
105
+ };
106
+ const G9TabBarPosition = {
107
+ Top: 'top',
108
+ Bottom: 'bottom'
109
+ };
110
+ const G9InputType = {
111
+ Default: 'default',
112
+ Number: 'number',
113
+ Decimal: 'decimal',
114
+ SignedNumber: 'signedNumber',
115
+ SignedDecimal: 'signedDecimal',
116
+ Phone: 'phone',
117
+ Email: 'email',
118
+ Url: 'url',
119
+ Letters: 'letters',
120
+ LettersAndNumbers: 'lettersAndNumbers',
121
+ LettersNumbersSpace: 'lettersNumbersSpace',
122
+ PersianLetters: 'persianLetters',
123
+ PersianLettersAndNumbers: 'persianLettersAndNumbers',
124
+ MultilingualLettersAndNumbers: 'multilingualLettersAndNumbers',
125
+ NoSpecialChars: 'noSpecialChars',
126
+ Custom: 'custom'
127
+ };
128
+ export { G9ButtonVariant, G9CascadeDirection, G9CascadeTransition, G9ChipGroupLayoutMode, G9ChipGroupSelectionMode, G9ControlSize, G9DateTimeDisplayFormat, G9DateTimePickerMode, G9FilledValueHighlight, G9InputType, G9KeyboardType, G9PinEntryType, G9ProgressLabelPlacement, G9ProgressType, G9RangeSliderMode, G9SeparatorTitleAlignment, G9TabBarPosition, G9TabMode, G9TabStyle, G9TextInputDirection };
129
+
130
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enums/index.js","sources":["../../src/enums/index.ts"],"sourcesContent":["/** Colour role of a button-like control (MAUI `G9ButtonVariant`). Default for buttons: `'primary'`. */\nexport const G9ButtonVariant = {\n Primary: 'primary',\n Tonal: 'tonal',\n Default: 'default',\n Secondary: 'secondary',\n Info: 'info',\n Success: 'success',\n Warning: 'warning',\n /** Solid red fill, white glyph: the loud, committing destructive action (Delete, Truncate). */\n Error: 'error',\n /**\n * The soft destructive look: an `ErrorContainer` fill with the `Error` glyph on top, quiet enough to stay on screen\n * permanently.\n */\n ErrorTonal: 'errorTonal',\n Surface: 'surface',\n Outline: 'outline',\n Text: 'text',\n} as const;\nexport type G9ButtonVariant = (typeof G9ButtonVariant)[keyof typeof G9ButtonVariant];\n\n/** Colour role of a progress indicator (MAUI `G9ProgressType`). */\nexport const G9ProgressType = {\n Primary: 'primary',\n Success: 'success',\n Warning: 'warning',\n Error: 'error',\n} as const;\nexport type G9ProgressType = (typeof G9ProgressType)[keyof typeof G9ProgressType];\n\n/** Size step of a control (MAUI `G9ControlSize`). Default for controls: `'medium'`. */\nexport const G9ControlSize = {\n Small: 'small',\n Medium: 'medium',\n Large: 'large',\n Hero: 'hero',\n} as const;\nexport type G9ControlSize = (typeof G9ControlSize)[keyof typeof G9ControlSize];\n\n/** Writing direction of a field's entered value (MAUI `G9TextInputDirection`). `'matchParent'` follows the culture. */\nexport const G9TextInputDirection = {\n MatchParent: 'matchParent',\n LeftToRight: 'leftToRight',\n RightToLeft: 'rightToLeft',\n} as const;\nexport type G9TextInputDirection = (typeof G9TextInputDirection)[keyof typeof G9TextInputDirection];\n\n/**\n * How a filled field's value is highlighted (MAUI `G9FilledValueHighlight`): `'inherit'` takes the app-wide setting,\n * `'accent'` tints with the primary colour, `'neutral'` keeps the regular text colour.\n */\nexport const G9FilledValueHighlight = {\n Inherit: 'inherit',\n Accent: 'accent',\n Neutral: 'neutral',\n} as const;\nexport type G9FilledValueHighlight = (typeof G9FilledValueHighlight)[keyof typeof G9FilledValueHighlight];\n\n/** On-screen keyboard of a text field (MAUI `G9KeyboardType`). */\nexport const G9KeyboardType = {\n Default: 'default',\n Email: 'email',\n Phone: 'phone',\n Number: 'number',\n Url: 'url',\n Password: 'password',\n} as const;\nexport type G9KeyboardType = (typeof G9KeyboardType)[keyof typeof G9KeyboardType];\n\n/** What a date/time picker edits (MAUI `G9DateTimePickerMode`). */\nexport const G9DateTimePickerMode = {\n Date: 'date',\n Time: 'time',\n DateTime: 'dateTime',\n} as const;\nexport type G9DateTimePickerMode = (typeof G9DateTimePickerMode)[keyof typeof G9DateTimePickerMode];\n\n/** How a picked date/time is displayed (MAUI `G9DateTimeDisplayFormat`); `'custom'` uses the caller's pattern. */\nexport const G9DateTimeDisplayFormat = {\n ShortDate: 'shortDate',\n LongDate: 'longDate',\n TimeOnly: 'timeOnly',\n ShortDateTime: 'shortDateTime',\n LongDateTime: 'longDateTime',\n Custom: 'custom',\n} as const;\nexport type G9DateTimeDisplayFormat = (typeof G9DateTimeDisplayFormat)[keyof typeof G9DateTimeDisplayFormat];\n\n/** One thumb or two (MAUI `G9RangeSliderMode`). */\nexport const G9RangeSliderMode = {\n Single: 'single',\n Range: 'range',\n} as const;\nexport type G9RangeSliderMode = (typeof G9RangeSliderMode)[keyof typeof G9RangeSliderMode];\n\n/** Characters a PIN entry accepts (MAUI `G9PinEntryType`); `'password'` masks them. */\nexport const G9PinEntryType = {\n Number: 'number',\n Letters: 'letters',\n Alphanumeric: 'alphanumeric',\n Password: 'password',\n} as const;\nexport type G9PinEntryType = (typeof G9PinEntryType)[keyof typeof G9PinEntryType];\n\n/** Selection behaviour of a chip group (MAUI `G9ChipGroupSelectionMode`). */\nexport const G9ChipGroupSelectionMode = {\n MultiSelection: 'multiSelection',\n SingleSelection: 'singleSelection',\n} as const;\nexport type G9ChipGroupSelectionMode = (typeof G9ChipGroupSelectionMode)[keyof typeof G9ChipGroupSelectionMode];\n\n/** Layout of a chip group (MAUI `G9ChipGroupLayoutMode`): wrapping rows or one horizontally scrolling line. */\nexport const G9ChipGroupLayoutMode = {\n Wrap: 'wrap',\n SingleLineScroll: 'singleLineScroll',\n} as const;\nexport type G9ChipGroupLayoutMode = (typeof G9ChipGroupLayoutMode)[keyof typeof G9ChipGroupLayoutMode];\n\n/** Where a progress bar's label sits (MAUI `G9ProgressLabelPlacement`). */\nexport const G9ProgressLabelPlacement = {\n None: 'none',\n Above: 'above',\n End: 'end',\n} as const;\nexport type G9ProgressLabelPlacement = (typeof G9ProgressLabelPlacement)[keyof typeof G9ProgressLabelPlacement];\n\n/** Alignment of a separator's title (MAUI `G9SeparatorTitleAlignment`); `'auto'` follows the direction. */\nexport const G9SeparatorTitleAlignment = {\n Auto: 'auto',\n Start: 'start',\n Center: 'center',\n End: 'end',\n} as const;\nexport type G9SeparatorTitleAlignment = (typeof G9SeparatorTitleAlignment)[keyof typeof G9SeparatorTitleAlignment];\n\n/** Tab width behaviour (MAUI `G9TabMode`): equal fixed tabs or a scrolling strip. */\nexport const G9TabMode = {\n Fixed: 'fixed',\n Scrollable: 'scrollable',\n} as const;\nexport type G9TabMode = (typeof G9TabMode)[keyof typeof G9TabMode];\n\n/** Tab indicator style (MAUI `G9TabStyle`). */\nexport const G9TabStyle = {\n Underlined: 'underlined',\n Pill: 'pill',\n} as const;\nexport type G9TabStyle = (typeof G9TabStyle)[keyof typeof G9TabStyle];\n\n/** Direction a cascade (drill-down) panel moves in (MAUI `G9CascadeDirection`); `'auto'` follows the direction. */\nexport const G9CascadeDirection = {\n Auto: 'auto',\n LeftToRight: 'leftToRight',\n RightToLeft: 'rightToLeft',\n TopToBottom: 'topToBottom',\n BottomToTop: 'bottomToTop',\n} as const;\nexport type G9CascadeDirection = (typeof G9CascadeDirection)[keyof typeof G9CascadeDirection];\n\n/** How the next cascade level appears (MAUI `G9CascadeTransition`): over the current one, or pushing it out. */\nexport const G9CascadeTransition = {\n Overlay: 'overlay',\n Push: 'push',\n} as const;\nexport type G9CascadeTransition = (typeof G9CascadeTransition)[keyof typeof G9CascadeTransition];\n\n/** Where a tab bar sits (MAUI `G9TabBarPosition`). */\nexport const G9TabBarPosition = {\n Top: 'top',\n Bottom: 'bottom',\n} as const;\nexport type G9TabBarPosition = (typeof G9TabBarPosition)[keyof typeof G9TabBarPosition];\n\n/**\n * Semantic input type of a text field (MAUI `G9InputType`). One value drives the keyboard, the live keystroke filter\n * and the on-blur validation; the policy itself (filters, validation, LTR preference) lands with the fields in WP03.\n */\nexport const G9InputType = {\n /** No filtering, no validation, default keyboard. */\n Default: 'default',\n /** Digits 0-9 only. Numeric keyboard. */\n Number: 'number',\n /** Digits plus one decimal separator (the culture's, `.` or `٫`). Numeric keyboard. */\n Decimal: 'decimal',\n /** Digits with an optional leading `-`. Numeric keyboard. */\n SignedNumber: 'signedNumber',\n /** Digits with an optional leading `-` and one decimal separator. Numeric keyboard. */\n SignedDecimal: 'signedDecimal',\n /** Digits, `+`, `-`, space, `(` and `)`. Telephone keyboard; no format validation. */\n Phone: 'phone',\n /** Anything but whitespace while typing; `local@domain.tld` shape on blur. Email keyboard. */\n Email: 'email',\n /** Anything but whitespace while typing; an absolute URI on blur. URL keyboard. */\n Url: 'url',\n /** Latin letters a-z, A-Z. */\n Letters: 'letters',\n /** Latin letters and digits 0-9. */\n LettersAndNumbers: 'lettersAndNumbers',\n /** Latin letters, digits and space. */\n LettersNumbersSpace: 'lettersNumbersSpace',\n /** Persian/Arabic letters (U+0600–U+06FF without digits) and space. */\n PersianLetters: 'persianLetters',\n /** Persian/Arabic letters, Persian and ASCII digits, and space. */\n PersianLettersAndNumbers: 'persianLettersAndNumbers',\n /** Latin and Persian/Arabic letters, ASCII and Persian digits, and space. */\n MultilingualLettersAndNumbers: 'multilingualLettersAndNumbers',\n /** Letters (Latin/Persian/Arabic), digits and space; every punctuation or symbol is rejected. */\n NoSpecialChars: 'noSpecialChars',\n /** The field's own allowed-characters and validation patterns. */\n Custom: 'custom',\n} as const;\nexport type G9InputType = (typeof G9InputType)[keyof typeof G9InputType];\n"],"names":["G9ButtonVariant","G9ProgressType","G9ControlSize","G9TextInputDirection","G9FilledValueHighlight","G9KeyboardType","G9DateTimePickerMode","G9DateTimeDisplayFormat","G9RangeSliderMode","G9PinEntryType","G9ChipGroupSelectionMode","G9ChipGroupLayoutMode","G9ProgressLabelPlacement","G9SeparatorTitleAlignment","G9TabMode","G9TabStyle","G9CascadeDirection","G9CascadeTransition","G9TabBarPosition","G9InputType"],"mappings":"AACO,MAAMA,kBAAkB;IAC7B,SAAS;IACT,OAAO;IACP,SAAS;IACT,WAAW;IACX,MAAM;IACN,SAAS;IACT,SAAS;IAET,OAAO;IAKP,YAAY;IACZ,SAAS;IACT,SAAS;IACT,MAAM;AACR;AAIO,MAAMC,iBAAiB;IAC5B,SAAS;IACT,SAAS;IACT,SAAS;IACT,OAAO;AACT;AAIO,MAAMC,gBAAgB;IAC3B,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;AACR;AAIO,MAAMC,uBAAuB;IAClC,aAAa;IACb,aAAa;IACb,aAAa;AACf;AAOO,MAAMC,yBAAyB;IACpC,SAAS;IACT,QAAQ;IACR,SAAS;AACX;AAIO,MAAMC,iBAAiB;IAC5B,SAAS;IACT,OAAO;IACP,OAAO;IACP,QAAQ;IACR,KAAK;IACL,UAAU;AACZ;AAIO,MAAMC,uBAAuB;IAClC,MAAM;IACN,MAAM;IACN,UAAU;AACZ;AAIO,MAAMC,0BAA0B;IACrC,WAAW;IACX,UAAU;IACV,UAAU;IACV,eAAe;IACf,cAAc;IACd,QAAQ;AACV;AAIO,MAAMC,oBAAoB;IAC/B,QAAQ;IACR,OAAO;AACT;AAIO,MAAMC,iBAAiB;IAC5B,QAAQ;IACR,SAAS;IACT,cAAc;IACd,UAAU;AACZ;AAIO,MAAMC,2BAA2B;IACtC,gBAAgB;IAChB,iBAAiB;AACnB;AAIO,MAAMC,wBAAwB;IACnC,MAAM;IACN,kBAAkB;AACpB;AAIO,MAAMC,2BAA2B;IACtC,MAAM;IACN,OAAO;IACP,KAAK;AACP;AAIO,MAAMC,4BAA4B;IACvC,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;AACP;AAIO,MAAMC,YAAY;IACvB,OAAO;IACP,YAAY;AACd;AAIO,MAAMC,aAAa;IACxB,YAAY;IACZ,MAAM;AACR;AAIO,MAAMC,qBAAqB;IAChC,MAAM;IACN,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;AACf;AAIO,MAAMC,sBAAsB;IACjC,SAAS;IACT,MAAM;AACR;AAIO,MAAMC,mBAAmB;IAC9B,KAAK;IACL,QAAQ;AACV;AAOO,MAAMC,cAAc;IAEzB,SAAS;IAET,QAAQ;IAER,SAAS;IAET,cAAc;IAEd,eAAe;IAEf,OAAO;IAEP,OAAO;IAEP,KAAK;IAEL,SAAS;IAET,mBAAmB;IAEnB,qBAAqB;IAErB,gBAAgB;IAEhB,0BAA0B;IAE1B,+BAA+B;IAE/B,gBAAgB;IAEhB,QAAQ;AACV"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Base class of every unexpected G9 failure (plan/specs/03-API-Conventions.md §7). `code` is stable and safe to switch
3
+ * on; `message` is for people.
4
+ */
5
+ export declare class G9Error extends Error {
6
+ /** Stable machine-readable failure code, e.g. `'color-format'`. */
7
+ readonly code: string;
8
+ constructor(code: string, message: string);
9
+ }
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,KAAK;IAChC,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAO1C"}
package/dist/errors.js ADDED
@@ -0,0 +1,21 @@
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) Object.defineProperty(obj, key, {
3
+ value: value,
4
+ enumerable: true,
5
+ configurable: true,
6
+ writable: true
7
+ });
8
+ else obj[key] = value;
9
+ return obj;
10
+ }
11
+ class G9Error extends Error {
12
+ constructor(code, message){
13
+ super(message), _define_property(this, "code", void 0);
14
+ this.name = 'G9Error';
15
+ this.code = code;
16
+ Object.setPrototypeOf(this, new.target.prototype);
17
+ }
18
+ }
19
+ export { G9Error };
20
+
21
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sources":["../src/errors.ts"],"sourcesContent":["/**\n * Base class of every unexpected G9 failure (plan/specs/03-API-Conventions.md §7). `code` is stable and safe to switch\n * on; `message` is for people.\n */\nexport class G9Error extends Error {\n /** Stable machine-readable failure code, e.g. `'color-format'`. */\n readonly code: string;\n\n constructor(code: string, message: string) {\n super(message);\n this.name = 'G9Error';\n this.code = code;\n // ES2015 class extension of Error loses the prototype on some downlevelled runtimes; restore it.\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n"],"names":["G9Error","Error","code","message","Object"],"mappings":";;;;;;;;;;AAIO,MAAMA,gBAAgBC;IAI3B,YAAYC,IAAY,EAAEC,OAAe,CAAE;QACzC,KAAK,CAACA,UAHR,uBAAS,QAAT;QAIE,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,IAAI,GAAGD;QAEZE,OAAO,cAAc,CAAC,IAAI,EAAE,WAAW,SAAS;IAClD;AACF"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Everything a safe executor knows about a failed operation (MAUI `G9DiagnosticsReport`), handed to
3
+ * `onOperationFailed` observers and to the app's "More details" surface.
4
+ */
5
+ export interface G9DiagnosticsReport {
6
+ /** Where the failure came from: `source/key` for operation failures, the given source for direct reports. */
7
+ readonly source: string;
8
+ /** The message the user was shown. */
9
+ readonly userMessage: string | null;
10
+ /** The operation trace report, when one was collected. */
11
+ readonly diagnosticsText: string | null;
12
+ /** Every error involved. Empty (not `null`) for a reported failure with no error behind it. */
13
+ readonly exceptions: ReadonlyArray<unknown> | null;
14
+ }
15
+ /** Creates a frozen {@link G9DiagnosticsReport} (MAUI positional record constructor). */
16
+ export declare function createDiagnosticsReport(source: string, userMessage?: string | null, diagnosticsText?: string | null, exceptions?: ReadonlyArray<unknown> | null): G9DiagnosticsReport;
17
+ /** Log severity (MAUI used `Microsoft.Extensions.Logging.LogLevel`; same names, camelCase). */
18
+ export declare const G9LogLevel: {
19
+ readonly Trace: "trace";
20
+ readonly Debug: "debug";
21
+ readonly Information: "information";
22
+ readonly Warning: "warning";
23
+ readonly Error: "error";
24
+ readonly Critical: "critical";
25
+ };
26
+ export type G9LogLevel = (typeof G9LogLevel)[keyof typeof G9LogLevel];
27
+ /** One log line (MAUI wrote these to `ILogger`). */
28
+ export interface G9LogEntry {
29
+ readonly level: G9LogLevel;
30
+ readonly message: string;
31
+ readonly source?: string;
32
+ readonly key?: string;
33
+ readonly error?: unknown;
34
+ }
35
+ /** Closes an activity started with {@link G9Diagnostics.activity}. Idempotent. */
36
+ export interface G9ActivityScope {
37
+ dispose(): void;
38
+ }
39
+ /**
40
+ * The library's observation seam (MAUI `G9Diagnostics`, plus `G9SafeCommand.OperationFailed` and the logger): a host
41
+ * learns that something started, finished, failed or was logged, without the library deciding what that means.
42
+ * Not a testing feature. Every listener call is guarded: an observer that throws never breaks the operation it
43
+ * observes (its error goes to `onListenerError` when given). One hub per app; the WP02 provider owns it.
44
+ */
45
+ export interface G9Diagnostics {
46
+ /** A safe-executor operation began: `source` and `key`. */
47
+ onOperationStarted(listener: (source: string, key: string) => void): () => void;
48
+ /**
49
+ * An operation ended, successfully or not, with elapsed milliseconds. Fires exactly once for every operation that
50
+ * raised `operationStarted`, including timed-out, cancelled and disposed ones, so in-flight counts never leak.
51
+ */
52
+ onOperationCompleted(listener: (source: string, key: string, elapsedMs: number) => void): () => void;
53
+ /** A named UI activity that is not a command began (`busy` true) or ended (false). */
54
+ onActivityChanged(listener: (name: string, busy: boolean) => void): () => void;
55
+ /** An operation failed (an error, a timeout or `trace.fail`): exactly once per failure, popup or not. */
56
+ onOperationFailed(listener: (report: G9DiagnosticsReport) => void): () => void;
57
+ /** Log lines from executors and traces. */
58
+ onLog(listener: (entry: G9LogEntry) => void): () => void;
59
+ raiseOperationStarted(source: string, key: string): void;
60
+ raiseOperationCompleted(source: string, key: string, elapsedMs: number): void;
61
+ raiseActivityChanged(name: string, busy: boolean): void;
62
+ raiseOperationFailed(report: G9DiagnosticsReport): void;
63
+ log(entry: G9LogEntry): void;
64
+ /** Raises `activityChanged(name, true)` now and `(name, false)` on the first `dispose()` only. */
65
+ activity(name: string): G9ActivityScope;
66
+ }
67
+ /** Options of {@link createDiagnostics}. */
68
+ export interface G9DiagnosticsOptions {
69
+ /** Receives errors thrown by listeners (they never propagate). Default: dropped, as MAUI did. */
70
+ readonly onListenerError?: (error: unknown, channel: string) => void;
71
+ }
72
+ /** Creates a {@link G9Diagnostics} hub. */
73
+ export declare function createDiagnostics(options?: G9DiagnosticsOptions): G9Diagnostics;
74
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/exec/diagnostics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,6GAA6G;IAC7G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CACpD;AAED,yFAAyF;AACzF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,MAAM,GAAG,IAAW,EACj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E,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACzD,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzD,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9E,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACxD,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACxD,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;CACzC;AAED,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,iGAAiG;IACjG,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtE;AAID,2CAA2C;AAC3C,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,oBAAyB,GAAG,aAAa,CAqDnF"}
@@ -0,0 +1,73 @@
1
+ function createDiagnosticsReport(source, userMessage = null, diagnosticsText = null, exceptions = null) {
2
+ return Object.freeze({
3
+ source,
4
+ userMessage,
5
+ diagnosticsText,
6
+ exceptions: null === exceptions ? null : Object.freeze([
7
+ ...exceptions
8
+ ])
9
+ });
10
+ }
11
+ const G9LogLevel = {
12
+ Trace: 'trace',
13
+ Debug: 'debug',
14
+ Information: 'information',
15
+ Warning: 'warning',
16
+ Error: 'error',
17
+ Critical: 'critical'
18
+ };
19
+ function createDiagnostics(options = {}) {
20
+ const channels = new Map();
21
+ const add = (channel, listener)=>{
22
+ let set = channels.get(channel);
23
+ if (!set) {
24
+ set = new Set();
25
+ channels.set(channel, set);
26
+ }
27
+ set.add(listener);
28
+ return ()=>{
29
+ set.delete(listener);
30
+ };
31
+ };
32
+ const raise = (channel, ...args)=>{
33
+ const set = channels.get(channel);
34
+ if (!set) return;
35
+ for (const listener of [
36
+ ...set
37
+ ])try {
38
+ listener(...args);
39
+ } catch (error) {
40
+ try {
41
+ var _options_onListenerError;
42
+ null == (_options_onListenerError = options.onListenerError) || _options_onListenerError.call(options, error, channel);
43
+ } catch {}
44
+ }
45
+ };
46
+ const hub = {
47
+ onOperationStarted: (listener)=>add('operationStarted', listener),
48
+ onOperationCompleted: (listener)=>add('operationCompleted', listener),
49
+ onActivityChanged: (listener)=>add('activityChanged', listener),
50
+ onOperationFailed: (listener)=>add('operationFailed', listener),
51
+ onLog: (listener)=>add('log', listener),
52
+ raiseOperationStarted: (source, key)=>raise('operationStarted', source, key),
53
+ raiseOperationCompleted: (source, key, elapsedMs)=>raise('operationCompleted', source, key, elapsedMs),
54
+ raiseActivityChanged: (name, busy)=>raise('activityChanged', name, busy),
55
+ raiseOperationFailed: (report)=>raise('operationFailed', report),
56
+ log: (entry)=>raise('log', entry),
57
+ activity (name) {
58
+ hub.raiseActivityChanged(name, true);
59
+ let open = true;
60
+ return {
61
+ dispose () {
62
+ if (!open) return;
63
+ open = false;
64
+ hub.raiseActivityChanged(name, false);
65
+ }
66
+ };
67
+ }
68
+ };
69
+ return hub;
70
+ }
71
+ export { G9LogLevel, createDiagnostics, createDiagnosticsReport };
72
+
73
+ //# sourceMappingURL=diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec/diagnostics.js","sources":["../../src/exec/diagnostics.ts"],"sourcesContent":["/**\n * Everything a safe executor knows about a failed operation (MAUI `G9DiagnosticsReport`), handed to\n * `onOperationFailed` observers and to the app's \"More details\" surface.\n */\nexport interface G9DiagnosticsReport {\n /** Where the failure came from: `source/key` for operation failures, the given source for direct reports. */\n readonly source: string;\n /** The message the user was shown. */\n readonly userMessage: string | null;\n /** The operation trace report, when one was collected. */\n readonly diagnosticsText: string | null;\n /** Every error involved. Empty (not `null`) for a reported failure with no error behind it. */\n readonly exceptions: ReadonlyArray<unknown> | null;\n}\n\n/** Creates a frozen {@link G9DiagnosticsReport} (MAUI positional record constructor). */\nexport function createDiagnosticsReport(\n source: string,\n userMessage: string | null = null,\n diagnosticsText: string | null = null,\n exceptions: ReadonlyArray<unknown> | null = null,\n): G9DiagnosticsReport {\n return Object.freeze({\n source,\n userMessage,\n diagnosticsText,\n exceptions: exceptions === null ? null : Object.freeze([...exceptions]),\n });\n}\n\n/** Log severity (MAUI used `Microsoft.Extensions.Logging.LogLevel`; same names, camelCase). */\nexport const G9LogLevel = {\n Trace: 'trace',\n Debug: 'debug',\n Information: 'information',\n Warning: 'warning',\n Error: 'error',\n Critical: 'critical',\n} as const;\nexport type G9LogLevel = (typeof G9LogLevel)[keyof typeof G9LogLevel];\n\n/** One log line (MAUI wrote these to `ILogger`). */\nexport interface G9LogEntry {\n readonly level: G9LogLevel;\n readonly message: string;\n readonly source?: string;\n readonly key?: string;\n readonly error?: unknown;\n}\n\n/** Closes an activity started with {@link G9Diagnostics.activity}. Idempotent. */\nexport interface G9ActivityScope {\n dispose(): void;\n}\n\n/**\n * The library's observation seam (MAUI `G9Diagnostics`, plus `G9SafeCommand.OperationFailed` and the logger): a host\n * learns that something started, finished, failed or was logged, without the library deciding what that means.\n * Not a testing feature. Every listener call is guarded: an observer that throws never breaks the operation it\n * observes (its error goes to `onListenerError` when given). One hub per app; the WP02 provider owns it.\n */\nexport interface G9Diagnostics {\n /** A safe-executor operation began: `source` and `key`. */\n onOperationStarted(listener: (source: string, key: string) => void): () => void;\n /**\n * An operation ended, successfully or not, with elapsed milliseconds. Fires exactly once for every operation that\n * raised `operationStarted`, including timed-out, cancelled and disposed ones, so in-flight counts never leak.\n */\n onOperationCompleted(listener: (source: string, key: string, elapsedMs: number) => void): () => void;\n /** A named UI activity that is not a command began (`busy` true) or ended (false). */\n onActivityChanged(listener: (name: string, busy: boolean) => void): () => void;\n /** An operation failed (an error, a timeout or `trace.fail`): exactly once per failure, popup or not. */\n onOperationFailed(listener: (report: G9DiagnosticsReport) => void): () => void;\n /** Log lines from executors and traces. */\n onLog(listener: (entry: G9LogEntry) => void): () => void;\n raiseOperationStarted(source: string, key: string): void;\n raiseOperationCompleted(source: string, key: string, elapsedMs: number): void;\n raiseActivityChanged(name: string, busy: boolean): void;\n raiseOperationFailed(report: G9DiagnosticsReport): void;\n log(entry: G9LogEntry): void;\n /** Raises `activityChanged(name, true)` now and `(name, false)` on the first `dispose()` only. */\n activity(name: string): G9ActivityScope;\n}\n\n/** Options of {@link createDiagnostics}. */\nexport interface G9DiagnosticsOptions {\n /** Receives errors thrown by listeners (they never propagate). Default: dropped, as MAUI did. */\n readonly onListenerError?: (error: unknown, channel: string) => void;\n}\n\ntype Listener = (...args: never[]) => void;\n\n/** Creates a {@link G9Diagnostics} hub. */\nexport function createDiagnostics(options: G9DiagnosticsOptions = {}): G9Diagnostics {\n const channels = new Map<string, Set<Listener>>();\n const add = (channel: string, listener: Listener) => {\n let set = channels.get(channel);\n if (!set) {\n set = new Set();\n channels.set(channel, set);\n }\n set.add(listener);\n return () => {\n set.delete(listener);\n };\n };\n const raise = <A extends unknown[]>(channel: string, ...args: A) => {\n const set = channels.get(channel);\n if (!set) return;\n for (const listener of [...set]) {\n try {\n (listener as unknown as (...a: A) => void)(...args);\n } catch (error) {\n try {\n options.onListenerError?.(error, channel);\n } catch {\n // Nothing further can be done; an observer must never break the operation it observes.\n }\n }\n }\n };\n const hub: G9Diagnostics = {\n onOperationStarted: (listener) => add('operationStarted', listener),\n onOperationCompleted: (listener) => add('operationCompleted', listener),\n onActivityChanged: (listener) => add('activityChanged', listener),\n onOperationFailed: (listener) => add('operationFailed', listener),\n onLog: (listener) => add('log', listener),\n raiseOperationStarted: (source, key) => raise('operationStarted', source, key),\n raiseOperationCompleted: (source, key, elapsedMs) => raise('operationCompleted', source, key, elapsedMs),\n raiseActivityChanged: (name, busy) => raise('activityChanged', name, busy),\n raiseOperationFailed: (report) => raise('operationFailed', report),\n log: (entry) => raise('log', entry),\n activity(name) {\n hub.raiseActivityChanged(name, true);\n let open = true;\n return {\n dispose() {\n // A double dispose would decrement a host's busy count twice (MAUI used Interlocked for the same reason).\n if (!open) return;\n open = false;\n hub.raiseActivityChanged(name, false);\n },\n };\n },\n };\n return hub;\n}\n"],"names":["createDiagnosticsReport","source","userMessage","diagnosticsText","exceptions","Object","G9LogLevel","createDiagnostics","options","channels","Map","add","channel","listener","set","Set","raise","args","error","hub","key","elapsedMs","name","busy","report","entry","open"],"mappings":"AAgBO,SAASA,wBACdC,MAAc,EACdC,cAA6B,IAAI,EACjCC,kBAAiC,IAAI,EACrCC,aAA4C,IAAI;IAEhD,OAAOC,OAAO,MAAM,CAAC;QACnBJ;QACAC;QACAC;QACA,YAAYC,AAAe,SAAfA,aAAsB,OAAOC,OAAO,MAAM,CAAC;eAAID;SAAW;IACxE;AACF;AAGO,MAAME,aAAa;IACxB,OAAO;IACP,OAAO;IACP,aAAa;IACb,SAAS;IACT,OAAO;IACP,UAAU;AACZ;AAuDO,SAASC,kBAAkBC,UAAgC,CAAC,CAAC;IAClE,MAAMC,WAAW,IAAIC;IACrB,MAAMC,MAAM,CAACC,SAAiBC;QAC5B,IAAIC,MAAML,SAAS,GAAG,CAACG;QACvB,IAAI,CAACE,KAAK;YACRA,MAAM,IAAIC;YACVN,SAAS,GAAG,CAACG,SAASE;QACxB;QACAA,IAAI,GAAG,CAACD;QACR,OAAO;YACLC,IAAI,MAAM,CAACD;QACb;IACF;IACA,MAAMG,QAAQ,CAAsBJ,SAAiB,GAAGK;QACtD,MAAMH,MAAML,SAAS,GAAG,CAACG;QACzB,IAAI,CAACE,KAAK;QACV,KAAK,MAAMD,YAAY;eAAIC;SAAI,CAC7B,IAAI;YACDD,YAA6CI;QAChD,EAAE,OAAOC,OAAO;YACd,IAAI;oBACFV;wBAAAA,CAAAA,2BAAAA,QAAQ,eAAe,AAAD,KAAtBA,yBAAAA,IAAAA,CAAAA,SAA0BU,OAAON;YACnC,EAAE,OAAM,CAER;QACF;IAEJ;IACA,MAAMO,MAAqB;QACzB,oBAAoB,CAACN,WAAaF,IAAI,oBAAoBE;QAC1D,sBAAsB,CAACA,WAAaF,IAAI,sBAAsBE;QAC9D,mBAAmB,CAACA,WAAaF,IAAI,mBAAmBE;QACxD,mBAAmB,CAACA,WAAaF,IAAI,mBAAmBE;QACxD,OAAO,CAACA,WAAaF,IAAI,OAAOE;QAChC,uBAAuB,CAACZ,QAAQmB,MAAQJ,MAAM,oBAAoBf,QAAQmB;QAC1E,yBAAyB,CAACnB,QAAQmB,KAAKC,YAAcL,MAAM,sBAAsBf,QAAQmB,KAAKC;QAC9F,sBAAsB,CAACC,MAAMC,OAASP,MAAM,mBAAmBM,MAAMC;QACrE,sBAAsB,CAACC,SAAWR,MAAM,mBAAmBQ;QAC3D,KAAK,CAACC,QAAUT,MAAM,OAAOS;QAC7B,UAASH,IAAI;YACXH,IAAI,oBAAoB,CAACG,MAAM;YAC/B,IAAII,OAAO;YACX,OAAO;gBACL;oBAEE,IAAI,CAACA,MAAM;oBACXA,OAAO;oBACPP,IAAI,oBAAoB,CAACG,MAAM;gBACjC;YACF;QACF;IACF;IACA,OAAOH;AACT"}
@@ -0,0 +1,5 @@
1
+ export { createDiagnostics, createDiagnosticsReport, type G9ActivityScope, type G9Diagnostics, type G9DiagnosticsOptions, type G9DiagnosticsReport, type G9LogEntry, G9LogLevel, } from './diagnostics.js';
2
+ export { createFireAndForgetOperationOptions, createSilentOperationOptions, createUiOperationOptions, type G9ResolvedSafeExecutorOptions, type G9SafeExecutorOptions, g9DefaultSafeExecutorOptions, resolveExecutionDelay, resolveSafeExecutorOptions, } from './options.js';
3
+ export { createSafeExecutor, type G9ErrorPopupRequest, type G9SafeAction, type G9SafeExecutor, type G9SafeExecutorConfig, type G9SafeExecutorSnapshot, type G9SafeRunContext, type G9SafeRunResult, type G9ShowOperationErrorOptions, type G9Timers, g9RuntimeTimers, } from './safe-executor.js';
4
+ export { createOperationTrace, describeError, formatRoundTripUtc, type G9OperationTrace, type G9OperationTraceOptions, type G9TraceEntry, type G9TraceFailure, type G9TraceLevel, } from './trace.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exec/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mCAAmC,EACnC,4BAA4B,EAC5B,wBAAwB,EACxB,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,QAAQ,EACb,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { G9LogLevel, createDiagnostics, createDiagnosticsReport } from "./diagnostics.js";
2
+ export { createFireAndForgetOperationOptions, createSilentOperationOptions, createUiOperationOptions, g9DefaultSafeExecutorOptions, resolveExecutionDelay, resolveSafeExecutorOptions } from "./options.js";
3
+ export { createSafeExecutor, g9RuntimeTimers } from "./safe-executor.js";
4
+ export { createOperationTrace, describeError, formatRoundTripUtc } from "./trace.js";
@@ -0,0 +1,75 @@
1
+ import type { G9AbortSignal } from '../services/abort.js';
2
+ /**
3
+ * Options of one guarded run (MAUI `G9SafeCommandOptions`). Every field is optional; executor-level `defaults` apply
4
+ * first, then these. Defaults are the MAUI defaults.
5
+ */
6
+ export interface G9SafeExecutorOptions {
7
+ /** Skip a new run while a run with the same key is in flight. Default `true`. */
8
+ readonly preventConcurrentExecution?: boolean;
9
+ /** Operation key for the throttle and concurrency guards. Default: the executor's default key (`'default'`). */
10
+ readonly throttleKey?: string;
11
+ /** Minimum time between two runs of the same key, in ms. Default `369`. */
12
+ readonly throttleIntervalMs?: number;
13
+ /** When `false`, the throttle (double-tap) guard is skipped. Default `true`. */
14
+ readonly enableThrottle?: boolean;
15
+ /** Message shown for an unexpected error. Default: the `UnexpectedError` string. */
16
+ readonly errorMessage?: string;
17
+ /** Title of the error popup. Default: the `Error` string. */
18
+ readonly errorTitle?: string;
19
+ /** Logical source in diagnostics (e.g. `'LoginScreen'`). Default: the executor's default source (`'unknown'`). */
20
+ readonly source?: string;
21
+ /** Show the error popup for an unexpected error, a timeout or `trace.fail`. Default `true`. */
22
+ readonly showErrorPopup?: boolean;
23
+ /** Reject the run's promise with the error after reporting it (errors and timeouts, not `trace.fail`). Default `false`. */
24
+ readonly rethrow?: boolean;
25
+ /** Busy indicator: `true` when the action starts (after the delay), `false` when the run settles. */
26
+ readonly setBusy?: (busy: boolean) => void;
27
+ /** Called with an unexpected error or timeout after the guards are released and before the popup. */
28
+ readonly onError?: (error: unknown) => void | Promise<void>;
29
+ /** Legacy delay before the action, in ms (MAUI `BusyDelay`). Default `0`. Ignored when `delayBeforeExecutionMs` > 0. */
30
+ readonly busyDelayMs?: number;
31
+ /** Delay before the action, in ms (ripple/animation room). Takes precedence over `busyDelayMs`. Default `0`. */
32
+ readonly delayBeforeExecutionMs?: number;
33
+ /**
34
+ * Fail the run when the action has not settled after this many ms (counted from the action's start). The run's
35
+ * signal is aborted, the guards and busy state are released, and a late completion is ignored. Default: none.
36
+ */
37
+ readonly timeoutMs?: number;
38
+ /** Cancels the run from outside: before start it is not run; while running it settles as cancelled at once. */
39
+ readonly signal?: G9AbortSignal;
40
+ }
41
+ /** {@link G9SafeExecutorOptions} with every default applied. */
42
+ export interface G9ResolvedSafeExecutorOptions {
43
+ readonly preventConcurrentExecution: boolean;
44
+ readonly throttleKey: string;
45
+ readonly throttleIntervalMs: number;
46
+ readonly enableThrottle: boolean;
47
+ readonly errorMessage: string | null;
48
+ readonly errorTitle: string | null;
49
+ readonly source: string;
50
+ readonly showErrorPopup: boolean;
51
+ readonly rethrow: boolean;
52
+ readonly setBusy: ((busy: boolean) => void) | null;
53
+ readonly onError: ((error: unknown) => void | Promise<void>) | null;
54
+ readonly busyDelayMs: number;
55
+ readonly delayBeforeExecutionMs: number;
56
+ readonly timeoutMs: number | null;
57
+ readonly signal: G9AbortSignal | null;
58
+ }
59
+ /** The MAUI defaults (`G9SafeCommandOptions.Default`). */
60
+ export declare const g9DefaultSafeExecutorOptions: G9ResolvedSafeExecutorOptions;
61
+ /**
62
+ * Applies `options` over `base`, validating every field.
63
+ * @throws {G9Error} `safe-options` for a blank key or source, a non-finite duration, a non-positive timeout, or a
64
+ * callback that is not a function.
65
+ */
66
+ export declare function resolveSafeExecutorOptions(options: G9SafeExecutorOptions | undefined, base?: G9ResolvedSafeExecutorOptions): G9ResolvedSafeExecutorOptions;
67
+ /** The delay actually applied: `delayBeforeExecutionMs` when positive, else `busyDelayMs` (MAUI precedence). */
68
+ export declare function resolveExecutionDelay(options: G9ResolvedSafeExecutorOptions): number;
69
+ /** Traced UI operations that reject same-key overlap (MAUI `CreateUiOperationOptions`). */
70
+ export declare function createUiOperationOptions(source: string, throttleKey: string): G9SafeExecutorOptions;
71
+ /** Silent nested/background work that must not block siblings (MAUI `CreateSilentOperationOptions`). */
72
+ export declare function createSilentOperationOptions(source: string, throttleKey: string): G9SafeExecutorOptions;
73
+ /** Observed event callbacks run fire-and-forget (MAUI `CreateFireAndForgetOperationOptions`). */
74
+ export declare function createFireAndForgetOperationOptions(source: string, throttleKey: string): G9SafeExecutorOptions;
75
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/exec/options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,iFAAiF;IACjF,QAAQ,CAAC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAC9C,gHAAgH;IAChH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,gFAAgF;IAChF,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,oFAAoF;IACpF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,kHAAkH;IAClH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,2HAA2H;IAC3H,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,qGAAqG;IACrG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,qGAAqG;IACrG,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,wHAAwH;IACxH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,gHAAgH;IAChH,QAAQ,CAAC,sBAAsB,CAAC,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mD/B;AAED,gHAAgH;AAChH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,6BAA6B,GAAG,MAAM,CAEpF;AAED,2FAA2F;AAC3F,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,qBAAqB,CAQnG;AAED,wGAAwG;AACxG,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,qBAAqB,CAQvG;AAED,iGAAiG;AACjG,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,qBAAqB,CAQ9G"}
@@ -0,0 +1,107 @@
1
+ import { G9Error } from "../errors.js";
2
+ const g9DefaultSafeExecutorOptions = Object.freeze({
3
+ preventConcurrentExecution: true,
4
+ throttleKey: 'default',
5
+ throttleIntervalMs: 369,
6
+ enableThrottle: true,
7
+ errorMessage: null,
8
+ errorTitle: null,
9
+ source: 'unknown',
10
+ showErrorPopup: true,
11
+ rethrow: false,
12
+ setBusy: null,
13
+ onError: null,
14
+ busyDelayMs: 0,
15
+ delayBeforeExecutionMs: 0,
16
+ timeoutMs: null,
17
+ signal: null
18
+ });
19
+ function fail(message) {
20
+ throw new G9Error('safe-options', message);
21
+ }
22
+ function ms(name, value) {
23
+ if ('number' != typeof value || !Number.isFinite(value)) fail(`${name} must be a finite number of milliseconds, got ${String(value)}.`);
24
+ return value < 0 ? 0 : value;
25
+ }
26
+ function nonBlank(name, value) {
27
+ if ('string' != typeof value || '' === value.trim()) fail(`${name} must be a non-blank string.`);
28
+ return value;
29
+ }
30
+ function resolveSafeExecutorOptions(options, base = g9DefaultSafeExecutorOptions) {
31
+ if (!options) return base;
32
+ const pick = (name)=>options[name];
33
+ function fn(name, value, fallback) {
34
+ if (void 0 === value) return fallback;
35
+ if ('function' != typeof value) fail(`${name} must be a function.`);
36
+ return value;
37
+ }
38
+ const bool = (name, fallback)=>{
39
+ const value = pick(name);
40
+ if (void 0 === value) return fallback;
41
+ if ('boolean' != typeof value) fail(`${name} must be a boolean.`);
42
+ return value;
43
+ };
44
+ const text = (name, fallback)=>{
45
+ const value = pick(name);
46
+ if (void 0 === value) return fallback;
47
+ if ('string' != typeof value) fail(`${name} must be a string.`);
48
+ return value;
49
+ };
50
+ let timeoutMs = base.timeoutMs;
51
+ if (void 0 !== options.timeoutMs) {
52
+ timeoutMs = ms('timeoutMs', options.timeoutMs);
53
+ if (timeoutMs <= 0) fail('timeoutMs must be greater than 0.');
54
+ }
55
+ const signal = options.signal;
56
+ if (void 0 !== signal && ('object' != typeof signal || null === signal || !('aborted' in signal))) fail('signal must be an AbortSignal.');
57
+ return Object.freeze({
58
+ preventConcurrentExecution: bool('preventConcurrentExecution', base.preventConcurrentExecution),
59
+ throttleKey: void 0 === options.throttleKey ? base.throttleKey : nonBlank('throttleKey', options.throttleKey),
60
+ throttleIntervalMs: void 0 === options.throttleIntervalMs ? base.throttleIntervalMs : ms('throttleIntervalMs', options.throttleIntervalMs),
61
+ enableThrottle: bool('enableThrottle', base.enableThrottle),
62
+ errorMessage: text('errorMessage', base.errorMessage),
63
+ errorTitle: text('errorTitle', base.errorTitle),
64
+ source: void 0 === options.source ? base.source : nonBlank('source', options.source),
65
+ showErrorPopup: bool('showErrorPopup', base.showErrorPopup),
66
+ rethrow: bool('rethrow', base.rethrow),
67
+ setBusy: fn('setBusy', options.setBusy, base.setBusy),
68
+ onError: fn('onError', options.onError, base.onError),
69
+ busyDelayMs: void 0 === options.busyDelayMs ? base.busyDelayMs : ms('busyDelayMs', options.busyDelayMs),
70
+ delayBeforeExecutionMs: void 0 === options.delayBeforeExecutionMs ? base.delayBeforeExecutionMs : ms('delayBeforeExecutionMs', options.delayBeforeExecutionMs),
71
+ timeoutMs,
72
+ signal: void 0 === signal ? base.signal : signal
73
+ });
74
+ }
75
+ function resolveExecutionDelay(options) {
76
+ return options.delayBeforeExecutionMs > 0 ? options.delayBeforeExecutionMs : options.busyDelayMs;
77
+ }
78
+ function createUiOperationOptions(source, throttleKey) {
79
+ return Object.freeze({
80
+ source,
81
+ throttleKey,
82
+ enableThrottle: false,
83
+ showErrorPopup: true,
84
+ preventConcurrentExecution: true
85
+ });
86
+ }
87
+ function createSilentOperationOptions(source, throttleKey) {
88
+ return Object.freeze({
89
+ source,
90
+ throttleKey,
91
+ enableThrottle: false,
92
+ showErrorPopup: false,
93
+ preventConcurrentExecution: false
94
+ });
95
+ }
96
+ function createFireAndForgetOperationOptions(source, throttleKey) {
97
+ return Object.freeze({
98
+ source,
99
+ throttleKey,
100
+ enableThrottle: false,
101
+ preventConcurrentExecution: false,
102
+ showErrorPopup: false
103
+ });
104
+ }
105
+ export { createFireAndForgetOperationOptions, createSilentOperationOptions, createUiOperationOptions, g9DefaultSafeExecutorOptions, resolveExecutionDelay, resolveSafeExecutorOptions };
106
+
107
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec/options.js","sources":["../../src/exec/options.ts"],"sourcesContent":["import { G9Error } from '../errors';\nimport type { G9AbortSignal } from '../services/abort';\n\n/**\n * Options of one guarded run (MAUI `G9SafeCommandOptions`). Every field is optional; executor-level `defaults` apply\n * first, then these. Defaults are the MAUI defaults.\n */\nexport interface G9SafeExecutorOptions {\n /** Skip a new run while a run with the same key is in flight. Default `true`. */\n readonly preventConcurrentExecution?: boolean;\n /** Operation key for the throttle and concurrency guards. Default: the executor's default key (`'default'`). */\n readonly throttleKey?: string;\n /** Minimum time between two runs of the same key, in ms. Default `369`. */\n readonly throttleIntervalMs?: number;\n /** When `false`, the throttle (double-tap) guard is skipped. Default `true`. */\n readonly enableThrottle?: boolean;\n /** Message shown for an unexpected error. Default: the `UnexpectedError` string. */\n readonly errorMessage?: string;\n /** Title of the error popup. Default: the `Error` string. */\n readonly errorTitle?: string;\n /** Logical source in diagnostics (e.g. `'LoginScreen'`). Default: the executor's default source (`'unknown'`). */\n readonly source?: string;\n /** Show the error popup for an unexpected error, a timeout or `trace.fail`. Default `true`. */\n readonly showErrorPopup?: boolean;\n /** Reject the run's promise with the error after reporting it (errors and timeouts, not `trace.fail`). Default `false`. */\n readonly rethrow?: boolean;\n /** Busy indicator: `true` when the action starts (after the delay), `false` when the run settles. */\n readonly setBusy?: (busy: boolean) => void;\n /** Called with an unexpected error or timeout after the guards are released and before the popup. */\n readonly onError?: (error: unknown) => void | Promise<void>;\n /** Legacy delay before the action, in ms (MAUI `BusyDelay`). Default `0`. Ignored when `delayBeforeExecutionMs` > 0. */\n readonly busyDelayMs?: number;\n /** Delay before the action, in ms (ripple/animation room). Takes precedence over `busyDelayMs`. Default `0`. */\n readonly delayBeforeExecutionMs?: number;\n /**\n * Fail the run when the action has not settled after this many ms (counted from the action's start). The run's\n * signal is aborted, the guards and busy state are released, and a late completion is ignored. Default: none.\n */\n readonly timeoutMs?: number;\n /** Cancels the run from outside: before start it is not run; while running it settles as cancelled at once. */\n readonly signal?: G9AbortSignal;\n}\n\n/** {@link G9SafeExecutorOptions} with every default applied. */\nexport interface G9ResolvedSafeExecutorOptions {\n readonly preventConcurrentExecution: boolean;\n readonly throttleKey: string;\n readonly throttleIntervalMs: number;\n readonly enableThrottle: boolean;\n readonly errorMessage: string | null;\n readonly errorTitle: string | null;\n readonly source: string;\n readonly showErrorPopup: boolean;\n readonly rethrow: boolean;\n readonly setBusy: ((busy: boolean) => void) | null;\n readonly onError: ((error: unknown) => void | Promise<void>) | null;\n readonly busyDelayMs: number;\n readonly delayBeforeExecutionMs: number;\n readonly timeoutMs: number | null;\n readonly signal: G9AbortSignal | null;\n}\n\n/** The MAUI defaults (`G9SafeCommandOptions.Default`). */\nexport const g9DefaultSafeExecutorOptions: G9ResolvedSafeExecutorOptions = Object.freeze({\n preventConcurrentExecution: true,\n throttleKey: 'default',\n throttleIntervalMs: 369,\n enableThrottle: true,\n errorMessage: null,\n errorTitle: null,\n source: 'unknown',\n showErrorPopup: true,\n rethrow: false,\n setBusy: null,\n onError: null,\n busyDelayMs: 0,\n delayBeforeExecutionMs: 0,\n timeoutMs: null,\n signal: null,\n});\n\nfunction fail(message: string): never {\n throw new G9Error('safe-options', message);\n}\n\nfunction ms(name: string, value: unknown): number {\n if (typeof value !== 'number' || !Number.isFinite(value))\n fail(`${name} must be a finite number of milliseconds, got ${String(value)}.`);\n // MAUI clamps a negative delay to zero; the same holds for every duration here.\n return value < 0 ? 0 : value;\n}\n\nfunction nonBlank(name: string, value: unknown): string {\n if (typeof value !== 'string' || value.trim() === '') fail(`${name} must be a non-blank string.`);\n return value;\n}\n\n/**\n * Applies `options` over `base`, validating every field.\n * @throws {G9Error} `safe-options` for a blank key or source, a non-finite duration, a non-positive timeout, or a\n * callback that is not a function.\n */\nexport function resolveSafeExecutorOptions(\n options: G9SafeExecutorOptions | undefined,\n base: G9ResolvedSafeExecutorOptions = g9DefaultSafeExecutorOptions,\n): G9ResolvedSafeExecutorOptions {\n if (!options) return base;\n const pick = (name: keyof G9SafeExecutorOptions): unknown => options[name];\n function fn<F>(name: string, value: F | undefined, fallback: F | null): F | null {\n if (value === undefined) return fallback;\n if (typeof value !== 'function') fail(`${name} must be a function.`);\n return value;\n }\n const bool = (name: keyof G9SafeExecutorOptions, fallback: boolean): boolean => {\n const value = pick(name);\n if (value === undefined) return fallback;\n if (typeof value !== 'boolean') fail(`${name} must be a boolean.`);\n return value;\n };\n const text = (name: 'errorMessage' | 'errorTitle', fallback: string | null): string | null => {\n const value = pick(name);\n if (value === undefined) return fallback;\n if (typeof value !== 'string') fail(`${name} must be a string.`);\n return value;\n };\n let timeoutMs = base.timeoutMs;\n if (options.timeoutMs !== undefined) {\n timeoutMs = ms('timeoutMs', options.timeoutMs);\n if (timeoutMs <= 0) fail('timeoutMs must be greater than 0.');\n }\n const signal = options.signal;\n if (signal !== undefined && (typeof signal !== 'object' || signal === null || !('aborted' in signal)))\n fail('signal must be an AbortSignal.');\n return Object.freeze({\n preventConcurrentExecution: bool('preventConcurrentExecution', base.preventConcurrentExecution),\n throttleKey: options.throttleKey === undefined ? base.throttleKey : nonBlank('throttleKey', options.throttleKey),\n throttleIntervalMs:\n options.throttleIntervalMs === undefined\n ? base.throttleIntervalMs\n : ms('throttleIntervalMs', options.throttleIntervalMs),\n enableThrottle: bool('enableThrottle', base.enableThrottle),\n errorMessage: text('errorMessage', base.errorMessage),\n errorTitle: text('errorTitle', base.errorTitle),\n source: options.source === undefined ? base.source : nonBlank('source', options.source),\n showErrorPopup: bool('showErrorPopup', base.showErrorPopup),\n rethrow: bool('rethrow', base.rethrow),\n setBusy: fn('setBusy', options.setBusy, base.setBusy),\n onError: fn('onError', options.onError, base.onError),\n busyDelayMs: options.busyDelayMs === undefined ? base.busyDelayMs : ms('busyDelayMs', options.busyDelayMs),\n delayBeforeExecutionMs:\n options.delayBeforeExecutionMs === undefined\n ? base.delayBeforeExecutionMs\n : ms('delayBeforeExecutionMs', options.delayBeforeExecutionMs),\n timeoutMs,\n signal: signal === undefined ? base.signal : signal,\n });\n}\n\n/** The delay actually applied: `delayBeforeExecutionMs` when positive, else `busyDelayMs` (MAUI precedence). */\nexport function resolveExecutionDelay(options: G9ResolvedSafeExecutorOptions): number {\n return options.delayBeforeExecutionMs > 0 ? options.delayBeforeExecutionMs : options.busyDelayMs;\n}\n\n/** Traced UI operations that reject same-key overlap (MAUI `CreateUiOperationOptions`). */\nexport function createUiOperationOptions(source: string, throttleKey: string): G9SafeExecutorOptions {\n return Object.freeze({\n source,\n throttleKey,\n enableThrottle: false,\n showErrorPopup: true,\n preventConcurrentExecution: true,\n });\n}\n\n/** Silent nested/background work that must not block siblings (MAUI `CreateSilentOperationOptions`). */\nexport function createSilentOperationOptions(source: string, throttleKey: string): G9SafeExecutorOptions {\n return Object.freeze({\n source,\n throttleKey,\n enableThrottle: false,\n showErrorPopup: false,\n preventConcurrentExecution: false,\n });\n}\n\n/** Observed event callbacks run fire-and-forget (MAUI `CreateFireAndForgetOperationOptions`). */\nexport function createFireAndForgetOperationOptions(source: string, throttleKey: string): G9SafeExecutorOptions {\n return Object.freeze({\n source,\n throttleKey,\n enableThrottle: false,\n preventConcurrentExecution: false,\n showErrorPopup: false,\n });\n}\n"],"names":["g9DefaultSafeExecutorOptions","Object","fail","message","G9Error","ms","name","value","Number","String","nonBlank","resolveSafeExecutorOptions","options","base","pick","fn","fallback","undefined","bool","text","timeoutMs","signal","resolveExecutionDelay","createUiOperationOptions","source","throttleKey","createSilentOperationOptions","createFireAndForgetOperationOptions"],"mappings":";AA+DO,MAAMA,+BAA8DC,OAAO,MAAM,CAAC;IACvF,4BAA4B;IAC5B,aAAa;IACb,oBAAoB;IACpB,gBAAgB;IAChB,cAAc;IACd,YAAY;IACZ,QAAQ;IACR,gBAAgB;IAChB,SAAS;IACT,SAAS;IACT,SAAS;IACT,aAAa;IACb,wBAAwB;IACxB,WAAW;IACX,QAAQ;AACV;AAEA,SAASC,KAAKC,OAAe;IAC3B,MAAM,IAAIC,QAAQ,gBAAgBD;AACpC;AAEA,SAASE,GAAGC,IAAY,EAAEC,KAAc;IACtC,IAAI,AAAiB,YAAjB,OAAOA,SAAsB,CAACC,OAAO,QAAQ,CAACD,QAChDL,KAAK,GAAGI,KAAK,8CAA8C,EAAEG,OAAOF,OAAO,CAAC,CAAC;IAE/E,OAAOA,QAAQ,IAAI,IAAIA;AACzB;AAEA,SAASG,SAASJ,IAAY,EAAEC,KAAc;IAC5C,IAAI,AAAiB,YAAjB,OAAOA,SAAsBA,AAAiB,OAAjBA,MAAM,IAAI,IAAWL,KAAK,GAAGI,KAAK,4BAA4B,CAAC;IAChG,OAAOC;AACT;AAOO,SAASI,2BACdC,OAA0C,EAC1CC,OAAsCb,4BAA4B;IAElE,IAAI,CAACY,SAAS,OAAOC;IACrB,MAAMC,OAAO,CAACR,OAA+CM,OAAO,CAACN,KAAK;IAC1E,SAASS,GAAMT,IAAY,EAAEC,KAAoB,EAAES,QAAkB;QACnE,IAAIT,AAAUU,WAAVV,OAAqB,OAAOS;QAChC,IAAI,AAAiB,cAAjB,OAAOT,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