@coveo/atomic 3.49.0 → 3.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/custom-elements.json +2257 -369
  2. package/dist/atomic/_atomic.esm.js +1 -1
  3. package/dist/atomic/atomic.esm.js.map +1 -1
  4. package/dist/atomic/components/_index.d.ts +0 -10
  5. package/dist/atomic/components/_index.js +2 -8
  6. package/dist/atomic/components/atomic-insight-result-action.js +123 -6
  7. package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
  8. package/dist/atomic/components/atomic-insight-result-children-template.js +1 -2
  9. package/dist/atomic/components/atomic-insight-result-children-template.js.map +1 -1
  10. package/dist/atomic/components/atomic-insight-timeframe-facet.js +97 -7
  11. package/dist/atomic/components/atomic-insight-timeframe-facet.js.map +1 -1
  12. package/dist/atomic/components/atomic-stencil-facet-date-input.js +3 -3
  13. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +4 -4
  14. package/dist/atomic/components/components/common/generated-answer/render-feedback-and-copy-buttons.js +4 -3
  15. package/dist/atomic/components/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.js +444 -0
  16. package/dist/atomic/components/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.tw.css.js +2 -0
  17. package/dist/atomic/components/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.js +122 -0
  18. package/dist/atomic/components/components/insight/atomic-insight-result-children/atomic-insight-result-children.js +4 -4
  19. package/dist/atomic/components/components/insight/index.js +2 -0
  20. package/dist/atomic/components/components/insight/lazy-index.js +2 -0
  21. package/dist/atomic/components/components/ipx/atomic-ipx-button/atomic-ipx-button.js +1 -1
  22. package/dist/atomic/components/components/ipx/atomic-ipx-recs-list/atomic-ipx-recs-list.js +483 -0
  23. package/dist/atomic/components/components/ipx/atomic-ipx-refine-modal/atomic-ipx-refine-modal.js +202 -0
  24. package/dist/atomic/components/components/ipx/atomic-ipx-refine-toggle/atomic-ipx-refine-toggle.js +123 -0
  25. package/dist/atomic/components/components/ipx/index.js +3 -0
  26. package/dist/atomic/components/components/ipx/lazy-index.js +3 -0
  27. package/dist/atomic/components/components/recommendations/atomic-recs-result/atomic-recs-result.js +1 -0
  28. package/dist/atomic/components/components/search/atomic-generated-answer/atomic-generated-answer.js +7 -1
  29. package/dist/atomic/components/components/search/atomic-refine-modal/atomic-refine-modal.js +2 -1
  30. package/dist/atomic/components/components/search/atomic-search-box/atomic-search-box.js +4 -4
  31. package/dist/atomic/components/global/environment.js +1 -1
  32. package/dist/atomic/components/index.js.map +1 -1
  33. package/dist/atomic/components/props-utils.js +1402 -2
  34. package/dist/atomic/components/props-utils.js.map +1 -1
  35. package/dist/atomic/components/utils/custom-element-tags.js +7 -0
  36. package/dist/atomic/components/utils/tailwind.global.tw.css.js +4 -4
  37. package/dist/atomic/index.esm.js +1 -1
  38. package/dist/atomic/p-1df0744f.entry.js +9 -0
  39. package/dist/atomic/p-1df0744f.entry.js.map +1 -0
  40. package/dist/atomic/{p-4a32511f.js → p-2045a1b1.js} +2 -2
  41. package/dist/atomic/p-500bf5c4.entry.js +2 -0
  42. package/dist/atomic/{p-4117289b.entry.js.map → p-500bf5c4.entry.js.map} +1 -1
  43. package/dist/atomic/p-5226a938.js +3 -0
  44. package/dist/atomic/p-5226a938.js.map +1 -0
  45. package/dist/atomic/{p-b4cfedf1.js → p-720863c3.js} +2 -2
  46. package/dist/atomic/p-81336626.entry.js +2 -0
  47. package/dist/atomic/p-81336626.entry.js.map +1 -0
  48. package/dist/atomic/p-aad3b4ec.js +3 -0
  49. package/dist/atomic/p-aad3b4ec.js.map +1 -0
  50. package/dist/atomic/{p-0698ccf1.entry.js → p-b5af331b.entry.js} +2 -2
  51. package/dist/atomic/{p-677f9c40.js → p-b7209471.js} +2 -2
  52. package/dist/cjs/_index.cjs.js +2 -2
  53. package/dist/cjs/_loader.cjs.js +2 -2
  54. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +22 -9
  55. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
  56. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js +6 -7
  57. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js.map +1 -1
  58. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js +106 -16
  59. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js.map +1 -1
  60. package/dist/cjs/atomic-stencil-facet-date-input.cjs.entry.js +5 -5
  61. package/dist/cjs/atomic.cjs.js +2 -2
  62. package/dist/cjs/{index-3532822e.js → index-122375df.js} +4 -58
  63. package/dist/cjs/index-122375df.js.map +1 -0
  64. package/dist/cjs/{initialization-utils-51a423fe.js → initialization-utils-c2821271.js} +2 -2
  65. package/dist/cjs/{initialization-utils-51a423fe.js.map → initialization-utils-c2821271.js.map} +1 -1
  66. package/dist/cjs/{utils-e845f262.js → props-utils-e4f29f1e.js} +54 -21
  67. package/dist/cjs/props-utils-e4f29f1e.js.map +1 -0
  68. package/dist/cjs/{stencil-button-f39da03e.js → stencil-button-bf22eea4.js} +2 -2
  69. package/dist/cjs/{stencil-button-f39da03e.js.map → stencil-button-bf22eea4.js.map} +1 -1
  70. package/dist/cjs/{stencil-result-template-decorators-1f099c15.js → stencil-result-template-decorators-96954751.js} +2 -2
  71. package/dist/cjs/{stencil-result-template-decorators-1f099c15.js.map → stencil-result-template-decorators-96954751.js.map} +1 -1
  72. package/dist/cjs/version.cjs.js +2 -2
  73. package/dist/esm/_index.js +3 -3
  74. package/dist/esm/_loader.js +3 -3
  75. package/dist/esm/atomic-insight-result-action.entry.js +20 -7
  76. package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
  77. package/dist/esm/atomic-insight-result-children-template.entry.js +2 -3
  78. package/dist/esm/atomic-insight-result-children-template.entry.js.map +1 -1
  79. package/dist/esm/atomic-insight-timeframe-facet.entry.js +100 -10
  80. package/dist/esm/atomic-insight-timeframe-facet.entry.js.map +1 -1
  81. package/dist/esm/atomic-stencil-facet-date-input.entry.js +5 -5
  82. package/dist/esm/atomic.js +3 -3
  83. package/dist/esm/{index-3eb0b28e.js → index-4d679e44.js} +5 -58
  84. package/dist/{cjs/index-3532822e.js.map → esm/index-4d679e44.js.map} +1 -1
  85. package/dist/esm/{initialization-utils-82d28c63.js → initialization-utils-9ff399ff.js} +2 -2
  86. package/dist/esm/{initialization-utils-82d28c63.js.map → initialization-utils-9ff399ff.js.map} +1 -1
  87. package/dist/esm/{utils-b5bab369.js → props-utils-76043c82.js} +54 -18
  88. package/dist/esm/props-utils-76043c82.js.map +1 -0
  89. package/dist/esm/{stencil-button-c25899df.js → stencil-button-28de709c.js} +2 -2
  90. package/dist/esm/{stencil-button-c25899df.js.map → stencil-button-28de709c.js.map} +1 -1
  91. package/dist/esm/{stencil-result-template-decorators-9cbe1e1c.js → stencil-result-template-decorators-4c2e5132.js} +2 -2
  92. package/dist/esm/{stencil-result-template-decorators-9cbe1e1c.js.map → stencil-result-template-decorators-4c2e5132.js.map} +1 -1
  93. package/dist/esm/version.js +2 -2
  94. package/dist/types/components/common/generated-answer/answerContent/answer-content.d.ts +49 -0
  95. package/dist/types/components/common/generated-answer/generated-answer-thread-item/generated-answer-thread-item.d.ts +49 -0
  96. package/dist/types/components/common/generated-answer/render-feedback-and-copy-buttons.d.ts +8 -2
  97. package/dist/types/components/common/item-list/table-layout.d.ts +1 -1
  98. package/dist/types/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.d.ts +54 -35
  99. package/dist/types/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.tw.css.d.ts +2 -0
  100. package/dist/types/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.d.ts +25 -20
  101. package/dist/types/components/insight/index.d.ts +2 -0
  102. package/dist/types/components/ipx/atomic-ipx-button/atomic-ipx-button.d.ts +1 -1
  103. package/dist/types/components/ipx/atomic-ipx-recs-list/{atomic-recs-list/atomic-ipx-recs-list.d.ts → atomic-ipx-recs-list.d.ts} +43 -21
  104. package/dist/types/components/ipx/atomic-ipx-refine-modal/atomic-ipx-refine-modal.d.ts +62 -15
  105. package/dist/types/components/ipx/atomic-ipx-refine-toggle/atomic-ipx-refine-toggle.d.ts +26 -11
  106. package/dist/types/components/ipx/index.d.ts +3 -0
  107. package/dist/types/components/recommendations/atomic-recs-result/atomic-recs-result.d.ts +1 -0
  108. package/dist/types/components/search/atomic-refine-modal/atomic-refine-modal.d.ts +4 -3
  109. package/dist/types/components.d.ts +0 -249
  110. package/docs/atomic-docs.json +1 -26
  111. package/package.json +4 -4
  112. package/dist/atomic/components/arrow-top-rounded.js +0 -7
  113. package/dist/atomic/components/arrow-top-rounded.js.map +0 -1
  114. package/dist/atomic/components/atomic-insight-generated-answer.d.ts +0 -11
  115. package/dist/atomic/components/atomic-insight-generated-answer.js +0 -3264
  116. package/dist/atomic/components/atomic-insight-generated-answer.js.map +0 -1
  117. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.d.ts +0 -11
  118. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +0 -102
  119. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +0 -1
  120. package/dist/atomic/components/atomic-ipx-recs-list.d.ts +0 -11
  121. package/dist/atomic/components/atomic-ipx-recs-list.js +0 -631
  122. package/dist/atomic/components/atomic-ipx-recs-list.js.map +0 -1
  123. package/dist/atomic/components/atomic-ipx-refine-modal.d.ts +0 -11
  124. package/dist/atomic/components/atomic-ipx-refine-modal.js +0 -8
  125. package/dist/atomic/components/atomic-ipx-refine-modal.js.map +0 -1
  126. package/dist/atomic/components/atomic-ipx-refine-modal2.js +0 -162
  127. package/dist/atomic/components/atomic-ipx-refine-modal2.js.map +0 -1
  128. package/dist/atomic/components/atomic-ipx-refine-toggle.d.ts +0 -11
  129. package/dist/atomic/components/atomic-ipx-refine-toggle.js +0 -121
  130. package/dist/atomic/components/atomic-ipx-refine-toggle.js.map +0 -1
  131. package/dist/atomic/components/attach.js +0 -115
  132. package/dist/atomic/components/attach.js.map +0 -1
  133. package/dist/atomic/components/components/common/layout/display-options.js +0 -28
  134. package/dist/atomic/components/popover-type.js +0 -12
  135. package/dist/atomic/components/popover-type.js.map +0 -1
  136. package/dist/atomic/components/stencil-heading.js +0 -169
  137. package/dist/atomic/components/stencil-heading.js.map +0 -1
  138. package/dist/atomic/components/stencil-iconButton.js +0 -16
  139. package/dist/atomic/components/stencil-iconButton.js.map +0 -1
  140. package/dist/atomic/components/store.js +0 -13
  141. package/dist/atomic/components/store.js.map +0 -1
  142. package/dist/atomic/components/utils.js +0 -1421
  143. package/dist/atomic/components/utils.js.map +0 -1
  144. package/dist/atomic/p-2c08a419.entry.js +0 -2
  145. package/dist/atomic/p-2c08a419.entry.js.map +0 -1
  146. package/dist/atomic/p-4117289b.entry.js +0 -2
  147. package/dist/atomic/p-52d14165.entry.js +0 -2
  148. package/dist/atomic/p-52d14165.entry.js.map +0 -1
  149. package/dist/atomic/p-578d761c.js +0 -2
  150. package/dist/atomic/p-578d761c.js.map +0 -1
  151. package/dist/atomic/p-64f83898.entry.js +0 -2
  152. package/dist/atomic/p-64f83898.entry.js.map +0 -1
  153. package/dist/atomic/p-70cc18a1.js +0 -2
  154. package/dist/atomic/p-70cc18a1.js.map +0 -1
  155. package/dist/atomic/p-9c5ec170.js +0 -2
  156. package/dist/atomic/p-9c5ec170.js.map +0 -1
  157. package/dist/atomic/p-9dfe5ab1.js +0 -2
  158. package/dist/atomic/p-9dfe5ab1.js.map +0 -1
  159. package/dist/atomic/p-a33748a9.js +0 -2
  160. package/dist/atomic/p-a33748a9.js.map +0 -1
  161. package/dist/atomic/p-b09433bb.js +0 -3
  162. package/dist/atomic/p-b09433bb.js.map +0 -1
  163. package/dist/atomic/p-c8452548.entry.js +0 -2
  164. package/dist/atomic/p-c8452548.entry.js.map +0 -1
  165. package/dist/atomic/p-c95ac794.entry.js +0 -2
  166. package/dist/atomic/p-c95ac794.entry.js.map +0 -1
  167. package/dist/atomic/p-d75a4630.js +0 -2
  168. package/dist/atomic/p-d75a4630.js.map +0 -1
  169. package/dist/atomic/p-d8230482.entry.js +0 -9
  170. package/dist/atomic/p-d8230482.entry.js.map +0 -1
  171. package/dist/atomic/p-e94ba0e1.entry.js +0 -2
  172. package/dist/atomic/p-e94ba0e1.entry.js.map +0 -1
  173. package/dist/atomic/p-ec1c5f46.js +0 -3
  174. package/dist/atomic/p-ec1c5f46.js.map +0 -1
  175. package/dist/atomic/p-f321aab0.js +0 -2
  176. package/dist/atomic/p-f321aab0.js.map +0 -1
  177. package/dist/cjs/arrow-top-rounded-885250ea.js +0 -10
  178. package/dist/cjs/arrow-top-rounded-885250ea.js.map +0 -1
  179. package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js +0 -3238
  180. package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js.map +0 -1
  181. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +0 -90
  182. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +0 -1
  183. package/dist/cjs/atomic-ipx-recs-list.cjs.entry.js +0 -600
  184. package/dist/cjs/atomic-ipx-recs-list.cjs.entry.js.map +0 -1
  185. package/dist/cjs/atomic-ipx-refine-modal.cjs.entry.js +0 -143
  186. package/dist/cjs/atomic-ipx-refine-modal.cjs.entry.js.map +0 -1
  187. package/dist/cjs/atomic-ipx-refine-toggle.cjs.entry.js +0 -99
  188. package/dist/cjs/atomic-ipx-refine-toggle.cjs.entry.js.map +0 -1
  189. package/dist/cjs/attach-19283bec.js +0 -10
  190. package/dist/cjs/attach-19283bec.js.map +0 -1
  191. package/dist/cjs/popover-type-22f285e1.js +0 -16
  192. package/dist/cjs/popover-type-22f285e1.js.map +0 -1
  193. package/dist/cjs/props-utils-bc5feb04.js +0 -59
  194. package/dist/cjs/props-utils-bc5feb04.js.map +0 -1
  195. package/dist/cjs/stencil-heading-ecec9ab3.js +0 -174
  196. package/dist/cjs/stencil-heading-ecec9ab3.js.map +0 -1
  197. package/dist/cjs/stencil-iconButton-f8b9fda0.js +0 -18
  198. package/dist/cjs/stencil-iconButton-f8b9fda0.js.map +0 -1
  199. package/dist/cjs/store-70fff5e6.js +0 -16
  200. package/dist/cjs/store-70fff5e6.js.map +0 -1
  201. package/dist/cjs/utils-e845f262.js.map +0 -1
  202. package/dist/esm/arrow-top-rounded-745b84a6.js +0 -7
  203. package/dist/esm/arrow-top-rounded-745b84a6.js.map +0 -1
  204. package/dist/esm/atomic-insight-generated-answer.entry.js +0 -3234
  205. package/dist/esm/atomic-insight-generated-answer.entry.js.map +0 -1
  206. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +0 -86
  207. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +0 -1
  208. package/dist/esm/atomic-ipx-recs-list.entry.js +0 -596
  209. package/dist/esm/atomic-ipx-recs-list.entry.js.map +0 -1
  210. package/dist/esm/atomic-ipx-refine-modal.entry.js +0 -139
  211. package/dist/esm/atomic-ipx-refine-modal.entry.js.map +0 -1
  212. package/dist/esm/atomic-ipx-refine-toggle.entry.js +0 -95
  213. package/dist/esm/atomic-ipx-refine-toggle.entry.js.map +0 -1
  214. package/dist/esm/attach-81bb8872.js +0 -8
  215. package/dist/esm/attach-81bb8872.js.map +0 -1
  216. package/dist/esm/index-3eb0b28e.js.map +0 -1
  217. package/dist/esm/popover-type-c85677ef.js +0 -12
  218. package/dist/esm/popover-type-c85677ef.js.map +0 -1
  219. package/dist/esm/props-utils-d343133b.js +0 -57
  220. package/dist/esm/props-utils-d343133b.js.map +0 -1
  221. package/dist/esm/stencil-heading-98a5f23f.js +0 -169
  222. package/dist/esm/stencil-heading-98a5f23f.js.map +0 -1
  223. package/dist/esm/stencil-iconButton-ed5804d3.js +0 -16
  224. package/dist/esm/stencil-iconButton-ed5804d3.js.map +0 -1
  225. package/dist/esm/store-50d170c8.js +0 -13
  226. package/dist/esm/store-50d170c8.js.map +0 -1
  227. package/dist/esm/utils-b5bab369.js.map +0 -1
  228. /package/dist/atomic/{p-4a32511f.js.map → p-2045a1b1.js.map} +0 -0
  229. /package/dist/atomic/{p-b4cfedf1.js.map → p-720863c3.js.map} +0 -0
  230. /package/dist/atomic/{p-0698ccf1.entry.js.map → p-b5af331b.entry.js.map} +0 -0
  231. /package/dist/atomic/{p-677f9c40.js.map → p-b7209471.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FocusTargetController","constructor","component","this","registerFocusCallback","callback","publicOnFocusCallbacks","push","doFocusAfterSearch","doFocusOnNextTarget","bindings","handleComponentRenderLoop","clearFocusCallbacks","internalOnFocusCallback","length","pop","setTarget","el","element","focus","defer","focusAfterSearch","lastSearchId","store","getUniqueIDFromEngine","engine","Promise","resolve","focusOnNextTarget","disableForCurrentSearch","originalComponentDidRender","componentDidRender","call","then","parseDependsOn","dependsOn","Object","keys","entries","map","parentFacetId","expectedValue","condition","buildDependsOnCondition","values","some","value","isCategoryFacetValue","matchesCategoryFacetValue","isSimpleFacetValue","matchesSimpleFacetValue","selectedValue","getSelectedCategoryFacetValueRequest","state","request","requestAsRecord","children","Array","isArray","child","asRecord","FacetPlaceholder","numberOfValues","isCollapsed","facetValues","i","h","class","style","width","opacity","part","getFieldCaptionNamespace","field","getFieldValueCaption","facetValue","i18n","t","ns","FacetContainer","_","Heading","level","htmlProps","HeadingTag","FacetHeader","props","label","expandFacet","collapseFacet","clearFilters","count","numberOfActiveValues","clearFiltersForFacet","Button","ariaLabel","onClick","onToggleCollapse","ariaExpanded","toString","ref","headerRef","headingLevel","icon","ArrowBottomIcon","ArrowTopIcon","onClearFilters","CloseIcon","matchHtmlRegExp","escapeHtml_1","escapeHtml","string","str","match","exec","escape","html","index","lastIndex","charCodeAt","substring","regexEncode","replace","highlightSearchResult","resultValue","searchQuery","sanitizedResult","trim","regex","RegExp","FacetValueLabelHighlight","title","displayValue","isSelected","isExcluded","innerHTML","FacetValueLink","numberOfResults","toLocaleString","language","formattedCount","interpolation","escapeValue","additionalPart","key","ariaPressed","buttonRef","text","subList","FieldsetGroup","FacetValuesGroup","facetDisplayLabel","groupLabel","query","undefined","initializePopover","host","childFacet","dispatchEvent","buildCustomEvent","shouldDisplayInputForFacetRange","facetRange","hasInput","hasInputRange","searchStatusState","hasResults","onlyValuesWithResultsOrActive","filter","TimeframeFacetCommon","manualTimeframes","facetId","determineFacetId","setFacetId","getManualTimeframes","facetForDateRange","initializeFacetForDateRange","currentValues","withDatePicker","facetForDatePicker","initializeFacetForDatePicker","facetForDatePickerDependenciesManager","buildDependenciesManager","initializeFilter","facetForDateRangeDependenciesManager","filterDependenciesManager","registerFacetToStore","dateFacets","randomID","enabled","valuesToRender","shouldRenderValues","shouldRenderFacet","shouldRenderInput","getSearchStatusState","hasValues","numberOfSelectedValues","range","period","amount","unit","buildDateRange","start","end","disconnectedCallback","isConnected","stopWatching","isHidden","facetInfo","registerFacet","format","formatFacetValue","from","querySelectorAll","startDate","deserializeRelativeDate","relativeDate","timeframe","find","error","parseDate","renderValues","renderValuesContainer","renderValue","toggleSingleSelect","renderHeader","headerFocus","clear","deselectAll","renderDateInput","min","max","rangeGetter","rangeSetter","setRange","render","hasError","firstSearchExecuted","Hidden","atomicInsightTimeframeFacetCss","AtomicInsightTimeframeFacetStyle0","AtomicInsightTimeframeFacet","filterFacetCount","injectionDepth","sortCriteria","initialize","timeframeFacetCommon","id","buildInsightFacetConditionsManager","conditions","buildInsightDateRange","deserializeInsightRelativeDate","searchStatus","buildInsightSearchStatus","focusTarget","buildInsightDateFacet","options","generateAutomaticRanges","buildInsightDateFilter","applyDateInput","dispatch","loadInsightDateFacetSetActions","deselectAllDateFacetValues","__decorate","InitializeBindings","BindStateToController","MapProp"],"sources":["src/utils/stencil-accessibility-utils.tsx","src/components/common/facets/depends-on.ts","src/components/common/facets/facet-placeholder/stencil-facet-placeholder.tsx","src/utils/field-utils.ts","src/components/common/facets/facet-container/stencil-facet-container.tsx","src/components/common/stencil-heading.tsx","src/components/common/facets/facet-header/stencil-facet-header.tsx","../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js","src/utils/string-utils.ts","src/components/common/facets/facet-search/facet-search-utils.ts","src/components/common/facets/facet-value-label-highlight/stencil-facet-value-label-highlight.tsx","src/components/common/facets/facet-value-link/stencil-facet-value-link.tsx","src/components/common/stencil-fieldset-group.tsx","src/components/common/facets/facet-values-group/stencil-facet-values-group.tsx","src/components/common/facets/popover/popover-type.ts","src/components/common/facets/stencil-facet-common.tsx","src/components/common/facets/stencil-timeframe-facet-common.tsx","src/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.pcss?tag=atomic-insight-timeframe-facet&encapsulation=shadow","src/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AtomicAriaLive } from '../components/common/atomic-aria-live/atomic-aria-live';\nimport {AnyBindings} from '../components/common/interface/bindings';\nimport {buildCustomEvent} from './event-utils';\nimport {InitializableComponent} from './initialization-utils';\nimport {defer} from './utils';\n\nconst findAriaLiveEventName = 'atomic/accessibility/findAriaLive';\n\n/**\n * @deprecated use Lit equivalent\n */\nexport interface FindAriaLiveEventArgs {\n element?: AtomicAriaLive;\n}\n\n/**\n * @deprecated use Lit equivalent\n */\nexport function AriaLiveRegion(regionName: string, assertive = false) {\n function getAriaLiveElement() {\n const event = buildCustomEvent<FindAriaLiveEventArgs>(\n findAriaLiveEventName,\n {}\n );\n document.dispatchEvent(event);\n const {element} = event.detail;\n return element;\n }\n\n function dispatchMessage(message: string) {\n getAriaLiveElement()?.updateMessage(regionName, message, assertive);\n }\n\n function registerRegion() {\n getAriaLiveElement()?.registerRegion(regionName, assertive);\n }\n\n return (\n component: InitializableComponent<AnyBindings>,\n setterName: string\n ) => {\n const {componentWillRender} = component;\n Object.defineProperty(component, setterName, {\n set: (message: string) => dispatchMessage(message),\n });\n\n component.componentWillRender = function () {\n componentWillRender && componentWillRender.call(this);\n registerRegion();\n };\n };\n}\n\n/**\n * @deprecated use Lit equivalent\n */\nexport class FocusTargetController {\n private bindings: AnyBindings;\n private lastSearchId?: string;\n private element?: HTMLElement;\n public registerFocusCallback: (callback: Function) => void = (\n callback: Function\n ) => {\n this.publicOnFocusCallbacks.push(callback);\n };\n private internalOnFocusCallback?: Function;\n private doFocusAfterSearch = false;\n private doFocusOnNextTarget = false;\n private publicOnFocusCallbacks: Function[] = [];\n\n constructor(private component: InitializableComponent<AnyBindings>) {\n this.bindings = component.bindings;\n this.handleComponentRenderLoop();\n }\n\n private clearFocusCallbacks() {\n this.internalOnFocusCallback?.();\n while (this.publicOnFocusCallbacks.length) {\n this.publicOnFocusCallbacks.pop()?.();\n }\n }\n\n public setTarget(el: HTMLElement | undefined) {\n if (!el) {\n return;\n }\n this.element = el;\n if (this.doFocusOnNextTarget) {\n this.doFocusOnNextTarget = false;\n this.focus();\n }\n }\n\n public async focus() {\n await defer();\n this.element?.focus();\n this.clearFocusCallbacks();\n }\n\n public focusAfterSearch() {\n this.lastSearchId = this.bindings.store.getUniqueIDFromEngine(\n this.bindings.engine\n );\n this.doFocusAfterSearch = true;\n return new Promise((resolve) => (this.internalOnFocusCallback = resolve));\n }\n\n public focusOnNextTarget() {\n this.doFocusOnNextTarget = true;\n return new Promise((resolve) => (this.internalOnFocusCallback = resolve));\n }\n\n public disableForCurrentSearch() {\n if (\n this.bindings.store.getUniqueIDFromEngine(this.bindings.engine) !==\n this.lastSearchId\n ) {\n this.doFocusAfterSearch = false;\n }\n }\n\n private handleComponentRenderLoop() {\n const originalComponentDidRender = this.component.componentDidRender;\n\n this.component.componentDidRender = () => {\n originalComponentDidRender &&\n originalComponentDidRender.call(this.component);\n if (!this.bindings) {\n return;\n }\n if (\n this.doFocusAfterSearch &&\n this.bindings.store.getUniqueIDFromEngine(this.bindings.engine) !==\n this.lastSearchId\n ) {\n this.doFocusAfterSearch = false;\n if (this.element) {\n const el = this.element;\n // The focus seems to be flaky without deferring, especially on iOS.\n defer().then(() => {\n el.focus();\n this.clearFocusCallbacks();\n });\n }\n }\n };\n }\n}\n\nfunction isFocusable(element: Element) {\n // Source: https://stackoverflow.com/a/30753870\n if (element.getAttribute('tabindex') === '-1') {\n return false;\n }\n if (element.hasAttribute('tabindex')) {\n return true;\n }\n if (element.getAttribute('contentEditable') === 'true') {\n return true;\n }\n switch (element.tagName) {\n case 'A':\n case 'AREA':\n return element.hasAttribute('href');\n case 'INPUT':\n case 'SELECT':\n case 'TEXTAREA':\n case 'BUTTON':\n return !element.hasAttribute('disabled');\n case 'IFRAME':\n return true;\n default:\n return false;\n }\n}\n\n/**\n * @deprecated use Lit equivalent\n */\nexport function* getFocusableDescendants(\n element: Element\n): Generator<HTMLElement> {\n if (isFocusable(element)) {\n yield element as HTMLElement;\n }\n let children = Array.from(element.children);\n if (element instanceof HTMLSlotElement) {\n children = element.assignedElements();\n } else if (element.shadowRoot) {\n children.push(...Array.from(element.shadowRoot.children));\n }\n for (const child of children) {\n yield* getFocusableDescendants(child);\n }\n}\n\n/**\n * @deprecated use Lit equivalent\n */\nexport function getFirstFocusableDescendant(\n element: Element\n): HTMLElement | null {\n return getFocusableDescendants(element).next().value ?? null;\n}\n","type GenericCondition<AnyFacetValueRequest> = {\n parentFacetId: string;\n condition(parentValues: AnyFacetValueRequest[]): boolean;\n};\n\ninterface SimpleFacetValue {\n value: string;\n state: string;\n}\n\ninterface CategoryFacetValue extends SimpleFacetValue {\n children: SimpleFacetValue[];\n}\n\nexport function parseDependsOn<\n FacetValue extends SimpleFacetValue | CategoryFacetValue,\n>(dependsOn: Record<string, string>): GenericCondition<FacetValue>[] {\n if (Object.keys(dependsOn).length > 1) {\n throw \"Depending on multiple facets isn't supported\";\n }\n\n const entries = Object.entries(dependsOn);\n return entries.map(([parentFacetId, expectedValue]) => ({\n parentFacetId,\n condition: buildDependsOnCondition<FacetValue>(expectedValue),\n }));\n}\n\nfunction buildDependsOnCondition<\n FacetValue extends SimpleFacetValue | CategoryFacetValue,\n>(expectedValue: string): (values: FacetValue[]) => boolean {\n return (values: FacetValue[]) =>\n values.some((value) => {\n if (isCategoryFacetValue(value)) {\n return matchesCategoryFacetValue(\n value as CategoryFacetValue,\n expectedValue\n );\n }\n if (isSimpleFacetValue(value)) {\n return matchesSimpleFacetValue(\n value as SimpleFacetValue,\n expectedValue\n );\n }\n return false;\n });\n}\n\nfunction matchesCategoryFacetValue<FacetValue extends CategoryFacetValue>(\n value: FacetValue,\n expectedValue: string\n): boolean {\n const selectedValue = getSelectedCategoryFacetValueRequest(value);\n if (!selectedValue) {\n return false;\n }\n return !expectedValue || selectedValue.value === expectedValue;\n}\n\nfunction matchesSimpleFacetValue(\n value: SimpleFacetValue,\n expectedValue: string\n): boolean {\n if (value.state !== 'selected') {\n return false;\n }\n return !expectedValue || value.value === expectedValue;\n}\n\nfunction isCategoryFacetValue(request: unknown): request is CategoryFacetValue {\n const requestAsRecord = request as Record<string, unknown>;\n return (\n (requestAsRecord?.children &&\n Array.isArray(requestAsRecord.children) &&\n requestAsRecord?.state &&\n typeof requestAsRecord.state === 'string') === true\n );\n}\n\nfunction getSelectedCategoryFacetValueRequest(\n value: unknown\n): CategoryFacetValue | null {\n if (!isCategoryFacetValue(value)) {\n return null;\n }\n if (value.state === 'selected') {\n return value;\n }\n for (const child of value.children) {\n const selectedValue = getSelectedCategoryFacetValueRequest(child);\n if (selectedValue !== null) {\n return selectedValue;\n }\n }\n return null;\n}\n\nfunction isSimpleFacetValue(value: unknown): value is SimpleFacetValue {\n const asRecord = value as Record<string, unknown>;\n return (\n 'value' in asRecord &&\n typeof asRecord.value === 'string' &&\n !('children' in asRecord)\n );\n}\n","import {FunctionalComponent, h} from '@stencil/core';\n\ninterface FacetPlaceholderProps {\n numberOfValues: number;\n isCollapsed: boolean;\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const FacetPlaceholder: FunctionalComponent<FacetPlaceholderProps> = ({\n numberOfValues,\n isCollapsed,\n}) => {\n const facetValues = [];\n for (let i = 0; i < numberOfValues; i++) {\n facetValues.push(\n <div\n class=\"bg-neutral mt-4 flex h-5\"\n style={{width: '100%', opacity: '0.5'}}\n ></div>\n );\n }\n\n return (\n <div\n part=\"placeholder\"\n class=\"bg-background border-neutral mb-4 animate-pulse rounded-lg border p-7\"\n aria-hidden=\"true\"\n >\n <div class=\"bg-neutral h-8 rounded\" style={{width: '75%'}}></div>\n {!isCollapsed && <div class=\"mt-7\">{facetValues}</div>}\n </div>\n );\n};\n","import type {i18n} from 'i18next';\n\nfunction getFieldCaptionNamespace(field: string) {\n return `caption-${field}`;\n}\n\nexport function getFieldCaptions(field: string, i18n: i18n) {\n return (\n i18n.getResourceBundle(i18n.language, getFieldCaptionNamespace(field)) || {}\n );\n}\n\nexport function getFieldValueCaption(\n field: string,\n facetValue: string,\n i18n: i18n\n) {\n return i18n.t(facetValue, {\n ns: getFieldCaptionNamespace(field),\n });\n}\n","import {FunctionalComponent, h} from '@stencil/core';\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const FacetContainer: FunctionalComponent = (_, children) => (\n <div class=\"bg-background border-neutral rounded-lg border p-4\" part=\"facet\">\n {children}\n </div>\n);\n","import {h, FunctionalComponent} from '@stencil/core';\nimport {JSXBase} from '@stencil/core/internal';\nimport {HeadingProps} from './heading';\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const Heading: FunctionalComponent<\n Pick<HeadingProps, 'level'> & JSXBase.HTMLAttributes<HTMLHeadingElement>\n> = ({level, ...htmlProps}, children) => {\n const HeadingTag = level > 0 && level <= 6 ? `h${level}` : 'div';\n return <HeadingTag {...htmlProps}>{children}</HeadingTag>;\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport ArrowBottomIcon from '../../../../images/arrow-bottom-rounded.svg';\nimport ArrowTopIcon from '../../../../images/arrow-top-rounded.svg';\nimport CloseIcon from '../../../../images/close.svg';\nimport {Button} from '../../stencil-button';\nimport {Heading} from '../../stencil-heading';\n\ninterface FacetHeaderProps {\n i18n: i18n;\n label: string;\n numberOfActiveValues: number;\n isCollapsed: boolean;\n headingLevel: number;\n onToggleCollapse(): void;\n onClearFilters?(): void;\n headerRef?: (element?: HTMLButtonElement) => void;\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const FacetHeader: FunctionalComponent<FacetHeaderProps> = (props) => {\n const label = props.i18n.t(props.label);\n const expandFacet = props.i18n.t('expand-facet', {label});\n const collapseFacet = props.i18n.t('collapse-facet', {label});\n const clearFilters = props.i18n.t('clear-filters', {\n count: props.numberOfActiveValues,\n });\n const clearFiltersForFacet = props.i18n.t('clear-filters-for-facet', {\n count: props.numberOfActiveValues,\n label,\n });\n\n return [\n <Button\n style=\"text-transparent\"\n part=\"label-button\"\n class=\"flex w-full justify-between rounded-none px-2 py-1 text-lg font-bold\"\n ariaLabel={props.isCollapsed ? expandFacet : collapseFacet}\n onClick={() => props.onToggleCollapse()}\n ariaExpanded={(!props.isCollapsed).toString()}\n ref={props.headerRef}\n >\n <Heading level={props.headingLevel} class=\"truncate\">\n {label}\n </Heading>\n <atomic-icon\n part=\"label-button-icon\"\n class=\"ml-4 w-3 shrink-0 self-center\"\n icon={props.isCollapsed ? ArrowBottomIcon : ArrowTopIcon}\n ></atomic-icon>\n </Button>,\n props.onClearFilters && props.numberOfActiveValues > 0 && (\n <Button\n style=\"text-primary\"\n part=\"clear-button\"\n class=\"flex max-w-full items-baseline p-2 text-sm\"\n ariaLabel={clearFiltersForFacet}\n onClick={() => props.onClearFilters!()}\n >\n <atomic-icon\n part=\"clear-button-icon\"\n class=\"mr-1 h-2 w-2\"\n icon={CloseIcon}\n ></atomic-icon>\n <span>{clearFilters}</span>\n </Button>\n ),\n ];\n};\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '&quot;';\n break;\n case 38: // &\n escape = '&amp;';\n break;\n case 39: // '\n escape = '&#39;';\n break;\n case 60: // <\n escape = '&lt;';\n break;\n case 62: // >\n escape = '&gt;';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","export function regexEncode(value: string): string {\n return value.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\n\nexport function encodeForDomAttribute(str: string) {\n return str\n .split('')\n .map((ch) => (ch.match(/(\\d|\\w)+/g) ? ch : ch.charCodeAt(0)))\n .join('');\n}\n","import escapeHtml from 'escape-html';\nimport {regexEncode} from '../../../../utils/string-utils';\n\ninterface FacetSearchState {\n query: string;\n values: unknown[];\n isLoading: boolean;\n}\n\n/**\n * Meant to be used inside the `shouldUpdate` lifecycle method.\n * It prevents updating the facet between two matchless facet searches.\n * It also prevents updating the facet until the first search has loaded.\n */\nexport function shouldUpdateFacetSearchComponent(\n nextFacetSearchState: FacetSearchState,\n prevFacetSearchState: FacetSearchState\n) {\n const hasQuery = nextFacetSearchState.query !== '';\n const stillNoValues =\n !nextFacetSearchState.values.length && !prevFacetSearchState.values.length;\n const hasFinishedLoading =\n !nextFacetSearchState.isLoading && prevFacetSearchState.isLoading;\n\n if (hasQuery && stillNoValues) {\n return hasFinishedLoading;\n }\n\n return true;\n}\n\nexport function shouldDisplaySearchResults(facetSearchState: FacetSearchState) {\n const hasQuery = facetSearchState.query !== '';\n const isLoading = facetSearchState.isLoading;\n const hasValues = !!facetSearchState.values.length;\n\n if (!hasQuery) {\n return false;\n }\n\n if (hasValues) {\n return true;\n }\n\n return !isLoading;\n}\n\nexport function highlightSearchResult(resultValue: string, searchQuery = '') {\n const sanitizedResult = escapeHtml(resultValue);\n\n if (searchQuery.trim() === '') {\n return sanitizedResult;\n }\n\n const regex = new RegExp(`(${regexEncode(escapeHtml(searchQuery))})`, 'i');\n return escapeHtml(resultValue).replace(\n regex,\n '<span part=\"search-highlight\" class=\"font-bold\">$1</span>'\n );\n}\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {highlightSearchResult} from '../facet-search/facet-search-utils';\n\ninterface FacetValueLabelHighlightProps {\n displayValue: string;\n searchQuery?: string;\n isSelected: boolean;\n isExcluded?: boolean;\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const FacetValueLabelHighlight: FunctionalComponent<\n FacetValueLabelHighlightProps\n> = (props) => {\n return (\n // deepcode ignore ReactSetInnerHtml: This is not React code\n <span\n title={props.displayValue}\n part=\"value-label\"\n class={`value-label peer-hover:text-error truncate ${\n props.isSelected || !!props.isExcluded ? 'font-bold' : ''\n }`}\n innerHTML={highlightSearchResult(props.displayValue, props.searchQuery)}\n ></span>\n );\n};\n","import {FunctionalComponent, h, VNode} from '@stencil/core';\nimport {Button} from '../../stencil-button';\nimport {FacetValueProps} from '../stencil-facet-common';\n\ninterface FacetValueLinkProps extends FacetValueProps {\n subList?: VNode | VNode[];\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const FacetValueLink: FunctionalComponent<FacetValueLinkProps> = (\n props,\n children\n) => {\n const count = props.numberOfResults.toLocaleString(props.i18n.language);\n const ariaLabel = props.i18n.t('facet-value', {\n value: props.displayValue,\n count: props.numberOfResults,\n formattedCount: count,\n interpolation: {escapeValue: false},\n });\n\n let part =\n props.part ?? `value-link${props.isSelected ? ' value-link-selected' : ''}`;\n\n if (props.additionalPart) {\n part += ` ${props.additionalPart}`;\n }\n\n return (\n <li key={props.displayValue} class={props.class}>\n <Button\n style=\"text-neutral\"\n part={part}\n onClick={() => props.onClick()}\n class=\"group flex w-full items-center truncate px-2 py-2.5 text-left focus-visible:outline-none\"\n ariaPressed={props.isSelected.toString()}\n ariaLabel={ariaLabel}\n ref={props.buttonRef}\n >\n {children}\n <span part=\"value-count\" class=\"value-count\">\n {props.i18n.t('between-parentheses', {\n text: count,\n })}\n </span>\n </Button>\n {props.subList}\n </li>\n );\n};\n","import {h, FunctionalComponent} from '@stencil/core';\n\ninterface GroupProps {\n label: string;\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const FieldsetGroup: FunctionalComponent<GroupProps> = (\n {label},\n children\n) => (\n <fieldset class=\"contents\">\n <legend class=\"sr-only\">{label}</legend>\n {children}\n </fieldset>\n);\n","import {h, FunctionalComponent} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {FieldsetGroup} from '../../stencil-fieldset-group';\n\ninterface FacetValuesGroupProps {\n i18n: i18n;\n label?: string;\n query?: string;\n}\n\n/**\n * @deprecated should only be used for Stencil components.\n */\nexport const FacetValuesGroup: FunctionalComponent<FacetValuesGroupProps> = (\n props,\n children\n) => {\n if (!props.label) {\n return children;\n }\n const facetDisplayLabel = props.i18n.t(props.label);\n const groupLabel =\n props.query === undefined\n ? props.i18n.t('facet-values', {label: facetDisplayLabel})\n : props.i18n.t('facet-search-results', {\n query: props.query,\n label: facetDisplayLabel,\n });\n\n return <FieldsetGroup label={groupLabel}>{children}</FieldsetGroup>;\n};\n","import {buildCustomEvent} from '../../../../utils/event-utils';\nimport type {FacetInfo} from '../../../common/facets/facet-common-store';\n\nexport interface PopoverChildFacet extends FacetInfo {\n hasValues: () => boolean;\n numberOfActiveValues: () => number;\n}\n\nexport const popoverClass = 'popover-nested';\n\nexport function initializePopover(\n host: HTMLElement,\n childFacet: PopoverChildFacet\n) {\n host.dispatchEvent(\n buildCustomEvent<PopoverChildFacet>('atomic/initializePopover', childFacet)\n );\n}\n","import {FacetValue, SearchStatusState} from '@coveo/headless';\nimport {i18n} from 'i18next';\nimport { AtomicAutomaticFacetGenerator } from '../../search/atomic-automatic-facet-generator/atomic-automatic-facet-generator';\n\nexport interface FacetValueProps {\n i18n: i18n;\n displayValue: string;\n numberOfResults: number;\n isSelected: boolean;\n onClick(): void;\n searchQuery?: string;\n class?: string;\n part?: string;\n additionalPart?: string;\n buttonRef?: (element?: HTMLButtonElement) => void;\n}\n\nexport function shouldDisplayInputForFacetRange(facetRange: {\n hasInput: boolean;\n hasInputRange: boolean;\n searchStatusState: SearchStatusState;\n facetValues: Pick<FacetValue, 'numberOfResults' | 'state'>[];\n}) {\n const {hasInput, hasInputRange, searchStatusState, facetValues} = facetRange;\n if (!hasInput) {\n return false;\n }\n\n if (hasInputRange) {\n return true;\n }\n\n if (!searchStatusState.hasResults) {\n return false;\n }\n\n const onlyValuesWithResultsOrActive =\n facetValues.filter(\n (value) => value.numberOfResults || value.state !== 'idle'\n ) || [];\n\n if (!onlyValuesWithResultsOrActive.length) {\n return false;\n }\n\n return true;\n}\n\nexport type BaseFacetElement = HTMLElement & {\n facetId: string;\n isCollapsed: boolean;\n};\n\nexport function sortFacetVisibility(\n facetElements: BaseFacetElement[],\n facetInfoMap: Record<string, {isHidden: () => boolean}>\n) {\n const visibleFacets: BaseFacetElement[] = [];\n const invisibleFacets: BaseFacetElement[] = [];\n\n facetElements.forEach((facet) => {\n if (facetInfoMap[facet.facetId] && facetInfoMap[facet.facetId].isHidden()) {\n invisibleFacets.push(facet);\n } else {\n visibleFacets.push(facet);\n }\n });\n\n return {visibleFacets, invisibleFacets};\n}\n\nexport function collapseFacetsAfter(\n facets: BaseFacetElement[],\n visibleFacetsCount: number\n) {\n if (visibleFacetsCount === -1) {\n return;\n }\n\n facets.forEach((facet, index) => {\n facet.isCollapsed = index + 1 > visibleFacetsCount;\n });\n}\n\nexport function isAutomaticFacetGenerator(\n element: HTMLElement\n): element is AtomicAutomaticFacetGenerator {\n return element.tagName === 'ATOMIC-AUTOMATIC-FACET-GENERATOR';\n}\n\nfunction isPseudoFacet(el: Element): el is BaseFacetElement {\n return 'facetId' in el;\n}\n\nexport function getFacetsInChildren(parent: HTMLElement): BaseFacetElement[] {\n const facets = Array.from(parent.children).filter((child) =>\n isPseudoFacet(child)\n ) as BaseFacetElement[];\n\n return facets;\n}\nexport function getAutomaticFacetGenerator(\n parent: HTMLElement\n): AtomicAutomaticFacetGenerator | undefined {\n return (Array.from(parent.children) as HTMLElement[]).find(\n isAutomaticFacetGenerator\n );\n}\n\nfunction findFacetParent(\n facet: BaseFacetElement,\n parents: (HTMLElement | null)[]\n) {\n for (let i = 0; i < parents.length; i++) {\n if (parents[i]?.contains(facet)) {\n return parents[i];\n }\n }\n return null;\n}\n\n/**\n * Triage elements by their parents.\n * @param facets Facet Elements\n * @param parents Elements that may contains the facets\n * @returns an array in the same order as the parents, containing the facets that are contained by the corresponding parent.\n * The last element of the array contains the facets that are not contained by any of the parents.\n */\nexport function triageFacetsByParents(\n facets: BaseFacetElement[],\n ...parents: (HTMLElement | null)[]\n): Map<HTMLElement | null, BaseFacetElement[]> {\n const sortedFacets: Map<HTMLElement | null, BaseFacetElement[]> = new Map(\n parents.concat([null]).map((parent) => [parent, []])\n );\n for (const facet of facets) {\n const parent = findFacetParent(facet, parents);\n sortedFacets.get(parent)!.push(facet);\n }\n return sortedFacets;\n}\n","import {FocusTargetController} from '@/src/utils/stencil-accessibility-utils';\nimport {\n DateFacet,\n DateFacetValue,\n DateFilter,\n DateRangeOptions,\n DateRangeRequest,\n FacetConditionsManager,\n RangeFacetSortCriterion,\n RelativeDate,\n RelativeDatePeriod,\n RelativeDateUnit,\n SearchStatusState,\n} from '@coveo/headless';\nimport {h, VNode} from '@stencil/core';\nimport {parseDate} from '../../../utils/date-utils';\nimport {getFieldValueCaption} from '../../../utils/field-utils';\nimport {randomID} from '../../../utils/utils';\nimport {InsightBindings} from '../../insight/atomic-insight-interface/atomic-insight-interface';\nimport {Bindings as SearchBindings} from '../../search/atomic-search-interface/atomic-search-interface';\nimport {Hidden} from '../stencil-hidden';\nimport {FacetInfo} from './facet-common-store';\nimport {FacetContainer} from './facet-container/stencil-facet-container';\nimport {FacetHeader} from './facet-header/stencil-facet-header';\nimport {FacetPlaceholder} from './facet-placeholder/stencil-facet-placeholder';\nimport {FacetValueLabelHighlight} from './facet-value-label-highlight/stencil-facet-value-label-highlight';\nimport {FacetValueLink} from './facet-value-link/stencil-facet-value-link';\nimport {FacetValuesGroup} from './facet-values-group/stencil-facet-values-group';\nimport {initializePopover} from './popover/popover-type';\nimport {shouldDisplayInputForFacetRange} from './stencil-facet-common';\n\nexport interface Timeframe {\n period: RelativeDatePeriod;\n unit?: RelativeDateUnit;\n amount?: number;\n label?: string;\n}\n\ninterface TimeframeFacetCommonOptions {\n facetId?: string;\n host: HTMLElement;\n bindings: SearchBindings | InsightBindings;\n label: string;\n field: string;\n headingLevel: number;\n dependsOn: Record<string, string>;\n withDatePicker: boolean;\n setFacetId(id: string): string;\n getSearchStatusState(): SearchStatusState;\n buildDependenciesManager(facetId: string): FacetConditionsManager;\n deserializeRelativeDate(date: string): RelativeDate;\n buildDateRange(config: DateRangeOptions): DateRangeRequest;\n initializeFacetForDatePicker(): DateFacet;\n initializeFacetForDateRange(values: DateRangeRequest[]): DateFacet;\n initializeFilter(): DateFilter;\n min?: string;\n max?: string;\n sortCriteria: RangeFacetSortCriterion;\n}\n\ninterface TimeframeFacetCommonRenderProps {\n hasError: boolean;\n firstSearchExecuted: boolean;\n isCollapsed: boolean;\n headerFocus: FocusTargetController;\n onToggleCollapse: () => boolean;\n}\n\nexport class TimeframeFacetCommon {\n private facetId?: string;\n private facetForDatePicker?: DateFacet;\n private facetForDateRange?: DateFacet;\n private filter?: DateFilter;\n private manualTimeframes: Timeframe[] = [];\n private facetForDateRangeDependenciesManager?: FacetConditionsManager;\n private facetForDatePickerDependenciesManager?: FacetConditionsManager;\n private filterDependenciesManager?: FacetConditionsManager;\n\n constructor(private props: TimeframeFacetCommonOptions) {\n this.facetId = this.determineFacetId;\n this.props.setFacetId(this.facetId);\n\n this.manualTimeframes = this.getManualTimeframes();\n\n // Initialize two facets: One that is actually used to display values for end users, which only exists\n // if we need to display something to the end user (ie: timeframes > 0)\n\n // A second facet is initialized only to verify the results count. It is never used to display results to end user.\n // It serves as a way to determine if the input should be rendered or not, independent of the ranges configured in the component\n if (this.manualTimeframes.length > 0) {\n this.facetForDateRange = this.props.initializeFacetForDateRange(\n this.currentValues\n );\n }\n\n if (this.props.withDatePicker) {\n this.facetForDatePicker = this.props.initializeFacetForDatePicker();\n this.facetForDatePickerDependenciesManager =\n this.props.buildDependenciesManager(\n this.facetForDatePicker.state.facetId\n );\n this.filter = this.props.initializeFilter();\n }\n\n if (this.facetForDateRange) {\n this.facetForDateRangeDependenciesManager =\n this.props.buildDependenciesManager(\n this.facetForDateRange?.state.facetId\n );\n }\n\n if (this.filter) {\n this.filterDependenciesManager = this.props.buildDependenciesManager(\n this.filter?.state.facetId\n );\n }\n\n this.registerFacetToStore();\n }\n\n private get determineFacetId() {\n if (this.props.facetId) {\n return this.props.facetId;\n }\n\n if (this.props.bindings.store.state.dateFacets[this.props.field]) {\n return randomID(`${this.props.field}_`);\n }\n\n return this.props.field;\n }\n\n private get enabled() {\n return (\n this.facetForDateRange?.state.enabled ??\n this.filter?.state.enabled ??\n true\n );\n }\n\n private get valuesToRender() {\n return (\n this.facetForDateRange?.state.values.filter(\n (value) => value.numberOfResults || value.state !== 'idle'\n ) || []\n );\n }\n\n private get shouldRenderValues() {\n return !this.hasInputRange && !!this.valuesToRender.length;\n }\n\n private get shouldRenderFacet() {\n return this.shouldRenderInput || this.shouldRenderValues;\n }\n\n private get shouldRenderInput() {\n return shouldDisplayInputForFacetRange({\n hasInput: this.props.withDatePicker,\n hasInputRange: this.hasInputRange,\n searchStatusState: this.props.getSearchStatusState(),\n facetValues: this.facetForDatePicker?.state?.values || [],\n });\n }\n\n private get hasValues() {\n if (this.facetForDatePicker?.state.values.length) {\n return true;\n }\n\n return !!this.valuesToRender.length;\n }\n\n private get numberOfSelectedValues() {\n if (this.filter?.state?.range) {\n return 1;\n }\n\n return (\n this.facetForDateRange?.state.values.filter(\n ({state}) => state === 'selected'\n ).length || 0\n );\n }\n\n private get hasInputRange() {\n return !!this.filter?.state.range;\n }\n\n public get currentValues(): DateRangeRequest[] {\n return this.manualTimeframes.map(({period, amount, unit}) =>\n period === 'past'\n ? this.props.buildDateRange({\n start: {period, unit, amount},\n end: {period: 'now'},\n })\n : this.props.buildDateRange({\n start: {period: 'now'},\n end: {period, unit, amount},\n })\n );\n }\n\n public disconnectedCallback() {\n if (this.props.host.isConnected) {\n return;\n }\n this.facetForDateRangeDependenciesManager?.stopWatching();\n this.facetForDatePickerDependenciesManager?.stopWatching();\n this.filterDependenciesManager?.stopWatching();\n }\n\n private get isHidden() {\n return !this.shouldRenderFacet || !this.enabled;\n }\n\n private registerFacetToStore() {\n const facetInfo: FacetInfo = {\n label: () => this.props.bindings.i18n.t(this.props.label),\n facetId: this.facetId!,\n element: this.props.host,\n isHidden: () => this.isHidden,\n };\n\n this.props.bindings.store.registerFacet('dateFacets', {\n ...facetInfo,\n format: (value) => this.formatFacetValue(value),\n });\n\n initializePopover(this.props.host, {\n ...facetInfo,\n hasValues: () => this.hasValues,\n numberOfActiveValues: () => this.numberOfSelectedValues,\n });\n\n if (this.filter) {\n this.props.bindings.store.state.dateFacets[this.filter.state.facetId] =\n this.props.bindings.store.state.dateFacets[this.facetId!];\n }\n }\n\n private getManualTimeframes(): Timeframe[] {\n return Array.from(this.props.host.querySelectorAll('atomic-timeframe')).map(\n ({label, amount, unit, period}) => ({\n label,\n amount,\n unit,\n period,\n })\n );\n }\n\n private formatFacetValue(facetValue: DateFacetValue) {\n try {\n const startDate = this.props.deserializeRelativeDate(facetValue.start);\n const relativeDate =\n startDate.period === 'past'\n ? startDate\n : this.props.deserializeRelativeDate(facetValue.end);\n const timeframe = this.getManualTimeframes().find(\n (timeframe) =>\n timeframe.period === relativeDate.period &&\n timeframe.unit === relativeDate.unit &&\n timeframe.amount === relativeDate.amount\n );\n\n if (timeframe?.label) {\n return getFieldValueCaption(\n this.props.field,\n timeframe.label,\n this.props.bindings.i18n\n );\n }\n return this.props.bindings.i18n.t(\n `${relativeDate.period}-${relativeDate.unit}`,\n {\n count: relativeDate.amount,\n }\n );\n } catch (error) {\n return this.props.bindings.i18n.t('to', {\n start: parseDate(facetValue.start).format('YYYY-MM-DD'),\n end: parseDate(facetValue.end).format('YYYY-MM-DD'),\n });\n }\n }\n private renderValues() {\n return this.renderValuesContainer(\n this.valuesToRender.map((value) => this.renderValue(value))\n );\n }\n private renderValue(facetValue: DateFacetValue) {\n const displayValue = this.formatFacetValue(facetValue);\n const isSelected = facetValue.state === 'selected';\n const isExcluded = facetValue.state === 'excluded';\n return (\n <FacetValueLink\n displayValue={displayValue}\n isSelected={isSelected}\n numberOfResults={facetValue.numberOfResults}\n i18n={this.props.bindings.i18n}\n onClick={() => this.facetForDateRange!.toggleSingleSelect(facetValue)}\n >\n <FacetValueLabelHighlight\n displayValue={displayValue}\n isSelected={isSelected}\n isExcluded={isExcluded}\n ></FacetValueLabelHighlight>\n </FacetValueLink>\n );\n }\n\n private renderValuesContainer(children: VNode[]) {\n return (\n <FacetValuesGroup\n i18n={this.props.bindings.i18n}\n label={this.props.label}\n >\n <ul class=\"mt-3\" part=\"values\">\n {children}\n </ul>\n </FacetValuesGroup>\n );\n }\n\n private renderHeader(\n isCollapsed: boolean,\n headerFocus: FocusTargetController,\n onToggleCollapse: () => void\n ) {\n return (\n <FacetHeader\n i18n={this.props.bindings.i18n}\n label={this.props.label}\n onClearFilters={() => {\n headerFocus.focusAfterSearch();\n if (this.filter?.state.range) {\n this.filter?.clear();\n return;\n }\n this.facetForDateRange?.deselectAll();\n }}\n numberOfActiveValues={this.numberOfSelectedValues}\n isCollapsed={isCollapsed}\n headingLevel={this.props.headingLevel}\n onToggleCollapse={onToggleCollapse}\n headerRef={(el) => headerFocus.setTarget(el)}\n ></FacetHeader>\n );\n }\n\n private renderDateInput() {\n return (\n <atomic-stencil-facet-date-input\n min={this.props.min}\n max={this.props.max}\n bindings={this.props.bindings}\n label={this.props.label}\n facetId={this.filter!.state!.facetId}\n rangeGetter={() => this.filter!.state.range}\n rangeSetter={(request: DateRangeRequest) => {\n this.filter!.setRange(request);\n }}\n ></atomic-stencil-facet-date-input>\n );\n }\n\n public render({\n hasError,\n firstSearchExecuted,\n isCollapsed,\n headerFocus,\n onToggleCollapse,\n }: TimeframeFacetCommonRenderProps) {\n if (hasError || !this.enabled) {\n return <Hidden></Hidden>;\n }\n\n if (!firstSearchExecuted) {\n return (\n <FacetPlaceholder\n numberOfValues={this.currentValues.length}\n isCollapsed={isCollapsed}\n ></FacetPlaceholder>\n );\n }\n\n if (!this.shouldRenderFacet) {\n return <Hidden></Hidden>;\n }\n\n return (\n <FacetContainer>\n {this.renderHeader(isCollapsed, headerFocus, onToggleCollapse)}\n {!isCollapsed && [\n this.shouldRenderValues && this.renderValues(),\n this.shouldRenderInput && this.renderDateInput(),\n ]}\n </FacetContainer>\n );\n }\n}\n","@import '../../common/facets/facet-common.pcss';\n","import {\n buildDateFacet as buildInsightDateFacet,\n buildDateFilter as buildInsightDateFilter,\n buildDateRange as buildInsightDateRange,\n buildFacetConditionsManager as buildInsightFacetConditionsManager,\n buildSearchStatus as buildInsightSearchStatus,\n deserializeRelativeDate as deserializeInsightRelativeDate,\n DateFacet as InsightDateFacet,\n DateFacetState as InsightDateFacetState,\n DateFilter as InsightDateFilter,\n DateFilterState as InsightDateFilterState,\n DateRangeRequest as InsightDateRangeRequest,\n SearchStatus as InsightSearchStatus,\n SearchStatusState as InsightSearchStatusState,\n loadDateFacetSetActions as loadInsightDateFacetSetActions,\n RangeFacetSortCriterion as InsightRangeFacetSortCriterion,\n FacetValueRequest as InsightFacetValueRequest,\n CategoryFacetValueRequest as InsightCategoryFacetValueRequest,\n} from '@coveo/headless/insight';\nimport {Component, Element, h, Listen, Prop, State} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {MapProp} from '../../../utils/props-utils';\nimport {FocusTargetController} from '../../../utils/stencil-accessibility-utils';\nimport {parseDependsOn} from '../../common/facets/depends-on';\nimport {FacetPlaceholder} from '../../common/facets/facet-placeholder/stencil-facet-placeholder';\nimport {TimeframeFacetCommon} from '../../common/facets/stencil-timeframe-facet-common';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-timeframe-facet',\n styleUrl: './atomic-insight-timeframe-facet.pcss',\n shadow: true,\n})\nexport class AtomicInsightTimeframeFacet\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n public facetForDateRange?: InsightDateFacet;\n public facetForDatePicker?: InsightDateFacet;\n\n private timeframeFacetCommon?: TimeframeFacetCommon;\n public filter?: InsightDateFilter;\n public searchStatus!: InsightSearchStatus;\n @Element() private host!: HTMLElement;\n\n @BindStateToController('facetForDateRange')\n @State()\n public facetState!: InsightDateFacetState;\n @BindStateToController('facetForDatePicker')\n @State()\n public facetForDatePickerState?: InsightDateFacetState;\n @BindStateToController('filter')\n @State()\n public filterState?: InsightDateFilterState;\n @BindStateToController('searchStatus')\n @State()\n public searchStatusState!: InsightSearchStatusState;\n @State() public error!: Error;\n\n /**\n * Specifies a unique identifier for the facet.\n */\n @Prop({mutable: true, reflect: true}) public facetId?: string;\n /**\n * The non-localized label for the facet.\n * Used in the atomic-breadbox component through the bindings store.\n */\n @Prop({reflect: true}) public label = 'no-label';\n /**\n * The field whose values you want to display in the facet.\n */\n @Prop({reflect: true}) public field = 'date';\n /**\n * Whether this facet should contain a date picker allowing users to set custom ranges.\n */\n @Prop({reflect: true}) public withDatePicker = false;\n /**\n * Specifies if the facet is collapsed.\n */\n @Prop({reflect: true, mutable: true}) public isCollapsed = false;\n /**\n * The [heading level](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) to use for the heading over the facet, from 1 to 6.\n */\n @Prop({reflect: true}) public headingLevel = 0;\n /**\n * Whether to exclude the parents of folded results when estimating the result count for each facet value.\n *\n *\n * Note: Resulting count is only an estimation, in some cases this value could be incorrect.\n */\n @Prop({reflect: true}) public filterFacetCount = true;\n /**\n * The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.\n * Note: A high injectionDepth may negatively impact the facet request performance.\n * Minimum: `0`\n * Default: `1000`\n */\n @Prop({reflect: true}) public injectionDepth = 1000;\n\n /**\n * The required facets and values for this facet to be displayed.\n * Examples:\n * ```html\n * <atomic-insight-facet facet-id=\"abc\" field=\"objecttype\" ...></atomic-insight-facet>\n *\n * <!-- To show the facet when any value is selected in the facet with id \"abc\": -->\n * <atomic-insight-timeframe-facet\n * depends-on-abc\n * ...\n * ></atomic-insight-timeframe-facet>\n *\n * <!-- To show the facet when value \"doc\" is selected in the facet with id \"abc\": -->\n * <atomic-insight-timeframe-facet\n * depends-on-abc=\"doc\"\n * ...\n * ></atomic-insight-timeframe-facet>\n * ```\n */\n @MapProp() @Prop() public dependsOn: Record<string, string> = {};\n\n /**\n * The sort criterion to apply to the returned facet values.\n * Possible values are 'ascending' and 'descending'.\n */\n @Prop({reflect: true}) public sortCriteria: InsightRangeFacetSortCriterion =\n 'descending';\n\n private headerFocus?: FocusTargetController;\n\n public initialize() {\n this.timeframeFacetCommon = new TimeframeFacetCommon({\n facetId: this.facetId,\n host: this.host,\n bindings: this.bindings,\n label: this.label,\n field: this.field,\n headingLevel: this.headingLevel,\n dependsOn: this.dependsOn,\n withDatePicker: this.withDatePicker,\n setFacetId: (id: string) => (this.facetId = id),\n buildDependenciesManager: (facetId: string) =>\n buildInsightFacetConditionsManager(this.bindings.engine, {\n facetId,\n conditions: parseDependsOn<\n InsightFacetValueRequest | InsightCategoryFacetValueRequest\n >(this.dependsOn),\n }),\n buildDateRange: buildInsightDateRange,\n getSearchStatusState: () => this.searchStatusState,\n deserializeRelativeDate: deserializeInsightRelativeDate,\n initializeFacetForDatePicker: () => this.initializeFacetForDatePicker(),\n initializeFacetForDateRange: (values: InsightDateRangeRequest[]) =>\n this.initializeFacetForDateRange(values),\n initializeFilter: () => this.initializeFilter(),\n sortCriteria: this.sortCriteria,\n });\n this.searchStatus = buildInsightSearchStatus(this.bindings.engine);\n }\n\n private get focusTarget(): FocusTargetController {\n if (!this.headerFocus) {\n this.headerFocus = new FocusTargetController(this);\n }\n return this.headerFocus;\n }\n\n public disconnectedCallback() {\n this.timeframeFacetCommon?.disconnectedCallback();\n }\n\n private initializeFacetForDatePicker() {\n this.facetForDatePicker = buildInsightDateFacet(this.bindings.engine, {\n options: {\n facetId: `${this.facetId}_input_range`,\n numberOfValues: 1,\n generateAutomaticRanges: true,\n field: this.field,\n filterFacetCount: this.filterFacetCount,\n injectionDepth: this.injectionDepth,\n },\n });\n return this.facetForDatePicker;\n }\n\n private initializeFacetForDateRange(values: InsightDateRangeRequest[]) {\n this.facetForDateRange = buildInsightDateFacet(this.bindings.engine, {\n options: {\n facetId: this.facetId,\n field: this.field,\n currentValues: values,\n generateAutomaticRanges: false,\n sortCriteria: 'descending',\n filterFacetCount: this.filterFacetCount,\n injectionDepth: this.injectionDepth,\n },\n });\n\n return this.facetForDateRange;\n }\n\n private initializeFilter() {\n this.filter = buildInsightDateFilter(this.bindings.engine, {\n options: {\n facetId: `${this.facetId}_input`,\n field: this.field,\n },\n });\n\n return this.filter;\n }\n\n @Listen('atomic/dateInputApply')\n public applyDateInput() {\n this.facetId &&\n this.bindings.engine.dispatch(\n loadInsightDateFacetSetActions(\n this.bindings.engine\n ).deselectAllDateFacetValues(this.facetId)\n );\n }\n\n public render() {\n if (!this.timeframeFacetCommon) {\n return (\n <FacetPlaceholder\n numberOfValues={5}\n isCollapsed={this.isCollapsed}\n ></FacetPlaceholder>\n );\n }\n return this.timeframeFacetCommon.render({\n hasError: this.searchStatusState.hasError,\n firstSearchExecuted: this.searchStatusState.firstSearchExecuted,\n isCollapsed: this.isCollapsed,\n headerFocus: this.focusTarget,\n onToggleCollapse: () => (this.isCollapsed = !this.isCollapsed),\n });\n }\n}\n"],"mappings":"4hBAyDaA,EAcX,WAAAC,CAAoBC,GAAAC,KAAAD,YAVbC,KAAAC,sBACLC,IAEAF,KAAKG,uBAAuBC,KAAKF,EAAS,EAGpCF,KAAAK,mBAAqB,MACrBL,KAAAM,oBAAsB,MACtBN,KAAAG,uBAAqC,GAG3CH,KAAKO,SAAWR,EAAUQ,SAC1BP,KAAKQ,2B,CAGC,mBAAAC,GACNT,KAAKU,4BACL,MAAOV,KAAKG,uBAAuBQ,OAAQ,CACzCX,KAAKG,uBAAuBS,KAA5BZ,I,EAIG,SAAAa,CAAUC,GACf,IAAKA,EAAI,CACP,M,CAEFd,KAAKe,QAAUD,EACf,GAAId,KAAKM,oBAAqB,CAC5BN,KAAKM,oBAAsB,MAC3BN,KAAKgB,O,EAIF,WAAMA,SACLC,IACNjB,KAAKe,SAASC,QACdhB,KAAKS,qB,CAGA,gBAAAS,GACLlB,KAAKmB,aAAenB,KAAKO,SAASa,MAAMC,sBACtCrB,KAAKO,SAASe,QAEhBtB,KAAKK,mBAAqB,KAC1B,OAAO,IAAIkB,SAASC,GAAaxB,KAAKU,wBAA0Bc,G,CAG3D,iBAAAC,GACLzB,KAAKM,oBAAsB,KAC3B,OAAO,IAAIiB,SAASC,GAAaxB,KAAKU,wBAA0Bc,G,CAG3D,uBAAAE,GACL,GACE1B,KAAKO,SAASa,MAAMC,sBAAsBrB,KAAKO,SAASe,UACxDtB,KAAKmB,aACL,CACAnB,KAAKK,mBAAqB,K,EAItB,yBAAAG,GACN,MAAMmB,EAA6B3B,KAAKD,UAAU6B,mBAElD5B,KAAKD,UAAU6B,mBAAqB,KAClCD,GACEA,EAA2BE,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K,S,CAIjC,MAAAgE,GACL,IAAKvO,KAAKkP,qBAAsB,CAC9B,OACEnL,EAACL,EAAgB,CACfC,eAAgB,EAChBC,YAAa5D,KAAK4D,a,CAIxB,OAAO5D,KAAKkP,qBAAqBX,OAAO,CACtCC,SAAUxO,KAAKiK,kBAAkBuE,SACjCC,oBAAqBzO,KAAKiK,kBAAkBwE,oBAC5C7K,YAAa5D,KAAK4D,YAClBkK,YAAa9N,KAAK0P,YAClB5J,iBAAkB,IAAO9F,KAAK4D,aAAe5D,KAAK4D,a,6BAvMzBuM,EAAA,CAA5BC,K,+BAWMD,EAAA,CAFNE,EAAsB,sB,iCAKhBF,EAAA,CAFNE,EAAsB,uB,8CAKhBF,EAAA,CAFNE,EAAsB,W,kCAKhBF,EAAA,CAFNE,EAAsB,iB,wCAgEGF,EAAA,CAAzBG,K","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{h as t,H as i,g as n,f as e}from"./p-ec1c5f46.js";import{i as s,c as o,M as r,e as a,a as c}from"./p-81d6e743.js";import{b as h}from"./p-1580513b.js";const d=()=>t(i,{class:"atomic-hidden"});const l="data-atomic-rendered";const f="data-atomic-loaded";function u({forceUpdate:i}={}){return(u,p)=>{const{componentWillLoad:m,render:g,componentDidRender:b,componentDidLoad:C,disconnectedCallback:y}=u;let j=()=>{};if(p!=="bindings"){return console.error(`The InitializeBindings decorator should be used on a property called "bindings", and not "${p}"`,u)}u.componentWillLoad=function(){const t=n(this);t.setAttribute(l,"false");t.setAttribute(f,"false");const d=h(s,(t=>{this.bindings=t;const n=()=>e(this);this.bindings.i18n.on("languageChanged",n);j=()=>this.bindings.i18n.off("languageChanged",n);try{if(this.initialize){this.initialize();if(i){e(this)}}else{e(this)}}catch(t){this.error=t}}));const u=o(t,c.join(", "));if(!u){this.error=new r(t.nodeName.toLowerCase());return}a(u,d,t);return m&&m.call(this)};u.render=function(){if(this.error){return t("atomic-component-error",{element:n(this),error:this.error})}if(!this.bindings){return t(d,null)}n(this).setAttribute(l,"true");return g&&g.call(this)};u.disconnectedCallback=function(){const t=n(this);t.setAttribute(l,"false");t.setAttribute(f,"false");j();y&&y.call(this)};u.componentDidRender=function(){const t=n(this);if(t.getAttribute(l)==="false"){return}b&&b.call(this);if(t.getAttribute(f)==="false"){t.setAttribute(f,"true");C&&C.call(this)}};u.componentDidLoad=function(){}}}function p(t,i){return(e,s)=>{const{disconnectedCallback:o,initialize:r}=e;e.initialize=function(){r&&r.call(this);if(!r){return console.error(`ControllerState: The "initialize" method has to be defined and instantiate a controller for the property ${t}`,e)}if(!this[t]){return}if(i?.onUpdateCallbackMethod&&!this[i.onUpdateCallbackMethod]){return console.error(`ControllerState: The onUpdateCallbackMethod property "${i.onUpdateCallbackMethod}" is not defined`,e)}this.unsubscribeController=this[t].subscribe((()=>{this[s]=this[t].state;i?.onUpdateCallbackMethod&&this[i.onUpdateCallbackMethod]()}))};e.disconnectedCallback=function(){!n(this).isConnected&&this.unsubscribeController?.();o&&o.call(this)}}}export{p as B,d as H,u as I};
2
- //# sourceMappingURL=p-4a32511f.js.map
1
+ import{h as t,H as i,g as n,f as e}from"./p-aad3b4ec.js";import{i as s,c as o,M as a,e as r,a as c}from"./p-81d6e743.js";import{b as h}from"./p-1580513b.js";const d=()=>t(i,{class:"atomic-hidden"});const l="data-atomic-rendered";const f="data-atomic-loaded";function u({forceUpdate:i}={}){return(u,p)=>{const{componentWillLoad:m,render:b,componentDidRender:g,componentDidLoad:C,disconnectedCallback:y}=u;let j=()=>{};if(p!=="bindings"){return console.error(`The InitializeBindings decorator should be used on a property called "bindings", and not "${p}"`,u)}u.componentWillLoad=function(){const t=n(this);t.setAttribute(l,"false");t.setAttribute(f,"false");const d=h(s,(t=>{this.bindings=t;const n=()=>e(this);this.bindings.i18n.on("languageChanged",n);j=()=>this.bindings.i18n.off("languageChanged",n);try{if(this.initialize){this.initialize();if(i){e(this)}}else{e(this)}}catch(t){this.error=t}}));const u=o(t,c.join(", "));if(!u){this.error=new a(t.nodeName.toLowerCase());return}r(u,d,t);return m&&m.call(this)};u.render=function(){if(this.error){return t("atomic-component-error",{element:n(this),error:this.error})}if(!this.bindings){return t(d,null)}n(this).setAttribute(l,"true");return b&&b.call(this)};u.disconnectedCallback=function(){const t=n(this);t.setAttribute(l,"false");t.setAttribute(f,"false");j();y&&y.call(this)};u.componentDidRender=function(){const t=n(this);if(t.getAttribute(l)==="false"){return}g&&g.call(this);if(t.getAttribute(f)==="false"){t.setAttribute(f,"true");C&&C.call(this)}};u.componentDidLoad=function(){}}}function p(t,i){return(e,s)=>{const{disconnectedCallback:o,initialize:a}=e;e.initialize=function(){a&&a.call(this);if(!a){return console.error(`ControllerState: The "initialize" method has to be defined and instantiate a controller for the property ${t}`,e)}if(!this[t]){return}if(i?.onUpdateCallbackMethod&&!this[i.onUpdateCallbackMethod]){return console.error(`ControllerState: The onUpdateCallbackMethod property "${i.onUpdateCallbackMethod}" is not defined`,e)}this.unsubscribeController=this[t].subscribe((()=>{this[s]=this[t].state;i?.onUpdateCallbackMethod&&this[i.onUpdateCallbackMethod]()}))};e.disconnectedCallback=function(){!n(this).isConnected&&this.unsubscribeController?.();o&&o.call(this)}}}export{p as B,d as H,u as I};
2
+ //# sourceMappingURL=p-2045a1b1.js.map
@@ -0,0 +1,2 @@
1
+ import{h as t,r as e,g as i}from"./p-aad3b4ec.js";import{i as o,a as n,b as s,M as r}from"./p-5226a938.js";import{ResultTemplatesHelpers as c}from"@coveo/headless";import"@coveo/bueno";import"./p-4573c419.js";const a="atomic-table-element";const l=new Set(["atomic-result-section-visual","atomic-result-section-badges","atomic-result-section-actions","atomic-result-section-title","atomic-result-section-title-metadata","atomic-result-section-emphasized","atomic-result-section-excerpt","atomic-result-section-bottom-metadata","atomic-result-section-children"]);const u=new Set(["atomic-product-section-visual","atomic-product-section-badges","atomic-product-section-actions","atomic-product-section-name","atomic-product-section-metadata","atomic-product-section-emphasized","atomic-product-section-description","atomic-product-section-bottom-metadata","atomic-product-section-children"]);const m=new Set([...l,...u]);function h(t){if(!o(t)){return false}return m.has(t.tagName.toLowerCase())}function d(t){if(h(t)){return"section"}if(!s(t)){return"metadata"}if(o(t)&&t.tagName.toLowerCase()===a){return"table-column-definition"}return"other"}function p(t){return n(Array.from(t),(t=>d(t)))}class f{constructor({host:t,setError:e,validParents:i,allowEmpty:o=false}){this.matchConditions=[];this.gridCellLinkTarget="_self";this.host=t;this.validateTemplate(t,e,i,o)}validateTemplate(t,e,i,o=true){const n=i.map((t=>t.toUpperCase())).includes(t.parentElement?.nodeName||"");const s=t.nodeName.toLowerCase();if(!n){e(new Error(`The "${s}" component has to be the child of one of the following: ${i.map((t=>`"${t.toLowerCase()}"`)).join(", ")}.`));return}if(t.parentElement?.attributes.getNamedItem("display")?.value==="grid"){this.gridCellLinkTarget=t.parentElement?.attributes.getNamedItem("grid-cell-link-target")?.value}const r=t.querySelector("template:not([slot])");if(!r){e(new Error(`The "${s}" component has to contain a "template" element as a child.`));return}if(!o&&!r.innerHTML.trim()){e(new Error(`The "template" tag inside "${s}" cannot be empty.`));return}if(r.content.querySelector("script")){console.warn('Any "script" tags defined inside of "template" elements are not supported and will not be executed when the results are rendered.',t)}const{section:c,other:a}=p(r.content.childNodes);if(c?.length&&a?.length){console.warn("Result templates should only contain section elements or non-section elements. Future updates could unpredictably affect this result template.",t,{sectionNodes:c,otherNodes:a})}}getTemplate(t,e){if(e){return null}return{conditions:t.concat(this.matchConditions),content:b(this.host).content,linkContent:this.getLinkTemplateElement(this.host).content,priority:1}}renderIfError(e){if(e){return t("atomic-component-error",{element:this.host,error:e})}}getDefaultLinkTemplateElement(){const t=document.createElement("template");t.innerHTML=`<atomic-result-link>${this.gridCellLinkTarget?`<a slot="attributes" target="${this.gridCellLinkTarget}"></a>`:""}</atomic-result-link>`;return t}getLinkTemplateElement(t){return t.querySelector('template[slot="link"]')??this.getDefaultLinkTemplateElement()}}function b(t){return t.querySelector("template:not([slot])")}function g(t,e){const i=[];for(const e in t){i.push(c.fieldMustMatch(e,t[e]))}for(const t in e){i.push(c.fieldMustNotMatch(t,e[t]))}return i}function v(t,e){const i=[];if(t){const e=t.split(",");i.push(c.fieldsMustBeDefined(e))}if(e){const t=e.split(",");i.push(c.fieldsMustNotBeDefined(t))}return i}var w=undefined&&undefined.__decorate||function(t,e,i,o){var n=arguments.length,s=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")s=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)if(r=t[c])s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s;return n>3&&s&&Object.defineProperty(e,i,s),s};const y=class{constructor(t){e(this,t);this.conditions=[];this.mustMatch={};this.mustNotMatch={};this.error=undefined;this.conditions=[];this.ifDefined=undefined;this.ifNotDefined=undefined;this.mustMatch={};this.mustNotMatch={}}connectedCallback(){this.resultTemplateCommon=new f({host:this.host,setError:t=>{this.error=t},validParents:["atomic-insight-result-children"]})}componentWillLoad(){this.conditions=v(this.ifDefined,this.ifNotDefined);this.resultTemplateCommon.matchConditions=g(this.mustMatch,this.mustNotMatch)}async getTemplate(){return this.resultTemplateCommon.getTemplate(this.conditions,this.error)}render(){return this.resultTemplateCommon.renderIfError(this.error)}get host(){return i(this)}};w([r({splitValues:true})],y.prototype,"mustMatch",void 0);w([r({splitValues:true})],y.prototype,"mustNotMatch",void 0);export{y as atomic_insight_result_children_template};
2
+ //# sourceMappingURL=p-500bf5c4.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tableElementTagName","resultSectionTags","Set","productSectionTags","allTags","isResultSectionNode","element","isElementNode","has","tagName","toLowerCase","getTemplateNodeType","node","isVisualNode","groupNodesByType","nodes","aggregate","Array","from","ResultTemplateCommon","constructor","host","setError","validParents","allowEmpty","this","matchConditions","gridCellLinkTarget","validateTemplate","hasValidParent","map","p","toUpperCase","includes","parentElement","nodeName","Error","join","attributes","getNamedItem","value","template","querySelector","innerHTML","trim","content","console","warn","section","sectionNodes","other","otherNodes","childNodes","length","getTemplate","conditions","error","concat","getTemplateElement","linkContent","getLinkTemplateElement","priority","renderIfError","h","getDefaultLinkTemplateElement","linkTemplate","document","createElement","makeMatchConditions","mustMatch","mustNotMatch","field","push","ResultTemplatesHelpers","fieldMustMatch","fieldMustNotMatch","makeDefinedConditions","ifDefined","ifNotDefined","fieldNames","split","fieldsMustBeDefined","fieldsMustNotBeDefined","AtomicInsightResultChildrenTemplate","hostRef","connectedCallback","resultTemplateCommon","err","componentWillLoad","render","__decorate","MapProp","splitValues"],"sources":["src/components/common/table-element-utils.ts","src/components/common/layout/item-layout-sections.ts","src/components/common/result-templates/stencil-result-template-common.tsx","src/components/insight/result-templates/atomic-insight-result-children-template/atomic-insight-result-children-template.tsx"],"sourcesContent":["export const tableElementTagName = 'atomic-table-element';\n","import {isElementNode} from '@/src/utils/utils';\n\nconst resultSectionTags = new Set([\n 'atomic-result-section-visual',\n 'atomic-result-section-badges',\n 'atomic-result-section-actions',\n 'atomic-result-section-title',\n 'atomic-result-section-title-metadata',\n 'atomic-result-section-emphasized',\n 'atomic-result-section-excerpt',\n 'atomic-result-section-bottom-metadata',\n 'atomic-result-section-children',\n] as const);\n\nconst productSectionTags = new Set([\n 'atomic-product-section-visual',\n 'atomic-product-section-badges',\n 'atomic-product-section-actions',\n 'atomic-product-section-name',\n 'atomic-product-section-metadata',\n 'atomic-product-section-emphasized',\n 'atomic-product-section-description',\n 'atomic-product-section-bottom-metadata',\n 'atomic-product-section-children',\n] as const);\n\nconst allTags = new Set([...resultSectionTags, ...productSectionTags]);\n\ntype SetValueType<T> = T extends Set<infer U> ? U : never;\n\nexport type ItemSectionTagName = SetValueType<typeof allTags>;\n\nexport function isResultSectionNode(element: Node) {\n if (!isElementNode(element)) {\n return false;\n }\n return allTags.has(element.tagName.toLowerCase() as ItemSectionTagName);\n}\n\nexport function containsSections(content: string | NodeList | HTMLCollection) {\n if (typeof content === 'string') {\n return Array.from(allTags.values()).some((tag) => content.includes(tag));\n }\n return Array.from(content).some((child) => isResultSectionNode(child));\n}\n","import {\n ResultTemplate,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {h} from '@stencil/core';\nimport {aggregate, isElementNode, isVisualNode} from '@/src/utils/utils';\nimport {tableElementTagName} from '../table-element-utils';\nimport {ItemTarget} from '../layout/display-options';\nimport {isResultSectionNode} from '../layout/item-layout-sections';\n\nexport type TemplateContent = DocumentFragment;\n\ninterface ResultTemplateCommonProps {\n allowEmpty?: boolean;\n host: HTMLDivElement;\n validParents: string[];\n setError: (error: Error) => void;\n}\n\ntype TemplateNodeType =\n | 'section'\n | 'metadata'\n | 'table-column-definition'\n | 'other';\n\nexport function getTemplateNodeType(node: Node): TemplateNodeType {\n if (isResultSectionNode(node)) {\n return 'section';\n }\n if (!isVisualNode(node)) {\n return 'metadata';\n }\n if (\n isElementNode(node) &&\n node.tagName.toLowerCase() === tableElementTagName\n ) {\n return 'table-column-definition';\n }\n return 'other';\n}\n\nfunction groupNodesByType(nodes: NodeList) {\n return aggregate(Array.from(nodes), (node) => getTemplateNodeType(node));\n}\n\nexport class ResultTemplateCommon {\n private host: HTMLDivElement;\n public matchConditions: ResultTemplateCondition[] = [];\n private gridCellLinkTarget: ItemTarget = '_self';\n\n constructor({\n host,\n setError,\n validParents,\n allowEmpty = false,\n }: ResultTemplateCommonProps) {\n this.host = host;\n this.validateTemplate(host, setError, validParents, allowEmpty);\n }\n\n validateTemplate(\n host: HTMLDivElement,\n setError: (error: Error) => void,\n validParents: string[],\n allowEmpty = true\n ) {\n const hasValidParent = validParents\n .map((p) => p.toUpperCase())\n .includes(host.parentElement?.nodeName || '');\n const tagName = host.nodeName.toLowerCase();\n\n if (!hasValidParent) {\n setError(\n new Error(\n `The \"${tagName}\" component has to be the child of one of the following: ${validParents\n .map((p) => `\"${p.toLowerCase()}\"`)\n .join(', ')}.`\n )\n );\n return;\n }\n\n if (\n host.parentElement?.attributes.getNamedItem('display')?.value === 'grid'\n ) {\n this.gridCellLinkTarget = host.parentElement?.attributes.getNamedItem(\n 'grid-cell-link-target'\n )?.value as ItemTarget;\n }\n\n const template = host.querySelector<HTMLTemplateElement>(\n 'template:not([slot])'\n );\n if (!template) {\n setError(\n new Error(\n `The \"${tagName}\" component has to contain a \"template\" element as a child.`\n )\n );\n return;\n }\n\n if (!allowEmpty && !template.innerHTML.trim()) {\n setError(\n new Error(`The \"template\" tag inside \"${tagName}\" cannot be empty.`)\n );\n return;\n }\n\n if (template.content.querySelector('script')) {\n console.warn(\n 'Any \"script\" tags defined inside of \"template\" elements are not supported and will not be executed when the results are rendered.',\n host\n );\n }\n\n const {section: sectionNodes, other: otherNodes} = groupNodesByType(\n template.content.childNodes\n );\n if (sectionNodes?.length && otherNodes?.length) {\n console.warn(\n 'Result templates should only contain section elements or non-section elements. Future updates could unpredictably affect this result template.',\n host,\n {sectionNodes, otherNodes}\n );\n }\n }\n\n getTemplate(\n conditions: ResultTemplateCondition[],\n error: Error\n ): ResultTemplate<TemplateContent> | null {\n if (error) {\n return null;\n }\n\n return {\n conditions: conditions.concat(this.matchConditions),\n content: getTemplateElement(this.host).content!,\n linkContent: this.getLinkTemplateElement(this.host).content!,\n priority: 1,\n };\n }\n\n renderIfError(error: Error) {\n if (error) {\n return (\n <atomic-component-error\n element={this.host}\n error={error}\n ></atomic-component-error>\n );\n }\n }\n\n getDefaultLinkTemplateElement() {\n const linkTemplate = document.createElement('template');\n linkTemplate.innerHTML = `<atomic-result-link>${this.gridCellLinkTarget ? `<a slot=\"attributes\" target=\"${this.gridCellLinkTarget}\"></a>` : ''}</atomic-result-link>`;\n return linkTemplate;\n }\n\n getLinkTemplateElement(host: HTMLElement) {\n return (\n host.querySelector<HTMLTemplateElement>('template[slot=\"link\"]') ??\n this.getDefaultLinkTemplateElement()\n );\n }\n}\n\nfunction getTemplateElement(host: HTMLElement) {\n return host.querySelector<HTMLTemplateElement>('template:not([slot])')!;\n}\n\nexport function makeMatchConditions(\n mustMatch: Record<string, string[]>,\n mustNotMatch: Record<string, string[]>\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n for (const field in mustMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustMatch(field, mustMatch[field])\n );\n }\n\n for (const field in mustNotMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustNotMatch(field, mustNotMatch[field])\n );\n }\n return conditions;\n}\n\nexport function makeDefinedConditions(\n ifDefined?: string,\n ifNotDefined?: string\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n if (ifDefined) {\n const fieldNames = ifDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames));\n }\n\n if (ifNotDefined) {\n const fieldNames = ifNotDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));\n }\n return conditions;\n}\n","import {ResultTemplate, ResultTemplateCondition} from '@coveo/headless';\nimport {Component, Element, Prop, State, Method} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {\n makeDefinedConditions,\n makeMatchConditions,\n ResultTemplateCommon,\n} from '../../../common/result-templates/stencil-result-template-common';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-children-template',\n shadow: true,\n})\nexport class AtomicInsightResultChildrenTemplate {\n @Element() public host!: HTMLDivElement;\n\n @State() public error!: Error;\n\n /**\n * A function that must return true on results for the result template to apply.\n * Set programmatically before initialization, not via attribute.\n *\n * For example, the following targets a template and sets a condition to make it apply only to results whose `title` contains `singapore`:\n * `document.querySelector('#target-template').conditions = [(result) => /singapore/i.test(result.title)];`\n */\n @Prop() public conditions: ResultTemplateCondition[] = [];\n\n /**\n * The field that, when defined on a result item, would allow the template to be applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are defined: `if-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifDefined?: string;\n\n /**\n * The field that, when defined on a result item, would prevent the template from being applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are NOT defined: `if-not-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * The field and values that define which result items the condition must be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustMatch: Record<\n string,\n string[]\n > = {};\n\n /**\n * The field and values that define which result items the condition must not be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustNotMatch: Record<\n string,\n string[]\n > = {};\n\n public resultTemplateCommon!: ResultTemplateCommon;\n\n constructor() {}\n\n connectedCallback() {\n this.resultTemplateCommon = new ResultTemplateCommon({\n host: this.host,\n setError: (err) => {\n this.error = err;\n },\n validParents: ['atomic-insight-result-children'],\n });\n }\n\n public componentWillLoad() {\n this.conditions = makeDefinedConditions(this.ifDefined, this.ifNotDefined);\n this.resultTemplateCommon.matchConditions = makeMatchConditions(\n this.mustMatch,\n this.mustNotMatch\n );\n }\n\n /**\n * Gets the appropriate result template based on conditions applied.\n */\n @Method()\n public async getTemplate(): Promise<ResultTemplate<DocumentFragment> | null> {\n return this.resultTemplateCommon.getTemplate(this.conditions, this.error);\n }\n\n public render() {\n return this.resultTemplateCommon.renderIfError(this.error);\n }\n}\n"],"mappings":"8OAAO,MAAMA,EAAsB,uBCEnC,MAAMC,EAAoB,IAAIC,IAAI,CAChC,+BACA,+BACA,gCACA,8BACA,uCACA,mCACA,gCACA,wCACA,mCAGF,MAAMC,EAAqB,IAAID,IAAI,CACjC,gCACA,gCACA,iCACA,8BACA,kCACA,oCACA,qCACA,yCACA,oCAGF,MAAME,EAAU,IAAIF,IAAI,IAAID,KAAsBE,I,SAMlCE,EAAoBC,GAClC,IAAKC,EAAcD,GAAU,CAC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XChMa4B,EAAmC,MAkD9C,WAAA/D,CAAAgE,G,UAtCe3D,KAAA8B,WAAwC,GAqBV9B,KAAA4C,UAGzC,GAOyC5C,KAAA6C,aAGzC,G,qCAlCmD,G,oEAwBnD,G,kBAUA,E,CAMJ,iBAAAe,GACE5D,KAAK6D,qBAAuB,IAAInE,EAAqB,CACnDE,KAAMI,KAAKJ,KACXC,SAAWiE,IACT9D,KAAK+B,MAAQ+B,CAAG,EAElBhE,aAAc,CAAC,mC,CAIZ,iBAAAiE,GACL/D,KAAK8B,WAAaqB,EAAsBnD,KAAKoD,UAAWpD,KAAKqD,cAC7DrD,KAAK6D,qBAAqB5D,gBAAkB0C,EAC1C3C,KAAK4C,UACL5C,KAAK6C,a,CAQF,iBAAMhB,GACX,OAAO7B,KAAK6D,qBAAqBhC,YAAY7B,KAAK8B,WAAY9B,KAAK+B,M,CAG9D,MAAAiC,GACL,OAAOhE,KAAK6D,qBAAqBxB,cAAcrC,KAAK+B,M,6BA9CTkC,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q,gCAUcF,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q","ignoreList":[]}
1
+ {"version":3,"names":["tableElementTagName","resultSectionTags","Set","productSectionTags","allTags","isResultSectionNode","element","isElementNode","has","tagName","toLowerCase","getTemplateNodeType","node","isVisualNode","groupNodesByType","nodes","aggregate","Array","from","ResultTemplateCommon","constructor","host","setError","validParents","allowEmpty","this","matchConditions","gridCellLinkTarget","validateTemplate","hasValidParent","map","p","toUpperCase","includes","parentElement","nodeName","Error","join","attributes","getNamedItem","value","template","querySelector","innerHTML","trim","content","console","warn","section","sectionNodes","other","otherNodes","childNodes","length","getTemplate","conditions","error","concat","getTemplateElement","linkContent","getLinkTemplateElement","priority","renderIfError","h","getDefaultLinkTemplateElement","linkTemplate","document","createElement","makeMatchConditions","mustMatch","mustNotMatch","field","push","ResultTemplatesHelpers","fieldMustMatch","fieldMustNotMatch","makeDefinedConditions","ifDefined","ifNotDefined","fieldNames","split","fieldsMustBeDefined","fieldsMustNotBeDefined","AtomicInsightResultChildrenTemplate","hostRef","connectedCallback","resultTemplateCommon","err","componentWillLoad","render","__decorate","MapProp","splitValues"],"sources":["src/components/common/table-element-utils.ts","src/components/common/layout/item-layout-sections.ts","src/components/common/result-templates/stencil-result-template-common.tsx","src/components/insight/result-templates/atomic-insight-result-children-template/atomic-insight-result-children-template.tsx"],"sourcesContent":["export const tableElementTagName = 'atomic-table-element';\n","import {isElementNode} from '@/src/utils/utils';\n\nconst resultSectionTags = new Set([\n 'atomic-result-section-visual',\n 'atomic-result-section-badges',\n 'atomic-result-section-actions',\n 'atomic-result-section-title',\n 'atomic-result-section-title-metadata',\n 'atomic-result-section-emphasized',\n 'atomic-result-section-excerpt',\n 'atomic-result-section-bottom-metadata',\n 'atomic-result-section-children',\n] as const);\n\nconst productSectionTags = new Set([\n 'atomic-product-section-visual',\n 'atomic-product-section-badges',\n 'atomic-product-section-actions',\n 'atomic-product-section-name',\n 'atomic-product-section-metadata',\n 'atomic-product-section-emphasized',\n 'atomic-product-section-description',\n 'atomic-product-section-bottom-metadata',\n 'atomic-product-section-children',\n] as const);\n\nconst allTags = new Set([...resultSectionTags, ...productSectionTags]);\n\ntype SetValueType<T> = T extends Set<infer U> ? U : never;\n\nexport type ItemSectionTagName = SetValueType<typeof allTags>;\n\nexport function isResultSectionNode(element: Node) {\n if (!isElementNode(element)) {\n return false;\n }\n return allTags.has(element.tagName.toLowerCase() as ItemSectionTagName);\n}\n\nexport function containsSections(content: string | NodeList | HTMLCollection) {\n if (typeof content === 'string') {\n return Array.from(allTags.values()).some((tag) => content.includes(tag));\n }\n return Array.from(content).some((child) => isResultSectionNode(child));\n}\n","import {\n ResultTemplate,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {h} from '@stencil/core';\nimport {aggregate, isElementNode, isVisualNode} from '@/src/utils/utils';\nimport {tableElementTagName} from '../table-element-utils';\nimport {ItemTarget} from '../layout/display-options';\nimport {isResultSectionNode} from '../layout/item-layout-sections';\n\nexport type TemplateContent = DocumentFragment;\n\ninterface ResultTemplateCommonProps {\n allowEmpty?: boolean;\n host: HTMLDivElement;\n validParents: string[];\n setError: (error: Error) => void;\n}\n\ntype TemplateNodeType =\n | 'section'\n | 'metadata'\n | 'table-column-definition'\n | 'other';\n\nexport function getTemplateNodeType(node: Node): TemplateNodeType {\n if (isResultSectionNode(node)) {\n return 'section';\n }\n if (!isVisualNode(node)) {\n return 'metadata';\n }\n if (\n isElementNode(node) &&\n node.tagName.toLowerCase() === tableElementTagName\n ) {\n return 'table-column-definition';\n }\n return 'other';\n}\n\nfunction groupNodesByType(nodes: NodeList) {\n return aggregate(Array.from(nodes), (node) => getTemplateNodeType(node));\n}\n\nexport class ResultTemplateCommon {\n private host: HTMLDivElement;\n public matchConditions: ResultTemplateCondition[] = [];\n private gridCellLinkTarget: ItemTarget = '_self';\n\n constructor({\n host,\n setError,\n validParents,\n allowEmpty = false,\n }: ResultTemplateCommonProps) {\n this.host = host;\n this.validateTemplate(host, setError, validParents, allowEmpty);\n }\n\n validateTemplate(\n host: HTMLDivElement,\n setError: (error: Error) => void,\n validParents: string[],\n allowEmpty = true\n ) {\n const hasValidParent = validParents\n .map((p) => p.toUpperCase())\n .includes(host.parentElement?.nodeName || '');\n const tagName = host.nodeName.toLowerCase();\n\n if (!hasValidParent) {\n setError(\n new Error(\n `The \"${tagName}\" component has to be the child of one of the following: ${validParents\n .map((p) => `\"${p.toLowerCase()}\"`)\n .join(', ')}.`\n )\n );\n return;\n }\n\n if (\n host.parentElement?.attributes.getNamedItem('display')?.value === 'grid'\n ) {\n this.gridCellLinkTarget = host.parentElement?.attributes.getNamedItem(\n 'grid-cell-link-target'\n )?.value as ItemTarget;\n }\n\n const template = host.querySelector<HTMLTemplateElement>(\n 'template:not([slot])'\n );\n if (!template) {\n setError(\n new Error(\n `The \"${tagName}\" component has to contain a \"template\" element as a child.`\n )\n );\n return;\n }\n\n if (!allowEmpty && !template.innerHTML.trim()) {\n setError(\n new Error(`The \"template\" tag inside \"${tagName}\" cannot be empty.`)\n );\n return;\n }\n\n if (template.content.querySelector('script')) {\n console.warn(\n 'Any \"script\" tags defined inside of \"template\" elements are not supported and will not be executed when the results are rendered.',\n host\n );\n }\n\n const {section: sectionNodes, other: otherNodes} = groupNodesByType(\n template.content.childNodes\n );\n if (sectionNodes?.length && otherNodes?.length) {\n console.warn(\n 'Result templates should only contain section elements or non-section elements. Future updates could unpredictably affect this result template.',\n host,\n {sectionNodes, otherNodes}\n );\n }\n }\n\n getTemplate(\n conditions: ResultTemplateCondition[],\n error: Error\n ): ResultTemplate<TemplateContent> | null {\n if (error) {\n return null;\n }\n\n return {\n conditions: conditions.concat(this.matchConditions),\n content: getTemplateElement(this.host).content!,\n linkContent: this.getLinkTemplateElement(this.host).content!,\n priority: 1,\n };\n }\n\n renderIfError(error: Error) {\n if (error) {\n return (\n <atomic-component-error\n element={this.host}\n error={error}\n ></atomic-component-error>\n );\n }\n }\n\n getDefaultLinkTemplateElement() {\n const linkTemplate = document.createElement('template');\n linkTemplate.innerHTML = `<atomic-result-link>${this.gridCellLinkTarget ? `<a slot=\"attributes\" target=\"${this.gridCellLinkTarget}\"></a>` : ''}</atomic-result-link>`;\n return linkTemplate;\n }\n\n getLinkTemplateElement(host: HTMLElement) {\n return (\n host.querySelector<HTMLTemplateElement>('template[slot=\"link\"]') ??\n this.getDefaultLinkTemplateElement()\n );\n }\n}\n\nfunction getTemplateElement(host: HTMLElement) {\n return host.querySelector<HTMLTemplateElement>('template:not([slot])')!;\n}\n\nexport function makeMatchConditions(\n mustMatch: Record<string, string[]>,\n mustNotMatch: Record<string, string[]>\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n for (const field in mustMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustMatch(field, mustMatch[field])\n );\n }\n\n for (const field in mustNotMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustNotMatch(field, mustNotMatch[field])\n );\n }\n return conditions;\n}\n\nexport function makeDefinedConditions(\n ifDefined?: string,\n ifNotDefined?: string\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n if (ifDefined) {\n const fieldNames = ifDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames));\n }\n\n if (ifNotDefined) {\n const fieldNames = ifNotDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));\n }\n return conditions;\n}\n","import {ResultTemplate, ResultTemplateCondition} from '@coveo/headless';\nimport {Component, Element, Prop, State, Method} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {\n makeDefinedConditions,\n makeMatchConditions,\n ResultTemplateCommon,\n} from '../../../common/result-templates/stencil-result-template-common';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-children-template',\n shadow: true,\n})\nexport class AtomicInsightResultChildrenTemplate {\n @Element() public host!: HTMLDivElement;\n\n @State() public error!: Error;\n\n /**\n * A function that must return true on results for the result template to apply.\n * Set programmatically before initialization, not via attribute.\n *\n * For example, the following targets a template and sets a condition to make it apply only to results whose `title` contains `singapore`:\n * `document.querySelector('#target-template').conditions = [(result) => /singapore/i.test(result.title)];`\n */\n @Prop() public conditions: ResultTemplateCondition[] = [];\n\n /**\n * The field that, when defined on a result item, would allow the template to be applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are defined: `if-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifDefined?: string;\n\n /**\n * The field that, when defined on a result item, would prevent the template from being applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are NOT defined: `if-not-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * The field and values that define which result items the condition must be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustMatch: Record<\n string,\n string[]\n > = {};\n\n /**\n * The field and values that define which result items the condition must not be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustNotMatch: Record<\n string,\n string[]\n > = {};\n\n public resultTemplateCommon!: ResultTemplateCommon;\n\n constructor() {}\n\n connectedCallback() {\n this.resultTemplateCommon = new ResultTemplateCommon({\n host: this.host,\n setError: (err) => {\n this.error = err;\n },\n validParents: ['atomic-insight-result-children'],\n });\n }\n\n public componentWillLoad() {\n this.conditions = makeDefinedConditions(this.ifDefined, this.ifNotDefined);\n this.resultTemplateCommon.matchConditions = makeMatchConditions(\n this.mustMatch,\n this.mustNotMatch\n );\n }\n\n /**\n * Gets the appropriate result template based on conditions applied.\n */\n @Method()\n public async getTemplate(): Promise<ResultTemplate<DocumentFragment> | null> {\n return this.resultTemplateCommon.getTemplate(this.conditions, this.error);\n }\n\n public render() {\n return this.resultTemplateCommon.renderIfError(this.error);\n }\n}\n"],"mappings":"iNAAO,MAAMA,EAAsB,uBCEnC,MAAMC,EAAoB,IAAIC,IAAI,CAChC,+BACA,+BACA,gCACA,8BACA,uCACA,mCACA,gCACA,wCACA,mCAGF,MAAMC,EAAqB,IAAID,IAAI,CACjC,gCACA,gCACA,iCACA,8BACA,kCACA,oCACA,qCACA,yCACA,oCAGF,MAAME,EAAU,IAAIF,IAAI,IAAID,KAAsBE,I,SAMlCE,EAAoBC,GAClC,IAAKC,EAAcD,GAAU,CAC3B,OAAO,K,CAET,OAAOF,EAAQI,IAAIF,EAAQG,QAAQC,cACrC,C,SCXgBC,EAAoBC,GAClC,GAAIP,EAAoBO,GAAO,CAC7B,MAAO,S,CAET,IAAKC,EAAaD,GAAO,CACvB,MAAO,U,CAET,GACEL,EAAcK,IACdA,EAAKH,QAAQC,gBAAkBV,EAC/B,CACA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MI,KAAKJ,KACXC,SAAWiE,IACT9D,KAAK+B,MAAQ+B,CAAG,EAElBhE,aAAc,CAAC,mC,CAIZ,iBAAAiE,GACL/D,KAAK8B,WAAaqB,EAAsBnD,KAAKoD,UAAWpD,KAAKqD,cAC7DrD,KAAK6D,qBAAqB5D,gBAAkB0C,EAC1C3C,KAAK4C,UACL5C,KAAK6C,a,CAQF,iBAAMhB,GACX,OAAO7B,KAAK6D,qBAAqBhC,YAAY7B,KAAK8B,WAAY9B,KAAK+B,M,CAG9D,MAAAiC,GACL,OAAOhE,KAAK6D,qBAAqBxB,cAAcrC,KAAK+B,M,6BA9CTkC,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q,gCAUcF,EAAA,CAApCC,EAAQ,CAACC,YAAa,Q","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import"@coveo/bueno";import{g as t}from"./p-aad3b4ec.js";import{c as e}from"./p-4573c419.js";var n={exports:{}};
2
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */(function(t,n){(function(e,n){t.exports=n()})(e,(function(){const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:r,seal:a,create:l}=Object;let{apply:s,construct:c}=typeof Reflect!=="undefined"&&Reflect;if(!r){r=function t(e){return e}}if(!a){a=function t(e){return e}}if(!s){s=function t(e,n,o){return e.apply(n,o)}}if(!c){c=function t(e,n){return new e(...n)}}const f=A(Array.prototype.forEach);const u=A(Array.prototype.lastIndexOf);const m=A(Array.prototype.pop);const p=A(Array.prototype.push);const d=A(Array.prototype.splice);const h=A(String.prototype.toLowerCase);const g=A(String.prototype.toString);const y=A(String.prototype.match);const b=A(String.prototype.replace);const w=A(String.prototype.indexOf);const x=A(String.prototype.trim);const T=A(Object.prototype.hasOwnProperty);const v=A(RegExp.prototype.test);const k=E(TypeError);function A(t){return function(e){if(e instanceof RegExp){e.lastIndex=0}for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++){o[i-1]=arguments[i]}return s(t,e,o)}}function E(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++){n[o]=arguments[o]}return c(t,n)}}function S(t,o){let i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:h;if(e){e(t,null)}let r=o.length;while(r--){let e=o[r];if(typeof e==="string"){const t=i(e);if(t!==e){if(!n(o)){o[r]=t}e=t}}t[e]=true}return t}function R(t){for(let e=0;e<t.length;e++){const n=T(t,e);if(!n){t[e]=null}}return t}function _(e){const n=l(null);for(const[o,i]of t(e)){const t=T(e,o);if(t){if(Array.isArray(i)){n[o]=R(i)}else if(i&&typeof i==="object"&&i.constructor===Object){n[o]=_(i)}else{n[o]=i}}}return n}function L(t,e){while(t!==null){const n=i(t,e);if(n){if(n.get){return A(n.get)}if(typeof n.value==="function"){return A(n.value)}}t=o(t)}function n(){return null}return n}const O=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]);const M=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]);const D=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]);const z=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]);const I=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]);const P=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]);const F=r(["#text"]);const N=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]);const C=r(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]);const j=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]);const U=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);const B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm);const W=a(/<%[\w\W]*|[\w\W]*%>/gm);const H=a(/\$\{[\w\W]*/gm);const $=a(/^data-[\-\w.\u00B7-\uFFFF]+$/);const q=a(/^aria-[\-\w]+$/);const Y=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);const X=a(/^(?:\w+script|data):/i);const G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);const Z=a(/^html$/i);const K=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var V=Object.freeze({__proto__:null,ARIA_ATTR:q,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:K,DATA_ATTR:$,DOCTYPE_NAME:Z,ERB_EXPR:W,IS_ALLOWED_URI:Y,IS_SCRIPT_OR_DATA:X,MUSTACHE_EXPR:B,TMPLIT_EXPR:H});const J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12};const Q=function t(){return typeof window==="undefined"?null:window};const tt=function t(e,n){if(typeof e!=="object"||typeof e.createPolicy!=="function"){return null}let o=null;const i="data-tt-policy-suffix";if(n&&n.hasAttribute(i)){o=n.getAttribute(i)}const r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML(t){return t},createScriptURL(t){return t}})}catch(t){console.warn("TrustedTypes policy "+r+" could not be created.");return null}};const et=function t(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function nt(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Q();const n=t=>nt(t);n.version="3.2.6";n.removed=[];if(!e||!e.document||e.document.nodeType!==J.document||!e.Element){n.isSupported=false;return n}let{document:o}=e;const i=o;const a=i.currentScript;const{DocumentFragment:s,HTMLTemplateElement:c,Node:A,Element:E,NodeFilter:R,NamedNodeMap:B=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:W,DOMParser:H,trustedTypes:$}=e;const q=E.prototype;const X=L(q,"cloneNode");const G=L(q,"remove");const K=L(q,"nextSibling");const ot=L(q,"childNodes");const it=L(q,"parentNode");if(typeof c==="function"){const t=o.createElement("template");if(t.content&&t.content.ownerDocument){o=t.content.ownerDocument}}let rt;let at="";const{implementation:lt,createNodeIterator:st,createDocumentFragment:ct,getElementsByTagName:ft}=o;const{importNode:ut}=i;let mt=et();n.isSupported=typeof t==="function"&&typeof it==="function"&&lt&&lt.createHTMLDocument!==undefined;const{MUSTACHE_EXPR:pt,ERB_EXPR:dt,TMPLIT_EXPR:ht,DATA_ATTR:gt,ARIA_ATTR:yt,IS_SCRIPT_OR_DATA:bt,ATTR_WHITESPACE:wt,CUSTOM_ELEMENT:xt}=V;let{IS_ALLOWED_URI:Tt}=V;let vt=null;const kt=S({},[...O,...M,...D,...I,...F]);let At=null;const Et=S({},[...N,...C,...j,...U]);let St=Object.seal(l(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}}));let Rt=null;let _t=null;let Lt=true;let Ot=true;let Mt=false;let Dt=true;let zt=false;let It=true;let Pt=false;let Ft=false;let Nt=false;let Ct=false;let jt=false;let Ut=false;let Bt=true;let Wt=false;const Ht="user-content-";let $t=true;let qt=false;let Yt={};let Xt=null;const Gt=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Zt=null;const Kt=S({},["audio","video","img","source","image","track"]);let Vt=null;const Jt=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]);const Qt="http://www.w3.org/1998/Math/MathML";const te="http://www.w3.org/2000/svg";const ee="http://www.w3.org/1999/xhtml";let ne=ee;let oe=false;let ie=null;const re=S({},[Qt,te,ee],g);let ae=S({},["mi","mo","mn","ms","mtext"]);let le=S({},["annotation-xml"]);const se=S({},["title","style","font","a","script"]);let ce=null;const fe=["application/xhtml+xml","text/html"];const ue="text/html";let me=null;let pe=null;const de=o.createElement("form");const he=function t(e){return e instanceof RegExp||e instanceof Function};const ge=function t(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(pe&&pe===e){return}if(!e||typeof e!=="object"){e={}}e=_(e);ce=fe.indexOf(e.PARSER_MEDIA_TYPE)===-1?ue:e.PARSER_MEDIA_TYPE;me=ce==="application/xhtml+xml"?g:h;vt=T(e,"ALLOWED_TAGS")?S({},e.ALLOWED_TAGS,me):kt;At=T(e,"ALLOWED_ATTR")?S({},e.ALLOWED_ATTR,me):Et;ie=T(e,"ALLOWED_NAMESPACES")?S({},e.ALLOWED_NAMESPACES,g):re;Vt=T(e,"ADD_URI_SAFE_ATTR")?S(_(Jt),e.ADD_URI_SAFE_ATTR,me):Jt;Zt=T(e,"ADD_DATA_URI_TAGS")?S(_(Kt),e.ADD_DATA_URI_TAGS,me):Kt;Xt=T(e,"FORBID_CONTENTS")?S({},e.FORBID_CONTENTS,me):Gt;Rt=T(e,"FORBID_TAGS")?S({},e.FORBID_TAGS,me):_({});_t=T(e,"FORBID_ATTR")?S({},e.FORBID_ATTR,me):_({});Yt=T(e,"USE_PROFILES")?e.USE_PROFILES:false;Lt=e.ALLOW_ARIA_ATTR!==false;Ot=e.ALLOW_DATA_ATTR!==false;Mt=e.ALLOW_UNKNOWN_PROTOCOLS||false;Dt=e.ALLOW_SELF_CLOSE_IN_ATTR!==false;zt=e.SAFE_FOR_TEMPLATES||false;It=e.SAFE_FOR_XML!==false;Pt=e.WHOLE_DOCUMENT||false;Ct=e.RETURN_DOM||false;jt=e.RETURN_DOM_FRAGMENT||false;Ut=e.RETURN_TRUSTED_TYPE||false;Nt=e.FORCE_BODY||false;Bt=e.SANITIZE_DOM!==false;Wt=e.SANITIZE_NAMED_PROPS||false;$t=e.KEEP_CONTENT!==false;qt=e.IN_PLACE||false;Tt=e.ALLOWED_URI_REGEXP||Y;ne=e.NAMESPACE||ee;ae=e.MATHML_TEXT_INTEGRATION_POINTS||ae;le=e.HTML_INTEGRATION_POINTS||le;St=e.CUSTOM_ELEMENT_HANDLING||{};if(e.CUSTOM_ELEMENT_HANDLING&&he(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)){St.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck}if(e.CUSTOM_ELEMENT_HANDLING&&he(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)){St.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck}if(e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==="boolean"){St.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements}if(zt){Ot=false}if(jt){Ct=true}if(Yt){vt=S({},F);At=[];if(Yt.html===true){S(vt,O);S(At,N)}if(Yt.svg===true){S(vt,M);S(At,C);S(At,U)}if(Yt.svgFilters===true){S(vt,D);S(At,C);S(At,U)}if(Yt.mathMl===true){S(vt,I);S(At,j);S(At,U)}}if(e.ADD_TAGS){if(vt===kt){vt=_(vt)}S(vt,e.ADD_TAGS,me)}if(e.ADD_ATTR){if(At===Et){At=_(At)}S(At,e.ADD_ATTR,me)}if(e.ADD_URI_SAFE_ATTR){S(Vt,e.ADD_URI_SAFE_ATTR,me)}if(e.FORBID_CONTENTS){if(Xt===Gt){Xt=_(Xt)}S(Xt,e.FORBID_CONTENTS,me)}if($t){vt["#text"]=true}if(Pt){S(vt,["html","head","body"])}if(vt.table){S(vt,["tbody"]);delete Rt.tbody}if(e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=="function"){throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.')}if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=="function"){throw k('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.')}rt=e.TRUSTED_TYPES_POLICY;at=rt.createHTML("")}else{if(rt===undefined){rt=tt($,a)}if(rt!==null&&typeof at==="string"){at=rt.createHTML("")}}if(r){r(e)}pe=e};const ye=S({},[...M,...D,...z]);const be=S({},[...I,...P]);const we=function t(e){let n=it(e);if(!n||!n.tagName){n={namespaceURI:ne,tagName:"template"}}const o=h(e.tagName);const i=h(n.tagName);if(!ie[e.namespaceURI]){return false}if(e.namespaceURI===te){if(n.namespaceURI===ee){return o==="svg"}if(n.namespaceURI===Qt){return o==="svg"&&(i==="annotation-xml"||ae[i])}return Boolean(ye[o])}if(e.namespaceURI===Qt){if(n.namespaceURI===ee){return o==="math"}if(n.namespaceURI===te){return o==="math"&&le[i]}return Boolean(be[o])}if(e.namespaceURI===ee){if(n.namespaceURI===te&&!le[i]){return false}if(n.namespaceURI===Qt&&!ae[i]){return false}return!be[o]&&(se[o]||!ye[o])}if(ce==="application/xhtml+xml"&&ie[e.namespaceURI]){return true}return false};const xe=function t(e){p(n.removed,{element:e});try{it(e).removeChild(e)}catch(t){G(e)}};const Te=function t(e,o){try{p(n.removed,{attribute:o.getAttributeNode(e),from:o})}catch(t){p(n.removed,{attribute:null,from:o})}o.removeAttribute(e);if(e==="is"){if(Ct||jt){try{xe(o)}catch(t){}}else{try{o.setAttribute(e,"")}catch(t){}}}};const ve=function t(e){let n=null;let i=null;if(Nt){e="<remove></remove>"+e}else{const t=y(e,/^[\r\n\t ]+/);i=t&&t[0]}if(ce==="application/xhtml+xml"&&ne===ee){e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>"}const r=rt?rt.createHTML(e):e;if(ne===ee){try{n=(new H).parseFromString(r,ce)}catch(t){}}if(!n||!n.documentElement){n=lt.createDocument(ne,"template",null);try{n.documentElement.innerHTML=oe?at:r}catch(t){}}const a=n.body||n.documentElement;if(e&&i){a.insertBefore(o.createTextNode(i),a.childNodes[0]||null)}if(ne===ee){return ft.call(n,Pt?"html":"body")[0]}return Pt?n.documentElement:a};const ke=function t(e){return st.call(e.ownerDocument||e,e,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT|R.SHOW_PROCESSING_INSTRUCTION|R.SHOW_CDATA_SECTION,null)};const Ae=function t(e){return e instanceof W&&(typeof e.nodeName!=="string"||typeof e.textContent!=="string"||typeof e.removeChild!=="function"||!(e.attributes instanceof B)||typeof e.removeAttribute!=="function"||typeof e.setAttribute!=="function"||typeof e.namespaceURI!=="string"||typeof e.insertBefore!=="function"||typeof e.hasChildNodes!=="function")};const Ee=function t(e){return typeof A==="function"&&e instanceof A};function Se(t,e,o){f(t,(t=>{t.call(n,e,o,pe)}))}const Re=function t(e){let o=null;Se(mt.beforeSanitizeElements,e,null);if(Ae(e)){xe(e);return true}const i=me(e.nodeName);Se(mt.uponSanitizeElement,e,{tagName:i,allowedTags:vt});if(It&&e.hasChildNodes()&&!Ee(e.firstElementChild)&&v(/<[/\w!]/g,e.innerHTML)&&v(/<[/\w!]/g,e.textContent)){xe(e);return true}if(e.nodeType===J.progressingInstruction){xe(e);return true}if(It&&e.nodeType===J.comment&&v(/<[/\w]/g,e.data)){xe(e);return true}if(!vt[i]||Rt[i]){if(!Rt[i]&&Le(i)){if(St.tagNameCheck instanceof RegExp&&v(St.tagNameCheck,i)){return false}if(St.tagNameCheck instanceof Function&&St.tagNameCheck(i)){return false}}if($t&&!Xt[i]){const t=it(e)||e.parentNode;const n=ot(e)||e.childNodes;if(n&&t){const o=n.length;for(let i=o-1;i>=0;--i){const o=X(n[i],true);o.__removalCount=(e.__removalCount||0)+1;t.insertBefore(o,K(e))}}}xe(e);return true}if(e instanceof E&&!we(e)){xe(e);return true}if((i==="noscript"||i==="noembed"||i==="noframes")&&v(/<\/no(script|embed|frames)/i,e.innerHTML)){xe(e);return true}if(zt&&e.nodeType===J.text){o=e.textContent;f([pt,dt,ht],(t=>{o=b(o,t," ")}));if(e.textContent!==o){p(n.removed,{element:e.cloneNode()});e.textContent=o}}Se(mt.afterSanitizeElements,e,null);return false};const _e=function t(e,n,i){if(Bt&&(n==="id"||n==="name")&&(i in o||i in de)){return false}if(Ot&&!_t[n]&&v(gt,n));else if(Lt&&v(yt,n));else if(!At[n]||_t[n]){if(Le(e)&&(St.tagNameCheck instanceof RegExp&&v(St.tagNameCheck,e)||St.tagNameCheck instanceof Function&&St.tagNameCheck(e))&&(St.attributeNameCheck instanceof RegExp&&v(St.attributeNameCheck,n)||St.attributeNameCheck instanceof Function&&St.attributeNameCheck(n))||n==="is"&&St.allowCustomizedBuiltInElements&&(St.tagNameCheck instanceof RegExp&&v(St.tagNameCheck,i)||St.tagNameCheck instanceof Function&&St.tagNameCheck(i)));else{return false}}else if(Vt[n]);else if(v(Tt,b(i,wt,"")));else if((n==="src"||n==="xlink:href"||n==="href")&&e!=="script"&&w(i,"data:")===0&&Zt[e]);else if(Mt&&!v(bt,b(i,wt,"")));else if(i){return false}else;return true};const Le=function t(e){return e!=="annotation-xml"&&y(e,xt)};const Oe=function t(e){Se(mt.beforeSanitizeAttributes,e,null);const{attributes:o}=e;if(!o||Ae(e)){return}const i={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:At,forceKeepAttr:undefined};let r=o.length;while(r--){const t=o[r];const{name:a,namespaceURI:l,value:s}=t;const c=me(a);const u=s;let p=a==="value"?u:x(u);i.attrName=c;i.attrValue=p;i.keepAttr=true;i.forceKeepAttr=undefined;Se(mt.uponSanitizeAttribute,e,i);p=i.attrValue;if(Wt&&(c==="id"||c==="name")){Te(a,e);p=Ht+p}if(It&&v(/((--!?|])>)|<\/(style|title)/i,p)){Te(a,e);continue}if(i.forceKeepAttr){continue}if(!i.keepAttr){Te(a,e);continue}if(!Dt&&v(/\/>/i,p)){Te(a,e);continue}if(zt){f([pt,dt,ht],(t=>{p=b(p,t," ")}))}const d=me(e.nodeName);if(!_e(d,c,p)){Te(a,e);continue}if(rt&&typeof $==="object"&&typeof $.getAttributeType==="function"){if(l);else{switch($.getAttributeType(d,c)){case"TrustedHTML":{p=rt.createHTML(p);break}case"TrustedScriptURL":{p=rt.createScriptURL(p);break}}}}if(p!==u){try{if(l){e.setAttributeNS(l,a,p)}else{e.setAttribute(a,p)}if(Ae(e)){xe(e)}else{m(n.removed)}}catch(t){Te(a,e)}}}Se(mt.afterSanitizeAttributes,e,null)};const Me=function t(e){let n=null;const o=ke(e);Se(mt.beforeSanitizeShadowDOM,e,null);while(n=o.nextNode()){Se(mt.uponSanitizeShadowNode,n,null);Re(n);Oe(n);if(n.content instanceof s){t(n.content)}}Se(mt.afterSanitizeShadowDOM,e,null)};n.sanitize=function(t){let e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let o=null;let r=null;let a=null;let l=null;oe=!t;if(oe){t="\x3c!--\x3e"}if(typeof t!=="string"&&!Ee(t)){if(typeof t.toString==="function"){t=t.toString();if(typeof t!=="string"){throw k("dirty is not a string, aborting")}}else{throw k("toString is not a function")}}if(!n.isSupported){return t}if(!Ft){ge(e)}n.removed=[];if(typeof t==="string"){qt=false}if(qt){if(t.nodeName){const e=me(t.nodeName);if(!vt[e]||Rt[e]){throw k("root node is forbidden and cannot be sanitized in-place")}}}else if(t instanceof A){o=ve("\x3c!----\x3e");r=o.ownerDocument.importNode(t,true);if(r.nodeType===J.element&&r.nodeName==="BODY"){o=r}else if(r.nodeName==="HTML"){o=r}else{o.appendChild(r)}}else{if(!Ct&&!zt&&!Pt&&t.indexOf("<")===-1){return rt&&Ut?rt.createHTML(t):t}o=ve(t);if(!o){return Ct?null:Ut?at:""}}if(o&&Nt){xe(o.firstChild)}const c=ke(qt?t:o);while(a=c.nextNode()){Re(a);Oe(a);if(a.content instanceof s){Me(a.content)}}if(qt){return t}if(Ct){if(jt){l=ct.call(o.ownerDocument);while(o.firstChild){l.appendChild(o.firstChild)}}else{l=o}if(At.shadowroot||At.shadowrootmode){l=ut.call(i,l,true)}return l}let u=Pt?o.outerHTML:o.innerHTML;if(Pt&&vt["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&v(Z,o.ownerDocument.doctype.name)){u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u}if(zt){f([pt,dt,ht],(t=>{u=b(u,t," ")}))}return rt&&Ut?rt.createHTML(u):u};n.setConfig=function(){let t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};ge(t);Ft=true};n.clearConfig=function(){pe=null;Ft=false};n.isValidAttribute=function(t,e,n){if(!pe){ge({})}const o=me(t);const i=me(e);return _e(o,i,n)};n.addHook=function(t,e){if(typeof e!=="function"){return}p(mt[t],e)};n.removeHook=function(t,e){if(e!==undefined){const n=u(mt[t],e);return n===-1?undefined:d(mt[t],n,1)[0]}return m(mt[t])};n.removeHooks=function(t){mt[t]=[]};n.removeAllHooks=function(){mt=et()};return n}var ot=nt();return ot}))})(n);function o(t){return t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function i(t){return t.replace(/-./g,(t=>t[1].toUpperCase()))}function r(t,e=5){const n=Math.random().toString(36).substring(2,2+e);if(!t){return n}return t+n}function a(t){return t.nodeType===Node.ELEMENT_NODE}function l(t){return t.nodeType===Node.TEXT_NODE}function s(t){if(a(t)){return!(t instanceof HTMLStyleElement)}if(l(t)){return!!t.textContent?.trim()}return false}function c(t,e){return t.reduce(((t,n,o)=>{const i=e(n,o);if(!(i in t)){t[i]=[]}t[i].push(n);return t}),{})}async function f(){return new Promise((t=>setTimeout(t,10)))}function u(e){return(n,o)=>{const{componentWillLoad:i}=n;if(!i){console.error('The "componentWillLoad" lifecycle method has to be defined for the MapProp decorator to work.');return}n.componentWillLoad=function(){const n=e?.attributePrefix||o;const r=this[o];const a=t(this).attributes;p(n,r,Array.from(a),e?.splitValues??false);i.call(this)}}}function m(t){const e=/(?:\\.|[^,])+/g;const[...n]=t.matchAll(e)??[];const o=/\\(.)/g;return n.map((([t])=>t.replace(o,"$1")))}function p(t,e,n,o){const i=h(t,n);Object.assign(e,o?d(i):i)}function d(t){return Object.entries(t).reduce(((t,[e,n])=>({...t,[e]:m(n).map((t=>t.trim()))})),{})}function h(t,e){const n={};const r=`${o(t)}-`;for(let t=0;t<e.length;t++){const o=e[t];if(o.name.indexOf(r)!==0){continue}const a=i(o.name.replace(r,""));n[a]=`${o.value}`}return n}export{u as M,c as a,s as b,f as d,a as i,r};
3
+ //# sourceMappingURL=p-5226a938.js.map