frontile 0.18.0 → 0.18.2

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 (155) hide show
  1. package/declarations/-private/get-config.d.ts.map +1 -1
  2. package/declarations/-private/timer.d.ts +3 -3
  3. package/declarations/-private/timer.d.ts.map +1 -1
  4. package/declarations/components/buttons/chip.d.ts +1 -1
  5. package/declarations/components/buttons/chip.d.ts.map +1 -1
  6. package/declarations/components/buttons/close-button.d.ts +2 -2
  7. package/declarations/components/buttons/close-button.d.ts.map +1 -1
  8. package/declarations/components/collections/listbox/item.d.ts +2 -2
  9. package/declarations/components/collections/listbox/item.d.ts.map +1 -1
  10. package/declarations/components/collections/simple-table/column.d.ts +6 -0
  11. package/declarations/components/collections/simple-table/column.d.ts.map +1 -1
  12. package/declarations/components/collections/simple-table/footer.d.ts +2 -1
  13. package/declarations/components/collections/simple-table/footer.d.ts.map +1 -1
  14. package/declarations/components/collections/simple-table/header.d.ts +2 -1
  15. package/declarations/components/collections/simple-table/header.d.ts.map +1 -1
  16. package/declarations/components/collections/simple-table/index.d.ts +1 -1
  17. package/declarations/components/collections/simple-table/index.d.ts.map +1 -1
  18. package/declarations/components/collections/table/checkbox.d.ts +1 -1
  19. package/declarations/components/collections/table/checkbox.d.ts.map +1 -1
  20. package/declarations/components/collections/table/column-visibility.d.ts +2 -2
  21. package/declarations/components/collections/table/column-visibility.d.ts.map +1 -1
  22. package/declarations/components/collections/table/table.d.ts +9 -7
  23. package/declarations/components/collections/table/table.d.ts.map +1 -1
  24. package/declarations/components/forms/autocomplete.d.ts +12 -12
  25. package/declarations/components/forms/checkbox.d.ts +2 -2
  26. package/declarations/components/forms/checkbox.d.ts.map +1 -1
  27. package/declarations/components/forms/date-input/clipboard.d.ts +34 -0
  28. package/declarations/components/forms/date-input/clipboard.d.ts.map +1 -0
  29. package/declarations/components/forms/date-input/date-input.d.ts +93 -0
  30. package/declarations/components/forms/date-input/date-input.d.ts.map +1 -0
  31. package/declarations/components/forms/date-input/segment-group.d.ts +132 -0
  32. package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -0
  33. package/declarations/components/forms/date-input/segments.d.ts +163 -0
  34. package/declarations/components/forms/date-input/segments.d.ts.map +1 -0
  35. package/declarations/components/forms/date-input/types.d.ts +175 -0
  36. package/declarations/components/forms/date-input/types.d.ts.map +1 -0
  37. package/declarations/components/forms/date-input.d.ts +6 -0
  38. package/declarations/components/forms/date-input.d.ts.map +1 -0
  39. package/declarations/components/forms/date-picker/date-picker.d.ts +263 -15
  40. package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
  41. package/declarations/components/forms/date-picker/end-content.d.ts +33 -3
  42. package/declarations/components/forms/date-picker/end-content.d.ts.map +1 -1
  43. package/declarations/components/forms/date-picker/types.d.ts +45 -2
  44. package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
  45. package/declarations/components/forms/date-picker/value.d.ts +21 -5
  46. package/declarations/components/forms/date-picker/value.d.ts.map +1 -1
  47. package/declarations/components/forms/field.d.ts +7 -5
  48. package/declarations/components/forms/field.d.ts.map +1 -1
  49. package/declarations/components/forms/form.d.ts +5 -5
  50. package/declarations/components/forms/form.d.ts.map +1 -1
  51. package/declarations/components/forms/index.d.ts +1 -0
  52. package/declarations/components/forms/index.d.ts.map +1 -1
  53. package/declarations/components/forms/input-otp.d.ts +5 -5
  54. package/declarations/components/forms/input-otp.d.ts.map +1 -1
  55. package/declarations/components/forms/input.d.ts +15 -15
  56. package/declarations/components/forms/input.d.ts.map +1 -1
  57. package/declarations/components/forms/native-select.d.ts +10 -10
  58. package/declarations/components/forms/native-select.d.ts.map +1 -1
  59. package/declarations/components/forms/radio.d.ts +2 -2
  60. package/declarations/components/forms/radio.d.ts.map +1 -1
  61. package/declarations/components/forms/select/select.d.ts +16 -16
  62. package/declarations/components/forms/textarea.d.ts +10 -10
  63. package/declarations/components/forms/textarea.d.ts.map +1 -1
  64. package/declarations/components/navigation/pagination/pagination.d.ts +32 -1
  65. package/declarations/components/navigation/pagination/pagination.d.ts.map +1 -1
  66. package/declarations/components/overlays/overlay.d.ts +4 -4
  67. package/declarations/components/overlays/overlay.d.ts.map +1 -1
  68. package/declarations/components/utilities/avatar.d.ts +35 -2
  69. package/declarations/components/utilities/avatar.d.ts.map +1 -1
  70. package/declarations/components/utilities/collapsible.d.ts +16 -0
  71. package/declarations/components/utilities/collapsible.d.ts.map +1 -1
  72. package/declarations/test-support.d.ts +30 -0
  73. package/declarations/test-support.d.ts.map +1 -1
  74. package/declarations/utils/forms-utils-index.d.ts +1 -1
  75. package/declarations/utils/forms-utils-index.d.ts.map +1 -1
  76. package/declarations/utils/nested-data.d.ts +17 -0
  77. package/declarations/utils/nested-data.d.ts.map +1 -1
  78. package/dist/components/buttons/chip.js.map +1 -1
  79. package/dist/components/buttons/close-button.js +5 -12
  80. package/dist/components/buttons/close-button.js.map +1 -1
  81. package/dist/components/collections/listbox/item.js +4 -11
  82. package/dist/components/collections/listbox/item.js.map +1 -1
  83. package/dist/components/collections/simple-table/column.js +2 -2
  84. package/dist/components/collections/simple-table/column.js.map +1 -1
  85. package/dist/components/collections/simple-table/footer.js +1 -1
  86. package/dist/components/collections/simple-table/footer.js.map +1 -1
  87. package/dist/components/collections/simple-table/header.js +1 -1
  88. package/dist/components/collections/simple-table/header.js.map +1 -1
  89. package/dist/components/collections/simple-table/index.js +1 -1
  90. package/dist/components/collections/simple-table/index.js.map +1 -1
  91. package/dist/components/collections/table/checkbox.js +2 -7
  92. package/dist/components/collections/table/checkbox.js.map +1 -1
  93. package/dist/components/collections/table/column-visibility.js +2 -7
  94. package/dist/components/collections/table/column-visibility.js.map +1 -1
  95. package/dist/components/forms/checkbox.js +4 -12
  96. package/dist/components/forms/checkbox.js.map +1 -1
  97. package/dist/components/forms/date-input/clipboard.js +231 -0
  98. package/dist/components/forms/date-input/clipboard.js.map +1 -0
  99. package/dist/components/forms/date-input/date-input.js +204 -0
  100. package/dist/components/forms/date-input/date-input.js.map +1 -0
  101. package/dist/components/forms/date-input/segment-group.js +292 -0
  102. package/dist/components/forms/date-input/segment-group.js.map +1 -0
  103. package/dist/components/forms/date-input/segments.js +562 -0
  104. package/dist/components/forms/date-input/segments.js.map +1 -0
  105. package/dist/components/forms/date-input/types.js +2 -0
  106. package/dist/components/forms/date-input/types.js.map +1 -0
  107. package/dist/components/forms/date-input.js +4 -0
  108. package/dist/components/forms/date-input.js.map +1 -0
  109. package/dist/components/forms/date-picker/date-picker.js +361 -20
  110. package/dist/components/forms/date-picker/date-picker.js.map +1 -1
  111. package/dist/components/forms/date-picker/end-content.js +17 -4
  112. package/dist/components/forms/date-picker/end-content.js.map +1 -1
  113. package/dist/components/forms/date-picker/value.js +44 -6
  114. package/dist/components/forms/date-picker/value.js.map +1 -1
  115. package/dist/components/forms/field.js +12 -20
  116. package/dist/components/forms/field.js.map +1 -1
  117. package/dist/components/forms/form.js +11 -27
  118. package/dist/components/forms/form.js.map +1 -1
  119. package/dist/components/forms/index.js +5 -2
  120. package/dist/components/forms/index.js.map +1 -1
  121. package/dist/components/forms/input-otp.js +10 -26
  122. package/dist/components/forms/input-otp.js.map +1 -1
  123. package/dist/components/forms/input.js +9 -22
  124. package/dist/components/forms/input.js.map +1 -1
  125. package/dist/components/forms/native-select.js +5 -12
  126. package/dist/components/forms/native-select.js.map +1 -1
  127. package/dist/components/forms/radio.js +4 -12
  128. package/dist/components/forms/radio.js.map +1 -1
  129. package/dist/components/forms/textarea.js +6 -17
  130. package/dist/components/forms/textarea.js.map +1 -1
  131. package/dist/components/navigation/pagination/pagination.js +18 -2
  132. package/dist/components/navigation/pagination/pagination.js.map +1 -1
  133. package/dist/components/notifications/index.js +1 -1
  134. package/dist/components/overlays/overlay.js +8 -21
  135. package/dist/components/overlays/overlay.js.map +1 -1
  136. package/dist/components/utilities/avatar.js +26 -5
  137. package/dist/components/utilities/avatar.js.map +1 -1
  138. package/dist/components/utilities/collapsible.js +47 -3
  139. package/dist/components/utilities/collapsible.js.map +1 -1
  140. package/dist/forms.js +5 -2
  141. package/dist/forms.js.map +1 -1
  142. package/dist/index.js +6 -3
  143. package/dist/index.js.map +1 -1
  144. package/dist/{manager-jDaRVZ5o.js → manager-Dge4r8Vn.js} +9 -19
  145. package/dist/manager-Dge4r8Vn.js.map +1 -0
  146. package/dist/notifications.js +1 -1
  147. package/dist/services/notifications.js +1 -1
  148. package/dist/test-support.js +903 -389
  149. package/dist/test-support.js.map +1 -1
  150. package/dist/utils/forms-utils-index.js +1 -1
  151. package/dist/utils/forms-utils-index.js.map +1 -1
  152. package/dist/utils/nested-data.js +28 -1
  153. package/dist/utils/nested-data.js.map +1 -1
  154. package/package.json +10 -10
  155. package/dist/manager-jDaRVZ5o.js.map +0 -1
@@ -138,6 +138,33 @@ function unflattenData(data) {
138
138
  return result;
139
139
  }
140
140
 
141
+ /**
142
+ * Reads a dotted path (`'profile.email'`) from form data, returning
143
+ * `undefined` as soon as a segment is missing or lands on a non-object.
144
+ *
145
+ * The read-side counterpart of `unflattenData`, and refuses the same unsafe
146
+ * segments: field names are untrusted input, so `'__proto__'` must not reach
147
+ * `Object.prototype`.
148
+ *
149
+ * @example
150
+ * getPath({ profile: { email: 'john@example.com' } }, 'profile.email')
151
+ * // Returns: 'john@example.com'
152
+ *
153
+ * @param data - The data object to read from
154
+ * @param path - A flat key or dotted path
155
+ * @returns The value at `path`, or `undefined`
156
+ */
157
+ function getPath(data, path) {
158
+ let current = data;
159
+ for (const key of path.split('.')) {
160
+ if (current === null || typeof current !== 'object' || isUnsafeKey(key)) {
161
+ return undefined;
162
+ }
163
+ current = current[key];
164
+ }
165
+ return current;
166
+ }
167
+
141
168
  /**
142
169
  * Checks if the data structure contains any nested objects.
143
170
  * If true, we need to handle it as nested data.
@@ -192,5 +219,5 @@ function deepEqual(a, b) {
192
219
  return a === b;
193
220
  }
194
221
 
195
- export { deepEqual, flattenData, hasNestedData, unflattenData };
222
+ export { deepEqual, flattenData, getPath, hasNestedData, unflattenData };
196
223
  //# sourceMappingURL=nested-data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nested-data.js","sources":["../../src/utils/nested-data.ts"],"sourcesContent":["/**\n * Utility functions for working with nested data structures in forms.\n * These functions convert between nested objects and flat dotted-path notation.\n */\n\n/**\n * `File` and `FileList` are browser globals. `FileList` in particular has no\n * counterpart in Node, so a bare `value instanceof FileList` is a hard\n * `ReferenceError` rather than `false` when a Form is server-rendered.\n */\nfunction isFileLike(value: object): boolean {\n return (\n (typeof File !== 'undefined' && value instanceof File) ||\n (typeof FileList !== 'undefined' && value instanceof FileList)\n );\n}\n\n/**\n * Type guard to check if a value is a plain object (not an array, Date, File, etc.)\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n value !== null &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n !(value instanceof Date) &&\n !isFileLike(value)\n );\n}\n\n/**\n * Path segments that are refused as object keys.\n *\n * Field names come from the `name` attribute of the form's controls, which an\n * app may render from a server-supplied schema, a CMS, or URL state — so they\n * are untrusted input.\n *\n * `__proto__` is the real vector: `isPlainObject(Object.prototype)` is `true`,\n * so when the walk below reached a `__proto__` segment it accepted\n * `Object.prototype` as an already-existing nested object instead of creating a\n * fresh one, and the final assignment wrote onto every object in the\n * application.\n *\n * `constructor` and `prototype` do not reach `Object.prototype` through the\n * walk as it is written — `current['constructor']` is a function, which\n * `isPlainObject` rejects, so the walk shadows it with a fresh own key. They\n * are refused anyway, as defense in depth: it keeps form data from shadowing\n * those names, and it means a later change to the walk (or an intermediate that\n * is a plain object with a `constructor` of its own) cannot quietly turn them\n * into live vectors.\n */\nconst UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];\n\n/**\n * Checks a single path segment. Callers refuse the whole entry rather than\n * substituting a safe key, so no partially-built path is left behind.\n */\nfunction isUnsafeKey(key: string): boolean {\n return UNSAFE_KEYS.includes(key);\n}\n\n/**\n * Checks whether a dotted path is safe to materialize. A single unsafe segment\n * anywhere in the path poisons the whole path, so the entry is refused wholesale\n * rather than partially built.\n */\nfunction isSafePath(keys: string[]): boolean {\n return !keys.some(isUnsafeKey);\n}\n\n/**\n * Flattens a nested object into a flat object with dotted-path keys.\n *\n * @example\n * flattenData({name: {first: 'John', last: 'Doe'}, email: 'john@example.com'})\n * // Returns: {'name.first': 'John', 'name.last': 'Doe', 'email': 'john@example.com'}\n *\n * @param data - The nested data object to flatten\n * @param prefix - Internal parameter for recursion (parent path)\n * @returns A flat object with dotted-path keys\n */\nexport function flattenData<T = unknown>(\n data: Record<string, unknown>,\n prefix = ''\n): Record<string, T> {\n const result: Record<string, T> = {};\n\n for (const key in data) {\n if (!Object.prototype.hasOwnProperty.call(data, key)) {\n continue;\n }\n\n // Refuse unsafe keys here too, so a hostile or already-polluted input\n // cannot produce a dotted path that `unflattenData` would have to reject\n // on the way back in.\n if (isUnsafeKey(key)) {\n continue;\n }\n\n const value = data[key];\n const fullPath = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(value)) {\n // Recursively flatten nested objects\n Object.assign(result, flattenData(value, fullPath));\n } else {\n // Store primitive values, arrays, and special objects as-is\n result[fullPath] = value as T;\n }\n }\n\n return result;\n}\n\n/**\n * Unflattens a flat object with dotted-path keys into a nested object structure.\n *\n * @example\n * unflattenData({'name.first': 'John', 'name.last': 'Doe', 'email': 'john@example.com'})\n * // Returns: {name: {first: 'John', last: 'Doe'}, email: 'john@example.com'}\n *\n * @param data - The flat data object with dotted-path keys\n * @returns A nested object structure\n */\nexport function unflattenData<T = unknown>(\n data: Record<string, unknown>\n): Record<string, T> {\n const result: Record<string, unknown> = {};\n\n for (const path in data) {\n if (!Object.prototype.hasOwnProperty.call(data, path)) {\n continue;\n }\n\n const value = data[path];\n const keys = path.split('.');\n\n if (!isSafePath(keys)) {\n continue;\n }\n\n let current = result;\n\n // Navigate/create nested structure\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n if (!key) continue;\n\n if (!isPlainObject(current[key])) {\n current[key] = {};\n }\n current = current[key] as Record<string, unknown>;\n }\n\n // Set the final value\n const lastKey = keys[keys.length - 1];\n if (lastKey) {\n current[lastKey] = value;\n }\n }\n\n return result as Record<string, T>;\n}\n\n/**\n * Checks if the data structure contains any nested objects.\n * If true, we need to handle it as nested data.\n *\n * @param data - The data object to check\n * @returns True if the data contains nested plain objects\n */\nexport function hasNestedData(data: Record<string, unknown>): boolean {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n if (isPlainObject(data[key])) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Deep equality comparison for nested objects.\n * Handles primitives, arrays, and nested objects.\n *\n * @param a - First value to compare\n * @param b - Second value to compare\n * @returns True if values are deeply equal\n */\nexport function deepEqual(a: unknown, b: unknown): boolean {\n // Handle primitives and same reference\n if (a === b) return true;\n\n // Handle null/undefined\n if (a == null || b == null) return a === b;\n\n // Handle different types\n if (typeof a !== typeof b) return false;\n\n // Handle arrays\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n return a.every((item, index) => deepEqual(item, b[index]));\n }\n\n // Handle plain objects\n if (isPlainObject(a) && isPlainObject(b)) {\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n return keysA.every((key) => deepEqual(a[key], b[key]));\n }\n\n // Handle special objects (Date, File, etc.) - compare by reference\n return a === b;\n}\n"],"names":["isFileLike","value","File","FileList","isPlainObject","Array","isArray","Date","UNSAFE_KEYS","isUnsafeKey","key","includes","isSafePath","keys","some","flattenData","data","prefix","result","Object","prototype","hasOwnProperty","call","fullPath","assign","unflattenData","path","split","current","i","length","lastKey","hasNestedData","deepEqual","a","b","every","item","index","keysA","keysB"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAUA,CAACC,KAAa,EAAW;AAC1C,EAAA,OACG,OAAOC,IAAI,KAAK,WAAW,IAAID,KAAK,YAAYC,IAAI,IACpD,OAAOC,QAAQ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AAI,EAAEC,KAAK,KAAKL,SAAS,CAACI,IAAI,EAAEF,CAAC,CAACG,KAAK,CAAC,CAAC,CAAC;AAC5D,EAAA;;AAEA;EACA,IAAIlC,aAAa,CAAC8B,CAAC,CAAC,IAAI9B,aAAa,CAAC+B,CAAC,CAAC,EAAE;AACxC,IAAA,MAAMI,KAAK,GAAGpB,MAAM,CAACN,IAAI,CAACqB,CAAC,CAAC;AAC5B,IAAA,MAAMM,KAAK,GAAGrB,MAAM,CAACN,IAAI,CAACsB,CAAC,CAAC;IAE5B,IAAII,KAAK,CAACT,MAAM,KAAKU,KAAK,CAACV,MAAM,EAAE,OAAO,KAAK;AAE/C,IAAA,OAAOS,KAAK,CAACH,KAAK,CAAE1B,GAAG,IAAKuB,SAAS,CAACC,CAAC,CAACxB,GAAG,CAAC,EAAEyB,CAAC,CAACzB,GAAG,CAAC,CAAC,CAAC;AACxD,EAAA;;AAEA;EACA,OAAOwB,CAAC,KAAKC,CAAC;AAChB;;"}
1
+ {"version":3,"file":"nested-data.js","sources":["../../src/utils/nested-data.ts"],"sourcesContent":["/**\n * Utility functions for working with nested data structures in forms.\n * These functions convert between nested objects and flat dotted-path notation.\n */\n\n/**\n * `File` and `FileList` are browser globals. `FileList` in particular has no\n * counterpart in Node, so a bare `value instanceof FileList` is a hard\n * `ReferenceError` rather than `false` when a Form is server-rendered.\n */\nfunction isFileLike(value: object): boolean {\n return (\n (typeof File !== 'undefined' && value instanceof File) ||\n (typeof FileList !== 'undefined' && value instanceof FileList)\n );\n}\n\n/**\n * Type guard to check if a value is a plain object (not an array, Date, File, etc.)\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n value !== null &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n !(value instanceof Date) &&\n !isFileLike(value)\n );\n}\n\n/**\n * Path segments that are refused as object keys.\n *\n * Field names come from the `name` attribute of the form's controls, which an\n * app may render from a server-supplied schema, a CMS, or URL state — so they\n * are untrusted input.\n *\n * `__proto__` is the real vector: `isPlainObject(Object.prototype)` is `true`,\n * so when the walk below reached a `__proto__` segment it accepted\n * `Object.prototype` as an already-existing nested object instead of creating a\n * fresh one, and the final assignment wrote onto every object in the\n * application.\n *\n * `constructor` and `prototype` do not reach `Object.prototype` through the\n * walk as it is written — `current['constructor']` is a function, which\n * `isPlainObject` rejects, so the walk shadows it with a fresh own key. They\n * are refused anyway, as defense in depth: it keeps form data from shadowing\n * those names, and it means a later change to the walk (or an intermediate that\n * is a plain object with a `constructor` of its own) cannot quietly turn them\n * into live vectors.\n */\nconst UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];\n\n/**\n * Checks a single path segment. Callers refuse the whole entry rather than\n * substituting a safe key, so no partially-built path is left behind.\n */\nfunction isUnsafeKey(key: string): boolean {\n return UNSAFE_KEYS.includes(key);\n}\n\n/**\n * Checks whether a dotted path is safe to materialize. A single unsafe segment\n * anywhere in the path poisons the whole path, so the entry is refused wholesale\n * rather than partially built.\n */\nfunction isSafePath(keys: string[]): boolean {\n return !keys.some(isUnsafeKey);\n}\n\n/**\n * Flattens a nested object into a flat object with dotted-path keys.\n *\n * @example\n * flattenData({name: {first: 'John', last: 'Doe'}, email: 'john@example.com'})\n * // Returns: {'name.first': 'John', 'name.last': 'Doe', 'email': 'john@example.com'}\n *\n * @param data - The nested data object to flatten\n * @param prefix - Internal parameter for recursion (parent path)\n * @returns A flat object with dotted-path keys\n */\nexport function flattenData<T = unknown>(\n data: Record<string, unknown>,\n prefix = ''\n): Record<string, T> {\n const result: Record<string, T> = {};\n\n for (const key in data) {\n if (!Object.prototype.hasOwnProperty.call(data, key)) {\n continue;\n }\n\n // Refuse unsafe keys here too, so a hostile or already-polluted input\n // cannot produce a dotted path that `unflattenData` would have to reject\n // on the way back in.\n if (isUnsafeKey(key)) {\n continue;\n }\n\n const value = data[key];\n const fullPath = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(value)) {\n // Recursively flatten nested objects\n Object.assign(result, flattenData(value, fullPath));\n } else {\n // Store primitive values, arrays, and special objects as-is\n result[fullPath] = value as T;\n }\n }\n\n return result;\n}\n\n/**\n * Unflattens a flat object with dotted-path keys into a nested object structure.\n *\n * @example\n * unflattenData({'name.first': 'John', 'name.last': 'Doe', 'email': 'john@example.com'})\n * // Returns: {name: {first: 'John', last: 'Doe'}, email: 'john@example.com'}\n *\n * @param data - The flat data object with dotted-path keys\n * @returns A nested object structure\n */\nexport function unflattenData<T = unknown>(\n data: Record<string, unknown>\n): Record<string, T> {\n const result: Record<string, unknown> = {};\n\n for (const path in data) {\n if (!Object.prototype.hasOwnProperty.call(data, path)) {\n continue;\n }\n\n const value = data[path];\n const keys = path.split('.');\n\n if (!isSafePath(keys)) {\n continue;\n }\n\n let current = result;\n\n // Navigate/create nested structure\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n if (!key) continue;\n\n if (!isPlainObject(current[key])) {\n current[key] = {};\n }\n current = current[key] as Record<string, unknown>;\n }\n\n // Set the final value\n const lastKey = keys[keys.length - 1];\n if (lastKey) {\n current[lastKey] = value;\n }\n }\n\n return result as Record<string, T>;\n}\n\n/**\n * Reads a dotted path (`'profile.email'`) from form data, returning\n * `undefined` as soon as a segment is missing or lands on a non-object.\n *\n * The read-side counterpart of `unflattenData`, and refuses the same unsafe\n * segments: field names are untrusted input, so `'__proto__'` must not reach\n * `Object.prototype`.\n *\n * @example\n * getPath({ profile: { email: 'john@example.com' } }, 'profile.email')\n * // Returns: 'john@example.com'\n *\n * @param data - The data object to read from\n * @param path - A flat key or dotted path\n * @returns The value at `path`, or `undefined`\n */\nexport function getPath(data: unknown, path: string): unknown {\n let current = data;\n\n for (const key of path.split('.')) {\n if (current === null || typeof current !== 'object' || isUnsafeKey(key)) {\n return undefined;\n }\n\n current = (current as Record<string, unknown>)[key];\n }\n\n return current;\n}\n\n/**\n * Checks if the data structure contains any nested objects.\n * If true, we need to handle it as nested data.\n *\n * @param data - The data object to check\n * @returns True if the data contains nested plain objects\n */\nexport function hasNestedData(data: Record<string, unknown>): boolean {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n if (isPlainObject(data[key])) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Deep equality comparison for nested objects.\n * Handles primitives, arrays, and nested objects.\n *\n * @param a - First value to compare\n * @param b - Second value to compare\n * @returns True if values are deeply equal\n */\nexport function deepEqual(a: unknown, b: unknown): boolean {\n // Handle primitives and same reference\n if (a === b) return true;\n\n // Handle null/undefined\n if (a == null || b == null) return a === b;\n\n // Handle different types\n if (typeof a !== typeof b) return false;\n\n // Handle arrays\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n return a.every((item, index) => deepEqual(item, b[index]));\n }\n\n // Handle plain objects\n if (isPlainObject(a) && isPlainObject(b)) {\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n return keysA.every((key) => deepEqual(a[key], b[key]));\n }\n\n // Handle special objects (Date, File, etc.) - compare by reference\n return a === b;\n}\n"],"names":["isFileLike","value","File","FileList","isPlainObject","Array","isArray","Date","UNSAFE_KEYS","isUnsafeKey","key","includes","isSafePath","keys","some","flattenData","data","prefix","result","Object","prototype","hasOwnProperty","call","fullPath","assign","unflattenData","path","split","current","i","length","lastKey","getPath","undefined","hasNestedData","deepEqual","a","b","every","item","index","keysA","keysB"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAUA,CAACC,KAAa,EAAW;AAC1C,EAAA,OACG,OAAOC,IAAI,KAAK,WAAW,IAAID,KAAK,YAAYC,IAAI,IACpD,OAAOC,QAAQ,KAAK,WAAW,IAAIF,KAAK,YAAYE,QAAS;AAElE;;AAEA;AACA;AACA;AACA,SAASC,aAAaA,CAACH,KAAc,EAAoC;EACvE,OACEA,KAAK,KAAK,IAAI,IACd,OAAOA,KAAK,KAAK,QAAQ,IACzB,CAACI,KAAK,CAACC,OAAO,CAACL,KAAK,CA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AAK,OAAOC,CAAC,EAAE,OAAO,KAAK;;AAEvC;AACA,EAAA,IAAIhC,KAAK,CAACC,OAAO,CAAC8B,CAAC,CAAC,IAAI/B,KAAK,CAACC,OAAO,CAAC+B,CAAC,CAAC,EAAE;IACxC,IAAID,CAAC,CAACN,MAAM,KAAKO,CAAC,CAACP,MAAM,EAAE,OAAO,KAAK;AACvC,IAAA,OAAOM,CAAC,CAACE,KAAK,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAKL,SAAS,CAACI,IAAI,EAAEF,CAAC,CAACG,KAAK,CAAC,CAAC,CAAC;AAC5D,EAAA;;AAEA;EACA,IAAIpC,aAAa,CAACgC,CAAC,CAAC,IAAIhC,aAAa,CAACiC,CAAC,CAAC,EAAE;AACxC,IAAA,MAAMI,KAAK,GAAGtB,MAAM,CAACN,IAAI,CAACuB,CAAC,CAAC;AAC5B,IAAA,MAAMM,KAAK,GAAGvB,MAAM,CAACN,IAAI,CAACwB,CAAC,CAAC;IAE5B,IAAII,KAAK,CAACX,MAAM,KAAKY,KAAK,CAACZ,MAAM,EAAE,OAAO,KAAK;AAE/C,IAAA,OAAOW,KAAK,CAACH,KAAK,CAAE5B,GAAG,IAAKyB,SAAS,CAACC,CAAC,CAAC1B,GAAG,CAAC,EAAE2B,CAAC,CAAC3B,GAAG,CAAC,CAAC,CAAC;AACxD,EAAA;;AAEA;EACA,OAAO0B,CAAC,KAAKC,CAAC;AAChB;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontile",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "description": "Component Library for Ember Octane apps",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -94,7 +94,7 @@
94
94
  "@embroider/addon-shim": "^1.10.3",
95
95
  "@embroider/macros": "^1.21.1",
96
96
  "@floating-ui/dom": "^1.8.0",
97
- "@frontile/theme": "^0.18.0",
97
+ "@frontile/theme": "^0.18.2",
98
98
  "@glint/template": "^1.9.0",
99
99
  "@universal-ember/table": "^4.0.0",
100
100
  "date-fns": "^4.4.0",
@@ -113,20 +113,20 @@
113
113
  "devDependencies": {
114
114
  "@babel/core": "7.26.7",
115
115
  "@babel/plugin-transform-typescript": "^7.29.7",
116
- "@ember/library-tsconfig": "^2.0.0",
117
- "@ember/test-helpers": "^5.4.3",
118
- "@embroider/addon-dev": "8.4.0",
116
+ "@ember/library-tsconfig": "^3.0.0",
117
+ "@ember/test-helpers": "^5.7.0",
118
+ "@embroider/addon-dev": "8.4.2",
119
119
  "@glimmer/component": "^2.1.1",
120
120
  "@glimmer/tracking": "^1.1.2",
121
- "@glint/ember-tsc": "^1.11.4",
121
+ "@glint/ember-tsc": "^1.11.6",
122
122
  "@rollup/plugin-babel": "^7.1.0",
123
123
  "@rollup/plugin-node-resolve": "^16.0.3",
124
124
  "@standard-schema/spec": "^1.1.0",
125
- "babel-plugin-ember-template-compilation": "^4.0.0",
126
- "concurrently": "^10.0.5",
125
+ "babel-plugin-ember-template-compilation": "^4.0.1",
126
+ "concurrently": "^10.0.6",
127
127
  "decorator-transforms": "^2.4.0",
128
128
  "ember-source": "^7.3.0",
129
- "rollup": "^4.63.3",
129
+ "rollup": "^4.64.5",
130
130
  "rollup-plugin-copy": "^3.5.0",
131
131
  "tailwindcss": "^4.3.3",
132
132
  "typescript": "^6.0.3"
@@ -152,5 +152,5 @@
152
152
  "./services/notifications.js": "./dist/_app_/services/notifications.js"
153
153
  }
154
154
  },
155
- "gitHead": "01c5a190c6888b5bb159eba96888663010592a1f"
155
+ "gitHead": "67c9ad81910629f0caf86a086585730f46c38dcf"
156
156
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager-jDaRVZ5o.js","sources":["../src/-private/timer.ts","../src/-private/get-config.ts","../src/-private/notification.ts","../src/-private/manager.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport { later, cancel } from '@ember/runloop';\nimport type { Timer as EmberTimer } from '@ember/runloop';\nimport { action } from '@ember/object';\n\nexport default class Timer {\n @tracked remaining: number;\n @tracked isRunning = true;\n\n readonly onFinish: () => void;\n private timer?: EmberTimer;\n private start!: number;\n\n constructor(duration: number, onFinish: () => void) {\n this.remaining = duration;\n this.onFinish = onFinish;\n this.setup();\n }\n\n @action clear(): void {\n this.isRunning = false;\n\n if (this.timer) {\n cancel(this.timer);\n }\n }\n\n @action pause(): void {\n // Pausing an already paused timer would subtract the elapsed time twice,\n // eventually driving `remaining` to zero or below.\n if (!this.isRunning) {\n return;\n }\n\n this.clear();\n this.remaining = Math.max(0, this.remaining - (Date.now() - this.start));\n }\n\n @action resume(): void {\n // Already counting down; resuming again would restart the remaining time.\n if (this.isRunning) {\n return;\n }\n\n this.clear();\n this.setup();\n }\n\n private setup(): void {\n this.start = Date.now();\n this.isRunning = true;\n\n this.timer = later(\n this,\n () => {\n this.onFinish();\n this.isRunning = false;\n },\n this.remaining\n );\n }\n}\n","import { get } from '@ember/object';\nimport type { DefaultConfig } from './types';\n\nexport function getConfigOption<T extends keyof DefaultConfig>(\n config: DefaultConfig,\n key: T,\n defaultValue: NonNullable<DefaultConfig[T]>\n): NonNullable<DefaultConfig[T]> {\n const value = get(config, key);\n\n if (value === undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","import { tracked } from '@glimmer/tracking';\nimport { deprecate } from '@ember/debug';\nimport Timer from './timer';\nimport { getConfigOption } from './get-config';\nimport type {\n NotificationOptions,\n NotificationContent,\n NotificationStatus,\n NotificationAppearance,\n NotificationUpdate,\n CustomAction,\n DefaultConfig\n} from './types';\n\n/**\n * Normalise the two content forms into `{ title, description }`.\n */\nfunction toContent(content: string | NotificationContent): NotificationContent {\n return typeof content === 'string' ? { title: content } : content;\n}\n\n/**\n * Emit the shared deprecation notice and remap `error` onto `danger`. Used\n * for both the option-level and config-level `appearance` fallbacks in\n * `resolveStatus`, which must apply the same remap.\n */\nfunction mapAppearance(appearance: NotificationAppearance): NotificationStatus {\n deprecate(\n 'The `appearance` option for notifications is deprecated. Use `status` instead, and `danger` in place of `error`.',\n false,\n {\n id: 'frontile.notification-appearance',\n until: '0.19.0',\n for: 'frontile',\n since: { available: '0.18.0', enabled: '0.18.0' }\n }\n );\n\n if (appearance === 'error') return 'danger';\n // `info` folded into `primary` when the axis became `status`.\n if (appearance === 'info') return 'primary';\n\n return appearance;\n}\n\n/**\n * Resolve the notification status from the current option, the deprecated\n * `appearance` option, and the app config, in that order.\n */\nfunction resolveStatus(\n config: DefaultConfig,\n options: NotificationOptions\n): NotificationStatus {\n if (options.status) {\n return options.status;\n }\n\n if (options.appearance) {\n return mapAppearance(options.appearance);\n }\n\n if (config.status) {\n return config.status;\n }\n\n if (config.appearance) {\n return mapAppearance(config.appearance);\n }\n\n // `config.status`/`config.appearance` were already read directly above, so\n // there is no distinct config lookup left to fall back to.\n return 'neutral';\n}\n\nexport default class Notification<\n TMetadata extends Record<string, unknown> = Record<string, unknown>\n> {\n /**\n * The title of the notification. Named `message` for backwards\n * compatibility with the original single-string API.\n */\n @tracked message: string;\n @tracked description?: string;\n @tracked status: NotificationStatus;\n @tracked allowClosing: boolean;\n @tracked isLoading: boolean;\n @tracked customActions?: CustomAction[];\n @tracked timer?: Timer;\n @tracked isRemoving = false;\n\n readonly transitionDuration: number;\n readonly duration: number;\n readonly hideIcon: boolean;\n readonly metadata?: TMetadata;\n\n constructor(\n config: DefaultConfig,\n content: string | NotificationContent,\n options: NotificationOptions<TMetadata> = {}\n ) {\n const { title, description } = toContent(content);\n\n this.message = title;\n // An object content form owns the description outright; the option is only\n // a convenience for the string form.\n this.description =\n typeof content === 'string' ? options.description : description;\n this.status = resolveStatus(config, options);\n this.isLoading = options.isLoading === true;\n this.hideIcon = options.hideIcon === true;\n this.customActions = options.customActions;\n this.duration =\n options.duration || getConfigOption(config, 'duration', 5000);\n this.transitionDuration =\n typeof options.transitionDuration !== 'undefined'\n ? options.transitionDuration\n : getConfigOption(config, 'transitionDuration', 200);\n this.metadata = options.metadata;\n this.allowClosing = options.allowClosing !== false;\n }\n\n /** Read-only alias of `message` — do not add a setter. */\n get title(): string {\n return this.message;\n }\n\n /**\n * @deprecated Read `status` instead.\n *\n * The return type is widened to include `'default'` because `default` is\n * new vocabulary introduced alongside this getter's deprecation — it has\n * no equivalent in the old `NotificationAppearance` names, so mapping it\n * onto `'info'` here would silently lie about the notification's status.\n * Everything else keeps the old four-value shape.\n */\n get appearance(): 'default' | 'info' | 'success' | 'warning' | 'error' {\n if (this.status === 'danger') return 'error';\n if (this.status === 'neutral') return 'default';\n if (this.status === 'primary') return 'info';\n\n return this.status;\n }\n\n /**\n * Mutate the notification in place. Used by `promise()` so a settling\n * promise swaps the content of the toast already on screen rather than\n * replacing it with a new one.\n */\n update(changes: NotificationUpdate): void {\n if (typeof changes.title !== 'undefined') {\n this.message = changes.title;\n }\n\n if (typeof changes.description !== 'undefined') {\n this.description = changes.description;\n }\n\n if (typeof changes.status !== 'undefined') {\n this.status = changes.status;\n }\n\n if (typeof changes.allowClosing !== 'undefined') {\n this.allowClosing = changes.allowClosing;\n }\n\n if (typeof changes.isLoading !== 'undefined') {\n this.isLoading = changes.isLoading;\n }\n }\n\n remove(): void {\n this.isRemoving = true;\n\n if (this.timer) {\n this.timer.clear();\n }\n }\n}\n","import Notification from './notification';\nimport Timer from './timer';\nimport { tracked } from '@glimmer/tracking';\nimport { assert } from '@ember/debug';\nimport { getConfigOption } from './get-config';\nimport { getOwner } from '@ember/owner';\nimport { isDestroyed } from '@ember/destroyable';\nimport { later } from '@ember/runloop';\nimport type Owner from '@ember/owner';\nimport type {\n DefaultConfig,\n NotificationOptions,\n NotificationContent,\n NotificationStatus,\n PromiseMessage,\n PromiseNotificationOptions\n} from './types';\n\nfunction resolveMessage<T>(\n message: PromiseMessage<T>,\n value: T\n): NotificationContent {\n const resolved = typeof message === 'function' ? message(value) : message;\n return typeof resolved === 'string' ? { title: resolved } : resolved;\n}\n\n/**\n * Whether a notification should get an auto-removal timer, given its own\n * `preserve` option and the manager's config. An explicit `preserve` wins;\n * otherwise the config's `preserve` default applies. Either way, a\n * config-level `skipTimer: true` forces preservation — there's no timer to\n * skip if the notification is never auto-removed in the first place.\n *\n * Shared by `add()` and `promise()`'s settle path, which must apply this\n * decision identically.\n */\nfunction shouldAutoRemove(\n config: DefaultConfig,\n preserveOption: boolean | undefined\n): boolean {\n const preserve =\n typeof preserveOption === 'undefined'\n ? getConfigOption(config, 'preserve', false)\n : preserveOption;\n\n if (getConfigOption(config, 'skipTimer', false) === true) {\n return false;\n }\n\n return preserve === false;\n}\n\nexport default class NotificationsManager {\n @tracked notifications: Notification<Record<string, unknown>>[] = [];\n\n config: DefaultConfig = {};\n onRemove?: (notification: Notification<Record<string, unknown>>) => void;\n\n constructor(\n context: object,\n onRemove?: (notification: Notification<Record<string, unknown>>) => void\n ) {\n if (isDestroyed(context)) {\n return;\n }\n const owner = getOwner(context) as Owner;\n assert('NotificationsManager context must have an owner', owner);\n const configFactory = owner.factoryFor('config:environment');\n\n if (configFactory && configFactory.class) {\n this.config =\n (configFactory.class as never)['@frontile/notifications'] || {};\n }\n\n this.onRemove = onRemove;\n }\n\n add<TMetadata extends Record<string, unknown> = Record<string, unknown>>(\n content: string | NotificationContent,\n options: NotificationOptions<TMetadata> = {}\n ): Notification<TMetadata> {\n const notification = new Notification<TMetadata>(\n this.config,\n content,\n options\n );\n this.notifications = [...this.notifications, notification];\n\n if (shouldAutoRemove(this.config, options.preserve)) {\n this.setupAutoRemoval(notification, notification.duration);\n }\n return notification;\n }\n\n /**\n * Show a notification driven by a promise: a spinner while pending, then\n * the same notification mutated in place once it settles.\n *\n * Returns the original promise, so callers can still await it — and are\n * still responsible for handling its rejection.\n */\n promise<\n T,\n TMetadata extends Record<string, unknown> = Record<string, unknown>\n >(\n promise: Promise<T>,\n options: PromiseNotificationOptions<T, TMetadata>\n ): Promise<T> {\n const { loading, success, error, ...rest } = options;\n\n const notification = this.add<TMetadata>(loading, {\n ...(rest as NotificationOptions<TMetadata>),\n preserve: true,\n allowClosing: false,\n isLoading: true\n });\n\n const settle = (\n content: NotificationContent,\n status: NotificationStatus\n ) => {\n // The user may have dismissed the toast before the promise settled; in\n // that case there is nothing left to update.\n if (notification.isRemoving) {\n return;\n }\n\n notification.update({\n ...content,\n // `update()` treats an absent key as \"leave this field alone\" (that\n // distinction is load-bearing elsewhere), so a settle message with\n // no description must still pass an explicit empty string here —\n // otherwise `resolveMessage`'s string-form `{ title }` (no\n // `description` key at all) would leave the loading phase's stale\n // description on screen instead of clearing it.\n description: content.description ?? '',\n status,\n allowClosing: true,\n isLoading: false\n });\n\n // `preserve: true` forces the loading phase to skip auto-dismissal\n // (there's nothing useful to time out on a spinner), but the docs\n // promise every option except `isLoading` carries through to the\n // settled notification — so a caller's own `preserve` must still be\n // honored here, not silently overridden by the loading phase's.\n if (shouldAutoRemove(this.config, rest.preserve)) {\n this.setupAutoRemoval(notification, notification.duration);\n }\n };\n\n promise.then(\n (value) => settle(resolveMessage(success, value), 'success'),\n (reason) => settle(resolveMessage(error, reason), 'danger')\n );\n\n return promise;\n }\n\n remove(notification?: Notification<Record<string, unknown>>): void {\n // Removal is single-shot: a notification already on its way out must not\n // schedule a second removal, otherwise `onRemove` is called twice for it.\n if (!notification || notification.isRemoving) {\n return;\n }\n\n notification.remove();\n\n // The unmount is timed to `transitionDuration` (default 200ms), which\n // governs the card's exit *opacity* fade. The exit *slide/scale*\n // transform, however, runs at a fixed 400ms (see notificationCard's\n // theme slots) independent of `transitionDuration`. At the defaults this\n // is invisible only because the opacity reaches 0 at the same moment the\n // card unmounts, hiding the fact that the slide is truncated mid-flight.\n // If the opacity duration is ever decoupled from this unmount timer (or\n // `transitionDuration` is changed without also revisiting the transform\n // duration), cards will visibly disappear mid-slide instead of fading\n // out cleanly. Keep the two in sync, or make the unmount wait for the\n // longer of the two durations.\n later(\n this,\n () => {\n this.notifications = this.notifications.filter((n) => {\n return n !== notification;\n });\n\n // Call the onRemove callback after the notification is actually removed\n if (this.onRemove) {\n this.onRemove(notification);\n }\n },\n notification.transitionDuration\n );\n }\n\n removeAll(): void {\n this.notifications.forEach((notification) => {\n this.remove(notification);\n });\n }\n\n private setupAutoRemoval(\n notification: Notification<Record<string, unknown>>,\n duration: number\n ): void {\n notification.timer = new Timer(duration, () => {\n this.remove(notification);\n });\n }\n}\n"],"names":["Timer","g","prototype","tracked","i","onFinish","timer","start","constructor","duration","remaining","setup","clear","isRunning","cancel","n","action","pause","Math","max","Date","now","resume","later","getConfigOption","config","key","defaultValue","value","get","undefined","toContent","content","title","mapAppearance","appearance","deprecate","id","until","for","since","available","enabled","resolveStatus","options","status","Notification","transitionDuration","hideIcon","metadata","description","message","isLoading","customActions","allowClosing","update","changes","remove","isRemoving","resolveMessage","resolved","shouldAutoRemove","preserveOption","preserve","NotificationsManager","onRemove","context","isDestroyed","owner","getOwner","assert","configFactory","factoryFor","class","add","notification","notifications","setupAutoRemoval","promise","loading","success","error","rest","settle","then","reason","filter","removeAll","forEach"],"mappings":";;;;;;;;AAKe,MAAMA,KAAK,CAAC;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACxBC,OAAO,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACPC,OAAO,CAAA,EAAA,YAAA;AAAA,MAAA,OAAa,IAAI;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;EAEhBC,QAAQ;EACTC,KAAK;EACLC,KAAK;AAEbC,EAAAA,WAAWA,CAACC,QAAgB,EAAEJ,QAAoB,EAAE;IAClD,IAAI,CAACK,SAAS,GAAGD,QAAQ;IACzB,IAAI,CAACJ,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACM,KAAK,EAAE;AACd,EAAA;AAEQC,EAAAA,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