@searchcraft/javascript-sdk 0.4.0 → 0.4.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 (183) hide show
  1. package/README.md +3 -4
  2. package/dist/cjs/{index-c8a8e492.js → index-6916cc47.js} +2 -1
  3. package/dist/cjs/index-6916cc47.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +2 -2
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/{package-ccc7e307.js → package-2005293c.js} +2 -2
  7. package/dist/cjs/package-2005293c.js.map +1 -0
  8. package/dist/cjs/searchcraft-auto-search-form.cjs.entry.js +27 -44
  9. package/dist/cjs/searchcraft-auto-search-form.cjs.entry.js.map +1 -1
  10. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +3 -3
  11. package/dist/cjs/searchcraft-base-search-result.cjs.entry.js +2 -2
  12. package/dist/cjs/searchcraft-base-search-results.cjs.entry.js +10 -30
  13. package/dist/cjs/searchcraft-base-search-results.cjs.entry.js.map +1 -1
  14. package/dist/cjs/searchcraft-button-icon.cjs.entry.js +1 -1
  15. package/dist/cjs/searchcraft-button.cjs.entry.js +1 -1
  16. package/dist/cjs/searchcraft-check-icon_2.cjs.entry.js +1 -1
  17. package/dist/cjs/searchcraft-clear-icon-set.cjs.entry.js +1 -1
  18. package/dist/cjs/searchcraft-error-message_3.cjs.entry.js +2 -2
  19. package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js +91 -38
  20. package/dist/cjs/searchcraft-facet-list_3.cjs.entry.js.map +1 -1
  21. package/dist/cjs/searchcraft-filter-panel.cjs.entry.js +7 -26
  22. package/dist/cjs/searchcraft-filter-panel.cjs.entry.js.map +1 -1
  23. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +2 -2
  24. package/dist/cjs/searchcraft-results-info.cjs.entry.js +3 -3
  25. package/dist/cjs/searchcraft-search-icon-set.cjs.entry.js +1 -1
  26. package/dist/cjs/searchcraft-spinner-dark.cjs.entry.js +1 -1
  27. package/dist/cjs/searchcraft-spinner-light.cjs.entry.js +1 -1
  28. package/dist/cjs/{store-72205332.js → store-afa727af.js} +11 -5
  29. package/dist/cjs/{store-72205332.js.map → store-afa727af.js.map} +1 -1
  30. package/dist/cjs/{utils-4ee2b88d.js → utils-a17279a2.js} +81 -24
  31. package/dist/cjs/utils-a17279a2.js.map +1 -0
  32. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +35 -50
  33. package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +1 -1
  34. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +19 -39
  35. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
  36. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js +51 -20
  37. package/dist/collection/components/searchcraft-facet-list/searchcraft-facet-list.js.map +1 -1
  38. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js +16 -34
  39. package/dist/collection/components/searchcraft-filter-panel/searchcraft-filter-panel.js.map +1 -1
  40. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js +23 -15
  41. package/dist/collection/components/searchcraft-slider/searchcraft-slider.js.map +1 -1
  42. package/dist/collection/components/searchcraft-slider/searchcraft-slider.module.css +11 -11
  43. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js +21 -3
  44. package/dist/collection/components/searchcraft-toggle-button/searchcraft-toggle-button.js.map +1 -1
  45. package/dist/collection/provider/store.js +10 -4
  46. package/dist/collection/provider/store.js.map +1 -1
  47. package/dist/collection/types/searchcraft-base-search-results.types.js.map +1 -1
  48. package/dist/collection/utils/utils.js +80 -23
  49. package/dist/collection/utils/utils.js.map +1 -1
  50. package/dist/components/index.js +2 -2
  51. package/dist/components/{p-8062f0ea.js → p-0468a9eb.js} +2 -2
  52. package/dist/components/{p-8062f0ea.js.map → p-0468a9eb.js.map} +1 -1
  53. package/dist/components/{p-be63dcac.js → p-3c181808.js} +11 -5
  54. package/dist/components/{p-be63dcac.js.map → p-3c181808.js.map} +1 -1
  55. package/dist/components/{p-e3c8b1ef.js → p-3e8d3586.js} +26 -18
  56. package/dist/components/p-3e8d3586.js.map +1 -0
  57. package/dist/components/{p-b1a59f07.js → p-415f7b11.js} +2 -2
  58. package/dist/components/{p-b1a59f07.js.map → p-415f7b11.js.map} +1 -1
  59. package/dist/components/{p-68897c11.js → p-7bb734f3.js} +54 -23
  60. package/dist/components/p-7bb734f3.js.map +1 -0
  61. package/dist/components/{p-ebf021b5.js → p-9b9df0ca.js} +22 -4
  62. package/dist/components/p-9b9df0ca.js.map +1 -0
  63. package/dist/components/{p-69eed21e.js → p-c994d722.js} +2 -2
  64. package/dist/components/p-c994d722.js.map +1 -0
  65. package/dist/components/{p-0deddac7.js → p-f308d05d.js} +81 -24
  66. package/dist/components/p-f308d05d.js.map +1 -0
  67. package/dist/components/searchcraft-auto-search-form.js +29 -47
  68. package/dist/components/searchcraft-auto-search-form.js.map +1 -1
  69. package/dist/components/searchcraft-base-search-form.js +3 -3
  70. package/dist/components/searchcraft-base-search-result.js +1 -1
  71. package/dist/components/searchcraft-base-search-results.js +12 -35
  72. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  73. package/dist/components/searchcraft-facet-list.js +1 -1
  74. package/dist/components/searchcraft-filter-panel.js +11 -33
  75. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  76. package/dist/components/searchcraft-input.js +1 -1
  77. package/dist/components/searchcraft-results-info.js +2 -2
  78. package/dist/components/searchcraft-slider.js +1 -1
  79. package/dist/components/searchcraft-toggle-button.js +1 -1
  80. package/dist/esm/{index-88dc5f88.js → index-921fe029.js} +2 -2
  81. package/dist/esm/index-921fe029.js.map +1 -0
  82. package/dist/esm/index.js +2 -2
  83. package/dist/esm/loader.js +3 -3
  84. package/dist/esm/{package-ee16f835.js → package-07f53086.js} +2 -2
  85. package/dist/esm/package-07f53086.js.map +1 -0
  86. package/dist/esm/searchcraft-auto-search-form.entry.js +27 -44
  87. package/dist/esm/searchcraft-auto-search-form.entry.js.map +1 -1
  88. package/dist/esm/searchcraft-base-search-form.entry.js +3 -3
  89. package/dist/esm/searchcraft-base-search-result.entry.js +2 -2
  90. package/dist/esm/searchcraft-base-search-results.entry.js +10 -30
  91. package/dist/esm/searchcraft-base-search-results.entry.js.map +1 -1
  92. package/dist/esm/searchcraft-button-icon.entry.js +1 -1
  93. package/dist/esm/searchcraft-button.entry.js +1 -1
  94. package/dist/esm/searchcraft-check-icon_2.entry.js +1 -1
  95. package/dist/esm/searchcraft-clear-icon-set.entry.js +1 -1
  96. package/dist/esm/searchcraft-error-message_3.entry.js +2 -2
  97. package/dist/esm/searchcraft-facet-list_3.entry.js +91 -38
  98. package/dist/esm/searchcraft-facet-list_3.entry.js.map +1 -1
  99. package/dist/esm/searchcraft-filter-panel.entry.js +7 -26
  100. package/dist/esm/searchcraft-filter-panel.entry.js.map +1 -1
  101. package/dist/esm/searchcraft-javascript-sdk.js +3 -3
  102. package/dist/esm/searchcraft-results-info.entry.js +3 -3
  103. package/dist/esm/searchcraft-search-icon-set.entry.js +1 -1
  104. package/dist/esm/searchcraft-spinner-dark.entry.js +1 -1
  105. package/dist/esm/searchcraft-spinner-light.entry.js +1 -1
  106. package/dist/esm/{store-52436995.js → store-8d82e948.js} +11 -5
  107. package/dist/esm/{store-52436995.js.map → store-8d82e948.js.map} +1 -1
  108. package/dist/esm/{utils-89a02921.js → utils-c2ce411f.js} +81 -24
  109. package/dist/esm/utils-c2ce411f.js.map +1 -0
  110. package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
  111. package/dist/searchcraft-javascript-sdk/{p-9647ae41.entry.js → p-1720b612.entry.js} +2 -2
  112. package/dist/searchcraft-javascript-sdk/{p-f4612b94.entry.js → p-3292e706.entry.js} +2 -2
  113. package/dist/searchcraft-javascript-sdk/p-491ae071.entry.js +2 -0
  114. package/dist/searchcraft-javascript-sdk/p-491ae071.entry.js.map +1 -0
  115. package/dist/searchcraft-javascript-sdk/{p-bf80bbee.entry.js → p-4a2d1f44.entry.js} +2 -2
  116. package/dist/searchcraft-javascript-sdk/p-676e2eef.entry.js +2 -0
  117. package/dist/searchcraft-javascript-sdk/p-676e2eef.entry.js.map +1 -0
  118. package/dist/searchcraft-javascript-sdk/{p-4c32c87d.js → p-80e3f29f.js} +2 -2
  119. package/dist/searchcraft-javascript-sdk/{p-4c32c87d.js.map → p-80e3f29f.js.map} +1 -1
  120. package/dist/searchcraft-javascript-sdk/{p-93e9de71.entry.js → p-83a074b6.entry.js} +2 -2
  121. package/dist/searchcraft-javascript-sdk/p-8a9b0762.entry.js +2 -0
  122. package/dist/searchcraft-javascript-sdk/{p-acc645c7.entry.js.map → p-8a9b0762.entry.js.map} +1 -1
  123. package/dist/searchcraft-javascript-sdk/{p-bb03e946.js → p-a2801518.js} +2 -2
  124. package/dist/searchcraft-javascript-sdk/p-a2801518.js.map +1 -0
  125. package/dist/searchcraft-javascript-sdk/{p-343adbe3.entry.js → p-a56af0b0.entry.js} +2 -2
  126. package/dist/searchcraft-javascript-sdk/p-a56af0b0.entry.js.map +1 -0
  127. package/dist/searchcraft-javascript-sdk/{p-4278ff89.entry.js → p-bcc68b15.entry.js} +2 -2
  128. package/dist/searchcraft-javascript-sdk/{p-7c59b3cd.entry.js → p-c70b31ae.entry.js} +2 -2
  129. package/dist/searchcraft-javascript-sdk/{p-69eed21e.js → p-c994d722.js} +2 -2
  130. package/dist/searchcraft-javascript-sdk/p-d08d0b15.entry.js +2 -0
  131. package/dist/searchcraft-javascript-sdk/p-d08d0b15.entry.js.map +1 -0
  132. package/dist/searchcraft-javascript-sdk/{p-3a2d9be9.entry.js → p-d4a7d8bd.entry.js} +2 -2
  133. package/dist/searchcraft-javascript-sdk/{p-69f64bdd.entry.js → p-e8a96dca.entry.js} +2 -2
  134. package/dist/searchcraft-javascript-sdk/{p-08bd95f1.entry.js → p-efb41d6d.entry.js} +2 -2
  135. package/dist/searchcraft-javascript-sdk/p-f308d05d.js +2 -0
  136. package/dist/searchcraft-javascript-sdk/p-f308d05d.js.map +1 -0
  137. package/dist/searchcraft-javascript-sdk/{p-a613a6ba.entry.js → p-fb239507.entry.js} +2 -2
  138. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
  139. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  140. package/dist/types/components/searchcraft-auto-search-form/searchcraft-auto-search-form.d.ts +5 -5
  141. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +1 -6
  142. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +4 -1
  143. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +3 -6
  144. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +4 -6
  145. package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +4 -0
  146. package/dist/types/components.d.ts +10 -6
  147. package/dist/types/provider/store.d.ts +0 -5
  148. package/dist/types/types/searchcraft-base-search-results.types.d.ts +1 -1
  149. package/dist/types/utils/utils.d.ts +1 -1
  150. package/package.json +1 -1
  151. package/dist/cjs/index-c8a8e492.js.map +0 -1
  152. package/dist/cjs/package-ccc7e307.js.map +0 -1
  153. package/dist/cjs/utils-4ee2b88d.js.map +0 -1
  154. package/dist/components/p-0deddac7.js.map +0 -1
  155. package/dist/components/p-68897c11.js.map +0 -1
  156. package/dist/components/p-69eed21e.js.map +0 -1
  157. package/dist/components/p-e3c8b1ef.js.map +0 -1
  158. package/dist/components/p-ebf021b5.js.map +0 -1
  159. package/dist/esm/index-88dc5f88.js.map +0 -1
  160. package/dist/esm/package-ee16f835.js.map +0 -1
  161. package/dist/esm/utils-89a02921.js.map +0 -1
  162. package/dist/searchcraft-javascript-sdk/p-0deddac7.js +0 -2
  163. package/dist/searchcraft-javascript-sdk/p-0deddac7.js.map +0 -1
  164. package/dist/searchcraft-javascript-sdk/p-15f9891d.entry.js +0 -2
  165. package/dist/searchcraft-javascript-sdk/p-15f9891d.entry.js.map +0 -1
  166. package/dist/searchcraft-javascript-sdk/p-2419a8c5.entry.js +0 -2
  167. package/dist/searchcraft-javascript-sdk/p-2419a8c5.entry.js.map +0 -1
  168. package/dist/searchcraft-javascript-sdk/p-343adbe3.entry.js.map +0 -1
  169. package/dist/searchcraft-javascript-sdk/p-56413bef.entry.js +0 -2
  170. package/dist/searchcraft-javascript-sdk/p-56413bef.entry.js.map +0 -1
  171. package/dist/searchcraft-javascript-sdk/p-acc645c7.entry.js +0 -2
  172. package/dist/searchcraft-javascript-sdk/p-bb03e946.js.map +0 -1
  173. /package/dist/searchcraft-javascript-sdk/{p-9647ae41.entry.js.map → p-1720b612.entry.js.map} +0 -0
  174. /package/dist/searchcraft-javascript-sdk/{p-f4612b94.entry.js.map → p-3292e706.entry.js.map} +0 -0
  175. /package/dist/searchcraft-javascript-sdk/{p-bf80bbee.entry.js.map → p-4a2d1f44.entry.js.map} +0 -0
  176. /package/dist/searchcraft-javascript-sdk/{p-93e9de71.entry.js.map → p-83a074b6.entry.js.map} +0 -0
  177. /package/dist/searchcraft-javascript-sdk/{p-4278ff89.entry.js.map → p-bcc68b15.entry.js.map} +0 -0
  178. /package/dist/searchcraft-javascript-sdk/{p-7c59b3cd.entry.js.map → p-c70b31ae.entry.js.map} +0 -0
  179. /package/dist/searchcraft-javascript-sdk/{p-69eed21e.js.map → p-c994d722.js.map} +0 -0
  180. /package/dist/searchcraft-javascript-sdk/{p-3a2d9be9.entry.js.map → p-d4a7d8bd.entry.js.map} +0 -0
  181. /package/dist/searchcraft-javascript-sdk/{p-69f64bdd.entry.js.map → p-e8a96dca.entry.js.map} +0 -0
  182. /package/dist/searchcraft-javascript-sdk/{p-08bd95f1.entry.js.map → p-efb41d6d.entry.js.map} +0 -0
  183. /package/dist/searchcraft-javascript-sdk/{p-a613a6ba.entry.js.map → p-fb239507.entry.js.map} +0 -0
@@ -90,7 +90,7 @@ function getDocumentValueFromSearchResultMapping(document, mapping) {
90
90
  return valueFound;
91
91
  })
92
92
  .filter((value) => !!value)
93
- .join(mapping.delimeter || ' ');
93
+ .join(mapping.delimiter || ' ');
94
94
  }
95
95
  }
96
96
  function deepMergeWithSpread(obj1, obj2) {
@@ -108,18 +108,52 @@ function deepMergeWithSpread(obj1, obj2) {
108
108
  }
109
109
  return result;
110
110
  }
111
- function facetToObject(child) {
112
- const transformed = {
113
- count: child.count,
114
- path: child.path,
111
+ function facetToRecord(facet) {
112
+ const records = {};
113
+ const traverseAndAddToFragments = (facetChild) => {
114
+ var _a;
115
+ records[facetChild.path] = {
116
+ count: facetChild.count,
117
+ path: facetChild.path,
118
+ };
119
+ (_a = facetChild.children) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
120
+ traverseAndAddToFragments(child);
121
+ });
122
+ };
123
+ traverseAndAddToFragments(facet);
124
+ return records;
125
+ }
126
+ function recordToObject(record) {
127
+ const root = {
128
+ count: 0,
129
+ path: '/',
115
130
  children: {},
116
131
  };
117
- if (child.children) {
118
- child.children.forEach((subChild) => {
119
- transformed.children[subChild.path] = facetToObject(subChild);
132
+ Object.keys(record).forEach((key) => {
133
+ const fragment = record[key];
134
+ if (fragment.path === '/') {
135
+ return;
136
+ }
137
+ const pathParts = fragment.path.substring(1).split('/');
138
+ let currentRoot = root;
139
+ let currentPath = '';
140
+ pathParts.forEach((part, index) => {
141
+ const nextPath = `${currentPath}/${part}`;
142
+ if (!currentRoot.children[nextPath]) {
143
+ currentRoot.children[nextPath] = {
144
+ count: 0,
145
+ path: nextPath,
146
+ children: {},
147
+ };
148
+ }
149
+ if (index === pathParts.length - 1) {
150
+ currentRoot.children[nextPath].count = fragment.count;
151
+ }
152
+ currentPath = nextPath;
153
+ currentRoot = currentRoot.children[nextPath];
120
154
  });
121
- }
122
- return transformed;
155
+ });
156
+ return root;
123
157
  }
124
158
  function objectToFacet(childObject) {
125
159
  const transformed = {
@@ -132,25 +166,48 @@ function objectToFacet(childObject) {
132
166
  }
133
167
  return transformed;
134
168
  }
135
- function mergeFacetRoots(fieldName, root1, root2) {
136
- const array1 = root1[fieldName];
137
- const array2 = root2[fieldName];
138
- const rootFacetChild1 = {
169
+ /**
170
+ * Filters records with the parent paths from record2 OUT of record1
171
+ */
172
+ function filterRecordByParentPaths(record1, record2) {
173
+ // Extract all paths (keys) both records
174
+ const paths1 = Object.keys(record1);
175
+ const paths2 = Object.keys(record2);
176
+ // Find all parent paths in record2
177
+ const parentPaths = new Set(paths2
178
+ .filter((path) => path.split('/').length > 2) // Only consider paths with more than one level
179
+ .map((path) => path.substring(0, path.lastIndexOf('/'))));
180
+ // Filter out keys in record1 that share a parent path with any of the identified parent paths
181
+ const filteredRecord = Object.fromEntries(paths1
182
+ .filter((path) => !parentPaths.has(path.substring(0, path.lastIndexOf('/'))))
183
+ .map((path) => [path, record1[path]]));
184
+ return filteredRecord;
185
+ }
186
+ function mergeFacetRoots(fieldName, currentRoot, incomingRoot) {
187
+ const currentArray = currentRoot[fieldName];
188
+ const incomingArray = incomingRoot[fieldName];
189
+ const currentRootFacetChild = {
139
190
  count: 0,
140
191
  path: '/',
141
- children: array1,
192
+ children: currentArray,
142
193
  };
143
- const rootFacetChild2 = {
194
+ const incomingRootFacetChild = {
144
195
  count: 0,
145
196
  path: '/',
146
- children: array2,
197
+ children: incomingArray,
147
198
  };
148
- // Transform into objects
149
- const facetObject1 = facetToObject(rootFacetChild1);
150
- const facetObject2 = facetToObject(rootFacetChild2);
151
- // Deep merge the objects
152
- const mergedFacetObject = deepMergeWithSpread(facetObject1, facetObject2);
153
- const mergedFacetChild = objectToFacet(mergedFacetObject);
199
+ // Flatten them into records
200
+ const currentRecord = facetToRecord(currentRootFacetChild);
201
+ const incomingRecord = facetToRecord(incomingRootFacetChild);
202
+ // Filter out the records from record1 (the current set of records)
203
+ // that share a parent path with record2 (the incoming records)
204
+ const filteredCurrentRecord = filterRecordByParentPaths(currentRecord, incomingRecord);
205
+ // Deep merge the records together
206
+ const mergedRecord = deepMergeWithSpread(filteredCurrentRecord, incomingRecord);
207
+ // Convert into a heirarchical object
208
+ const mergedObject = recordToObject(mergedRecord);
209
+ // Convert the heirarchical object back to the Facet child structure
210
+ const mergedFacetChild = objectToFacet(mergedObject);
154
211
  return {
155
212
  [fieldName]: mergedFacetChild.children,
156
213
  };
@@ -158,4 +215,4 @@ function mergeFacetRoots(fieldName, root1, root2) {
158
215
 
159
216
  export { getMillis as a, formatNumberWithCommas as f, getDocumentValueFromSearchResultMapping as g, mergeFacetRoots as m, parseCustomStyles as p, removeSubstringMatches as r, serializeStyles as s };
160
217
 
161
- //# sourceMappingURL=utils-89a02921.js.map
218
+ //# sourceMappingURL=utils-c2ce411f.js.map
@@ -0,0 +1 @@
1
+ {"file":"utils-c2ce411f.js","mappings":"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","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["import type {\n FacetChild,\n FacetChildObject,\n FacetRoot,\n} from '@searchcraft/core';\nimport type { SearchResultMapping } from 'types';\n\nexport function parseCustomStyles(\n styles: string | Record<string, string>,\n): Record<string, string> {\n if (typeof styles === 'string') {\n try {\n return JSON.parse(styles);\n } catch (error) {\n console.error('Invalid customStyles format:', styles);\n return {};\n }\n }\n return styles || {};\n}\n\nexport function serializeStyles(\n styles: Record<string, Record<string, string>>,\n): string {\n try {\n return JSON.stringify(styles);\n } catch (error) {\n console.error('Error serializing styles:', error);\n return '{}';\n }\n}\n\n/**\n * Given a timestamp value, returns a formatted time string for the time\n * since now.\n *\n * @param timestamp\n * @returns {string} Formatted string value\n */\nexport function getFormattedTimeFromNow(timestamp: string): string {\n const now = new Date();\n const inputTime = new Date(timestamp);\n const diffInSeconds = Math.floor(\n (now.getTime() - inputTime.getTime()) / 1000,\n );\n\n const minutes = Math.floor(diffInSeconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const years = Math.floor(days / 365);\n\n if (minutes < 60) {\n return `${minutes}m ago`;\n }\n if (hours < 24) {\n return `${hours}h ago`;\n }\n if (days < 365) {\n return `${days}d ago`;\n }\n return `${years}y ago`;\n}\n\nexport function filterPaths(paths) {\n return paths.filter((path) => {\n const parts = path.split('/').filter(Boolean);\n\n if (parts.length > 1) {\n return true;\n }\n\n return !paths.some(\n (otherPath) => otherPath.startsWith(`${path}/`) && otherPath !== path,\n );\n });\n}\n\nexport function formatNumberWithCommas(number) {\n return number.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n}\n\nexport function getMillis(unit: 'year' | 'month' | 'day' | 'hour'): number {\n const millisInHour = 60 * 60 * 1000;\n const millisInDay = 24 * millisInHour;\n const millisInMonth = 30 * millisInDay;\n const millisInYear = 365 * millisInDay;\n\n switch (unit) {\n case 'hour':\n return millisInHour;\n case 'day':\n return millisInDay;\n case 'month':\n return millisInMonth;\n case 'year':\n return millisInYear;\n default:\n return 3600000;\n }\n}\n/**\n * Given an array of facet paths, removes parent facet paths.\n */\nexport function removeSubstringMatches(arr: string[]): string[] {\n return arr.filter(\n (entry, index, array) =>\n !array.some(\n (otherEntry, otherIndex) =>\n otherIndex !== index && otherEntry.includes(entry),\n ),\n );\n}\n\n/**\n * Given a document and a SearchResultMapping, return a mapped value from the document.\n *\n * @param document\n * @param {SearchResultMapping} mapping\n * @returns {string | undefined}\n */\nexport function getDocumentValueFromSearchResultMapping(\n document: Record<string, unknown> | undefined,\n mapping: SearchResultMapping | undefined,\n): string | undefined {\n if (document && mapping) {\n return mapping.fieldNames\n .map((fieldNameDetails) => {\n let valueFound = document[fieldNameDetails.fieldName];\n\n if (valueFound && fieldNameDetails.dataType === 'date') {\n valueFound = getFormattedTimeFromNow(valueFound as string);\n }\n\n return valueFound;\n })\n .filter((value) => !!value)\n .join(mapping.delimiter || ' ');\n }\n}\n\nfunction deepMergeWithSpread(obj1, obj2) {\n const result = { ...obj1 };\n\n for (const key in obj2) {\n // biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>\n if (obj2.hasOwnProperty(key)) {\n if (obj2[key] instanceof Object && obj1[key] instanceof Object) {\n result[key] = deepMergeWithSpread(obj1[key], obj2[key]);\n } else {\n result[key] = obj2[key];\n }\n }\n }\n\n return result;\n}\n\ntype FacetChildFragment = {\n count: number;\n path: string;\n};\n\nfunction facetToRecord(facet: FacetChild): Record<string, FacetChildFragment> {\n const records: Record<string, FacetChildFragment> = {};\n\n const traverseAndAddToFragments = (facetChild: FacetChild) => {\n records[facetChild.path] = {\n count: facetChild.count,\n path: facetChild.path,\n };\n\n facetChild.children?.forEach((child) => {\n traverseAndAddToFragments(child);\n });\n };\n\n traverseAndAddToFragments(facet);\n\n return records;\n}\n\nfunction recordToObject(\n record: Record<string, FacetChildFragment>,\n): FacetChildObject {\n const root: FacetChildObject = {\n count: 0,\n path: '/',\n children: {},\n };\n\n Object.keys(record).forEach((key) => {\n const fragment = record[key];\n if (fragment.path === '/') {\n return;\n }\n const pathParts = fragment.path.substring(1).split('/');\n let currentRoot = root;\n let currentPath = '';\n\n pathParts.forEach((part, index) => {\n const nextPath = `${currentPath}/${part}`;\n if (!currentRoot.children[nextPath]) {\n currentRoot.children[nextPath] = {\n count: 0,\n path: nextPath,\n children: {},\n };\n }\n\n if (index === pathParts.length - 1) {\n currentRoot.children[nextPath].count = fragment.count;\n }\n\n currentPath = nextPath;\n currentRoot = currentRoot.children[nextPath];\n });\n });\n\n return root;\n}\n\nfunction objectToFacet(childObject: FacetChildObject): FacetChild {\n const transformed: FacetChild = {\n count: childObject.count,\n path: childObject.path,\n children: [],\n };\n\n if (Object.keys(childObject.children).length > 0) {\n transformed.children = Object.values(childObject.children).map(\n (subChildObject) => objectToFacet(subChildObject),\n );\n }\n\n return transformed;\n}\n\n/**\n * Filters records with the parent paths from record2 OUT of record1\n */\nfunction filterRecordByParentPaths(\n record1: Record<string, FacetChild>,\n record2: Record<string, FacetChild>,\n): Record<string, FacetChild> {\n // Extract all paths (keys) both records\n const paths1 = Object.keys(record1);\n const paths2 = Object.keys(record2);\n\n // Find all parent paths in record2\n const parentPaths = new Set(\n paths2\n .filter((path) => path.split('/').length > 2) // Only consider paths with more than one level\n .map((path) => path.substring(0, path.lastIndexOf('/'))),\n );\n\n // Filter out keys in record1 that share a parent path with any of the identified parent paths\n const filteredRecord = Object.fromEntries(\n paths1\n .filter(\n (path) => !parentPaths.has(path.substring(0, path.lastIndexOf('/'))),\n )\n .map((path) => [path, record1[path]]), // Reconstruct the key-value pairs\n );\n\n return filteredRecord;\n}\n\nexport function mergeFacetRoots(\n fieldName: string,\n currentRoot: FacetRoot,\n incomingRoot: FacetRoot,\n): FacetRoot {\n const currentArray = currentRoot[fieldName];\n const incomingArray = incomingRoot[fieldName];\n\n const currentRootFacetChild: FacetChild = {\n count: 0,\n path: '/',\n children: currentArray,\n };\n\n const incomingRootFacetChild: FacetChild = {\n count: 0,\n path: '/',\n children: incomingArray,\n };\n\n // Flatten them into records\n const currentRecord: Record<string, FacetChildFragment> = facetToRecord(\n currentRootFacetChild,\n );\n\n const incomingRecord: Record<string, FacetChildFragment> = facetToRecord(\n incomingRootFacetChild,\n );\n\n // Filter out the records from record1 (the current set of records)\n // that share a parent path with record2 (the incoming records)\n const filteredCurrentRecord = filterRecordByParentPaths(\n currentRecord,\n incomingRecord,\n );\n\n // Deep merge the records together\n const mergedRecord: Record<string, FacetChildFragment> = deepMergeWithSpread(\n filteredCurrentRecord,\n incomingRecord,\n );\n\n // Convert into a heirarchical object\n const mergedObject: FacetChildObject = recordToObject(mergedRecord);\n\n // Convert the heirarchical object back to the Facet child structure\n const mergedFacetChild = objectToFacet(mergedObject);\n\n return {\n [fieldName]: mergedFacetChild.children,\n };\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
- export{p as parseCustomStyles,s as serializeStyles}from"./p-0deddac7.js";export{u as useSearchcraftStore,a as useThemeStore}from"./p-bb03e946.js";
1
+ export{p as parseCustomStyles,s as serializeStyles}from"./p-f308d05d.js";export{u as useSearchcraftStore,a as useThemeStore}from"./p-a2801518.js";
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1,2 +1,2 @@
1
- import{r as e,h as s,c}from"./p-4c32c87d.js";import{c as r}from"./p-5cdc6210.js";import{p as a}from"./p-0deddac7.js";const n=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-error-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-danger)}";const t=n;const i=class{constructor(s){e(this,s);this.errorMessage=undefined}render(){return s("p",{key:"07a5a9e83a30988018aa9d3d3ece9d0894923399",class:"searchcraft-error-message"},this.errorMessage||"Search term is required.")}};i.style=t;const o=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}searchcraft-input{display:flex;flex:1}.searchcraft-input-wrapper{display:inline-block;position:relative;cursor:text}.searchcraft-input-wrapper-flex{display:flex;flex:1}.searchcraft-input-flex{flex:1}.searchcraft-input{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);background-color:var(--sc-surface-neutral-secondary);border:none;border-radius:var(--sc-input-border-radius);color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size)}";const d=o;const h=class{constructor(s){e(this,s);this.clearInput=c(this,"clearInput",7);this.inputChange=c(this,"inputChange",7);this.handleOnInput=e=>{const s=e.target;this.inputValue=s.value;this.inputChange.emit(s.value)};this.handleClearInput=()=>{this.inputValue="";if(this.clearInput){this.clearInput.emit()}if(this.inputValue===""){return}};this.customStyles={};this.error=false;this.inputCaptionClassName="";this.inputCaptionValue="";this.inputClassName="";this.isRequesting=false;this.placeholderValue="Enter Search";this.query="";this.flex=true;this.inputValue=this.query}render(){const e=a(this.customStyles);const c=r("searchcraft-input-wrapper",{"searchcraft-input-wrapper-flex":this.flex});const n=r("searchcraft-input",{"searchcraft-input-flex":this.flex,error:this.error});const t=this.inputValue.length>0;return s("div",{key:"ccc37209c67ce2d5faa3ad435f0c303bf23b9355",class:c},s("input",{key:"d368f669c9e5ab7716502100d27325140a7d4c4e",autoComplete:"off",class:n,onInput:e=>{this.handleOnInput(e)},placeholder:this.placeholderValue,style:e,type:"text",value:this.inputValue}),s("div",{key:"b26c20cf29469f80a072635a4dc23ca8123d2b0b",class:"searchcraft-input-search-icon-wrapper"},s("svg",{key:"0865511d00e078982fe873e2b6fce30df290cdbd",class:"searchcraft-input-search-icon",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},s("title",{key:"09e89005bc7972729888ed787f579ad18b6886b4",id:"searchcraft-title"},"Searchcraft Search Icon Light"),s("path",{key:"fc37d213842b87f26d9d9f89c0708392a197648c",d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#404040","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))),t&&s("button",{key:"779b81efc2ae5e985415edf4f9c02618852c7185",type:"button",class:"searchcraft-input-clear-button",onClick:this.handleClearInput},s("svg",{key:"511dd4755fd75ab0a75ecd21ad18eb8726f84c94",class:"searchcraft-input-clear-icon",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},s("title",{key:"97304d272345567dd59ef1c1985663074bd0ed0e",id:"icon-title"},"Searchcraft Clear Input Icon Light"),s("path",{key:"147f88e2f51d855fbc097e81d32f24c27217f443",d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))))}};h.style=d;const f=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-input-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height);color:var(--sc-content-neutral-primary);margin-top:4px;margin-bottom:4px}";const u=f;const l=class{constructor(s){e(this,s);this.inputLabelClassName="";this.label=undefined}render(){if(!this.label){return null}return s("label",{class:"searchcraft-input-label",htmlFor:"searchcraft-input-id"},this.label)}};l.style=u;export{i as searchcraft_error_message,h as searchcraft_input,l as searchcraft_input_label};
2
- //# sourceMappingURL=p-9647ae41.entry.js.map
1
+ import{r as e,h as s,c}from"./p-80e3f29f.js";import{c as r}from"./p-5cdc6210.js";import{p as a}from"./p-f308d05d.js";const n=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-error-message{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-font-size);font-weight:var(--sc-body-small-font-weight);line-height:var(--sc-body-small-line-height);color:var(--sc-content-danger)}";const t=n;const i=class{constructor(s){e(this,s);this.errorMessage=undefined}render(){return s("p",{key:"07a5a9e83a30988018aa9d3d3ece9d0894923399",class:"searchcraft-error-message"},this.errorMessage||"Search term is required.")}};i.style=t;const o=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}searchcraft-input{display:flex;flex:1}.searchcraft-input-wrapper{display:inline-block;position:relative;cursor:text}.searchcraft-input-wrapper-flex{display:flex;flex:1}.searchcraft-input-flex{flex:1}.searchcraft-input{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-font-size);font-weight:var(--sc-body-font-weight);line-height:var(--sc-body-line-height);background-color:var(--sc-surface-neutral-secondary);border:none;border-radius:var(--sc-input-border-radius);color:var(--sc-content-neutral-primary);outline:none;padding-left:var(--sc-input-padding-left);padding-right:var(--sc-input-padding-right);padding-top:12px;padding-bottom:12px}.searchcraft-input::placeholder{color:var(--sc-content-disabled)}.searchcraft-input:focus{outline:var(--sc-border-brand) solid 2px}.searchcraft-input:focus::placeholder{opacity:0}.searchcraft-input.error{color:var(--sc-content-danger);outline:var(--sc-border-danger) solid 2px}.searchcraft-input.error:focus{outline:var(--sc-border-danger) solid 2px}.searchcraft-input-search-icon-wrapper{align-items:center;justify-content:center;display:flex;position:absolute;pointer-events:none;bottom:0;left:0;top:0;width:var(--sc-input-padding-left)}.searchcraft-input-search-icon{pointer-events:none;width:var(--sc-input-search-icon-size);height:var(--sc-input-search-icon-size)}.searchcraft-input-clear-button{all:unset;align-items:center;justify-content:center;cursor:pointer;display:flex;position:absolute;border:none;outline:none;bottom:0;right:0;top:0;width:var(--sc-input-padding-right)}.searchcraft-input-clear-icon{width:var(--sc-input-clear-icon-size);height:var(--sc-input-clear-icon-size)}";const d=o;const h=class{constructor(s){e(this,s);this.clearInput=c(this,"clearInput",7);this.inputChange=c(this,"inputChange",7);this.handleOnInput=e=>{const s=e.target;this.inputValue=s.value;this.inputChange.emit(s.value)};this.handleClearInput=()=>{this.inputValue="";if(this.clearInput){this.clearInput.emit()}if(this.inputValue===""){return}};this.customStyles={};this.error=false;this.inputCaptionClassName="";this.inputCaptionValue="";this.inputClassName="";this.isRequesting=false;this.placeholderValue="Enter Search";this.query="";this.flex=true;this.inputValue=this.query}render(){const e=a(this.customStyles);const c=r("searchcraft-input-wrapper",{"searchcraft-input-wrapper-flex":this.flex});const n=r("searchcraft-input",{"searchcraft-input-flex":this.flex,error:this.error});const t=this.inputValue.length>0;return s("div",{key:"ccc37209c67ce2d5faa3ad435f0c303bf23b9355",class:c},s("input",{key:"d368f669c9e5ab7716502100d27325140a7d4c4e",autoComplete:"off",class:n,onInput:e=>{this.handleOnInput(e)},placeholder:this.placeholderValue,style:e,type:"text",value:this.inputValue}),s("div",{key:"b26c20cf29469f80a072635a4dc23ca8123d2b0b",class:"searchcraft-input-search-icon-wrapper"},s("svg",{key:"0865511d00e078982fe873e2b6fce30df290cdbd",class:"searchcraft-input-search-icon",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},s("title",{key:"09e89005bc7972729888ed787f579ad18b6886b4",id:"searchcraft-title"},"Searchcraft Search Icon Light"),s("path",{key:"fc37d213842b87f26d9d9f89c0708392a197648c",d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#404040","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))),t&&s("button",{key:"779b81efc2ae5e985415edf4f9c02618852c7185",type:"button",class:"searchcraft-input-clear-button",onClick:this.handleClearInput},s("svg",{key:"511dd4755fd75ab0a75ecd21ad18eb8726f84c94",class:"searchcraft-input-clear-icon",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},s("title",{key:"97304d272345567dd59ef1c1985663074bd0ed0e",id:"icon-title"},"Searchcraft Clear Input Icon Light"),s("path",{key:"147f88e2f51d855fbc097e81d32f24c27217f443",d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))))}};h.style=d;const f=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-input-label{font-family:var(--sc-font-family);-webkit-font-smoothing:antialiased;font-size:var(--sc-body-small-bold-font-size);font-weight:var(--sc-body-small-bold-font-weight);line-height:var(--sc-body-small-bold-line-height);color:var(--sc-content-neutral-primary);margin-top:4px;margin-bottom:4px}";const u=f;const l=class{constructor(s){e(this,s);this.inputLabelClassName="";this.label=undefined}render(){if(!this.label){return null}return s("label",{class:"searchcraft-input-label",htmlFor:"searchcraft-input-id"},this.label)}};l.style=u;export{i as searchcraft_error_message,h as searchcraft_input,l as searchcraft_input_label};
2
+ //# sourceMappingURL=p-1720b612.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,h as r}from"./p-4c32c87d.js";const e=class{constructor(r){t(this,r);this.type="search-dark";this.width=20;this.height=20}render(){const{width:t,height:e}=this;switch(this.type){case"search-light":return r("svg",{width:t,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Search Icon Light"),r("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#404040","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"search-dark":return r("svg",{width:t,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Search Icon Dark"),r("path",{d:"M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",stroke:"#E6E6E6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"error-light":return r("svg",{width:t,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Error Search Icon Light"),r("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#737373","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"error-dark":return r("svg",{width:t,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Error Search Icon Dark"),r("path",{d:"M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",stroke:"#BFBFBF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));default:return null}}};export{e as searchcraft_search_icon_set};
2
- //# sourceMappingURL=p-f4612b94.entry.js.map
1
+ import{r as t,h as r}from"./p-80e3f29f.js";const e=class{constructor(r){t(this,r);this.type="search-dark";this.width=20;this.height=20}render(){const{width:t,height:e}=this;switch(this.type){case"search-light":return r("svg",{width:t,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Search Icon Light"),r("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#404040","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"search-dark":return r("svg",{width:t,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Search Icon Dark"),r("path",{d:"M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",stroke:"#E6E6E6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"error-light":return r("svg",{width:t,height:e,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Error Search Icon Light"),r("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#737373","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"error-dark":return r("svg",{width:t,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},r("title",{id:"searchcraft-title"},"Searchcraft Error Search Icon Dark"),r("path",{d:"M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",stroke:"#BFBFBF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));default:return null}}};export{e as searchcraft_search_icon_set};
2
+ //# sourceMappingURL=p-3292e706.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as s,c as e,h as t,g as i}from"./p-80e3f29f.js";import{u as c,i as a}from"./p-a2801518.js";import{p as r}from"./p-f308d05d.js";import{p as n}from"./p-c994d722.js";const h=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-auto-search-form{display:flex;flex-direction:column;gap:4px}";const o=h;const d=class{constructor(t){s(this,t);this.inputClearedOrNoResults=e(this,"inputClearedOrNoResults",7);this.querySubmit=e(this,"querySubmit",7);this.debounceTimeout=null;this.debounceDelay=0;this.searchStore=c.getState();this.handleInputChange=s=>{const e=s.detail;if(e===this.query){return}this.query=e;const t=()=>{if(this.query.trim()===""){this.searchStore.setQuery("");this.searchResults=null;this.searchStore.setSearchResults(null);this.inputClearedOrNoResults.emit()}else{this.searchStore.setQuery(this.query);this.querySubmit.emit();this.runSearch()}};if(this.debounceDelay>0){if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.debounceTimeout=setTimeout(t,this.debounceDelay)}else{t()}};this.handleClearInput=()=>{if(this.query===""&&!this.searchResults){return}this.query="";this.searchResults=null;this.searchStore.setQuery("");this.searchStore.setSearchResults(null);if(typeof this.clearInput==="function"){this.clearInput()}if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.error=false;this.inputClearedOrNoResults.emit()};this.runSearch=async()=>{if(this.query.trim()===""){this.error=true;this.inputClearedOrNoResults.emit()}else{this.error=false;this.searchStore.setQuery(this.query);try{await this.searchStore.search()}catch(s){this.error=true;this.inputClearedOrNoResults.emit()}}};this.handleFormSubmit=async s=>{s.preventDefault();await this.runSearch()};this.autoSearchFormClass="";this.clearInput=()=>{};this.config=undefined;this.customStylesForInput={};this.inputCaptionValue="";this.labelForInput="";this.placeholderValue="Search here";this.searchContainerClass="";this.error=false;this.isRequesting=false;this.query="";this.searchResults=null}init(){var s;if(this.config){const e=new a(this.config,{sdkName:n.name,sdkVersion:n.version});this.searchStore.initialize(e,true);(s=this.unsubscribe)===null||s===void 0?void 0:s.call(this);this.unsubscribe=c.subscribe((s=>{this.isRequesting=s.isRequesting;this.searchResults=Object.assign({},s.searchResults)}))}}componentDidLoad(){this.init()}onConfigChange(){this.init()}connectedCallback(){}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}render(){const s=r(this.customStylesForInput);return t("form",{key:"3c1069cbaf543e9b06616d7440eb784010a7b601",class:"searchcraft-auto-search-form",onSubmit:this.handleFormSubmit},t("searchcraft-input-label",{key:"7ba138f9335b59ee2205a22ef3a8af306db102d1",label:this.labelForInput}),t("searchcraft-input",{key:"a7400629e259ea15cd58d5f2c87f1659c8d6addb",customStyles:s,"input-caption-value":this.inputCaptionValue,"is-requesting":this.isRequesting,onClearInput:this.handleClearInput,onInputChange:this.handleInputChange.bind(this),"placeholder-value":this.placeholderValue,query:this.query}),this.error&&t("searchcraft-error-message",{key:"f304152c611d3e8849a9d24b07a9db3d5d71197f",errorMessage:"Please enter a search query."}))}get element(){return i(this)}static get watchers(){return{config:["onConfigChange"]}}};d.style=o;export{d as searchcraft_auto_search_form};
2
+ //# sourceMappingURL=p-491ae071.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["searchcraftAutoSearchFormModuleCss","SearchcraftAutoSearchFormStyle0","SearchcraftAutoSearchForm","this","debounceTimeout","debounceDelay","searchStore","useSearchcraftStore","getState","handleInputChange","event","target","detail","query","performSearchActions","trim","setQuery","searchResults","setSearchResults","inputClearedOrNoResults","emit","querySubmit","runSearch","clearTimeout","setTimeout","handleClearInput","clearInput","error","async","search","handleFormSubmit","preventDefault","init","config","searchcraft","SearchcraftCore","sdkName","packageJson","name","sdkVersion","version","initialize","_a","unsubscribe","call","subscribe","state","isRequesting","Object","assign","componentDidLoad","onConfigChange","connectedCallback","disconnectedCallback","render","parsedCustomStyles","parseCustomStyles","customStylesForInput","h","key","class","onSubmit","label","labelForInput","customStyles","inputCaptionValue","onClearInput","onInputChange","bind","placeholderValue","errorMessage"],"sources":["src/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.scss?tag=searchcraft-auto-search-form","src/components/searchcraft-auto-search-form/searchcraft-auto-search-form.tsx"],"sourcesContent":[".searchcraft-auto-search-form {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n","import {\n Component,\n Prop,\n State,\n Event,\n type EventEmitter,\n h,\n Element,\n Watch,\n} from '@stencil/core';\n\nimport {\n type SearchcraftConfig,\n SearchcraftCore,\n type SearchcraftResponse,\n} from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\nimport { parseCustomStyles } from '@utils/utils';\nimport type { ScInputCustomEvent } from '@components/searchcraft-input/searchcraft-input';\n\nimport packageJson from '../../../package.json';\n\n@Component({\n tag: 'searchcraft-auto-search-form',\n styleUrl: 'searchcraft-auto-search-form.module.scss',\n shadow: false,\n})\nexport class SearchcraftAutoSearchForm {\n @Prop() autoSearchFormClass = '';\n @Prop() clearInput: () => void = () => {};\n @Prop() config: SearchcraftConfig | undefined;\n @Prop() customStylesForInput: string | Record<string, string> = {};\n @Prop() inputCaptionValue = '';\n @Prop() labelForInput = '';\n @Prop() placeholderValue = 'Search here';\n @Prop() searchContainerClass = '';\n\n @Event() inputClearedOrNoResults: EventEmitter<void>;\n @Event() querySubmit: EventEmitter<string>;\n\n @State() error = false;\n @State() isRequesting = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n @Element() element: HTMLElement;\n\n private debounceTimeout: ReturnType<typeof setTimeout> | null = null;\n private debounceDelay = 0;\n private searchStore = useSearchcraftStore.getState();\n unsubscribe: () => void;\n\n init() {\n if (this.config) {\n const searchcraft = new SearchcraftCore(this.config, {\n sdkName: packageJson.name,\n sdkVersion: packageJson.version,\n });\n this.searchStore.initialize(searchcraft, true);\n\n this.unsubscribe?.();\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.isRequesting = state.isRequesting;\n this.searchResults = { ...state.searchResults };\n });\n }\n }\n\n componentDidLoad() {\n this.init();\n }\n\n @Watch('config')\n onConfigChange() {\n this.init();\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n handleInputChange = (event: ScInputCustomEvent<string>) => {\n const target = event.detail;\n if (target === this.query) {\n return;\n }\n this.query = target;\n\n const performSearchActions = () => {\n if (this.query.trim() === '') {\n this.searchStore.setQuery('');\n this.searchResults = null;\n this.searchStore.setSearchResults(null);\n this.inputClearedOrNoResults.emit();\n } else {\n this.searchStore.setQuery(this.query);\n this.querySubmit.emit();\n this.runSearch();\n }\n };\n\n // Only set a timeout if debounceDelay > 0\n if (this.debounceDelay > 0) {\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n this.debounceTimeout = setTimeout(\n performSearchActions,\n this.debounceDelay,\n );\n } else {\n // Otherwise just call search actions directly\n performSearchActions();\n }\n };\n\n handleClearInput = () => {\n if (this.query === '' && !this.searchResults) {\n return;\n }\n this.query = '';\n this.searchResults = null;\n this.searchStore.setQuery('');\n this.searchStore.setSearchResults(null);\n\n if (typeof this.clearInput === 'function') {\n this.clearInput();\n }\n\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n this.error = false;\n this.inputClearedOrNoResults.emit();\n };\n\n private runSearch = async () => {\n if (this.query.trim() === '') {\n this.error = true;\n this.inputClearedOrNoResults.emit();\n } else {\n this.error = false;\n this.searchStore.setQuery(this.query);\n\n try {\n await this.searchStore.search();\n } catch (error) {\n this.error = true;\n this.inputClearedOrNoResults.emit();\n }\n }\n };\n\n handleFormSubmit = async (event: Event) => {\n event.preventDefault();\n await this.runSearch();\n };\n\n render() {\n const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);\n return (\n <form\n class='searchcraft-auto-search-form'\n onSubmit={this.handleFormSubmit}\n >\n <searchcraft-input-label label={this.labelForInput} />\n <searchcraft-input\n customStyles={parsedCustomStyles}\n input-caption-value={this.inputCaptionValue}\n is-requesting={this.isRequesting}\n onClearInput={this.handleClearInput}\n onInputChange={this.handleInputChange.bind(this)}\n placeholder-value={this.placeholderValue}\n query={this.query}\n />\n {this.error && (\n <searchcraft-error-message errorMessage='Please enter a search query.' />\n )}\n </form>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as t,h as e}from"./p-4c32c87d.js";const r=class{constructor(e){t(this,e);this.type="clear-light"}render(){switch(this.type){case"clear-light":return e("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Clear Input Icon Light"),e("path",{d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"clear-dark":return e("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Clear Input Icon Dark"),e("path",{d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"arrow-light":return e("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Arrow Right Icon Light"),e("path",{d:"M7.5 15.0444L12.5 10.0444L7.5 5.04443",stroke:"#737373","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"arrow-dark":return e("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Arrow Right Icon Dark"),e("path",{d:"M1.5 11L6.5 6L1.5 1",stroke:"#BFBFBF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));default:return null}}};export{r as searchcraft_clear_icon_set};
2
- //# sourceMappingURL=p-bf80bbee.entry.js.map
1
+ import{r as t,h as e}from"./p-80e3f29f.js";const r=class{constructor(e){t(this,e);this.type="clear-light"}render(){switch(this.type){case"clear-light":return e("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Clear Input Icon Light"),e("path",{d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"clear-dark":return e("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Clear Input Icon Dark"),e("path",{d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"arrow-light":return e("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Arrow Right Icon Light"),e("path",{d:"M7.5 15.0444L12.5 10.0444L7.5 5.04443",stroke:"#737373","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"arrow-dark":return e("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Arrow Right Icon Dark"),e("path",{d:"M1.5 11L6.5 6L1.5 1",stroke:"#BFBFBF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));default:return null}}};export{r as searchcraft_clear_icon_set};
2
+ //# sourceMappingURL=p-4a2d1f44.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as s,c as e,h as t}from"./p-80e3f29f.js";import{u as c}from"./p-a2801518.js";import{g as r,s as i}from"./p-f308d05d.js";const n=":root{--sc-spinner-size:20px;--sc-input-border-radius:8px;--sc-input-search-icon-size:20px;--sc-input-clear-icon-size:20px;--sc-input-padding-left:44px;--sc-input-padding-right:44px;--sc-image-border-radius:8px}:root{--sc-surface-disabled:#D9D9D9;--sc-surface-neutral-primary:#FFFFFF;--sc-surface-neutral-secondary:#F3F3F3;--sc-surface-neutral-light:#FFFFFF;--sc-surface-neutral-primary-hover:#FAFAFA;--sc-surface-neutral-primary-active:#F7F7F7;--sc-surface-neutral-secondary-hover:#EDEDED;--sc-surface-neutral-secondary-active:#E6E6E6;--sc-surface-brand-primary:#000000;--sc-surface-brand-secondary:#E6E6E6;--sc-surface-brand-primary-hover:#2E2E2E;--sc-surface-brand-primary-active:#292929;--sc-surface-brand-secondary-hover:#EBEBEB;--sc-surface-brand-secondary-active:#E0E0E0;--sc-surface-success-primary:#008000;--sc-surface-success-secondary:#CCFFCC;--sc-surface-success-primary-hover:#009900;--sc-surface-success-primary-active:#006600;--sc-surface-success-secondary-hover:#E6FFE6;--sc-surface-success-secondary-active:#E6FFE6;--sc-surface-caution-primary:#CC6600;--sc-surface-caution-secondary:#FFD9B3;--sc-surface-caution-primary-hover:#E57300;--sc-surface-caution-primary-active:#B25A00;--sc-surface-caution-secondary-hover:#FFE5CC;--sc-surface-caution-secondary-active:#FFCC99;--sc-surface-danger-primary:#CC0000;--sc-surface-danger-secondary:#FFCCCC;--sc-surface-danger-primary-hover:#E50000;--sc-surface-danger-primary-active:#B30000;--sc-surface-danger-secondary-hover:#FFE7E7;--sc-surface-danger-secondary-active:#FFB3B3;--sc-content-brand:#000000;--sc-content-success:#008000;--sc-content-caution:#994D00;--sc-content-danger:#990000;--sc-content-disabled:#737373;--sc-content-neutral-primary:#292929;--sc-content-neutral-secondary:#404040;--sc-content-brand-on-primary:#FFFFFF;--sc-content-success-on-primary:#FFFFFF;--sc-content-caution-on-primary:#FFFFFF;--sc-content-danger-on-primary:#FFFFFF;--sc-content-disabled-on-disabled:#737373;--sc-border-neutral:rgba(0,0,0, 0.1);--sc-border-brand:#000000;--sc-border-success:#008000;--sc-border-caution:#CC6600;--sc-border-danger:#CC0000;--sc-border-disabled:#737373}:root{--sc-font-family:sans-serif;--sc-heading-1-font-size:32px;--sc-heading-1-line-height:36px;--sc-heading-1-font-weight:700;--sc-heading-2-font-size:29px;--sc-heading-2-line-height:32px;--sc-heading-2-font-weight:700;--sc-heading-3-font-size:26px;--sc-heading-3-line-height:28px;--sc-heading-3-font-weight:700;--sc-heading-4-font-size:23px;--sc-heading-4-line-height:24px;--sc-heading-4-font-weight:700;--sc-heading-5-font-size:20px;--sc-heading-5-line-height:24px;--sc-heading-5-font-weight:700;--sc-heading-6-font-size:10px;--sc-heading-6-line-height:12px;--sc-heading-6-font-weight:700;--sc-body-bold-font-size:16px;--sc-body-bold-line-height:20px;--sc-body-bold-font-weight:700;--sc-body-font-size:16px;--sc-body-line-height:20px;--sc-body-font-weight:400;--sc-body-small-bold-font-size:12px;--sc-body-small-bold-line-height:16px;--sc-body-small-bold-font-weight:700;--sc-body-small-font-size:12px;--sc-body-small-line-height:16px;--sc-body-small-font-weight:400}.searchcraft-search-results-container{display:flex;flex-direction:column;justify-content:center;gap:16px}.searchcraft-ad-section{align-items:center;background-color:#F1F1F1;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;min-height:176px;text-align:center}.searchcraft-ad-section p{margin:0;color:var(--sc-content-disabled)}.searchcraft-search-results-empty-state-container{text-align:center}.searchcraft-search-results-error-message-container{text-align:center}";const a=n;const o=class{constructor(t){s(this,t);this.noResults=e(this,"noResults",7);this.adInterval=4;this.customStylesForResults=undefined;this.searchResultMappings=undefined;this.placeAdAtEnd=false;this.placeAdAtStart=true;this.resultImagePlacement="right";this.buttonLabel=undefined;this.buttonTarget="_blank";this.buttonRel=undefined;this.containerTarget="_blank";this.containerRel=undefined;this.hasSearched=false;this.query="";this.searchResults=null}componentDidLoad(){this.unsubscribe=c.subscribe((s=>{if(s.query.length>0){this.hasSearched=true}else{this.hasSearched=false}this.searchResults=Object.assign({},s.searchResults);this.query=s.query}));const{searchResults:s,query:e}=c.getState();this.searchResults=s;this.query=e}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}renderDocument(s,e){const c=r(s,this.searchResultMappings.title);const n=r(s,this.searchResultMappings.subtitle);const a=r(s,this.searchResultMappings.body);const o=r(s,this.searchResultMappings.containerHref);const d=r(s,this.searchResultMappings.buttonHref);const h=r(s,this.searchResultMappings.imageSource);const l=r(s,this.searchResultMappings.footer);const u=typeof this.customStylesForResults==="string"?this.customStylesForResults:i(this.customStylesForResults);return t("searchcraft-base-search-result",{key:`${s.document_id}-${e}`,"custom-styles":u,"image-placement":this.resultImagePlacement,"container-rel":this.containerRel,"container-target":this.containerTarget,"button-label":this.buttonLabel||"View more","button-rel":this.buttonRel,"button-target":this.buttonTarget,"document-position":e,"title-content":c,"subtitle-content":n,"body-content":a,"footer-content":l,"container-href":o,"button-href":d,"image-src":h})}render(){var s,e,c,r,i,n,a,o,d,h;if(this.query.trim()===""){return t("div",{class:"searchcraft-search-results-empty-state-container"},t("slot",{name:"empty-search"}))}if(!((s=this.searchResults)===null||s===void 0?void 0:s.data)){return}const l=(r=(c=(e=this.searchResults)===null||e===void 0?void 0:e.data)===null||c===void 0?void 0:c.hits)===null||r===void 0?void 0:r.map(((s,e)=>{const{doc:t}=s;return t}));const u=[];if(this.placeAdAtStart){u.push(t("div",{key:"ad-section-start",class:"searchcraft-ad-section"},t("p",null,"Ad Section")))}if(this.adInterval>0){l.forEach(((s,e)=>{u.push(this.renderDocument(s,e));if((e+1)%this.adInterval===0){u.push(t("div",{key:`ad-section-${e+1}`,class:"searchcraft-ad-section "},t("p",null,"Ad Section")))}}))}else{const s=l.map(((s,e)=>this.renderDocument(s,e)));u.push(...s)}if(this.placeAdAtEnd){u.push(t("div",{key:"ad-section-end",class:"searchcraft-ad-section"},t("p",null,"Ad Section")))}if(this.query.length>0&&((a=(n=(i=this.searchResults)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.hits)===null||a===void 0?void 0:a.length)===0){this.noResults.emit()}return t("div",{class:"searchcraft-search-results-container"},u,this.query.length>0&&((h=(d=(o=this.searchResults)===null||o===void 0?void 0:o.data)===null||d===void 0?void 0:d.hits)===null||h===void 0?void 0:h.length)===0&&t("div",{class:"searchcraft-search-results-error-message-container"},t("searchcraft-error-message",{"error-message":`No search results found for "${this.query}" query`})))}};o.style=a;export{o as searchcraft_base_search_results};
2
+ //# sourceMappingURL=p-676e2eef.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["searchcraftBaseSearchResultsModuleCss","SearchcraftBaseSearchResultsStyle0","SearchcraftBaseSearchResults","componentDidLoad","this","unsubscribe","useSearchcraftStore","subscribe","state","query","length","hasSearched","searchResults","Object","assign","getState","disconnectedCallback","renderDocument","document","index","titleContent","getDocumentValueFromSearchResultMapping","searchResultMappings","title","subtitleContent","subtitle","bodyContent","body","containerHref","buttonHref","imageSource","footerContent","footer","serializedStyles","customStylesForResults","serializeStyles","h","key","document_id","resultImagePlacement","containerRel","containerTarget","buttonLabel","buttonRel","buttonTarget","render","trim","class","name","_a","data","documents","_d","_c","_b","hits","map","_index","doc","result","finalComponents","placeAdAtStart","push","adInterval","forEach","documentElements","placeAdAtEnd","_g","_f","_e","noResults","emit","_k","_j","_h"],"sources":["src/components/searchcraft-base-search-results/searchcraft-base-search-results.module.scss?tag=searchcraft-base-search-results","src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"sourcesContent":[".searchcraft-search-results-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 16px;\n}\n\n.searchcraft-ad-section {\n align-items: center;\n background-color: #F1F1F1;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n font-size: 16px;\n justify-content: center;\n min-height: 176px;\n text-align: center;\n\n p {\n margin: 0;\n color: var(--sc-content-disabled);\n }\n}\n\n.searchcraft-search-results-empty-state-container {\n text-align: center;\n}\n\n.searchcraft-search-results-error-message-container {\n text-align: center;\n}\n","import {\n Component,\n h,\n Event,\n Prop,\n State,\n type EventEmitter,\n} from '@stencil/core';\n\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport {\n getDocumentValueFromSearchResultMapping,\n serializeStyles,\n} from '@utils/utils';\nimport type { SearchResultMappings } from 'types';\n\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: false,\n})\nexport class SearchcraftBaseSearchResults {\n @Prop() adInterval = 4;\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>>\n | undefined;\n @Prop() searchResultMappings: SearchResultMappings | undefined;\n @Prop() placeAdAtEnd = false;\n @Prop() placeAdAtStart = true;\n @Prop() resultImagePlacement: 'left' | 'right' = 'right';\n @Prop() buttonLabel: string | undefined;\n @Prop() buttonTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n @Prop() buttonRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n @Prop() containerTarget: '_blank' | '_self' | '_top' | '_parent' = '_blank';\n @Prop() containerRel: 'noreferrer' | 'noopener' | 'nofollow' | undefined;\n\n @Event() noResults: EventEmitter<void>;\n\n @State() hasSearched = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n } else {\n this.hasSearched = false;\n }\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n renderDocument(document: Record<string, unknown>, index: number) {\n /**\n * Index field values -> Result container props mappings.\n */\n const titleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.title,\n );\n const subtitleContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.subtitle,\n );\n const bodyContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.body,\n );\n const containerHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.containerHref,\n );\n const buttonHref = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.buttonHref,\n );\n const imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.imageSource,\n );\n const footerContent = getDocumentValueFromSearchResultMapping(\n document,\n this.searchResultMappings.footer,\n );\n\n const serializedStyles =\n typeof this.customStylesForResults === 'string'\n ? this.customStylesForResults\n : serializeStyles(this.customStylesForResults);\n\n return (\n <searchcraft-base-search-result\n key={`${document.document_id}-${index}`}\n custom-styles={serializedStyles}\n image-placement={this.resultImagePlacement}\n container-rel={this.containerRel}\n container-target={this.containerTarget}\n button-label={this.buttonLabel || 'View more'}\n button-rel={this.buttonRel}\n button-target={this.buttonTarget}\n document-position={index}\n title-content={titleContent}\n subtitle-content={subtitleContent}\n body-content={bodyContent}\n footer-content={footerContent}\n container-href={containerHref}\n button-href={buttonHref}\n image-src={imageSource}\n />\n );\n }\n\n render() {\n if (this.query.trim() === '') {\n return (\n <div class='searchcraft-search-results-empty-state-container'>\n <slot name='empty-search' />\n </div>\n );\n }\n\n if (!this.searchResults?.data) {\n return;\n }\n\n const documents: Record<string, unknown>[] =\n this.searchResults?.data?.hits?.map((data, _index) => {\n const { doc: result } = data;\n return result;\n });\n\n const finalComponents: JSX.Element[] = [];\n\n if (this.placeAdAtStart) {\n finalComponents.push(\n <div key='ad-section-start' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.adInterval > 0) {\n documents.forEach((document, index) => {\n finalComponents.push(this.renderDocument(document, index));\n\n if ((index + 1) % this.adInterval === 0) {\n finalComponents.push(\n <div\n key={`ad-section-${index + 1}`}\n class='searchcraft-ad-section '\n >\n <p>Ad Section</p>\n </div>,\n );\n }\n });\n } else {\n const documentElements = documents.map((document, index) =>\n this.renderDocument(document, index),\n );\n finalComponents.push(...documentElements);\n }\n\n if (this.placeAdAtEnd) {\n finalComponents.push(\n <div key='ad-section-end' class='searchcraft-ad-section'>\n <p>Ad Section</p>\n </div>,\n );\n }\n\n if (this.query.length > 0 && this.searchResults?.data?.hits?.length === 0) {\n this.noResults.emit();\n }\n\n return (\n <div class='searchcraft-search-results-container'>\n {finalComponents}\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <div class='searchcraft-search-results-error-message-container'>\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n </div>\n )}\n </div>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,3 +1,3 @@
1
1
  const e="searchcraft-javascript-sdk";const t={allRenderFn:true,appendChildSlotFix:false,asyncLoading:true,asyncQueue:false,attachStyles:true,cloneNodeFix:false,cmpDidLoad:true,cmpDidRender:false,cmpDidUnload:false,cmpDidUpdate:false,cmpShouldUpdate:false,cmpWillLoad:false,cmpWillRender:false,cmpWillUpdate:false,connectedCallback:true,constructableCSS:true,cssAnnotations:true,devTools:false,disconnectedCallback:true,element:false,event:true,experimentalScopedSlotChanges:false,experimentalSlotFixes:false,formAssociated:false,hasRenderFn:true,hostListener:false,hostListenerTarget:false,hostListenerTargetBody:false,hostListenerTargetDocument:false,hostListenerTargetParent:false,hostListenerTargetWindow:false,hotModuleReplacement:false,hydrateClientSide:false,hydrateServerSide:false,hydratedAttribute:false,hydratedClass:true,hydratedSelectorName:"hydrated",initializeNextTick:false,invisiblePrehydration:true,isDebug:false,isDev:false,isTesting:false,lazyLoad:true,lifecycle:true,lifecycleDOMEvents:false,member:true,method:false,mode:false,observeAttribute:true,profile:false,prop:true,propBoolean:true,propMutable:false,propNumber:true,propString:true,reflect:false,scoped:false,scopedSlotTextContentFix:false,scriptDataOpts:false,shadowDelegatesFocus:false,shadowDom:true,slot:true,slotChildNodesFix:false,slotRelocation:true,state:true,style:true,svg:true,taskQueue:true,transformTagName:false,updatable:true,vdomAttribute:true,vdomClass:true,vdomFunctional:true,vdomKey:true,vdomListener:true,vdomPropOrAttr:true,vdomRef:false,vdomRender:true,vdomStyle:true,vdomText:true,vdomXlink:false,watchCallback:true};var r=Object.defineProperty;var n=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:true})};var l=new WeakMap;var s=e=>l.get(e);var o=(e,t)=>l.set(t.t=e,t);var i=(e,t)=>{const r={l:0,$hostElement$:e,o:t,i:new Map};{r.u=new Promise((e=>r.v=e));e["s-p"]=[];e["s-rc"]=[]}return l.set(e,r)};var a=(e,t)=>t in e;var f=(e,t)=>(0,console.error)(e,t);var c=new Map;var u=(e,t,r)=>{const n=e.h.replace(/-/g,"_");const l=e.p;if(!l){return void 0}const s=c.get(l);if(s){return s[n]}
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${l}.entry.js${""}`).then((e=>{{c.set(l,e)}return e[n]}),f)};var v=new Map;var d="{visibility:hidden}.hydrated{visibility:inherit}";var h="slot-fb{display:contents}slot-fb[hidden]{display:none}";var p=typeof window!=="undefined"?window:{};var m=p.document||{head:{}};var y={l:0,m:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,n)=>e.addEventListener(t,r,n),rel:(e,t,r,n)=>e.removeEventListener(t,r,n),ce:(e,t)=>new CustomEvent(e,t)};var b=e=>Promise.resolve(e);var w=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false})();var g=false;var $=[];var S=[];var k=(e,t)=>r=>{e.push(r);if(!g){g=true;if(t&&y.l&4){x(j)}else{y.raf(j)}}};var C=e=>{for(let t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){f(e)}}e.length=0};var j=()=>{C($);{C(S);if(g=$.length>0){y.raf(j)}}};var x=e=>b().then(e);var O=k(S,true);var T={};var E="http://www.w3.org/2000/svg";var D="http://www.w3.org/1999/xhtml";var R=e=>e!=null;var L=e=>{e=typeof e;return e==="object"||e==="function"};function F(e){var t,r,n;return(n=(r=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:r.getAttribute("content"))!=null?n:void 0}var M={};n(M,{err:()=>N,map:()=>P,ok:()=>A,unwrap:()=>U,unwrapErr:()=>W});var A=e=>({isOk:true,isErr:false,value:e});var N=e=>({isOk:false,isErr:true,value:e});function P(e,t){if(e.isOk){const r=t(e.value);if(r instanceof Promise){return r.then((e=>A(e)))}else{return A(r)}}if(e.isErr){const t=e.value;return N(t)}throw"should never get here"}var U=e=>{if(e.isOk){return e.value}else{throw e.value}};var W=e=>{if(e.isErr){return e.value}else{throw e.value}};var H=(e,t="")=>{{return()=>{}}};var z=(e,t)=>{{return()=>{}}};var B=(e,t,...r)=>{let n=null;let l=null;let s=null;let o=false;let i=false;const a=[];const f=t=>{for(let r=0;r<t.length;r++){n=t[r];if(Array.isArray(n)){f(n)}else if(n!=null&&typeof n!=="boolean"){if(o=typeof e!=="function"&&!L(n)){n=String(n)}if(o&&i){a[a.length-1].$+=n}else{a.push(o?I(null,n):n)}i=o}}};f(r);if(t){if(t.key){l=t.key}if(t.name){s=t.name}{const e=t.className||t.class;if(e){t.class=typeof e!=="object"?e:Object.keys(e).filter((t=>e[t])).join(" ")}}}if(typeof e==="function"){return e(t===null?{}:t,a,G)}const c=I(e,null);c.S=t;if(a.length>0){c.k=a}{c.C=l}{c.j=s}return c};var I=(e,t)=>{const r={l:0,O:e,$:t,T:null,k:null};{r.S=null}{r.C=null}{r.j=null}return r};var Q={};var q=e=>e&&e.O===Q;var G={forEach:(e,t)=>e.map(K).forEach(t),map:(e,t)=>e.map(K).map(t).map(V)};var K=e=>({vattrs:e.S,vchildren:e.k,vkey:e.C,vname:e.j,vtag:e.O,vtext:e.$});var V=e=>{if(typeof e.vtag==="function"){const t={...e.vattrs};if(e.vkey){t.key=e.vkey}if(e.vname){t.name=e.vname}return B(e.vtag,t,...e.vchildren||[])}const t=I(e.vtag,e.vtext);t.S=e.vattrs;t.k=e.vchildren;t.C=e.vkey;t.j=e.vname;return t};var X=(e,t)=>{if(e!=null&&!L(e)){if(t&4){return e==="false"?false:e===""||!!e}if(t&2){return parseFloat(e)}if(t&1){return String(e)}return e}return e};var _=e=>s(e).$hostElement$;var J=(e,t,r)=>{const n=_(e);return{emit:e=>Y(n,t,{bubbles:!!(r&4),composed:!!(r&2),cancelable:!!(r&1),detail:e})}};var Y=(e,t,r)=>{const n=y.ce(t,r);e.dispatchEvent(n);return n};var Z=new WeakMap;var ee=(e,t,r)=>{let n=v.get(e);if(w&&r){n=n||new CSSStyleSheet;if(typeof n==="string"){n=t}else{n.replaceSync(t)}}else{n=t}v.set(e,n)};var te=(e,t,r)=>{var n;const l=ne(t);const s=v.get(l);e=e.nodeType===11?e:m;if(s){if(typeof s==="string"){e=e.head||e;let r=Z.get(e);let o;if(!r){Z.set(e,r=new Set)}if(!r.has(l)){{o=m.createElement("style");o.innerHTML=s;const r=(n=y.D)!=null?n:F(m);if(r!=null){o.setAttribute("nonce",r)}if(!(t.l&1)){if(e.nodeName==="HEAD"){const t=e.querySelectorAll("link[rel=preconnect]");const r=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(o,r)}else if("host"in e){if(w){const t=new CSSStyleSheet;t.replaceSync(s);e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");if(t){t.innerHTML=s+t.innerHTML}else{e.prepend(o)}}}else{e.append(o)}}if(t.l&1&&e.nodeName!=="HEAD"){e.insertBefore(o,null)}}if(t.l&4){o.innerHTML+=h}if(r){r.add(l)}}}else if(!e.adoptedStyleSheets.includes(s)){e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]}}return l};var re=e=>{const t=e.o;const r=e.$hostElement$;const n=t.l;const l=H("attachStyles",t.h);const s=te(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);if(n&10&&n&2){r["s-sc"]=s;r.classList.add(s+"-h")}l()};var ne=(e,t)=>"sc-"+e.h;var le=(e,t,r,n,l,s)=>{if(r!==n){let o=a(e,t);let i=t.toLowerCase();if(t==="class"){const t=e.classList;const l=oe(r);const s=oe(n);t.remove(...l.filter((e=>e&&!s.includes(e))));t.add(...s.filter((e=>e&&!l.includes(e))))}else if(t==="style"){{for(const t in r){if(!n||n[t]==null){if(t.includes("-")){e.style.removeProperty(t)}else{e.style[t]=""}}}}for(const t in n){if(!r||n[t]!==r[t]){if(t.includes("-")){e.style.setProperty(t,n[t])}else{e.style[t]=n[t]}}}}else if(t==="key");else if(!o&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"){t=t.slice(3)}else if(a(p,i)){t=i.slice(2)}else{t=i[2]+t.slice(3)}if(r||n){const l=t.endsWith(ie);t=t.replace(ae,"");if(r){y.rel(e,t,r,l)}if(n){y.ael(e,t,n,l)}}}else{const i=L(n);if((o||i&&n!==null)&&!l){try{if(!e.tagName.includes("-")){const l=n==null?"":n;if(t==="list"){o=false}else if(r==null||e[t]!=l){if(typeof e.__lookupSetter__(t)==="function"){e[t]=l}else{e.setAttribute(t,l)}}}else{e[t]=n}}catch(e){}}if(n==null||n===false){if(n!==false||e.getAttribute(t)===""){{e.removeAttribute(t)}}}else if((!o||s&4||l)&&!i){n=n===true?"":n;{e.setAttribute(t,n)}}}}};var se=/\s/;var oe=e=>!e?[]:e.split(se);var ie="Capture";var ae=new RegExp(ie+"$");var fe=(e,t,r)=>{const n=t.T.nodeType===11&&t.T.host?t.T.host:t.T;const l=e&&e.S||T;const s=t.S||T;{for(const e of ce(Object.keys(l))){if(!(e in s)){le(n,e,l[e],void 0,r,t.l)}}}for(const e of ce(Object.keys(s))){le(n,e,l[e],s[e],r,t.l)}};function ce(e){return e.includes("ref")?[...e.filter((e=>e!=="ref")),"ref"]:e}var ue;var ve;var de;var he=false;var pe=false;var me=false;var ye=false;var be=(e,r,n,l)=>{var s;const o=r.k[n];let i=0;let a;let f;let c;if(!he){me=true;if(o.O==="slot"){if(ue){l.classList.add(ue+"-s")}o.l|=o.k?2:1}}if(o.$!==null){a=o.T=m.createTextNode(o.$)}else if(o.l&1){a=o.T=m.createTextNode("")}else{if(!ye){ye=o.O==="svg"}a=o.T=m.createElementNS(ye?E:D,!he&&t.slotRelocation&&o.l&2?"slot-fb":o.O);if(ye&&o.O==="foreignObject"){ye=false}{fe(null,o,ye)}const r=a.getRootNode();const n=!r.querySelector("body");if(!n&&t.scoped&&R(ue)&&a["s-si"]!==ue){a.classList.add(a["s-si"]=ue)}if(o.k){for(i=0;i<o.k.length;++i){f=be(e,o,i,a);if(f){a.appendChild(f)}}}{if(o.O==="svg"){ye=false}else if(a.tagName==="foreignObject"){ye=true}}}a["s-hn"]=de;{if(o.l&(2|1)){a["s-sr"]=true;a["s-cr"]=ve;a["s-sn"]=o.j||"";a["s-rf"]=(s=o.S)==null?void 0:s.ref;c=e&&e.k&&e.k[n];if(c&&c.O===o.O&&e.T){{we(e.T,false)}}}}return a};var we=(e,r)=>{y.l|=1;const n=Array.from(e.childNodes);if(e["s-sr"]&&t.experimentalSlotFixes){let t=e;while(t=t.nextSibling){if(t&&t["s-sn"]===e["s-sn"]&&t["s-sh"]===de){n.push(t)}}}for(let e=n.length-1;e>=0;e--){const t=n[e];if(t["s-hn"]!==de&&t["s-ol"]){Re(je(t),t,Ce(t));t["s-ol"].remove();t["s-ol"]=void 0;t["s-sh"]=void 0;me=true}if(r){we(t,r)}}y.l&=~1};var ge=(e,t,r,n,l,s)=>{let o=e["s-cr"]&&e["s-cr"].parentNode||e;let i;if(o.shadowRoot&&o.tagName===de){o=o.shadowRoot}for(;l<=s;++l){if(n[l]){i=be(null,r,l,e);if(i){n[l].T=i;Re(o,i,Ce(t))}}}};var $e=(e,t,r)=>{for(let n=t;n<=r;++n){const t=e[n];if(t){const e=t.T;if(e){{pe=true;if(e["s-ol"]){e["s-ol"].remove()}else{we(e,true)}}e.remove()}}}};var Se=(e,t,r,n,l=false)=>{let s=0;let o=0;let i=0;let a=0;let f=t.length-1;let c=t[0];let u=t[f];let v=n.length-1;let d=n[0];let h=n[v];let p;let m;while(s<=f&&o<=v){if(c==null){c=t[++s]}else if(u==null){u=t[--f]}else if(d==null){d=n[++o]}else if(h==null){h=n[--v]}else if(ke(c,d,l)){xe(c,d,l);c=t[++s];d=n[++o]}else if(ke(u,h,l)){xe(u,h,l);u=t[--f];h=n[--v]}else if(ke(c,h,l)){if(c.O==="slot"||h.O==="slot"){we(c.T.parentNode,false)}xe(c,h,l);Re(e,c.T,u.T.nextSibling);c=t[++s];h=n[--v]}else if(ke(u,d,l)){if(c.O==="slot"||h.O==="slot"){we(u.T.parentNode,false)}xe(u,d,l);Re(e,u.T,c.T);u=t[--f];d=n[++o]}else{i=-1;{for(a=s;a<=f;++a){if(t[a]&&t[a].C!==null&&t[a].C===d.C){i=a;break}}}if(i>=0){m=t[i];if(m.O!==d.O){p=be(t&&t[o],r,i,e)}else{xe(m,d,l);t[i]=void 0;p=m.T}d=n[++o]}else{p=be(t&&t[o],r,o,e);d=n[++o]}if(p){{Re(je(c.T),p,Ce(c.T))}}}}if(s>f){ge(e,n[v+1]==null?null:n[v+1].T,r,n,o,v)}else if(o>v){$e(t,s,f)}};var ke=(e,t,r=false)=>{if(e.O===t.O){if(e.O==="slot"){if("R"in e&&r&&e.T.nodeType!==8){return false}return e.j===t.j}if(!r){return e.C===t.C}return true}return false};var Ce=e=>e&&e["s-ol"]||e;var je=e=>(e["s-ol"]?e["s-ol"]:e).parentNode;var xe=(e,r,n=false)=>{const l=r.T=e.T;const s=e.k;const o=r.k;const i=r.O;const a=r.$;let f;if(a===null){{ye=i==="svg"?true:i==="foreignObject"?false:ye}{if(i==="slot"&&!he);else{fe(e,r,ye)}}if(s!==null&&o!==null){Se(l,s,r,o,n)}else if(o!==null){if(e.$!==null){l.textContent=""}ge(l,null,r,o,0,o.length-1)}else if(!n&&t.updatable&&s!==null){$e(s,0,s.length-1)}if(ye&&i==="svg"){ye=false}}else if(f=l["s-cr"]){f.parentNode.textContent=a}else if(e.$!==a){l.data=a}};var Oe=e=>{const t=e.childNodes;for(const e of t){if(e.nodeType===1){if(e["s-sr"]){const r=e["s-sn"];e.hidden=false;for(const n of t){if(n!==e){if(n["s-hn"]!==e["s-hn"]||r!==""){if(n.nodeType===1&&(r===n.getAttribute("slot")||r===n["s-sn"])||n.nodeType===3&&r===n["s-sn"]){e.hidden=true;break}}else{if(n.nodeType===1||n.nodeType===3&&n.textContent.trim()!==""){e.hidden=true;break}}}}}Oe(e)}}};var Te=[];var Ee=e=>{let r;let n;let l;for(const s of e.childNodes){if(s["s-sr"]&&(r=s["s-cr"])&&r.parentNode){n=r.parentNode.childNodes;const e=s["s-sn"];for(l=n.length-1;l>=0;l--){r=n[l];if(!r["s-cn"]&&!r["s-nr"]&&r["s-hn"]!==s["s-hn"]&&!t.experimentalSlotFixes){if(De(r,e)){let t=Te.find((e=>e.L===r));pe=true;r["s-sn"]=r["s-sn"]||e;if(t){t.L["s-sh"]=s["s-hn"];t.F=s}else{r["s-sh"]=s["s-hn"];Te.push({F:s,L:r})}if(r["s-sr"]){Te.map((e=>{if(De(e.L,r["s-sn"])){t=Te.find((e=>e.L===r));if(t&&!e.F){e.F=t.F}}}))}}else if(!Te.some((e=>e.L===r))){Te.push({L:r})}}}}if(s.nodeType===1){Ee(s)}}};var De=(e,t)=>{if(e.nodeType===1){if(e.getAttribute("slot")===null&&t===""){return true}if(e.getAttribute("slot")===t){return true}return false}if(e["s-sn"]===t){return true}return t===""};var Re=(e,t,r)=>{const n=e==null?void 0:e.insertBefore(t,r);return n};var Le=(e,t,r=false)=>{var n,l,s,o;const i=e.$hostElement$;const a=e.o;const f=e.M||I(null,null);const c=q(t)?t:B(null,null,t);de=i.tagName;if(r&&c.S){for(const e of Object.keys(c.S)){if(i.hasAttribute(e)&&!["key","ref","style","class"].includes(e)){c.S[e]=i[e]}}}c.O=null;c.l|=4;e.M=c;c.T=f.T=i.shadowRoot||i;{ue=i["s-sc"]}he=(a.l&1)!==0;{ve=i["s-cr"];pe=false}xe(f,c,r);{y.l|=1;if(me){Ee(c.T);for(const e of Te){const t=e.L;if(!t["s-ol"]){const e=m.createTextNode("");e["s-nr"]=t;Re(t.parentNode,t["s-ol"]=e,t)}}for(const e of Te){const t=e.L;const i=e.F;if(i){const e=i.parentNode;let r=i.nextSibling;{let s=(n=t["s-ol"])==null?void 0:n.previousSibling;while(s){let n=(l=s["s-nr"])!=null?l:null;if(n&&n["s-sn"]===t["s-sn"]&&e===n.parentNode){n=n.nextSibling;while(n===t||(n==null?void 0:n["s-sr"])){n=n==null?void 0:n.nextSibling}if(!n||!n["s-nr"]){r=n;break}}s=s.previousSibling}}if(!r&&e!==t.parentNode||t.nextSibling!==r){if(t!==r){if(!t["s-hn"]&&t["s-ol"]){t["s-hn"]=t["s-ol"].parentNode.nodeName}Re(e,t,r);if(t.nodeType===1){t.hidden=(s=t["s-ih"])!=null?s:false}}}t&&typeof i["s-rf"]==="function"&&i["s-rf"](t)}else{if(t.nodeType===1){if(r){t["s-ih"]=(o=t.hidden)!=null?o:false}t.hidden=true}}}}if(pe){Oe(c.T)}y.l&=~1;Te.length=0}ve=void 0};var Fe=(e,t)=>{if(t&&!e.A&&t["s-p"]){t["s-p"].push(new Promise((t=>e.A=t)))}};var Me=(e,t)=>{{e.l|=16}if(e.l&4){e.l|=512;return}Fe(e,e.N);const r=()=>Ae(e,t);return O(r)};var Ae=(e,t)=>{const r=e.$hostElement$;const n=H("scheduleUpdate",e.o.h);const l=e.t;if(!l){throw new Error(`Can't render component <${r.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`)}let s;n();return Ne(s,(()=>Ue(e,l,t)))};var Ne=(e,t)=>Pe(e)?e.then(t).catch((e=>{console.error(e);t()})):t();var Pe=e=>e instanceof Promise||e&&e.then&&typeof e.then==="function";var Ue=async(e,t,r)=>{var n;const l=e.$hostElement$;const s=H("update",e.o.h);const o=l["s-rc"];if(r){re(e)}const i=H("render",e.o.h);{We(e,t,l,r)}if(o){o.map((e=>e()));l["s-rc"]=void 0}i();s();{const t=(n=l["s-p"])!=null?n:[];const r=()=>He(e);if(t.length===0){r()}else{Promise.all(t).then(r);e.l|=4;t.length=0}}};var We=(e,t,r,n)=>{try{t=t.render();{e.l&=~16}{e.l|=2}{{{Le(e,t,n)}}}}catch(t){f(t,e.$hostElement$)}return null};var He=e=>{const t=e.o.h;const r=e.$hostElement$;const n=H("postUpdate",t);const l=e.t;const s=e.N;if(!(e.l&64)){e.l|=64;{Ie(r)}{Be(l,"componentDidLoad")}n();{e.v(r);if(!s){ze()}}}else{n()}{if(e.A){e.A();e.A=void 0}if(e.l&512){x((()=>Me(e,false)))}e.l&=~(4|512)}};var ze=t=>{{Ie(m.documentElement)}x((()=>Y(p,"appload",{detail:{namespace:e}})))};var Be=(e,t,r)=>{if(e&&e[t]){try{return e[t](r)}catch(e){f(e)}}return void 0};var Ie=e=>{var r;return e.classList.add((r=t.hydratedSelectorName)!=null?r:"hydrated")};var Qe=(e,t)=>s(e).i.get(t);var qe=(e,t,r,n)=>{const l=s(e);if(!l){throw new Error(`Couldn't find host element for "${n.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`)}const o=l.$hostElement$;const i=l.i.get(t);const a=l.l;const c=l.t;r=X(r,n.P[t][0]);const u=Number.isNaN(i)&&Number.isNaN(r);const v=r!==i&&!u;if((!(a&8)||i===void 0)&&v){l.i.set(t,r);if(c){if(n.U&&a&128){const e=n.U[t];if(e){e.map((e=>{try{c[e](r,i,t)}catch(e){f(e,o)}}))}}if((a&(2|16))===2){Me(l,false)}}}};var Ge=(e,t,r)=>{var n,l;const o=e.prototype;if(t.P||(t.U||e.watchers)){if(e.watchers&&!t.U){t.U=e.watchers}const i=Object.entries((n=t.P)!=null?n:{});i.map((([e,[n]])=>{if(n&31||r&2&&n&32){Object.defineProperty(o,e,{get(){return Qe(this,e)},set(r){qe(this,e,r,t)},configurable:true,enumerable:true})}}));if(r&1){const r=new Map;o.attributeChangedCallback=function(e,n,l){y.jmp((()=>{var i;const a=r.get(e);if(this.hasOwnProperty(a)){l=this[a];delete this[a]}else if(o.hasOwnProperty(a)&&typeof this[a]==="number"&&this[a]==l){return}else if(a==null){const r=s(this);const o=r==null?void 0:r.l;if(o&&!(o&8)&&o&128&&l!==n){const s=r.t;const o=(i=t.U)==null?void 0:i[e];o==null?void 0:o.forEach((t=>{if(s[t]!=null){s[t].call(s,l,n,e)}}))}return}this[a]=l===null&&typeof this[a]==="boolean"?false:l}))};e.observedAttributes=Array.from(new Set([...Object.keys((l=t.U)!=null?l:{}),...i.filter((([e,t])=>t[0]&15)).map((([e,t])=>{const n=t[1]||e;r.set(n,e);return n}))]))}}return e};var Ke=async(e,t,r,n)=>{let l;if((t.l&32)===0){t.l|=32;const n=r.p;if(n){const e=u(r);if(e&&"then"in e){const t=z();l=await e;t()}else{l=e}if(!l){throw new Error(`Constructor for "${r.h}#${t.W}" was not found`)}if(!l.isProxied){{r.U=l.watchers}Ge(l,r,2);l.isProxied=true}const n=H("createInstance",r.h);{t.l|=8}try{new l(t)}catch(e){f(e)}{t.l&=~8}{t.l|=128}n();Ve(t.t)}else{l=e.constructor;const r=e.localName;customElements.whenDefined(r).then((()=>t.l|=128))}if(l&&l.style){let e;if(typeof l.style==="string"){e=l.style}const t=ne(r);if(!v.has(t)){const n=H("registerStyles",r.h);ee(t,e,!!(r.l&1));n()}}}const s=t.N;const o=()=>Me(t,true);if(s&&s["s-rc"]){s["s-rc"].push(o)}else{o()}};var Ve=e=>{{Be(e,"connectedCallback")}};var Xe=e=>{if((y.l&1)===0){const t=s(e);const r=t.o;const n=H("connectedCallback",r.h);if(!(t.l&1)){t.l|=1;{if(r.l&(4|8)){_e(e)}}{let r=e;while(r=r.parentNode||r.host){if(r["s-p"]){Fe(t,t.N=r);break}}}if(r.P){Object.entries(r.P).map((([t,[r]])=>{if(r&31&&e.hasOwnProperty(t)){const r=e[t];delete e[t];e[t]=r}}))}{Ke(e,t,r)}}else{if(t==null?void 0:t.t){Ve(t.t)}else if(t==null?void 0:t.u){t.u.then((()=>Ve(t.t)))}}n()}};var _e=e=>{const t=e["s-cr"]=m.createComment("");t["s-cn"]=true;Re(e,t,e.firstChild)};var Je=e=>{{Be(e,"disconnectedCallback")}};var Ye=async e=>{if((y.l&1)===0){const t=s(e);if(t==null?void 0:t.t){Je(t.t)}else if(t==null?void 0:t.u){t.u.then((()=>Je(t.t)))}}};var Ze=(e,t={})=>{var r;const n=H();const l=[];const o=t.exclude||[];const a=p.customElements;const f=m.head;const c=f.querySelector("meta[charset]");const u=m.createElement("style");const v=[];let b;let w=true;Object.assign(y,t);y.m=new URL(t.resourcesUrl||"./",m.baseURI).href;let g=false;e.map((e=>{e[1].map((t=>{var r;const n={l:t[0],h:t[1],P:t[2],H:t[3]};if(n.l&4){g=true}{n.P=t[2]}{n.U=(r=t[4])!=null?r:{}}const f=n.h;const c=class extends HTMLElement{constructor(e){super(e);this.hasRegisteredEventListeners=false;e=this;i(e,n);if(n.l&1){{if(!e.shadowRoot){{e.attachShadow({mode:"open"})}}else{if(e.shadowRoot.mode!=="open"){throw new Error(`Unable to re-use existing shadow root for ${n.h}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}}}}connectedCallback(){s(this);if(!this.hasRegisteredEventListeners){this.hasRegisteredEventListeners=true}if(b){clearTimeout(b);b=null}if(w){v.push(this)}else{y.jmp((()=>Xe(this)))}}disconnectedCallback(){y.jmp((()=>Ye(this)))}componentOnReady(){return s(this).u}};n.p=e[0];if(!o.includes(f)&&!a.get(f)){l.push(f);a.define(f,Ge(c,n,1))}}))}));if(l.length>0){if(g){u.textContent+=h}{u.textContent+=l.sort()+d}if(u.innerHTML.length){u.setAttribute("data-styles","");const e=(r=y.D)!=null?r:F(m);if(e!=null){u.setAttribute("nonce",e)}f.insertBefore(u,c?c.nextSibling:f.firstChild)}}w=false;if(v.length){v.map((e=>e.connectedCallback()))}else{{y.jmp((()=>b=setTimeout(ze,30)))}}n()};var et=(e,t)=>t;var tt=e=>y.D=e;export{et as F,Ze as b,J as c,B as h,b as p,o as r,tt as s};
3
- //# sourceMappingURL=p-4c32c87d.js.map
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${l}.entry.js${""}`).then((e=>{{c.set(l,e)}return e[n]}),f)};var v=new Map;var d="{visibility:hidden}.hydrated{visibility:inherit}";var h="slot-fb{display:contents}slot-fb[hidden]{display:none}";var p=typeof window!=="undefined"?window:{};var m=p.document||{head:{}};var y={l:0,m:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,r,n)=>e.addEventListener(t,r,n),rel:(e,t,r,n)=>e.removeEventListener(t,r,n),ce:(e,t)=>new CustomEvent(e,t)};var b=e=>Promise.resolve(e);var w=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false})();var g=false;var $=[];var S=[];var k=(e,t)=>r=>{e.push(r);if(!g){g=true;if(t&&y.l&4){x(j)}else{y.raf(j)}}};var C=e=>{for(let t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){f(e)}}e.length=0};var j=()=>{C($);{C(S);if(g=$.length>0){y.raf(j)}}};var x=e=>b().then(e);var O=k(S,true);var T={};var E="http://www.w3.org/2000/svg";var D="http://www.w3.org/1999/xhtml";var R=e=>e!=null;var L=e=>{e=typeof e;return e==="object"||e==="function"};function F(e){var t,r,n;return(n=(r=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:r.getAttribute("content"))!=null?n:void 0}var M={};n(M,{err:()=>N,map:()=>P,ok:()=>A,unwrap:()=>U,unwrapErr:()=>W});var A=e=>({isOk:true,isErr:false,value:e});var N=e=>({isOk:false,isErr:true,value:e});function P(e,t){if(e.isOk){const r=t(e.value);if(r instanceof Promise){return r.then((e=>A(e)))}else{return A(r)}}if(e.isErr){const t=e.value;return N(t)}throw"should never get here"}var U=e=>{if(e.isOk){return e.value}else{throw e.value}};var W=e=>{if(e.isErr){return e.value}else{throw e.value}};var H=(e,t="")=>{{return()=>{}}};var z=(e,t)=>{{return()=>{}}};var B=(e,t,...r)=>{let n=null;let l=null;let s=null;let o=false;let i=false;const a=[];const f=t=>{for(let r=0;r<t.length;r++){n=t[r];if(Array.isArray(n)){f(n)}else if(n!=null&&typeof n!=="boolean"){if(o=typeof e!=="function"&&!L(n)){n=String(n)}if(o&&i){a[a.length-1].$+=n}else{a.push(o?I(null,n):n)}i=o}}};f(r);if(t){if(t.key){l=t.key}if(t.name){s=t.name}{const e=t.className||t.class;if(e){t.class=typeof e!=="object"?e:Object.keys(e).filter((t=>e[t])).join(" ")}}}if(typeof e==="function"){return e(t===null?{}:t,a,G)}const c=I(e,null);c.S=t;if(a.length>0){c.k=a}{c.C=l}{c.j=s}return c};var I=(e,t)=>{const r={l:0,O:e,$:t,T:null,k:null};{r.S=null}{r.C=null}{r.j=null}return r};var Q={};var q=e=>e&&e.O===Q;var G={forEach:(e,t)=>e.map(K).forEach(t),map:(e,t)=>e.map(K).map(t).map(V)};var K=e=>({vattrs:e.S,vchildren:e.k,vkey:e.C,vname:e.j,vtag:e.O,vtext:e.$});var V=e=>{if(typeof e.vtag==="function"){const t={...e.vattrs};if(e.vkey){t.key=e.vkey}if(e.vname){t.name=e.vname}return B(e.vtag,t,...e.vchildren||[])}const t=I(e.vtag,e.vtext);t.S=e.vattrs;t.k=e.vchildren;t.C=e.vkey;t.j=e.vname;return t};var X=(e,t)=>{if(e!=null&&!L(e)){if(t&4){return e==="false"?false:e===""||!!e}if(t&2){return parseFloat(e)}if(t&1){return String(e)}return e}return e};var _=e=>s(e).$hostElement$;var J=(e,t,r)=>{const n=_(e);return{emit:e=>Y(n,t,{bubbles:!!(r&4),composed:!!(r&2),cancelable:!!(r&1),detail:e})}};var Y=(e,t,r)=>{const n=y.ce(t,r);e.dispatchEvent(n);return n};var Z=new WeakMap;var ee=(e,t,r)=>{let n=v.get(e);if(w&&r){n=n||new CSSStyleSheet;if(typeof n==="string"){n=t}else{n.replaceSync(t)}}else{n=t}v.set(e,n)};var te=(e,t,r)=>{var n;const l=ne(t);const s=v.get(l);e=e.nodeType===11?e:m;if(s){if(typeof s==="string"){e=e.head||e;let r=Z.get(e);let o;if(!r){Z.set(e,r=new Set)}if(!r.has(l)){{o=m.createElement("style");o.innerHTML=s;const r=(n=y.D)!=null?n:F(m);if(r!=null){o.setAttribute("nonce",r)}if(!(t.l&1)){if(e.nodeName==="HEAD"){const t=e.querySelectorAll("link[rel=preconnect]");const r=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(o,r)}else if("host"in e){if(w){const t=new CSSStyleSheet;t.replaceSync(s);e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");if(t){t.innerHTML=s+t.innerHTML}else{e.prepend(o)}}}else{e.append(o)}}if(t.l&1&&e.nodeName!=="HEAD"){e.insertBefore(o,null)}}if(t.l&4){o.innerHTML+=h}if(r){r.add(l)}}}else if(!e.adoptedStyleSheets.includes(s)){e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]}}return l};var re=e=>{const t=e.o;const r=e.$hostElement$;const n=t.l;const l=H("attachStyles",t.h);const s=te(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);if(n&10&&n&2){r["s-sc"]=s;r.classList.add(s+"-h")}l()};var ne=(e,t)=>"sc-"+e.h;var le=(e,t,r,n,l,s)=>{if(r!==n){let o=a(e,t);let i=t.toLowerCase();if(t==="class"){const t=e.classList;const l=oe(r);const s=oe(n);t.remove(...l.filter((e=>e&&!s.includes(e))));t.add(...s.filter((e=>e&&!l.includes(e))))}else if(t==="style"){{for(const t in r){if(!n||n[t]==null){if(t.includes("-")){e.style.removeProperty(t)}else{e.style[t]=""}}}}for(const t in n){if(!r||n[t]!==r[t]){if(t.includes("-")){e.style.setProperty(t,n[t])}else{e.style[t]=n[t]}}}}else if(t==="key");else if(!o&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"){t=t.slice(3)}else if(a(p,i)){t=i.slice(2)}else{t=i[2]+t.slice(3)}if(r||n){const l=t.endsWith(ie);t=t.replace(ae,"");if(r){y.rel(e,t,r,l)}if(n){y.ael(e,t,n,l)}}}else{const i=L(n);if((o||i&&n!==null)&&!l){try{if(!e.tagName.includes("-")){const l=n==null?"":n;if(t==="list"){o=false}else if(r==null||e[t]!=l){if(typeof e.__lookupSetter__(t)==="function"){e[t]=l}else{e.setAttribute(t,l)}}}else{e[t]=n}}catch(e){}}if(n==null||n===false){if(n!==false||e.getAttribute(t)===""){{e.removeAttribute(t)}}}else if((!o||s&4||l)&&!i){n=n===true?"":n;{e.setAttribute(t,n)}}}}};var se=/\s/;var oe=e=>!e?[]:e.split(se);var ie="Capture";var ae=new RegExp(ie+"$");var fe=(e,t,r)=>{const n=t.T.nodeType===11&&t.T.host?t.T.host:t.T;const l=e&&e.S||T;const s=t.S||T;{for(const e of ce(Object.keys(l))){if(!(e in s)){le(n,e,l[e],void 0,r,t.l)}}}for(const e of ce(Object.keys(s))){le(n,e,l[e],s[e],r,t.l)}};function ce(e){return e.includes("ref")?[...e.filter((e=>e!=="ref")),"ref"]:e}var ue;var ve;var de;var he=false;var pe=false;var me=false;var ye=false;var be=(e,r,n,l)=>{var s;const o=r.k[n];let i=0;let a;let f;let c;if(!he){me=true;if(o.O==="slot"){if(ue){l.classList.add(ue+"-s")}o.l|=o.k?2:1}}if(o.$!==null){a=o.T=m.createTextNode(o.$)}else if(o.l&1){a=o.T=m.createTextNode("")}else{if(!ye){ye=o.O==="svg"}a=o.T=m.createElementNS(ye?E:D,!he&&t.slotRelocation&&o.l&2?"slot-fb":o.O);if(ye&&o.O==="foreignObject"){ye=false}{fe(null,o,ye)}const r=a.getRootNode();const n=!r.querySelector("body");if(!n&&t.scoped&&R(ue)&&a["s-si"]!==ue){a.classList.add(a["s-si"]=ue)}if(o.k){for(i=0;i<o.k.length;++i){f=be(e,o,i,a);if(f){a.appendChild(f)}}}{if(o.O==="svg"){ye=false}else if(a.tagName==="foreignObject"){ye=true}}}a["s-hn"]=de;{if(o.l&(2|1)){a["s-sr"]=true;a["s-cr"]=ve;a["s-sn"]=o.j||"";a["s-rf"]=(s=o.S)==null?void 0:s.ref;c=e&&e.k&&e.k[n];if(c&&c.O===o.O&&e.T){{we(e.T,false)}}}}return a};var we=(e,r)=>{y.l|=1;const n=Array.from(e.childNodes);if(e["s-sr"]&&t.experimentalSlotFixes){let t=e;while(t=t.nextSibling){if(t&&t["s-sn"]===e["s-sn"]&&t["s-sh"]===de){n.push(t)}}}for(let e=n.length-1;e>=0;e--){const t=n[e];if(t["s-hn"]!==de&&t["s-ol"]){Re(je(t),t,Ce(t));t["s-ol"].remove();t["s-ol"]=void 0;t["s-sh"]=void 0;me=true}if(r){we(t,r)}}y.l&=~1};var ge=(e,t,r,n,l,s)=>{let o=e["s-cr"]&&e["s-cr"].parentNode||e;let i;if(o.shadowRoot&&o.tagName===de){o=o.shadowRoot}for(;l<=s;++l){if(n[l]){i=be(null,r,l,e);if(i){n[l].T=i;Re(o,i,Ce(t))}}}};var $e=(e,t,r)=>{for(let n=t;n<=r;++n){const t=e[n];if(t){const e=t.T;if(e){{pe=true;if(e["s-ol"]){e["s-ol"].remove()}else{we(e,true)}}e.remove()}}}};var Se=(e,t,r,n,l=false)=>{let s=0;let o=0;let i=0;let a=0;let f=t.length-1;let c=t[0];let u=t[f];let v=n.length-1;let d=n[0];let h=n[v];let p;let m;while(s<=f&&o<=v){if(c==null){c=t[++s]}else if(u==null){u=t[--f]}else if(d==null){d=n[++o]}else if(h==null){h=n[--v]}else if(ke(c,d,l)){xe(c,d,l);c=t[++s];d=n[++o]}else if(ke(u,h,l)){xe(u,h,l);u=t[--f];h=n[--v]}else if(ke(c,h,l)){if(c.O==="slot"||h.O==="slot"){we(c.T.parentNode,false)}xe(c,h,l);Re(e,c.T,u.T.nextSibling);c=t[++s];h=n[--v]}else if(ke(u,d,l)){if(c.O==="slot"||h.O==="slot"){we(u.T.parentNode,false)}xe(u,d,l);Re(e,u.T,c.T);u=t[--f];d=n[++o]}else{i=-1;{for(a=s;a<=f;++a){if(t[a]&&t[a].C!==null&&t[a].C===d.C){i=a;break}}}if(i>=0){m=t[i];if(m.O!==d.O){p=be(t&&t[o],r,i,e)}else{xe(m,d,l);t[i]=void 0;p=m.T}d=n[++o]}else{p=be(t&&t[o],r,o,e);d=n[++o]}if(p){{Re(je(c.T),p,Ce(c.T))}}}}if(s>f){ge(e,n[v+1]==null?null:n[v+1].T,r,n,o,v)}else if(o>v){$e(t,s,f)}};var ke=(e,t,r=false)=>{if(e.O===t.O){if(e.O==="slot"){if("R"in e&&r&&e.T.nodeType!==8){return false}return e.j===t.j}if(!r){return e.C===t.C}return true}return false};var Ce=e=>e&&e["s-ol"]||e;var je=e=>(e["s-ol"]?e["s-ol"]:e).parentNode;var xe=(e,r,n=false)=>{const l=r.T=e.T;const s=e.k;const o=r.k;const i=r.O;const a=r.$;let f;if(a===null){{ye=i==="svg"?true:i==="foreignObject"?false:ye}{if(i==="slot"&&!he);else{fe(e,r,ye)}}if(s!==null&&o!==null){Se(l,s,r,o,n)}else if(o!==null){if(e.$!==null){l.textContent=""}ge(l,null,r,o,0,o.length-1)}else if(!n&&t.updatable&&s!==null){$e(s,0,s.length-1)}if(ye&&i==="svg"){ye=false}}else if(f=l["s-cr"]){f.parentNode.textContent=a}else if(e.$!==a){l.data=a}};var Oe=e=>{const t=e.childNodes;for(const e of t){if(e.nodeType===1){if(e["s-sr"]){const r=e["s-sn"];e.hidden=false;for(const n of t){if(n!==e){if(n["s-hn"]!==e["s-hn"]||r!==""){if(n.nodeType===1&&(r===n.getAttribute("slot")||r===n["s-sn"])||n.nodeType===3&&r===n["s-sn"]){e.hidden=true;break}}else{if(n.nodeType===1||n.nodeType===3&&n.textContent.trim()!==""){e.hidden=true;break}}}}}Oe(e)}}};var Te=[];var Ee=e=>{let r;let n;let l;for(const s of e.childNodes){if(s["s-sr"]&&(r=s["s-cr"])&&r.parentNode){n=r.parentNode.childNodes;const e=s["s-sn"];for(l=n.length-1;l>=0;l--){r=n[l];if(!r["s-cn"]&&!r["s-nr"]&&r["s-hn"]!==s["s-hn"]&&!t.experimentalSlotFixes){if(De(r,e)){let t=Te.find((e=>e.L===r));pe=true;r["s-sn"]=r["s-sn"]||e;if(t){t.L["s-sh"]=s["s-hn"];t.F=s}else{r["s-sh"]=s["s-hn"];Te.push({F:s,L:r})}if(r["s-sr"]){Te.map((e=>{if(De(e.L,r["s-sn"])){t=Te.find((e=>e.L===r));if(t&&!e.F){e.F=t.F}}}))}}else if(!Te.some((e=>e.L===r))){Te.push({L:r})}}}}if(s.nodeType===1){Ee(s)}}};var De=(e,t)=>{if(e.nodeType===1){if(e.getAttribute("slot")===null&&t===""){return true}if(e.getAttribute("slot")===t){return true}return false}if(e["s-sn"]===t){return true}return t===""};var Re=(e,t,r)=>{const n=e==null?void 0:e.insertBefore(t,r);return n};var Le=(e,t,r=false)=>{var n,l,s,o;const i=e.$hostElement$;const a=e.o;const f=e.M||I(null,null);const c=q(t)?t:B(null,null,t);de=i.tagName;if(r&&c.S){for(const e of Object.keys(c.S)){if(i.hasAttribute(e)&&!["key","ref","style","class"].includes(e)){c.S[e]=i[e]}}}c.O=null;c.l|=4;e.M=c;c.T=f.T=i.shadowRoot||i;{ue=i["s-sc"]}he=(a.l&1)!==0;{ve=i["s-cr"];pe=false}xe(f,c,r);{y.l|=1;if(me){Ee(c.T);for(const e of Te){const t=e.L;if(!t["s-ol"]){const e=m.createTextNode("");e["s-nr"]=t;Re(t.parentNode,t["s-ol"]=e,t)}}for(const e of Te){const t=e.L;const i=e.F;if(i){const e=i.parentNode;let r=i.nextSibling;{let s=(n=t["s-ol"])==null?void 0:n.previousSibling;while(s){let n=(l=s["s-nr"])!=null?l:null;if(n&&n["s-sn"]===t["s-sn"]&&e===n.parentNode){n=n.nextSibling;while(n===t||(n==null?void 0:n["s-sr"])){n=n==null?void 0:n.nextSibling}if(!n||!n["s-nr"]){r=n;break}}s=s.previousSibling}}if(!r&&e!==t.parentNode||t.nextSibling!==r){if(t!==r){if(!t["s-hn"]&&t["s-ol"]){t["s-hn"]=t["s-ol"].parentNode.nodeName}Re(e,t,r);if(t.nodeType===1){t.hidden=(s=t["s-ih"])!=null?s:false}}}t&&typeof i["s-rf"]==="function"&&i["s-rf"](t)}else{if(t.nodeType===1){if(r){t["s-ih"]=(o=t.hidden)!=null?o:false}t.hidden=true}}}}if(pe){Oe(c.T)}y.l&=~1;Te.length=0}ve=void 0};var Fe=(e,t)=>{if(t&&!e.A&&t["s-p"]){t["s-p"].push(new Promise((t=>e.A=t)))}};var Me=(e,t)=>{{e.l|=16}if(e.l&4){e.l|=512;return}Fe(e,e.N);const r=()=>Ae(e,t);return O(r)};var Ae=(e,t)=>{const r=e.$hostElement$;const n=H("scheduleUpdate",e.o.h);const l=e.t;if(!l){throw new Error(`Can't render component <${r.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`)}let s;n();return Ne(s,(()=>Ue(e,l,t)))};var Ne=(e,t)=>Pe(e)?e.then(t).catch((e=>{console.error(e);t()})):t();var Pe=e=>e instanceof Promise||e&&e.then&&typeof e.then==="function";var Ue=async(e,t,r)=>{var n;const l=e.$hostElement$;const s=H("update",e.o.h);const o=l["s-rc"];if(r){re(e)}const i=H("render",e.o.h);{We(e,t,l,r)}if(o){o.map((e=>e()));l["s-rc"]=void 0}i();s();{const t=(n=l["s-p"])!=null?n:[];const r=()=>He(e);if(t.length===0){r()}else{Promise.all(t).then(r);e.l|=4;t.length=0}}};var We=(e,t,r,n)=>{try{t=t.render();{e.l&=~16}{e.l|=2}{{{Le(e,t,n)}}}}catch(t){f(t,e.$hostElement$)}return null};var He=e=>{const t=e.o.h;const r=e.$hostElement$;const n=H("postUpdate",t);const l=e.t;const s=e.N;if(!(e.l&64)){e.l|=64;{Ie(r)}{Be(l,"componentDidLoad")}n();{e.v(r);if(!s){ze()}}}else{n()}{if(e.A){e.A();e.A=void 0}if(e.l&512){x((()=>Me(e,false)))}e.l&=~(4|512)}};var ze=t=>{{Ie(m.documentElement)}x((()=>Y(p,"appload",{detail:{namespace:e}})))};var Be=(e,t,r)=>{if(e&&e[t]){try{return e[t](r)}catch(e){f(e)}}return void 0};var Ie=e=>{var r;return e.classList.add((r=t.hydratedSelectorName)!=null?r:"hydrated")};var Qe=(e,t)=>s(e).i.get(t);var qe=(e,t,r,n)=>{const l=s(e);if(!l){throw new Error(`Couldn't find host element for "${n.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`)}const o=l.$hostElement$;const i=l.i.get(t);const a=l.l;const c=l.t;r=X(r,n.P[t][0]);const u=Number.isNaN(i)&&Number.isNaN(r);const v=r!==i&&!u;if((!(a&8)||i===void 0)&&v){l.i.set(t,r);if(c){if(n.U&&a&128){const e=n.U[t];if(e){e.map((e=>{try{c[e](r,i,t)}catch(e){f(e,o)}}))}}if((a&(2|16))===2){Me(l,false)}}}};var Ge=(e,t,r)=>{var n,l;const o=e.prototype;if(t.P||(t.U||e.watchers)){if(e.watchers&&!t.U){t.U=e.watchers}const i=Object.entries((n=t.P)!=null?n:{});i.map((([e,[n]])=>{if(n&31||r&2&&n&32){Object.defineProperty(o,e,{get(){return Qe(this,e)},set(r){qe(this,e,r,t)},configurable:true,enumerable:true})}}));if(r&1){const r=new Map;o.attributeChangedCallback=function(e,n,l){y.jmp((()=>{var i;const a=r.get(e);if(this.hasOwnProperty(a)){l=this[a];delete this[a]}else if(o.hasOwnProperty(a)&&typeof this[a]==="number"&&this[a]==l){return}else if(a==null){const r=s(this);const o=r==null?void 0:r.l;if(o&&!(o&8)&&o&128&&l!==n){const s=r.t;const o=(i=t.U)==null?void 0:i[e];o==null?void 0:o.forEach((t=>{if(s[t]!=null){s[t].call(s,l,n,e)}}))}return}this[a]=l===null&&typeof this[a]==="boolean"?false:l}))};e.observedAttributes=Array.from(new Set([...Object.keys((l=t.U)!=null?l:{}),...i.filter((([e,t])=>t[0]&15)).map((([e,t])=>{const n=t[1]||e;r.set(n,e);return n}))]))}}return e};var Ke=async(e,t,r,n)=>{let l;if((t.l&32)===0){t.l|=32;const n=r.p;if(n){const e=u(r);if(e&&"then"in e){const t=z();l=await e;t()}else{l=e}if(!l){throw new Error(`Constructor for "${r.h}#${t.W}" was not found`)}if(!l.isProxied){{r.U=l.watchers}Ge(l,r,2);l.isProxied=true}const n=H("createInstance",r.h);{t.l|=8}try{new l(t)}catch(e){f(e)}{t.l&=~8}{t.l|=128}n();Ve(t.t)}else{l=e.constructor;const r=e.localName;customElements.whenDefined(r).then((()=>t.l|=128))}if(l&&l.style){let e;if(typeof l.style==="string"){e=l.style}const t=ne(r);if(!v.has(t)){const n=H("registerStyles",r.h);ee(t,e,!!(r.l&1));n()}}}const s=t.N;const o=()=>Me(t,true);if(s&&s["s-rc"]){s["s-rc"].push(o)}else{o()}};var Ve=e=>{{Be(e,"connectedCallback")}};var Xe=e=>{if((y.l&1)===0){const t=s(e);const r=t.o;const n=H("connectedCallback",r.h);if(!(t.l&1)){t.l|=1;{if(r.l&(4|8)){_e(e)}}{let r=e;while(r=r.parentNode||r.host){if(r["s-p"]){Fe(t,t.N=r);break}}}if(r.P){Object.entries(r.P).map((([t,[r]])=>{if(r&31&&e.hasOwnProperty(t)){const r=e[t];delete e[t];e[t]=r}}))}{Ke(e,t,r)}}else{if(t==null?void 0:t.t){Ve(t.t)}else if(t==null?void 0:t.u){t.u.then((()=>Ve(t.t)))}}n()}};var _e=e=>{const t=e["s-cr"]=m.createComment("");t["s-cn"]=true;Re(e,t,e.firstChild)};var Je=e=>{{Be(e,"disconnectedCallback")}};var Ye=async e=>{if((y.l&1)===0){const t=s(e);if(t==null?void 0:t.t){Je(t.t)}else if(t==null?void 0:t.u){t.u.then((()=>Je(t.t)))}}};var Ze=(e,t={})=>{var r;const n=H();const l=[];const o=t.exclude||[];const a=p.customElements;const f=m.head;const c=f.querySelector("meta[charset]");const u=m.createElement("style");const v=[];let b;let w=true;Object.assign(y,t);y.m=new URL(t.resourcesUrl||"./",m.baseURI).href;let g=false;e.map((e=>{e[1].map((t=>{var r;const n={l:t[0],h:t[1],P:t[2],H:t[3]};if(n.l&4){g=true}{n.P=t[2]}{n.U=(r=t[4])!=null?r:{}}const f=n.h;const c=class extends HTMLElement{constructor(e){super(e);this.hasRegisteredEventListeners=false;e=this;i(e,n);if(n.l&1){{if(!e.shadowRoot){{e.attachShadow({mode:"open"})}}else{if(e.shadowRoot.mode!=="open"){throw new Error(`Unable to re-use existing shadow root for ${n.h}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}}}}connectedCallback(){s(this);if(!this.hasRegisteredEventListeners){this.hasRegisteredEventListeners=true}if(b){clearTimeout(b);b=null}if(w){v.push(this)}else{y.jmp((()=>Xe(this)))}}disconnectedCallback(){y.jmp((()=>Ye(this)))}componentOnReady(){return s(this).u}};n.p=e[0];if(!o.includes(f)&&!a.get(f)){l.push(f);a.define(f,Ge(c,n,1))}}))}));if(l.length>0){if(g){u.textContent+=h}{u.textContent+=l.sort()+d}if(u.innerHTML.length){u.setAttribute("data-styles","");const e=(r=y.D)!=null?r:F(m);if(e!=null){u.setAttribute("nonce",e)}f.insertBefore(u,c?c.nextSibling:f.firstChild)}}w=false;if(v.length){v.map((e=>e.connectedCallback()))}else{{y.jmp((()=>b=setTimeout(ze,30)))}}n()};var et=(e,t)=>t;var tt=e=>y.D=e;export{et as F,Ze as b,J as c,_ as g,B as h,b as p,o as r,tt as s};
3
+ //# sourceMappingURL=p-80e3f29f.js.map