@searchcraft/javascript-sdk 0.2.4 → 0.2.6

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 (77) hide show
  1. package/dist/cjs/index.cjs.js +2 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js +63 -43
  4. package/dist/cjs/searchcraft-auto-search-form_17.cjs.entry.js.map +1 -1
  5. package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +1 -1
  6. package/dist/cjs/searchcraft-javascript-sdk.cjs.js +1 -1
  7. package/dist/cjs/{store-b0a26894.js → store-c44c58ab.js} +8 -7
  8. package/dist/cjs/{store-b0a26894.js.map → store-c44c58ab.js.map} +1 -1
  9. package/dist/cjs/{utils-15f85bca.js → utils-2dc6115c.js} +13 -1
  10. package/dist/cjs/utils-2dc6115c.js.map +1 -0
  11. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +24 -3
  12. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +1 -1
  13. package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -2
  14. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +20 -1
  15. package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +1 -1
  16. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js +54 -39
  17. package/dist/collection/components/searchcraft-filters-list/searchcraft-filters-list.js.map +1 -1
  18. package/dist/collection/provider/store.js +7 -6
  19. package/dist/collection/provider/store.js.map +1 -1
  20. package/dist/collection/utils/utils.js +11 -0
  21. package/dist/collection/utils/utils.js.map +1 -1
  22. package/dist/components/index.js +2 -2
  23. package/dist/components/{p-8c70054a.js → p-023371c8.js} +10 -6
  24. package/dist/components/p-023371c8.js.map +1 -0
  25. package/dist/components/{p-33bb5c45.js → p-157e5b1a.js} +8 -7
  26. package/dist/components/{p-33bb5c45.js.map → p-157e5b1a.js.map} +1 -1
  27. package/dist/components/{p-ff6c3650.js → p-2bda632c.js} +13 -2
  28. package/dist/components/p-2bda632c.js.map +1 -0
  29. package/dist/components/{p-1204b43a.js → p-b5f97e04.js} +2 -2
  30. package/dist/components/{p-1204b43a.js.map → p-b5f97e04.js.map} +1 -1
  31. package/dist/components/searchcraft-auto-search-form.js +3 -3
  32. package/dist/components/searchcraft-base-search-form.js +2 -2
  33. package/dist/components/searchcraft-base-search-result.js +1 -1
  34. package/dist/components/searchcraft-base-search-results.js +6 -4
  35. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  36. package/dist/components/searchcraft-filters-list.js +55 -40
  37. package/dist/components/searchcraft-filters-list.js.map +1 -1
  38. package/dist/components/searchcraft-input.js +1 -1
  39. package/dist/components/searchcraft-results-info.js +1 -1
  40. package/dist/components/searchcraft-slider.js +1 -1
  41. package/dist/components/searchcraft-toggle-button.js +1 -1
  42. package/dist/esm/index.js +2 -2
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/esm/searchcraft-auto-search-form_17.entry.js +63 -43
  45. package/dist/esm/searchcraft-auto-search-form_17.entry.js.map +1 -1
  46. package/dist/esm/searchcraft-base-search-form.entry.js +1 -1
  47. package/dist/esm/searchcraft-javascript-sdk.js +1 -1
  48. package/dist/esm/{store-97358312.js → store-9e0b0710.js} +8 -7
  49. package/dist/esm/{store-97358312.js.map → store-9e0b0710.js.map} +1 -1
  50. package/dist/esm/{utils-dbb6302b.js → utils-a3373179.js} +13 -2
  51. package/dist/esm/utils-a3373179.js.map +1 -0
  52. package/dist/searchcraft-javascript-sdk/index.esm.js +1 -1
  53. package/dist/searchcraft-javascript-sdk/p-2bda632c.js +2 -0
  54. package/dist/searchcraft-javascript-sdk/p-2bda632c.js.map +1 -0
  55. package/dist/searchcraft-javascript-sdk/{p-acca6173.entry.js → p-63b3b565.entry.js} +2 -2
  56. package/dist/searchcraft-javascript-sdk/{p-cd489e98.js → p-901fee50.js} +2 -2
  57. package/dist/searchcraft-javascript-sdk/p-901fee50.js.map +1 -0
  58. package/dist/searchcraft-javascript-sdk/p-c2c4f6b7.entry.js +2 -0
  59. package/dist/searchcraft-javascript-sdk/p-c2c4f6b7.entry.js.map +1 -0
  60. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +1 -1
  61. package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
  62. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +1 -0
  63. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +1 -0
  64. package/dist/types/components/searchcraft-filters-list/searchcraft-filters-list.d.ts +1 -5
  65. package/dist/types/components.d.ts +4 -0
  66. package/dist/types/utils/utils.d.ts +11 -0
  67. package/package.json +1 -1
  68. package/dist/cjs/utils-15f85bca.js.map +0 -1
  69. package/dist/components/p-8c70054a.js.map +0 -1
  70. package/dist/components/p-ff6c3650.js.map +0 -1
  71. package/dist/esm/utils-dbb6302b.js.map +0 -1
  72. package/dist/searchcraft-javascript-sdk/p-1a0e85ee.entry.js +0 -2
  73. package/dist/searchcraft-javascript-sdk/p-1a0e85ee.entry.js.map +0 -1
  74. package/dist/searchcraft-javascript-sdk/p-cd489e98.js.map +0 -1
  75. package/dist/searchcraft-javascript-sdk/p-ff6c3650.js +0 -2
  76. package/dist/searchcraft-javascript-sdk/p-ff6c3650.js.map +0 -1
  77. /package/dist/searchcraft-javascript-sdk/{p-acca6173.entry.js.map → p-63b3b565.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["searchcraftAutoSearchFormModuleCss","SearchcraftAutoSearchFormStyle0","SearchcraftAutoSearchForm","this","debounceTimeout","debounceDelay","searchStore","useSearchcraftStore","getState","handleInputChange","event","query","detail","setQuery","querySubmit","emit","handleInputKeyUp","target","clearTimeout","setTimeout","trim","runSearch","handleClearInput","clearInput","error","inputClearedOrNoResults","async","search","handleFormSubmit","preventDefault","apiKey","endpointURL","index","componentDidLoad","searchcraft","SearchcraftCore","config","initialize","unsubscribe","subscribe","state","isRequesting","searchResults","Object","assign","disconnectedCallback","render","formClass","rightToLeftOrientation","parsedCustomStyles","parseCustomStyles","customStylesForInput","length","_c","_b","_a","data","hits","h","key","class","onSubmit","label","labelForInput","customStyles","inputCaptionValue","inputIconHeight","inputIconWidth","onClearInput","onInputKeyUp","onSearchInputChange","placeholderValue","errorMessage","searchcraftBaseSearchResultModuleCss","SearchcraftBaseSearchResultStyle0","SearchcraftBaseSearchResult","buttonCallback","keyDownCallback","resultCallback","handleButtonClick","handleContainerClick","isInteractive","parseStyles","JSON","parse","console","isLightTheme","themeMode","styles","imageContainer","imageSource","alt","imageDescription","src","style","image","contentContainer","heading","headingText","subheading","subheadingText","primaryContent","secondaryContent","tertiaryContent","buttonText","onClick","button","type","onKeyDown","container","tabindex","placeImageRight","Fragment","searchcraftBaseSearchResultsModuleCss","SearchcraftBaseSearchResultsStyle0","SearchcraftBaseSearchResults","documentAttributesForDisplay","warn","hasSearched","name","parsedSearchKeys","parseSearchKeys","serializedStyles","customStylesForResults","serializeStyles","resultsComponents","_d","map","document","doc","result","dynamicProperties","extractDynamicProperties","formatTime","value","Number","isNaN","Date","getFormattedTimeFromNow","log","document_id","placeResultImageRight","finalComponents","placeAdAtStart","push","adInterval","forEach","component","placeAdAtEnd","_g","_f","_e","SearchcraftClearIconSet","width","height","viewBox","fill","xmlns","id","d","stroke","searchcraftClearInputButtonModuleCss","SearchcraftClearInputButtonStyle0","SearchcraftClearInputButton","handleClearClick","theme","classNames","searchcraftErrorMessageModuleCss","SearchcraftErrorMessageStyle0","SearchcraftErrorMessage","errorMessageStyle","searchcraftFiltersListModuleCss","SearchcraftFiltersListStyle0","SearchcraftFiltersList","handleFilterChange","checked","selectedFilters","add","delete","deduplicatedFilters","deduplicatePaths","Array","from","filtersUpdated","setSelectedFilters","Set","connectedCallback","facets","populateFiltersFromFacets","size","clear","resultsCount","newFilters","flattenFacets","section","filtersMap","Map","filter","split","pop","existingFilter","get","set","dynamicFilters","values","filters","pathMap","path","existingPath","formatLabel","replace","word","charAt","toUpperCase","slice","join","filtersToRender","includes","indexOf","isChecked","has","children","child","startsWith","onChange","isChildChecked","marginLeft","searchcraftInputModuleCss","SearchcraftInputStyle0","SearchcraftInput","input","searchInputChange","inputKeyUp","containerClassName","inputClassName","validatedCustomStyles","placeholderStyle","fontSize","placeholderFontSize","formClassName","autoComplete","bind","onKeyUp","placeholder","inputCaptionClassName","searchcraftInputCaptionModuleCss","SearchcraftInputCaptionStyle0","SearchcraftInputCaption","searchcraftInputIconModuleCss","SearchcraftInputIconStyle0","SearchcraftInputIcon","searchcraftInputLabelModuleCss","SearchcraftInputLabelStyle0","SearchcraftInputLabel","labelStyle","inputLabelClassName","htmlFor","searchcraftResultsInfoModuleCss","SearchcraftResultsInfoStyle0","SearchcraftResultsInfo","count","responseTime","time_taken","toFixed","SearchcraftSearchIconSet","searchcraftSliderModuleCss","SearchcraftSliderStyle0","SearchcraftSlider","updateYears","setYearsRange","startYear","endYear","handleStartYearChange","parseInt","Math","min","handleEndYearChange","max","getFullYear","maxYear","minYear","rangeMin","rangeMax","startPercent","endPercent","left","onInput","step","searchcraftSpinnerDarkModuleCss","SearchcraftSpinnerDarkStyle0","SearchcraftSpinnerDark","searchcraftSpinnerLightModuleCss","SearchcraftSpinnerLightStyle0","SearchcraftSpinnerLight","searchcraftToggleButtonModuleCss","SearchcraftToggleButtonStyle0","SearchcraftToggleButton","handleToggle","isActive","mode","setSearchParams","sort"],"sources":["src/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.scss?tag=searchcraft-auto-search-form&encapsulation=shadow","src/components/searchcraft-auto-search-form/searchcraft-auto-search-form.tsx","src/components/searchcraft-base-search-result/searchcraft-base-search-result.module.scss?tag=searchcraft-base-search-result&encapsulation=shadow","src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx","src/components/searchcraft-base-search-results/searchcraft-base-search-results.module.scss?tag=searchcraft-base-search-results&encapsulation=shadow","src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx","src/assets/searchcraft-clear-icon-set.tsx","src/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.scss?tag=searchcraft-clear-input-button&encapsulation=shadow","src/components/searchcraft-clear-input-button/searchcraft-clear-input-button.tsx","src/components/searchcraft-error-message/searchcraft-error-message.module.scss?tag=searchcraft-error-message&encapsulation=shadow","src/components/searchcraft-error-message/searchcraft-error-message.tsx","src/components/searchcraft-filters-list/searchcraft-filters-list.module.scss?tag=searchcraft-filters-list&encapsulation=shadow","src/components/searchcraft-filters-list/searchcraft-filters-list.tsx","src/components/searchcraft-input/searchcraft-input.module.scss?tag=searchcraft-input&encapsulation=shadow","src/components/searchcraft-input/searchcraft-input.tsx","src/components/searchcraft-input-caption/searchcraft-input-caption.module.scss?tag=searchcraft-input-caption&encapsulation=shadow","src/components/searchcraft-input-caption/searchcraft-input-caption.tsx","src/components/searchcraft-input-icon/searchcraft-input-icon.module.scss?tag=searchcraft-input-icon&encapsulation=shadow","src/components/searchcraft-input-icon/searchcraft-input-icon.tsx","src/components/searchcraft-input-label/searchcraft-input-label.module.scss?tag=searchcraft-input-label&encapsulation=shadow","src/components/searchcraft-input-label/searchcraft-input-label.tsx","src/components/searchcraft-results-info/searchcraft-results-info.module.scss?tag=searchcraft-results-info&encapsulation=shadow","src/components/searchcraft-results-info/searchcraft-results-info.tsx","src/assets/searchcraft-search-icon-set.tsx","src/components/searchcraft-slider/searchcraft-slider.module.scss?tag=searchcraft-slider&encapsulation=shadow","src/components/searchcraft-slider/searchcraft-slider.tsx","src/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.scss?tag=searchcraft-spinner-dark&encapsulation=shadow","src/components/searchcraft-spinner-dark/searchcraft-spinner-dark.tsx","src/components/searchcraft-spinner-light/searchcraft-spinner-light.module.scss?tag=searchcraft-spinner-light&encapsulation=shadow","src/components/searchcraft-spinner-light/searchcraft-spinner-light.tsx","src/components/searchcraft-toggle-button/searchcraft-toggle-button.module.scss?tag=searchcraft-toggle-button&encapsulation=shadow","src/components/searchcraft-toggle-button/searchcraft-toggle-button.tsx"],"sourcesContent":[":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.formLTR {\n font-family: var(--font-stack);\n text-align: left;\n width: 100%;\n}\n\n.formRTL {\n font-family: var(--font-stack);\n text-align: right;\n width: 100%;\n}","import {\n Component,\n Prop,\n State,\n Event,\n type EventEmitter,\n h,\n} from '@stencil/core';\n\nimport {\n type CoreConfigSDK,\n CoreSDK as SearchcraftCore,\n type SearchcraftResponse,\n} from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport { parseCustomStyles } from '@utils/utils';\n\nimport type { ScInputCustomEvent } from '@components/searchcraft-input/searchcraft-input';\n\n@Component({\n tag: 'searchcraft-auto-search-form',\n styleUrl: 'searchcraft-auto-search-form.module.scss',\n shadow: true,\n})\nexport class SearchcraftAutoSearchForm {\n @Prop() autoSearchFormClass = '';\n @Prop() clearInput: () => void = () => {};\n @Prop() config: CoreConfigSDK = {\n apiKey: '',\n endpointURL: '',\n index: [],\n };\n @Prop() customStylesForInput: string | Record<string, string> = {};\n @Prop() inputCaptionValue = '';\n @Prop() inputIconHeight = 20;\n @Prop() inputIconWidth = 20;\n @Prop() labelForInput = '';\n @Prop() placeholderValue = 'Search here';\n @Prop() rightToLeftOrientation = false;\n @Prop() searchContainerClass = '';\n\n @Event() inputClearedOrNoResults: EventEmitter<void>;\n @Event() querySubmit: EventEmitter<string>;\n\n @State() error = false;\n @State() isRequesting = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n private debounceTimeout: ReturnType<typeof setTimeout> | null = null;\n private debounceDelay = 0;\n private searchStore = useSearchcraftStore.getState();\n unsubscribe: () => void;\n\n componentDidLoad() {\n const searchcraft = new SearchcraftCore(this.config);\n this.searchStore.initialize(searchcraft, true);\n\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.isRequesting = state.isRequesting;\n this.searchResults = { ...state.searchResults };\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n handleInputChange = (event: ScInputCustomEvent<string>) => {\n this.query = event.detail;\n this.searchStore.setQuery(this.query);\n this.querySubmit.emit(this.query);\n };\n\n handleInputKeyUp = (event: ScInputCustomEvent<string>) => {\n const target = event.detail;\n this.query = target;\n this.searchStore.setQuery(this.query);\n this.querySubmit.emit(this.query);\n\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n this.debounceTimeout = setTimeout(() => {\n this.query.trim() !== '' && this.runSearch();\n }, this.debounceDelay);\n };\n\n handleClearInput = () => {\n this.query = '';\n this.searchStore.setQuery('');\n\n if (typeof this.clearInput === 'function') {\n this.clearInput();\n }\n\n if (this.debounceTimeout) {\n clearTimeout(this.debounceTimeout);\n }\n\n this.error = false;\n this.inputClearedOrNoResults.emit();\n };\n\n private runSearch = async () => {\n if (this.query.trim() === '') {\n this.error = true;\n this.inputClearedOrNoResults.emit();\n } else {\n this.error = false;\n this.searchStore.setQuery(this.query);\n\n try {\n await this.searchStore.search();\n } catch (error) {\n this.error = true;\n this.inputClearedOrNoResults.emit();\n }\n }\n };\n\n handleFormSubmit = async (event: Event) => {\n event.preventDefault();\n await this.runSearch();\n };\n\n render() {\n const formClass = this.rightToLeftOrientation ? 'formRTL' : 'formLTR';\n const parsedCustomStyles = parseCustomStyles(this.customStylesForInput);\n if (this.query.length > 0 && this.searchResults?.data?.hits?.length === 0) {\n this.inputClearedOrNoResults.emit();\n }\n\n return (\n <form class={`${formClass}`} onSubmit={this.handleFormSubmit}>\n <searchcraft-input-label label={this.labelForInput} />\n <searchcraft-input\n customStyles={parsedCustomStyles}\n input-caption-value={this.inputCaptionValue}\n input-icon-height={this.inputIconHeight}\n input-icon-width={this.inputIconWidth}\n is-requesting={this.isRequesting}\n onClearInput={this.handleClearInput}\n onInputKeyUp={this.handleInputKeyUp}\n onSearchInputChange={this.handleInputChange}\n placeholder-value={this.placeholderValue}\n query={this.query}\n right-to-left-orientation={this.rightToLeftOrientation}\n />\n {this.error && (\n <searchcraft-error-message errorMessage='Please enter a search query.' />\n )}\n </form>\n );\n }\n}\n","@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin interactive-result-container-base {\n align-items: flex-start;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 8px;\n position: relative;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveResultContainerLight {\n @include interactive-result-container-base;\n background-color: $light-search-result-container-background;\n}\n\n.interactiveResultContainerDark {\n @include interactive-result-container-base;\n background-color: $dark-search-result-container-background;\n}\n\n.resultContainer {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveIconLarge {\n display: inline-block;\n position: absolute;\n right: 5px;\n top: 8px;\n\n\n @media (max-width: 600px) {\n display: none;\n }\n}\n\n.interactiveIconSmall {\n display: inline-block;\n position: absolute;\n right: 5px;\n top: -2px;\n\n\n @media (min-width: 600px) {\n display: none;\n }\n}\n\n.imageContainer {\n max-width: 100%;\n}\n\n.contentContainer {\n max-height: 100%;\n max-width: 100%;\n\n @media (min-width: 600px) {\n max-width: 50%;\n }\n}\n\n.secondaryContentContainer {\n display: flex;\n\n}\n\n@mixin image-base {\n border-radius: 8px;\n max-height: 100%;\n max-width: 100%;\n}\n\n.imageLight {\n @include image-base;\n border: 1px solid $light-search-result-image-border;\n}\n\n.imageDark {\n @include image-base;\n border: 1px solid $dark-search-result-image-border;\n}\n\n@mixin heading-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 700;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0;\n position: relative;\n}\n\n.headingLight {\n @include heading-base;\n color: $light-search-result-heading-color;\n}\n\n.headingDark {\n @include heading-base;\n color: $dark-search-result-heading-color;\n}\n\n@mixin subheading-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.subheadingLight {\n @include subheading-base;\n color: $light-search-result-subheading-color;\n}\n\n.subheadingDark {\n @include subheading-base;\n color: $dark-search-result-subheading-color\n}\n\n@mixin body-content-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 400;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.primaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.primaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.secondaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.secondaryContentLight::after {\n content: \"•\";\n color: $light-search-result-body-content-color;\n font-size: 1em;\n margin-left: 5px;\n margin-right: 5px;\n}\n\n.secondaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.tertiaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.tertiaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}","import { Component, Event, Fragment, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-base-search-result',\n styleUrl: 'searchcraft-base-search-result.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchResult {\n @Prop() buttonText = ''; // Label for the button\n @Prop() customStyles = '{}'; // New string prop for serialized styles.\n @Prop() headingText = ''; // Text for the heading\n @Prop() imageDescription = ''; // Alternative text for the image\n @Prop() imageSource = ''; // Source URL for the image\n @Prop() isInteractive = false; // Determines if the result is interactive\n @Prop() primaryContent = ''; // Primary body content\n @Prop() secondaryContent = ''; // Secondary body content\n @Prop() subheadingText = ''; // Text for the subheading\n @Prop() tertiaryContent = ''; // Tertiary body content\n @Prop() themeMode: 'light' | 'dark' = 'light'; // Light or dark theme context\n @Prop() placeImageRight = false; // Determines the placement of the image container\n\n @Event() buttonCallback: () => void = () => {}; // Callback for button click\n @Event() keyDownCallback: () => void = () => {}; // Callback for key down event\n @Event() resultCallback: () => void = () => {}; // Callback for result container click\n\n private handleButtonClick = () => {\n this.buttonCallback();\n };\n\n private handleContainerClick = () => {\n if (this.isInteractive) {\n this.resultCallback();\n }\n };\n\n private parseStyles(): Record<string, { [key: string]: string }> {\n try {\n return JSON.parse(this.customStyles);\n } catch (error) {\n console.error('Error parsing custom styles:', error);\n return {};\n }\n }\n\n render() {\n const isLightTheme = this.themeMode === 'light';\n const styles = this.parseStyles();\n\n const imageContainer = this.imageSource && (\n <div class='imageContainer'>\n <img\n alt={this.imageDescription}\n class={isLightTheme ? 'imageLight' : 'imageDark'}\n src={this.imageSource}\n style={styles.image || {}}\n />\n </div>\n );\n\n const contentContainer = (\n <div class='contentContainer'>\n <h2\n class={isLightTheme ? 'headingLight' : 'headingDark'}\n style={styles.heading || {}}\n >\n {this.headingText}\n </h2>\n <h3\n class={isLightTheme ? 'subheadingLight' : 'subheadingDark'}\n style={styles.subheading || {}}\n >\n {this.subheadingText}\n </h3>\n <p\n class={isLightTheme ? 'primaryContentLight' : 'primaryContentDark'}\n style={styles.primaryContent || {}}\n >\n {this.primaryContent}\n </p>\n <div class='secondaryContentContainer'>\n <p\n class={\n isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark'\n }\n style={styles.secondaryContent || {}}\n >\n {this.secondaryContent}\n </p>\n <p\n class={\n isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark'\n }\n style={styles.tertiaryContent || {}}\n >\n {this.tertiaryContent}\n </p>\n </div>\n {this.buttonText && (\n <button\n onClick={this.handleButtonClick}\n style={styles.button || {}}\n type='button'\n >\n {this.buttonText}\n </button>\n )}\n </div>\n );\n\n return (\n <div\n class={\n this.isInteractive\n ? isLightTheme\n ? 'interactiveResultContainerLight'\n : 'interactiveResultContainerDark'\n : 'resultContainer'\n }\n onKeyDown={this.keyDownCallback}\n onClick={this.handleContainerClick}\n style={styles.container || {}}\n tabindex='0'\n >\n {this.placeImageRight ? (\n <Fragment>\n {contentContainer}\n {imageContainer}\n </Fragment>\n ) : (\n <Fragment>\n {imageContainer}\n {contentContainer}\n </Fragment>\n )}\n </div>\n );\n }\n}\n",":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.resultsContainer {\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin: 16px 0;\n\n & > p {\n align-self: center;\n }\n\n & > div {\n margin-bottom: 20px;\n img {\n height: 300px;\n width: 200px;\n }\n }\n}\n\n.adSection {\n align-items: center;\n background-color: #F1F1F1;\n border: 1px solid #DCDDDE;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n font-size: 16px;\n justify-content: center;\n margin: auto;\n min-height: 150px;\n text-align: center;\n width: 100%;\n\n p {\n margin-top: 5px;\n }\n}\n\n.emptyState {\n text-align: center;\n width: 100%;\n}\n\n.errorMessageContainer {\n text-align: center;\n}\n","import { Component, h, Prop, State } from '@stencil/core';\n\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport {\n extractDynamicProperties,\n getFormattedTimeFromNow,\n parseSearchKeys,\n serializeStyles,\n} from '@utils/utils';\n\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchResults {\n @Prop() adInterval = 4;\n @Prop() customStylesForResults:\n | string\n | Record<string, Record<string, string>> = {};\n @Prop() documentAttributesForDisplay = '';\n @Prop() fallbackElement: HTMLElement | null = null;\n @Prop() formatTime = true;\n @Prop() placeAdAtEnd = false;\n @Prop() placeAdAtStart = true;\n @Prop() placeResultImageRight = false;\n\n @State() hasSearched = false;\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n if (\n !this.documentAttributesForDisplay ||\n this.documentAttributesForDisplay.length === 0\n ) {\n console.warn('No document attributes provided; using empty keys array.');\n this.documentAttributesForDisplay = '';\n }\n\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n } else {\n this.hasSearched = false;\n }\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n render() {\n if (!this.hasSearched) {\n return (\n <div class='emptyState'>\n <slot name='empty-search' />\n </div>\n );\n }\n\n if (!this.searchResults?.data) {\n console.warn('No search results data available');\n return <div class='emptyState'>No results to display.</div>;\n }\n\n const parsedSearchKeys = parseSearchKeys(this.documentAttributesForDisplay);\n const serializedStyles =\n typeof this.customStylesForResults === 'string'\n ? this.customStylesForResults\n : serializeStyles(this.customStylesForResults);\n\n const resultsComponents = this.searchResults?.data?.hits?.map(\n (document, index) => {\n const { doc: result } = document;\n const dynamicProperties = extractDynamicProperties(\n result,\n parsedSearchKeys,\n );\n\n if (this.formatTime) {\n for (const key of parsedSearchKeys) {\n if (dynamicProperties[key]) {\n const value = dynamicProperties[key];\n // Check if the value is a valid ISO timestamp\n if (\n typeof value === 'string' &&\n !Number.isNaN(Date.parse(value))\n ) {\n dynamicProperties[key] = getFormattedTimeFromNow(value);\n }\n }\n }\n }\n\n return (\n <searchcraft-base-search-result\n button-callback={() => console.log('button callback')}\n custom-styles={serializedStyles}\n image-source={\n dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]]\n }\n is-interactive={true}\n key={`${document.document_id}-${index}`}\n keydown-callback={() => console.log('keydown')}\n heading-text={dynamicProperties[parsedSearchKeys[0]]}\n place-image-right={this.placeResultImageRight}\n primary-content={dynamicProperties[parsedSearchKeys[2]]}\n result-callback={() => console.log('interactive element')}\n secondary-content={dynamicProperties[parsedSearchKeys[3]]}\n subheading-text={dynamicProperties[parsedSearchKeys[1]]}\n tertiary-content={dynamicProperties[parsedSearchKeys[4]]}\n />\n );\n },\n );\n\n const finalComponents: JSX.Element[] = [];\n\n if (this.placeAdAtStart) {\n finalComponents.push(\n <div key='ad-section-start' class='adSection'>\n <span>##</span>\n <p> Ad Impressions</p>\n </div>,\n );\n }\n\n if (this.adInterval > 0) {\n resultsComponents.forEach((component, index) => {\n finalComponents.push(component);\n if ((index + 1) % this.adInterval === 0) {\n finalComponents.push(\n <div key={`ad-section-${index + 1}`} class='adSection'>\n <span>##</span>\n <p> Ad Impressions</p>\n </div>,\n );\n }\n });\n } else {\n finalComponents.push(...resultsComponents);\n }\n\n if (this.placeAdAtEnd) {\n finalComponents.push(\n <div key='ad-section-end' class='adSection'>\n <span>##</span>\n <p> Ad Impressions</p>\n </div>,\n );\n }\n\n return (\n <div class='resultsContainer'>\n {finalComponents}\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <div class='errorMessageContainer'>\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n </div>\n )}\n </div>\n );\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-clear-icon-set',\n shadow: true,\n})\nexport class SearchcraftClearIconSet {\n /**\n * Type of the icon to display.\n * Options: 'clear-light', 'clear-dark', 'arrow-light', 'arrow-dark'\n */\n @Prop() type: 'clear-light' | 'clear-dark' | 'arrow-light' | 'arrow-dark' =\n 'clear-light';\n\n render() {\n switch (this.type) {\n case 'clear-light':\n return (\n <svg\n width='22'\n height='22'\n viewBox='0 0 22 22'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Clear Input Icon Light</title>\n <path\n d='M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z'\n stroke='black'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'clear-dark':\n return (\n <svg\n width='22'\n height='22'\n viewBox='0 0 22 22'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Clear Input Icon Dark</title>\n <path\n d='M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z'\n stroke='white'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'arrow-light':\n return (\n <svg\n width='20'\n height='21'\n viewBox='0 0 20 21'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Arrow Right Icon Light</title>\n <path\n d='M7.5 15.0444L12.5 10.0444L7.5 5.04443'\n stroke='#737373'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'arrow-dark':\n return (\n <svg\n width='8'\n height='12'\n viewBox='0 0 8 12'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='icon-title'\n >\n <title id='icon-title'>Searchcraft Arrow Right Icon Dark</title>\n <path\n d='M1.5 11L6.5 6L1.5 1'\n stroke='#BFBFBF'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n\n default:\n return null;\n }\n }\n}\n",":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.inputClearButtonLTR {\n align-items: center;\n background: none;\n border: none;\n display: flex;\n height: 20px;\n justify-content: center;\n padding: 0;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 20px;\n}\n\n.inputClearButtonRTL {\n align-items: center;\n background: none;\n border: none;\n display: flex;\n height: 20px;\n justify-content: center;\n left: 0px;\n padding: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 20px;\n}","import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-clear-input-button',\n styleUrl: 'searchcraft-clear-input-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftClearInputButton {\n @Prop() isRequesting? = false;\n @Prop() rightToLeftOrientation = false;\n\n @Event() clearInput: EventEmitter<void>;\n\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n private handleClearClick = (event: MouseEvent) => {\n event.preventDefault();\n this.clearInput.emit();\n };\n\n render() {\n return this.rightToLeftOrientation ? (\n <button\n class={classNames('inputClearButtonRTL', '.sc-clear-input-button-rtl')}\n onClick={this.handleClearClick}\n type='button'\n >\n {this.isRequesting ? (\n this.isLightTheme ? (\n <searchcraft-spinner-light />\n ) : (\n <searchcraft-spinner-dark />\n )\n ) : this.isLightTheme ? (\n <searchcraft-clear-icon-set type='clear-light' />\n ) : (\n <searchcraft-clear-icon-set type='clear-dark' />\n )}\n </button>\n ) : (\n <button\n class={classNames('inputClearButtonLTR', '.sc-clear-input-button-ltr')}\n onClick={this.handleClearClick}\n type='button'\n >\n {this.isRequesting ? (\n this.isLightTheme ? (\n <searchcraft-spinner-light />\n ) : (\n <searchcraft-spinner-dark />\n )\n ) : this.isLightTheme ? (\n <searchcraft-clear-icon-set type='clear-light' />\n ) : (\n <searchcraft-clear-icon-set type='clear-dark' />\n )}\n </button>\n );\n }\n}\n","@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin error-message-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-top: 4px;\n}\n\n.errorMessageLight {\n @include error-message-base;\n color: $light-input-caption-color-error;\n}\n\n.errorMessageDark {\n @include error-message-base;\n color: $dark-input-caption-color-error;\n}","import { Component, Prop, h } from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-error-message',\n styleUrl: 'searchcraft-error-message.module.scss',\n shadow: true,\n})\nexport class SearchcraftErrorMessage {\n /**\n * The error message to display. Defaults to a standard message if not provided.\n */\n @Prop() errorMessage?: string;\n\n /**\n * The theme, which determines the style (light or dark).\n */\n @Prop() theme: 'light' | 'dark' = 'light';\n\n render() {\n const errorMessageStyle =\n this.theme === 'light' ? 'errorMessageLight' : 'errorMessageDark';\n\n return (\n <p class={classNames(errorMessageStyle)}>\n {this.errorMessage || 'Search term is required.'}\n </p>\n );\n }\n}\n",".filtersList {\n width: 100%;\n}\n\n.checkboxLabel {\n align-items: center;\n color: #292929;\n display: flex;\n font-family: 'Source Sans Pro';\n font-size: 14px;\n font-weight: 600;\n gap: 14px;\n}\n\n.checkboxLabel input[type=\"checkbox\"] {\n align-items: center;\n appearance: none;\n background-color:#EDEDED;\n border: 1px solid #D9D9D9;\n cursor: pointer;\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n}\n\n.checkboxLabel input[type=\"checkbox\"]:checked {\n background-color: #000;\n}\n\n.checkboxLabel input[type=\"checkbox\"]:checked::before {\n color: #fff;\n content: '✔';\n}\n\n.remainingFilterListCheckbox {\n margin-left: 16px;\n}\n\n.childCheckboxLabel {\n align-items: center;\n color: #292929;\n display: flex;\n font-family: 'Source Sans Pro';\n font-size: 14px;\n font-weight: 600;\n gap: 12px;\n}\n\n.childCheckboxLabel input[type=\"checkbox\"] {\n align-items: center;\n appearance: none;\n background-color:#EDEDED;\n border: 1px solid #D9D9D9;\n cursor: pointer;\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n}\n\n.childCheckboxLabel input[type=\"checkbox\"]:checked {\n background-color: #000;\n}\n\n.childCheckboxLabel input[type=\"checkbox\"]:checked::before {\n color: #fff;\n content: '✔';\n}","import {\n Component,\n h,\n State,\n Prop,\n Event,\n type EventEmitter,\n} from '@stencil/core';\n\nimport type { Facets } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\n\nimport { flattenFacets } from '@utils/utils';\n\n@Component({\n tag: 'searchcraft-filters-list',\n styleUrl: 'searchcraft-filters-list.module.scss',\n shadow: true,\n})\nexport class SearchcraftFiltersList {\n @Prop() filters: Array<{ label: string; value: string }> = [];\n\n @Event() filtersUpdated: EventEmitter<string[]>;\n\n @State() dynamicFilters: Array<{ label: string; value: string }> = [];\n @State() isRequesting = false;\n @State() query = '';\n @State() resultsCount = 0;\n @State() selectedFilters: Set<string> = new Set();\n\n private searchStore = useSearchcraftStore.getState();\n unsubscribe: () => void;\n\n connectedCallback() {\n const state = this.searchStore; // Fetch the initial state\n\n // Initial population of facets if available\n if (state.searchResults?.data.facets) {\n this.populateFiltersFromFacets(state.searchResults.data.facets);\n }\n\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (!state.query || state.query.trim().length === 0) {\n if (this.selectedFilters.size > 0) {\n this.selectedFilters.clear();\n this.filtersUpdated.emit([]);\n if (this.searchStore.selectedFilters.length > 0) {\n this.searchStore.setSelectedFilters([]);\n }\n }\n }\n this.query = state.query || '';\n this.isRequesting = state.isRequesting;\n this.resultsCount = state.searchResults?.data?.hits?.length || 0;\n\n // Populate filters when facets are updated\n if (state.searchResults?.data.facets) {\n this.populateFiltersFromFacets(state.searchResults.data.facets);\n }\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n populateFiltersFromFacets(facets: Facets) {\n const newFilters = flattenFacets(facets[0]?.section || []);\n const filtersMap = new Map<string, { label: string; value: string }>();\n\n newFilters.forEach((filter) => {\n const key = filter.value.split('/').pop() || '';\n const existingFilter = filtersMap.get(key);\n if (\n !existingFilter ||\n filter.value.length < existingFilter.value.length\n ) {\n filtersMap.set(key, filter);\n }\n });\n\n this.dynamicFilters = Array.from(filtersMap.values());\n }\n\n handleFilterChange = (value: string, checked: boolean) => {\n if (checked) {\n this.selectedFilters.add(value);\n } else {\n this.selectedFilters.delete(value);\n }\n const deduplicatedFilters = this.deduplicatePaths(\n Array.from(this.selectedFilters),\n );\n\n this.filtersUpdated.emit(deduplicatedFilters);\n this.searchStore.setSelectedFilters(deduplicatedFilters);\n this.searchStore.search();\n };\n\n deduplicatePaths(filters: string[]): string[] {\n const pathMap = new Map<string, string>();\n\n filters.forEach((path) => {\n const key = path.split('/').pop() || '';\n const existingPath = pathMap.get(key);\n\n if (!existingPath || path.length < existingPath.length) {\n pathMap.set(key, path);\n }\n });\n\n return Array.from(pathMap.values());\n }\n\n formatLabel(label: string): string {\n return label\n .replace(/-/g, ' ')\n .split(' ')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n }\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n\n const filtersToRender = this.dynamicFilters.filter(\n (filter) => !filter.value.includes('/', filter.value.indexOf('/') + 1),\n );\n\n return (\n <div class='filtersList'>\n {filtersToRender.map((filter) => {\n const isChecked = this.selectedFilters.has(filter.value);\n const children = this.dynamicFilters.filter(\n (child) =>\n child.value.startsWith(`${filter.value}/`) &&\n child.value !== filter.value,\n );\n\n return (\n <div key={filter.value}>\n <label class='checkboxLabel'>\n <input\n class='filterCheckbox'\n checked={isChecked}\n onChange={(event: Event) =>\n this.handleFilterChange(\n filter.value,\n (event.target as HTMLInputElement).checked,\n )\n }\n type='checkbox'\n />\n {this.formatLabel(filter.label)}\n </label>\n {children.map((child) => {\n const isChildChecked = this.selectedFilters.has(child.value);\n return (\n <label\n class='childCheckboxLabel'\n key={child.value}\n style={{ marginLeft: '20px' }}\n >\n <input\n class='childFilterCheckbox'\n checked={isChildChecked}\n onChange={(event: Event) =>\n this.handleFilterChange(\n child.value,\n (event.target as HTMLInputElement).checked,\n )\n }\n type='checkbox'\n />\n {this.formatLabel(child.label.split('/').pop() || '')}\n </label>\n );\n })}\n </div>\n );\n })}\n </div>\n );\n }\n}\n","@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin input-container-base {\n position: relative;\n width: 100%;\n}\n\n@mixin input-base {\n border: none;\n border-radius: 8px;\n font-family: var(--font-stack);\n outline: none;\n padding-bottom: 15px;\n padding-top: 15px;\n width: 100%;\n\n &::placeholder {\n font-family: var(--font-stack);\n font-size: 16px;\n }\n}\n\n@mixin input-base-light {\n @include input-base;\n background-color: $light-input-background-color;\n color: $light-input-label-color;\n\n &::placeholder {\n color: $light-input-placeholder-color;\n }\n\n &:focus {\n outline: 2px solid $light-input-outline-focus;\n }\n}\n\n@mixin input-base-dark {\n @include input-base;\n background-color: $dark-input-background-color;\n color: $dark-input-label-color;\n\n &::placeholder {\n color: $dark-input-placeholder-color;\n }\n\n &:focus {\n outline: 2px solid $dark-input-outline-focus;\n }\n}\n\n@mixin input-error-base-light {\n @include input-base-light;\n outline: 2px solid $light-input-error-outline;\n\n &:focus-visible {\n outline: 2px solid $light-input-error-outline,\n }\n}\n\n@mixin input-error-base-dark {\n @include input-base-dark;\n outline: 2px solid $dark-input-error-outline;\n\n &:focus-visible {\n outline: 2px solid $dark-input-error-outline;\n }\n}\n\n.inputContainerLTR {\n @include input-container-base;\n}\n\n.inputContainerRTL {\n @include input-container-base;\n margin-left: 8px;\n}\n\n@mixin align-LTR {\n margin-right: 8px;\n padding-left: 36px;\n padding-right: 16px;\n}\n\n.inputLightLTR {\n @include input-base-light;\n @include align-LTR;\n}\n\n.inputDarkLTR {\n @include input-base-dark;\n @include align-LTR;\n}\n\n.inputErrorLightLTR {\n @include input-error-base-light;\n @include align-LTR;\n}\n\n.inputErrorDarkLTR {\n @include input-error-base-dark;\n @include align-LTR;\n}\n\n@mixin align-RTL {\n margin-left: 8px;\n padding-left: 16px;\n padding-right: 36px;\n text-align: right;\n}\n\n.inputLightRTL {\n @include input-base-light;\n @include align-RTL;\n}\n\n.inputDarkRTL {\n @include input-base-dark;\n @include align-RTL;\n}\n\n.inputErrorLightRTL {\n @include input-error-base-light;\n @include align-RTL;\n}\n\n.inputErrorDarkRTL {\n @include input-error-base-dark;\n @include align-RTL;\n}\n\n.inputWrapper {\n align-items: center;\n display: flex;\n position: relative;\n width: 100%;\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Event,\n Fragment,\n type EventEmitter,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\nimport { parseCustomStyles } from '@utils/utils';\n\nexport interface ScInputCustomEvent<T> extends CustomEvent<T> {\n detail: T;\n target: HTMLSearchcraftInputElement;\n}\n\n@Component({\n tag: 'searchcraft-input',\n styleUrl: 'searchcraft-input.module.scss',\n shadow: true,\n})\nexport class SearchcraftInput {\n @Prop() customStyles: string | Record<string, string> = {};\n @Prop() error = false;\n @Prop() formClassName = '';\n @Prop() inputCaptionClassName = '';\n @Prop() inputCaptionValue = '';\n @Prop() inputClassName = '';\n @Prop() inputIconHeight = 20;\n @Prop() inputIconWidth = 20;\n @Prop() isRequesting = false;\n @Prop() placeholderValue = 'Enter Search';\n @Prop() rightToLeftOrientation = false;\n @Prop() query = '';\n\n @Event() clearInput: EventEmitter<void>;\n @Event() searchInputChange: EventEmitter<string>;\n @Event() inputKeyUp: EventEmitter<string>;\n\n @State() theme = 'light';\n\n private get isLightTheme() {\n return this.theme === 'light';\n }\n\n handleInputChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.searchInputChange.emit(input.value);\n }\n\n handleInputKeyUp(event: KeyboardEvent) {\n const input = event.target as HTMLInputElement;\n this.inputKeyUp.emit(input.value);\n }\n\n handleClearInput() {\n if (this.clearInput) {\n this.clearInput.emit();\n }\n }\n\n render() {\n const containerClassName = this.rightToLeftOrientation\n ? 'inputContainerRTL'\n : 'inputContainerLTR';\n\n const inputClassName = classNames(\n this.error\n ? this.isLightTheme\n ? 'inputErrorLightRTL'\n : 'inputErrorDarkRTL'\n : this.isLightTheme\n ? 'inputLightLTR'\n : 'inputDarkLTR',\n 'searchcraft-input',\n );\n\n const validatedCustomStyles = parseCustomStyles(this.customStyles);\n\n const placeholderStyle = {\n fontSize: validatedCustomStyles.placeholderFontSize || '16px',\n };\n return (\n <div\n class={classNames(\n containerClassName,\n this.formClassName,\n 'searchcraft-input-form',\n )}\n >\n {this.rightToLeftOrientation ? (\n <Fragment>\n <input\n autoComplete='off'\n class={classNames(inputClassName, 'searchcraft-input')}\n id='searchcraft-input-id'\n onChange={this.handleInputChange.bind(this)}\n onKeyUp={this.handleInputKeyUp.bind(this)}\n placeholder={this.placeholderValue}\n type='text'\n value={this.query}\n style={validatedCustomStyles}\n />\n <style>\n {`\n #searchcraft-input-id::placeholder {\n font-size: ${placeholderStyle.fontSize};\n }\n `}\n </style>\n {this.inputCaptionValue && (\n <searchcraft-input-caption\n inputCaptionClassName={this.inputCaptionClassName}\n inputCaptionValue={this.inputCaptionValue}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n {this.query.length > 0 && (\n <searchcraft-clear-input-button\n isRequesting={this.isRequesting}\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n <searchcraft-input-icon\n error={this.error}\n height={this.inputIconHeight}\n rightToLeftOrientation={this.rightToLeftOrientation}\n width={this.inputIconWidth}\n />\n </Fragment>\n ) : (\n <Fragment>\n <searchcraft-input-icon\n error={this.error}\n height={this.inputIconHeight}\n rightToLeftOrientation={this.rightToLeftOrientation}\n width={this.inputIconWidth}\n />\n <input\n autoComplete='off'\n class={classNames(inputClassName, 'searchcraft-input')}\n id='searchcraft-input-id'\n onChange={this.handleInputChange.bind(this)}\n onKeyUp={this.handleInputKeyUp.bind(this)}\n placeholder={this.placeholderValue}\n type='text'\n value={this.query}\n style={validatedCustomStyles}\n />\n <style>\n {`\n #searchcraft-input-id::placeholder {\n font-size: ${placeholderStyle.fontSize};\n }\n `}\n </style>\n {this.inputCaptionValue && (\n <searchcraft-input-caption\n inputCaptionClassName={this.inputCaptionClassName}\n inputCaptionValue={this.inputCaptionValue}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n {this.query.length > 0 && (\n <searchcraft-clear-input-button\n isRequesting={this.isRequesting}\n onClearInput={this.handleClearInput}\n rightToLeftOrientation={this.rightToLeftOrientation}\n />\n )}\n </Fragment>\n )}\n </div>\n );\n }\n}\n","@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin input-caption-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-top: 4px;\n}\n\n@mixin input-caption-base-light {\n @include input-caption-base;\n color: $light-input-caption-color;\n}\n\n@mixin input-caption-base-dark {\n @include input-caption-base;\n color: $dark-input-caption-color;\n}\n\n.inputCaptionLightLTR {\n @include input-caption-base-light;\n}\n\n.inputCaptionDarkLTR {\n @include input-caption-base-dark;\n}\n\n.inputCaptionErrorLightLTR {\n @include input-caption-base;\n color: $light-input-caption-color-error;\n}\n\n.inputCaptionErrorDarkLTR {\n @include input-caption-base;\n color: $dark-input-caption-color-error;\n}\n\n.inputCaptionLightRTL {\n @include input-caption-base-light;\n text-align: right;\n}\n\n.inputCaptionDarkRTL {\n @include input-caption-base-dark;\n text-align: right;\n}\n\n.inputCaptionErrorLightRTL {\n @include input-caption-base;\n color: $light-input-caption-color-error;\n text-align: right;\n}\n\n.inputCaptionErrorDarkRTL {\n @include input-caption-base;\n color: $dark-input-caption-color-error;\n text-align: right;\n}","import { Component, Prop, h, State } from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-input-caption',\n styleUrl: 'searchcraft-input-caption.module.scss',\n shadow: true,\n})\nexport class SearchcraftInputCaption {\n @Prop() error?: boolean;\n @Prop() inputCaptionClassName? = '';\n @Prop() inputCaptionValue = 'Enter Search';\n @Prop() rightToLeftOrientation = false;\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n render() {\n return this.rightToLeftOrientation ? (\n <p\n class={classNames(\n this.error\n ? this.isLightTheme\n ? 'inputCaptionErrorLightRTL'\n : 'inputCaptionErrorDarkRTL'\n : this.isLightTheme\n ? 'inputCaptionLightRTL'\n : 'inputCaptionDarkRTL',\n this.inputCaptionClassName,\n '.searchcraft-input-caption',\n )}\n >\n {this.inputCaptionValue}\n </p>\n ) : (\n <p\n class={classNames(\n this.error\n ? this.isLightTheme\n ? 'inputCaptionErrorLightLTR'\n : 'inputCaptionErrorDarkLTR'\n : this.isLightTheme\n ? 'inputCaptionLightLTR'\n : 'inputCaptionDarkLTR',\n this.inputCaptionClassName,\n '.searchcraft-input-caption',\n )}\n >\n {this.inputCaptionValue}\n </p>\n );\n }\n}\n",":root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n.inputIconLTR {\n left: 15px;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.inputIconRTL {\n position: absolute;\n right: 15px;\n top: 50%;\n transform: translateY(-50%);\n}","import { Component, Prop, h, State } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-input-icon',\n styleUrl: 'searchcraft-input-icon.module.scss',\n shadow: true,\n})\nexport class SearchcraftInputIcon {\n @Prop() error?: boolean;\n @Prop() height = 20;\n @Prop() rightToLeftOrientation = false;\n @Prop() width = 20;\n\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n render() {\n return this.error ? (\n <div\n class={this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR'}\n >\n {this.isLightTheme() ? (\n <searchcraft-search-icon-set\n height={this.height}\n type='error-light'\n width={this.width}\n />\n ) : (\n <searchcraft-search-icon-set\n height={this.height}\n type='error-dark'\n width={this.width}\n />\n )}\n </div>\n ) : (\n <div\n class={this.rightToLeftOrientation ? 'inputIconRTL' : 'inputIconLTR'}\n >\n {this.isLightTheme() ? (\n <searchcraft-search-icon-set\n height={this.height}\n type='search-light'\n width={this.width}\n />\n ) : (\n <searchcraft-search-icon-set\n height={this.height}\n type='search-dark'\n width={this.width}\n />\n )}\n </div>\n );\n }\n}\n","@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin input-label-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-top: 4px;\n}\n\n.labelLight {\n @include input-label-base;\n color: $light-input-label-color;\n}\n\n.labelDark {\n @include input-label-base;\n color: $dark-input-label-color;\n}","import { Component, Prop, h, State } from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-input-label',\n styleUrl: 'searchcraft-input-label.module.scss',\n shadow: true,\n})\nexport class SearchcraftInputLabel {\n @Prop() inputLabelClassName? = '';\n @Prop() label?: string;\n @State() theme = 'light';\n\n private isLightTheme() {\n return this.theme === 'light';\n }\n\n render() {\n if (!this.label) {\n return null;\n }\n const labelStyle = this.isLightTheme() ? 'labelLight' : 'labelDark';\n return (\n <label\n class={classNames(labelStyle, this.inputLabelClassName)}\n htmlFor='searchcraft-input-id'\n >\n {this.label}\n </label>\n );\n }\n}\n",".container {\n border-bottom: 1px solid #D9D9D9;\n display: flex;\n justify-content: flex-start;\n width: 100%;\n}\n\n.resultsInfo {\n color: #292929;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n margin: 0;\n margin-bottom: 8px;\n}","import { Component, h, State } from '@stencil/core';\nimport { useSearchcraftStore } from '@provider/store';\n\n@Component({\n tag: 'searchcraft-results-info',\n styleUrl: 'searchcraft-results-info.module.scss',\n shadow: true,\n})\nexport class SearchcraftResultsInfo {\n @State() isRequesting = false;\n @State() resultsCount = 0;\n @State() responseTime = '';\n @State() query = ''; // Track the query\n\n unsubscribe: () => void;\n\n connectedCallback() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.isRequesting = state.isRequesting;\n this.resultsCount = state.searchResults?.data?.count || 0;\n this.responseTime = (\n (state.searchResults?.data?.time_taken || 0) * 1000\n ).toFixed(2);\n this.query = state.query || ''; // Update query from store\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n\n return (\n <div class='container'>\n <p class='resultsInfo'>\n {this.resultsCount} results found in {this.responseTime}ms\n </p>\n </div>\n );\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-search-icon-set',\n shadow: true,\n})\nexport class SearchcraftSearchIconSet {\n /**\n * Type of the icon to display.\n * Options: 'search-light', 'search-dark', 'error-light', 'error-dark'\n */\n @Prop() type: 'search-light' | 'search-dark' | 'error-light' | 'error-dark' =\n 'search-dark';\n @Prop() width = 20;\n @Prop() height = 20;\n\n render() {\n const { width, height } = this;\n switch (this.type) {\n case 'search-light':\n return (\n <svg\n width={width}\n height={height}\n viewBox='0 0 20 20'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>Searchcraft Search Icon Light</title>\n <path\n d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z'\n stroke='#404040'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'search-dark':\n return (\n <svg\n width={width}\n height={height}\n viewBox='0 0 18 18'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>Searchcraft Search Icon Dark</title>\n <path\n d='M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z'\n stroke='#E6E6E6'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'error-light':\n return (\n <svg\n width={width}\n height={height}\n viewBox='0 0 20 20'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>\n Searchcraft Error Search Icon Light\n </title>\n <path\n d='M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z'\n stroke='#737373'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n case 'error-dark':\n return (\n <svg\n width={width}\n height={height}\n viewBox='0 0 18 18'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n aria-labelledby='searchcraft-title'\n >\n <title id='searchcraft-title'>\n Searchcraft Error Search Icon Dark\n </title>\n <path\n d='M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z'\n stroke='#BFBFBF'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n );\n default:\n return null;\n }\n }\n}\n",".sliderContainer {\n display: flex;\n flex-direction: column;\n gap: 10px;\n font-family: Arial, sans-serif;\n align-items: center;\n width: 100%;\n}\n\n.rangeContainer {\n display: flex;\n position: relative;\n width: 100%;\n align-items: center;\n\n .activeRange {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n height: 4px;\n background: #007DB3;\n z-index: 0;\n border-radius: 2px;\n }\n\n .rangeSlider {\n width: 100%;\n height: 4px;\n background: transparent;\n border-radius: 2px;\n outline: none;\n -webkit-appearance: none;\n appearance: none;\n position: absolute;\n margin: 0;\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n width: 20px;\n height: 20px;\n background-color: #FFF;\n border-radius: 50%;\n border: 2px solid #e6e6e6;\n cursor: pointer;\n }\n\n &::-moz-range-thumb {\n width: 20px;\n height: 20px;\n background-color: #FFF;\n border-radius: 50%;\n border: 2px solid #e6e6e6;\n cursor: pointer;\n }\n }\n}\n\n.yearLabels {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-top: 10px;\n font-size: 15px;\n font-weight: 600;\n font-family: 'Source Sans Pro', sans-serif;\n color: #666;\n}\n\n.yearLabel {\n min-width: 30px;\n text-align: center;\n}","import { Component, h, State, Prop } from '@stencil/core';\nimport { useSearchcraftStore } from '@provider/store';\n\n@Component({\n tag: 'searchcraft-slider',\n styleUrl: 'searchcraft-slider.module.scss',\n shadow: true,\n})\nexport class SearchcraftSlider {\n @Prop() maxYear = new Date().getFullYear();\n @Prop() minYear = 2014;\n\n @State() endYear = this.maxYear;\n @State() hasSearched = false;\n @State() query = '';\n @State() resultsCount = 0;\n @State() startYear = this.minYear;\n\n private searchStore = useSearchcraftStore.getState();\n\n unsubscribe: () => void;\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n if (state.query.length > 0) {\n this.hasSearched = true;\n this.resultsCount = state.searchResults?.data?.hits?.length || 0;\n }\n this.query = state.query;\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n private updateYears = async () => {\n this.searchStore.setYearsRange([this.startYear, this.endYear]);\n\n try {\n if (typeof this.query === 'string' && this.query.trim() !== '') {\n await this.searchStore.search();\n } else {\n console.warn('Query is missing or empty, skipping search request.');\n }\n } catch (error) {\n console.error('Search failed:', error);\n }\n };\n\n private handleStartYearChange = (event: InputEvent) => {\n const value = Number.parseInt((event.target as HTMLInputElement).value, 10);\n this.startYear = Math.min(value, this.endYear);\n this.updateYears();\n };\n\n private handleEndYearChange = (event: InputEvent) => {\n const value = Number.parseInt((event.target as HTMLInputElement).value, 10);\n this.endYear = Math.max(value, this.startYear);\n this.updateYears();\n };\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n\n const rangeMin = this.minYear;\n const rangeMax = this.maxYear;\n const startPercent =\n ((this.startYear - rangeMin) / (rangeMax - rangeMin)) * 100;\n const endPercent =\n ((this.endYear - rangeMin) / (rangeMax - rangeMin)) * 100;\n\n return (\n <div class='sliderContainer'>\n <div class='rangeContainer'>\n <div\n class='activeRange'\n style={{\n left: `${startPercent}%`,\n width: `${endPercent - startPercent}%`,\n }}\n />\n <input\n class='rangeSlider'\n max={this.maxYear}\n min={this.minYear}\n onInput={this.handleStartYearChange}\n step='1'\n type='range'\n value={this.startYear}\n />\n <input\n class='rangeSlider'\n max={this.maxYear}\n min={this.minYear}\n onInput={this.handleEndYearChange}\n step='1'\n type='range'\n value={this.endYear}\n />\n </div>\n <div class='yearLabels'>\n <span class='yearLabel'>{this.startYear}</span>\n <span class='yearLabel'>{this.endYear}</span>\n </div>\n </div>\n );\n }\n}\n","$spinner-size: 20px;\n\n.spinnerContainer {\n background-color: transparent;\n height: $spinner-size;\n width: $spinner-size;\n}\n\n.spinnerDark {\n animation: spinning 1s linear infinite;\n background: conic-gradient(#000 50%, #FFFFFF);\n clip-path: circle(50%);\n height: 100%;\n mask-image: radial-gradient(circle at center, rgba(0,0,0,0) calc($spinner-size/3), rgba(0,0,0,1) calc($spinner-size/3));\n width: 100%;\n}\n\n.spinnerLight {\n animation: spinning 1s linear infinite;\n background: conic-gradient(#737373 50%, #FFFFFF);\n clip-path: circle(50%);\n height: 100%;\n mask-image: radial-gradient(circle at center, rgba(0,0,0,0) calc($spinner-size/3), rgba(0,0,0,1) calc($spinner-size/3));\n width: 100%;\n}\n\n@keyframes spinning {\n 0% { transform: rotate(0deg); }\n 50% {transform: rotate(180deg);}\n 100% { transform: rotate(360deg); }\n}","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-spinner-dark',\n styleUrl: 'searchcraft-spinner-dark.module.scss',\n shadow: true,\n})\nexport class SearchcraftSpinnerDark {\n render() {\n return (\n <div class='spinnerContainer'>\n <div class='spinnerDark' />\n </div>\n );\n }\n}\n","$spinner-size: 20px;\n\n.spinnerContainer {\n background-color: transparent;\n height: $spinner-size;\n width: $spinner-size;\n}\n\n.spinnerLight {\n animation: spinning 1s linear infinite;\n background: conic-gradient(#737373 50%, #FFFFFF);\n clip-path: circle(50%);\n height: 100%;\n mask-image: radial-gradient(circle at center, rgba(0,0,0,0) calc($spinner-size/3), rgba(0,0,0,1) calc($spinner-size/3));\n width: 100%;\n}\n\n@keyframes spinning {\n 0% { transform: rotate(0deg); }\n 50% {transform: rotate(180deg);}\n 100% { transform: rotate(360deg); }\n}","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-spinner-light',\n styleUrl: 'searchcraft-spinner-light.module.scss',\n shadow: true,\n})\nexport class SearchcraftSpinnerLight {\n render() {\n return (\n <div class='spinnerContainer'>\n <div class='spinnerLight' />\n </div>\n );\n }\n}\n",".toggle-wrapper {\n background: #ddd;\n border: none;\n border-radius: 16px;\n box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.05);\n cursor: pointer;\n height: 26px;\n margin-left: 10px;\n position: relative;\n width: 44px;\n}\n\n.toggle-wrapper.active {\n background: #007DB3;\n box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.05);\n}\n\n.toggle-wrapper .toggle-switch {\n background: #fff;\n border-radius: 50%;\n height: 18px;\n left: 4px;\n position: absolute;\n top: calc(50% - 18px/2);\n transition: transform 0.3s ease;\n width: 18px;\n}\n\n.toggle-wrapper .toggle-switch.active {\n transform: translateX(16px);\n}\n","import { Component, h, Prop, State } from '@stencil/core';\nimport { useSearchcraftStore } from '@provider/store';\n\n@Component({\n tag: 'searchcraft-toggle-button',\n styleUrl: 'searchcraft-toggle-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftToggleButton {\n /**\n * Type of the toggle - determines what it controls\n * 'mode': toggles between 'fuzzy' and 'normal'\n * 'sort': toggles between 'asc' and 'desc'\n */\n @Prop() type: 'mode' | 'sort' = 'mode';\n\n @State() isActive = false;\n @State() query = ''; // Track the query\n @State() resultsCount = 0; // Track the count of search results\n\n private unsubscribe: () => void;\n private searchStore = useSearchcraftStore.getState();\n\n componentDidLoad() {\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.query = state.query || '';\n this.resultsCount = state.searchResults?.data?.hits?.length || 0;\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n private handleToggle = async () => {\n this.isActive = !this.isActive;\n\n if (this.type === 'mode') {\n const mode = this.isActive ? 'normal' : 'fuzzy';\n this.searchStore.setSearchParams({\n mode,\n });\n } else if (this.type === 'sort') {\n const sort = this.isActive ? 'desc' : 'asc';\n this.searchStore.setSearchParams({\n sort,\n });\n }\n\n try {\n await this.searchStore.search();\n } catch (error) {\n console.error('Search failed:', error);\n }\n };\n\n render() {\n if (!this.query || this.resultsCount === 0) {\n return null;\n }\n\n return (\n <button\n class={`toggle-wrapper ${this.isActive ? 'active' : ''}`}\n onClick={this.handleToggle}\n type='button'\n >\n <div class={`toggle-switch ${this.isActive ? 'active' : ''}`} />\n </button>\n );\n }\n}\n"],"mappings":"+MAAA,MAAMA,EAAqC,wLAC3C,MAAAC,EAAeD,E,MCyBFE,EAAyB,M,mIAyB5BC,KAAAC,gBAAwD,KACxDD,KAAAE,cAAgB,EAChBF,KAAAG,YAAcC,EAAoBC,WAmB1CL,KAAAM,kBAAqBC,IACnBP,KAAKQ,MAAQD,EAAME,OACnBT,KAAKG,YAAYO,SAASV,KAAKQ,OAC/BR,KAAKW,YAAYC,KAAKZ,KAAKQ,MAAM,EAGnCR,KAAAa,iBAAoBN,IAClB,MAAMO,EAASP,EAAME,OACrBT,KAAKQ,MAAQM,EACbd,KAAKG,YAAYO,SAASV,KAAKQ,OAC/BR,KAAKW,YAAYC,KAAKZ,KAAKQ,OAE3B,GAAIR,KAAKC,gBAAiB,CACxBc,aAAaf,KAAKC,gB,CAGpBD,KAAKC,gBAAkBe,YAAW,KAChChB,KAAKQ,MAAMS,SAAW,IAAMjB,KAAKkB,WAAW,GAC3ClB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AAMgM,EAAOxS,KAAKuS,SAAW,SAAW,QACxCvS,KAAKG,YAAYsS,gBAAgB,CAC/BD,Q,MAEG,GAAIxS,KAAKwG,OAAS,OAAQ,CAC/B,MAAMkM,EAAO1S,KAAKuS,SAAW,OAAS,MACtCvS,KAAKG,YAAYsS,gBAAgB,CAC/BC,Q,CAIJ,UACQ1S,KAAKG,YAAYqB,Q,CACvB,MAAOH,GACP6D,QAAQ7D,MAAM,iBAAkBA,E,aAxCJ,O,cAEZ,M,WACH,G,kBACO,C,CAKxB,gBAAAS,GACE9B,KAAKmC,YAAc/B,EAAoBgC,WAAWC,I,UAChDrC,KAAKQ,MAAQ6B,EAAM7B,OAAS,GAC5BR,KAAK4L,eAAe1I,GAAAC,GAAAC,EAAAf,EAAME,iBAAa,MAAAa,SAAA,SAAAA,EAAEC,QAAI,MAAAF,SAAA,SAAAA,EAAEG,QAAI,MAAAJ,SAAA,SAAAA,EAAED,SAAU,CAAC,G,CAIpE,oBAAAP,GACE,GAAI1C,KAAKmC,YAAa,CACpBnC,KAAKmC,a,EA0BT,MAAAQ,GACE,IAAK3C,KAAKQ,OAASR,KAAK4L,eAAiB,EAAG,CAC1C,OAAO,I,CAGT,OACErI,EAAA,UACEE,MAAO,kBAAkBzD,KAAKuS,SAAW,SAAW,KACpDjM,QAAStG,KAAKsS,aACd9L,KAAK,UAELjD,EAAA,OAAKE,MAAO,iBAAiBzD,KAAKuS,SAAW,SAAW,O","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,b as t}from"./p-0880cfbb.js";export{s as setNonce}from"./p-0880cfbb.js";import{g as r}from"./p-e1255160.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t([["p-1a0e85ee",[[1,"searchcraft-auto-search-form",{autoSearchFormClass:[1,"auto-search-form-class"],clearInput:[16],config:[16],customStylesForInput:[1,"custom-styles-for-input"],inputCaptionValue:[1,"input-caption-value"],inputIconHeight:[2,"input-icon-height"],inputIconWidth:[2,"input-icon-width"],labelForInput:[1,"label-for-input"],placeholderValue:[1,"placeholder-value"],rightToLeftOrientation:[4,"right-to-left-orientation"],searchContainerClass:[1,"search-container-class"],error:[32],isRequesting:[32],query:[32],searchResults:[32]}],[1,"searchcraft-base-search-results",{adInterval:[2,"ad-interval"],customStylesForResults:[1,"custom-styles-for-results"],documentAttributesForDisplay:[1,"document-attributes-for-display"],fallbackElement:[16],formatTime:[4,"format-time"],placeAdAtEnd:[4,"place-ad-at-end"],placeAdAtStart:[4,"place-ad-at-start"],hasSearched:[32],query:[32],searchResults:[32]}],[1,"searchcraft-filters-list",{filters:[16],dynamicFilters:[32],initialFilters:[32],isRequesting:[32],originalFilterCounts:[32],query:[32],resultsCount:[32],selectedFilters:[32]}],[1,"searchcraft-results-info",{isRequesting:[32],resultsCount:[32],responseTime:[32],query:[32]}],[1,"searchcraft-slider",{maxYear:[2,"max-year"],minYear:[2,"min-year"],endYear:[32],hasSearched:[32],query:[32],resultsCount:[32],startYear:[32]}],[1,"searchcraft-toggle-button",{type:[1],isActive:[32],query:[32],resultsCount:[32]}],[1,"searchcraft-base-search-result",{buttonText:[1,"button-text"],customStyles:[1,"custom-styles"],headingText:[1,"heading-text"],imageDescription:[1,"image-description"],imageSource:[1,"image-source"],isInteractive:[4,"is-interactive"],primaryContent:[1,"primary-content"],secondaryContent:[1,"secondary-content"],subheadingText:[1,"subheading-text"],tertiaryContent:[1,"tertiary-content"],themeMode:[1,"theme-mode"]}],[1,"searchcraft-input",{customStyles:[1,"custom-styles"],error:[4],formClassName:[1,"form-class-name"],inputCaptionClassName:[1,"input-caption-class-name"],inputCaptionValue:[1,"input-caption-value"],inputClassName:[1,"input-class-name"],inputIconHeight:[2,"input-icon-height"],inputIconWidth:[2,"input-icon-width"],isRequesting:[4,"is-requesting"],placeholderValue:[1,"placeholder-value"],rightToLeftOrientation:[4,"right-to-left-orientation"],query:[1],theme:[32]}],[1,"searchcraft-input-label",{inputLabelClassName:[1,"input-label-class-name"],label:[1],theme:[32]}],[1,"searchcraft-clear-input-button",{isRequesting:[4,"is-requesting"],rightToLeftOrientation:[4,"right-to-left-orientation"],theme:[32]}],[1,"searchcraft-input-icon",{error:[4],height:[2],rightToLeftOrientation:[4,"right-to-left-orientation"],width:[2],theme:[32]}],[1,"searchcraft-error-message",{errorMessage:[1,"error-message"],theme:[1]}],[1,"searchcraft-input-caption",{error:[4],inputCaptionClassName:[1,"input-caption-class-name"],inputCaptionValue:[1,"input-caption-value"],rightToLeftOrientation:[4,"right-to-left-orientation"],theme:[32]}],[1,"searchcraft-clear-icon-set",{type:[1]}],[1,"searchcraft-search-icon-set",{type:[1],width:[2],height:[2]}],[1,"searchcraft-spinner-light"],[1,"searchcraft-spinner-dark"]]],["p-acca6173",[[1,"searchcraft-base-search-form",{config:[16],errorMessage:[1,"error-message"],labelForInput:[1,"label-for-input"],rightToLeftOrientation:[4,"right-to-left-orientation"],error:[32],query:[32],searchResults:[32]}]]],["p-5ec960bd",[[1,"searchcraft-button-icon"]]],["p-cc454542",[[1,"searchcraft-button",{iconElement:[16],iconOnly:[4,"icon-only"],iconPosition:[1,"icon-position"],label:[1],isRequesting:[32],theme:[32]}]]]],e)}));
1
+ import{p as e,b as t}from"./p-0880cfbb.js";export{s as setNonce}from"./p-0880cfbb.js";import{g as a}from"./p-e1255160.js";var r=()=>{const t=import.meta.url;const a={};if(t!==""){a.resourcesUrl=new URL(".",t).href}return e(a)};r().then((async e=>{await a();return t([["p-c2c4f6b7",[[1,"searchcraft-auto-search-form",{autoSearchFormClass:[1,"auto-search-form-class"],clearInput:[16],config:[16],customStylesForInput:[1,"custom-styles-for-input"],inputCaptionValue:[1,"input-caption-value"],inputIconHeight:[2,"input-icon-height"],inputIconWidth:[2,"input-icon-width"],labelForInput:[1,"label-for-input"],placeholderValue:[1,"placeholder-value"],rightToLeftOrientation:[4,"right-to-left-orientation"],searchContainerClass:[1,"search-container-class"],error:[32],isRequesting:[32],query:[32],searchResults:[32]}],[1,"searchcraft-base-search-results",{adInterval:[2,"ad-interval"],customStylesForResults:[1,"custom-styles-for-results"],documentAttributesForDisplay:[1,"document-attributes-for-display"],fallbackElement:[16],formatTime:[4,"format-time"],placeAdAtEnd:[4,"place-ad-at-end"],placeAdAtStart:[4,"place-ad-at-start"],placeResultImageRight:[4,"place-result-image-right"],hasSearched:[32],query:[32],searchResults:[32]}],[1,"searchcraft-filters-list",{filters:[16],dynamicFilters:[32],isRequesting:[32],query:[32],resultsCount:[32],selectedFilters:[32]}],[1,"searchcraft-results-info",{isRequesting:[32],resultsCount:[32],responseTime:[32],query:[32]}],[1,"searchcraft-slider",{maxYear:[2,"max-year"],minYear:[2,"min-year"],endYear:[32],hasSearched:[32],query:[32],resultsCount:[32],startYear:[32]}],[1,"searchcraft-toggle-button",{type:[1],isActive:[32],query:[32],resultsCount:[32]}],[1,"searchcraft-base-search-result",{buttonText:[1,"button-text"],customStyles:[1,"custom-styles"],headingText:[1,"heading-text"],imageDescription:[1,"image-description"],imageSource:[1,"image-source"],isInteractive:[4,"is-interactive"],primaryContent:[1,"primary-content"],secondaryContent:[1,"secondary-content"],subheadingText:[1,"subheading-text"],tertiaryContent:[1,"tertiary-content"],themeMode:[1,"theme-mode"],placeImageRight:[4,"place-image-right"]}],[1,"searchcraft-input",{customStyles:[1,"custom-styles"],error:[4],formClassName:[1,"form-class-name"],inputCaptionClassName:[1,"input-caption-class-name"],inputCaptionValue:[1,"input-caption-value"],inputClassName:[1,"input-class-name"],inputIconHeight:[2,"input-icon-height"],inputIconWidth:[2,"input-icon-width"],isRequesting:[4,"is-requesting"],placeholderValue:[1,"placeholder-value"],rightToLeftOrientation:[4,"right-to-left-orientation"],query:[1],theme:[32]}],[1,"searchcraft-input-label",{inputLabelClassName:[1,"input-label-class-name"],label:[1],theme:[32]}],[1,"searchcraft-clear-input-button",{isRequesting:[4,"is-requesting"],rightToLeftOrientation:[4,"right-to-left-orientation"],theme:[32]}],[1,"searchcraft-input-icon",{error:[4],height:[2],rightToLeftOrientation:[4,"right-to-left-orientation"],width:[2],theme:[32]}],[1,"searchcraft-error-message",{errorMessage:[1,"error-message"],theme:[1]}],[1,"searchcraft-input-caption",{error:[4],inputCaptionClassName:[1,"input-caption-class-name"],inputCaptionValue:[1,"input-caption-value"],rightToLeftOrientation:[4,"right-to-left-orientation"],theme:[32]}],[1,"searchcraft-clear-icon-set",{type:[1]}],[1,"searchcraft-search-icon-set",{type:[1],width:[2],height:[2]}],[1,"searchcraft-spinner-light"],[1,"searchcraft-spinner-dark"]]],["p-63b3b565",[[1,"searchcraft-base-search-form",{config:[16],errorMessage:[1,"error-message"],labelForInput:[1,"label-for-input"],rightToLeftOrientation:[4,"right-to-left-orientation"],error:[32],query:[32],searchResults:[32]}]]],["p-5ec960bd",[[1,"searchcraft-button-icon"]]],["p-cc454542",[[1,"searchcraft-button",{iconElement:[16],iconOnly:[4,"icon-only"],iconPosition:[1,"icon-position"],label:[1],isRequesting:[32],theme:[32]}]]]],e)}));
2
2
  //# sourceMappingURL=searchcraft-javascript-sdk.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","autoSearchFormClass","clearInput","config","customStylesForInput","inputCaptionValue","inputIconHeight","inputIconWidth","labelForInput","placeholderValue","rightToLeftOrientation","searchContainerClass","error","isRequesting","query","searchResults","adInterval","customStylesForResults","documentAttributesForDisplay","fallbackElement","formatTime","placeAdAtEnd","placeAdAtStart","hasSearched","filters","dynamicFilters","initialFilters","originalFilterCounts","resultsCount","selectedFilters","responseTime","maxYear","minYear","endYear","startYear","type","isActive","buttonText","customStyles","headingText","imageDescription","imageSource","isInteractive","primaryContent","secondaryContent","subheadingText","tertiaryContent","themeMode","formClassName","inputCaptionClassName","inputClassName","theme","inputLabelClassName","label","height","width","errorMessage","iconElement","iconOnly","iconPosition"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings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AAA,wBAAAC,uBAAA,gCAAAI,MAAA,IAAAqC,MAAA,qCAAAC,oBAAA,6BAAAC,MAAA,IAAAF,MAAA,4CAAAtC,aAAA,oBAAAH,uBAAA,gCAAAyC,MAAA,oCAAAvC,MAAA,IAAA0C,OAAA,IAAA5C,uBAAA,gCAAA6C,MAAA,IAAAJ,MAAA,uCAAAK,aAAA,oBAAAL,MAAA,sCAAAvC,MAAA,IAAAqC,sBAAA,+BAAA5C,kBAAA,0BAAAK,uBAAA,gCAAAyC,MAAA,wCAAAhB,KAAA,wCAAAA,KAAA,IAAAoB,MAAA,IAAAD,OAAA,yHAAAnD,OAAA,KAAAqD,aAAA,oBAAAhD,cAAA,sBAAAE,uBAAA,gCAAAE,MAAA,KAAAE,MAAA,KAAAC,cAAA,gGAAA0C,YAAA,KAAAC,SAAA,gBAAAC,aAAA,oBAAAN,MAAA,IAAAxC,aAAA,KAAAsC,MAAA,UAAArD,EAAA","ignoreList":[]}
1
+ {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","async","options","globalScripts","bootstrapLazy","autoSearchFormClass","clearInput","config","customStylesForInput","inputCaptionValue","inputIconHeight","inputIconWidth","labelForInput","placeholderValue","rightToLeftOrientation","searchContainerClass","error","isRequesting","query","searchResults","adInterval","customStylesForResults","documentAttributesForDisplay","fallbackElement","formatTime","placeAdAtEnd","placeAdAtStart","placeResultImageRight","hasSearched","filters","dynamicFilters","resultsCount","selectedFilters","responseTime","maxYear","minYear","endYear","startYear","type","isActive","buttonText","customStyles","headingText","imageDescription","imageSource","isInteractive","primaryContent","secondaryContent","subheadingText","tertiaryContent","themeMode","placeImageRight","formClassName","inputCaptionClassName","inputClassName","theme","inputLabelClassName","label","height","width","errorMessage","iconElement","iconOnly","iconPosition"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"0HAOA,IAAIA,EAAe,KAUjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GA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A,4CAAAtC,aAAA,oBAAAH,uBAAA,gCAAAyC,MAAA,oCAAAvC,MAAA,IAAA0C,OAAA,IAAA5C,uBAAA,gCAAA6C,MAAA,IAAAJ,MAAA,uCAAAK,aAAA,oBAAAL,MAAA,sCAAAvC,MAAA,IAAAqC,sBAAA,+BAAA5C,kBAAA,0BAAAK,uBAAA,gCAAAyC,MAAA,wCAAAjB,KAAA,wCAAAA,KAAA,IAAAqB,MAAA,IAAAD,OAAA,yHAAAnD,OAAA,KAAAqD,aAAA,oBAAAhD,cAAA,sBAAAE,uBAAA,gCAAAE,MAAA,KAAAE,MAAA,KAAAC,cAAA,gGAAA0C,YAAA,KAAAC,SAAA,gBAAAC,aAAA,oBAAAN,MAAA,IAAAxC,aAAA,KAAAsC,MAAA,UAAArD,EAAA","ignoreList":[]}
@@ -10,6 +10,7 @@ export declare class SearchcraftBaseSearchResult {
10
10
  subheadingText: string;
11
11
  tertiaryContent: string;
12
12
  themeMode: 'light' | 'dark';
13
+ placeImageRight: boolean;
13
14
  buttonCallback: () => void;
14
15
  keyDownCallback: () => void;
15
16
  resultCallback: () => void;
@@ -7,6 +7,7 @@ export declare class SearchcraftBaseSearchResults {
7
7
  formatTime: boolean;
8
8
  placeAdAtEnd: boolean;
9
9
  placeAdAtStart: boolean;
10
+ placeResultImageRight: boolean;
10
11
  hasSearched: boolean;
11
12
  query: string;
12
13
  searchResults: SearchcraftResponse | null;
@@ -10,12 +10,7 @@ export declare class SearchcraftFiltersList {
10
10
  label: string;
11
11
  value: string;
12
12
  }>;
13
- initialFilters: Array<{
14
- label: string;
15
- value: string;
16
- }>;
17
13
  isRequesting: boolean;
18
- originalFilterCounts: Record<string, string>;
19
14
  query: string;
20
15
  resultsCount: number;
21
16
  selectedFilters: Set<string>;
@@ -25,6 +20,7 @@ export declare class SearchcraftFiltersList {
25
20
  disconnectedCallback(): void;
26
21
  populateFiltersFromFacets(facets: Facets): void;
27
22
  handleFilterChange: (value: string, checked: boolean) => void;
23
+ deduplicatePaths(filters: string[]): string[];
28
24
  formatLabel(label: string): string;
29
25
  render(): any;
30
26
  }
@@ -34,6 +34,7 @@ export namespace Components {
34
34
  "imageDescription": string;
35
35
  "imageSource": string;
36
36
  "isInteractive": boolean;
37
+ "placeImageRight": boolean;
37
38
  "primaryContent": string;
38
39
  "secondaryContent": string;
39
40
  "subheadingText": string;
@@ -49,6 +50,7 @@ export namespace Components {
49
50
  "formatTime": boolean;
50
51
  "placeAdAtEnd": boolean;
51
52
  "placeAdAtStart": boolean;
53
+ "placeResultImageRight": boolean;
52
54
  }
53
55
  interface SearchcraftButton {
54
56
  "iconElement"?: Element;
@@ -423,6 +425,7 @@ declare namespace LocalJSX {
423
425
  "onButtonCallback"?: (event: SearchcraftBaseSearchResultCustomEvent<any>) => void;
424
426
  "onKeyDownCallback"?: (event: SearchcraftBaseSearchResultCustomEvent<any>) => void;
425
427
  "onResultCallback"?: (event: SearchcraftBaseSearchResultCustomEvent<any>) => void;
428
+ "placeImageRight"?: boolean;
426
429
  "primaryContent"?: string;
427
430
  "secondaryContent"?: string;
428
431
  "subheadingText"?: string;
@@ -438,6 +441,7 @@ declare namespace LocalJSX {
438
441
  "formatTime"?: boolean;
439
442
  "placeAdAtEnd"?: boolean;
440
443
  "placeAdAtStart"?: boolean;
444
+ "placeResultImageRight"?: boolean;
441
445
  }
442
446
  interface SearchcraftButton {
443
447
  "iconElement"?: Element;
@@ -3,3 +3,14 @@ export declare function parseSearchKeys(documentAttributesForDisplay: string): s
3
3
  export declare function extractDynamicProperties(document: Record<string, string | number>, keys: string[]): Record<string, string | number>;
4
4
  export declare function serializeStyles(styles: Record<string, Record<string, string>>): string;
5
5
  export declare function getFormattedTimeFromNow(timestamp: string): string;
6
+ type Section = {
7
+ count: number;
8
+ path: string;
9
+ children: Section[];
10
+ };
11
+ type FacetCheckbox = {
12
+ label: string;
13
+ value: string;
14
+ };
15
+ export declare function flattenFacets(sections: Section[]): FacetCheckbox[];
16
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@searchcraft/javascript-sdk",
3
3
  "private": false,
4
- "version": "0.2.4",
4
+ "version": "0.2.6",
5
5
  "description": "Searchcraft Javascript SDK",
6
6
  "author": "Searchcraft",
7
7
  "license": "Apache-2.0",
@@ -1 +0,0 @@
1
- {"file":"utils-15f85bca.js","mappings":";;SAAgB,iBAAiB,CAC/B,MAAuC;IAEvC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;YACtD,OAAO,EAAE,CAAC;SACX;KACF;IACD,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC;SAEe,eAAe,CAC7B,4BAAoC;IAEpC,IAAI;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAC5D,IACE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;YACzB,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,OAAO,GAAG,KAAK,QAAQ,CAAC,EAClD;YACA,OAAO,UAAU,CAAC;SACnB;QACD,OAAO,CAAC,IAAI,CACV,2EAA2E,CAC5E,CAAC;QACF,OAAO,EAAE,CAAC;KACX;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,EAAE,CAAC;KACX;AACH,CAAC;SAEe,wBAAwB,CACtC,QAAyC,EACzC,IAAc;IAEd,MAAM,mBAAmB,GAAoC,EAAE,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG;QACf,mBAAmB,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;KAChD,CAAC,CAAC;IACH,OAAO,mBAAmB,CAAC;AAC7B,CAAC;SAEe,eAAe,CAC7B,MAA8C;IAE9C,IAAI;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;KAC/B;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;KACb;AACH,CAAC;SAEe,uBAAuB,CAAC,SAAiB;IACvD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAC9B,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,IAAI,CAC7C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;IAErC,IAAI,OAAO,GAAG,EAAE,EAAE;QAChB,OAAO,GAAG,OAAO,OAAO,CAAC;KAC1B;IACD,IAAI,KAAK,GAAG,EAAE,EAAE;QACd,OAAO,GAAG,KAAK,OAAO,CAAC;KACxB;IACD,IAAI,IAAI,GAAG,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,OAAO,CAAC;KACvB;IACD,OAAO,GAAG,KAAK,OAAO,CAAC;AACzB;;;;;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["export function parseCustomStyles(\n styles: string | Record<string, string>,\n): Record<string, string> {\n if (typeof styles === 'string') {\n try {\n return JSON.parse(styles);\n } catch (error) {\n console.error('Invalid customStyles format:', styles);\n return {};\n }\n }\n return styles || {};\n}\n\nexport function parseSearchKeys(\n documentAttributesForDisplay: string,\n): string[] {\n try {\n const parsedKeys = JSON.parse(documentAttributesForDisplay);\n if (\n Array.isArray(parsedKeys) &&\n parsedKeys.every((key) => typeof key === 'string')\n ) {\n return parsedKeys;\n }\n console.warn(\n 'searchKeys must be a JSON array of strings. Defaulting to an empty array.',\n );\n return [];\n } catch (error) {\n console.error('Failed to parse searchKeys:', error);\n return [];\n }\n}\n\nexport function extractDynamicProperties(\n document: Record<string, string | number>,\n keys: string[],\n) {\n const extractedProperties: Record<string, string | number> = {};\n keys.forEach((key) => {\n extractedProperties[key] = document[key] || '';\n });\n return extractedProperties;\n}\n\nexport function serializeStyles(\n styles: Record<string, Record<string, string>>,\n): string {\n try {\n return JSON.stringify(styles);\n } catch (error) {\n console.error('Error serializing styles:', error);\n return '{}';\n }\n}\n\nexport function getFormattedTimeFromNow(timestamp: string): string {\n const now = new Date();\n const inputTime = new Date(timestamp);\n const diffInSeconds = Math.floor(\n (now.getTime() - inputTime.getTime()) / 1000,\n );\n\n const minutes = Math.floor(diffInSeconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const years = Math.floor(days / 365);\n\n if (minutes < 60) {\n return `${minutes}m ago`;\n }\n if (hours < 24) {\n return `${hours}h ago`;\n }\n if (days < 365) {\n return `${days}d ago`;\n }\n return `${years}y ago`;\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-8c70054a.js","mappings":";;AAAA,MAAM,oCAAoC,GAAG,64FAA64F,CAAC;AAC37F,0CAAe,oCAAoC;;MCMtC,2BAA2B;;;;;;;;QAa7B,mBAAc,GAAe,SAAQ,CAAC;QACtC,oBAAe,GAAe,SAAQ,CAAC;QACvC,mBAAc,GAAe,SAAQ,CAAC;QAEvC,sBAAiB,GAAG;YAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;S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CAAC,WAAW,CACd,EACL,2DACE,KAAK,EAAE,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,EAC1D,KAAK,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE,IAE7B,IAAI,CAAC,cAAc,CACjB,EACL,0DACE,KAAK,EAAE,YAAY,GAAG,qBAAqB,GAAG,oBAAoB,EAClE,KAAK,EAAE,MAAM,CAAC,cAAc,IAAI,EAAE,IAEjC,IAAI,CAAC,cAAc,CAClB,EACJ,4DAAK,KAAK,EAAC,2BAA2B,IACpC,0DACE,KAAK,EACH,YAAY,GAAG,uBAAuB,GAAG,sBAAsB,EAEjE,KAAK,EAAE,MAAM,CAAC,gBAAgB,IAAI,EAAE,IAEnC,IAAI,CAAC,gBAAgB,CACpB,EACJ,0DACE,KAAK,EACH,YAAY,GAAG,sBAAsB,GAAG,qBAAqB,EAE/D,KAAK,EAAE,MAAM,CAAC,eAAe,IAAI,EAAE,IAElC,IAAI,CAAC,eAAe,CACnB,CACA,EACL,IAAI,CAAC,UAAU,KACd,+DACE,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE,EAC1B,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,UAAU,CACT,CACV,CACG,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-base-search-result/searchcraft-base-search-result.module.scss?tag=searchcraft-base-search-result&encapsulation=shadow","src/components/searchcraft-base-search-result/searchcraft-base-search-result.tsx"],"sourcesContent":["@import '../../utils/theme';\n\n:root {\n --font-stack: Helvetica, Arial, sans-serif;\n}\n\n@mixin interactive-result-container-base {\n align-items: flex-start;\n border-radius: 16px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 8px;\n position: relative;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveResultContainerLight {\n @include interactive-result-container-base;\n background-color: $light-search-result-container-background;\n}\n\n.interactiveResultContainerDark {\n @include interactive-result-container-base;\n background-color: $dark-search-result-container-background;\n}\n\n.resultContainer {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n @media (min-width: 600px) {\n flex-direction: row;\n }\n}\n\n.interactiveIconLarge {\n display: inline-block;\n position: absolute;\n right: 5px;\n top: 8px;\n\n\n @media (max-width: 600px) {\n display: none;\n }\n}\n\n.interactiveIconSmall {\n display: inline-block;\n position: absolute;\n right: 5px;\n top: -2px;\n\n\n @media (min-width: 600px) {\n display: none;\n }\n}\n\n.imageContainer {\n max-width: 100%;\n}\n\n.contentContainer {\n max-height: 100%;\n max-width: 100%;\n\n @media (min-width: 600px) {\n max-width: 50%;\n }\n}\n\n.secondaryContentContainer {\n display: flex;\n\n}\n\n@mixin image-base {\n aspect-ratio: 2 / 1;\n border-radius: 8px;\n max-height: 100%;\n max-width: 100%;\n}\n\n.imageLight {\n @include image-base;\n border: 1px solid $light-search-result-image-border;\n}\n\n.imageDark {\n @include image-base;\n border: 1px solid $dark-search-result-image-border;\n}\n\n@mixin heading-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 700;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0;\n position: relative;\n}\n\n.headingLight {\n @include heading-base;\n color: $light-search-result-heading-color;\n}\n\n.headingDark {\n @include heading-base;\n color: $dark-search-result-heading-color;\n}\n\n@mixin subheading-base {\n font-family: var(--font-stack);\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.subheadingLight {\n @include subheading-base;\n color: $light-search-result-subheading-color;\n}\n\n.subheadingDark {\n @include subheading-base;\n color: $dark-search-result-subheading-color\n}\n\n@mixin body-content-base {\n font-family: var(--font-stack);\n font-size: 16px;\n font-weight: 400;\n line-height: 20px;\n margin-bottom: 4px;\n margin-top: 0px;\n}\n\n.primaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.primaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.secondaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.secondaryContentLight::after {\n content: \"•\";\n color: $light-search-result-body-content-color;\n font-size: 1em;\n margin-left: 5px;\n margin-right: 5px;\n}\n\n.secondaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}\n\n.tertiaryContentLight {\n @include body-content-base;\n color: $light-search-result-body-content-color;\n}\n\n.tertiaryContentDark {\n @include body-content-base;\n color: $dark-search-result-body-content-color;\n}","import { Component, Event, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'searchcraft-base-search-result',\n styleUrl: 'searchcraft-base-search-result.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchResult {\n @Prop() buttonText = ''; // Label for the button\n @Prop() customStyles = '{}'; // New string prop for serialized styles.\n @Prop() headingText = ''; // Text for the heading\n @Prop() imageDescription = ''; // Alternative text for the image\n @Prop() imageSource = ''; // Source URL for the image\n @Prop() isInteractive = false; // Determines if the result is interactive\n @Prop() primaryContent = ''; // Primary body content\n @Prop() secondaryContent = ''; // Secondary body content\n @Prop() subheadingText = ''; // Text for the subheading\n @Prop() tertiaryContent = ''; // Tertiary body content\n @Prop() themeMode: 'light' | 'dark' = 'light'; // Light or dark theme context\n\n @Event() buttonCallback: () => void = () => {}; // Callback for button click\n @Event() keyDownCallback: () => void = () => {}; // Callback for key down event\n @Event() resultCallback: () => void = () => {}; // Callback for result container click\n\n private handleButtonClick = () => {\n this.buttonCallback();\n };\n\n private handleContainerClick = () => {\n if (this.isInteractive) {\n this.resultCallback();\n }\n };\n\n private parseStyles(): Record<string, { [key: string]: string }> {\n try {\n return JSON.parse(this.customStyles);\n } catch (error) {\n console.error('Error parsing custom styles:', error);\n return {};\n }\n }\n\n render() {\n const isLightTheme = this.themeMode === 'light';\n const styles = this.parseStyles();\n\n return (\n <div\n class={\n this.isInteractive\n ? isLightTheme\n ? 'interactiveResultContainerLight'\n : 'interactiveResultContainerDark'\n : 'resultContainer'\n }\n onKeyDown={this.keyDownCallback}\n onClick={this.handleContainerClick}\n style={styles.container || {}}\n tabindex='0'\n >\n <div class='imageContainer'>\n <img\n alt={this.imageDescription}\n class={isLightTheme ? 'imageLight' : 'imageDark'}\n src={this.imageSource}\n style={styles.image || {}}\n />\n </div>\n <div class='contentContainer'>\n <h2\n class={isLightTheme ? 'headingLight' : 'headingDark'}\n style={styles.heading || {}}\n >\n {this.headingText}\n </h2>\n <h3\n class={isLightTheme ? 'subheadingLight' : 'subheadingDark'}\n style={styles.subheading || {}}\n >\n {this.subheadingText}\n </h3>\n <p\n class={isLightTheme ? 'primaryContentLight' : 'primaryContentDark'}\n style={styles.primaryContent || {}}\n >\n {this.primaryContent}\n </p>\n <div class='secondaryContentContainer'>\n <p\n class={\n isLightTheme ? 'secondaryContentLight' : 'secondaryContentDark'\n }\n style={styles.secondaryContent || {}}\n >\n {this.secondaryContent}\n </p>\n <p\n class={\n isLightTheme ? 'tertiaryContentLight' : 'tertiaryContentDark'\n }\n style={styles.tertiaryContent || {}}\n >\n {this.tertiaryContent}\n </p>\n </div>\n {this.buttonText && (\n <button\n onClick={this.handleButtonClick}\n style={styles.button || {}}\n type='button'\n >\n {this.buttonText}\n </button>\n )}\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"p-ff6c3650.js","mappings":"SAAgB,iBAAiB,CAC/B,MAAuC;IAEvC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;YACtD,OAAO,EAAE,CAAC;SACX;KACF;IACD,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC;SAEe,eAAe,CAC7B,4BAAoC;IAEpC,IAAI;QACF,MAA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GAAG,EAAE,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;IAErC,IAAI,OAAO,GAAG,EAAE,EAAE;QAChB,OAAO,GAAG,OAAO,OAAO,CAAC;KAC1B;IACD,IAAI,KAAK,GAAG,EAAE,EAAE;QACd,OAAO,GAAG,KAAK,OAAO,CAAC;KACxB;IACD,IAAI,IAAI,GAAG,GAAG,EAAE;QACd,OAAO,GAAG,IAAI,OAAO,CAAC;KACvB;IACD,OAAO,GAAG,KAAK,OAAO,CAAC;AACzB;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["export function parseCustomStyles(\n styles: string | Record<string, string>,\n): Record<string, string> {\n if (typeof styles === 'string') {\n try {\n return JSON.parse(styles);\n } catch (error) {\n console.error('Invalid customStyles format:', styles);\n return {};\n }\n }\n return styles || {};\n}\n\nexport function parseSearchKeys(\n documentAttributesForDisplay: string,\n): string[] {\n try {\n const parsedKeys = JSON.parse(documentAttributesForDisplay);\n if (\n Array.isArray(parsedKeys) &&\n parsedKeys.every((key) => typeof key === 'string')\n ) {\n return parsedKeys;\n }\n console.warn(\n 'searchKeys must be a JSON array of strings. Defaulting to an empty array.',\n );\n return [];\n } catch (error) {\n console.error('Failed to parse searchKeys:', error);\n return [];\n }\n}\n\nexport function extractDynamicProperties(\n document: Record<string, string | number>,\n keys: string[],\n) {\n const extractedProperties: Record<string, string | number> = {};\n keys.forEach((key) => {\n extractedProperties[key] = document[key] || '';\n });\n return extractedProperties;\n}\n\nexport function serializeStyles(\n styles: Record<string, Record<string, string>>,\n): string {\n try {\n return JSON.stringify(styles);\n } catch (error) {\n console.error('Error serializing styles:', error);\n return '{}';\n }\n}\n\nexport function getFormattedTimeFromNow(timestamp: string): string {\n const now = new Date();\n const inputTime = new Date(timestamp);\n const diffInSeconds = Math.floor(\n (now.getTime() - inputTime.getTime()) / 1000,\n );\n\n const minutes = Math.floor(diffInSeconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const years = Math.floor(days / 365);\n\n if (minutes < 60) {\n return `${minutes}m ago`;\n }\n if (hours < 24) {\n return `${hours}h ago`;\n }\n if (days < 365) {\n return `${days}d ago`;\n }\n return `${years}y ago`;\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"file":"utils-dbb6302b.js","mappings":"SAAgB,iBAAiB,CAC/B,MAAuC;IAEvC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;YACtD,OAAO,EAAE,CAAC;SACX;KACF;IACD,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC;SAEe,eAAe,CAC7B,4BAAoC;IAEpC,IAAI;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAC5D,IACE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;YACzB,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,OAAO,GAAG,KAAK,QAAQ,CAAC,EAClD;YACA,OAAO,UAAU,CAAC;SACnB;QACD,OAAO,CAAC,IAAI,CACV,2EAA2E,CAC5E,CAAC;QACF,OAAO,EAAE,CAAC;KACX;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,EAAE,CAAC;KACX;AACH,CAAC;SAEe,wBAAwB,CACtC,QAAyC,EACzC,IAAc;IAEd,MAAM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AAO,CAAC;KACvB;IACD,OAAO,GAAG,KAAK,OAAO,CAAC;AACzB;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["export function parseCustomStyles(\n styles: string | Record<string, string>,\n): Record<string, string> {\n if (typeof styles === 'string') {\n try {\n return JSON.parse(styles);\n } catch (error) {\n console.error('Invalid customStyles format:', styles);\n return {};\n }\n }\n return styles || {};\n}\n\nexport function parseSearchKeys(\n documentAttributesForDisplay: string,\n): string[] {\n try {\n const parsedKeys = JSON.parse(documentAttributesForDisplay);\n if (\n Array.isArray(parsedKeys) &&\n parsedKeys.every((key) => typeof key === 'string')\n ) {\n return parsedKeys;\n }\n console.warn(\n 'searchKeys must be a JSON array of strings. Defaulting to an empty array.',\n );\n return [];\n } catch (error) {\n console.error('Failed to parse searchKeys:', error);\n return [];\n }\n}\n\nexport function extractDynamicProperties(\n document: Record<string, string | number>,\n keys: string[],\n) {\n const extractedProperties: Record<string, string | number> = {};\n keys.forEach((key) => {\n extractedProperties[key] = document[key] || '';\n });\n return extractedProperties;\n}\n\nexport function serializeStyles(\n styles: Record<string, Record<string, string>>,\n): string {\n try {\n return JSON.stringify(styles);\n } catch (error) {\n console.error('Error serializing styles:', error);\n return '{}';\n }\n}\n\nexport function getFormattedTimeFromNow(timestamp: string): string {\n const now = new Date();\n const inputTime = new Date(timestamp);\n const diffInSeconds = Math.floor(\n (now.getTime() - inputTime.getTime()) / 1000,\n );\n\n const minutes = Math.floor(diffInSeconds / 60);\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n const years = Math.floor(days / 365);\n\n if (minutes < 60) {\n return `${minutes}m ago`;\n }\n if (hours < 24) {\n return `${hours}h ago`;\n }\n if (days < 365) {\n return `${days}d ago`;\n }\n return `${years}y ago`;\n}\n"],"version":3}
@@ -1,2 +0,0 @@
1
- import{r as t,c as i,h as e,F as n}from"./p-0880cfbb.js";import{u as s,g as r}from"./p-cd489e98.js";import{p as o,a,s as h,e as c,g as l}from"./p-ff6c3650.js";import{c as p}from"./p-5cdc6210.js";const d=":root{--font-stack:Helvetica, Arial, sans-serif}.formLTR{font-family:var(--font-stack);text-align:left;width:100%}.formRTL{font-family:var(--font-stack);text-align:right;width:100%}";const f=d;const g=class{constructor(e){t(this,e);this.inputClearedOrNoResults=i(this,"inputClearedOrNoResults",7);this.querySubmit=i(this,"querySubmit",7);this.debounceTimeout=null;this.debounceDelay=0;this.searchStore=s.getState();this.handleInputChange=t=>{this.query=t.detail;this.searchStore.setQuery(this.query);this.querySubmit.emit(this.query)};this.handleInputKeyUp=t=>{const i=t.detail;this.query=i;this.searchStore.setQuery(this.query);this.querySubmit.emit(this.query);if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.debounceTimeout=setTimeout((()=>{this.query.trim()!==""&&this.runSearch()}),this.debounceDelay)};this.handleClearInput=()=>{this.query="";this.searchStore.setQuery("");if(typeof this.clearInput==="function"){this.clearInput()}if(this.debounceTimeout){clearTimeout(this.debounceTimeout)}this.error=false;this.inputClearedOrNoResults.emit()};this.runSearch=async()=>{if(this.query.trim()===""){this.error=true;this.inputClearedOrNoResults.emit()}else{this.error=false;this.searchStore.setQuery(this.query);try{await this.searchStore.search()}catch(t){this.error=true;this.inputClearedOrNoResults.emit()}}};this.handleFormSubmit=async t=>{t.preventDefault();await this.runSearch()};this.autoSearchFormClass="";this.clearInput=()=>{};this.config={apiKey:"",endpointURL:"",index:[]};this.customStylesForInput={};this.inputCaptionValue="";this.inputIconHeight=20;this.inputIconWidth=20;this.labelForInput="";this.placeholderValue="Search here";this.rightToLeftOrientation=false;this.searchContainerClass="";this.error=false;this.isRequesting=false;this.query="";this.searchResults=null}componentDidLoad(){const t=new r(this.config);this.searchStore.initialize(t,true);this.unsubscribe=s.subscribe((t=>{this.isRequesting=t.isRequesting;this.searchResults=Object.assign({},t.searchResults)}))}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}render(){var t,i,n;const s=this.rightToLeftOrientation?"formRTL":"formLTR";const r=o(this.customStylesForInput);if(this.query.length>0&&((n=(i=(t=this.searchResults)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.hits)===null||n===void 0?void 0:n.length)===0){this.inputClearedOrNoResults.emit()}return e("form",{key:"1ecc90be4b39c7fbfff4a3c89c319343f6478a1e",class:`${s}`,onSubmit:this.handleFormSubmit},e("searchcraft-input-label",{key:"82ee01912536de6a11e20f7df533856a41ebc343",label:this.labelForInput}),e("searchcraft-input",{key:"ad00322933a20db2865cd79241056f7b0ee84a15",customStyles:r,"input-caption-value":this.inputCaptionValue,"input-icon-height":this.inputIconHeight,"input-icon-width":this.inputIconWidth,"is-requesting":this.isRequesting,onClearInput:this.handleClearInput,onInputKeyUp:this.handleInputKeyUp,onSearchInputChange:this.handleInputChange,"placeholder-value":this.placeholderValue,query:this.query,"right-to-left-orientation":this.rightToLeftOrientation}),this.error&&e("searchcraft-error-message",{key:"588a134a1130d3c4e4fc921b09450268057b8217",errorMessage:"Please enter a search query."}))}};g.style=f;const u='@charset "UTF-8";:root{--font-stack:Helvetica, Arial, sans-serif}.interactiveResultContainerLight{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#FAFAFA}@media (min-width: 600px){.interactiveResultContainerLight{flex-direction:row}}.interactiveResultContainerDark{align-items:flex-start;border-radius:16px;display:flex;flex-direction:column;gap:16px;padding:8px;position:relative;background-color:#2E2E2E}@media (min-width: 600px){.interactiveResultContainerDark{flex-direction:row}}.resultContainer{align-items:flex-start;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.resultContainer{flex-direction:row}}.interactiveIconLarge{display:inline-block;position:absolute;right:5px;top:8px}@media (max-width: 600px){.interactiveIconLarge{display:none}}.interactiveIconSmall{display:inline-block;position:absolute;right:5px;top:-2px}@media (min-width: 600px){.interactiveIconSmall{display:none}}.imageContainer{max-width:100%}.contentContainer{max-height:100%;max-width:100%}@media (min-width: 600px){.contentContainer{max-width:50%}}.secondaryContentContainer{display:flex}.imageLight{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #D9D9D9}.imageDark{aspect-ratio:2/1;border-radius:8px;max-height:100%;max-width:100%;border:1px solid #333}.headingLight{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;color:#292929}.headingDark{font-family:var(--font-stack);font-size:16px;font-weight:700;line-height:20px;margin-bottom:4px;margin-top:0;position:relative;color:#FFF}.subheadingLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#737373}.subheadingDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px;margin-top:0px;color:#BFBFBF}.primaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.primaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.secondaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.secondaryContentLight::after{content:"•";color:#404040;font-size:1em;margin-left:5px;margin-right:5px}.secondaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}.tertiaryContentLight{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#404040}.tertiaryContentDark{font-family:var(--font-stack);font-size:16px;font-weight:400;line-height:20px;margin-bottom:4px;margin-top:0px;color:#E6E6E6}';const x=u;const b=class{constructor(e){t(this,e);this.buttonCallback=i(this,"buttonCallback",7);this.keyDownCallback=i(this,"keyDownCallback",7);this.resultCallback=i(this,"resultCallback",7);this.buttonCallback=()=>{};this.keyDownCallback=()=>{};this.resultCallback=()=>{};this.handleButtonClick=()=>{this.buttonCallback()};this.handleContainerClick=()=>{if(this.isInteractive){this.resultCallback()}};this.buttonText="";this.customStyles="{}";this.headingText="";this.imageDescription="";this.imageSource="";this.isInteractive=false;this.primaryContent="";this.secondaryContent="";this.subheadingText="";this.tertiaryContent="";this.themeMode="light"}parseStyles(){try{return JSON.parse(this.customStyles)}catch(t){console.error("Error parsing custom styles:",t);return{}}}render(){const t=this.themeMode==="light";const i=this.parseStyles();return e("div",{key:"91cfc671b0b99082915df3eaafa053a9a7f77929",class:this.isInteractive?t?"interactiveResultContainerLight":"interactiveResultContainerDark":"resultContainer",onKeyDown:this.keyDownCallback,onClick:this.handleContainerClick,style:i.container||{},tabindex:"0"},e("div",{key:"ccda236ef60aee285472155889c5490c69a86415",class:"imageContainer"},e("img",{key:"e55d743952e2997d91f6486436e3a7955ffc1dcc",alt:this.imageDescription,class:t?"imageLight":"imageDark",src:this.imageSource,style:i.image||{}})),e("div",{key:"b0e831c0c7bfef46b8b6da4e84536adf3ebd7158",class:"contentContainer"},e("h2",{key:"54137612623a39d711f4e3c888bf2015b6fb9500",class:t?"headingLight":"headingDark",style:i.heading||{}},this.headingText),e("h3",{key:"de46df990be3d0b5d2134d272e1766e911ab094a",class:t?"subheadingLight":"subheadingDark",style:i.subheading||{}},this.subheadingText),e("p",{key:"d9e7656bc739b0dd2267f86ac51b17d9ca16da6a",class:t?"primaryContentLight":"primaryContentDark",style:i.primaryContent||{}},this.primaryContent),e("div",{key:"d05813b3da29b8b21c2e370db9c0cbc7b48b9556",class:"secondaryContentContainer"},e("p",{key:"e8d2ede937705a5bd88927779ee24e35ba2efbd8",class:t?"secondaryContentLight":"secondaryContentDark",style:i.secondaryContent||{}},this.secondaryContent),e("p",{key:"2f9b9f603d55bcefe8347675cb31f705b1f7a0e8",class:t?"tertiaryContentLight":"tertiaryContentDark",style:i.tertiaryContent||{}},this.tertiaryContent)),this.buttonText&&e("button",{key:"58724046c9704974cb3ae1c34335ebb7131b91ab",onClick:this.handleButtonClick,style:i.button||{},type:"button"},this.buttonText)))}};b.style=x;const m=":root{--font-stack:Helvetica, Arial, sans-serif}.resultsContainer{display:flex;flex-direction:column;justify-content:center;margin:16px 0}.resultsContainer>p{align-self:center}.resultsContainer>div{margin-bottom:20px}.resultsContainer>div img{height:300px;width:200px}.adSection{align-items:center;background-color:#F1F1F1;border:1px solid #DCDDDE;border-radius:16px;display:flex;flex-direction:column;font-size:16px;justify-content:center;margin:auto;min-height:150px;text-align:center;width:100%}.adSection p{margin-top:5px}.emptyState{text-align:center;width:100%}.errorMessageContainer{text-align:center}";const k=m;const y=class{constructor(i){t(this,i);this.adInterval=4;this.customStylesForResults={};this.documentAttributesForDisplay="";this.fallbackElement=null;this.formatTime=true;this.placeAdAtEnd=false;this.placeAdAtStart=true;this.hasSearched=false;this.query="";this.searchResults=null}componentDidLoad(){if(!this.documentAttributesForDisplay||this.documentAttributesForDisplay.length===0){console.warn("No document attributes provided; using empty keys array.");this.documentAttributesForDisplay=""}this.unsubscribe=s.subscribe((t=>{if(t.query.length>0){this.hasSearched=true}else{this.hasSearched=false}this.searchResults=Object.assign({},t.searchResults);this.query=t.query}));const{searchResults:t,query:i}=s.getState();this.searchResults=t;this.query=i}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}render(){var t,i,n,s,r,o,p;if(!this.hasSearched){return e("div",{class:"emptyState"},e("slot",{name:"empty-search"}))}if(!((t=this.searchResults)===null||t===void 0?void 0:t.data)){console.warn("No search results data available");return e("div",{class:"emptyState"},"No results to display.")}const d=a(this.documentAttributesForDisplay);const f=typeof this.customStylesForResults==="string"?this.customStylesForResults:h(this.customStylesForResults);const g=(s=(n=(i=this.searchResults)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.hits)===null||s===void 0?void 0:s.map(((t,i)=>{const{doc:n}=t;const s=c(n,d);if(this.formatTime){for(const t of d){if(s[t]){const i=s[t];if(typeof i==="string"&&!Number.isNaN(Date.parse(i))){s[t]=l(i)}}}}return e("searchcraft-base-search-result",{"button-callback":()=>console.log("button callback"),"custom-styles":f,"image-source":s[d[d.length-1]],"is-interactive":true,key:`${t.document_id}-${i}`,"keydown-callback":()=>console.log("keydown"),"heading-text":s[d[0]],"primary-content":s[d[2]],"result-callback":()=>console.log("interactive element"),"secondary-content":s[d[3]],"subheading-text":s[d[1]],"tertiary-content":s[d[4]]})}));const u=[];if(this.placeAdAtStart){u.push(e("div",{key:"ad-section-start",class:"adSection"},e("span",null,"##"),e("p",null," Ad Impressions")))}if(this.adInterval>0){g.forEach(((t,i)=>{u.push(t);if((i+1)%this.adInterval===0){u.push(e("div",{key:`ad-section-${i+1}`,class:"adSection"},e("span",null,"##"),e("p",null," Ad Impressions")))}}))}else{u.push(...g)}if(this.placeAdAtEnd){u.push(e("div",{key:"ad-section-end",class:"adSection"},e("span",null,"##"),e("p",null," Ad Impressions")))}return e("div",{class:"resultsContainer"},u,this.query.length>0&&((p=(o=(r=this.searchResults)===null||r===void 0?void 0:r.data)===null||o===void 0?void 0:o.hits)===null||p===void 0?void 0:p.length)===0&&e("div",{class:"errorMessageContainer"},e("searchcraft-error-message",{"error-message":`No search results found for "${this.query}" query`})))}};y.style=k;const v=class{constructor(i){t(this,i);this.type="clear-light"}render(){switch(this.type){case"clear-light":return e("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Clear Input Icon Light"),e("path",{d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"clear-dark":return e("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Clear Input Icon Dark"),e("path",{d:"M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"arrow-light":return e("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Arrow Right Icon Light"),e("path",{d:"M7.5 15.0444L12.5 10.0444L7.5 5.04443",stroke:"#737373","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"arrow-dark":return e("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"icon-title"},e("title",{id:"icon-title"},"Searchcraft Arrow Right Icon Dark"),e("path",{d:"M1.5 11L6.5 6L1.5 1",stroke:"#BFBFBF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));default:return null}}};const L=":root{--font-stack:Helvetica, Arial, sans-serif}.inputClearButtonLTR{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;padding:0;position:absolute;right:0;top:50%;transform:translateY(-50%);width:20px}.inputClearButtonRTL{align-items:center;background:none;border:none;display:flex;height:20px;justify-content:center;left:0px;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:20px}";const w=L;const C=class{constructor(e){t(this,e);this.clearInput=i(this,"clearInput",7);this.handleClearClick=t=>{t.preventDefault();this.clearInput.emit()};this.isRequesting=false;this.rightToLeftOrientation=false;this.theme="light"}isLightTheme(){return this.theme==="light"}render(){return this.rightToLeftOrientation?e("button",{class:p("inputClearButtonRTL",".sc-clear-input-button-rtl"),onClick:this.handleClearClick,type:"button"},this.isRequesting?this.isLightTheme?e("searchcraft-spinner-light",null):e("searchcraft-spinner-dark",null):this.isLightTheme?e("searchcraft-clear-icon-set",{type:"clear-light"}):e("searchcraft-clear-icon-set",{type:"clear-dark"})):e("button",{class:p("inputClearButtonLTR",".sc-clear-input-button-ltr"),onClick:this.handleClearClick,type:"button"},this.isRequesting?this.isLightTheme?e("searchcraft-spinner-light",null):e("searchcraft-spinner-dark",null):this.isLightTheme?e("searchcraft-clear-icon-set",{type:"clear-light"}):e("searchcraft-clear-icon-set",{type:"clear-dark"}))}};C.style=w;const F=":root{--font-stack:Helvetica, Arial, sans-serif}.errorMessageLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.errorMessageDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}";const D=F;const T=class{constructor(i){t(this,i);this.errorMessage=undefined;this.theme="light"}render(){const t=this.theme==="light"?"errorMessageLight":"errorMessageDark";return e("p",{key:"544903d700810ed5d6efdefedab646cafed2376d",class:p(t)},this.errorMessage||"Search term is required.")}};T.style=D;const R='@charset "UTF-8";.filtersList{width:100%}.checkboxLabel{align-items:center;color:#292929;display:flex;font-family:"Source Sans Pro";font-size:14px;font-weight:600;gap:14px}.checkboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EDEDED;border:1px solid #D9D9D9;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.checkboxLabel input[type=checkbox]:checked{background-color:#000}.checkboxLabel input[type=checkbox]:checked::before{color:#fff;content:"✔"}.remainingFilterListCheckbox{margin-left:16px}.childCheckboxLabel{align-items:center;color:#292929;display:flex;font-family:"Source Sans Pro";font-size:14px;font-weight:600;gap:12px}.childCheckboxLabel input[type=checkbox]{align-items:center;appearance:none;background-color:#EDEDED;border:1px solid #D9D9D9;cursor:pointer;display:flex;height:24px;justify-content:center;width:24px}.childCheckboxLabel input[type=checkbox]:checked{background-color:#000}.childCheckboxLabel input[type=checkbox]:checked::before{color:#fff;content:"✔"}';const E=R;const B=class{constructor(e){t(this,e);this.filtersUpdated=i(this,"filtersUpdated",7);this.searchStore=s.getState();this.handleFilterChange=(t,i)=>{if(i){this.selectedFilters.add(t)}else{this.selectedFilters.delete(t)}const e=Array.from(this.selectedFilters);this.filtersUpdated.emit(e);this.searchStore.setSelectedFilters(e);this.searchStore.search()};this.filters=[];this.dynamicFilters=[];this.initialFilters=[];this.isRequesting=false;this.originalFilterCounts={};this.query="";this.resultsCount=0;this.selectedFilters=new Set}connectedCallback(){this.unsubscribe=s.subscribe((t=>{var i,e,n,s;this.isRequesting=t.isRequesting;this.query=t.query||"";this.resultsCount=((n=(e=(i=t.searchResults)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.hits)===null||n===void 0?void 0:n.length)||0;const r=(s=t.searchResults)===null||s===void 0?void 0:s.data.facets;if(r){this.populateFiltersFromFacets(r)}}))}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}populateFiltersFromFacets(t){var i;const e=Object.entries(((i=t.section)===null||i===void 0?void 0:i.counts)||{}).map((([t,i])=>{const e=t;this.originalFilterCounts[e]=`${i}`;return{label:`${t.replace(/^\//,"")} (${i})`,value:e}}));const n=[...this.initialFilters,...e.filter((t=>!this.initialFilters.some((i=>i.value===t.value))))];this.dynamicFilters=n;if(this.initialFilters.length===0){this.initialFilters=[...n]}}formatLabel(t){return t.replace(/-/g," ").split(" ").map((t=>t.charAt(0).toUpperCase()+t.slice(1))).join(" ")}render(){if(!this.query||this.resultsCount===0){return null}const t=this.initialFilters.map((t=>{const i=this.selectedFilters.has(t.value);const e=this.dynamicFilters.filter((i=>i.value.startsWith(t.value)&&i.value!==t.value));return Object.assign(Object.assign({},t),{isChecked:i,children:e})}));return e("div",{class:"filtersList"},t.map((t=>e("div",{key:t.value},e("label",{class:"checkboxLabel"},e("input",{class:"filterCheckbox",checked:t.isChecked,onChange:i=>this.handleFilterChange(t.value,i.target.checked),type:"checkbox",value:t.value}),this.formatLabel(t.label)),t.isChecked&&t.children.map((t=>{const i=t.label.split("/").pop();return e("label",{class:"childCheckboxLabel",key:t.value,style:{marginLeft:"20px"}},e("input",{class:"childFilterCheckbox",checked:this.selectedFilters.has(t.value),onChange:i=>this.handleFilterChange(t.value,i.target.checked),type:"checkbox",value:t.value}),this.formatLabel(i||""))}))))))}};B.style=E;const S=":root{--font-stack:Helvetica, Arial, sans-serif}.inputContainerLTR{position:relative;width:100%}.inputContainerRTL{position:relative;width:100%;margin-left:8px}.inputLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;margin-right:8px;padding-left:36px;padding-right:16px}.inputLightLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputLightLTR::placeholder{color:#737373}.inputLightLTR:focus{outline:2px solid #000}.inputDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-right:8px;padding-left:36px;padding-right:16px}.inputDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputDarkLTR::placeholder{color:#BFBFBF}.inputDarkLTR:focus{outline:2px solid #FFF}.inputErrorLightLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorLightLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorLightLTR::placeholder{color:#737373}.inputErrorLightLTR:focus{outline:2px solid #000}.inputErrorLightLTR:focus-visible{outline:2px solid #c00}.inputErrorDarkLTR{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;outline:2px solid #FFB3B3;margin-right:8px;padding-left:36px;padding-right:16px}.inputErrorDarkLTR::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorDarkLTR::placeholder{color:#BFBFBF}.inputErrorDarkLTR:focus{outline:2px solid #FFF}.inputErrorDarkLTR:focus-visible{outline:2px solid #FFB3B3}.inputLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputLightRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputLightRTL::placeholder{color:#737373}.inputLightRTL:focus{outline:2px solid #000}.inputDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputDarkRTL::placeholder{color:#BFBFBF}.inputDarkRTL:focus{outline:2px solid #FFF}.inputErrorLightRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#EDEDED;color:#292929;outline:2px solid #c00;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorLightRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorLightRTL::placeholder{color:#737373}.inputErrorLightRTL:focus{outline:2px solid #000}.inputErrorLightRTL:focus-visible{outline:2px solid #c00}.inputErrorDarkRTL{border:none;border-radius:8px;font-family:var(--font-stack);outline:none;padding-bottom:15px;padding-top:15px;width:100%;background-color:#1A1A1A;color:#FFF;outline:2px solid #FFB3B3;margin-left:8px;padding-left:16px;padding-right:36px;text-align:right}.inputErrorDarkRTL::placeholder{font-family:var(--font-stack);font-size:16px}.inputErrorDarkRTL::placeholder{color:#BFBFBF}.inputErrorDarkRTL:focus{outline:2px solid #FFF}.inputErrorDarkRTL:focus-visible{outline:2px solid #FFB3B3}.inputWrapper{align-items:center;display:flex;position:relative;width:100%}";const z=S;const I=class{constructor(e){t(this,e);this.clearInput=i(this,"clearInput",7);this.searchInputChange=i(this,"searchInputChange",7);this.inputKeyUp=i(this,"inputKeyUp",7);this.customStyles={};this.error=false;this.formClassName="";this.inputCaptionClassName="";this.inputCaptionValue="";this.inputClassName="";this.inputIconHeight=20;this.inputIconWidth=20;this.isRequesting=false;this.placeholderValue="Enter Search";this.rightToLeftOrientation=false;this.query="";this.theme="light"}get isLightTheme(){return this.theme==="light"}handleInputChange(t){const i=t.target;this.searchInputChange.emit(i.value)}handleInputKeyUp(t){const i=t.target;this.inputKeyUp.emit(i.value)}handleClearInput(){if(this.clearInput){this.clearInput.emit()}}render(){const t=this.rightToLeftOrientation?"inputContainerRTL":"inputContainerLTR";const i=p(this.error?this.isLightTheme?"inputErrorLightRTL":"inputErrorDarkRTL":this.isLightTheme?"inputLightLTR":"inputDarkLTR","searchcraft-input");const s=o(this.customStyles);const r={fontSize:s.placeholderFontSize||"16px"};return e("div",{key:"ca2698b808ef606d890817f6b8c133503663570e",class:p(t,this.formClassName,"searchcraft-input-form")},this.rightToLeftOrientation?e(n,null,e("input",{autoComplete:"off",class:p(i,"searchcraft-input"),id:"searchcraft-input-id",onChange:this.handleInputChange.bind(this),onKeyUp:this.handleInputKeyUp.bind(this),placeholder:this.placeholderValue,type:"text",value:this.query,style:s}),e("style",null,`\n #searchcraft-input-id::placeholder {\n font-size: ${r.fontSize};\n }\n `),this.inputCaptionValue&&e("searchcraft-input-caption",{inputCaptionClassName:this.inputCaptionClassName,inputCaptionValue:this.inputCaptionValue,rightToLeftOrientation:this.rightToLeftOrientation}),this.query.length>0&&e("searchcraft-clear-input-button",{isRequesting:this.isRequesting,onClearInput:this.handleClearInput,rightToLeftOrientation:this.rightToLeftOrientation}),e("searchcraft-input-icon",{error:this.error,height:this.inputIconHeight,rightToLeftOrientation:this.rightToLeftOrientation,width:this.inputIconWidth})):e(n,null,e("searchcraft-input-icon",{error:this.error,height:this.inputIconHeight,rightToLeftOrientation:this.rightToLeftOrientation,width:this.inputIconWidth}),e("input",{autoComplete:"off",class:p(i,"searchcraft-input"),id:"searchcraft-input-id",onChange:this.handleInputChange.bind(this),onKeyUp:this.handleInputKeyUp.bind(this),placeholder:this.placeholderValue,type:"text",value:this.query,style:s}),e("style",null,`\n #searchcraft-input-id::placeholder {\n font-size: ${r.fontSize};\n }\n `),this.inputCaptionValue&&e("searchcraft-input-caption",{inputCaptionClassName:this.inputCaptionClassName,inputCaptionValue:this.inputCaptionValue,rightToLeftOrientation:this.rightToLeftOrientation}),this.query.length>0&&e("searchcraft-clear-input-button",{isRequesting:this.isRequesting,onClearInput:this.handleClearInput,rightToLeftOrientation:this.rightToLeftOrientation})))}};I.style=z;const _=":root{--font-stack:Helvetica, Arial, sans-serif}.inputCaptionLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040}.inputCaptionDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6}.inputCaptionErrorLightLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000}.inputCaptionErrorDarkLTR{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3}.inputCaptionLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#404040;text-align:right}.inputCaptionDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#E6E6E6;text-align:right}.inputCaptionErrorLightRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#990000;text-align:right}.inputCaptionErrorDarkRTL{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFB3B3;text-align:right}";const A=_;const j=class{constructor(i){t(this,i);this.error=undefined;this.inputCaptionClassName="";this.inputCaptionValue="Enter Search";this.rightToLeftOrientation=false;this.theme="light"}isLightTheme(){return this.theme==="light"}render(){return this.rightToLeftOrientation?e("p",{class:p(this.error?this.isLightTheme?"inputCaptionErrorLightRTL":"inputCaptionErrorDarkRTL":this.isLightTheme?"inputCaptionLightRTL":"inputCaptionDarkRTL",this.inputCaptionClassName,".searchcraft-input-caption")},this.inputCaptionValue):e("p",{class:p(this.error?this.isLightTheme?"inputCaptionErrorLightLTR":"inputCaptionErrorDarkLTR":this.isLightTheme?"inputCaptionLightLTR":"inputCaptionDarkLTR",this.inputCaptionClassName,".searchcraft-input-caption")},this.inputCaptionValue)}};j.style=A;const M=":root{--font-stack:Helvetica, Arial, sans-serif}.inputIconLTR{left:15px;position:absolute;top:50%;transform:translateY(-50%)}.inputIconRTL{position:absolute;right:15px;top:50%;transform:translateY(-50%)}";const $=M;const O=class{constructor(i){t(this,i);this.error=undefined;this.height=20;this.rightToLeftOrientation=false;this.width=20;this.theme="light"}isLightTheme(){return this.theme==="light"}render(){return this.error?e("div",{class:this.rightToLeftOrientation?"inputIconRTL":"inputIconLTR"},this.isLightTheme()?e("searchcraft-search-icon-set",{height:this.height,type:"error-light",width:this.width}):e("searchcraft-search-icon-set",{height:this.height,type:"error-dark",width:this.width})):e("div",{class:this.rightToLeftOrientation?"inputIconRTL":"inputIconLTR"},this.isLightTheme()?e("searchcraft-search-icon-set",{height:this.height,type:"search-light",width:this.width}):e("searchcraft-search-icon-set",{height:this.height,type:"search-dark",width:this.width}))}};O.style=$;const N=":root{--font-stack:Helvetica, Arial, sans-serif}.labelLight{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#292929}.labelDark{font-family:var(--font-stack);font-size:12px;font-weight:400;line-height:16px;margin-top:4px;color:#FFF}";const q=N;const H=class{constructor(i){t(this,i);this.inputLabelClassName="";this.label=undefined;this.theme="light"}isLightTheme(){return this.theme==="light"}render(){if(!this.label){return null}const t=this.isLightTheme()?"labelLight":"labelDark";return e("label",{class:p(t,this.inputLabelClassName),htmlFor:"searchcraft-input-id"},this.label)}};H.style=q;const U=".container{border-bottom:1px solid #D9D9D9;display:flex;justify-content:flex-start;width:100%}.resultsInfo{color:#292929;font-size:18px;font-weight:600;line-height:20px;margin:0;margin-bottom:8px}";const K=U;const Z=class{constructor(i){t(this,i);this.isRequesting=false;this.resultsCount=0;this.responseTime="";this.query=""}connectedCallback(){this.unsubscribe=s.subscribe((t=>{var i,e,n,s;this.isRequesting=t.isRequesting;this.resultsCount=((e=(i=t.searchResults)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.count)||0;this.responseTime=((((s=(n=t.searchResults)===null||n===void 0?void 0:n.data)===null||s===void 0?void 0:s.time_taken)||0)*1e3).toFixed(2);this.query=t.query||""}))}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}render(){if(!this.query||this.resultsCount===0){return null}return e("div",{class:"container"},e("p",{class:"resultsInfo"},this.resultsCount," results found in ",this.responseTime,"ms"))}};Z.style=K;const Y=class{constructor(i){t(this,i);this.type="search-dark";this.width=20;this.height=20}render(){const{width:t,height:i}=this;switch(this.type){case"search-light":return e("svg",{width:t,height:i,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},e("title",{id:"searchcraft-title"},"Searchcraft Search Icon Light"),e("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#404040","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"search-dark":return e("svg",{width:t,height:i,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},e("title",{id:"searchcraft-title"},"Searchcraft Search Icon Dark"),e("path",{d:"M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",stroke:"#E6E6E6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"error-light":return e("svg",{width:t,height:i,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},e("title",{id:"searchcraft-title"},"Searchcraft Error Search Icon Light"),e("path",{d:"M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z",stroke:"#737373","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));case"error-dark":return e("svg",{width:t,height:i,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"searchcraft-title"},e("title",{id:"searchcraft-title"},"Searchcraft Error Search Icon Dark"),e("path",{d:"M16.5 16.5L12.875 12.875M14.8333 8.16667C14.8333 11.8486 11.8486 14.8333 8.16667 14.8333C4.48477 14.8333 1.5 11.8486 1.5 8.16667C1.5 4.48477 4.48477 1.5 8.16667 1.5C11.8486 1.5 14.8333 4.48477 14.8333 8.16667Z",stroke:"#BFBFBF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));default:return null}}};const P='.sliderContainer{display:flex;flex-direction:column;gap:10px;font-family:Arial, sans-serif;align-items:center;width:100%}.rangeContainer{display:flex;position:relative;width:100%;align-items:center}.rangeContainer .activeRange{position:absolute;top:50%;transform:translateY(-50%);height:4px;background:#007DB3;z-index:0;border-radius:2px}.rangeContainer .rangeSlider{width:100%;height:4px;background:transparent;border-radius:2px;outline:none;-webkit-appearance:none;appearance:none;position:absolute;margin:0}.rangeContainer .rangeSlider::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;background-color:#FFF;border-radius:50%;border:2px solid #e6e6e6;cursor:pointer}.rangeContainer .rangeSlider::-moz-range-thumb{width:20px;height:20px;background-color:#FFF;border-radius:50%;border:2px solid #e6e6e6;cursor:pointer}.yearLabels{display:flex;justify-content:space-between;width:100%;margin-top:10px;font-size:15px;font-weight:600;font-family:"Source Sans Pro", sans-serif;color:#666}.yearLabel{min-width:30px;text-align:center}';const V=P;const J=class{constructor(i){t(this,i);this.searchStore=s.getState();this.updateYears=async()=>{this.searchStore.setYearsRange([this.startYear,this.endYear]);try{if(typeof this.query==="string"&&this.query.trim()!==""){await this.searchStore.search()}else{console.warn("Query is missing or empty, skipping search request.")}}catch(t){console.error("Search failed:",t)}};this.handleStartYearChange=t=>{const i=Number.parseInt(t.target.value,10);this.startYear=Math.min(i,this.endYear);this.updateYears()};this.handleEndYearChange=t=>{const i=Number.parseInt(t.target.value,10);this.endYear=Math.max(i,this.startYear);this.updateYears()};this.maxYear=(new Date).getFullYear();this.minYear=2014;this.endYear=this.maxYear;this.hasSearched=false;this.query="";this.resultsCount=0;this.startYear=this.minYear}componentDidLoad(){this.unsubscribe=s.subscribe((t=>{var i,e,n;if(t.query.length>0){this.hasSearched=true;this.resultsCount=((n=(e=(i=t.searchResults)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.hits)===null||n===void 0?void 0:n.length)||0}this.query=t.query}))}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}render(){if(!this.query||this.resultsCount===0){return null}const t=this.minYear;const i=this.maxYear;const n=(this.startYear-t)/(i-t)*100;const s=(this.endYear-t)/(i-t)*100;return e("div",{class:"sliderContainer"},e("div",{class:"rangeContainer"},e("div",{class:"activeRange",style:{left:`${n}%`,width:`${s-n}%`}}),e("input",{class:"rangeSlider",max:this.maxYear,min:this.minYear,onInput:this.handleStartYearChange,step:"1",type:"range",value:this.startYear}),e("input",{class:"rangeSlider",max:this.maxYear,min:this.minYear,onInput:this.handleEndYearChange,step:"1",type:"range",value:this.endYear})),e("div",{class:"yearLabels"},e("span",{class:"yearLabel"},this.startYear),e("span",{class:"yearLabel"},this.endYear)))}};J.style=V;const Q=".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerDark{animation:spinning 1s linear infinite;background:conic-gradient(#000 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}.spinnerLight{animation:spinning 1s linear infinite;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";const W=Q;const X=class{constructor(i){t(this,i)}render(){return e("div",{key:"60b629930c2e2795236f6768b40c95ce9390e882",class:"spinnerContainer"},e("div",{key:"bfef3329f2e81ecf6538738ac0213da6259dd1c3",class:"spinnerDark"}))}};X.style=W;const G=".spinnerContainer{background-color:transparent;height:20px;width:20px}.spinnerLight{animation:spinning 1s linear infinite;background:conic-gradient(#737373 50%, #FFFFFF);clip-path:circle(50%);height:100%;mask-image:radial-gradient(circle at center, rgba(0, 0, 0, 0) 6.6666666667px, rgb(0, 0, 0) 6.6666666667px);width:100%}@keyframes spinning{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}";const tt=G;const it=class{constructor(i){t(this,i)}render(){return e("div",{key:"ad5224c97faf7e329d2a8904488c17dfd7414b9e",class:"spinnerContainer"},e("div",{key:"6336ce7737af65eedac46ee290b20291ce5b6096",class:"spinnerLight"}))}};it.style=tt;const et=".toggle-wrapper{background:#ddd;border:none;border-radius:16px;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05);cursor:pointer;height:26px;margin-left:10px;position:relative;width:44px}.toggle-wrapper.active{background:#007DB3;box-shadow:0px 0px 0px 1px rgba(0, 0, 0, 0.05)}.toggle-wrapper .toggle-switch{background:#fff;border-radius:50%;height:18px;left:4px;position:absolute;top:calc(50% - 9px);transition:transform 0.3s ease;width:18px}.toggle-wrapper .toggle-switch.active{transform:translateX(16px)}";const nt=et;const st=class{constructor(i){t(this,i);this.searchStore=s.getState();this.handleToggle=async()=>{this.isActive=!this.isActive;if(this.type==="mode"){const t=this.isActive?"normal":"fuzzy";this.searchStore.setSearchParams({mode:t})}else if(this.type==="sort"){const t=this.isActive?"desc":"asc";this.searchStore.setSearchParams({sort:t})}try{await this.searchStore.search()}catch(t){console.error("Search failed:",t)}};this.type="mode";this.isActive=false;this.query="";this.resultsCount=0}componentDidLoad(){this.unsubscribe=s.subscribe((t=>{var i,e,n;this.query=t.query||"";this.resultsCount=((n=(e=(i=t.searchResults)===null||i===void 0?void 0:i.data)===null||e===void 0?void 0:e.hits)===null||n===void 0?void 0:n.length)||0}))}disconnectedCallback(){if(this.unsubscribe){this.unsubscribe()}}render(){if(!this.query||this.resultsCount===0){return null}return e("button",{class:`toggle-wrapper ${this.isActive?"active":""}`,onClick:this.handleToggle,type:"button"},e("div",{class:`toggle-switch ${this.isActive?"active":""}`}))}};st.style=nt;export{g as searchcraft_auto_search_form,b as searchcraft_base_search_result,y as searchcraft_base_search_results,v as searchcraft_clear_icon_set,C as searchcraft_clear_input_button,T as searchcraft_error_message,B as searchcraft_filters_list,I as searchcraft_input,j as searchcraft_input_caption,O as searchcraft_input_icon,H as searchcraft_input_label,Z as searchcraft_results_info,Y as searchcraft_search_icon_set,J as searchcraft_slider,X as searchcraft_spinner_dark,it as searchcraft_spinner_light,st as searchcraft_toggle_button};
2
- //# sourceMappingURL=p-1a0e85ee.entry.js.map